@serviceme/devtools-protocol 0.1.9 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +1026 -130
- package/dist/index.d.ts +1026 -130
- package/dist/index.js +859 -142
- package/dist/index.mjs +790 -142
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -83,8 +83,613 @@ declare function isAgentMutationResult(value: unknown): value is AgentMutationRe
|
|
|
83
83
|
declare function isAgentPermissionSummary(value: unknown): value is AgentPermissionSummary;
|
|
84
84
|
declare function isAgentPermissionsResult(value: unknown): value is AgentPermissionsResult;
|
|
85
85
|
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
/**
|
|
87
|
+
* Phantom brand types — compile-time guards against accidental string mixing.
|
|
88
|
+
*
|
|
89
|
+
* Per ADL-004 the protocol package must keep zero runtime dependencies, so
|
|
90
|
+
* we cannot use `z.string().brand<SecretToken>()`. Instead we use the
|
|
91
|
+
* canonical TypeScript phantom-type pattern:
|
|
92
|
+
*
|
|
93
|
+
* type SecretToken = string & { readonly __brand: "SecretToken" };
|
|
94
|
+
*
|
|
95
|
+
* This makes:
|
|
96
|
+
* const t: string = someSecret; // OK
|
|
97
|
+
* const t: SecretToken = "raw"; // compile error
|
|
98
|
+
* const t: SecretToken = someSecret as SecretToken; // explicit ack
|
|
99
|
+
*
|
|
100
|
+
* The runtime value is still a plain `string`; the brand is purely a
|
|
101
|
+
* compile-time tag. Combined with the rule "no `JSON.stringify` /
|
|
102
|
+
* `.toString()` / `.includes(...)` on a `SecretToken` field", it
|
|
103
|
+
* prevents the most common accidental-leak classes.
|
|
104
|
+
*/
|
|
105
|
+
/**
|
|
106
|
+
* A token-bearing string (OAuth / device / refresh token byte buffer).
|
|
107
|
+
*
|
|
108
|
+
* Lives only in OS keychain (CLI) or VSCode SecretStorage (Extension)
|
|
109
|
+
* per ADL-004 §不变量. Crossing the bridge requires the `auth.tokenRead`
|
|
110
|
+
* capability and the Extension process advertising it.
|
|
111
|
+
*/
|
|
112
|
+
type SecretToken = string & {
|
|
113
|
+
readonly __serviceme_secret_brand: "SecretToken";
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* A device HMAC secret byte buffer.
|
|
117
|
+
*
|
|
118
|
+
* Lives only in the IdentityStore JSON file (Phase 5.2 `DeviceCore`).
|
|
119
|
+
* Cross-process consumers see only `publicId` + `secretVersion`.
|
|
120
|
+
*/
|
|
121
|
+
type DeviceSecret = string & {
|
|
122
|
+
readonly __serviceme_secret_brand: "DeviceSecret";
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Auth protocol — Phase 5.1 cross-process contract.
|
|
127
|
+
*
|
|
128
|
+
* Per ADL-003 these pure data models live in `@serviceme/devtools-protocol`,
|
|
129
|
+
* NOT `@serviceme/shared`. Per ADL-004 the auth token byte string **never**
|
|
130
|
+
* crosses the bridge or any protocol payload — it lives only in OS keychain
|
|
131
|
+
* (CLI) or VSCode SecretStorage (Extension). `SecretToken` is a TypeScript
|
|
132
|
+
* phantom brand used purely as a static-typing guarantee against accidental
|
|
133
|
+
* string→token mixing at compile time.
|
|
134
|
+
*
|
|
135
|
+
* Wire shapes for the bridge methods (`auth.status`, `auth.login`, …) follow
|
|
136
|
+
* `docs/requirements/phase-5-auth-device-toolbox/3.功能拆分.md` §3
|
|
137
|
+
* (Bridge method 新增). Result types are always objects so the wire format
|
|
138
|
+
* matches the rest of `BridgeMethodMap`.
|
|
139
|
+
*/
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Authentication providers registered with `AuthCore`.
|
|
143
|
+
*
|
|
144
|
+
* String union (not TS enum) to match the rest of the protocol package —
|
|
145
|
+
* `apps/extension/src/core/auth/types.ts` uses an equivalent TS enum whose
|
|
146
|
+
* values are the same strings; the protocol type is the canonical cross-
|
|
147
|
+
* process contract.
|
|
148
|
+
*/
|
|
149
|
+
type AuthProvider = "github" | "microsoft";
|
|
150
|
+
declare const AUTH_PROVIDERS: readonly AuthProvider[];
|
|
151
|
+
/**
|
|
152
|
+
* Lightweight account metadata safe to serialize across the bridge.
|
|
153
|
+
*
|
|
154
|
+
* Contains **no** token bytes, refresh tokens, or any secret material —
|
|
155
|
+
* those stay in OS keychain / SecretStorage. Only identity + display
|
|
156
|
+
* fields + non-sensitive timing info cross the wire.
|
|
157
|
+
*/
|
|
158
|
+
interface AuthAccountMeta {
|
|
159
|
+
/** Provider-side unique id (e.g. GitHub user id, MSA oid). */
|
|
160
|
+
id: string;
|
|
161
|
+
provider: AuthProvider;
|
|
162
|
+
/** Best-effort display name (GitHub `name`, MSA `displayName`, etc.). */
|
|
163
|
+
displayName?: string;
|
|
164
|
+
/** Login handle (e.g. GitHub `login`, MSA userPrincipalName). */
|
|
165
|
+
login?: string;
|
|
166
|
+
email?: string;
|
|
167
|
+
avatarUrl?: string;
|
|
168
|
+
/** Token expiry as unix ms — `null` / `undefined` for sessions without expiry. */
|
|
169
|
+
expiresAt?: number | null;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Outcome of `auth.login` (device-flow initiation).
|
|
173
|
+
*
|
|
174
|
+
* Per ADL-004 token bytes never cross the bridge — the actual token is
|
|
175
|
+
* stored via SecretStorage (Extension) or keyring (CLI) by the runtime
|
|
176
|
+
* that received it. This shape only exposes device-flow UI hooks so the
|
|
177
|
+
* user can complete the OAuth handshake.
|
|
178
|
+
*/
|
|
179
|
+
interface AuthLoginResult {
|
|
180
|
+
provider: AuthProvider;
|
|
181
|
+
/** GitHub device-flow user code shown to the user (e.g. "ABCD-1234"). */
|
|
182
|
+
userCode?: string;
|
|
183
|
+
/** Verification URL the user must open (e.g. https://github.com/login/device). */
|
|
184
|
+
verificationUrl?: string;
|
|
185
|
+
/** Unix-ms expiry of the device-flow code itself (NOT the token). */
|
|
186
|
+
expiresAt?: number;
|
|
187
|
+
/** Optional human-readable copy for the UI. */
|
|
188
|
+
message?: string;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Lightweight, non-secret handle to the active auth session.
|
|
192
|
+
*
|
|
193
|
+
* The full `AuthState` (token + refresh token) lives in the Extension
|
|
194
|
+
* SecretStorage; this protocol payload is what crosses the bridge.
|
|
195
|
+
*/
|
|
196
|
+
interface AuthSessionHandle {
|
|
197
|
+
provider: AuthProvider;
|
|
198
|
+
account?: AuthAccountMeta;
|
|
199
|
+
/** Unix-ms token expiry; mirrors the same field on `AuthAccountMeta`. */
|
|
200
|
+
expiresAt?: number | null;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Snapshot of all known authentication providers — used by `auth.status`.
|
|
204
|
+
*
|
|
205
|
+
* Mirrors `3.功能拆分.md` §3 wire shape: `{ activeProvider, accounts }`.
|
|
206
|
+
* `accounts` is keyed by provider so multi-account lookups are O(1).
|
|
207
|
+
*/
|
|
208
|
+
interface AuthStatus {
|
|
209
|
+
activeProvider: AuthProvider | null;
|
|
210
|
+
accounts: Partial<Record<AuthProvider, AuthAccountMeta>>;
|
|
211
|
+
hasAnySession: boolean;
|
|
212
|
+
lastError?: string;
|
|
213
|
+
}
|
|
214
|
+
/** `auth.status` — no params. */
|
|
215
|
+
type AuthStatusParams = Record<string, never>;
|
|
216
|
+
/** `auth.login` — triggers device flow for the chosen provider. */
|
|
217
|
+
interface AuthLoginParams {
|
|
218
|
+
provider: AuthProvider;
|
|
219
|
+
/** When true, skip cached session and force re-auth. */
|
|
220
|
+
force?: boolean;
|
|
221
|
+
}
|
|
222
|
+
/** `auth.logout` — clears session locally (token bytes removed at the source). */
|
|
223
|
+
interface AuthLogoutParams {
|
|
224
|
+
/** Provider to log out; omit to log out every active provider. */
|
|
225
|
+
provider?: AuthProvider;
|
|
226
|
+
}
|
|
227
|
+
interface AuthLogoutResult {
|
|
228
|
+
/** Provider that was affected (null when no session existed). */
|
|
229
|
+
provider: AuthProvider | null;
|
|
230
|
+
success: boolean;
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* `auth.whoami` — minimal identity for the active session.
|
|
234
|
+
*
|
|
235
|
+
* Per `3.功能拆分.md` §3 the wire shape is
|
|
236
|
+
* `{ provider, login, name, avatarUrl, email? }`. We wrap it in an object
|
|
237
|
+
* so the bridge result stays object-shaped (consistent with every other
|
|
238
|
+
* method in `BridgeMethodMap`); consumer-side `null` ⇒ unauthenticated.
|
|
239
|
+
*/
|
|
240
|
+
interface AuthWhoamiResult {
|
|
241
|
+
provider: AuthProvider | null;
|
|
242
|
+
login?: string;
|
|
243
|
+
name?: string;
|
|
244
|
+
avatarUrl?: string;
|
|
245
|
+
email?: string;
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* `auth.switch` — flip the active provider to the requested one.
|
|
249
|
+
*
|
|
250
|
+
* Added per `2.需求澄清.md` §2.3 owner decision (CLI/QuickPick parity).
|
|
251
|
+
*/
|
|
252
|
+
interface AuthSwitchParams {
|
|
253
|
+
provider: AuthProvider;
|
|
254
|
+
}
|
|
255
|
+
interface AuthSwitchResult {
|
|
256
|
+
activeProvider: AuthProvider | null;
|
|
257
|
+
account: AuthAccountMeta | null;
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Future-facing read-write handle to a `SecretToken` — exposed only when
|
|
261
|
+
* the bridge advertised `capabilities.auth.tokenRead` (Extension process
|
|
262
|
+
* only, see ADL-004 §不变量). The `SecretToken` brand is the static-typing
|
|
263
|
+
* guard: a plain `string` can never be assigned into a `SecretToken`
|
|
264
|
+
* field without a runtime/compile-time brand assertion, preventing
|
|
265
|
+
* accidental leak via plain `string` parameters.
|
|
266
|
+
*/
|
|
267
|
+
type AuthTokenEnvelope = {
|
|
268
|
+
/** Token bytes — never logged, never emitted over the wire unless the
|
|
269
|
+
* Extension advertised `auth.tokenRead`. */
|
|
270
|
+
token: SecretToken;
|
|
271
|
+
provider: AuthProvider;
|
|
272
|
+
accountId: string;
|
|
273
|
+
};
|
|
274
|
+
declare function isAuthProvider(value: unknown): value is AuthProvider;
|
|
275
|
+
declare function isAuthAccountMeta(value: unknown): value is AuthAccountMeta;
|
|
276
|
+
declare function isAuthLoginResult(value: unknown): value is AuthLoginResult;
|
|
277
|
+
declare function isAuthSessionHandle(value: unknown): value is AuthSessionHandle;
|
|
278
|
+
declare function isAuthStatus(value: unknown): value is AuthStatus;
|
|
279
|
+
declare function isAuthLoginParams(value: unknown): value is AuthLoginParams;
|
|
280
|
+
declare function isAuthLogoutParams(value: unknown): value is AuthLogoutParams;
|
|
281
|
+
declare function isAuthLogoutResult(value: unknown): value is AuthLogoutResult;
|
|
282
|
+
declare function isAuthWhoamiResult(value: unknown): value is AuthWhoamiResult;
|
|
283
|
+
declare function isAuthSwitchParams(value: unknown): value is AuthSwitchParams;
|
|
284
|
+
declare function isAuthSwitchResult(value: unknown): value is AuthSwitchResult;
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* Skill & Agent v2 — Bridge protocol methods for the v2 skill/agent
|
|
288
|
+
* repository pipeline (M5).
|
|
289
|
+
*
|
|
290
|
+
* Two new top-level method groups land here per
|
|
291
|
+
* docs/architecture/skill-agent-v2-repo.md §6:
|
|
292
|
+
*
|
|
293
|
+
* - **`skillRepo.*`** — read + install skills/agents from local clones
|
|
294
|
+
* - **`repo.*`** — manage the repo catalog (CRUD + sync)
|
|
295
|
+
*
|
|
296
|
+
* Draft methods (`skillRepo.draft.*`) and the `repo.syncAll` orchestrator
|
|
297
|
+
* are typed for forward compatibility but their bridge handlers are
|
|
298
|
+
* not wired in this PR — they land alongside the CLI/extension
|
|
299
|
+
* integration in subsequent M5 follow-ups.
|
|
300
|
+
*
|
|
301
|
+
* All shapes are pure types. Runtime validation lives in
|
|
302
|
+
* `isXxxResult` helpers in the bottom half of this file. Validators
|
|
303
|
+
* are deliberately structural (no zod) so the protocol package
|
|
304
|
+
* stays zero-dep.
|
|
305
|
+
*/
|
|
306
|
+
/** Kinds of artifacts in the catalog. */
|
|
307
|
+
type BridgeSkillKind = "skill" | "agent";
|
|
308
|
+
/** Which side of the link is reported. Matches SkillLinker's `LinkMode`. */
|
|
309
|
+
type BridgeLinkMode = "symlink" | "junction" | "copy";
|
|
310
|
+
/** A single skill/agent entry inside a repo (SkillStore.SkillEntry). */
|
|
311
|
+
interface BridgeSkillRepoEntry {
|
|
312
|
+
repoId: string;
|
|
313
|
+
name: string;
|
|
314
|
+
kind: BridgeSkillKind;
|
|
315
|
+
/** Absolute path to the manifest file. */
|
|
316
|
+
manifestPath: string;
|
|
317
|
+
/** Absolute path to the entry's directory. */
|
|
318
|
+
dir: string;
|
|
319
|
+
/** Best-effort parsed frontmatter. */
|
|
320
|
+
frontmatter: Record<string, unknown>;
|
|
321
|
+
/** ISO timestamp of the manifest's mtime. */
|
|
322
|
+
modifiedAt: string;
|
|
323
|
+
}
|
|
324
|
+
/** A single file inside an entry (SkillStore.SkillFile). */
|
|
325
|
+
interface BridgeSkillRepoFile {
|
|
326
|
+
/** Path relative to the entry's directory. */
|
|
327
|
+
path: string;
|
|
328
|
+
/** UTF-8 content. */
|
|
329
|
+
content: string;
|
|
330
|
+
}
|
|
331
|
+
/** Detailed view: entry + all the files inside it. */
|
|
332
|
+
interface BridgeSkillRepoDetail extends BridgeSkillRepoEntry {
|
|
333
|
+
files: BridgeSkillRepoFile[];
|
|
334
|
+
}
|
|
335
|
+
/** A symlink/junction currently present in a workspace or user (global) scope. */
|
|
336
|
+
interface BridgeLinkedSkill {
|
|
337
|
+
repoId: string;
|
|
338
|
+
name: string;
|
|
339
|
+
linkPath: string;
|
|
340
|
+
targetPath: string;
|
|
341
|
+
mode: BridgeLinkMode;
|
|
342
|
+
/** Which scope this link lives in — "workspace" or "user" (global, `~/.agents/...`). */
|
|
343
|
+
scope: "workspace" | "user";
|
|
344
|
+
}
|
|
345
|
+
/** `skillRepo.list` — enumerate available skills/agents. */
|
|
346
|
+
interface SkillRepoListParams {
|
|
347
|
+
/** Restrict to one repo; omit to list across all. */
|
|
348
|
+
repoId?: string;
|
|
349
|
+
/** Restrict to one kind; omit to include both skills + agents. */
|
|
350
|
+
kind?: BridgeSkillKind;
|
|
351
|
+
}
|
|
352
|
+
interface SkillRepoListResult {
|
|
353
|
+
entries: BridgeSkillRepoEntry[];
|
|
354
|
+
}
|
|
355
|
+
/** `skillRepo.get` — full detail of one entry. */
|
|
356
|
+
interface SkillRepoGetParams {
|
|
357
|
+
repoId: string;
|
|
358
|
+
name: string;
|
|
359
|
+
}
|
|
360
|
+
interface SkillRepoGetResult extends BridgeSkillRepoDetail {
|
|
361
|
+
}
|
|
362
|
+
/** `skillRepo.install` — link an entry into a workspace or the global user scope. */
|
|
363
|
+
interface SkillRepoInstallParams {
|
|
364
|
+
repoId: string;
|
|
365
|
+
name: string;
|
|
366
|
+
workspaceDir: string;
|
|
367
|
+
/** "skill" (default) or "agent" — selects the repo subfolder + scan directory. */
|
|
368
|
+
kind?: BridgeSkillKind;
|
|
369
|
+
/** Override the link mode. Defaults to platform-optimal. */
|
|
370
|
+
mode?: "auto" | BridgeLinkMode;
|
|
371
|
+
/**
|
|
372
|
+
* Which scope to install into. "workspace" (default, back-compat)
|
|
373
|
+
* links into `<workspaceDir>/.github/...`; "user" links into the
|
|
374
|
+
* global `~/.agents/...` scope, visible to every workspace.
|
|
375
|
+
*/
|
|
376
|
+
scope?: "workspace" | "user";
|
|
377
|
+
}
|
|
378
|
+
interface SkillRepoInstallResult {
|
|
379
|
+
mode: BridgeLinkMode;
|
|
380
|
+
linkPath: string;
|
|
381
|
+
targetPath: string;
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* `skillRepo.convertToSymlink` — replace an existing, real (non-symlink)
|
|
385
|
+
* skill/agent directory at the standard scan path with a symlink into
|
|
386
|
+
* the matching global repo entry. Same params/result shape as
|
|
387
|
+
* `skillRepo.install`; the handler refuses when there's nothing real
|
|
388
|
+
* to convert (already a symlink, or nothing installed).
|
|
389
|
+
*/
|
|
390
|
+
interface SkillRepoConvertToSymlinkParams {
|
|
391
|
+
repoId: string;
|
|
392
|
+
name: string;
|
|
393
|
+
workspaceDir: string;
|
|
394
|
+
/** "skill" (default) or "agent". */
|
|
395
|
+
kind?: BridgeSkillKind;
|
|
396
|
+
/** Override the link mode. Defaults to platform-optimal. */
|
|
397
|
+
mode?: "auto" | BridgeLinkMode;
|
|
398
|
+
/** "workspace" (default) or "user" (global) scope. */
|
|
399
|
+
scope?: "workspace" | "user";
|
|
400
|
+
}
|
|
401
|
+
interface SkillRepoConvertToSymlinkResult {
|
|
402
|
+
mode: BridgeLinkMode;
|
|
403
|
+
linkPath: string;
|
|
404
|
+
targetPath: string;
|
|
405
|
+
}
|
|
406
|
+
/** `skillRepo.uninstall` — remove a link from a workspace or the global user scope. */
|
|
407
|
+
interface SkillRepoUninstallParams {
|
|
408
|
+
repoId: string;
|
|
409
|
+
name: string;
|
|
410
|
+
workspaceDir: string;
|
|
411
|
+
/** "skill" (default) or "agent". */
|
|
412
|
+
kind?: BridgeSkillKind;
|
|
413
|
+
/** "workspace" (default) or "user" (global) scope. */
|
|
414
|
+
scope?: "workspace" | "user";
|
|
415
|
+
}
|
|
416
|
+
interface SkillRepoUninstallResult {
|
|
417
|
+
removed: true;
|
|
418
|
+
}
|
|
419
|
+
/** `skillRepo.listLinked` — every link currently in a workspace and/or user (global) scope. */
|
|
420
|
+
interface SkillRepoListLinkedParams {
|
|
421
|
+
workspaceDir: string;
|
|
422
|
+
/** "skill" (default) or "agent". */
|
|
423
|
+
kind?: BridgeSkillKind;
|
|
424
|
+
/**
|
|
425
|
+
* Which scope(s) to scan. "workspace" (default, back-compat) scans only
|
|
426
|
+
* `<workspaceDir>/.github/...`; "user" scans only the global
|
|
427
|
+
* `~/.agents/...` scope; "all" scans and merges both.
|
|
428
|
+
*/
|
|
429
|
+
scope?: "workspace" | "user" | "all";
|
|
430
|
+
}
|
|
431
|
+
interface SkillRepoListLinkedResult {
|
|
432
|
+
links: BridgeLinkedSkill[];
|
|
433
|
+
}
|
|
434
|
+
/** `skillRepo.draft.create` — start a new draft. */
|
|
435
|
+
interface SkillRepoDraftCreateParams {
|
|
436
|
+
kind: BridgeSkillKind;
|
|
437
|
+
/** Files including a manifest (SKILL.md or AGENT.md). */
|
|
438
|
+
files: BridgeSkillRepoFile[];
|
|
439
|
+
/** Optional caller-supplied id (otherwise 16-hex-char random). */
|
|
440
|
+
id?: string;
|
|
441
|
+
}
|
|
442
|
+
interface SkillRepoDraftCreateResult {
|
|
443
|
+
id: string;
|
|
444
|
+
}
|
|
445
|
+
/** `skillRepo.draft.commit` — push a draft to its target repo. */
|
|
446
|
+
interface SkillRepoDraftCommitParams {
|
|
447
|
+
kind: BridgeSkillKind;
|
|
448
|
+
id: string;
|
|
449
|
+
/** Target repo. Must have `writeEnabled: true`. */
|
|
450
|
+
repoId: string;
|
|
451
|
+
/** Optional override; otherwise defaults to the draft's manifest `name`. */
|
|
452
|
+
skillName?: string;
|
|
453
|
+
/** Optional override; otherwise defaults to main. */
|
|
454
|
+
branch?: string;
|
|
455
|
+
/** When true, skip the network push (local commit only). */
|
|
456
|
+
skipPush?: boolean;
|
|
457
|
+
}
|
|
458
|
+
interface SkillRepoDraftCommitResult {
|
|
459
|
+
repoId: string;
|
|
460
|
+
skillName: string;
|
|
461
|
+
commitSha: string;
|
|
462
|
+
pushedRef?: string;
|
|
463
|
+
pushedSha?: string;
|
|
464
|
+
}
|
|
465
|
+
/** `skillRepo.draft.list` — list drafts of a kind. */
|
|
466
|
+
interface SkillRepoDraftListParams {
|
|
467
|
+
kind: BridgeSkillKind;
|
|
468
|
+
}
|
|
469
|
+
interface SkillRepoDraftListResult {
|
|
470
|
+
drafts: Array<{
|
|
471
|
+
id: string;
|
|
472
|
+
kind: BridgeSkillKind;
|
|
473
|
+
name: string;
|
|
474
|
+
description: string;
|
|
475
|
+
modifiedAt: string;
|
|
476
|
+
}>;
|
|
477
|
+
}
|
|
478
|
+
/** `skillRepo.draft.delete` — remove a draft. */
|
|
479
|
+
interface SkillRepoDraftDeleteParams {
|
|
480
|
+
kind: BridgeSkillKind;
|
|
481
|
+
id: string;
|
|
482
|
+
}
|
|
483
|
+
interface SkillRepoDraftDeleteResult {
|
|
484
|
+
deleted: true;
|
|
485
|
+
}
|
|
486
|
+
/** A single entry from `repos.json` (subset of RepoConfig). */
|
|
487
|
+
interface BridgeRepoEntry {
|
|
488
|
+
id: string;
|
|
489
|
+
name: string;
|
|
490
|
+
url: string;
|
|
491
|
+
branch: string;
|
|
492
|
+
enabled: boolean;
|
|
493
|
+
writeEnabled: boolean;
|
|
494
|
+
source: "default" | "user";
|
|
495
|
+
description?: string;
|
|
496
|
+
addedAt: string;
|
|
497
|
+
lastSyncAt?: string;
|
|
498
|
+
lastSyncCommitSha?: string;
|
|
499
|
+
lastSyncStatus?: "ok" | "error";
|
|
500
|
+
lastSyncError?: string;
|
|
501
|
+
}
|
|
502
|
+
/** A single line of a sync run. */
|
|
503
|
+
interface BridgeRepoSyncPull {
|
|
504
|
+
repoId: string;
|
|
505
|
+
status: "ok" | "error";
|
|
506
|
+
commitSha?: string;
|
|
507
|
+
error?: string;
|
|
508
|
+
}
|
|
509
|
+
/** `repo.list` — enumerate known repos. */
|
|
510
|
+
interface RepoListParams {
|
|
511
|
+
/** Optional source filter; default includes both. */
|
|
512
|
+
source?: "default" | "user";
|
|
513
|
+
}
|
|
514
|
+
interface RepoListResult {
|
|
515
|
+
repos: BridgeRepoEntry[];
|
|
516
|
+
}
|
|
517
|
+
/** `repo.add` — add a user repo. */
|
|
518
|
+
interface RepoAddParams {
|
|
519
|
+
url: string;
|
|
520
|
+
/** Auto-detected from upstream when omitted. */
|
|
521
|
+
branch?: string;
|
|
522
|
+
/** Optional display name. */
|
|
523
|
+
name?: string;
|
|
524
|
+
}
|
|
525
|
+
interface RepoAddResult {
|
|
526
|
+
repo: BridgeRepoEntry;
|
|
527
|
+
branch: string;
|
|
528
|
+
cloned: boolean;
|
|
529
|
+
}
|
|
530
|
+
/** `repo.remove` — remove a user repo. */
|
|
531
|
+
interface RepoRemoveParams {
|
|
532
|
+
repoId: string;
|
|
533
|
+
}
|
|
534
|
+
interface RepoRemoveResult {
|
|
535
|
+
removed: true;
|
|
536
|
+
}
|
|
537
|
+
/** `repo.enable` — flip the `enabled` flag to true. */
|
|
538
|
+
interface RepoEnableParams {
|
|
539
|
+
repoId: string;
|
|
540
|
+
}
|
|
541
|
+
interface RepoEnableResult {
|
|
542
|
+
repo: BridgeRepoEntry;
|
|
543
|
+
}
|
|
544
|
+
/** `repo.disable` — flip the `enabled` flag to false. */
|
|
545
|
+
interface RepoDisableParams {
|
|
546
|
+
repoId: string;
|
|
547
|
+
}
|
|
548
|
+
interface RepoDisableResult {
|
|
549
|
+
repo: BridgeRepoEntry;
|
|
550
|
+
}
|
|
551
|
+
/** `repo.sync` — pull a single repo. */
|
|
552
|
+
interface RepoSyncParams {
|
|
553
|
+
repoId: string;
|
|
554
|
+
}
|
|
555
|
+
interface RepoSyncResult {
|
|
556
|
+
pulls: [BridgeRepoSyncPull];
|
|
557
|
+
}
|
|
558
|
+
/** `repo.syncAll` — pull every enabled repo. */
|
|
559
|
+
type RepoSyncAllParams = {};
|
|
560
|
+
interface RepoSyncAllResult {
|
|
561
|
+
pulls: BridgeRepoSyncPull[];
|
|
562
|
+
}
|
|
563
|
+
declare function isSkillRepoListResult(value: unknown): value is SkillRepoListResult;
|
|
564
|
+
declare function isSkillRepoGetResult(value: unknown): value is SkillRepoGetResult;
|
|
565
|
+
declare function isSkillRepoInstallResult(value: unknown): value is SkillRepoInstallResult;
|
|
566
|
+
declare function isSkillRepoConvertToSymlinkResult(value: unknown): value is SkillRepoConvertToSymlinkResult;
|
|
567
|
+
declare function isSkillRepoUninstallResult(value: unknown): value is SkillRepoUninstallResult;
|
|
568
|
+
declare function isSkillRepoListLinkedResult(value: unknown): value is SkillRepoListLinkedResult;
|
|
569
|
+
declare function isSkillRepoDraftCreateResult(value: unknown): value is SkillRepoDraftCreateResult;
|
|
570
|
+
declare function isSkillRepoDraftCommitResult(value: unknown): value is SkillRepoDraftCommitResult;
|
|
571
|
+
declare function isSkillRepoDraftListResult(value: unknown): value is SkillRepoDraftListResult;
|
|
572
|
+
declare function isSkillRepoDraftDeleteResult(value: unknown): value is SkillRepoDraftDeleteResult;
|
|
573
|
+
declare function isRepoListResult(value: unknown): value is RepoListResult;
|
|
574
|
+
declare function isRepoAddResult(value: unknown): value is RepoAddResult;
|
|
575
|
+
declare function isRepoRemoveResult(value: unknown): value is RepoRemoveResult;
|
|
576
|
+
declare function isRepoEnableResult(value: unknown): value is RepoEnableResult;
|
|
577
|
+
declare function isRepoDisableResult(value: unknown): value is RepoDisableResult;
|
|
578
|
+
declare function isRepoSyncResult(value: unknown): value is RepoSyncResult;
|
|
579
|
+
declare function isRepoSyncAllResult(value: unknown): value is RepoSyncAllResult;
|
|
580
|
+
declare function isSkillRepoListParams(value: unknown): value is SkillRepoListParams;
|
|
581
|
+
declare function isSkillRepoGetParams(value: unknown): value is SkillRepoGetParams;
|
|
582
|
+
declare function isSkillRepoInstallParams(value: unknown): value is SkillRepoInstallParams;
|
|
583
|
+
declare function isSkillRepoConvertToSymlinkParams(value: unknown): value is SkillRepoConvertToSymlinkParams;
|
|
584
|
+
declare function isSkillRepoUninstallParams(value: unknown): value is SkillRepoUninstallParams;
|
|
585
|
+
declare function isSkillRepoListLinkedParams(value: unknown): value is SkillRepoListLinkedParams;
|
|
586
|
+
declare function isRepoListParams(value: unknown): value is RepoListParams;
|
|
587
|
+
declare function isRepoAddParams(value: unknown): value is RepoAddParams;
|
|
588
|
+
declare function isRepoRemoveParams(value: unknown): value is RepoRemoveParams;
|
|
589
|
+
declare function isRepoEnableParams(value: unknown): value is RepoEnableParams;
|
|
590
|
+
declare function isRepoDisableParams(value: unknown): value is RepoDisableParams;
|
|
591
|
+
declare function isRepoSyncParams(value: unknown): value is RepoSyncParams;
|
|
592
|
+
declare function isRepoSyncAllParams(value: unknown): value is RepoSyncAllParams;
|
|
593
|
+
|
|
594
|
+
/**
|
|
595
|
+
* Device protocol — Phase 5.1 cross-process contract.
|
|
596
|
+
*
|
|
597
|
+
* Per ADL-003 these pure data models live in `@serviceme/devtools-protocol`,
|
|
598
|
+
* NOT `@serviceme/shared`. Per `2.需求澄清.md` §1.2 the binding-state
|
|
599
|
+
* machine is `anonymous → pending → claimed → expired` and `rotate-secret`
|
|
600
|
+
* keeps the old HMAC secret for a 7-day grace window for in-flight
|
|
601
|
+
* requests. HMAC secret bytes **never** cross the bridge — only
|
|
602
|
+
* `publicId` + `secretVersion` flow; the secret stays in
|
|
603
|
+
* `~/.config/serviceme/device.json` (P5.2 IdentityStore).
|
|
604
|
+
*
|
|
605
|
+
* Wire shapes follow `3.功能拆分.md` §3:
|
|
606
|
+
* - `device.status` → { publicId, bindingState, installationId, lastEnrollAt }
|
|
607
|
+
* - `device.enroll` → { publicId, bindingState, expiresAt }
|
|
608
|
+
* - `device.rotate-secret` → { publicId, secretVersion }
|
|
609
|
+
*/
|
|
610
|
+
type DeviceBindingState = "anonymous" | "pending" | "claimed" | "expired";
|
|
611
|
+
declare const DEVICE_BINDING_STATES: readonly DeviceBindingState[];
|
|
612
|
+
/**
|
|
613
|
+
* Public, non-secret half of the device identity.
|
|
614
|
+
*
|
|
615
|
+
* `secretVersion` is a monotonically increasing counter (`1`, `2`, …).
|
|
616
|
+
* The rotated HMAC secret bytes themselves live in the IdentityStore
|
|
617
|
+
* JSON file and **never** enter protocol payloads.
|
|
618
|
+
*/
|
|
619
|
+
interface DeviceIdentityState {
|
|
620
|
+
publicId: string;
|
|
621
|
+
secretVersion: number;
|
|
622
|
+
bindingState: DeviceBindingState;
|
|
623
|
+
}
|
|
624
|
+
/**
|
|
625
|
+
* Snapshot of the installed environment for this device.
|
|
626
|
+
*
|
|
627
|
+
* `installationId` is derived by Core from `os.hostname()` +
|
|
628
|
+
* `os.userInfo()` hash (per `3.功能拆分.md` B2) — not `vscode.env.machineId`,
|
|
629
|
+
* so the same value persists across Extension and CLI processes.
|
|
630
|
+
* `machineId` is the raw hostname for diagnostics.
|
|
631
|
+
*/
|
|
632
|
+
interface DeviceMetadata {
|
|
633
|
+
installationId: string;
|
|
634
|
+
machineId: string;
|
|
635
|
+
platform: NodeJS.Platform | string;
|
|
636
|
+
hostname?: string;
|
|
637
|
+
vscodeVersion?: string;
|
|
638
|
+
extensionVersion?: string;
|
|
639
|
+
}
|
|
640
|
+
/**
|
|
641
|
+
* Result of `device.status` — public identity + environment + sync timing.
|
|
642
|
+
*/
|
|
643
|
+
interface DeviceStatus {
|
|
644
|
+
bindingState: DeviceBindingState;
|
|
645
|
+
identity?: DeviceIdentityState;
|
|
646
|
+
metadata?: DeviceMetadata;
|
|
647
|
+
/** ISO timestamp of the last successful server sync. */
|
|
648
|
+
lastSyncAt?: string;
|
|
649
|
+
/** Last sync error message (omitted when last sync succeeded). */
|
|
650
|
+
lastSyncError?: string;
|
|
651
|
+
}
|
|
652
|
+
/** `device.status` — no params. */
|
|
653
|
+
type DeviceStatusParams = Record<string, never>;
|
|
654
|
+
/** `device.enroll` — kick off enrollment (or re-enrollment). */
|
|
655
|
+
interface DeviceEnrollParams {
|
|
656
|
+
/** When true, drop the current identity and start fresh. */
|
|
657
|
+
force?: boolean;
|
|
658
|
+
/** When true, the existing auth code is required to re-enroll. */
|
|
659
|
+
requireAuth?: boolean;
|
|
660
|
+
}
|
|
661
|
+
interface DeviceEnrollResult {
|
|
662
|
+
publicId: string;
|
|
663
|
+
bindingState: DeviceBindingState;
|
|
664
|
+
/** ISO timestamp at which this device-secret expires (forces re-enroll). */
|
|
665
|
+
expiresAt?: string;
|
|
666
|
+
}
|
|
667
|
+
/** `device.rotate-secret` — rotate HMAC secret while keeping grace window. */
|
|
668
|
+
interface DeviceRotateSecretParams {
|
|
669
|
+
/**
|
|
670
|
+
* Grace period (days) during which the previous secret still validates
|
|
671
|
+
* in-flight requests. Defaults to 7 per `2.需求澄清.md` §1.2.
|
|
672
|
+
*/
|
|
673
|
+
gracePeriodDays?: number;
|
|
674
|
+
}
|
|
675
|
+
interface DeviceRotateSecretResult {
|
|
676
|
+
publicId: string;
|
|
677
|
+
secretVersion: number;
|
|
678
|
+
gracePeriodDays: number;
|
|
679
|
+
/** ISO timestamp marking the end of the grace window for the old secret. */
|
|
680
|
+
gracePeriodEndsAt?: string;
|
|
681
|
+
}
|
|
682
|
+
declare function isDeviceBindingState(value: unknown): value is DeviceBindingState;
|
|
683
|
+
declare function isDeviceIdentityState(value: unknown): value is DeviceIdentityState;
|
|
684
|
+
declare function isDeviceMetadata(value: unknown): value is DeviceMetadata;
|
|
685
|
+
declare function isDeviceStatus(value: unknown): value is DeviceStatus;
|
|
686
|
+
declare function isDeviceEnrollParams(value: unknown): value is DeviceEnrollParams;
|
|
687
|
+
declare function isDeviceEnrollResult(value: unknown): value is DeviceEnrollResult;
|
|
688
|
+
declare function isDeviceRotateSecretParams(value: unknown): value is DeviceRotateSecretParams;
|
|
689
|
+
declare function isDeviceRotateSecretResult(value: unknown): value is DeviceRotateSecretResult;
|
|
690
|
+
|
|
691
|
+
type ServicemeErrorCode = "protocol_mismatch" | "cli_not_found" | "cli_start_failed" | "command_timeout" | "request_cancelled" | "invalid_params" | "opencode_not_installed" | "opencode_startup_timeout" | "opencode_request_failed" | "opencode_backend_not_running" | "opencode_session_not_found" | "copilot_not_installed" | "copilot_auth_required" | "copilot_execution_failed" | "copilot_timeout" | "json_invalid_input" | "env_tool_not_found" | "task_not_found" | "task_already_exists" | "invalid_schedule" | "invalid_payload" | "confirmation_required" | "workspace_not_found" | "daemon_not_running" | "executor_timeout" | "executor_error" | "task_already_running" | "not_found" | "internal_error" | "auth_not_logged_in" | "auth_provider_not_registered" | "device_not_enrolled" | "toolbox_invalid_scope";
|
|
692
|
+
declare const SERVICEME_ERROR_CODES: readonly ["protocol_mismatch", "cli_not_found", "cli_start_failed", "command_timeout", "request_cancelled", "invalid_params", "opencode_not_installed", "opencode_startup_timeout", "opencode_request_failed", "opencode_backend_not_running", "opencode_session_not_found", "copilot_not_installed", "copilot_auth_required", "copilot_execution_failed", "copilot_timeout", "json_invalid_input", "env_tool_not_found", "task_not_found", "task_already_exists", "invalid_schedule", "invalid_payload", "confirmation_required", "workspace_not_found", "daemon_not_running", "executor_timeout", "executor_error", "task_already_running", "not_found", "internal_error", "auth_not_logged_in", "auth_provider_not_registered", "device_not_enrolled", "toolbox_invalid_scope"];
|
|
88
693
|
interface ServicemeErrorDetails {
|
|
89
694
|
code: ServicemeErrorCode;
|
|
90
695
|
message: string;
|
|
@@ -139,7 +744,28 @@ interface GithubCopilotCliPayload {
|
|
|
139
744
|
agent?: string;
|
|
140
745
|
}
|
|
141
746
|
type TaskPayload = CommandPayload | ShellPayload | HttpRequestPayload | GithubCopilotCliPayload;
|
|
142
|
-
|
|
747
|
+
/**
|
|
748
|
+
* Reference to the workspace a scheduled task is bound to. Required by v2
|
|
749
|
+
* because the global scheduler runs tasks across many workspaces and needs to
|
|
750
|
+
* know where to execute each one.
|
|
751
|
+
*/
|
|
752
|
+
interface TaskWorkspaceRef {
|
|
753
|
+
/** Absolute path to the workspace root. Required and unique. */
|
|
754
|
+
path: string;
|
|
755
|
+
/** Display name. Defaults to `path` basename; users may override. */
|
|
756
|
+
name: string;
|
|
757
|
+
/** `git@github.com:owner/repo.git` — auto-detected at task creation. */
|
|
758
|
+
gitRemote?: string;
|
|
759
|
+
/** Current branch — auto-detected at task creation; verified at execute. */
|
|
760
|
+
gitBranch?: string;
|
|
761
|
+
/** Last time the extension saw this workspace alive. */
|
|
762
|
+
lastSeenAt?: string;
|
|
763
|
+
}
|
|
764
|
+
/**
|
|
765
|
+
* v1 task shape — kept for reading legacy `<workspace>/.serviceme/scheduled-tasks.json`
|
|
766
|
+
* during migration. New code should always use {@link ScheduledTask} (v2).
|
|
767
|
+
*/
|
|
768
|
+
interface ScheduledTaskV1 {
|
|
143
769
|
id: string;
|
|
144
770
|
name: string;
|
|
145
771
|
description?: string;
|
|
@@ -151,8 +777,38 @@ interface ScheduledTask {
|
|
|
151
777
|
createdAt: string;
|
|
152
778
|
updatedAt: string;
|
|
153
779
|
}
|
|
154
|
-
|
|
780
|
+
/** Runtime status of the most recent execution for a task. */
|
|
781
|
+
type TaskRunStatus = "ok" | "error" | "skipped";
|
|
782
|
+
/**
|
|
783
|
+
* v2 scheduled task — adds required `workspace` reference and runtime metadata
|
|
784
|
+
* fields. See `docs/architecture/skill-agent-v2-repo.md` §14.2.
|
|
785
|
+
*/
|
|
786
|
+
interface ScheduledTask extends ScheduledTaskV1 {
|
|
787
|
+
/** Required in v2. The workspace this task executes in. */
|
|
788
|
+
workspace: TaskWorkspaceRef;
|
|
789
|
+
/** ISO timestamp of the most recent execution. */
|
|
790
|
+
lastRunAt?: string;
|
|
791
|
+
/** Status of the most recent execution. */
|
|
792
|
+
lastRunStatus?: TaskRunStatus;
|
|
793
|
+
/** Error message from the most recent failed execution. */
|
|
794
|
+
lastRunError?: string;
|
|
795
|
+
/** Duration of the most recent execution, in milliseconds. */
|
|
796
|
+
lastRunDurationMs?: number;
|
|
797
|
+
/** Next scheduled run (computed by scheduler). */
|
|
798
|
+
nextRunAt?: string;
|
|
799
|
+
/** Total successful executions. */
|
|
800
|
+
runCount?: number;
|
|
801
|
+
}
|
|
802
|
+
/**
|
|
803
|
+
* v1 config — kept for migration. New code should use {@link ScheduledTasksConfig}.
|
|
804
|
+
*/
|
|
805
|
+
interface ScheduledTasksConfigV1 {
|
|
155
806
|
version: 1;
|
|
807
|
+
tasks: ScheduledTaskV1[];
|
|
808
|
+
}
|
|
809
|
+
/** v2 config — single source of truth for the global scheduler. */
|
|
810
|
+
interface ScheduledTasksConfig {
|
|
811
|
+
version: 2;
|
|
156
812
|
tasks: ScheduledTask[];
|
|
157
813
|
}
|
|
158
814
|
type TaskExecutionStatus = "running" | "success" | "failure" | "timeout" | "cancelled";
|
|
@@ -286,7 +942,20 @@ interface ScheduleDeleteDryRunResult {
|
|
|
286
942
|
task: ScheduledTask;
|
|
287
943
|
}
|
|
288
944
|
declare function isScheduledTaskType(value: unknown): value is ScheduledTaskType;
|
|
945
|
+
/**
|
|
946
|
+
* Validates a v1 task shape (no `workspace`). Used for reading legacy config
|
|
947
|
+
* during migration only. New code should validate against {@link ScheduledTask}
|
|
948
|
+
* with {@link isScheduledTask}.
|
|
949
|
+
*/
|
|
950
|
+
declare function isScheduledTaskV1(value: unknown): value is ScheduledTaskV1;
|
|
951
|
+
/** Validates a {@link TaskWorkspaceRef} payload. */
|
|
952
|
+
declare function isTaskWorkspaceRef(value: unknown): value is TaskWorkspaceRef;
|
|
953
|
+
/** Validates a v2 task shape. Requires the `workspace` field. */
|
|
289
954
|
declare function isScheduledTask(value: unknown): value is ScheduledTask;
|
|
955
|
+
/** Validates a v2 {@link ScheduledTasksConfig} (version: 2). */
|
|
956
|
+
declare function isScheduledTasksConfig(value: unknown): value is ScheduledTasksConfig;
|
|
957
|
+
/** Validates a v1 {@link ScheduledTasksConfigV1} (version: 1). */
|
|
958
|
+
declare function isScheduledTasksConfigV1(value: unknown): value is ScheduledTasksConfigV1;
|
|
290
959
|
declare function isTaskExecutionLog(value: unknown): value is TaskExecutionLog;
|
|
291
960
|
declare function isSchedulerStatus(value: unknown): value is SchedulerStatus;
|
|
292
961
|
declare function isTaskExecuteResult(value: unknown): value is TaskExecuteResult;
|
|
@@ -299,96 +968,145 @@ declare function isTaskFailedEventParams(value: unknown): value is TaskFailedEve
|
|
|
299
968
|
declare function isTaskCancelledEventParams(value: unknown): value is TaskCancelledEventParams;
|
|
300
969
|
type AgentSessionStatus = "idle" | "running" | "needs-input" | "completed" | "failed" | "aborted";
|
|
301
970
|
declare function isAgentSessionStatus(value: unknown): value is AgentSessionStatus;
|
|
971
|
+
/**
|
|
972
|
+
* Result of a single v1→v2 migration. `task` is included for callers that
|
|
973
|
+
* want to log it; `issues` lists soft validation problems (e.g. unknown task
|
|
974
|
+
* type) so the migration scanner can surface diagnostics without aborting.
|
|
975
|
+
*/
|
|
976
|
+
interface MigratedTask {
|
|
977
|
+
task: ScheduledTask;
|
|
978
|
+
/** Soft warnings about the migrated task. Empty for clean migrations. */
|
|
979
|
+
issues: string[];
|
|
980
|
+
}
|
|
981
|
+
/**
|
|
982
|
+
* Converts a single v1 task to v2 by attaching the given workspace context.
|
|
983
|
+
* Preserves all v1 fields (id, name, description, schedule, payload, etc.)
|
|
984
|
+
* and adds the new runtime metadata fields as undefined.
|
|
985
|
+
*
|
|
986
|
+
* The `workspace` argument supplies the workspace binding that the v1 task
|
|
987
|
+
* lacked. Callers (e.g. `MigrateToGlobal`) build this from the file location
|
|
988
|
+
* of the v1 config plus auto-probed git metadata.
|
|
989
|
+
*/
|
|
990
|
+
declare function migrateTaskV1ToV2(v1: ScheduledTaskV1, workspace: TaskWorkspaceRef): MigratedTask;
|
|
991
|
+
/**
|
|
992
|
+
* Converts a v1 config (from a single per-workspace file) to a v2 config
|
|
993
|
+
* (the global config). Every v1 task inherits the supplied workspace context
|
|
994
|
+
* — v1 had no per-task workspace, so the file's location is authoritative.
|
|
995
|
+
*
|
|
996
|
+
* The returned v2 config can be appended to the global config by the caller.
|
|
997
|
+
* Tasks with structural issues (unknown task type) are still migrated but
|
|
998
|
+
* surface a non-fatal issue string.
|
|
999
|
+
*/
|
|
1000
|
+
declare function migrateV1ToV2(v1Config: ScheduledTasksConfigV1, workspace: TaskWorkspaceRef): {
|
|
1001
|
+
config: ScheduledTasksConfig;
|
|
1002
|
+
issues: string[];
|
|
1003
|
+
};
|
|
302
1004
|
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
1005
|
+
/**
|
|
1006
|
+
* Toolbox protocol — Phase 5.1 cross-process contract.
|
|
1007
|
+
*
|
|
1008
|
+
* Per ADL-003 + `2.需求澄清.md` §2.1 these pure data models live in
|
|
1009
|
+
* `@serviceme/devtools-protocol`, NOT `@serviceme/shared`. Toolbox scope
|
|
1010
|
+
* is preserved (both `user` and `workspace` accepted); see
|
|
1011
|
+
* `~/.config/serviceme/toolbox.json` + `.github/.serviceme-toolbox.json`
|
|
1012
|
+
* for the persistence layout.
|
|
1013
|
+
*
|
|
1014
|
+
* Wire shapes follow `3.功能拆分.md` §3:
|
|
1015
|
+
* - `toolbox.list` → { scope, tools: ExternalTool[] }
|
|
1016
|
+
* - `toolbox.add` → { scope, tool: ExternalTool }
|
|
1017
|
+
* - `toolbox.remove` → { scope, toolId, success: boolean }
|
|
1018
|
+
* - `toolbox.update` → { scope, tool: ExternalTool }
|
|
1019
|
+
*/
|
|
1020
|
+
/**
|
|
1021
|
+
* Where the toolbox entry is persisted.
|
|
1022
|
+
*
|
|
1023
|
+
* - `user` — `~/.config/serviceme/toolbox.json` (applies to the user, every workspace)
|
|
1024
|
+
* - `workspace` — `.github/.serviceme-toolbox.json` (this project only)
|
|
1025
|
+
*
|
|
1026
|
+
* `toolbox.list` without `--scope` defaults to `user` per
|
|
1027
|
+
* `3.功能拆分.md` (对齐 skill/agent "个人优先" 惯例).
|
|
1028
|
+
*/
|
|
1029
|
+
type ToolboxScope = "user" | "workspace";
|
|
1030
|
+
declare const TOOLBOX_SCOPES: readonly ToolboxScope[];
|
|
1031
|
+
/**
|
|
1032
|
+
* Single toolbox entry — matches the extension's
|
|
1033
|
+
* `apps/extension/src/config/external-tools.ts` shape and lets users
|
|
1034
|
+
* override display order + last-used timestamp.
|
|
1035
|
+
*
|
|
1036
|
+
* `isDefault` mirrors the seeded built-in entries (cannot be removed,
|
|
1037
|
+
* only reordered). `order` is the user-defined sort position; absent
|
|
1038
|
+
* means "append".
|
|
1039
|
+
*/
|
|
1040
|
+
interface ExternalTool {
|
|
320
1041
|
id: string;
|
|
321
|
-
|
|
1042
|
+
name: string;
|
|
322
1043
|
description: string;
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
interface
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
interface SkillMutationResult {
|
|
361
|
-
state: SkillMarketplaceState;
|
|
362
|
-
skillId: string;
|
|
363
|
-
targetScope: SkillScope;
|
|
364
|
-
action: SkillMutationAction;
|
|
365
|
-
changed: boolean;
|
|
366
|
-
status: "success" | "blocked" | "requires_confirmation";
|
|
367
|
-
message?: string;
|
|
368
|
-
hasScripts?: boolean;
|
|
369
|
-
hasHooks?: boolean;
|
|
370
|
-
prUrl?: string;
|
|
371
|
-
fromVersion?: string;
|
|
372
|
-
toVersion?: string;
|
|
373
|
-
}
|
|
374
|
-
interface SkillReconcileResult {
|
|
375
|
-
state: SkillMarketplaceState;
|
|
376
|
-
changed: boolean;
|
|
377
|
-
}
|
|
378
|
-
interface PublishableSkillEntry {
|
|
1044
|
+
icon: string;
|
|
1045
|
+
url: string;
|
|
1046
|
+
isDefault?: boolean;
|
|
1047
|
+
order?: number;
|
|
1048
|
+
/** Scope this entry belongs to; omitted entries default to `user`. */
|
|
1049
|
+
scope?: ToolboxScope;
|
|
1050
|
+
/** ISO timestamp of last use — drives "recently used" sort. */
|
|
1051
|
+
lastUsedAt?: string;
|
|
1052
|
+
}
|
|
1053
|
+
/**
|
|
1054
|
+
* Snapshot of all toolbox entries in one scope (returned by `toolbox.list`).
|
|
1055
|
+
*/
|
|
1056
|
+
interface ToolboxList {
|
|
1057
|
+
scope: ToolboxScope;
|
|
1058
|
+
tools: ExternalTool[];
|
|
1059
|
+
}
|
|
1060
|
+
/**
|
|
1061
|
+
* Patch payload for `toolbox.update`.
|
|
1062
|
+
*
|
|
1063
|
+
* Every field optional; the implementation rejects patches on default
|
|
1064
|
+
* tools for anything other than `order` (matches the current
|
|
1065
|
+
* `ToolBoxService.updateExternalTool` rule).
|
|
1066
|
+
*/
|
|
1067
|
+
type ExternalToolPatch = Partial<Omit<ExternalTool, "id">>;
|
|
1068
|
+
/** `toolbox.list` — list entries of one scope. */
|
|
1069
|
+
interface ToolboxListParams {
|
|
1070
|
+
scope?: ToolboxScope;
|
|
1071
|
+
}
|
|
1072
|
+
type ToolboxListResult = ToolboxList;
|
|
1073
|
+
/** `toolbox.add` — append a non-default entry to the requested scope. */
|
|
1074
|
+
type ToolboxAddParams = ExternalTool;
|
|
1075
|
+
interface ToolboxAddResult {
|
|
1076
|
+
scope: ToolboxScope;
|
|
1077
|
+
tool: ExternalTool;
|
|
1078
|
+
}
|
|
1079
|
+
/** `toolbox.remove` — delete one entry by id. */
|
|
1080
|
+
interface ToolboxRemoveParams {
|
|
379
1081
|
id: string;
|
|
380
|
-
|
|
381
|
-
path: string;
|
|
382
|
-
version?: string;
|
|
1082
|
+
scope?: ToolboxScope;
|
|
383
1083
|
}
|
|
384
|
-
interface
|
|
385
|
-
|
|
1084
|
+
interface ToolboxRemoveResult {
|
|
1085
|
+
scope: ToolboxScope;
|
|
1086
|
+
toolId: string;
|
|
1087
|
+
success: boolean;
|
|
386
1088
|
}
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
1089
|
+
/** `toolbox.update` — patch one entry by id. */
|
|
1090
|
+
interface ToolboxUpdateParams {
|
|
1091
|
+
id: string;
|
|
1092
|
+
patch: ExternalToolPatch;
|
|
1093
|
+
scope?: ToolboxScope;
|
|
1094
|
+
}
|
|
1095
|
+
interface ToolboxUpdateResult {
|
|
1096
|
+
scope: ToolboxScope;
|
|
1097
|
+
tool: ExternalTool;
|
|
1098
|
+
}
|
|
1099
|
+
declare function isToolboxScope(value: unknown): value is ToolboxScope;
|
|
1100
|
+
declare function isExternalTool(value: unknown): value is ExternalTool;
|
|
1101
|
+
declare function isExternalToolPatch(value: unknown): value is ExternalToolPatch;
|
|
1102
|
+
declare function isToolboxList(value: unknown): value is ToolboxList;
|
|
1103
|
+
declare function isToolboxListParams(value: unknown): value is ToolboxListParams;
|
|
1104
|
+
declare function isToolboxAddParams(value: unknown): value is ToolboxAddParams;
|
|
1105
|
+
declare function isToolboxAddResult(value: unknown): value is ToolboxAddResult;
|
|
1106
|
+
declare function isToolboxRemoveParams(value: unknown): value is ToolboxRemoveParams;
|
|
1107
|
+
declare function isToolboxRemoveResult(value: unknown): value is ToolboxRemoveResult;
|
|
1108
|
+
declare function isToolboxUpdateParams(value: unknown): value is ToolboxUpdateParams;
|
|
1109
|
+
declare function isToolboxUpdateResult(value: unknown): value is ToolboxUpdateResult;
|
|
392
1110
|
|
|
393
1111
|
declare const SERVICEME_PROTOCOL_VERSION: 2;
|
|
394
1112
|
type SupportedBridgeProtocolVersion = 1 | 2;
|
|
@@ -397,8 +1115,24 @@ interface BridgeCapabilities {
|
|
|
397
1115
|
json: 1;
|
|
398
1116
|
env: 1;
|
|
399
1117
|
tasks?: 1;
|
|
400
|
-
|
|
401
|
-
|
|
1118
|
+
/** v2 skill/agent repo catalog: list, install, manage drafts. */
|
|
1119
|
+
skillRepo?: 1;
|
|
1120
|
+
/** v2 repo catalog: list, add, remove, enable, disable, sync. */
|
|
1121
|
+
repoMgmt?: 1;
|
|
1122
|
+
/** Auth domain (Phase 5.1): auth.status / login / logout / whoami / switch. */
|
|
1123
|
+
auth?: 1;
|
|
1124
|
+
/** Device domain (Phase 5.1): device.status / enroll / rotate-secret. */
|
|
1125
|
+
device?: 1;
|
|
1126
|
+
/** Toolbox domain (Phase 5.1): toolbox.list / add / remove / update. */
|
|
1127
|
+
toolbox?: 1;
|
|
1128
|
+
/**
|
|
1129
|
+
* Read token bytes across the bridge (Phase 5.1, ADL-004).
|
|
1130
|
+
*
|
|
1131
|
+
* Default OFF. Only the Extension process ever advertises this bit.
|
|
1132
|
+
* CLI must read tokens directly via OS keychain; it MUST NOT advertise
|
|
1133
|
+
* `auth.tokenRead` even when its own auth realm is available.
|
|
1134
|
+
*/
|
|
1135
|
+
"auth.tokenRead"?: 1;
|
|
402
1136
|
}
|
|
403
1137
|
declare function isBridgeCapabilities(value: unknown): value is BridgeCapabilities;
|
|
404
1138
|
interface BridgeMethodMap {
|
|
@@ -441,50 +1175,124 @@ interface BridgeMethodMap {
|
|
|
441
1175
|
params: Record<string, never>;
|
|
442
1176
|
result: TaskListRunningResult;
|
|
443
1177
|
};
|
|
444
|
-
"
|
|
445
|
-
params:
|
|
446
|
-
|
|
447
|
-
forceRefresh?: boolean;
|
|
448
|
-
};
|
|
449
|
-
result: SkillMarketplaceState;
|
|
1178
|
+
"skillRepo.list": {
|
|
1179
|
+
params: SkillRepoListParams;
|
|
1180
|
+
result: SkillRepoListResult;
|
|
450
1181
|
};
|
|
451
|
-
"
|
|
452
|
-
params:
|
|
453
|
-
result:
|
|
1182
|
+
"skillRepo.get": {
|
|
1183
|
+
params: SkillRepoGetParams;
|
|
1184
|
+
result: SkillRepoGetResult;
|
|
454
1185
|
};
|
|
455
|
-
"
|
|
456
|
-
params:
|
|
457
|
-
|
|
458
|
-
force?: boolean;
|
|
459
|
-
};
|
|
460
|
-
result: SkillReconcileResult;
|
|
1186
|
+
"skillRepo.install": {
|
|
1187
|
+
params: SkillRepoInstallParams;
|
|
1188
|
+
result: SkillRepoInstallResult;
|
|
461
1189
|
};
|
|
462
|
-
"
|
|
463
|
-
params:
|
|
464
|
-
|
|
465
|
-
};
|
|
466
|
-
result: SkillPublishableResult;
|
|
1190
|
+
"skillRepo.convertToSymlink": {
|
|
1191
|
+
params: SkillRepoConvertToSymlinkParams;
|
|
1192
|
+
result: SkillRepoConvertToSymlinkResult;
|
|
467
1193
|
};
|
|
468
|
-
"
|
|
469
|
-
params:
|
|
470
|
-
|
|
471
|
-
forceRefresh?: boolean;
|
|
472
|
-
};
|
|
473
|
-
result: AgentMarketplaceState;
|
|
1194
|
+
"skillRepo.uninstall": {
|
|
1195
|
+
params: SkillRepoUninstallParams;
|
|
1196
|
+
result: SkillRepoUninstallResult;
|
|
474
1197
|
};
|
|
475
|
-
"
|
|
476
|
-
params:
|
|
477
|
-
result:
|
|
1198
|
+
"skillRepo.listLinked": {
|
|
1199
|
+
params: SkillRepoListLinkedParams;
|
|
1200
|
+
result: SkillRepoListLinkedResult;
|
|
478
1201
|
};
|
|
479
|
-
"
|
|
480
|
-
params:
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
1202
|
+
"skillRepo.draft.create": {
|
|
1203
|
+
params: SkillRepoDraftCreateParams;
|
|
1204
|
+
result: SkillRepoDraftCreateResult;
|
|
1205
|
+
};
|
|
1206
|
+
"skillRepo.draft.commit": {
|
|
1207
|
+
params: SkillRepoDraftCommitParams;
|
|
1208
|
+
result: SkillRepoDraftCommitResult;
|
|
1209
|
+
};
|
|
1210
|
+
"skillRepo.draft.list": {
|
|
1211
|
+
params: SkillRepoDraftListParams;
|
|
1212
|
+
result: SkillRepoDraftListResult;
|
|
1213
|
+
};
|
|
1214
|
+
"skillRepo.draft.delete": {
|
|
1215
|
+
params: SkillRepoDraftDeleteParams;
|
|
1216
|
+
result: SkillRepoDraftDeleteResult;
|
|
1217
|
+
};
|
|
1218
|
+
"repo.list": {
|
|
1219
|
+
params: RepoListParams;
|
|
1220
|
+
result: RepoListResult;
|
|
1221
|
+
};
|
|
1222
|
+
"repo.add": {
|
|
1223
|
+
params: RepoAddParams;
|
|
1224
|
+
result: RepoAddResult;
|
|
1225
|
+
};
|
|
1226
|
+
"repo.remove": {
|
|
1227
|
+
params: RepoRemoveParams;
|
|
1228
|
+
result: RepoRemoveResult;
|
|
1229
|
+
};
|
|
1230
|
+
"repo.enable": {
|
|
1231
|
+
params: RepoEnableParams;
|
|
1232
|
+
result: RepoEnableResult;
|
|
1233
|
+
};
|
|
1234
|
+
"repo.disable": {
|
|
1235
|
+
params: RepoDisableParams;
|
|
1236
|
+
result: RepoDisableResult;
|
|
1237
|
+
};
|
|
1238
|
+
"repo.sync": {
|
|
1239
|
+
params: RepoSyncParams;
|
|
1240
|
+
result: RepoSyncResult;
|
|
1241
|
+
};
|
|
1242
|
+
"repo.syncAll": {
|
|
1243
|
+
params: RepoSyncAllParams;
|
|
1244
|
+
result: RepoSyncAllResult;
|
|
1245
|
+
};
|
|
1246
|
+
"auth.status": {
|
|
1247
|
+
params: Record<string, never>;
|
|
1248
|
+
result: AuthStatus;
|
|
1249
|
+
};
|
|
1250
|
+
"auth.login": {
|
|
1251
|
+
params: AuthLoginParams;
|
|
1252
|
+
result: AuthLoginResult;
|
|
1253
|
+
};
|
|
1254
|
+
"auth.logout": {
|
|
1255
|
+
params: AuthLogoutParams;
|
|
1256
|
+
result: AuthLogoutResult;
|
|
1257
|
+
};
|
|
1258
|
+
"auth.whoami": {
|
|
1259
|
+
params: Record<string, never>;
|
|
1260
|
+
result: AuthWhoamiResult;
|
|
1261
|
+
};
|
|
1262
|
+
"auth.switch": {
|
|
1263
|
+
params: AuthSwitchParams;
|
|
1264
|
+
result: AuthSwitchResult;
|
|
1265
|
+
};
|
|
1266
|
+
"device.status": {
|
|
1267
|
+
params: Record<string, never>;
|
|
1268
|
+
result: DeviceStatus;
|
|
1269
|
+
};
|
|
1270
|
+
"device.enroll": {
|
|
1271
|
+
params: DeviceEnrollParams;
|
|
1272
|
+
result: DeviceEnrollResult;
|
|
1273
|
+
};
|
|
1274
|
+
"device.rotate-secret": {
|
|
1275
|
+
params: DeviceRotateSecretParams;
|
|
1276
|
+
result: DeviceRotateSecretResult;
|
|
1277
|
+
};
|
|
1278
|
+
"toolbox.list": {
|
|
1279
|
+
params: ToolboxListParams;
|
|
1280
|
+
result: ToolboxListResult;
|
|
1281
|
+
};
|
|
1282
|
+
"toolbox.add": {
|
|
1283
|
+
params: ToolboxAddParams;
|
|
1284
|
+
result: ToolboxAddResult;
|
|
1285
|
+
};
|
|
1286
|
+
"toolbox.remove": {
|
|
1287
|
+
params: ToolboxRemoveParams;
|
|
1288
|
+
result: ToolboxRemoveResult;
|
|
1289
|
+
};
|
|
1290
|
+
"toolbox.update": {
|
|
1291
|
+
params: ToolboxUpdateParams;
|
|
1292
|
+
result: ToolboxUpdateResult;
|
|
485
1293
|
};
|
|
486
1294
|
}
|
|
487
|
-
declare const BRIDGE_METHODS: readonly ["system.hello", "system.ping", "system.shutdown", "task.execute", "task.cancel", "task.list-running", "
|
|
1295
|
+
declare const BRIDGE_METHODS: readonly ["system.hello", "system.ping", "system.shutdown", "task.execute", "task.cancel", "task.list-running", "skillRepo.list", "skillRepo.get", "skillRepo.install", "skillRepo.convertToSymlink", "skillRepo.uninstall", "skillRepo.listLinked", "skillRepo.draft.create", "skillRepo.draft.commit", "skillRepo.draft.list", "skillRepo.draft.delete", "repo.list", "repo.add", "repo.remove", "repo.enable", "repo.disable", "repo.sync", "repo.syncAll", "auth.status", "auth.login", "auth.logout", "auth.whoami", "auth.switch", "device.status", "device.enroll", "device.rotate-secret", "toolbox.list", "toolbox.add", "toolbox.remove", "toolbox.update"];
|
|
488
1296
|
type BridgeMethod = keyof BridgeMethodMap;
|
|
489
1297
|
type BridgeParams<M extends BridgeMethod> = BridgeMethodMap[M]["params"];
|
|
490
1298
|
type BridgeResult<M extends BridgeMethod> = BridgeMethodMap[M]["result"];
|
|
@@ -743,7 +1551,7 @@ interface LocalPublishableAgent {
|
|
|
743
1551
|
}
|
|
744
1552
|
|
|
745
1553
|
declare const SERVICEME_CLI_NAME = "serviceme";
|
|
746
|
-
declare const SERVICEME_CLI_VERSION = "0.
|
|
1554
|
+
declare const SERVICEME_CLI_VERSION = "0.2.0";
|
|
747
1555
|
declare const SERVICEME_CLI_CAPABILITIES: {
|
|
748
1556
|
readonly bridge: true;
|
|
749
1557
|
readonly tasks: 1;
|
|
@@ -751,8 +1559,6 @@ declare const SERVICEME_CLI_CAPABILITIES: {
|
|
|
751
1559
|
readonly env: 1;
|
|
752
1560
|
readonly image: 1;
|
|
753
1561
|
readonly project: 1;
|
|
754
|
-
readonly skills: 1;
|
|
755
|
-
readonly agents: 1;
|
|
756
1562
|
};
|
|
757
1563
|
|
|
758
1564
|
interface ServiceMeProjectScaffoldPruneResult {
|
|
@@ -788,4 +1594,94 @@ declare function isServiceMeProjectInstallDepsResult(value: unknown): value is S
|
|
|
788
1594
|
declare function isServiceMeProjectExtractTemplateInput(value: unknown): value is ServiceMeProjectExtractTemplateInput;
|
|
789
1595
|
declare function isServiceMeProjectExtractTemplateResult(value: unknown): value is ServiceMeProjectExtractTemplateResult;
|
|
790
1596
|
|
|
791
|
-
|
|
1597
|
+
type SkillScope = "workspace" | "user";
|
|
1598
|
+
type SkillOwnerKind = "builtin" | "external";
|
|
1599
|
+
type SkillScopeStatus = "absent" | "available" | "installed" | "blocked" | "conflict";
|
|
1600
|
+
type SkillMutationAction = "install" | "uninstall" | "move" | "removeExternal" | "publish" | "republish" | "submit-to-official";
|
|
1601
|
+
interface SkillScopeState {
|
|
1602
|
+
scope: SkillScope;
|
|
1603
|
+
status: SkillScopeStatus;
|
|
1604
|
+
kind?: SkillOwnerKind;
|
|
1605
|
+
path?: string;
|
|
1606
|
+
isInstalled: boolean;
|
|
1607
|
+
canInstall: boolean;
|
|
1608
|
+
canUninstall: boolean;
|
|
1609
|
+
canRemove: boolean;
|
|
1610
|
+
canMoveHere: boolean;
|
|
1611
|
+
summary?: string;
|
|
1612
|
+
}
|
|
1613
|
+
interface SkillMarketplaceEntry {
|
|
1614
|
+
id: string;
|
|
1615
|
+
displayName: string;
|
|
1616
|
+
description: string;
|
|
1617
|
+
version: string;
|
|
1618
|
+
updatedAt: string;
|
|
1619
|
+
categoryId?: string;
|
|
1620
|
+
enabled?: boolean;
|
|
1621
|
+
isCatalogSkill: boolean;
|
|
1622
|
+
recommended: boolean;
|
|
1623
|
+
installCount: number;
|
|
1624
|
+
requiresSetup?: boolean;
|
|
1625
|
+
setupHint?: string;
|
|
1626
|
+
homepage?: string;
|
|
1627
|
+
ownerScope?: SkillScope;
|
|
1628
|
+
ownerKind?: SkillOwnerKind;
|
|
1629
|
+
hasConflict: boolean;
|
|
1630
|
+
hasScripts?: boolean;
|
|
1631
|
+
hasHooks?: boolean;
|
|
1632
|
+
source?: "official" | "community" | "local";
|
|
1633
|
+
localSkillPath?: string;
|
|
1634
|
+
canPublish?: boolean;
|
|
1635
|
+
workspaceState: SkillScopeState;
|
|
1636
|
+
userState: SkillScopeState;
|
|
1637
|
+
}
|
|
1638
|
+
interface SkillMarketplaceState {
|
|
1639
|
+
configPath: string;
|
|
1640
|
+
userSkillsPath: string;
|
|
1641
|
+
skills: SkillMarketplaceEntry[];
|
|
1642
|
+
enabledSkillIds?: string[];
|
|
1643
|
+
recommendedSkillIds?: string[];
|
|
1644
|
+
onboardingRequired: boolean;
|
|
1645
|
+
hasPersistedSelection: boolean;
|
|
1646
|
+
workspaceOpen?: boolean;
|
|
1647
|
+
}
|
|
1648
|
+
interface SkillMutationRequest {
|
|
1649
|
+
skillId: string;
|
|
1650
|
+
targetScope: SkillScope;
|
|
1651
|
+
action: SkillMutationAction;
|
|
1652
|
+
confirmed?: boolean;
|
|
1653
|
+
}
|
|
1654
|
+
interface SkillMutationResult {
|
|
1655
|
+
state: SkillMarketplaceState;
|
|
1656
|
+
skillId: string;
|
|
1657
|
+
targetScope: SkillScope;
|
|
1658
|
+
action: SkillMutationAction;
|
|
1659
|
+
changed: boolean;
|
|
1660
|
+
status: "success" | "blocked" | "requires_confirmation";
|
|
1661
|
+
message?: string;
|
|
1662
|
+
hasScripts?: boolean;
|
|
1663
|
+
hasHooks?: boolean;
|
|
1664
|
+
prUrl?: string;
|
|
1665
|
+
fromVersion?: string;
|
|
1666
|
+
toVersion?: string;
|
|
1667
|
+
}
|
|
1668
|
+
interface SkillReconcileResult {
|
|
1669
|
+
state: SkillMarketplaceState;
|
|
1670
|
+
changed: boolean;
|
|
1671
|
+
}
|
|
1672
|
+
interface PublishableSkillEntry {
|
|
1673
|
+
id: string;
|
|
1674
|
+
displayName: string;
|
|
1675
|
+
path: string;
|
|
1676
|
+
version?: string;
|
|
1677
|
+
}
|
|
1678
|
+
interface SkillPublishableResult {
|
|
1679
|
+
skills: PublishableSkillEntry[];
|
|
1680
|
+
}
|
|
1681
|
+
declare function isSkillMarketplaceState(value: unknown): value is SkillMarketplaceState;
|
|
1682
|
+
declare function isSkillMutationRequest(value: unknown): value is SkillMutationRequest;
|
|
1683
|
+
declare function isSkillMutationResult(value: unknown): value is SkillMutationResult;
|
|
1684
|
+
declare function isSkillReconcileResult(value: unknown): value is SkillReconcileResult;
|
|
1685
|
+
declare function isSkillPublishableResult(value: unknown): value is SkillPublishableResult;
|
|
1686
|
+
|
|
1687
|
+
export { AUTH_PROVIDERS, type AgentDownloadFile, type AgentMarketplaceEntry, type AgentMarketplaceState, type AgentMutationAction, type AgentMutationRequest, type AgentMutationResult, type AgentOwnerKind, type AgentPermissionSummary, type AgentPermissionsResult, type AgentScope, type AgentScopeState, type AgentScopeStatus, type AgentSessionStatus, type AgentToolPermission, type AgentToolRiskLevel, type AuthAccountMeta, type AuthLoginParams, type AuthLoginResult, type AuthLogoutParams, type AuthLogoutResult, type AuthProvider, type AuthSessionHandle, type AuthStatus, type AuthStatusParams, type AuthSwitchParams, type AuthSwitchResult, type AuthTokenEnvelope, type AuthWhoamiResult, BRIDGE_EVENTS, BRIDGE_METHODS, type BridgeCapabilities, type BridgeErrorResponse, type BridgeEvent, type BridgeEventMap, type BridgeEventName, type BridgeEventParams, type BridgeLinkMode, type BridgeLinkedSkill, type BridgeMessage, type BridgeMethod, type BridgeMethodMap, type BridgeParams, type BridgeRepoEntry, type BridgeRepoSyncPull, type BridgeRequest, type BridgeResponse, type BridgeResult, type BridgeSkillKind, type BridgeSkillRepoDetail, type BridgeSkillRepoEntry, type BridgeSkillRepoFile, type BridgeSuccessResponse, COPILOT_ERROR_CODES, type CliEnvelope, type CliFailure, type CliSuccess, type CommandPayload, type ConcurrencyPolicy, type CopilotDoctorResult, type CopilotPromptOptions, type CopilotPromptResult, DEFAULT_JSON_SORT_OPTIONS, DEVICE_BINDING_STATES, type DeviceBindingState, type DeviceEnrollParams, type DeviceEnrollResult, type DeviceIdentityState, type DeviceMetadata, type DeviceRotateSecretParams, type DeviceRotateSecretResult, type DeviceSecret, type DeviceStatus, type DeviceStatusParams, type EnvironmentCheckResult, type ExternalTool, type ExternalToolPatch, type GithubCopilotCliPayload, type HttpRequestPayload, JSON_SORT_ALGORITHMS, JSON_SORT_ORDERS, type JsonSortAlgorithm, type JsonSortOptions, type JsonSortOrder, type JsonValidationResult, KNOWN_ENVIRONMENT_TOOLS, type KnownEnvironmentTool, type LocalPublishableAgent, type LocalPublishableSkill, type MarketplaceAgentItem, type MarketplaceAgentsCatalog, type MarketplaceCatalog, type MarketplaceSkillItem, type MigratedTask, type PublishableSkillEntry, type RepoAddParams, type RepoAddResult, type RepoDisableParams, type RepoDisableResult, type RepoEnableParams, type RepoEnableResult, type RepoListParams, type RepoListResult, type RepoRemoveParams, type RepoRemoveResult, type RepoSyncAllParams, type RepoSyncAllResult, type RepoSyncParams, type RepoSyncResult, type RunningTaskInfo, SERVICEME_CLI_CAPABILITIES, SERVICEME_CLI_NAME, SERVICEME_CLI_SCHEMA_VERSION, SERVICEME_CLI_VERSION, SERVICEME_ERROR_CODES, SERVICEME_IMAGE_FORMATS, SERVICEME_PROTOCOL_VERSION, type ScheduleCreateDryRunResult, type ScheduleCreateResult, type ScheduleDeleteDryRunResult, type ScheduleDeleteResult, type ScheduleEditDryRunResult, type ScheduleEditResult, type ScheduleGetResult, type ScheduleListResult, type ScheduleLogsResult, type ScheduleToggleResult, type ScheduleTriggerResult, type ScheduledTask, type ScheduledTaskType, type ScheduledTaskV1, type ScheduledTasksConfig, type ScheduledTasksConfigV1, type ScheduledTasksLogFile, type SchedulerStartResult, type SchedulerStatus, type SchedulerStopResult, type SecretToken, type ServiceMeImageCompressOptions, type ServiceMeImageCompressResult, type ServiceMeImageFormat, type ServiceMeImageInfo, type ServiceMeImageValidationResult, type ServiceMeProjectExtractTemplateInput, type ServiceMeProjectExtractTemplateResult, type ServiceMeProjectGitInitResult, type ServiceMeProjectInstallDepsResult, type ServiceMeProjectMakeScriptsExecutableResult, type ServiceMeProjectScaffoldPruneResult, type ServicemeErrorCode, type ServicemeErrorDetails, ServicemeProtocolError, type ShellPayload, type SkillDownloadFile, type SkillMarketplaceEntry, type SkillMarketplaceState, type SkillMutationAction, type SkillMutationRequest, type SkillMutationResult, type SkillOwnerKind, type SkillPublishableResult, type SkillReconcileResult, type SkillRepoConvertToSymlinkParams, type SkillRepoConvertToSymlinkResult, type SkillRepoDraftCommitParams, type SkillRepoDraftCommitResult, type SkillRepoDraftCreateParams, type SkillRepoDraftCreateResult, type SkillRepoDraftDeleteParams, type SkillRepoDraftDeleteResult, type SkillRepoDraftListParams, type SkillRepoDraftListResult, type SkillRepoGetParams, type SkillRepoGetResult, type SkillRepoInstallParams, type SkillRepoInstallResult, type SkillRepoListLinkedParams, type SkillRepoListLinkedResult, type SkillRepoListParams, type SkillRepoListResult, type SkillRepoUninstallParams, type SkillRepoUninstallResult, type SkillScope, type SkillScopeState, type SkillScopeStatus, type SubmitToOfficialPayload, type SubmitToOfficialResult, type SupportedBridgeProtocolVersion, TOOLBOX_SCOPES, type TaskCancelResult, type TaskCancelledEventParams, type TaskCompletedEventParams, type TaskExecuteResult, type TaskExecutionLog, type TaskExecutionSnapshot, type TaskExecutionStatus, type TaskFailedEventParams, type TaskListRunningResult, type TaskOutputEventParams, type TaskPayload, type TaskRunStatus, type TaskStartedEventParams, type TaskTriggerType, type TaskWorkspaceRef, type ToolCheckResult, type ToolboxAddParams, type ToolboxAddResult, type ToolboxList, type ToolboxListParams, type ToolboxListResult, type ToolboxRemoveParams, type ToolboxRemoveResult, type ToolboxScope, type ToolboxUpdateParams, type ToolboxUpdateResult, type UploadAgentPayload, type UploadFile, type UploadSkillPayload, 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, isDeviceBindingState, isDeviceEnrollParams, isDeviceEnrollResult, isDeviceIdentityState, isDeviceMetadata, isDeviceRotateSecretParams, isDeviceRotateSecretResult, isDeviceStatus, isEnvironmentCheckResult, isExternalTool, isExternalToolPatch, isJsonOutputResult, isJsonSortAlgorithm, isJsonSortOptions, isJsonSortOrder, isJsonValidationResult, isKnownEnvironmentTool, isRepoAddParams, isRepoAddResult, isRepoDisableParams, isRepoDisableResult, isRepoEnableParams, isRepoEnableResult, isRepoListParams, isRepoListResult, isRepoRemoveParams, isRepoRemoveResult, isRepoSyncAllParams, isRepoSyncAllResult, isRepoSyncParams, isRepoSyncResult, 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, 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, normalizeServicemeError };
|