@serviceme/devtools-protocol 2.0.0 → 2.0.2

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