@ctout-uk/agentsmith 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +127 -2
- package/bin/agentsmith.js +2 -0
- package/dist/cli.cjs +2512 -0
- package/dist/cli.cjs.map +1 -0
- package/dist/index.cjs +2308 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +463 -0
- package/dist/index.d.ts +463 -0
- package/dist/index.js +2236 -0
- package/dist/index.js.map +1 -0
- package/package.json +68 -4
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,463 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core shared types for agentsmith.
|
|
3
|
+
*/
|
|
4
|
+
/** Canonical asset types across all sources and targets. */
|
|
5
|
+
type AssetType = "agent" | "instruction" | "skill" | "plugin" | "rule" | "workflow";
|
|
6
|
+
/** Supported target environments. */
|
|
7
|
+
type Target = "vscode" | "kiro" | "antigravity";
|
|
8
|
+
/** Installation scope. */
|
|
9
|
+
type Scope = "repo" | "user";
|
|
10
|
+
/** Portability outcome for a target adapter. */
|
|
11
|
+
type CompatibilityOutcome = "native" | "adapted" | "unsupported";
|
|
12
|
+
/**
|
|
13
|
+
* A canonical asset as returned by a source adapter.
|
|
14
|
+
* Mirrors the canonical-asset schema from vscode-copilot-sync.
|
|
15
|
+
*/
|
|
16
|
+
interface Asset {
|
|
17
|
+
id: string;
|
|
18
|
+
type: AssetType;
|
|
19
|
+
title: string;
|
|
20
|
+
description: string;
|
|
21
|
+
source: string;
|
|
22
|
+
/** Path to the asset on the local filesystem (within the cache). */
|
|
23
|
+
localPath: string;
|
|
24
|
+
/** Whether this is a directory (skills) or a single file. */
|
|
25
|
+
isDirectory: boolean;
|
|
26
|
+
/** SHA-256 hash of the asset content (file hash or directory tree hash). */
|
|
27
|
+
hash: string;
|
|
28
|
+
requiresSetup: boolean;
|
|
29
|
+
tags: string[];
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Catalogue entry as stored in ~/.agentsmith/cache/catalogue.json.
|
|
33
|
+
* Lightweight metadata for display in the picker — no content loaded.
|
|
34
|
+
*/
|
|
35
|
+
interface CatalogueEntry {
|
|
36
|
+
id: string;
|
|
37
|
+
type: AssetType;
|
|
38
|
+
title: string;
|
|
39
|
+
description: string;
|
|
40
|
+
source: string;
|
|
41
|
+
requiresSetup: boolean;
|
|
42
|
+
tags: string[];
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Manifest entry as stored in ~/.agentsmith/cache/manifest.json.
|
|
46
|
+
* Tracks sync state across runs.
|
|
47
|
+
*/
|
|
48
|
+
interface ManifestEntry {
|
|
49
|
+
id: string;
|
|
50
|
+
type: AssetType;
|
|
51
|
+
localPath: string;
|
|
52
|
+
hash: string;
|
|
53
|
+
syncedAt: string;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* A subscription record — one installed asset at a specific target and scope.
|
|
57
|
+
* Stored in subscriptions.json.
|
|
58
|
+
*/
|
|
59
|
+
interface Subscription {
|
|
60
|
+
id: string;
|
|
61
|
+
type: AssetType;
|
|
62
|
+
target: Target;
|
|
63
|
+
scope: Scope;
|
|
64
|
+
/** Absolute path to the installed file or directory. */
|
|
65
|
+
installedPath: string;
|
|
66
|
+
/** Hash of the content at install time — used to detect local edits. */
|
|
67
|
+
installedHash: string;
|
|
68
|
+
/** Hash of the upstream source at install time — used to detect updates. */
|
|
69
|
+
sourceHash: string;
|
|
70
|
+
installedAt: string;
|
|
71
|
+
updatedAt: string;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Status of an installed asset — computed at runtime by comparing hashes.
|
|
75
|
+
*/
|
|
76
|
+
interface AssetStatus {
|
|
77
|
+
subscription: Subscription;
|
|
78
|
+
/** Whether the installed file/directory still exists. */
|
|
79
|
+
exists: boolean;
|
|
80
|
+
/** Whether the installed content differs from when it was installed (local edit). */
|
|
81
|
+
locallyModified: boolean;
|
|
82
|
+
/** Whether the upstream source has a newer version available. */
|
|
83
|
+
updateAvailable: boolean;
|
|
84
|
+
/** The current upstream hash, if an update is available. */
|
|
85
|
+
upstreamHash?: string;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Result of an install, update, or remove operation.
|
|
89
|
+
*/
|
|
90
|
+
interface OperationResult {
|
|
91
|
+
id: string;
|
|
92
|
+
target: Target;
|
|
93
|
+
scope: Scope;
|
|
94
|
+
success: boolean;
|
|
95
|
+
action: "installed" | "updated" | "removed" | "skipped" | "failed";
|
|
96
|
+
/** Human-readable reason for skipped or failed actions. */
|
|
97
|
+
reason?: string;
|
|
98
|
+
/** Whether frontmatter was adapted for the target. */
|
|
99
|
+
adapted?: boolean;
|
|
100
|
+
/** Fields that were changed or dropped during adaptation. */
|
|
101
|
+
adaptations?: string[];
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Cross-platform path utilities for agentsmith.
|
|
106
|
+
*/
|
|
107
|
+
/** Root of the agentsmith cache directory. */
|
|
108
|
+
declare function cacheRoot(): string;
|
|
109
|
+
/** Root of the legacy vscode-copilot-sync cache directory. */
|
|
110
|
+
declare function legacyCacheRoot(): string;
|
|
111
|
+
/** Path to the local awesome-copilot git checkout. */
|
|
112
|
+
declare function awesomeCopilotRoot(): string;
|
|
113
|
+
/** Path to the catalogue JSON file. */
|
|
114
|
+
declare function cataloguePath(): string;
|
|
115
|
+
/** Path to the manifest JSON file. */
|
|
116
|
+
declare function manifestPath(): string;
|
|
117
|
+
/** Path to the subscriptions JSON file. */
|
|
118
|
+
declare function subscriptionsPath(): string;
|
|
119
|
+
/**
|
|
120
|
+
* Asserts that a target path resides strictly within an authorised base directory.
|
|
121
|
+
* Guards against path traversal attacks (e.g. '../' or absolute path escaping).
|
|
122
|
+
* Throws if the path escapes the base, equals the base (unless allowEqual), or traverses a symlink.
|
|
123
|
+
*/
|
|
124
|
+
declare function assertPathWithin(targetPath: string, baseDir: string, allowEqual?: boolean): void;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Lightweight YAML frontmatter parser and serialiser for Markdown assets.
|
|
128
|
+
*/
|
|
129
|
+
interface ParsedFrontmatter {
|
|
130
|
+
attributes: Record<string, unknown>;
|
|
131
|
+
body: string;
|
|
132
|
+
hasFrontmatter: boolean;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Parses YAML frontmatter delimited by `---` at the start of a Markdown document.
|
|
136
|
+
*/
|
|
137
|
+
declare function parseFrontmatter(content: string): ParsedFrontmatter;
|
|
138
|
+
/**
|
|
139
|
+
* Serialises frontmatter attributes and Markdown body back into a single document.
|
|
140
|
+
*/
|
|
141
|
+
declare function serialiseFrontmatter(attributes: Record<string, unknown>, body: string): string;
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* SHA-256 content and directory tree hashing for change detection.
|
|
145
|
+
*/
|
|
146
|
+
/**
|
|
147
|
+
* Computes a deterministic SHA-256 hex digest of a string (normalising CRLF to LF).
|
|
148
|
+
*/
|
|
149
|
+
declare function hashString(content: string): string;
|
|
150
|
+
/**
|
|
151
|
+
* Computes a deterministic SHA-256 hex digest of a single file.
|
|
152
|
+
* Normalises CRLF to LF for UTF-8 text files; hashes raw bytes for binary files.
|
|
153
|
+
*/
|
|
154
|
+
declare function hashFile(filePath: string): string;
|
|
155
|
+
/**
|
|
156
|
+
* Computes a deterministic SHA-256 hex digest of a directory tree.
|
|
157
|
+
* Sorts relative POSIX paths alphabetically and combines path + file hash.
|
|
158
|
+
*/
|
|
159
|
+
declare function hashDirectory(dirPath: string): string;
|
|
160
|
+
/**
|
|
161
|
+
* Computes the SHA-256 hash of either a file or a directory asset.
|
|
162
|
+
*/
|
|
163
|
+
declare function hashAssetPath(targetPath: string): string;
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Source adapter for github/awesome-copilot.
|
|
167
|
+
* Handles git clone/pull, asset discovery, frontmatter extraction,
|
|
168
|
+
* safety checks (structural change & mass-removal detection), and cache writing.
|
|
169
|
+
*/
|
|
170
|
+
|
|
171
|
+
declare const AWESOME_COPILOT_REPO_URL = "https://github.com/github/awesome-copilot.git";
|
|
172
|
+
declare const SOURCE_NAME = "awesome-copilot";
|
|
173
|
+
declare const MASS_REMOVAL_THRESHOLD = 0.25;
|
|
174
|
+
interface SyncOptions {
|
|
175
|
+
dryRun?: boolean;
|
|
176
|
+
force?: boolean;
|
|
177
|
+
/** Override local git checkout directory (used for testing). */
|
|
178
|
+
repoDir?: string;
|
|
179
|
+
/** Override remote git URL (used for testing). */
|
|
180
|
+
remoteUrl?: string;
|
|
181
|
+
/** Skip git network clone/pull operations (used when repoDir is pre-populated). */
|
|
182
|
+
skipGit?: boolean;
|
|
183
|
+
}
|
|
184
|
+
interface SyncResult {
|
|
185
|
+
assets: Asset[];
|
|
186
|
+
added: string[];
|
|
187
|
+
updated: string[];
|
|
188
|
+
removed: string[];
|
|
189
|
+
unchanged: string[];
|
|
190
|
+
dryRun: boolean;
|
|
191
|
+
legacyCacheDetected: boolean;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Scans a local awesome-copilot directory and returns all discovered canonical assets.
|
|
195
|
+
*/
|
|
196
|
+
declare function scanAwesomeCopilotRepo(repoDir: string): Asset[];
|
|
197
|
+
/**
|
|
198
|
+
* Ensures the local git clone of awesome-copilot is present and up to date.
|
|
199
|
+
*/
|
|
200
|
+
declare function ensureAwesomeCopilotRepo(repoDir?: string, remoteUrl?: string): Promise<void>;
|
|
201
|
+
/**
|
|
202
|
+
* Loads the cached catalogue from ~/.agentsmith/catalogue.json.
|
|
203
|
+
*/
|
|
204
|
+
declare function loadCatalogue(): CatalogueEntry[];
|
|
205
|
+
/**
|
|
206
|
+
* Loads the cached manifest from ~/.agentsmith/manifest.json.
|
|
207
|
+
*/
|
|
208
|
+
declare function loadManifest(): ManifestEntry[];
|
|
209
|
+
/**
|
|
210
|
+
* Validates structural integrity and guards against accidental mass removals.
|
|
211
|
+
*/
|
|
212
|
+
declare function validateSyncSafety(assets: Asset[], previousManifest: ManifestEntry[], force?: boolean): void;
|
|
213
|
+
/**
|
|
214
|
+
* Syncs the awesome-copilot repository into the local cache and updates catalogue.json and manifest.json.
|
|
215
|
+
*/
|
|
216
|
+
declare function syncAwesomeCopilot(options?: SyncOptions): Promise<SyncResult>;
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* VS Code (Copilot) target adapter.
|
|
220
|
+
* Repo scope: .github/
|
|
221
|
+
* User scope: ~/.copilot/
|
|
222
|
+
*/
|
|
223
|
+
|
|
224
|
+
interface AdaptationResult {
|
|
225
|
+
outcome: CompatibilityOutcome;
|
|
226
|
+
content: string;
|
|
227
|
+
adaptations: string[];
|
|
228
|
+
reason?: string;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Target adapter registry for VS Code, Kiro, and Antigravity.
|
|
233
|
+
*/
|
|
234
|
+
|
|
235
|
+
declare const ALL_TARGETS: readonly Target[];
|
|
236
|
+
interface TargetAdapter {
|
|
237
|
+
target: Target;
|
|
238
|
+
resolveBaseDir(scope: Scope, cwd?: string, home?: string): string;
|
|
239
|
+
resolveTargetPath(assetId: string, type: AssetType, scope: Scope, cwd?: string, home?: string): string | null;
|
|
240
|
+
adaptContent(content: string, type: AssetType): AdaptationResult;
|
|
241
|
+
}
|
|
242
|
+
declare function isValidTarget(value: string): value is Target;
|
|
243
|
+
declare function isValidScope(value: string): value is Scope;
|
|
244
|
+
interface TargetTerminology {
|
|
245
|
+
singular: Record<AssetType, string>;
|
|
246
|
+
plural: Record<AssetType, string>;
|
|
247
|
+
}
|
|
248
|
+
declare const TARGET_TERMINOLOGY: Record<Target, TargetTerminology>;
|
|
249
|
+
declare function getTargetTypeLabel(type: AssetType, target: Target): string;
|
|
250
|
+
declare function getTargetTypePlural(type: AssetType, target: Target): string;
|
|
251
|
+
declare function normaliseTargetAssetType(rawType: string, _target?: Target): AssetType | undefined;
|
|
252
|
+
declare function getTargetAdapter(target: Target): TargetAdapter;
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Asset installation lifecycle.
|
|
256
|
+
*/
|
|
257
|
+
|
|
258
|
+
interface InstallOptions {
|
|
259
|
+
target: Target;
|
|
260
|
+
scope: Scope;
|
|
261
|
+
dryRun?: boolean;
|
|
262
|
+
force?: boolean;
|
|
263
|
+
cwd?: string;
|
|
264
|
+
home?: string;
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Installs a single asset from the local cache into the specified target and scope.
|
|
268
|
+
*/
|
|
269
|
+
declare function installAsset(assetId: string, options: InstallOptions): OperationResult;
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* Upstream update lifecycle for subscribed assets.
|
|
273
|
+
*/
|
|
274
|
+
|
|
275
|
+
interface UpdateOptions {
|
|
276
|
+
target?: Target;
|
|
277
|
+
scope?: Scope;
|
|
278
|
+
dryRun?: boolean;
|
|
279
|
+
force?: boolean;
|
|
280
|
+
cwd?: string;
|
|
281
|
+
home?: string;
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Checks all subscribed assets (filtered by target/scope) and applies upstream updates.
|
|
285
|
+
*/
|
|
286
|
+
declare function updateSubscribedAssets(options?: UpdateOptions): OperationResult[];
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Asset removal lifecycle.
|
|
290
|
+
*/
|
|
291
|
+
|
|
292
|
+
interface RemoveOptions {
|
|
293
|
+
target: Target;
|
|
294
|
+
scope: Scope;
|
|
295
|
+
dryRun?: boolean;
|
|
296
|
+
cwd?: string;
|
|
297
|
+
home?: string;
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* Removes an installed asset and its subscription record.
|
|
301
|
+
*/
|
|
302
|
+
declare function removeAsset(assetId: string, options: RemoveOptions): OperationResult;
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Subscription state management and status calculation (~/.agentsmith/subscriptions.json).
|
|
306
|
+
*/
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* Loads all subscription records from ~/.agentsmith/subscriptions.json.
|
|
310
|
+
*/
|
|
311
|
+
declare function loadSubscriptions(): Subscription[];
|
|
312
|
+
/**
|
|
313
|
+
* Persists subscription records to ~/.agentsmith/subscriptions.json.
|
|
314
|
+
*/
|
|
315
|
+
declare function saveSubscriptions(subscriptions: Subscription[]): void;
|
|
316
|
+
/**
|
|
317
|
+
* Finds an existing subscription matching (id, target, scope) and optional path constraint.
|
|
318
|
+
*/
|
|
319
|
+
declare function findSubscription(id: string, target: Target, scope: Scope, installedPathOrBaseDir?: string): Subscription | undefined;
|
|
320
|
+
/**
|
|
321
|
+
* Inserts or updates a subscription record in ~/.agentsmith/subscriptions.json.
|
|
322
|
+
*/
|
|
323
|
+
declare function upsertSubscription(sub: Subscription): void;
|
|
324
|
+
/**
|
|
325
|
+
* Removes a subscription record by (id, target, scope) and optional path constraint. Returns true if one was removed.
|
|
326
|
+
*/
|
|
327
|
+
declare function removeSubscriptionRecord(id: string, target: Target, scope: Scope, installedPathOrBaseDir?: string): boolean;
|
|
328
|
+
/**
|
|
329
|
+
* Computes the runtime status of a single subscription (existence, local edits, upstream updates).
|
|
330
|
+
*/
|
|
331
|
+
declare function computeAssetStatus(subscription: Subscription, manifest?: ManifestEntry[]): AssetStatus;
|
|
332
|
+
/**
|
|
333
|
+
* Returns statuses for all subscriptions, optionally filtered by target and/or scope.
|
|
334
|
+
*/
|
|
335
|
+
declare function listAssetStatuses(filter?: {
|
|
336
|
+
target?: Target;
|
|
337
|
+
scope?: Scope;
|
|
338
|
+
}): AssetStatus[];
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* Recommendation scoring and stack detection for user and repository scopes.
|
|
342
|
+
*/
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
* Known vendor and platform prefixes isolated from generic tech tags.
|
|
346
|
+
*/
|
|
347
|
+
declare const VENDOR_PREFIXES: readonly string[];
|
|
348
|
+
/**
|
|
349
|
+
* Tech-specific keywords that prevent an asset from being recommended at user level.
|
|
350
|
+
*/
|
|
351
|
+
declare const USER_TECH_SPECIFIC_SEGMENTS: readonly string[];
|
|
352
|
+
/**
|
|
353
|
+
* Positive keywords identifying general-purpose, cross-cutting engineering assets.
|
|
354
|
+
*/
|
|
355
|
+
declare const USER_GENERAL_POSITIVE_SEGMENTS: readonly string[];
|
|
356
|
+
/**
|
|
357
|
+
* Inspects a repository directory to detect language, framework, and tooling signals.
|
|
358
|
+
*/
|
|
359
|
+
declare function detectRepoStack(cwd?: string): string[];
|
|
360
|
+
/**
|
|
361
|
+
* Determines whether a catalogue entry is recommended for repository scope given detected stack tags.
|
|
362
|
+
*/
|
|
363
|
+
declare function isRepoRecommended(entry: CatalogueEntry, tags: readonly string[]): boolean;
|
|
364
|
+
/**
|
|
365
|
+
* Determines whether a catalogue entry is recommended for user scope (tech-agnostic baseline).
|
|
366
|
+
*/
|
|
367
|
+
declare function isUserRecommended(entry: CatalogueEntry): boolean;
|
|
368
|
+
/**
|
|
369
|
+
* Returns the set of recommended asset IDs for a given scope and workspace.
|
|
370
|
+
*/
|
|
371
|
+
declare function getRecommendedAssetIds(catalogue: readonly CatalogueEntry[], scope: Scope, cwd?: string): Set<string>;
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* Auto-detect target environments from the current working directory.
|
|
375
|
+
*/
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* Detects active target environments in `cwd` by checking for `.github`, `.kiro`, and `.agents`/`.gemini`.
|
|
379
|
+
*/
|
|
380
|
+
declare function detectTargets(cwd?: string, fallbackToDefault?: boolean): Target[];
|
|
381
|
+
/**
|
|
382
|
+
* Resolves the target environment for a command:
|
|
383
|
+
* - Returns `explicitTarget` immediately if supplied.
|
|
384
|
+
* - Auto-selects the single detected target if exactly one marker directory exists in `cwd`.
|
|
385
|
+
* - Prompts the user with detected targets (when multiple exist) or all targets (when none exist in `cwd`).
|
|
386
|
+
*/
|
|
387
|
+
declare function resolveTarget(explicitTarget?: Target, cwd?: string, promptFn?: (targets: Target[]) => Promise<Target>): Promise<Target>;
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
* Interactive picker UI and status badge formatting using @inquirer/prompts.
|
|
391
|
+
*/
|
|
392
|
+
|
|
393
|
+
/**
|
|
394
|
+
* Formats status badges for an asset according to the project specification:
|
|
395
|
+
* ★ Recommended for this environment
|
|
396
|
+
* [*] Already installed
|
|
397
|
+
* [↑] Update available
|
|
398
|
+
* [~] Locally modified since install
|
|
399
|
+
* [!] Requires additional setup
|
|
400
|
+
*/
|
|
401
|
+
declare function formatAssetBadges(options: {
|
|
402
|
+
installed?: boolean;
|
|
403
|
+
updateAvailable?: boolean;
|
|
404
|
+
locallyModified?: boolean;
|
|
405
|
+
requiresSetup?: boolean;
|
|
406
|
+
recommended?: boolean;
|
|
407
|
+
}): string;
|
|
408
|
+
/**
|
|
409
|
+
* Formats a single asset status row for `agentsmith list`.
|
|
410
|
+
*/
|
|
411
|
+
declare function formatStatusLine(status: AssetStatus, catalogueEntry?: CatalogueEntry): string;
|
|
412
|
+
/**
|
|
413
|
+
* Sanitises markdown descriptions by collapsing line breaks, list bullet markers,
|
|
414
|
+
* and excess whitespace into a single clean line.
|
|
415
|
+
*/
|
|
416
|
+
declare function cleanDescription(desc: string): string;
|
|
417
|
+
/**
|
|
418
|
+
* Truncates a string to fit within a fixed column width and pads it with trailing spaces.
|
|
419
|
+
*/
|
|
420
|
+
declare function truncateAndPad(str: string, width: number): string;
|
|
421
|
+
/**
|
|
422
|
+
* Centres a string within a fixed width by padding both sides with spaces.
|
|
423
|
+
*/
|
|
424
|
+
declare function centreAndPad(str: string, width: number): string;
|
|
425
|
+
/**
|
|
426
|
+
* Resolves a human-friendly relative destination path for an asset within the target environment.
|
|
427
|
+
*/
|
|
428
|
+
declare function getTargetDisplayPath(assetId: string, type: AssetType, target: Target, scope?: Scope): string;
|
|
429
|
+
/**
|
|
430
|
+
* Filters and scores catalogue entries by search query matching on ID, title, description, tags, and target terms.
|
|
431
|
+
*/
|
|
432
|
+
declare function filterCatalogueBySearch(catalogue: readonly CatalogueEntry[], query: string, target: Target): CatalogueEntry[];
|
|
433
|
+
interface PromptInstallOptions {
|
|
434
|
+
recommendedIds?: Set<string>;
|
|
435
|
+
searchQuery?: string;
|
|
436
|
+
typeFilter?: AssetType;
|
|
437
|
+
skipFilterMenu?: boolean;
|
|
438
|
+
scope?: Scope;
|
|
439
|
+
}
|
|
440
|
+
/**
|
|
441
|
+
* Prompts the user to select one or more assets from the catalogue to install.
|
|
442
|
+
* Supports category filtering, fuzzy search, and target-specific terminology.
|
|
443
|
+
*/
|
|
444
|
+
declare function promptSelectAssetsToInstall(catalogue: CatalogueEntry[], statuses: AssetStatus[], target: Target, options?: PromptInstallOptions | Set<string>): Promise<string[]>;
|
|
445
|
+
/**
|
|
446
|
+
* Prompts the user to select installed subscriptions to remove.
|
|
447
|
+
*/
|
|
448
|
+
declare function promptSelectAssetsToRemove(subscriptions: Subscription[]): Promise<string[]>;
|
|
449
|
+
/**
|
|
450
|
+
* Prompts the user to select a target environment when none or multiple are detected.
|
|
451
|
+
*/
|
|
452
|
+
declare function promptSelectTarget(targets?: readonly Target[]): Promise<Target>;
|
|
453
|
+
|
|
454
|
+
/**
|
|
455
|
+
* agentsmith — public API surface
|
|
456
|
+
*
|
|
457
|
+
* The CLI entry point is src/cli.ts.
|
|
458
|
+
* This file exports the programmatic API for use as a library.
|
|
459
|
+
*/
|
|
460
|
+
declare const VERSION = "0.1.0";
|
|
461
|
+
|
|
462
|
+
export { ALL_TARGETS, AWESOME_COPILOT_REPO_URL, MASS_REMOVAL_THRESHOLD, SOURCE_NAME, TARGET_TERMINOLOGY, USER_GENERAL_POSITIVE_SEGMENTS, USER_TECH_SPECIFIC_SEGMENTS, VENDOR_PREFIXES, VERSION, assertPathWithin, awesomeCopilotRoot, cacheRoot, cataloguePath, centreAndPad, cleanDescription, computeAssetStatus, detectRepoStack, detectTargets, ensureAwesomeCopilotRepo, filterCatalogueBySearch, findSubscription, formatAssetBadges, formatStatusLine, getRecommendedAssetIds, getTargetAdapter, getTargetDisplayPath, getTargetTypeLabel, getTargetTypePlural, hashAssetPath, hashDirectory, hashFile, hashString, installAsset, isRepoRecommended, isUserRecommended, isValidScope, isValidTarget, legacyCacheRoot, listAssetStatuses, loadCatalogue, loadManifest, loadSubscriptions, manifestPath, normaliseTargetAssetType, parseFrontmatter, promptSelectAssetsToInstall, promptSelectAssetsToRemove, promptSelectTarget, removeAsset, removeSubscriptionRecord, resolveTarget, saveSubscriptions, scanAwesomeCopilotRepo, serialiseFrontmatter, subscriptionsPath, syncAwesomeCopilot, truncateAndPad, updateSubscribedAssets, upsertSubscription, validateSyncSafety };
|
|
463
|
+
export type { AdaptationResult, Asset, AssetStatus, AssetType, CatalogueEntry, CompatibilityOutcome, InstallOptions, ManifestEntry, OperationResult, ParsedFrontmatter, PromptInstallOptions, RemoveOptions, Scope, Subscription, SyncOptions, SyncResult, Target, TargetAdapter, TargetTerminology, UpdateOptions };
|