@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.js
CHANGED
|
@@ -23,6 +23,7 @@ __export(index_exports, {
|
|
|
23
23
|
AUTH_PROVIDERS: () => AUTH_PROVIDERS,
|
|
24
24
|
BRIDGE_EVENTS: () => BRIDGE_EVENTS,
|
|
25
25
|
BRIDGE_METHODS: () => BRIDGE_METHODS,
|
|
26
|
+
COPILOT_CONTENT_METHOD_ALIASES: () => COPILOT_CONTENT_METHOD_ALIASES,
|
|
26
27
|
COPILOT_ERROR_CODES: () => COPILOT_ERROR_CODES,
|
|
27
28
|
DEFAULT_JSON_SORT_OPTIONS: () => DEFAULT_JSON_SORT_OPTIONS,
|
|
28
29
|
DEVICE_BINDING_STATES: () => DEVICE_BINDING_STATES,
|
|
@@ -67,6 +68,42 @@ __export(index_exports, {
|
|
|
67
68
|
isBridgeRequest: () => isBridgeRequest,
|
|
68
69
|
isBridgeResponse: () => isBridgeResponse,
|
|
69
70
|
isCliEnvelope: () => isCliEnvelope,
|
|
71
|
+
isCopilotContentAdoptUnmanagedParams: () => isCopilotContentAdoptUnmanagedParams,
|
|
72
|
+
isCopilotContentAdoptUnmanagedResult: () => isCopilotContentAdoptUnmanagedResult,
|
|
73
|
+
isCopilotContentApproveResult: () => isCopilotContentApproveResult,
|
|
74
|
+
isCopilotContentDetectUnmanagedParams: () => isCopilotContentDetectUnmanagedParams,
|
|
75
|
+
isCopilotContentDetectUnmanagedResult: () => isCopilotContentDetectUnmanagedResult,
|
|
76
|
+
isCopilotContentIntegrationStatusResult: () => isCopilotContentIntegrationStatusResult,
|
|
77
|
+
isCopilotContentMigrateLegacyResult: () => isCopilotContentMigrateLegacyResult,
|
|
78
|
+
isCopilotContentRestoreResult: () => isCopilotContentRestoreResult,
|
|
79
|
+
isCopilotContentStatusResult: () => isCopilotContentStatusResult,
|
|
80
|
+
isCopilotCustomizationViewPayload: () => isCopilotCustomizationViewPayload,
|
|
81
|
+
isCopilotCustomizationsListParams: () => isCopilotCustomizationsListParams,
|
|
82
|
+
isCopilotCustomizationsListResult: () => isCopilotCustomizationsListResult,
|
|
83
|
+
isCopilotLegacyMigrateParams: () => isCopilotLegacyMigrateParams,
|
|
84
|
+
isCopilotLegacyMigrateResult: () => isCopilotLegacyMigrateResult,
|
|
85
|
+
isCopilotLegacyPreviewParams: () => isCopilotLegacyPreviewParams,
|
|
86
|
+
isCopilotLegacyPreviewResult: () => isCopilotLegacyPreviewResult,
|
|
87
|
+
isCopilotPackageInstallParams: () => isCopilotPackageInstallParams,
|
|
88
|
+
isCopilotPackageInstallResult: () => isCopilotPackageInstallResult,
|
|
89
|
+
isCopilotPackageMoveParams: () => isCopilotPackageMoveParams,
|
|
90
|
+
isCopilotPackageMoveResult: () => isCopilotPackageMoveResult,
|
|
91
|
+
isCopilotPackageUninstallParams: () => isCopilotPackageUninstallParams,
|
|
92
|
+
isCopilotPackageUninstallResult: () => isCopilotPackageUninstallResult,
|
|
93
|
+
isCopilotPackageUpdateParams: () => isCopilotPackageUpdateParams,
|
|
94
|
+
isCopilotPackageUpdateResult: () => isCopilotPackageUpdateResult,
|
|
95
|
+
isCopilotPluginListParams: () => isCopilotPluginListParams,
|
|
96
|
+
isCopilotPluginListResult: () => isCopilotPluginListResult,
|
|
97
|
+
isCopilotPluginRegisterParams: () => isCopilotPluginRegisterParams,
|
|
98
|
+
isCopilotPluginRegisterResult: () => isCopilotPluginRegisterResult,
|
|
99
|
+
isCopilotPluginUnregisterParams: () => isCopilotPluginUnregisterParams,
|
|
100
|
+
isCopilotPluginUnregisterResult: () => isCopilotPluginUnregisterResult,
|
|
101
|
+
isCopilotSourceListParams: () => isCopilotSourceListParams,
|
|
102
|
+
isCopilotSourceListResult: () => isCopilotSourceListResult,
|
|
103
|
+
isCopilotSourceRemoveParams: () => isCopilotSourceRemoveParams,
|
|
104
|
+
isCopilotSourceRemoveResult: () => isCopilotSourceRemoveResult,
|
|
105
|
+
isCopilotUpdatePreviewParams: () => isCopilotUpdatePreviewParams,
|
|
106
|
+
isCopilotUpdatePreviewResult: () => isCopilotUpdatePreviewResult,
|
|
70
107
|
isDeviceBindingState: () => isDeviceBindingState,
|
|
71
108
|
isDeviceEnrollParams: () => isDeviceEnrollParams,
|
|
72
109
|
isDeviceEnrollResult: () => isDeviceEnrollResult,
|
|
@@ -84,6 +121,7 @@ __export(index_exports, {
|
|
|
84
121
|
isJsonSortOrder: () => isJsonSortOrder,
|
|
85
122
|
isJsonValidationResult: () => isJsonValidationResult,
|
|
86
123
|
isKnownEnvironmentTool: () => isKnownEnvironmentTool,
|
|
124
|
+
isRecord: () => isRecord4,
|
|
87
125
|
isRepoAddParams: () => isRepoAddParams,
|
|
88
126
|
isRepoAddResult: () => isRepoAddResult,
|
|
89
127
|
isRepoDisableParams: () => isRepoDisableParams,
|
|
@@ -138,6 +176,8 @@ __export(index_exports, {
|
|
|
138
176
|
isSkillRepoListLinkedResult: () => isSkillRepoListLinkedResult,
|
|
139
177
|
isSkillRepoListParams: () => isSkillRepoListParams,
|
|
140
178
|
isSkillRepoListResult: () => isSkillRepoListResult,
|
|
179
|
+
isSkillRepoSetEntryEnabledParams: () => isSkillRepoSetEntryEnabledParams,
|
|
180
|
+
isSkillRepoSetEntryEnabledResult: () => isSkillRepoSetEntryEnabledResult,
|
|
141
181
|
isSkillRepoUninstallParams: () => isSkillRepoUninstallParams,
|
|
142
182
|
isSkillRepoUninstallResult: () => isSkillRepoUninstallResult,
|
|
143
183
|
isSystemHelloResult: () => isSystemHelloResult,
|
|
@@ -165,6 +205,7 @@ __export(index_exports, {
|
|
|
165
205
|
isToolboxUpdateResult: () => isToolboxUpdateResult,
|
|
166
206
|
migrateTaskV1ToV2: () => migrateTaskV1ToV2,
|
|
167
207
|
migrateV1ToV2: () => migrateV1ToV2,
|
|
208
|
+
normalizeBridgeMethod: () => normalizeBridgeMethod,
|
|
168
209
|
normalizeServicemeError: () => normalizeServicemeError
|
|
169
210
|
});
|
|
170
211
|
module.exports = __toCommonJS(index_exports);
|
|
@@ -354,8 +395,206 @@ function isAuthSwitchResult(value) {
|
|
|
354
395
|
return true;
|
|
355
396
|
}
|
|
356
397
|
|
|
357
|
-
// src/bridge-
|
|
398
|
+
// src/bridge-copilot-customizations.ts
|
|
399
|
+
var PRIVATE_RESULT_KEYS = /* @__PURE__ */ new Set([
|
|
400
|
+
"sourcePath",
|
|
401
|
+
"configPath",
|
|
402
|
+
"token",
|
|
403
|
+
"secret",
|
|
404
|
+
"approvalPayload"
|
|
405
|
+
]);
|
|
406
|
+
var SCOPES = /* @__PURE__ */ new Set(["workspace", "personal"]);
|
|
407
|
+
var KINDS = /* @__PURE__ */ new Set(["agent", "skill", "prompt", "instruction", "mcp", "hook"]);
|
|
408
|
+
var INTENTS = /* @__PURE__ */ new Set(["available", "selected", "moving", "removing"]);
|
|
409
|
+
var HEALTH = /* @__PURE__ */ new Set([
|
|
410
|
+
"healthy",
|
|
411
|
+
"missing",
|
|
412
|
+
"drifted",
|
|
413
|
+
"conflict",
|
|
414
|
+
"source-unavailable",
|
|
415
|
+
"unsupported"
|
|
416
|
+
]);
|
|
417
|
+
var GATES = /* @__PURE__ */ new Set(["ready", "approval-required", "configuration-required"]);
|
|
418
|
+
var STATUSES = /* @__PURE__ */ new Set(["healthy", "action-required", "blocked", "not-enabled"]);
|
|
419
|
+
var SOURCE_TYPES = /* @__PURE__ */ new Set(["marketplace", "git", "local"]);
|
|
420
|
+
var UPDATE_CAPABILITIES = /* @__PURE__ */ new Set(["pinned", "live", "none"]);
|
|
358
421
|
function isRecord3(value) {
|
|
422
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
423
|
+
}
|
|
424
|
+
function isString(value) {
|
|
425
|
+
return typeof value === "string" && value.length > 0;
|
|
426
|
+
}
|
|
427
|
+
function isOptionalString(value) {
|
|
428
|
+
return value === void 0 || typeof value === "string";
|
|
429
|
+
}
|
|
430
|
+
function isStringArray2(value, allowEmpty = true) {
|
|
431
|
+
return Array.isArray(value) && (allowEmpty || value.length > 0) && value.every((entry) => isString(entry));
|
|
432
|
+
}
|
|
433
|
+
function hasPrivateResultKey(value) {
|
|
434
|
+
if (Array.isArray(value)) return value.some(hasPrivateResultKey);
|
|
435
|
+
if (!isRecord3(value)) return false;
|
|
436
|
+
return Object.entries(value).some(
|
|
437
|
+
([key, nested]) => PRIVATE_RESULT_KEYS.has(key) || hasPrivateResultKey(nested)
|
|
438
|
+
);
|
|
439
|
+
}
|
|
440
|
+
function isScope(value) {
|
|
441
|
+
return typeof value === "string" && SCOPES.has(value);
|
|
442
|
+
}
|
|
443
|
+
function hasOptionalWorkspaceDir(value) {
|
|
444
|
+
return value.workspaceDir === void 0 || isString(value.workspaceDir);
|
|
445
|
+
}
|
|
446
|
+
function hasRequiredWorkspaceDirForWorkspaceScope(value) {
|
|
447
|
+
return value.scope !== "workspace" || isString(value.workspaceDir);
|
|
448
|
+
}
|
|
449
|
+
function isArtifactState(value) {
|
|
450
|
+
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);
|
|
451
|
+
}
|
|
452
|
+
function isArtifactSummary(value) {
|
|
453
|
+
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");
|
|
454
|
+
}
|
|
455
|
+
function isInstallation(value) {
|
|
456
|
+
return isRecord3(value) && isString(value.packageId) && isScope(value.scope) && isStringArray2(value.selectedArtifactIds) && isOptionalString(value.pinnedVersion);
|
|
457
|
+
}
|
|
458
|
+
function isDefinition(value) {
|
|
459
|
+
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);
|
|
460
|
+
}
|
|
461
|
+
function isArtifactView(value) {
|
|
462
|
+
return isRecord3(value) && isArtifactSummary(value.artifact) && isArtifactState(value.state);
|
|
463
|
+
}
|
|
464
|
+
function isPackageView(value) {
|
|
465
|
+
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);
|
|
466
|
+
}
|
|
467
|
+
function isSourceView(value) {
|
|
468
|
+
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);
|
|
469
|
+
}
|
|
470
|
+
function isSourceRecord(value) {
|
|
471
|
+
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");
|
|
472
|
+
}
|
|
473
|
+
function isUpdatePreview(value) {
|
|
474
|
+
return isRecord3(value) && isString(value.packageId) && isOptionalString(value.fromVersion) && isString(value.toVersion) && isStringArray2(value.addedArtifactIds) && isStringArray2(value.removedArtifactIds) && isStringArray2(value.changedArtifactIds) && isStringArray2(value.approvalInvalidatedArtifactIds);
|
|
475
|
+
}
|
|
476
|
+
function isCopilotCustomizationViewPayload(value) {
|
|
477
|
+
if (!isRecord3(value) || hasPrivateResultKey(value)) return false;
|
|
478
|
+
const summary = value.summary;
|
|
479
|
+
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");
|
|
480
|
+
}
|
|
481
|
+
function isCopilotCustomizationsListParams(value) {
|
|
482
|
+
return isRecord3(value) && isScope(value.scope) && hasOptionalWorkspaceDir(value);
|
|
483
|
+
}
|
|
484
|
+
function isAvailablePackage(value) {
|
|
485
|
+
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);
|
|
486
|
+
}
|
|
487
|
+
function isCopilotCustomizationsListResult(value) {
|
|
488
|
+
if (!isRecord3(value) || hasPrivateResultKey(value) || !isCopilotCustomizationViewPayload(value.view)) {
|
|
489
|
+
return false;
|
|
490
|
+
}
|
|
491
|
+
return value.availablePackages === void 0 || Array.isArray(value.availablePackages) && value.availablePackages.every(isAvailablePackage);
|
|
492
|
+
}
|
|
493
|
+
function isCopilotPackageInstallParams(value) {
|
|
494
|
+
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");
|
|
495
|
+
}
|
|
496
|
+
function isCopilotPackageUpdateParams(value) {
|
|
497
|
+
return isRecord3(value) && isScope(value.scope) && hasOptionalWorkspaceDir(value) && hasRequiredWorkspaceDirForWorkspaceScope(value) && isString(value.packageId) && isStringArray2(value.artifactIds, false) && isOptionalString(value.pinnedVersion);
|
|
498
|
+
}
|
|
499
|
+
function isCopilotPackageUninstallParams(value) {
|
|
500
|
+
return isRecord3(value) && isScope(value.scope) && hasOptionalWorkspaceDir(value) && hasRequiredWorkspaceDirForWorkspaceScope(value) && isString(value.packageId);
|
|
501
|
+
}
|
|
502
|
+
function isCopilotPackageMoveParams(value) {
|
|
503
|
+
return isRecord3(value) && hasOptionalWorkspaceDir(value) && isString(value.packageId) && isScope(value.from) && isScope(value.to) && value.from !== value.to && isString(value.workspaceDir);
|
|
504
|
+
}
|
|
505
|
+
function isCopilotLegacyPreviewParams(value) {
|
|
506
|
+
return isRecord3(value) && hasOptionalWorkspaceDir(value);
|
|
507
|
+
}
|
|
508
|
+
function isCopilotLegacyMigrateParams(value) {
|
|
509
|
+
return isRecord3(value) && hasOptionalWorkspaceDir(value) && isStringArray2(value.artifactIds, false);
|
|
510
|
+
}
|
|
511
|
+
function isCopilotSourceListParams(value) {
|
|
512
|
+
return isRecord3(value) && isScope(value.scope) && hasOptionalWorkspaceDir(value);
|
|
513
|
+
}
|
|
514
|
+
function isCopilotSourceListResult(value) {
|
|
515
|
+
return isRecord3(value) && !hasPrivateResultKey(value) && Array.isArray(value.sources) && value.sources.every(isSourceRecord);
|
|
516
|
+
}
|
|
517
|
+
function isCopilotSourceRemoveParams(value) {
|
|
518
|
+
return isRecord3(value) && isScope(value.scope) && hasOptionalWorkspaceDir(value) && isString(value.sourceId);
|
|
519
|
+
}
|
|
520
|
+
function isCopilotSourceRemoveResult(value) {
|
|
521
|
+
return isRecord3(value) && !hasPrivateResultKey(value) && value.removed === true;
|
|
522
|
+
}
|
|
523
|
+
function isCopilotUpdatePreviewParams(value) {
|
|
524
|
+
return isRecord3(value) && isScope(value.scope) && hasOptionalWorkspaceDir(value) && isString(value.packageId) && isString(value.revision);
|
|
525
|
+
}
|
|
526
|
+
function isCopilotUpdatePreviewResult(value) {
|
|
527
|
+
return isRecord3(value) && !hasPrivateResultKey(value) && isUpdatePreview(value.preview);
|
|
528
|
+
}
|
|
529
|
+
function isCopilotLegacyPreviewResult(value) {
|
|
530
|
+
return isRecord3(value) && !hasPrivateResultKey(value) && value.sourceLabel === "~/.agents" && Number.isInteger(value.count) && value.count >= 0 && Array.isArray(value.artifacts) && value.artifacts.every(isArtifactSummary);
|
|
531
|
+
}
|
|
532
|
+
var isCopilotPackageInstallResult = isCopilotCustomizationsListResult;
|
|
533
|
+
var isCopilotPackageUpdateResult = isCopilotCustomizationsListResult;
|
|
534
|
+
var isCopilotPackageUninstallResult = isCopilotCustomizationsListResult;
|
|
535
|
+
var isCopilotPackageMoveResult = isCopilotCustomizationsListResult;
|
|
536
|
+
var isCopilotLegacyMigrateResult = isCopilotCustomizationsListResult;
|
|
537
|
+
|
|
538
|
+
// src/json.ts
|
|
539
|
+
var JSON_SORT_ALGORITHMS = [
|
|
540
|
+
"default",
|
|
541
|
+
"keyLength",
|
|
542
|
+
"alphaNum",
|
|
543
|
+
"values",
|
|
544
|
+
"type"
|
|
545
|
+
];
|
|
546
|
+
var JSON_SORT_ORDERS = ["asc", "desc"];
|
|
547
|
+
var DEFAULT_JSON_SORT_OPTIONS = {
|
|
548
|
+
sortOrder: "asc",
|
|
549
|
+
sortAlgo: "default"
|
|
550
|
+
};
|
|
551
|
+
function isRecord4(value) {
|
|
552
|
+
return typeof value === "object" && value !== null;
|
|
553
|
+
}
|
|
554
|
+
function isJsonSortAlgorithm(value) {
|
|
555
|
+
return typeof value === "string" && JSON_SORT_ALGORITHMS.includes(value);
|
|
556
|
+
}
|
|
557
|
+
function isJsonSortOrder(value) {
|
|
558
|
+
return typeof value === "string" && JSON_SORT_ORDERS.includes(value);
|
|
559
|
+
}
|
|
560
|
+
function isJsonSortOptions(value) {
|
|
561
|
+
return isRecord4(value) && isJsonSortOrder(value.sortOrder) && isJsonSortAlgorithm(value.sortAlgo);
|
|
562
|
+
}
|
|
563
|
+
function isJsonValidationResult(value) {
|
|
564
|
+
return isRecord4(value) && typeof value.valid === "boolean" && (value.error === void 0 || typeof value.error === "string");
|
|
565
|
+
}
|
|
566
|
+
function isJsonOutputResult(value) {
|
|
567
|
+
return isRecord4(value) && typeof value.output === "string";
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
// src/bridge-copilot-plugins.ts
|
|
571
|
+
var SCOPES2 = /* @__PURE__ */ new Set(["workspace", "personal"]);
|
|
572
|
+
function isOptionalScope(value) {
|
|
573
|
+
return value === void 0 || typeof value === "string" && SCOPES2.has(value);
|
|
574
|
+
}
|
|
575
|
+
function isScopeArray(value) {
|
|
576
|
+
return Array.isArray(value) && value.every((s) => typeof s === "string" && SCOPES2.has(s));
|
|
577
|
+
}
|
|
578
|
+
function isRegistration(value) {
|
|
579
|
+
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";
|
|
580
|
+
}
|
|
581
|
+
function isCopilotPluginListParams(value) {
|
|
582
|
+
return isRecord4(value);
|
|
583
|
+
}
|
|
584
|
+
function isCopilotPluginListResult(value) {
|
|
585
|
+
return isRecord4(value) && Array.isArray(value.plugins) && value.plugins.every(isRegistration);
|
|
586
|
+
}
|
|
587
|
+
function isCopilotPluginRegisterParams(value) {
|
|
588
|
+
return isRecord4(value) && isOptionalScope(value.scope) && (value.workspaceDir === void 0 || typeof value.workspaceDir === "string") && typeof value.repoId === "string" && typeof value.pluginId === "string";
|
|
589
|
+
}
|
|
590
|
+
var isCopilotPluginRegisterResult = isCopilotPluginListResult;
|
|
591
|
+
function isCopilotPluginUnregisterParams(value) {
|
|
592
|
+
return isRecord4(value) && isOptionalScope(value.scope) && (value.workspaceDir === void 0 || typeof value.workspaceDir === "string") && typeof value.registrationId === "string";
|
|
593
|
+
}
|
|
594
|
+
var isCopilotPluginUnregisterResult = isCopilotPluginListResult;
|
|
595
|
+
|
|
596
|
+
// src/bridge-skill-repo.ts
|
|
597
|
+
function isRecord5(value) {
|
|
359
598
|
return typeof value === "object" && value !== null;
|
|
360
599
|
}
|
|
361
600
|
function isStringOrUndefined2(value) {
|
|
@@ -383,7 +622,7 @@ function isLinkMode(value) {
|
|
|
383
622
|
return value === "symlink" || value === "junction" || value === "copy";
|
|
384
623
|
}
|
|
385
624
|
function isRepoEntry(value) {
|
|
386
|
-
if (!
|
|
625
|
+
if (!isRecord5(value)) return false;
|
|
387
626
|
if (typeof value.id !== "string") return false;
|
|
388
627
|
if (typeof value.name !== "string") return false;
|
|
389
628
|
if (typeof value.url !== "string") return false;
|
|
@@ -407,7 +646,7 @@ function isRepoEntry(value) {
|
|
|
407
646
|
return true;
|
|
408
647
|
}
|
|
409
648
|
function isSkillEntry(value) {
|
|
410
|
-
if (!
|
|
649
|
+
if (!isRecord5(value)) return false;
|
|
411
650
|
if (typeof value.repoId !== "string") return false;
|
|
412
651
|
if (typeof value.name !== "string") return false;
|
|
413
652
|
if (value.kind !== "skill" && value.kind !== "agent") return false;
|
|
@@ -420,108 +659,198 @@ function isSkillEntry(value) {
|
|
|
420
659
|
return true;
|
|
421
660
|
}
|
|
422
661
|
function isSkillFile(value) {
|
|
423
|
-
return
|
|
662
|
+
return isRecord5(value) && typeof value.path === "string" && typeof value.content === "string";
|
|
424
663
|
}
|
|
425
664
|
function isLinkedSkill(value) {
|
|
426
|
-
return
|
|
665
|
+
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);
|
|
427
666
|
}
|
|
428
667
|
function isSyncPull(value) {
|
|
429
|
-
return
|
|
668
|
+
return isRecord5(value) && typeof value.repoId === "string" && (value.status === "ok" || value.status === "error");
|
|
669
|
+
}
|
|
670
|
+
function isCopilotContentStatus(value) {
|
|
671
|
+
return value === "restored" || value === "adopted" || value === "pending_approval" || value === "missing_source" || value === "conflict" || value === "drifted";
|
|
672
|
+
}
|
|
673
|
+
function isCopilotContentEntry(value) {
|
|
674
|
+
if (!isRecord5(value)) return false;
|
|
675
|
+
if (typeof value.identity !== "string") return false;
|
|
676
|
+
if (!isCopilotContentStatus(value.status)) return false;
|
|
677
|
+
if (value.message !== void 0 && typeof value.message !== "string") return false;
|
|
678
|
+
return true;
|
|
679
|
+
}
|
|
680
|
+
function isCopilotContentIntegrationKind(value) {
|
|
681
|
+
return value === "mcp" || value === "hook";
|
|
682
|
+
}
|
|
683
|
+
function isCopilotContentIntegrationStatus(value) {
|
|
684
|
+
return value === "active" || value === "inactive" || value === "pending_approval" || value === "missing_local_configuration";
|
|
685
|
+
}
|
|
686
|
+
function isCopilotContentIntegration(value) {
|
|
687
|
+
if (!isRecord5(value)) return false;
|
|
688
|
+
if (typeof value.identity !== "string") return false;
|
|
689
|
+
if (!isCopilotContentIntegrationKind(value.kind)) return false;
|
|
690
|
+
if (typeof value.configPath !== "string") return false;
|
|
691
|
+
if (!Array.isArray(value.names) || value.names.some((name) => typeof name !== "string")) {
|
|
692
|
+
return false;
|
|
693
|
+
}
|
|
694
|
+
return isCopilotContentIntegrationStatus(value.status);
|
|
430
695
|
}
|
|
431
696
|
function isSkillRepoListResult(value) {
|
|
432
|
-
return
|
|
697
|
+
return isRecord5(value) && Array.isArray(value.entries) && value.entries.every(isSkillEntry);
|
|
433
698
|
}
|
|
434
699
|
function isSkillRepoGetResult(value) {
|
|
435
|
-
return
|
|
700
|
+
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);
|
|
436
701
|
}
|
|
437
702
|
function isSkillRepoInstallResult(value) {
|
|
438
|
-
return
|
|
703
|
+
return isRecord5(value) && isLinkMode(value.mode) && typeof value.linkPath === "string" && typeof value.targetPath === "string";
|
|
439
704
|
}
|
|
440
705
|
function isSkillRepoConvertToSymlinkResult(value) {
|
|
441
|
-
return
|
|
706
|
+
return isRecord5(value) && isLinkMode(value.mode) && typeof value.linkPath === "string" && typeof value.targetPath === "string";
|
|
442
707
|
}
|
|
443
708
|
function isSkillRepoUninstallResult(value) {
|
|
444
|
-
return
|
|
709
|
+
return isRecord5(value) && value.removed === true;
|
|
710
|
+
}
|
|
711
|
+
function isSkillRepoSetEntryEnabledResult(value) {
|
|
712
|
+
return isRecord5(value) && typeof value.enabled === "boolean";
|
|
713
|
+
}
|
|
714
|
+
function isSkillKind(value) {
|
|
715
|
+
return value === "skill" || value === "agent";
|
|
716
|
+
}
|
|
717
|
+
function isCopilotContentDetectUnmanagedParams(value) {
|
|
718
|
+
return isRecord5(value) && typeof value.workspaceDir === "string";
|
|
719
|
+
}
|
|
720
|
+
function isCopilotContentDetectUnmanagedResult(value) {
|
|
721
|
+
if (!isRecord5(value)) return false;
|
|
722
|
+
if (!Array.isArray(value.adoptions) || !Array.isArray(value.ambiguous)) return false;
|
|
723
|
+
if (!Array.isArray(value.integrations) || !Array.isArray(value.unmatched)) return false;
|
|
724
|
+
return value.adoptions.every(
|
|
725
|
+
(a) => isRecord5(a) && typeof a.repoId === "string" && typeof a.name === "string" && isSkillKind(a.kind) && (a.source === "symlink" || a.source === "fingerprint")
|
|
726
|
+
) && value.ambiguous.every(
|
|
727
|
+
(a) => isRecord5(a) && typeof a.name === "string" && isSkillKind(a.kind) && Array.isArray(a.candidates) && a.candidates.every((c) => typeof c === "string")
|
|
728
|
+
) && value.integrations.every(
|
|
729
|
+
(i) => isRecord5(i) && typeof i.repoId === "string" && typeof i.pluginId === "string" && (i.kind === "hook" || i.kind === "mcp")
|
|
730
|
+
) && value.unmatched.every(
|
|
731
|
+
(u) => isRecord5(u) && typeof u.name === "string" && typeof u.reason === "string"
|
|
732
|
+
);
|
|
733
|
+
}
|
|
734
|
+
function isCopilotContentAdoptUnmanagedParams(value) {
|
|
735
|
+
if (!isRecord5(value) || typeof value.workspaceDir !== "string") return false;
|
|
736
|
+
if (!Array.isArray(value.entries)) return false;
|
|
737
|
+
if (!value.entries.every(
|
|
738
|
+
(e) => isRecord5(e) && typeof e.repoId === "string" && typeof e.name === "string" && isSkillKind(e.kind) && (e.convertRealCopy === void 0 || typeof e.convertRealCopy === "boolean")
|
|
739
|
+
)) {
|
|
740
|
+
return false;
|
|
741
|
+
}
|
|
742
|
+
if (value.integrations !== void 0 && !Array.isArray(value.integrations)) return false;
|
|
743
|
+
if (Array.isArray(value.integrations)) {
|
|
744
|
+
return value.integrations.every(
|
|
745
|
+
(i) => isRecord5(i) && typeof i.repoId === "string" && typeof i.pluginId === "string" && (i.kind === "hook" || i.kind === "mcp")
|
|
746
|
+
);
|
|
747
|
+
}
|
|
748
|
+
return true;
|
|
749
|
+
}
|
|
750
|
+
function isCopilotContentAdoptUnmanagedResult(value) {
|
|
751
|
+
if (!isRecord5(value) || typeof value.changed !== "boolean") return false;
|
|
752
|
+
if (!Array.isArray(value.entries)) return false;
|
|
753
|
+
return value.entries.every(
|
|
754
|
+
(e) => isRecord5(e) && typeof e.identity === "string" && typeof e.status === "string" && (e.message === void 0 || typeof e.message === "string")
|
|
755
|
+
);
|
|
445
756
|
}
|
|
446
757
|
function isSkillRepoListLinkedResult(value) {
|
|
447
|
-
return
|
|
758
|
+
return isRecord5(value) && Array.isArray(value.links) && value.links.every(isLinkedSkill);
|
|
448
759
|
}
|
|
449
760
|
function isSkillRepoDraftCreateResult(value) {
|
|
450
|
-
return
|
|
761
|
+
return isRecord5(value) && typeof value.id === "string";
|
|
451
762
|
}
|
|
452
763
|
function isSkillRepoDraftCommitResult(value) {
|
|
453
|
-
return
|
|
764
|
+
return isRecord5(value) && typeof value.repoId === "string" && typeof value.skillName === "string" && typeof value.commitSha === "string" && isStringOrUndefined2(value.pushedRef) && isStringOrUndefined2(value.pushedSha);
|
|
454
765
|
}
|
|
455
766
|
function isSkillRepoDraftListResult(value) {
|
|
456
|
-
return
|
|
457
|
-
(d) =>
|
|
767
|
+
return isRecord5(value) && Array.isArray(value.drafts) && value.drafts.every(
|
|
768
|
+
(d) => isRecord5(d) && typeof d.id === "string" && (d.kind === "skill" || d.kind === "agent") && typeof d.name === "string" && typeof d.description === "string" && typeof d.modifiedAt === "string"
|
|
458
769
|
);
|
|
459
770
|
}
|
|
460
771
|
function isSkillRepoDraftDeleteResult(value) {
|
|
461
|
-
return
|
|
772
|
+
return isRecord5(value) && value.deleted === true;
|
|
462
773
|
}
|
|
463
774
|
function isRepoListResult(value) {
|
|
464
|
-
return
|
|
775
|
+
return isRecord5(value) && Array.isArray(value.repos) && value.repos.every(isRepoEntry);
|
|
465
776
|
}
|
|
466
777
|
function isRepoAddResult(value) {
|
|
467
|
-
return
|
|
778
|
+
return isRecord5(value) && isRepoEntry(value.repo) && typeof value.branch === "string" && typeof value.cloned === "boolean";
|
|
468
779
|
}
|
|
469
780
|
function isRepoRemoveResult(value) {
|
|
470
|
-
return
|
|
781
|
+
return isRecord5(value) && value.removed === true;
|
|
471
782
|
}
|
|
472
783
|
function isRepoEnableResult(value) {
|
|
473
|
-
return
|
|
784
|
+
return isRecord5(value) && isRepoEntry(value.repo);
|
|
474
785
|
}
|
|
475
786
|
function isRepoDisableResult(value) {
|
|
476
|
-
return
|
|
787
|
+
return isRecord5(value) && isRepoEntry(value.repo);
|
|
477
788
|
}
|
|
478
789
|
function isRepoUpdateResult(value) {
|
|
479
|
-
return
|
|
790
|
+
return isRecord5(value) && isRepoEntry(value.repo);
|
|
480
791
|
}
|
|
481
792
|
function isRepoSyncResult(value) {
|
|
482
|
-
return
|
|
793
|
+
return isRecord5(value) && Array.isArray(value.pulls) && value.pulls.length >= 1 && value.pulls.every(isSyncPull);
|
|
483
794
|
}
|
|
484
795
|
function isRepoSyncAllResult(value) {
|
|
485
|
-
return
|
|
796
|
+
return isRecord5(value) && Array.isArray(value.pulls) && value.pulls.every(isSyncPull);
|
|
797
|
+
}
|
|
798
|
+
function isCopilotContentRestoreResult(value) {
|
|
799
|
+
return isRecord5(value) && typeof value.changed === "boolean" && Array.isArray(value.entries) && value.entries.every(isCopilotContentEntry);
|
|
800
|
+
}
|
|
801
|
+
function isCopilotContentStatusResult(value) {
|
|
802
|
+
return isCopilotContentRestoreResult(value);
|
|
803
|
+
}
|
|
804
|
+
function isCopilotContentApproveResult(value) {
|
|
805
|
+
return isCopilotContentRestoreResult(value);
|
|
806
|
+
}
|
|
807
|
+
function isCopilotContentMigrateLegacyResult(value) {
|
|
808
|
+
return isRecord5(value) && Array.isArray(value.entries) && value.entries.every(isCopilotContentEntry);
|
|
809
|
+
}
|
|
810
|
+
function isCopilotContentIntegrationStatusResult(value) {
|
|
811
|
+
return isRecord5(value) && Array.isArray(value.integrations) && value.integrations.every(isCopilotContentIntegration);
|
|
486
812
|
}
|
|
487
813
|
function isSkillRepoListParams(value) {
|
|
488
|
-
return
|
|
814
|
+
return isRecord5(value) && isStringOrUndefined2(value.repoId) && isSkillKindOrUndefined(value.kind) && isStringOrUndefined2(value.workspaceDir);
|
|
489
815
|
}
|
|
490
816
|
function isSkillRepoGetParams(value) {
|
|
491
|
-
return
|
|
817
|
+
return isRecord5(value) && typeof value.repoId === "string" && typeof value.name === "string";
|
|
492
818
|
}
|
|
493
819
|
function isSkillRepoInstallParams(value) {
|
|
494
|
-
return
|
|
820
|
+
return isRecord5(value) && typeof value.repoId === "string" && typeof value.name === "string" && typeof value.workspaceDir === "string" && isSkillKindOrUndefined(value.kind) && isLinkModeOrUndefined(value.mode) && isLinkScopeOrUndefined(value.scope);
|
|
495
821
|
}
|
|
496
822
|
function isSkillRepoConvertToSymlinkParams(value) {
|
|
497
|
-
return
|
|
823
|
+
return isRecord5(value) && typeof value.repoId === "string" && typeof value.name === "string" && typeof value.workspaceDir === "string" && isSkillKindOrUndefined(value.kind) && isLinkModeOrUndefined(value.mode) && isLinkScopeOrUndefined(value.scope);
|
|
498
824
|
}
|
|
499
825
|
function isSkillRepoUninstallParams(value) {
|
|
500
|
-
return
|
|
826
|
+
return isRecord5(value) && typeof value.repoId === "string" && typeof value.name === "string" && typeof value.workspaceDir === "string" && isSkillKindOrUndefined(value.kind) && isLinkScopeOrUndefined(value.scope);
|
|
827
|
+
}
|
|
828
|
+
function isSkillRepoSetEntryEnabledParams(value) {
|
|
829
|
+
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");
|
|
501
830
|
}
|
|
502
831
|
function isSkillRepoListLinkedParams(value) {
|
|
503
|
-
return
|
|
832
|
+
return isRecord5(value) && typeof value.workspaceDir === "string" && isSkillKindOrUndefined(value.kind) && isLinkScopeFilterOrUndefined(value.scope);
|
|
504
833
|
}
|
|
505
834
|
function isRepoListParams(value) {
|
|
506
|
-
return
|
|
835
|
+
return isRecord5(value) && (value.source === void 0 || value.source === "default" || value.source === "user");
|
|
507
836
|
}
|
|
508
837
|
function isRepoAddParams(value) {
|
|
509
|
-
return
|
|
838
|
+
return isRecord5(value) && typeof value.url === "string" && isStringOrUndefined2(value.branch) && isStringOrUndefined2(value.name) && isBooleanOrUndefined(value.useProxy);
|
|
510
839
|
}
|
|
511
840
|
function isRepoRemoveParams(value) {
|
|
512
|
-
return
|
|
841
|
+
return isRecord5(value) && typeof value.repoId === "string";
|
|
513
842
|
}
|
|
514
843
|
function isRepoEnableParams(value) {
|
|
515
|
-
return
|
|
844
|
+
return isRecord5(value) && typeof value.repoId === "string";
|
|
516
845
|
}
|
|
517
846
|
function isRepoDisableParams(value) {
|
|
518
|
-
return
|
|
847
|
+
return isRecord5(value) && typeof value.repoId === "string";
|
|
519
848
|
}
|
|
520
849
|
function isRepoSyncParams(value) {
|
|
521
|
-
return
|
|
850
|
+
return isRecord5(value) && typeof value.repoId === "string";
|
|
522
851
|
}
|
|
523
852
|
function isRepoSyncAllParams(value) {
|
|
524
|
-
return
|
|
853
|
+
return isRecord5(value);
|
|
525
854
|
}
|
|
526
855
|
|
|
527
856
|
// src/device.ts
|
|
@@ -531,7 +860,7 @@ var DEVICE_BINDING_STATES = [
|
|
|
531
860
|
"claimed",
|
|
532
861
|
"expired"
|
|
533
862
|
];
|
|
534
|
-
function
|
|
863
|
+
function isRecord6(value) {
|
|
535
864
|
return typeof value === "object" && value !== null;
|
|
536
865
|
}
|
|
537
866
|
function isStringOrUndefined3(value) {
|
|
@@ -541,7 +870,7 @@ function isDeviceBindingState(value) {
|
|
|
541
870
|
return value === "anonymous" || value === "pending" || value === "claimed" || value === "expired";
|
|
542
871
|
}
|
|
543
872
|
function isDeviceIdentityState(value) {
|
|
544
|
-
if (!
|
|
873
|
+
if (!isRecord6(value)) return false;
|
|
545
874
|
if (typeof value.publicId !== "string") return false;
|
|
546
875
|
if (value.publicId.length === 0) return false;
|
|
547
876
|
if (typeof value.secretVersion !== "number") return false;
|
|
@@ -551,7 +880,7 @@ function isDeviceIdentityState(value) {
|
|
|
551
880
|
return true;
|
|
552
881
|
}
|
|
553
882
|
function isDeviceMetadata(value) {
|
|
554
|
-
if (!
|
|
883
|
+
if (!isRecord6(value)) return false;
|
|
555
884
|
if (typeof value.installationId !== "string") return false;
|
|
556
885
|
if (value.installationId.length === 0) return false;
|
|
557
886
|
if (typeof value.machineId !== "string") return false;
|
|
@@ -564,7 +893,7 @@ function isDeviceMetadata(value) {
|
|
|
564
893
|
return true;
|
|
565
894
|
}
|
|
566
895
|
function isDeviceStatus(value) {
|
|
567
|
-
if (!
|
|
896
|
+
if (!isRecord6(value)) return false;
|
|
568
897
|
if (!isDeviceBindingState(value.bindingState)) return false;
|
|
569
898
|
if (value.identity !== void 0 && !isDeviceIdentityState(value.identity)) {
|
|
570
899
|
return false;
|
|
@@ -577,10 +906,10 @@ function isDeviceStatus(value) {
|
|
|
577
906
|
return true;
|
|
578
907
|
}
|
|
579
908
|
function isDeviceEnrollParams(value) {
|
|
580
|
-
return
|
|
909
|
+
return isRecord6(value) && (value.force === void 0 || typeof value.force === "boolean") && (value.requireAuth === void 0 || typeof value.requireAuth === "boolean");
|
|
581
910
|
}
|
|
582
911
|
function isDeviceEnrollResult(value) {
|
|
583
|
-
if (!
|
|
912
|
+
if (!isRecord6(value)) return false;
|
|
584
913
|
if (typeof value.publicId !== "string") return false;
|
|
585
914
|
if (value.publicId.length === 0) return false;
|
|
586
915
|
if (!isDeviceBindingState(value.bindingState)) return false;
|
|
@@ -588,14 +917,14 @@ function isDeviceEnrollResult(value) {
|
|
|
588
917
|
return true;
|
|
589
918
|
}
|
|
590
919
|
function isDeviceRotateSecretParams(value) {
|
|
591
|
-
if (!
|
|
920
|
+
if (!isRecord6(value)) return false;
|
|
592
921
|
if (value.gracePeriodDays !== void 0 && (typeof value.gracePeriodDays !== "number" || !Number.isInteger(value.gracePeriodDays) || value.gracePeriodDays < 0 || value.gracePeriodDays > 365)) {
|
|
593
922
|
return false;
|
|
594
923
|
}
|
|
595
924
|
return true;
|
|
596
925
|
}
|
|
597
926
|
function isDeviceRotateSecretResult(value) {
|
|
598
|
-
if (!
|
|
927
|
+
if (!isRecord6(value)) return false;
|
|
599
928
|
if (typeof value.publicId !== "string") return false;
|
|
600
929
|
if (value.publicId.length === 0) return false;
|
|
601
930
|
if (typeof value.secretVersion !== "number") return false;
|
|
@@ -622,18 +951,18 @@ var VALID_TERMINAL_STATUSES = [
|
|
|
622
951
|
"timeout",
|
|
623
952
|
"cancelled"
|
|
624
953
|
];
|
|
625
|
-
function
|
|
954
|
+
function isRecord7(value) {
|
|
626
955
|
return typeof value === "object" && value !== null;
|
|
627
956
|
}
|
|
628
957
|
function isScheduledTaskType(value) {
|
|
629
958
|
return typeof value === "string" && VALID_TASK_TYPES.includes(value);
|
|
630
959
|
}
|
|
631
960
|
function isScheduledTaskV1(value) {
|
|
632
|
-
if (!
|
|
633
|
-
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) &&
|
|
961
|
+
if (!isRecord7(value)) return false;
|
|
962
|
+
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";
|
|
634
963
|
}
|
|
635
964
|
function isTaskWorkspaceRef(value) {
|
|
636
|
-
if (!
|
|
965
|
+
if (!isRecord7(value)) return false;
|
|
637
966
|
if (typeof value.path !== "string" || value.path.length === 0) return false;
|
|
638
967
|
if (typeof value.name !== "string" || value.name.length === 0) return false;
|
|
639
968
|
if (value.gitRemote !== void 0 && typeof value.gitRemote !== "string") {
|
|
@@ -652,48 +981,48 @@ function isScheduledTask(value) {
|
|
|
652
981
|
return isTaskWorkspaceRef(value.workspace);
|
|
653
982
|
}
|
|
654
983
|
function isScheduledTasksConfig(value) {
|
|
655
|
-
if (!
|
|
984
|
+
if (!isRecord7(value)) return false;
|
|
656
985
|
if (value.version !== 2) return false;
|
|
657
986
|
if (!Array.isArray(value.tasks)) return false;
|
|
658
987
|
return value.tasks.every((t) => isScheduledTask(t));
|
|
659
988
|
}
|
|
660
989
|
function isScheduledTasksConfigV1(value) {
|
|
661
|
-
if (!
|
|
990
|
+
if (!isRecord7(value)) return false;
|
|
662
991
|
if (value.version !== 1) return false;
|
|
663
992
|
if (!Array.isArray(value.tasks)) return false;
|
|
664
993
|
return value.tasks.every((t) => isScheduledTaskV1(t));
|
|
665
994
|
}
|
|
666
995
|
function isTaskExecutionLog(value) {
|
|
667
|
-
if (!
|
|
996
|
+
if (!isRecord7(value)) return false;
|
|
668
997
|
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);
|
|
669
998
|
}
|
|
670
999
|
function isSchedulerStatus(value) {
|
|
671
|
-
if (!
|
|
1000
|
+
if (!isRecord7(value)) return false;
|
|
672
1001
|
return typeof value.running === "boolean" && typeof value.tasksRegistered === "number" && typeof value.workspacePath === "string";
|
|
673
1002
|
}
|
|
674
1003
|
function isTaskExecuteResult(value) {
|
|
675
|
-
return
|
|
1004
|
+
return isRecord7(value) && typeof value.executionId === "string" && value.accepted === true;
|
|
676
1005
|
}
|
|
677
1006
|
function isTaskCancelResult(value) {
|
|
678
|
-
return
|
|
1007
|
+
return isRecord7(value) && typeof value.executionId === "string" && typeof value.cancelled === "boolean";
|
|
679
1008
|
}
|
|
680
1009
|
function isTaskListRunningResult(value) {
|
|
681
|
-
return
|
|
1010
|
+
return isRecord7(value) && Array.isArray(value.executions);
|
|
682
1011
|
}
|
|
683
1012
|
function isTaskStartedEventParams(value) {
|
|
684
|
-
return
|
|
1013
|
+
return isRecord7(value) && typeof value.executionId === "string" && typeof value.taskId === "string" && typeof value.startedAt === "string";
|
|
685
1014
|
}
|
|
686
1015
|
function isTaskOutputEventParams(value) {
|
|
687
|
-
return
|
|
1016
|
+
return isRecord7(value) && typeof value.executionId === "string" && (value.stream === "stdout" || value.stream === "stderr") && typeof value.data === "string";
|
|
688
1017
|
}
|
|
689
1018
|
function isTaskCompletedEventParams(value) {
|
|
690
|
-
return
|
|
1019
|
+
return isRecord7(value) && typeof value.executionId === "string" && isTaskExecutionLog(value.log);
|
|
691
1020
|
}
|
|
692
1021
|
function isTaskFailedEventParams(value) {
|
|
693
|
-
return
|
|
1022
|
+
return isRecord7(value) && typeof value.executionId === "string" && (value.status === "failure" || value.status === "timeout") && (value.reason === "error" || value.reason === "timeout") && isTaskExecutionLog(value.log);
|
|
694
1023
|
}
|
|
695
1024
|
function isTaskCancelledEventParams(value) {
|
|
696
|
-
return
|
|
1025
|
+
return isRecord7(value) && typeof value.executionId === "string" && isTaskExecutionLog(value.log);
|
|
697
1026
|
}
|
|
698
1027
|
function isAgentSessionStatus(value) {
|
|
699
1028
|
return value === "idle" || value === "running" || value === "needs-input" || value === "completed" || value === "failed" || value === "aborted";
|
|
@@ -727,7 +1056,7 @@ function migrateV1ToV2(v1Config, workspace) {
|
|
|
727
1056
|
|
|
728
1057
|
// src/toolbox.ts
|
|
729
1058
|
var TOOLBOX_SCOPES = ["user", "workspace"];
|
|
730
|
-
function
|
|
1059
|
+
function isRecord8(value) {
|
|
731
1060
|
return typeof value === "object" && value !== null;
|
|
732
1061
|
}
|
|
733
1062
|
function isStringOrUndefined4(value) {
|
|
@@ -740,7 +1069,7 @@ function isToolboxScope(value) {
|
|
|
740
1069
|
return value === "user" || value === "workspace";
|
|
741
1070
|
}
|
|
742
1071
|
function isExternalTool(value) {
|
|
743
|
-
if (!
|
|
1072
|
+
if (!isRecord8(value)) return false;
|
|
744
1073
|
if (typeof value.id !== "string") return false;
|
|
745
1074
|
if (value.id.length === 0) return false;
|
|
746
1075
|
if (typeof value.name !== "string") return false;
|
|
@@ -758,7 +1087,7 @@ function isExternalTool(value) {
|
|
|
758
1087
|
return true;
|
|
759
1088
|
}
|
|
760
1089
|
function isExternalToolPatch(value) {
|
|
761
|
-
if (!
|
|
1090
|
+
if (!isRecord8(value)) return false;
|
|
762
1091
|
if (value.name !== void 0) {
|
|
763
1092
|
if (typeof value.name !== "string" || value.name.length === 0) return false;
|
|
764
1093
|
}
|
|
@@ -778,7 +1107,7 @@ function isExternalToolPatch(value) {
|
|
|
778
1107
|
return true;
|
|
779
1108
|
}
|
|
780
1109
|
function isToolboxList(value) {
|
|
781
|
-
if (!
|
|
1110
|
+
if (!isRecord8(value)) return false;
|
|
782
1111
|
if (!isToolboxScope(value.scope)) return false;
|
|
783
1112
|
if (!Array.isArray(value.tools)) return false;
|
|
784
1113
|
for (const tool of value.tools) {
|
|
@@ -787,26 +1116,26 @@ function isToolboxList(value) {
|
|
|
787
1116
|
return true;
|
|
788
1117
|
}
|
|
789
1118
|
function isToolboxListParams(value) {
|
|
790
|
-
return
|
|
1119
|
+
return isRecord8(value) && (value.scope === void 0 || isToolboxScope(value.scope));
|
|
791
1120
|
}
|
|
792
1121
|
function isToolboxAddParams(value) {
|
|
793
1122
|
return isExternalTool(value);
|
|
794
1123
|
}
|
|
795
1124
|
function isToolboxAddResult(value) {
|
|
796
|
-
if (!
|
|
1125
|
+
if (!isRecord8(value)) return false;
|
|
797
1126
|
if (!isToolboxScope(value.scope)) return false;
|
|
798
1127
|
if (!isExternalTool(value.tool)) return false;
|
|
799
1128
|
return true;
|
|
800
1129
|
}
|
|
801
1130
|
function isToolboxRemoveParams(value) {
|
|
802
|
-
if (!
|
|
1131
|
+
if (!isRecord8(value)) return false;
|
|
803
1132
|
if (typeof value.id !== "string") return false;
|
|
804
1133
|
if (value.id.length === 0) return false;
|
|
805
1134
|
if (value.scope !== void 0 && !isToolboxScope(value.scope)) return false;
|
|
806
1135
|
return true;
|
|
807
1136
|
}
|
|
808
1137
|
function isToolboxRemoveResult(value) {
|
|
809
|
-
if (!
|
|
1138
|
+
if (!isRecord8(value)) return false;
|
|
810
1139
|
if (!isToolboxScope(value.scope)) return false;
|
|
811
1140
|
if (typeof value.toolId !== "string") return false;
|
|
812
1141
|
if (value.toolId.length === 0) return false;
|
|
@@ -814,7 +1143,7 @@ function isToolboxRemoveResult(value) {
|
|
|
814
1143
|
return true;
|
|
815
1144
|
}
|
|
816
1145
|
function isToolboxUpdateParams(value) {
|
|
817
|
-
if (!
|
|
1146
|
+
if (!isRecord8(value)) return false;
|
|
818
1147
|
if (typeof value.id !== "string") return false;
|
|
819
1148
|
if (value.id.length === 0) return false;
|
|
820
1149
|
if (!isExternalToolPatch(value.patch)) return false;
|
|
@@ -822,7 +1151,7 @@ function isToolboxUpdateParams(value) {
|
|
|
822
1151
|
return true;
|
|
823
1152
|
}
|
|
824
1153
|
function isToolboxUpdateResult(value) {
|
|
825
|
-
if (!
|
|
1154
|
+
if (!isRecord8(value)) return false;
|
|
826
1155
|
if (!isToolboxScope(value.scope)) return false;
|
|
827
1156
|
if (!isExternalTool(value.tool)) return false;
|
|
828
1157
|
return true;
|
|
@@ -830,14 +1159,14 @@ function isToolboxUpdateResult(value) {
|
|
|
830
1159
|
|
|
831
1160
|
// src/bridge.ts
|
|
832
1161
|
var SERVICEME_PROTOCOL_VERSION = 2;
|
|
833
|
-
function
|
|
1162
|
+
function isRecord9(value) {
|
|
834
1163
|
return typeof value === "object" && value !== null;
|
|
835
1164
|
}
|
|
836
1165
|
function isValidProtocolVersion(value) {
|
|
837
1166
|
return typeof value === "number" && Number.isInteger(value) && value >= 1 && value <= SERVICEME_PROTOCOL_VERSION;
|
|
838
1167
|
}
|
|
839
1168
|
function isBridgeCapabilities(value) {
|
|
840
|
-
return
|
|
1169
|
+
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);
|
|
841
1170
|
}
|
|
842
1171
|
var BRIDGE_METHODS = [
|
|
843
1172
|
"system.hello",
|
|
@@ -846,11 +1175,25 @@ var BRIDGE_METHODS = [
|
|
|
846
1175
|
"task.execute",
|
|
847
1176
|
"task.cancel",
|
|
848
1177
|
"task.list-running",
|
|
1178
|
+
"copilotContent.list",
|
|
1179
|
+
"copilotContent.get",
|
|
1180
|
+
"copilotContent.install",
|
|
1181
|
+
"copilotContent.convertToSymlink",
|
|
1182
|
+
"copilotContent.uninstall",
|
|
1183
|
+
"copilotContent.setEntryEnabled",
|
|
1184
|
+
"copilotContent.detectUnmanaged",
|
|
1185
|
+
"copilotContent.adoptUnmanaged",
|
|
1186
|
+
"copilotContent.listLinked",
|
|
1187
|
+
"copilotContent.draft.create",
|
|
1188
|
+
"copilotContent.draft.commit",
|
|
1189
|
+
"copilotContent.draft.list",
|
|
1190
|
+
"copilotContent.draft.delete",
|
|
849
1191
|
"skillRepo.list",
|
|
850
1192
|
"skillRepo.get",
|
|
851
1193
|
"skillRepo.install",
|
|
852
1194
|
"skillRepo.convertToSymlink",
|
|
853
1195
|
"skillRepo.uninstall",
|
|
1196
|
+
"skillRepo.setEntryEnabled",
|
|
854
1197
|
"skillRepo.listLinked",
|
|
855
1198
|
"skillRepo.draft.create",
|
|
856
1199
|
"skillRepo.draft.commit",
|
|
@@ -864,6 +1207,25 @@ var BRIDGE_METHODS = [
|
|
|
864
1207
|
"repo.update",
|
|
865
1208
|
"repo.sync",
|
|
866
1209
|
"repo.syncAll",
|
|
1210
|
+
"repo.resetParseCache",
|
|
1211
|
+
"copilotContent.status",
|
|
1212
|
+
"copilotContent.restore",
|
|
1213
|
+
"copilotContent.approve",
|
|
1214
|
+
"copilotContent.migrateLegacy",
|
|
1215
|
+
"copilotContent.integrationStatus",
|
|
1216
|
+
"copilotContent.customizations.list",
|
|
1217
|
+
"copilotContent.package.install",
|
|
1218
|
+
"copilotContent.package.update",
|
|
1219
|
+
"copilotContent.package.uninstall",
|
|
1220
|
+
"copilotContent.package.move",
|
|
1221
|
+
"copilotPlugin.list",
|
|
1222
|
+
"copilotPlugin.register",
|
|
1223
|
+
"copilotPlugin.unregister",
|
|
1224
|
+
"copilotContent.legacy.preview",
|
|
1225
|
+
"copilotContent.legacy.migrate",
|
|
1226
|
+
"copilotContent.sources.list",
|
|
1227
|
+
"copilotContent.sources.remove",
|
|
1228
|
+
"copilotContent.package.previewUpdate",
|
|
867
1229
|
"auth.status",
|
|
868
1230
|
"auth.login",
|
|
869
1231
|
"auth.logout",
|
|
@@ -877,6 +1239,22 @@ var BRIDGE_METHODS = [
|
|
|
877
1239
|
"toolbox.remove",
|
|
878
1240
|
"toolbox.update"
|
|
879
1241
|
];
|
|
1242
|
+
var COPILOT_CONTENT_METHOD_ALIASES = {
|
|
1243
|
+
"skillRepo.list": "copilotContent.list",
|
|
1244
|
+
"skillRepo.get": "copilotContent.get",
|
|
1245
|
+
"skillRepo.install": "copilotContent.install",
|
|
1246
|
+
"skillRepo.convertToSymlink": "copilotContent.convertToSymlink",
|
|
1247
|
+
"skillRepo.uninstall": "copilotContent.uninstall",
|
|
1248
|
+
"skillRepo.setEntryEnabled": "copilotContent.setEntryEnabled",
|
|
1249
|
+
"skillRepo.listLinked": "copilotContent.listLinked",
|
|
1250
|
+
"skillRepo.draft.create": "copilotContent.draft.create",
|
|
1251
|
+
"skillRepo.draft.commit": "copilotContent.draft.commit",
|
|
1252
|
+
"skillRepo.draft.list": "copilotContent.draft.list",
|
|
1253
|
+
"skillRepo.draft.delete": "copilotContent.draft.delete"
|
|
1254
|
+
};
|
|
1255
|
+
function normalizeBridgeMethod(method) {
|
|
1256
|
+
return COPILOT_CONTENT_METHOD_ALIASES[method] ?? method;
|
|
1257
|
+
}
|
|
880
1258
|
var BRIDGE_EVENTS = [
|
|
881
1259
|
"task.started",
|
|
882
1260
|
"task.output",
|
|
@@ -885,13 +1263,13 @@ var BRIDGE_EVENTS = [
|
|
|
885
1263
|
"task.cancelled"
|
|
886
1264
|
];
|
|
887
1265
|
function isSystemHelloResult(value) {
|
|
888
|
-
return
|
|
1266
|
+
return isRecord9(value) && typeof value.cliVersion === "string" && isValidProtocolVersion(value.protocolVersion) && isBridgeCapabilities(value.capabilities) && typeof value.pid === "number";
|
|
889
1267
|
}
|
|
890
1268
|
function isSystemPingResult(value) {
|
|
891
|
-
return
|
|
1269
|
+
return isRecord9(value) && typeof value.now === "string";
|
|
892
1270
|
}
|
|
893
1271
|
function isSystemShutdownResult(value) {
|
|
894
|
-
return
|
|
1272
|
+
return isRecord9(value) && value.shuttingDown === true;
|
|
895
1273
|
}
|
|
896
1274
|
function getBridgeResultValidator(method) {
|
|
897
1275
|
switch (method) {
|
|
@@ -907,24 +1285,41 @@ function getBridgeResultValidator(method) {
|
|
|
907
1285
|
return isTaskCancelResult;
|
|
908
1286
|
case "task.list-running":
|
|
909
1287
|
return isTaskListRunningResult;
|
|
1288
|
+
case "copilotContent.list":
|
|
910
1289
|
case "skillRepo.list":
|
|
911
1290
|
return isSkillRepoListResult;
|
|
1291
|
+
case "copilotContent.get":
|
|
912
1292
|
case "skillRepo.get":
|
|
913
1293
|
return isSkillRepoGetResult;
|
|
1294
|
+
case "copilotContent.install":
|
|
914
1295
|
case "skillRepo.install":
|
|
915
1296
|
return isSkillRepoInstallResult;
|
|
1297
|
+
case "copilotContent.convertToSymlink":
|
|
916
1298
|
case "skillRepo.convertToSymlink":
|
|
917
1299
|
return isSkillRepoConvertToSymlinkResult;
|
|
1300
|
+
case "copilotContent.uninstall":
|
|
918
1301
|
case "skillRepo.uninstall":
|
|
919
1302
|
return isSkillRepoUninstallResult;
|
|
1303
|
+
case "copilotContent.setEntryEnabled":
|
|
1304
|
+
case "skillRepo.setEntryEnabled":
|
|
1305
|
+
return isSkillRepoSetEntryEnabledResult;
|
|
1306
|
+
case "copilotContent.detectUnmanaged":
|
|
1307
|
+
return isCopilotContentDetectUnmanagedResult;
|
|
1308
|
+
case "copilotContent.adoptUnmanaged":
|
|
1309
|
+
return isCopilotContentAdoptUnmanagedResult;
|
|
1310
|
+
case "copilotContent.listLinked":
|
|
920
1311
|
case "skillRepo.listLinked":
|
|
921
1312
|
return isSkillRepoListLinkedResult;
|
|
1313
|
+
case "copilotContent.draft.create":
|
|
922
1314
|
case "skillRepo.draft.create":
|
|
923
1315
|
return isSkillRepoDraftCreateResult;
|
|
1316
|
+
case "copilotContent.draft.commit":
|
|
924
1317
|
case "skillRepo.draft.commit":
|
|
925
1318
|
return isSkillRepoDraftCommitResult;
|
|
1319
|
+
case "copilotContent.draft.list":
|
|
926
1320
|
case "skillRepo.draft.list":
|
|
927
1321
|
return isSkillRepoDraftListResult;
|
|
1322
|
+
case "copilotContent.draft.delete":
|
|
928
1323
|
case "skillRepo.draft.delete":
|
|
929
1324
|
return isSkillRepoDraftDeleteResult;
|
|
930
1325
|
case "repo.list":
|
|
@@ -943,6 +1338,42 @@ function getBridgeResultValidator(method) {
|
|
|
943
1338
|
return isRepoSyncResult;
|
|
944
1339
|
case "repo.syncAll":
|
|
945
1340
|
return isRepoSyncAllResult;
|
|
1341
|
+
case "copilotContent.status":
|
|
1342
|
+
return isCopilotContentStatusResult;
|
|
1343
|
+
case "copilotContent.restore":
|
|
1344
|
+
return isCopilotContentRestoreResult;
|
|
1345
|
+
case "copilotContent.approve":
|
|
1346
|
+
return isCopilotContentApproveResult;
|
|
1347
|
+
case "copilotContent.migrateLegacy":
|
|
1348
|
+
return isCopilotContentMigrateLegacyResult;
|
|
1349
|
+
case "copilotContent.integrationStatus":
|
|
1350
|
+
return isCopilotContentIntegrationStatusResult;
|
|
1351
|
+
case "copilotContent.customizations.list":
|
|
1352
|
+
return isCopilotCustomizationsListResult;
|
|
1353
|
+
case "copilotPlugin.list":
|
|
1354
|
+
return isCopilotPluginListResult;
|
|
1355
|
+
case "copilotPlugin.register":
|
|
1356
|
+
return isCopilotPluginRegisterResult;
|
|
1357
|
+
case "copilotPlugin.unregister":
|
|
1358
|
+
return isCopilotPluginUnregisterResult;
|
|
1359
|
+
case "copilotContent.package.install":
|
|
1360
|
+
return isCopilotPackageInstallResult;
|
|
1361
|
+
case "copilotContent.package.update":
|
|
1362
|
+
return isCopilotPackageUpdateResult;
|
|
1363
|
+
case "copilotContent.package.uninstall":
|
|
1364
|
+
return isCopilotPackageUninstallResult;
|
|
1365
|
+
case "copilotContent.package.move":
|
|
1366
|
+
return isCopilotPackageMoveResult;
|
|
1367
|
+
case "copilotContent.legacy.preview":
|
|
1368
|
+
return isCopilotLegacyPreviewResult;
|
|
1369
|
+
case "copilotContent.legacy.migrate":
|
|
1370
|
+
return isCopilotLegacyMigrateResult;
|
|
1371
|
+
case "copilotContent.sources.list":
|
|
1372
|
+
return isCopilotSourceListResult;
|
|
1373
|
+
case "copilotContent.sources.remove":
|
|
1374
|
+
return isCopilotSourceRemoveResult;
|
|
1375
|
+
case "copilotContent.package.previewUpdate":
|
|
1376
|
+
return isCopilotUpdatePreviewResult;
|
|
946
1377
|
case "auth.status":
|
|
947
1378
|
return isAuthStatus;
|
|
948
1379
|
case "auth.login":
|
|
@@ -994,13 +1425,13 @@ function isBridgeEventName(value) {
|
|
|
994
1425
|
return typeof value === "string" && BRIDGE_EVENTS.includes(value);
|
|
995
1426
|
}
|
|
996
1427
|
function isBridgeRequest(value) {
|
|
997
|
-
if (!
|
|
1428
|
+
if (!isRecord9(value)) {
|
|
998
1429
|
return false;
|
|
999
1430
|
}
|
|
1000
1431
|
return isValidProtocolVersion(value.protocolVersion) && value.kind === "request" && typeof value.id === "string" && isBridgeMethod(value.method) && "params" in value;
|
|
1001
1432
|
}
|
|
1002
1433
|
function isBridgeResponse(value) {
|
|
1003
|
-
if (!
|
|
1434
|
+
if (!isRecord9(value)) {
|
|
1004
1435
|
return false;
|
|
1005
1436
|
}
|
|
1006
1437
|
if (!isValidProtocolVersion(value.protocolVersion) || value.kind !== "response" || typeof value.id !== "string" || typeof value.ok !== "boolean") {
|
|
@@ -1012,7 +1443,7 @@ function isBridgeResponse(value) {
|
|
|
1012
1443
|
return "error" in value;
|
|
1013
1444
|
}
|
|
1014
1445
|
function isBridgeEvent(value) {
|
|
1015
|
-
if (!
|
|
1446
|
+
if (!isRecord9(value)) {
|
|
1016
1447
|
return false;
|
|
1017
1448
|
}
|
|
1018
1449
|
return isValidProtocolVersion(value.protocolVersion) && value.kind === "event" && isBridgeEventName(value.event) && "params" in value;
|
|
@@ -1020,7 +1451,7 @@ function isBridgeEvent(value) {
|
|
|
1020
1451
|
|
|
1021
1452
|
// src/cli.ts
|
|
1022
1453
|
var SERVICEME_CLI_SCHEMA_VERSION = 1;
|
|
1023
|
-
function
|
|
1454
|
+
function isRecord10(value) {
|
|
1024
1455
|
return typeof value === "object" && value !== null;
|
|
1025
1456
|
}
|
|
1026
1457
|
function createCliSuccess(data) {
|
|
@@ -1038,7 +1469,7 @@ function createCliFailure(error) {
|
|
|
1038
1469
|
};
|
|
1039
1470
|
}
|
|
1040
1471
|
function isCliEnvelope(value) {
|
|
1041
|
-
if (!
|
|
1472
|
+
if (!isRecord10(value)) {
|
|
1042
1473
|
return false;
|
|
1043
1474
|
}
|
|
1044
1475
|
if (value.schemaVersion !== SERVICEME_CLI_SCHEMA_VERSION || typeof value.ok !== "boolean") {
|
|
@@ -1072,20 +1503,20 @@ var KNOWN_ENVIRONMENT_TOOLS = [
|
|
|
1072
1503
|
"dotnet",
|
|
1073
1504
|
"nuget"
|
|
1074
1505
|
];
|
|
1075
|
-
function
|
|
1506
|
+
function isRecord11(value) {
|
|
1076
1507
|
return typeof value === "object" && value !== null;
|
|
1077
1508
|
}
|
|
1078
1509
|
function isKnownEnvironmentTool(value) {
|
|
1079
1510
|
return KNOWN_ENVIRONMENT_TOOLS.includes(value);
|
|
1080
1511
|
}
|
|
1081
1512
|
function isToolCheckResult(value) {
|
|
1082
|
-
if (!
|
|
1513
|
+
if (!isRecord11(value)) {
|
|
1083
1514
|
return false;
|
|
1084
1515
|
}
|
|
1085
1516
|
return typeof value.installed === "boolean" && (value.version === void 0 || typeof value.version === "string") && (value.path === void 0 || typeof value.path === "string") && (value.error === void 0 || typeof value.error === "string");
|
|
1086
1517
|
}
|
|
1087
1518
|
function isEnvironmentCheckResult(value) {
|
|
1088
|
-
if (!
|
|
1519
|
+
if (!isRecord11(value)) {
|
|
1089
1520
|
return false;
|
|
1090
1521
|
}
|
|
1091
1522
|
return KNOWN_ENVIRONMENT_TOOLS.every((tool) => isToolCheckResult(value[tool]));
|
|
@@ -1137,14 +1568,14 @@ var RETRYABLE_ERROR_CODES = /* @__PURE__ */ new Set([
|
|
|
1137
1568
|
"executor_timeout",
|
|
1138
1569
|
"internal_error"
|
|
1139
1570
|
]);
|
|
1140
|
-
function
|
|
1571
|
+
function isRecord12(value) {
|
|
1141
1572
|
return typeof value === "object" && value !== null;
|
|
1142
1573
|
}
|
|
1143
1574
|
function isServicemeErrorCode(value) {
|
|
1144
1575
|
return typeof value === "string" && SERVICEME_ERROR_CODES.includes(value);
|
|
1145
1576
|
}
|
|
1146
1577
|
function isServicemeErrorDetails(value) {
|
|
1147
|
-
if (!
|
|
1578
|
+
if (!isRecord12(value)) {
|
|
1148
1579
|
return false;
|
|
1149
1580
|
}
|
|
1150
1581
|
return isServicemeErrorCode(value.code) && typeof value.message === "string" && typeof value.retryable === "boolean";
|
|
@@ -1184,7 +1615,7 @@ function normalizeServicemeError(error, fallbackCode = "internal_error") {
|
|
|
1184
1615
|
if (isServicemeErrorDetails(error)) {
|
|
1185
1616
|
return error;
|
|
1186
1617
|
}
|
|
1187
|
-
if (
|
|
1618
|
+
if (isRecord12(error)) {
|
|
1188
1619
|
const code = isServicemeErrorCode(error.code) ? error.code : fallbackCode;
|
|
1189
1620
|
const message = typeof error.message === "string" ? error.message : "Unexpected serviceme error.";
|
|
1190
1621
|
const retryable = typeof error.retryable === "boolean" ? error.retryable : isRetryableErrorCode(code);
|
|
@@ -1215,69 +1646,37 @@ var SERVICEME_IMAGE_FORMATS = [
|
|
|
1215
1646
|
"png",
|
|
1216
1647
|
"webp"
|
|
1217
1648
|
];
|
|
1218
|
-
function
|
|
1649
|
+
function isRecord13(value) {
|
|
1219
1650
|
return typeof value === "object" && value !== null;
|
|
1220
1651
|
}
|
|
1221
1652
|
function isServiceMeImageFormat(value) {
|
|
1222
1653
|
return typeof value === "string" && SERVICEME_IMAGE_FORMATS.includes(value);
|
|
1223
1654
|
}
|
|
1224
1655
|
function isServiceMeImageCompressOptions(value) {
|
|
1225
|
-
if (!
|
|
1656
|
+
if (!isRecord13(value)) {
|
|
1226
1657
|
return false;
|
|
1227
1658
|
}
|
|
1228
1659
|
return typeof value.quality === "number" && typeof value.replaceOriginImage === "boolean" && (value.outputPath === void 0 || typeof value.outputPath === "string") && (value.format === void 0 || isServiceMeImageFormat(value.format)) && (value.sharpModulePath === void 0 || typeof value.sharpModulePath === "string") && (value.minimumCompressionRatio === void 0 || typeof value.minimumCompressionRatio === "number");
|
|
1229
1660
|
}
|
|
1230
1661
|
function isServiceMeImageCompressResult(value) {
|
|
1231
|
-
if (!
|
|
1662
|
+
if (!isRecord13(value)) {
|
|
1232
1663
|
return false;
|
|
1233
1664
|
}
|
|
1234
1665
|
return typeof value.originalSize === "number" && typeof value.compressedSize === "number" && typeof value.compressionRatio === "number" && typeof value.outputPath === "string";
|
|
1235
1666
|
}
|
|
1236
1667
|
function isServiceMeImageInfo(value) {
|
|
1237
|
-
if (!
|
|
1668
|
+
if (!isRecord13(value)) {
|
|
1238
1669
|
return false;
|
|
1239
1670
|
}
|
|
1240
1671
|
return typeof value.width === "number" && typeof value.height === "number" && typeof value.format === "string" && typeof value.size === "number" && (value.colorSpace === void 0 || typeof value.colorSpace === "string");
|
|
1241
1672
|
}
|
|
1242
1673
|
function isServiceMeImageValidationResult(value) {
|
|
1243
|
-
return
|
|
1244
|
-
}
|
|
1245
|
-
|
|
1246
|
-
// src/json.ts
|
|
1247
|
-
var JSON_SORT_ALGORITHMS = [
|
|
1248
|
-
"default",
|
|
1249
|
-
"keyLength",
|
|
1250
|
-
"alphaNum",
|
|
1251
|
-
"values",
|
|
1252
|
-
"type"
|
|
1253
|
-
];
|
|
1254
|
-
var JSON_SORT_ORDERS = ["asc", "desc"];
|
|
1255
|
-
var DEFAULT_JSON_SORT_OPTIONS = {
|
|
1256
|
-
sortOrder: "asc",
|
|
1257
|
-
sortAlgo: "default"
|
|
1258
|
-
};
|
|
1259
|
-
function isRecord12(value) {
|
|
1260
|
-
return typeof value === "object" && value !== null;
|
|
1261
|
-
}
|
|
1262
|
-
function isJsonSortAlgorithm(value) {
|
|
1263
|
-
return typeof value === "string" && JSON_SORT_ALGORITHMS.includes(value);
|
|
1264
|
-
}
|
|
1265
|
-
function isJsonSortOrder(value) {
|
|
1266
|
-
return typeof value === "string" && JSON_SORT_ORDERS.includes(value);
|
|
1267
|
-
}
|
|
1268
|
-
function isJsonSortOptions(value) {
|
|
1269
|
-
return isRecord12(value) && isJsonSortOrder(value.sortOrder) && isJsonSortAlgorithm(value.sortAlgo);
|
|
1270
|
-
}
|
|
1271
|
-
function isJsonValidationResult(value) {
|
|
1272
|
-
return isRecord12(value) && typeof value.valid === "boolean" && (value.error === void 0 || typeof value.error === "string");
|
|
1273
|
-
}
|
|
1274
|
-
function isJsonOutputResult(value) {
|
|
1275
|
-
return isRecord12(value) && typeof value.output === "string";
|
|
1674
|
+
return isRecord13(value) && typeof value.valid === "boolean";
|
|
1276
1675
|
}
|
|
1277
1676
|
|
|
1278
1677
|
// src/metadata.ts
|
|
1279
1678
|
var SERVICEME_CLI_NAME = "serviceme";
|
|
1280
|
-
var SERVICEME_CLI_VERSION = "
|
|
1679
|
+
var SERVICEME_CLI_VERSION = "2.0.1";
|
|
1281
1680
|
var SERVICEME_CLI_CAPABILITIES = {
|
|
1282
1681
|
bridge: true,
|
|
1283
1682
|
tasks: 1,
|
|
@@ -1288,32 +1687,32 @@ var SERVICEME_CLI_CAPABILITIES = {
|
|
|
1288
1687
|
};
|
|
1289
1688
|
|
|
1290
1689
|
// src/project.ts
|
|
1291
|
-
function
|
|
1690
|
+
function isRecord14(value) {
|
|
1292
1691
|
return typeof value === "object" && value !== null;
|
|
1293
1692
|
}
|
|
1294
1693
|
function isServiceMeProjectScaffoldPruneResult(value) {
|
|
1295
|
-
if (!
|
|
1694
|
+
if (!isRecord14(value)) {
|
|
1296
1695
|
return false;
|
|
1297
1696
|
}
|
|
1298
1697
|
return typeof value.applied === "boolean" && typeof value.preset === "string" && Array.isArray(value.commands) && value.commands.every((command) => typeof command === "string");
|
|
1299
1698
|
}
|
|
1300
1699
|
function isServiceMeProjectGitInitResult(value) {
|
|
1301
|
-
return
|
|
1700
|
+
return isRecord14(value) && typeof value.initialized === "boolean" && typeof value.command === "string";
|
|
1302
1701
|
}
|
|
1303
1702
|
function isServiceMeProjectMakeScriptsExecutableResult(value) {
|
|
1304
|
-
if (!
|
|
1703
|
+
if (!isRecord14(value)) {
|
|
1305
1704
|
return false;
|
|
1306
1705
|
}
|
|
1307
1706
|
return typeof value.processedCount === "number" && typeof value.updatedCount === "number" && typeof value.platform === "string" && Array.isArray(value.scripts) && value.scripts.every((script) => typeof script === "string");
|
|
1308
1707
|
}
|
|
1309
1708
|
function isServiceMeProjectInstallDepsResult(value) {
|
|
1310
|
-
return
|
|
1709
|
+
return isRecord14(value) && typeof value.installed === "boolean" && typeof value.command === "string";
|
|
1311
1710
|
}
|
|
1312
1711
|
function isServiceMeProjectExtractTemplateInput(value) {
|
|
1313
|
-
return
|
|
1712
|
+
return isRecord14(value) && typeof value.extractedDirName === "string" && typeof value.projectFilePattern === "string";
|
|
1314
1713
|
}
|
|
1315
1714
|
function isServiceMeProjectExtractTemplateResult(value) {
|
|
1316
|
-
return
|
|
1715
|
+
return isRecord14(value) && typeof value.actualDirName === "string";
|
|
1317
1716
|
}
|
|
1318
1717
|
|
|
1319
1718
|
// src/skill.ts
|
|
@@ -1334,7 +1733,7 @@ var VALID_SKILL_MUTATION_ACTIONS = [
|
|
|
1334
1733
|
"republish",
|
|
1335
1734
|
"submit-to-official"
|
|
1336
1735
|
];
|
|
1337
|
-
function
|
|
1736
|
+
function isRecord15(value) {
|
|
1338
1737
|
return typeof value === "object" && value !== null;
|
|
1339
1738
|
}
|
|
1340
1739
|
function isSkillScope(value) {
|
|
@@ -1346,7 +1745,7 @@ function isSkillScopeStatus(value) {
|
|
|
1346
1745
|
function isSkillMutationAction(value) {
|
|
1347
1746
|
return typeof value === "string" && VALID_SKILL_MUTATION_ACTIONS.includes(value);
|
|
1348
1747
|
}
|
|
1349
|
-
function
|
|
1748
|
+
function isStringArray3(value) {
|
|
1350
1749
|
return Array.isArray(value) && value.every((item) => typeof item === "string");
|
|
1351
1750
|
}
|
|
1352
1751
|
function isSafeResourceId2(value) {
|
|
@@ -1362,43 +1761,44 @@ function isSafeResourceId2(value) {
|
|
|
1362
1761
|
);
|
|
1363
1762
|
}
|
|
1364
1763
|
function isSkillScopeState(value) {
|
|
1365
|
-
if (!
|
|
1764
|
+
if (!isRecord15(value)) {
|
|
1366
1765
|
return false;
|
|
1367
1766
|
}
|
|
1368
1767
|
return isSkillScope(value.scope) && isSkillScopeStatus(value.status) && (value.kind === void 0 || value.kind === "builtin" || value.kind === "external") && (value.path === void 0 || typeof value.path === "string") && typeof value.isInstalled === "boolean" && typeof value.canInstall === "boolean" && typeof value.canUninstall === "boolean" && typeof value.canRemove === "boolean" && typeof value.canMoveHere === "boolean" && (value.summary === void 0 || typeof value.summary === "string");
|
|
1369
1768
|
}
|
|
1370
1769
|
function isSkillMarketplaceEntry(value) {
|
|
1371
|
-
if (!
|
|
1770
|
+
if (!isRecord15(value)) {
|
|
1372
1771
|
return false;
|
|
1373
1772
|
}
|
|
1374
1773
|
return typeof value.id === "string" && typeof value.displayName === "string" && typeof value.description === "string" && typeof value.version === "string" && typeof value.updatedAt === "string" && (value.categoryId === void 0 || typeof value.categoryId === "string") && (value.enabled === void 0 || typeof value.enabled === "boolean") && typeof value.isCatalogSkill === "boolean" && typeof value.recommended === "boolean" && typeof value.installCount === "number" && (value.requiresSetup === void 0 || typeof value.requiresSetup === "boolean") && (value.setupHint === void 0 || typeof value.setupHint === "string") && (value.homepage === void 0 || typeof value.homepage === "string") && (value.ownerScope === void 0 || isSkillScope(value.ownerScope)) && (value.ownerKind === void 0 || value.ownerKind === "builtin" || value.ownerKind === "external") && typeof value.hasConflict === "boolean" && (value.hasScripts === void 0 || typeof value.hasScripts === "boolean") && (value.hasHooks === void 0 || typeof value.hasHooks === "boolean") && (value.source === void 0 || value.source === "official" || value.source === "community" || value.source === "local") && (value.localSkillPath === void 0 || typeof value.localSkillPath === "string") && (value.canPublish === void 0 || typeof value.canPublish === "boolean") && isSkillScopeState(value.workspaceState) && isSkillScopeState(value.userState);
|
|
1375
1774
|
}
|
|
1376
1775
|
function isSkillMarketplaceState(value) {
|
|
1377
|
-
if (!
|
|
1776
|
+
if (!isRecord15(value)) {
|
|
1378
1777
|
return false;
|
|
1379
1778
|
}
|
|
1380
|
-
return typeof value.configPath === "string" && typeof value.userSkillsPath === "string" && Array.isArray(value.skills) && value.skills.every((entry) => isSkillMarketplaceEntry(entry)) && (value.enabledSkillIds === void 0 ||
|
|
1779
|
+
return typeof value.configPath === "string" && typeof value.userSkillsPath === "string" && Array.isArray(value.skills) && value.skills.every((entry) => isSkillMarketplaceEntry(entry)) && (value.enabledSkillIds === void 0 || isStringArray3(value.enabledSkillIds)) && (value.recommendedSkillIds === void 0 || isStringArray3(value.recommendedSkillIds)) && typeof value.onboardingRequired === "boolean" && typeof value.hasPersistedSelection === "boolean" && (value.workspaceOpen === void 0 || typeof value.workspaceOpen === "boolean");
|
|
1381
1780
|
}
|
|
1382
1781
|
function isSkillMutationRequest(value) {
|
|
1383
|
-
return
|
|
1782
|
+
return isRecord15(value) && isSafeResourceId2(value.skillId) && isSkillScope(value.targetScope) && isSkillMutationAction(value.action) && (value.confirmed === void 0 || typeof value.confirmed === "boolean");
|
|
1384
1783
|
}
|
|
1385
1784
|
function isSkillMutationResult(value) {
|
|
1386
|
-
return
|
|
1785
|
+
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");
|
|
1387
1786
|
}
|
|
1388
1787
|
function isSkillReconcileResult(value) {
|
|
1389
|
-
return
|
|
1788
|
+
return isRecord15(value) && isSkillMarketplaceState(value.state) && typeof value.changed === "boolean";
|
|
1390
1789
|
}
|
|
1391
1790
|
function isPublishableSkillEntry(value) {
|
|
1392
|
-
return
|
|
1791
|
+
return isRecord15(value) && typeof value.id === "string" && typeof value.displayName === "string" && typeof value.path === "string" && (value.version === void 0 || typeof value.version === "string");
|
|
1393
1792
|
}
|
|
1394
1793
|
function isSkillPublishableResult(value) {
|
|
1395
|
-
return
|
|
1794
|
+
return isRecord15(value) && Array.isArray(value.skills) && value.skills.every((entry) => isPublishableSkillEntry(entry));
|
|
1396
1795
|
}
|
|
1397
1796
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1398
1797
|
0 && (module.exports = {
|
|
1399
1798
|
AUTH_PROVIDERS,
|
|
1400
1799
|
BRIDGE_EVENTS,
|
|
1401
1800
|
BRIDGE_METHODS,
|
|
1801
|
+
COPILOT_CONTENT_METHOD_ALIASES,
|
|
1402
1802
|
COPILOT_ERROR_CODES,
|
|
1403
1803
|
DEFAULT_JSON_SORT_OPTIONS,
|
|
1404
1804
|
DEVICE_BINDING_STATES,
|
|
@@ -1443,6 +1843,42 @@ function isSkillPublishableResult(value) {
|
|
|
1443
1843
|
isBridgeRequest,
|
|
1444
1844
|
isBridgeResponse,
|
|
1445
1845
|
isCliEnvelope,
|
|
1846
|
+
isCopilotContentAdoptUnmanagedParams,
|
|
1847
|
+
isCopilotContentAdoptUnmanagedResult,
|
|
1848
|
+
isCopilotContentApproveResult,
|
|
1849
|
+
isCopilotContentDetectUnmanagedParams,
|
|
1850
|
+
isCopilotContentDetectUnmanagedResult,
|
|
1851
|
+
isCopilotContentIntegrationStatusResult,
|
|
1852
|
+
isCopilotContentMigrateLegacyResult,
|
|
1853
|
+
isCopilotContentRestoreResult,
|
|
1854
|
+
isCopilotContentStatusResult,
|
|
1855
|
+
isCopilotCustomizationViewPayload,
|
|
1856
|
+
isCopilotCustomizationsListParams,
|
|
1857
|
+
isCopilotCustomizationsListResult,
|
|
1858
|
+
isCopilotLegacyMigrateParams,
|
|
1859
|
+
isCopilotLegacyMigrateResult,
|
|
1860
|
+
isCopilotLegacyPreviewParams,
|
|
1861
|
+
isCopilotLegacyPreviewResult,
|
|
1862
|
+
isCopilotPackageInstallParams,
|
|
1863
|
+
isCopilotPackageInstallResult,
|
|
1864
|
+
isCopilotPackageMoveParams,
|
|
1865
|
+
isCopilotPackageMoveResult,
|
|
1866
|
+
isCopilotPackageUninstallParams,
|
|
1867
|
+
isCopilotPackageUninstallResult,
|
|
1868
|
+
isCopilotPackageUpdateParams,
|
|
1869
|
+
isCopilotPackageUpdateResult,
|
|
1870
|
+
isCopilotPluginListParams,
|
|
1871
|
+
isCopilotPluginListResult,
|
|
1872
|
+
isCopilotPluginRegisterParams,
|
|
1873
|
+
isCopilotPluginRegisterResult,
|
|
1874
|
+
isCopilotPluginUnregisterParams,
|
|
1875
|
+
isCopilotPluginUnregisterResult,
|
|
1876
|
+
isCopilotSourceListParams,
|
|
1877
|
+
isCopilotSourceListResult,
|
|
1878
|
+
isCopilotSourceRemoveParams,
|
|
1879
|
+
isCopilotSourceRemoveResult,
|
|
1880
|
+
isCopilotUpdatePreviewParams,
|
|
1881
|
+
isCopilotUpdatePreviewResult,
|
|
1446
1882
|
isDeviceBindingState,
|
|
1447
1883
|
isDeviceEnrollParams,
|
|
1448
1884
|
isDeviceEnrollResult,
|
|
@@ -1460,6 +1896,7 @@ function isSkillPublishableResult(value) {
|
|
|
1460
1896
|
isJsonSortOrder,
|
|
1461
1897
|
isJsonValidationResult,
|
|
1462
1898
|
isKnownEnvironmentTool,
|
|
1899
|
+
isRecord,
|
|
1463
1900
|
isRepoAddParams,
|
|
1464
1901
|
isRepoAddResult,
|
|
1465
1902
|
isRepoDisableParams,
|
|
@@ -1514,6 +1951,8 @@ function isSkillPublishableResult(value) {
|
|
|
1514
1951
|
isSkillRepoListLinkedResult,
|
|
1515
1952
|
isSkillRepoListParams,
|
|
1516
1953
|
isSkillRepoListResult,
|
|
1954
|
+
isSkillRepoSetEntryEnabledParams,
|
|
1955
|
+
isSkillRepoSetEntryEnabledResult,
|
|
1517
1956
|
isSkillRepoUninstallParams,
|
|
1518
1957
|
isSkillRepoUninstallResult,
|
|
1519
1958
|
isSystemHelloResult,
|
|
@@ -1541,5 +1980,6 @@ function isSkillPublishableResult(value) {
|
|
|
1541
1980
|
isToolboxUpdateResult,
|
|
1542
1981
|
migrateTaskV1ToV2,
|
|
1543
1982
|
migrateV1ToV2,
|
|
1983
|
+
normalizeBridgeMethod,
|
|
1544
1984
|
normalizeServicemeError
|
|
1545
1985
|
});
|