@senior-skills/cli 1.0.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/README.md +21 -0
- package/bin/senior-skills.mjs +4 -0
- package/dist/cli.d.ts +11 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +272 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/authoring.d.ts +20 -0
- package/dist/commands/authoring.d.ts.map +1 -0
- package/dist/commands/authoring.js +136 -0
- package/dist/commands/authoring.js.map +1 -0
- package/dist/commands/discovery.d.ts +12 -0
- package/dist/commands/discovery.d.ts.map +1 -0
- package/dist/commands/discovery.js +188 -0
- package/dist/commands/discovery.js.map +1 -0
- package/dist/commands/install.d.ts +11 -0
- package/dist/commands/install.d.ts.map +1 -0
- package/dist/commands/install.js +99 -0
- package/dist/commands/install.js.map +1 -0
- package/dist/commands/lifecycle.d.ts +13 -0
- package/dist/commands/lifecycle.d.ts.map +1 -0
- package/dist/commands/lifecycle.js +189 -0
- package/dist/commands/lifecycle.js.map +1 -0
- package/dist/commands/system.d.ts +22 -0
- package/dist/commands/system.d.ts.map +1 -0
- package/dist/commands/system.js +170 -0
- package/dist/commands/system.js.map +1 -0
- package/dist/container.d.ts +29 -0
- package/dist/container.d.ts.map +1 -0
- package/dist/container.js +101 -0
- package/dist/container.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/options.d.ts +25 -0
- package/dist/options.d.ts.map +1 -0
- package/dist/options.js +39 -0
- package/dist/options.js.map +1 -0
- package/dist/ui.d.ts +42 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +136 -0
- package/dist/ui.js.map +1 -0
- package/dist/update-notifications.d.ts +19 -0
- package/dist/update-notifications.d.ts.map +1 -0
- package/dist/update-notifications.js +142 -0
- package/dist/update-notifications.js.map +1 -0
- package/package.json +53 -0
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { AgentSkillsError, DiagnoseSystem, ErrorCode, ExitCode, detectAgents, } from '@senior-skills/core';
|
|
2
|
+
import { inferKind } from '@senior-skills/node';
|
|
3
|
+
import { glyph, heading, info, json, out, plural, style, success, table, warn } from "../ui.js";
|
|
4
|
+
export async function runDoctor(ctx, options) {
|
|
5
|
+
const report = await new DiagnoseSystem(ctx).execute({
|
|
6
|
+
...(options.offline === undefined ? {} : { offline: options.offline }),
|
|
7
|
+
});
|
|
8
|
+
if (options.json === true) {
|
|
9
|
+
json(report);
|
|
10
|
+
return report.ok ? ExitCode.OK : ExitCode.FAILURE;
|
|
11
|
+
}
|
|
12
|
+
render(report);
|
|
13
|
+
return report.ok ? ExitCode.OK : ExitCode.FAILURE;
|
|
14
|
+
}
|
|
15
|
+
function render(report) {
|
|
16
|
+
out();
|
|
17
|
+
out(style.bold('Senior Skills Doctor'));
|
|
18
|
+
for (const section of report.sections) {
|
|
19
|
+
out();
|
|
20
|
+
out(`${style.bold(section.title)}`);
|
|
21
|
+
for (const check of section.checks) {
|
|
22
|
+
out(` ${marker(check.status)} ${check.title}${check.detail === undefined ? '' : ` ${style.dim(check.detail)}`}`);
|
|
23
|
+
for (const note of check.notes ?? [])
|
|
24
|
+
out(` ${style.dim(note)}`);
|
|
25
|
+
if (check.hint !== undefined)
|
|
26
|
+
out(` ${style.cyan(check.hint)}`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
out();
|
|
30
|
+
if (report.ok && report.warnings === 0) {
|
|
31
|
+
success('Everything looks good.');
|
|
32
|
+
}
|
|
33
|
+
else if (report.ok) {
|
|
34
|
+
warn(`${plural(report.warnings, 'warning')} — nothing is broken.`);
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
out(`${style.red(glyph.fail)} ${plural(report.failures, 'problem')} found.`);
|
|
38
|
+
}
|
|
39
|
+
out();
|
|
40
|
+
}
|
|
41
|
+
function marker(status) {
|
|
42
|
+
switch (status) {
|
|
43
|
+
case 'ok':
|
|
44
|
+
return style.green(glyph.ok);
|
|
45
|
+
case 'warn':
|
|
46
|
+
return style.yellow(glyph.warn);
|
|
47
|
+
case 'fail':
|
|
48
|
+
return style.red(glyph.fail);
|
|
49
|
+
default:
|
|
50
|
+
return style.dim(glyph.skip);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* `senior-skills agents` — what detection found, without the rest of doctor's output.
|
|
55
|
+
* Answers "does this machine have Codex?" directly, which is the question people actually ask.
|
|
56
|
+
*/
|
|
57
|
+
export async function runAgents(ctx, options) {
|
|
58
|
+
const detections = await detectAgents(ctx);
|
|
59
|
+
if (options.json === true) {
|
|
60
|
+
json(detections);
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
heading('Detecting agents...');
|
|
64
|
+
for (const detection of detections) {
|
|
65
|
+
const adapter = ctx.agents.find(detection.agentId);
|
|
66
|
+
const label = adapter?.displayName ?? detection.agentId;
|
|
67
|
+
if (detection.installed) {
|
|
68
|
+
out(`${style.green(glyph.ok)} ${label} detected`);
|
|
69
|
+
}
|
|
70
|
+
else if (detection.strength === 'weak') {
|
|
71
|
+
out(`${style.yellow(glyph.warn)} ${label} — weak evidence only`);
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
out(`${style.dim(glyph.skip)} ${style.dim(`${label} not detected`)}`);
|
|
75
|
+
}
|
|
76
|
+
for (const evidence of detection.evidence) {
|
|
77
|
+
out(` ${style.dim(`${evidence.kind}: ${evidence.detail}`)}`);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
const anyInstalled = detections.some((detection) => detection.installed);
|
|
81
|
+
out();
|
|
82
|
+
if (!anyInstalled) {
|
|
83
|
+
out('No supported coding agents detected.');
|
|
84
|
+
out();
|
|
85
|
+
out('Supported agents:');
|
|
86
|
+
for (const adapter of ctx.agents.all())
|
|
87
|
+
out(`- ${adapter.displayName}`);
|
|
88
|
+
out();
|
|
89
|
+
out('Use --agent to explicitly select an agent.');
|
|
90
|
+
out();
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
export async function runRegistryList(ctx, options) {
|
|
94
|
+
const registries = ctx.config.registries;
|
|
95
|
+
if (options.json === true) {
|
|
96
|
+
json(registries);
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
if (registries.length === 0) {
|
|
100
|
+
heading('No registries configured');
|
|
101
|
+
info('senior-skills registry add official https://github.com/robsonkades/senior-skills.git');
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
heading('Registries');
|
|
105
|
+
out(` ${style.dim('Earlier entries take precedence: the first registry publishing a name owns it.')}`);
|
|
106
|
+
out();
|
|
107
|
+
table(registries.map((registry, index) => [
|
|
108
|
+
style.dim(`${index + 1}.`),
|
|
109
|
+
style.bold(registry.name),
|
|
110
|
+
registry.kind,
|
|
111
|
+
registry.url + (registry.ref === undefined ? '' : `#${registry.ref}`),
|
|
112
|
+
registry.trusted ? '' : style.yellow('untrusted'),
|
|
113
|
+
]));
|
|
114
|
+
out();
|
|
115
|
+
}
|
|
116
|
+
export async function runRegistryAdd(ctx, store, name, url, options) {
|
|
117
|
+
const config = await store.load();
|
|
118
|
+
if (config.registries.some((registry) => registry.name === name)) {
|
|
119
|
+
throw new AgentSkillsError(ErrorCode.REGISTRY_DUPLICATE, `A registry named "${name}" already exists`, {
|
|
120
|
+
hints: [`senior-skills registry remove ${name} then add it again`],
|
|
121
|
+
data: { name },
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
const entry = {
|
|
125
|
+
name,
|
|
126
|
+
url,
|
|
127
|
+
kind: inferKind(options.kind, url),
|
|
128
|
+
trusted: options.untrusted !== true,
|
|
129
|
+
...(options.ref === undefined ? {} : { ref: options.ref }),
|
|
130
|
+
};
|
|
131
|
+
// Precedence is list order, so where a registry lands is a real decision, not cosmetics.
|
|
132
|
+
const registries = options.first === true ? [entry, ...config.registries] : [...config.registries, entry];
|
|
133
|
+
await store.save({ ...config, registries });
|
|
134
|
+
if (options.json === true) {
|
|
135
|
+
json({ added: entry, registries });
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
success(`Added registry "${name}" (${entry.kind})`);
|
|
139
|
+
out(` ${style.dim(url)}`);
|
|
140
|
+
out(` ${style.dim(options.first === true
|
|
141
|
+
? 'Placed first: it now takes precedence over every other registry.'
|
|
142
|
+
: 'Placed last: existing registries keep precedence for names they already publish.')}`);
|
|
143
|
+
if (!entry.trusted)
|
|
144
|
+
out(` ${style.yellow('Marked untrusted; doctor will flag it.')}`);
|
|
145
|
+
out();
|
|
146
|
+
info(`Config: ${store.location()}`);
|
|
147
|
+
void ctx;
|
|
148
|
+
}
|
|
149
|
+
export async function runRegistryRemove(store, name, options) {
|
|
150
|
+
const config = await store.load();
|
|
151
|
+
const registries = config.registries.filter((registry) => registry.name !== name);
|
|
152
|
+
if (registries.length === config.registries.length) {
|
|
153
|
+
throw new AgentSkillsError(ErrorCode.REGISTRY_NOT_FOUND, `No registry named "${name}"`, {
|
|
154
|
+
details: ['', 'Configured:', ...config.registries.map((registry) => ` ${registry.name}`)],
|
|
155
|
+
hints: ['senior-skills registry list'],
|
|
156
|
+
data: { name },
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
await store.save({ ...config, registries });
|
|
160
|
+
if (options.json === true) {
|
|
161
|
+
json({ removed: name, registries });
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
success(`Removed registry "${name}"`);
|
|
165
|
+
if (registries.length === 0) {
|
|
166
|
+
out();
|
|
167
|
+
warn('No registries are configured; install and search will not find anything.');
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
//# sourceMappingURL=system.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system.js","sourceRoot":"","sources":["../../src/commands/system.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,SAAS,EACT,QAAQ,EACR,YAAY,GAKb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AC,IAAI,EAAE,CAAC;IAClC,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;IAElF,IAAI,UAAU,CAAC,MAAM,KAAK,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;QACnD,MAAM,IAAI,gBAAgB,CAAC,SAAS,CAAC,kBAAkB,EAAE,sBAAsB,IAAI,GAAG,EAAE;YACtF,OAAO,EAAE,CAAC,EAAE,EAAE,aAAa,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,KAAK,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;YAC1F,KAAK,EAAE,CAAC,6BAA6B,CAAC;YACtC,IAAI,EAAE,EAAE,IAAI,EAAE;SACf,CAAC,CAAC;IACL,CAAC;IAED,MAAM,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC;IAE5C,IAAI,OAAO,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;QAC1B,IAAI,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;QACpC,OAAO;IACT,CAAC;IAED,OAAO,CAAC,qBAAqB,IAAI,GAAG,CAAC,CAAC;IACtC,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC5B,GAAG,EAAE,CAAC;QACN,IAAI,CAAC,0EAA0E,CAAC,CAAC;IACnF,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type AgentSkillsConfig, type ApplicationContext, type Hasher } from '@senior-skills/core';
|
|
2
|
+
import { FileConfigStore } from '@senior-skills/node';
|
|
3
|
+
import type { LogLevel } from '@senior-skills/core';
|
|
4
|
+
import type { NotificationServices } from './update-notifications.ts';
|
|
5
|
+
export declare const TOOL_NAME = "@senior-skills/cli";
|
|
6
|
+
export interface ContainerOptions {
|
|
7
|
+
readonly logLevel?: LogLevel;
|
|
8
|
+
readonly allowInsecure?: boolean;
|
|
9
|
+
readonly version: string;
|
|
10
|
+
}
|
|
11
|
+
export interface Container {
|
|
12
|
+
readonly ctx: ApplicationContext;
|
|
13
|
+
readonly hasher: Hasher;
|
|
14
|
+
readonly configStore: FileConfigStore;
|
|
15
|
+
readonly config: AgentSkillsConfig;
|
|
16
|
+
readonly notifications: NotificationServices;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The composition root.
|
|
20
|
+
*
|
|
21
|
+
* This is the only place in the project where a concrete class is chosen. Every layer above
|
|
22
|
+
* receives interfaces, which is what makes "swap the registry", "swap the filesystem" and
|
|
23
|
+
* "add an agent" true statements rather than aspirations.
|
|
24
|
+
*
|
|
25
|
+
* Registering a third-party adapter is one more `.register(...)` call here — or, once a
|
|
26
|
+
* plugin loader exists, a line of configuration that ends up doing exactly this.
|
|
27
|
+
*/
|
|
28
|
+
export declare function createContainer(options: ContainerOptions): Promise<Container>;
|
|
29
|
+
//# sourceMappingURL=container.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../src/container.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EAEvB,KAAK,MAAM,EACZ,MAAM,qBAAqB,CAAC;AAK7B,OAAO,EAEL,eAAe,EAYhB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEtE,eAAO,MAAM,SAAS,uBAAuB,CAAC;AAE9C,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAC7B,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;IACjC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,GAAG,EAAE,kBAAkB,CAAC;IACjC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,WAAW,EAAE,eAAe,CAAC;IACtC,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;IACnC,QAAQ,CAAC,aAAa,EAAE,oBAAoB,CAAC;CAC9C;AAED;;;;;;;;;GASG;AACH,wBAAsB,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,SAAS,CAAC,CAqGnF"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { AgentCatalog, ApplySkillUpdates, CheckUpdates, } from '@senior-skills/core';
|
|
2
|
+
import { ClaudeCodeAdapter } from '@senior-skills/adapter-claude';
|
|
3
|
+
import { CodexAdapter } from '@senior-skills/adapter-codex';
|
|
4
|
+
import { AtomicInstaller, SafeExtractor } from '@senior-skills/installer';
|
|
5
|
+
import { DefaultRegistryFactory, RegistryFederation } from '@senior-skills/registry';
|
|
6
|
+
import { ConsoleLogger, FileConfigStore, NodeArchiveReader, NodeCommandRunner, NodeEnvironment, NodeFileSystem, NodeHasher, NodeHttpClient, SystemClock, cacheHome, FileUpdateStateStore, NpmToolUpdater, NodeSelectionPrompt, } from '@senior-skills/node';
|
|
7
|
+
import { fileURLToPath } from 'node:url';
|
|
8
|
+
export const TOOL_NAME = '@senior-skills/cli';
|
|
9
|
+
/**
|
|
10
|
+
* The composition root.
|
|
11
|
+
*
|
|
12
|
+
* This is the only place in the project where a concrete class is chosen. Every layer above
|
|
13
|
+
* receives interfaces, which is what makes "swap the registry", "swap the filesystem" and
|
|
14
|
+
* "add an agent" true statements rather than aspirations.
|
|
15
|
+
*
|
|
16
|
+
* Registering a third-party adapter is one more `.register(...)` call here — or, once a
|
|
17
|
+
* plugin loader exists, a line of configuration that ends up doing exactly this.
|
|
18
|
+
*/
|
|
19
|
+
export async function createContainer(options) {
|
|
20
|
+
const toolVersion = `${TOOL_NAME}@${options.version}`;
|
|
21
|
+
const fs = new NodeFileSystem();
|
|
22
|
+
const env = new NodeEnvironment();
|
|
23
|
+
const clock = new SystemClock();
|
|
24
|
+
const hasher = new NodeHasher();
|
|
25
|
+
const commands = new NodeCommandRunner();
|
|
26
|
+
const logger = new ConsoleLogger(options.logLevel ?? 'info');
|
|
27
|
+
const http = new NodeHttpClient(`senior-skills/${options.version}`, options.allowInsecure === true);
|
|
28
|
+
const configStore = new FileConfigStore(fs, env);
|
|
29
|
+
const config = await configStore.load();
|
|
30
|
+
const agents = new AgentCatalog().register(new ClaudeCodeAdapter()).register(new CodexAdapter());
|
|
31
|
+
const extractor = new SafeExtractor(new NodeArchiveReader());
|
|
32
|
+
const registryFactory = new DefaultRegistryFactory({
|
|
33
|
+
fs,
|
|
34
|
+
hasher,
|
|
35
|
+
http,
|
|
36
|
+
commands,
|
|
37
|
+
clock,
|
|
38
|
+
logger,
|
|
39
|
+
extractor,
|
|
40
|
+
cacheDir: cacheHome(fs, env),
|
|
41
|
+
ttlSeconds: config.cache.ttlSeconds,
|
|
42
|
+
});
|
|
43
|
+
const registry = new RegistryFederation(config.registries.map((entry) => registryFactory.create(entry)));
|
|
44
|
+
const installer = new AtomicInstaller({ fs, hasher, clock, logger, toolVersion });
|
|
45
|
+
const ctx = {
|
|
46
|
+
agents,
|
|
47
|
+
registry,
|
|
48
|
+
installer,
|
|
49
|
+
fs,
|
|
50
|
+
env,
|
|
51
|
+
commands,
|
|
52
|
+
clock,
|
|
53
|
+
logger,
|
|
54
|
+
config,
|
|
55
|
+
toolVersion,
|
|
56
|
+
};
|
|
57
|
+
const tool = new NpmToolUpdater({
|
|
58
|
+
fs,
|
|
59
|
+
env,
|
|
60
|
+
commands,
|
|
61
|
+
http,
|
|
62
|
+
packageDirectory: fileURLToPath(new URL('../', import.meta.url)),
|
|
63
|
+
nodeExecutable: process.execPath,
|
|
64
|
+
});
|
|
65
|
+
// Notification traffic has a short deadline and never launches credential prompts.
|
|
66
|
+
// Its drivers share the normal registry cache, but installs keep their usual timeouts.
|
|
67
|
+
const notificationFactory = new DefaultRegistryFactory({
|
|
68
|
+
fs,
|
|
69
|
+
hasher,
|
|
70
|
+
clock,
|
|
71
|
+
logger,
|
|
72
|
+
extractor,
|
|
73
|
+
cacheDir: cacheHome(fs, env),
|
|
74
|
+
ttlSeconds: config.cache.ttlSeconds,
|
|
75
|
+
http: { get: (url, request) => http.get(url, { ...request, timeoutMs: 2000 }) },
|
|
76
|
+
commands: {
|
|
77
|
+
which: (command) => commands.which(command),
|
|
78
|
+
run: (command, args, request) => commands.run(command, args, {
|
|
79
|
+
...request,
|
|
80
|
+
timeoutMs: 2000,
|
|
81
|
+
env: { ...request?.env, GIT_TERMINAL_PROMPT: '0', GCM_INTERACTIVE: 'never' },
|
|
82
|
+
}),
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
const notificationRegistry = new RegistryFederation(config.registries.map((entry) => notificationFactory.create(entry)));
|
|
86
|
+
const notifications = {
|
|
87
|
+
check: new CheckUpdates({ ...ctx, registry: notificationRegistry }, tool, new FileUpdateStateStore(fs, env)),
|
|
88
|
+
apply: new ApplySkillUpdates(ctx),
|
|
89
|
+
tool,
|
|
90
|
+
prompt: new NodeSelectionPrompt(),
|
|
91
|
+
logger,
|
|
92
|
+
};
|
|
93
|
+
return {
|
|
94
|
+
ctx,
|
|
95
|
+
hasher,
|
|
96
|
+
configStore,
|
|
97
|
+
config,
|
|
98
|
+
notifications,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=container.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"container.js","sourceRoot":"","sources":["../src/container.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,YAAY,GAKb,MAAM,qBAAqB,CA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;KACP,CAAC;IAEF,OAAO;QACL,GAAG;QACH,MAAM;QACN,WAAW;QACX,MAAM;QACN,aAAa;KACd,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@senior-skills/cli` — the command-line interface and the composition root.
|
|
3
|
+
*
|
|
4
|
+
* Importable so that tests (and any embedding tool) can drive the CLI in-process rather than
|
|
5
|
+
* shelling out.
|
|
6
|
+
*/
|
|
7
|
+
export { VERSION, run } from './cli.ts';
|
|
8
|
+
export { createContainer, TOOL_NAME, type Container, type ContainerOptions } from './container.ts';
|
|
9
|
+
export { collect, resolveScope, type GlobalOptions } from './options.ts';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,KAAK,SAAS,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACnG,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@senior-skills/cli` — the command-line interface and the composition root.
|
|
3
|
+
*
|
|
4
|
+
* Importable so that tests (and any embedding tool) can drive the CLI in-process rather than
|
|
5
|
+
* shelling out.
|
|
6
|
+
*/
|
|
7
|
+
export { VERSION, run } from "./cli.js";
|
|
8
|
+
export { createContainer, TOOL_NAME } from "./container.js";
|
|
9
|
+
export { collect, resolveScope } from "./options.js";
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,SAAS,EAAyC,MAAM,gBAAgB,CAAC;AACnG,OAAO,EAAE,OAAO,EAAE,YAAY,EAAsB,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type ApplicationContext, type InstallScope } from '@senior-skills/core';
|
|
2
|
+
export interface GlobalOptions {
|
|
3
|
+
readonly agent?: readonly string[];
|
|
4
|
+
readonly global?: boolean;
|
|
5
|
+
readonly project?: boolean;
|
|
6
|
+
readonly projectRoot?: string;
|
|
7
|
+
readonly registry?: string;
|
|
8
|
+
readonly dryRun?: boolean;
|
|
9
|
+
readonly json?: boolean;
|
|
10
|
+
readonly verbose?: boolean;
|
|
11
|
+
readonly quiet?: boolean;
|
|
12
|
+
readonly updateCheck?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Decides between global and project scope.
|
|
16
|
+
*
|
|
17
|
+
* The default is deliberately contextual: inside a directory that already has a `skills.lock`
|
|
18
|
+
* or an agent project directory, `install` almost always means "for this project", and making
|
|
19
|
+
* the user type `--project` every time would be a papercut. Everywhere else the default is
|
|
20
|
+
* global. Passing both flags is a usage error rather than a silent precedence rule.
|
|
21
|
+
*/
|
|
22
|
+
export declare function resolveScope(ctx: ApplicationContext, options: GlobalOptions): Promise<InstallScope>;
|
|
23
|
+
/** Commander collects repeatable options through this. */
|
|
24
|
+
export declare function collect(value: string, previous?: readonly string[]): readonly string[];
|
|
25
|
+
//# sourceMappingURL=options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,kBAAkB,EACvB,KAAK,YAAY,EAClB,MAAM,qBAAqB,CAAC;AAE7B,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;CAChC;AAED;;;;;;;GAOG;AACH,wBAAsB,YAAY,CAChC,GAAG,EAAE,kBAAkB,EACvB,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,YAAY,CAAC,CAiBvB;AAED,0DAA0D;AAC1D,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,GAAE,SAAS,MAAM,EAAO,GAAG,SAAS,MAAM,EAAE,CAQ1F"}
|
package/dist/options.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { AgentSkillsError, ErrorCode, findProjectRoot, } from '@senior-skills/core';
|
|
2
|
+
/**
|
|
3
|
+
* Decides between global and project scope.
|
|
4
|
+
*
|
|
5
|
+
* The default is deliberately contextual: inside a directory that already has a `skills.lock`
|
|
6
|
+
* or an agent project directory, `install` almost always means "for this project", and making
|
|
7
|
+
* the user type `--project` every time would be a papercut. Everywhere else the default is
|
|
8
|
+
* global. Passing both flags is a usage error rather than a silent precedence rule.
|
|
9
|
+
*/
|
|
10
|
+
export async function resolveScope(ctx, options) {
|
|
11
|
+
if (options.global === true && options.project === true) {
|
|
12
|
+
throw new AgentSkillsError(ErrorCode.USAGE, 'Cannot use --global and --project together', {
|
|
13
|
+
hints: ['Pick one: --global installs for your user, --project installs into this repository'],
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
if (options.global === true)
|
|
17
|
+
return 'global';
|
|
18
|
+
if (options.project === true || options.projectRoot !== undefined)
|
|
19
|
+
return 'project';
|
|
20
|
+
const projectRoot = await findProjectRoot(ctx.fs, ctx.env.cwd(), ctx.env.homeDir());
|
|
21
|
+
if (projectRoot === undefined)
|
|
22
|
+
return 'global';
|
|
23
|
+
for (const marker of ['skills.lock', '.claude/skills', '.agents/skills']) {
|
|
24
|
+
if (await ctx.fs.exists(ctx.fs.join(projectRoot, ...marker.split('/'))))
|
|
25
|
+
return 'project';
|
|
26
|
+
}
|
|
27
|
+
return 'global';
|
|
28
|
+
}
|
|
29
|
+
/** Commander collects repeatable options through this. */
|
|
30
|
+
export function collect(value, previous = []) {
|
|
31
|
+
return [
|
|
32
|
+
...previous,
|
|
33
|
+
...value
|
|
34
|
+
.split(',')
|
|
35
|
+
.map((item) => item.trim())
|
|
36
|
+
.filter(Boolean),
|
|
37
|
+
];
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.js","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,SAAS,EACT,eAAe,GAGhB,MAAM,qBAAqB,CAAC;AAe7B;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,GAAuB,EACvB,OAAsB;IAEtB,IAAI,OAAO,CAAC,MAAM,KAAK,IAAI,IAAI,OAAO,CAAC,OAAO,KAAK,IAAI,EAAE,CAAC;QACxD,MAAM,IAAI,gBAAgB,CAAC,SAAS,CAAC,KAAK,EAAE,4CAA4C,EAAE;YACxF,KAAK,EAAE,CAAC,oFAAoF,CAAC;SAC9F,CAAC,CAAC;IACL,CAAC;IACD,IAAI,OAAO,CAAC,MAAM,KAAK,IAAI;QAAE,OAAO,QAAQ,CAAC;IAC7C,IAAI,OAAO,CAAC,OAAO,KAAK,IAAI,IAAI,OAAO,CAAC,WAAW,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAEpF,MAAM,WAAW,GAAG,MAAM,eAAe,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;IACpF,IAAI,WAAW,KAAK,SAAS;QAAE,OAAO,QAAQ,CAAC;IAE/C,KAAK,MAAM,MAAM,IAAI,CAAC,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,CAAC,EAAE,CAAC;QACzE,IAAI,MAAM,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;YAAE,OAAO,SAAS,CAAC;IAC5F,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,0DAA0D;AAC1D,MAAM,UAAU,OAAO,CAAC,KAAa,EAAE,WAA8B,EAAE;IACrE,OAAO;QACL,GAAG,QAAQ;QACX,GAAG,KAAK;aACL,KAAK,CAAC,GAAG,CAAC;aACV,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;aAC1B,MAAM,CAAC,OAAO,CAAC;KACnB,CAAC;AACJ,CAAC"}
|
package/dist/ui.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type ValidationIssue } from '@senior-skills/core';
|
|
2
|
+
export declare function configureUi(options: {
|
|
3
|
+
color?: boolean;
|
|
4
|
+
quiet?: boolean;
|
|
5
|
+
}): void;
|
|
6
|
+
export declare const style: {
|
|
7
|
+
bold: (value: string) => string;
|
|
8
|
+
dim: (value: string) => string;
|
|
9
|
+
green: (value: string) => string;
|
|
10
|
+
yellow: (value: string) => string;
|
|
11
|
+
red: (value: string) => string;
|
|
12
|
+
cyan: (value: string) => string;
|
|
13
|
+
magenta: (value: string) => string;
|
|
14
|
+
};
|
|
15
|
+
export declare const glyph: {
|
|
16
|
+
ok: string;
|
|
17
|
+
warn: string;
|
|
18
|
+
fail: string;
|
|
19
|
+
skip: string;
|
|
20
|
+
arrow: string;
|
|
21
|
+
bullet: string;
|
|
22
|
+
};
|
|
23
|
+
export declare function out(line?: string): void;
|
|
24
|
+
/** Always printed, even under `--quiet`: this is the answer the user asked for. */
|
|
25
|
+
export declare function result(line?: string): void;
|
|
26
|
+
export declare function json(value: unknown): void;
|
|
27
|
+
export declare function heading(text: string): void;
|
|
28
|
+
export declare function success(text: string): void;
|
|
29
|
+
export declare function warn(text: string): void;
|
|
30
|
+
export declare function info(text: string): void;
|
|
31
|
+
/**
|
|
32
|
+
* Renders an error as headline, cause, and next action.
|
|
33
|
+
*
|
|
34
|
+
* Every failure in this tool is supposed to leave the user knowing what to do next, so the
|
|
35
|
+
* `Try:` block is part of the format rather than an optional extra.
|
|
36
|
+
*/
|
|
37
|
+
export declare function renderError(error: unknown, verbose: boolean): void;
|
|
38
|
+
export declare function renderIssues(issues: readonly ValidationIssue[]): void;
|
|
39
|
+
/** Left-aligned columns. Simpler and more predictable than wrapping in a narrow terminal. */
|
|
40
|
+
export declare function table(rows: readonly (readonly string[])[], indent?: string): void;
|
|
41
|
+
export declare function plural(count: number, singular: string, pluralForm?: string): string;
|
|
42
|
+
//# sourceMappingURL=ui.d.ts.map
|
package/dist/ui.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"AACA,OAAO,EAAsB,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAa/E,wBAAgB,WAAW,CAAC,OAAO,EAAE;IAAE,KA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
3
|
+
/**
|
|
4
|
+
* Terminal presentation.
|
|
5
|
+
*
|
|
6
|
+
* Kept apart from the commands so that every command can be read as "call a service, hand the
|
|
7
|
+
* result to a renderer" — and so `--json` is a different renderer rather than a branch
|
|
8
|
+
* threaded through business logic.
|
|
9
|
+
*/
|
|
10
|
+
let colorEnabled = true;
|
|
11
|
+
let quiet = false;
|
|
12
|
+
export function configureUi(options) {
|
|
13
|
+
if (options.color !== undefined)
|
|
14
|
+
colorEnabled = options.color;
|
|
15
|
+
if (options.quiet !== undefined)
|
|
16
|
+
quiet = options.quiet;
|
|
17
|
+
}
|
|
18
|
+
function paint(fn, value) {
|
|
19
|
+
return colorEnabled ? fn(value) : value;
|
|
20
|
+
}
|
|
21
|
+
export const style = {
|
|
22
|
+
bold: (value) => paint(colors.bold, value),
|
|
23
|
+
dim: (value) => paint(colors.dim, value),
|
|
24
|
+
green: (value) => paint(colors.green, value),
|
|
25
|
+
yellow: (value) => paint(colors.yellow, value),
|
|
26
|
+
red: (value) => paint(colors.red, value),
|
|
27
|
+
cyan: (value) => paint(colors.cyan, value),
|
|
28
|
+
magenta: (value) => paint(colors.magenta, value),
|
|
29
|
+
};
|
|
30
|
+
// ASCII fallbacks: Windows consoles in legacy code pages render box-drawing glyphs as noise.
|
|
31
|
+
const unicode = process.platform !== 'win32' || process.env['WT_SESSION'] !== undefined;
|
|
32
|
+
export const glyph = {
|
|
33
|
+
ok: unicode ? '✓' : '+',
|
|
34
|
+
warn: unicode ? '!' : '!',
|
|
35
|
+
fail: unicode ? '✗' : 'x',
|
|
36
|
+
skip: unicode ? '-' : '-',
|
|
37
|
+
arrow: unicode ? '→' : '->',
|
|
38
|
+
bullet: unicode ? '•' : '*',
|
|
39
|
+
};
|
|
40
|
+
export function out(line = '') {
|
|
41
|
+
if (!quiet)
|
|
42
|
+
process.stdout.write(`${line}\n`);
|
|
43
|
+
}
|
|
44
|
+
/** Always printed, even under `--quiet`: this is the answer the user asked for. */
|
|
45
|
+
export function result(line = '') {
|
|
46
|
+
process.stdout.write(`${line}\n`);
|
|
47
|
+
}
|
|
48
|
+
export function json(value) {
|
|
49
|
+
process.stdout.write(`${JSON.stringify(value, null, 2)}\n`);
|
|
50
|
+
}
|
|
51
|
+
export function heading(text) {
|
|
52
|
+
out();
|
|
53
|
+
out(style.bold(text));
|
|
54
|
+
out();
|
|
55
|
+
}
|
|
56
|
+
export function success(text) {
|
|
57
|
+
out(`${style.green(glyph.ok)} ${text}`);
|
|
58
|
+
}
|
|
59
|
+
export function warn(text) {
|
|
60
|
+
out(`${style.yellow(glyph.warn)} ${text}`);
|
|
61
|
+
}
|
|
62
|
+
export function info(text) {
|
|
63
|
+
out(`${style.dim(glyph.bullet)} ${text}`);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Renders an error as headline, cause, and next action.
|
|
67
|
+
*
|
|
68
|
+
* Every failure in this tool is supposed to leave the user knowing what to do next, so the
|
|
69
|
+
* `Try:` block is part of the format rather than an optional extra.
|
|
70
|
+
*/
|
|
71
|
+
export function renderError(error, verbose) {
|
|
72
|
+
const stream = process.stderr;
|
|
73
|
+
if (!isAgentSkillsError(error)) {
|
|
74
|
+
stream.write(`${style.red('error')} ${error instanceof Error ? error.message : String(error)}\n`);
|
|
75
|
+
if (verbose && error instanceof Error && error.stack !== undefined) {
|
|
76
|
+
stream.write(`\n${style.dim(error.stack)}\n`);
|
|
77
|
+
}
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
stream.write(`\n${style.red('error')} ${style.bold(error.message)}\n`);
|
|
81
|
+
if (error.details.length > 0) {
|
|
82
|
+
stream.write('\n');
|
|
83
|
+
for (const line of error.details)
|
|
84
|
+
stream.write(` ${line}\n`);
|
|
85
|
+
}
|
|
86
|
+
if (error.hints.length > 0) {
|
|
87
|
+
stream.write(`\n ${style.bold('Try:')}\n`);
|
|
88
|
+
for (const hint of error.hints)
|
|
89
|
+
stream.write(` ${style.cyan(hint)}\n`);
|
|
90
|
+
}
|
|
91
|
+
stream.write(`\n ${style.dim(`code: ${error.code}`)}\n\n`);
|
|
92
|
+
if (verbose && error.cause !== undefined) {
|
|
93
|
+
stream.write(`${style.dim('caused by:')}\n`);
|
|
94
|
+
stream.write(`${style.dim(String(error.cause instanceof Error ? (error.cause.stack ?? error.cause.message) : error.cause))}\n\n`);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
export function renderIssues(issues) {
|
|
98
|
+
for (const issue of issues) {
|
|
99
|
+
const marker = issue.severity === 'error'
|
|
100
|
+
? style.red(glyph.fail)
|
|
101
|
+
: issue.severity === 'warning'
|
|
102
|
+
? style.yellow(glyph.warn)
|
|
103
|
+
: style.dim(glyph.bullet);
|
|
104
|
+
out(` ${marker} ${style.bold(issue.at)} ${issue.message}`);
|
|
105
|
+
if (issue.hint !== undefined)
|
|
106
|
+
out(` ${style.dim(issue.hint)}`);
|
|
107
|
+
out(` ${style.dim(issue.rule)}`);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
/** Left-aligned columns. Simpler and more predictable than wrapping in a narrow terminal. */
|
|
111
|
+
export function table(rows, indent = ' ') {
|
|
112
|
+
if (rows.length === 0)
|
|
113
|
+
return;
|
|
114
|
+
const widths = [];
|
|
115
|
+
for (const row of rows) {
|
|
116
|
+
row.forEach((cell, index) => {
|
|
117
|
+
widths[index] = Math.max(widths[index] ?? 0, stripAnsi(cell).length);
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
for (const row of rows) {
|
|
121
|
+
const line = row
|
|
122
|
+
.map((cell, index) => index === row.length - 1
|
|
123
|
+
? cell
|
|
124
|
+
: cell + ' '.repeat((widths[index] ?? 0) - stripAnsi(cell).length))
|
|
125
|
+
.join(' ');
|
|
126
|
+
out(indent + line.trimEnd());
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
const ANSI_PATTERN = new RegExp(`${String.fromCharCode(27)}\\[[0-9;]*m`, 'g');
|
|
130
|
+
function stripAnsi(value) {
|
|
131
|
+
return value.replace(ANSI_PATTERN, '');
|
|
132
|
+
}
|
|
133
|
+
export function plural(count, singular, pluralForm = `${singular}s`) {
|
|
134
|
+
return `${count} ${count === 1 ? singular : pluralForm}`;
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=ui.js.map
|
package/dist/ui.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui.js","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,YAAY,CAAC;AAChC,OAAO,EAAE,kBAAkB,EAAwB,MAAM,qBAAqB,CAAC;AAE/E;;;;;;GAMG;AAEH,IAAI,YAAY,GAAG,IAAI,CAAC;AACxB,IAAI,KAAK,GAAG,KAAK,CAAC;AAElB,MAAM,UAAU,WAAW,CAAC,OAA6C;IACvE,IAAI,OAAO,CAAC,KAAK,KAAK,SAAS;QAAE,YAAY,GAAG,OAAO,CAAC,KAAK,CAAC;IAC9D,IAAI,OAAO,CAAC,KAAK,KAAK,SAAS;QAAE,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;AACzD,CAAC;AAED,SAAS,KAAK,CAAC,EAA6B,EAAE,KAAa;IACzD,OAAO,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AAC1C,CAAC;AAED,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,IAAI,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC;IAClD,GAAG,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC;IAChD,KAAK,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC;IACpD,MAAM,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,M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MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC;QACvE,CAAC,CAAC,CAAC;IACL,CAAC;IAED,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,MAAM,IAAI,GAAG,GAAG;aACb,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CACnB,KAAK,KAAK,GAAG,CAAC,MAAM,GAAG,CAAC;YACtB,CAAC,CAAC,IAAI;YACN,CAAC,CAAC,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CACrE;aACA,IAAI,CAAC,IAAI,CAAC,CAAC;QACd,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;IAC/B,CAAC;AACH,CAAC;AAED,MAAM,YAAY,GAAG,IAAI,MAAM,CAAC,GAAG,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC,aAAa,EAAE,GAAG,CAAC,CAAC;AAE9E,SAAS,SAAS,CAAC,KAAa;IAC9B,OAAO,KAAK,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;AACzC,CAAC;AAED,MAAM,UAAU,MAAM,CAAC,KAAa,EAAE,QAAgB,EAAE,UAAU,GAAG,GAAG,QAAQ,GAAG;IACjF,OAAO,GAAG,KAAK,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC;AAC3D,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type ApplySkillUpdates, type CheckUpdates, type SelectionPrompt, type ToolUpdater, type Logger } from '@senior-skills/core';
|
|
2
|
+
import type { GlobalOptions } from './options.ts';
|
|
3
|
+
export interface NotificationServices {
|
|
4
|
+
readonly check: Pick<CheckUpdates, 'execute' | 'dismiss' | 'remindLater'>;
|
|
5
|
+
readonly apply: Pick<ApplySkillUpdates, 'execute'>;
|
|
6
|
+
readonly tool: ToolUpdater;
|
|
7
|
+
readonly prompt: SelectionPrompt;
|
|
8
|
+
readonly logger: Logger;
|
|
9
|
+
}
|
|
10
|
+
export declare function shouldCheckUpdates(command: string, options: GlobalOptions & {
|
|
11
|
+
offline?: boolean;
|
|
12
|
+
}, terminal: {
|
|
13
|
+
stdin: boolean;
|
|
14
|
+
stdout: boolean;
|
|
15
|
+
stderr: boolean;
|
|
16
|
+
}, env: Readonly<Record<string, string | undefined>>): boolean;
|
|
17
|
+
/** Returns true after replacing the CLI, so the old process stops before running a command. */
|
|
18
|
+
export declare function showUpdateNotifications(services: NotificationServices, command: string, options: GlobalOptions, write?: (message: string) => void): Promise<boolean>;
|
|
19
|
+
//# sourceMappingURL=update-notifications.d.ts.map
|