@a1st/aix 0.7.0 → 0.8.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 +12 -7
- package/bin/aixd.mjs +8 -6
- package/dist/cli.js +3 -2
- package/dist/cli.js.map +1 -1
- package/dist/commands/add/agent.d.ts +1 -0
- package/dist/commands/add/agent.d.ts.map +1 -1
- package/dist/commands/add/agent.js +5 -2
- package/dist/commands/add/agent.js.map +1 -1
- package/dist/commands/add/hook.d.ts +1 -0
- package/dist/commands/add/hook.d.ts.map +1 -1
- package/dist/commands/add/hook.js +5 -2
- package/dist/commands/add/hook.js.map +1 -1
- package/dist/commands/add/index.d.ts.map +1 -1
- package/dist/commands/add/index.js +1 -1
- package/dist/commands/add/index.js.map +1 -1
- package/dist/commands/add/marketplace.d.ts +1 -0
- package/dist/commands/add/marketplace.d.ts.map +1 -1
- package/dist/commands/add/marketplace.js +5 -2
- package/dist/commands/add/marketplace.js.map +1 -1
- package/dist/commands/add/mcp.d.ts +1 -0
- package/dist/commands/add/mcp.d.ts.map +1 -1
- package/dist/commands/add/mcp.js +5 -2
- package/dist/commands/add/mcp.js.map +1 -1
- package/dist/commands/add/plugin.d.ts +1 -0
- package/dist/commands/add/plugin.d.ts.map +1 -1
- package/dist/commands/add/plugin.js +5 -2
- package/dist/commands/add/plugin.js.map +1 -1
- package/dist/commands/add/prompt.d.ts +1 -0
- package/dist/commands/add/prompt.d.ts.map +1 -1
- package/dist/commands/add/prompt.js +5 -2
- package/dist/commands/add/prompt.js.map +1 -1
- package/dist/commands/add/rule.d.ts +1 -0
- package/dist/commands/add/rule.d.ts.map +1 -1
- package/dist/commands/add/rule.js +5 -2
- package/dist/commands/add/rule.js.map +1 -1
- package/dist/commands/add/skill.d.ts +1 -0
- package/dist/commands/add/skill.d.ts.map +1 -1
- package/dist/commands/add/skill.js +5 -2
- package/dist/commands/add/skill.js.map +1 -1
- package/dist/commands/install.d.ts.map +1 -1
- package/dist/commands/install.js +7 -2
- package/dist/commands/install.js.map +1 -1
- package/dist/commands/list/agents.d.ts +3 -4
- package/dist/commands/list/agents.d.ts.map +1 -1
- package/dist/commands/list/agents.js +4 -62
- package/dist/commands/list/agents.js.map +1 -1
- package/dist/commands/list/editors.d.ts +3 -4
- package/dist/commands/list/editors.d.ts.map +1 -1
- package/dist/commands/list/editors.js +4 -39
- package/dist/commands/list/editors.js.map +1 -1
- package/dist/commands/list/hooks.d.ts +3 -4
- package/dist/commands/list/hooks.d.ts.map +1 -1
- package/dist/commands/list/hooks.js +4 -55
- package/dist/commands/list/hooks.js.map +1 -1
- package/dist/commands/list/index.d.ts +8 -3
- package/dist/commands/list/index.d.ts.map +1 -1
- package/dist/commands/list/index.js +252 -79
- package/dist/commands/list/index.js.map +1 -1
- package/dist/commands/list/marketplaces.d.ts +3 -4
- package/dist/commands/list/marketplaces.d.ts.map +1 -1
- package/dist/commands/list/marketplaces.js +4 -56
- package/dist/commands/list/marketplaces.js.map +1 -1
- package/dist/commands/list/mcp.d.ts +3 -4
- package/dist/commands/list/mcp.d.ts.map +1 -1
- package/dist/commands/list/mcp.js +4 -42
- package/dist/commands/list/mcp.js.map +1 -1
- package/dist/commands/list/plugins.d.ts +3 -4
- package/dist/commands/list/plugins.d.ts.map +1 -1
- package/dist/commands/list/plugins.js +4 -57
- package/dist/commands/list/plugins.js.map +1 -1
- package/dist/commands/list/prompts.d.ts +3 -4
- package/dist/commands/list/prompts.d.ts.map +1 -1
- package/dist/commands/list/prompts.js +4 -75
- package/dist/commands/list/prompts.js.map +1 -1
- package/dist/commands/list/rules.d.ts +3 -4
- package/dist/commands/list/rules.d.ts.map +1 -1
- package/dist/commands/list/rules.js +4 -57
- package/dist/commands/list/rules.js.map +1 -1
- package/dist/commands/list/skills.d.ts +3 -4
- package/dist/commands/list/skills.d.ts.map +1 -1
- package/dist/commands/list/skills.js +4 -32
- package/dist/commands/list/skills.js.map +1 -1
- package/dist/commands/remove/agent.d.ts +1 -0
- package/dist/commands/remove/agent.d.ts.map +1 -1
- package/dist/commands/remove/agent.js +10 -17
- package/dist/commands/remove/agent.js.map +1 -1
- package/dist/commands/remove/hook.d.ts +1 -0
- package/dist/commands/remove/hook.d.ts.map +1 -1
- package/dist/commands/remove/hook.js +19 -23
- package/dist/commands/remove/hook.js.map +1 -1
- package/dist/commands/remove/index.d.ts.map +1 -1
- package/dist/commands/remove/index.js +1 -1
- package/dist/commands/remove/index.js.map +1 -1
- package/dist/commands/remove/marketplace.d.ts +1 -0
- package/dist/commands/remove/marketplace.d.ts.map +1 -1
- package/dist/commands/remove/marketplace.js +20 -16
- package/dist/commands/remove/marketplace.js.map +1 -1
- package/dist/commands/remove/mcp.d.ts +1 -0
- package/dist/commands/remove/mcp.d.ts.map +1 -1
- package/dist/commands/remove/mcp.js +18 -18
- package/dist/commands/remove/mcp.js.map +1 -1
- package/dist/commands/remove/plugin.d.ts +1 -0
- package/dist/commands/remove/plugin.d.ts.map +1 -1
- package/dist/commands/remove/plugin.js +20 -16
- package/dist/commands/remove/plugin.js.map +1 -1
- package/dist/commands/remove/prompt.d.ts +1 -0
- package/dist/commands/remove/prompt.d.ts.map +1 -1
- package/dist/commands/remove/prompt.js +10 -17
- package/dist/commands/remove/prompt.js.map +1 -1
- package/dist/commands/remove/rule.d.ts +1 -0
- package/dist/commands/remove/rule.d.ts.map +1 -1
- package/dist/commands/remove/rule.js +10 -17
- package/dist/commands/remove/rule.js.map +1 -1
- package/dist/commands/remove/skill.d.ts +1 -0
- package/dist/commands/remove/skill.d.ts.map +1 -1
- package/dist/commands/remove/skill.js +10 -17
- package/dist/commands/remove/skill.js.map +1 -1
- package/dist/commands/sync.d.ts.map +1 -1
- package/dist/commands/sync.js +5 -0
- package/dist/commands/sync.js.map +1 -1
- package/dist/flags/save.d.ts +4 -0
- package/dist/flags/save.d.ts.map +1 -0
- package/dist/flags/save.js +9 -0
- package/dist/flags/save.js.map +1 -0
- package/dist/flags/scope.d.ts +7 -0
- package/dist/flags/scope.d.ts.map +1 -1
- package/dist/flags/scope.js +6 -1
- package/dist/flags/scope.js.map +1 -1
- package/dist/lib/add-command-helper.d.ts +3 -1
- package/dist/lib/add-command-helper.d.ts.map +1 -1
- package/dist/lib/add-command-helper.js +23 -19
- package/dist/lib/add-command-helper.js.map +1 -1
- package/dist/lib/apply-result-reporter.js +1 -1
- package/dist/lib/apply-result-reporter.js.map +1 -1
- package/dist/lib/delete-helper.d.ts +9 -0
- package/dist/lib/delete-helper.d.ts.map +1 -1
- package/dist/lib/delete-helper.js +30 -0
- package/dist/lib/delete-helper.js.map +1 -1
- package/dist/lib/install-helper.d.ts.map +1 -1
- package/dist/lib/install-helper.js +4 -0
- package/dist/lib/install-helper.js.map +1 -1
- package/dist/lib/resolve-removal-editors.d.ts +4 -7
- package/dist/lib/resolve-removal-editors.d.ts.map +1 -1
- package/dist/lib/resolve-removal-editors.js +16 -16
- package/dist/lib/resolve-removal-editors.js.map +1 -1
- package/oclif.manifest.json +1056 -192
- package/package.json +6 -6
|
@@ -1,57 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
*/
|
|
6
|
-
function describeAction(action) {
|
|
7
|
-
const type = action.type ?? 'command';
|
|
8
|
-
if (type === 'http') {
|
|
9
|
-
return `http ${action.url ?? ''}`.trim();
|
|
10
|
-
}
|
|
11
|
-
if (type === 'mcp_tool') {
|
|
12
|
-
return `mcp ${action.mcp_server ?? ''}/${action.mcp_tool ?? ''}`;
|
|
13
|
-
}
|
|
14
|
-
if (type === 'prompt' || type === 'agent') {
|
|
15
|
-
return `${type} ${action.prompt ?? ''}`.trim();
|
|
16
|
-
}
|
|
17
|
-
return action.command ?? action.bash ?? action.powershell ?? '(none)';
|
|
18
|
-
}
|
|
19
|
-
export default class ListHooks extends BaseCommand {
|
|
20
|
-
static description = 'List configured hooks';
|
|
21
|
-
static examples = [
|
|
22
|
-
'<%= config.bin %> <%= command.id %>',
|
|
23
|
-
'<%= config.bin %> <%= command.id %> --json',
|
|
24
|
-
];
|
|
25
|
-
async run() {
|
|
26
|
-
const loaded = await this.requireConfig();
|
|
27
|
-
const hooks = loaded.config.hooks ?? {};
|
|
28
|
-
if (this.flags.json) {
|
|
29
|
-
this.output.json({ hooks });
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
const entries = Object.entries(hooks);
|
|
33
|
-
if (entries.length === 0) {
|
|
34
|
-
this.output.info('No hooks configured');
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
const rows = entries.flatMap(([event, matchers]) => {
|
|
38
|
-
return (matchers ?? []).map((group) => {
|
|
39
|
-
return {
|
|
40
|
-
event,
|
|
41
|
-
matcher: group.matcher ?? '(all)',
|
|
42
|
-
actions: group.hooks.map(describeAction).join(', '),
|
|
43
|
-
};
|
|
44
|
-
});
|
|
45
|
-
});
|
|
46
|
-
this.output.header('Hooks');
|
|
47
|
-
this.output.table(rows, {
|
|
48
|
-
columns: [
|
|
49
|
-
{ key: 'event', name: 'Event' },
|
|
50
|
-
{ key: 'matcher', name: 'Matcher' },
|
|
51
|
-
{ key: 'actions', name: 'Runs' },
|
|
52
|
-
],
|
|
53
|
-
overflow: 'wrap',
|
|
54
|
-
});
|
|
55
|
-
}
|
|
1
|
+
import List from './index.js';
|
|
2
|
+
export default class ListHooks extends List {
|
|
3
|
+
static description = 'List installed hooks';
|
|
4
|
+
sectionsOverride = ['hooks'];
|
|
56
5
|
}
|
|
57
6
|
//# sourceMappingURL=hooks.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../../src/commands/list/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../../src/commands/list/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,YAAY,CAAC;AAE9B,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,IAAI;IACxC,MAAM,CAAU,WAAW,GAAG,sBAAsB,CAAC;IAElC,gBAAgB,GAAG,CAAC,OAAO,CAAU,CAAC"}
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { BaseCommand } from '../../base-command.js';
|
|
2
|
+
import { type Section } from '../../flags/scope.js';
|
|
2
3
|
export default class List extends BaseCommand<typeof List> {
|
|
3
4
|
static aliases: string[];
|
|
4
5
|
static description: string;
|
|
5
6
|
static examples: string[];
|
|
6
7
|
static flags: {
|
|
7
8
|
all: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
|
-
|
|
9
|
+
target: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
10
|
scope: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
11
|
user: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
12
|
project: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
13
|
only: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
14
|
};
|
|
15
|
+
protected sectionsOverride?: readonly Section[];
|
|
14
16
|
run(): Promise<void>;
|
|
15
17
|
private getConfigSections;
|
|
16
18
|
private getStateSections;
|
|
@@ -33,12 +35,15 @@ export default class List extends BaseCommand<typeof List> {
|
|
|
33
35
|
* (like .agents, .github/skills, .windsurf). The default (no scope flag) also shows
|
|
34
36
|
* user-scope items tracked by aix state.
|
|
35
37
|
*/
|
|
36
|
-
|
|
37
|
-
|
|
38
|
+
protected listProjectConfig(sections: Section[], scopeFilter: 'project' | undefined): Promise<void>;
|
|
39
|
+
protected listProjectConfigJson(sections: Section[], scopeFilter: 'project' | undefined): Promise<void>;
|
|
38
40
|
private hasEditorItems;
|
|
39
41
|
private buildEditorJson;
|
|
40
42
|
private printEditorConfig;
|
|
41
43
|
private getEditorItemRows;
|
|
44
|
+
private formatHookActionTarget;
|
|
45
|
+
private formatHookItemName;
|
|
46
|
+
private flattenHookItems;
|
|
42
47
|
private toEditorItemRow;
|
|
43
48
|
private printEditorRows;
|
|
44
49
|
private isAixManaged;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/list/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/list/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAMJ,KAAK,OAAO,EACd,MAAM,sBAAsB,CAAC;AAyD9B,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,WAAW,CAAC,OAAO,IAAI,CAAC;IACvD,OAAgB,OAAO,WAAU;IAEjC,OAAgB,WAAW,SAAsC;IAEjE,OAAgB,QAAQ,WAUtB;IAEF,OAAgB,KAAK;;;;;;;MAenB;IAEF,SAAS,CAAC,gBAAgB,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;IAE1C,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IAQ1B,OAAO,CAAC,iBAAiB;IAwBzB,OAAO,CAAC,gBAAgB;IA8BxB,OAAO,CAAC,mBAAmB;IAoC3B,OAAO,CAAC,kBAAkB;IA4C1B,OAAO,CAAC,aAAa;IAYrB,OAAO,CAAC,mBAAmB;IAkB3B,OAAO,CAAC,iBAAiB;IAgBzB;;OAEG;YACW,mBAAmB;IAkCjC;;;OAGG;YACW,mBAAmB;IAwFjC;;;;OAIG;cACa,iBAAiB,CAC9B,QAAQ,EAAE,OAAO,EAAE,EACnB,WAAW,EAAE,SAAS,GAAG,SAAS,GAClC,OAAO,CAAC,IAAI,CAAC;cAgDA,qBAAqB,CAClC,QAAQ,EAAE,OAAO,EAAE,EACnB,WAAW,EAAE,SAAS,GAAG,SAAS,GAClC,OAAO,CAAC,IAAI,CAAC;IAuChB,OAAO,CAAC,cAAc;IAatB,OAAO,CAAC,eAAe;IAuLvB,OAAO,CAAC,iBAAiB;IAsBzB,OAAO,CAAC,iBAAiB;IAyKzB,OAAO,CAAC,sBAAsB;IAqD9B,OAAO,CAAC,kBAAkB;IAY1B,OAAO,CAAC,gBAAgB;IAuBxB,OAAO,CAAC,eAAe;IAsBvB,OAAO,CAAC,eAAe;IA8BvB,OAAO,CAAC,YAAY;CAiBtB"}
|
|
@@ -1,15 +1,24 @@
|
|
|
1
1
|
import { Flags } from '@oclif/core';
|
|
2
2
|
import chalk from 'chalk';
|
|
3
3
|
import { BaseCommand } from '../../base-command.js';
|
|
4
|
-
import { onlyFlag, parseSections, includesSection, configScopeFlags,
|
|
5
|
-
import { readState, importFromEditor, getAvailableEditors, getAcceptedEditorNames, isEditorInputName, normalizeEditorName, } from '@a1st/aix-core';
|
|
4
|
+
import { onlyFlag, parseSections, includesSection, configScopeFlags, resolveListScope, } from '../../flags/scope.js';
|
|
5
|
+
import { readState, importFromEditor, getAvailableEditors, getAcceptedEditorNames, isEditorInputName, normalizeEditorName, isDisabledConfigValue, } from '@a1st/aix-core';
|
|
6
6
|
import { resolveScope } from '@a1st/aix-schema';
|
|
7
|
-
const STATE_SECTIONS = [
|
|
7
|
+
const STATE_SECTIONS = [
|
|
8
|
+
'mcp',
|
|
9
|
+
'skills',
|
|
10
|
+
'rules',
|
|
11
|
+
'prompts',
|
|
12
|
+
'agents',
|
|
13
|
+
'hooks',
|
|
14
|
+
'plugins',
|
|
15
|
+
'marketplaces',
|
|
16
|
+
];
|
|
8
17
|
const CANONICAL_EDITORS = getAvailableEditors();
|
|
9
18
|
const VALID_EDITORS = getAcceptedEditorNames();
|
|
10
19
|
export default class List extends BaseCommand {
|
|
11
20
|
static aliases = ['ls'];
|
|
12
|
-
static description = 'List
|
|
21
|
+
static description = 'List native editor configuration';
|
|
13
22
|
static examples = [
|
|
14
23
|
'<%= config.bin %> <%= command.id %>',
|
|
15
24
|
'<%= config.bin %> <%= command.id %> --only skills',
|
|
@@ -18,44 +27,29 @@ export default class List extends BaseCommand {
|
|
|
18
27
|
'<%= config.bin %> <%= command.id %> --scope user',
|
|
19
28
|
'<%= config.bin %> <%= command.id %> --project',
|
|
20
29
|
'<%= config.bin %> <%= command.id %> --all',
|
|
21
|
-
'<%= config.bin %> <%= command.id %> --all --
|
|
22
|
-
'<%= config.bin %> <%= command.id %> --all --
|
|
23
|
-
'<%= config.bin %> <%= command.id %> --all --scope user --only mcp',
|
|
30
|
+
'<%= config.bin %> <%= command.id %> --all --target codex',
|
|
31
|
+
'<%= config.bin %> <%= command.id %> --all --target codex --target zed',
|
|
24
32
|
];
|
|
25
33
|
static flags = {
|
|
26
34
|
...onlyFlag,
|
|
27
35
|
...configScopeFlags,
|
|
28
36
|
all: Flags.boolean({
|
|
29
|
-
description: 'List
|
|
37
|
+
description: 'List user and project config from detected editors',
|
|
30
38
|
default: false,
|
|
39
|
+
exclusive: ['project', 'scope', 'user'],
|
|
31
40
|
}),
|
|
32
|
-
|
|
33
|
-
char: '
|
|
41
|
+
target: Flags.string({
|
|
42
|
+
char: 't',
|
|
43
|
+
aliases: ['editor'],
|
|
44
|
+
charAliases: ['e'],
|
|
34
45
|
description: 'Only show config from a specific editor (repeatable, case-insensitive)',
|
|
35
46
|
multiple: true,
|
|
36
47
|
}),
|
|
37
48
|
};
|
|
49
|
+
sectionsOverride;
|
|
38
50
|
async run() {
|
|
39
|
-
const sections = parseSections(this.flags),
|
|
40
|
-
|
|
41
|
-
// `-u` lists all items present in every editor's global config — never the project's
|
|
42
|
-
// ai.json/state. It always uses discovery: scan actual editor config directories to give
|
|
43
|
-
// a complete, accurate view of what is installed in those editors, including
|
|
44
|
-
// non-aix-managed items and items installed without an ai.json.
|
|
45
|
-
if (isUserScope) {
|
|
46
|
-
await this.listAllEditorConfig(sections, scopeFilter, editorFilter);
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
// Editors explicitly requested via --all or -e also trigger direct config-file discovery.
|
|
50
|
-
if (showAll || editorFilter !== undefined) {
|
|
51
|
-
await this.listAllEditorConfig(sections, scopeFilter, editorFilter);
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
if (this.flags.json) {
|
|
55
|
-
await this.listProjectConfigJson(sections, scopeFilter);
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
await this.listProjectConfig(sections, scopeFilter);
|
|
51
|
+
const sections = this.sectionsOverride ? [...this.sectionsOverride] : parseSections(this.flags), scope = resolveListScope(this.flags), editorFilter = this.resolveEditorFilter();
|
|
52
|
+
await this.listAllEditorConfig(sections, scope === 'all' ? undefined : scope, editorFilter);
|
|
59
53
|
}
|
|
60
54
|
getConfigSections(config, sections) {
|
|
61
55
|
const result = {};
|
|
@@ -164,7 +158,7 @@ export default class List extends BaseCommand {
|
|
|
164
158
|
return STATE_SECTIONS.some((s) => Object.values(state.installed[s]).some((meta) => meta.editors.some((e) => editorSet.has(e))));
|
|
165
159
|
}
|
|
166
160
|
resolveEditorFilter() {
|
|
167
|
-
const editors = this.flags.
|
|
161
|
+
const editors = this.flags.target;
|
|
168
162
|
if (!editors || editors.length === 0) {
|
|
169
163
|
return undefined;
|
|
170
164
|
}
|
|
@@ -194,17 +188,18 @@ export default class List extends BaseCommand {
|
|
|
194
188
|
* Scan editors' actual config directories and collect any discovered items.
|
|
195
189
|
*/
|
|
196
190
|
async collectEditorConfig(editors, scope) {
|
|
197
|
-
const projectRoot = process.cwd(), projectState = await readState('project', projectRoot), userState = await readState('user'),
|
|
198
|
-
for (const editor of editors) {
|
|
191
|
+
const projectRoot = process.cwd(), projectState = await readState('project', projectRoot), userState = await readState('user'), imported = await Promise.all(editors.map(async (editor) => {
|
|
199
192
|
try {
|
|
200
|
-
// eslint-disable-next-line no-await-in-loop -- Sequential for consistency
|
|
201
193
|
const result = await importFromEditor(editor, { projectRoot, scope });
|
|
202
|
-
|
|
203
|
-
results.push({ editor, result });
|
|
204
|
-
}
|
|
194
|
+
return { editor, result };
|
|
205
195
|
}
|
|
206
196
|
catch {
|
|
207
|
-
|
|
197
|
+
return undefined;
|
|
198
|
+
}
|
|
199
|
+
})), results = [];
|
|
200
|
+
for (const entry of imported) {
|
|
201
|
+
if (entry && (this.hasEditorItems(entry.result) || entry.result.warnings.length > 0)) {
|
|
202
|
+
results.push(entry);
|
|
208
203
|
}
|
|
209
204
|
}
|
|
210
205
|
return { results, projectState, userState };
|
|
@@ -214,22 +209,64 @@ export default class List extends BaseCommand {
|
|
|
214
209
|
* Scans actual editor config directories to discover what's installed.
|
|
215
210
|
*/
|
|
216
211
|
async listAllEditorConfig(sections, scopeFilter, editorFilter) {
|
|
217
|
-
const editors = editorFilter ?? CANONICAL_EDITORS, scope = scopeFilter ?? 'all', { results, projectState, userState } = await this.collectEditorConfig(editors, scope), context = { sections, scopeFilter, projectState, userState };
|
|
218
|
-
if (
|
|
219
|
-
|
|
212
|
+
const editors = editorFilter ?? CANONICAL_EDITORS, scope = scopeFilter ?? 'all', { results, projectState, userState } = await this.collectEditorConfig(editors, scope), context = { sections, scopeFilter, projectState, userState }, isEditorsOnly = sections.length === 1 && sections[0] === 'editors';
|
|
213
|
+
if (isEditorsOnly) {
|
|
214
|
+
const detectedEditors = results.map(({ editor }) => editor);
|
|
215
|
+
if (this.flags.json) {
|
|
216
|
+
this.output.json({
|
|
217
|
+
version: 1,
|
|
218
|
+
scope: scopeFilter ?? 'all',
|
|
219
|
+
targets: editors,
|
|
220
|
+
editors: detectedEditors,
|
|
221
|
+
items: [],
|
|
222
|
+
warnings: results.flatMap(({ editor, result }) => {
|
|
223
|
+
return result.warnings.map((warning) => ({ editor, warning }));
|
|
224
|
+
}),
|
|
225
|
+
});
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
if (detectedEditors.length === 0) {
|
|
229
|
+
this.output.info('No editors with AI configuration found.');
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
for (const editor of detectedEditors) {
|
|
233
|
+
this.output.log(editor);
|
|
234
|
+
}
|
|
220
235
|
return;
|
|
221
236
|
}
|
|
222
237
|
if (this.flags.json) {
|
|
223
|
-
const
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
238
|
+
const items = results.flatMap(({ editor, result }) => {
|
|
239
|
+
return this.getEditorItemRows(editor, result, context).map((row) => ({
|
|
240
|
+
editor,
|
|
241
|
+
type: row.type,
|
|
242
|
+
name: row.name,
|
|
243
|
+
source: row.source,
|
|
244
|
+
status: row.status,
|
|
245
|
+
scope: row.scope,
|
|
246
|
+
path: row.path,
|
|
247
|
+
}));
|
|
248
|
+
});
|
|
249
|
+
this.output.json({
|
|
250
|
+
version: 1,
|
|
251
|
+
scope: scopeFilter ?? 'all',
|
|
252
|
+
targets: editors,
|
|
253
|
+
items,
|
|
254
|
+
warnings: results.flatMap(({ editor, result }) => {
|
|
255
|
+
return result.warnings.map((warning) => ({ editor, warning }));
|
|
256
|
+
}),
|
|
257
|
+
});
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
if (results.length === 0) {
|
|
261
|
+
this.output.info('No AI configuration found in any editor.');
|
|
228
262
|
return;
|
|
229
263
|
}
|
|
230
264
|
let printed = 0;
|
|
231
265
|
for (const { editor, result } of results) {
|
|
232
266
|
const didPrint = this.printEditorConfig(editor, result, context, printed > 0);
|
|
267
|
+
for (const warning of result.warnings) {
|
|
268
|
+
this.output.warn(`${editor}: ${warning}`);
|
|
269
|
+
}
|
|
233
270
|
if (didPrint) {
|
|
234
271
|
printed++;
|
|
235
272
|
}
|
|
@@ -289,7 +326,7 @@ export default class List extends BaseCommand {
|
|
|
289
326
|
}
|
|
290
327
|
const editors = {};
|
|
291
328
|
for (const { editor, result: editorResult } of results) {
|
|
292
|
-
editors[editor] = this.buildEditorJson(editorResult, context);
|
|
329
|
+
editors[editor] = this.buildEditorJson(editor, editorResult, context);
|
|
293
330
|
}
|
|
294
331
|
if (Object.keys(editors).length > 0) {
|
|
295
332
|
result.editors = editors;
|
|
@@ -308,15 +345,17 @@ export default class List extends BaseCommand {
|
|
|
308
345
|
Object.keys(result.skills).length > 0 ||
|
|
309
346
|
Object.keys(result.prompts).length > 0 ||
|
|
310
347
|
Object.keys(result.agents).length > 0 ||
|
|
311
|
-
Object.keys(result.hooks).length > 0
|
|
348
|
+
Object.keys(result.hooks).length > 0 ||
|
|
349
|
+
Object.keys(result.plugins).length > 0 ||
|
|
350
|
+
Object.keys(result.marketplaces).length > 0);
|
|
312
351
|
}
|
|
313
|
-
buildEditorJson(result, context) {
|
|
352
|
+
buildEditorJson(editor, result, context) {
|
|
314
353
|
const out = {};
|
|
315
354
|
const { sections, scopeFilter, projectState, userState } = context;
|
|
316
355
|
if (includesSection(sections, 'mcp') && Object.keys(result.mcp).length > 0) {
|
|
317
356
|
const items = {};
|
|
318
357
|
for (const [name] of Object.entries(result.mcp)) {
|
|
319
|
-
const managed = this.isAixManaged(name, 'mcp', projectState, userState);
|
|
358
|
+
const managed = this.isAixManaged({ editor, name, section: 'mcp', projectState, userState });
|
|
320
359
|
const scope = managed?.scope ?? result.scopes.mcp[name];
|
|
321
360
|
if (scopeFilter && scope !== scopeFilter) {
|
|
322
361
|
continue;
|
|
@@ -334,7 +373,7 @@ export default class List extends BaseCommand {
|
|
|
334
373
|
if (includesSection(sections, 'rules') && result.rules.length > 0) {
|
|
335
374
|
const items = {};
|
|
336
375
|
for (const rule of result.rules) {
|
|
337
|
-
const managed = this.isAixManaged(rule.name, 'rules', projectState, userState);
|
|
376
|
+
const managed = this.isAixManaged({ editor, name: rule.name, section: 'rules', projectState, userState });
|
|
338
377
|
const scope = rule.scope ?? result.scopes.rules[rule.name] ?? managed?.scope;
|
|
339
378
|
if (scopeFilter && scope !== scopeFilter) {
|
|
340
379
|
continue;
|
|
@@ -352,7 +391,7 @@ export default class List extends BaseCommand {
|
|
|
352
391
|
if (includesSection(sections, 'skills') && Object.keys(result.skills).length > 0) {
|
|
353
392
|
const items = {};
|
|
354
393
|
for (const [name] of Object.entries(result.skills)) {
|
|
355
|
-
const managed = this.isAixManaged(name, 'skills', projectState, userState);
|
|
394
|
+
const managed = this.isAixManaged({ editor, name, section: 'skills', projectState, userState });
|
|
356
395
|
const scope = managed?.scope ?? result.scopes.skills[name];
|
|
357
396
|
if (scopeFilter && scope !== scopeFilter) {
|
|
358
397
|
continue;
|
|
@@ -370,7 +409,7 @@ export default class List extends BaseCommand {
|
|
|
370
409
|
if (includesSection(sections, 'prompts') && Object.keys(result.prompts).length > 0) {
|
|
371
410
|
const items = {};
|
|
372
411
|
for (const [name] of Object.entries(result.prompts)) {
|
|
373
|
-
const managed = this.isAixManaged(name, 'prompts', projectState, userState);
|
|
412
|
+
const managed = this.isAixManaged({ editor, name, section: 'prompts', projectState, userState });
|
|
374
413
|
const scope = managed?.scope ?? result.scopes.prompts[name];
|
|
375
414
|
if (scopeFilter && scope !== scopeFilter) {
|
|
376
415
|
continue;
|
|
@@ -388,7 +427,7 @@ export default class List extends BaseCommand {
|
|
|
388
427
|
if (includesSection(sections, 'agents') && Object.keys(result.agents).length > 0) {
|
|
389
428
|
const items = {};
|
|
390
429
|
for (const [name] of Object.entries(result.agents)) {
|
|
391
|
-
const managed = this.isAixManaged(name, 'agents', projectState, userState);
|
|
430
|
+
const managed = this.isAixManaged({ editor, name, section: 'agents', projectState, userState });
|
|
392
431
|
const scope = managed?.scope ?? result.scopes.agents[name];
|
|
393
432
|
if (scopeFilter && scope !== scopeFilter) {
|
|
394
433
|
continue;
|
|
@@ -405,26 +444,61 @@ export default class List extends BaseCommand {
|
|
|
405
444
|
}
|
|
406
445
|
if (includesSection(sections, 'hooks') && Object.keys(result.hooks).length > 0) {
|
|
407
446
|
const items = {};
|
|
408
|
-
for (const event of Object.
|
|
409
|
-
const managed = this.isAixManaged(event, 'hooks', projectState, userState);
|
|
410
|
-
const scope = managed?.scope ?? result.scopes.hooks[event];
|
|
447
|
+
for (const [event, matchers] of Object.entries(result.hooks)) {
|
|
448
|
+
const managed = this.isAixManaged({ editor, name: event, section: 'hooks', projectState, userState }), scope = managed?.scope ?? result.scopes.hooks[event];
|
|
411
449
|
if (scopeFilter && scope !== scopeFilter) {
|
|
412
450
|
continue;
|
|
413
451
|
}
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
452
|
+
const hookItems = this.flattenHookItems(event, matchers);
|
|
453
|
+
for (const hookItem of hookItems) {
|
|
454
|
+
items[hookItem.name] = {
|
|
455
|
+
source: managed ? 'aix' : 'external',
|
|
456
|
+
scope,
|
|
457
|
+
path: result.paths.hooks[event],
|
|
458
|
+
event,
|
|
459
|
+
};
|
|
460
|
+
}
|
|
419
461
|
}
|
|
420
462
|
if (Object.keys(items).length > 0) {
|
|
421
463
|
out.hooks = items;
|
|
422
464
|
}
|
|
423
465
|
}
|
|
466
|
+
if (includesSection(sections, 'plugins') && Object.keys(result.plugins).length > 0) {
|
|
467
|
+
const items = {};
|
|
468
|
+
for (const name of Object.keys(result.plugins)) {
|
|
469
|
+
const managed = this.isAixManaged({ editor, name, section: 'plugins', projectState, userState }), scope = managed?.scope ?? result.scopes.plugins[name];
|
|
470
|
+
if (!scopeFilter || scope === scopeFilter) {
|
|
471
|
+
items[name] = {
|
|
472
|
+
source: managed ? 'aix' : 'external',
|
|
473
|
+
scope,
|
|
474
|
+
path: result.paths.plugins[name],
|
|
475
|
+
};
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
if (Object.keys(items).length > 0) {
|
|
479
|
+
out.plugins = items;
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
if (includesSection(sections, 'marketplaces') && Object.keys(result.marketplaces).length > 0) {
|
|
483
|
+
const items = {};
|
|
484
|
+
for (const name of Object.keys(result.marketplaces)) {
|
|
485
|
+
const managed = this.isAixManaged({ editor, name, section: 'marketplaces', projectState, userState }), scope = managed?.scope ?? result.scopes.marketplaces[name];
|
|
486
|
+
if (!scopeFilter || scope === scopeFilter) {
|
|
487
|
+
items[name] = {
|
|
488
|
+
source: managed ? 'aix' : 'external',
|
|
489
|
+
scope,
|
|
490
|
+
path: result.paths.marketplaces[name],
|
|
491
|
+
};
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
if (Object.keys(items).length > 0) {
|
|
495
|
+
out.marketplaces = items;
|
|
496
|
+
}
|
|
497
|
+
}
|
|
424
498
|
return out;
|
|
425
499
|
}
|
|
426
500
|
printEditorConfig(editor, result, context, addLeadingBlankLine) {
|
|
427
|
-
const rows = this.getEditorItemRows(result, context);
|
|
501
|
+
const rows = this.getEditorItemRows(editor, result, context);
|
|
428
502
|
if (rows.length === 0) {
|
|
429
503
|
return false;
|
|
430
504
|
}
|
|
@@ -435,11 +509,12 @@ export default class List extends BaseCommand {
|
|
|
435
509
|
this.printEditorRows(rows);
|
|
436
510
|
return true;
|
|
437
511
|
}
|
|
438
|
-
getEditorItemRows(result, context) {
|
|
512
|
+
getEditorItemRows(editor, result, context) {
|
|
439
513
|
const rows = [];
|
|
440
514
|
const { sections } = context;
|
|
441
515
|
if (includesSection(sections, 'mcp')) {
|
|
442
516
|
rows.push(...Object.keys(result.mcp).flatMap((name) => this.toEditorItemRow({
|
|
517
|
+
editor,
|
|
443
518
|
type: 'mcp',
|
|
444
519
|
name,
|
|
445
520
|
section: 'mcp',
|
|
@@ -449,6 +524,7 @@ export default class List extends BaseCommand {
|
|
|
449
524
|
}
|
|
450
525
|
if (includesSection(sections, 'rules')) {
|
|
451
526
|
rows.push(...result.rules.flatMap((rule) => this.toEditorItemRow({
|
|
527
|
+
editor,
|
|
452
528
|
type: 'rule',
|
|
453
529
|
name: rule.name,
|
|
454
530
|
section: 'rules',
|
|
@@ -458,6 +534,7 @@ export default class List extends BaseCommand {
|
|
|
458
534
|
}
|
|
459
535
|
if (includesSection(sections, 'skills')) {
|
|
460
536
|
rows.push(...Object.keys(result.skills).flatMap((name) => this.toEditorItemRow({
|
|
537
|
+
editor,
|
|
461
538
|
type: 'skill',
|
|
462
539
|
name,
|
|
463
540
|
section: 'skills',
|
|
@@ -467,6 +544,7 @@ export default class List extends BaseCommand {
|
|
|
467
544
|
}
|
|
468
545
|
if (includesSection(sections, 'prompts')) {
|
|
469
546
|
rows.push(...Object.keys(result.prompts).flatMap((name) => this.toEditorItemRow({
|
|
547
|
+
editor,
|
|
470
548
|
type: 'prompt',
|
|
471
549
|
name,
|
|
472
550
|
section: 'prompts',
|
|
@@ -476,6 +554,7 @@ export default class List extends BaseCommand {
|
|
|
476
554
|
}
|
|
477
555
|
if (includesSection(sections, 'agents')) {
|
|
478
556
|
rows.push(...Object.keys(result.agents).flatMap((name) => this.toEditorItemRow({
|
|
557
|
+
editor,
|
|
479
558
|
type: 'agent',
|
|
480
559
|
name,
|
|
481
560
|
section: 'agents',
|
|
@@ -484,19 +563,111 @@ export default class List extends BaseCommand {
|
|
|
484
563
|
}, context)));
|
|
485
564
|
}
|
|
486
565
|
if (includesSection(sections, 'hooks')) {
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
566
|
+
for (const [event, matchers] of Object.entries(result.hooks)) {
|
|
567
|
+
const hookItems = this.flattenHookItems(event, matchers);
|
|
568
|
+
for (const hookItem of hookItems) {
|
|
569
|
+
rows.push(...this.toEditorItemRow({
|
|
570
|
+
editor,
|
|
571
|
+
type: 'hook',
|
|
572
|
+
name: hookItem.name,
|
|
573
|
+
section: 'hooks',
|
|
574
|
+
path: result.paths.hooks[event],
|
|
575
|
+
detectedScope: result.scopes.hooks[event],
|
|
576
|
+
managedKey: event,
|
|
577
|
+
}, context));
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
if (includesSection(sections, 'plugins')) {
|
|
582
|
+
rows.push(...Object.keys(result.plugins).flatMap((name) => this.toEditorItemRow({
|
|
583
|
+
editor,
|
|
584
|
+
type: 'plugin',
|
|
585
|
+
name,
|
|
586
|
+
section: 'plugins',
|
|
587
|
+
path: result.paths.plugins[name],
|
|
588
|
+
detectedScope: result.scopes.plugins[name],
|
|
589
|
+
status: isDisabledConfigValue(result.plugins[name]) ? 'disabled' : 'enabled',
|
|
493
590
|
}, context)));
|
|
494
591
|
}
|
|
592
|
+
if (includesSection(sections, 'marketplaces')) {
|
|
593
|
+
rows.push(...Object.keys(result.marketplaces).flatMap((name) => this.toEditorItemRow({
|
|
594
|
+
editor,
|
|
595
|
+
type: 'marketplace',
|
|
596
|
+
name,
|
|
597
|
+
section: 'marketplaces',
|
|
598
|
+
path: result.paths.marketplaces[name],
|
|
599
|
+
detectedScope: result.scopes.marketplaces[name],
|
|
600
|
+
status: isDisabledConfigValue(result.marketplaces[name]) ? 'disabled' : 'enabled',
|
|
601
|
+
}, context)));
|
|
602
|
+
}
|
|
603
|
+
rows.sort((left, right) => {
|
|
604
|
+
const leftKey = `${left.type}\0${left.scope ?? ''}\0${left.name}\0${left.path ?? ''}`, rightKey = `${right.type}\0${right.scope ?? ''}\0${right.name}\0${right.path ?? ''}`;
|
|
605
|
+
return leftKey.localeCompare(rightKey);
|
|
606
|
+
});
|
|
495
607
|
return rows;
|
|
496
608
|
}
|
|
609
|
+
formatHookActionTarget(action) {
|
|
610
|
+
const rawCommand = action.command ?? action.bash ?? action.powershell, command = rawCommand?.replace(/\s+/g, ' ').trim();
|
|
611
|
+
if (action.name && command) {
|
|
612
|
+
return `${action.name}: ${command}`;
|
|
613
|
+
}
|
|
614
|
+
if (action.name && action.url) {
|
|
615
|
+
return `${action.name}: ${action.url}`;
|
|
616
|
+
}
|
|
617
|
+
if (action.name && action.prompt) {
|
|
618
|
+
const prompt = action.prompt.replace(/\s+/g, ' ').trim(), displayPrompt = prompt.length > 60 ? `${prompt.slice(0, 57)}...` : prompt;
|
|
619
|
+
return `${action.name}: prompt "${displayPrompt}"`;
|
|
620
|
+
}
|
|
621
|
+
if (action.name && action.mcp_tool) {
|
|
622
|
+
const server = action.mcp_server ? `${action.mcp_server}/` : '';
|
|
623
|
+
return `${action.name}: mcp ${server}${action.mcp_tool}`;
|
|
624
|
+
}
|
|
625
|
+
if (action.name) {
|
|
626
|
+
return action.name;
|
|
627
|
+
}
|
|
628
|
+
if (command) {
|
|
629
|
+
return command;
|
|
630
|
+
}
|
|
631
|
+
if (action.url) {
|
|
632
|
+
return `http ${action.url}`;
|
|
633
|
+
}
|
|
634
|
+
if (action.prompt) {
|
|
635
|
+
const prompt = action.prompt.replace(/\s+/g, ' ').trim(), displayPrompt = prompt.length > 60 ? `${prompt.slice(0, 57)}...` : prompt;
|
|
636
|
+
return `prompt "${displayPrompt}"`;
|
|
637
|
+
}
|
|
638
|
+
if (action.mcp_tool) {
|
|
639
|
+
const server = action.mcp_server ? `${action.mcp_server}/` : '';
|
|
640
|
+
return `mcp ${server}${action.mcp_tool}`;
|
|
641
|
+
}
|
|
642
|
+
return action.description ?? 'hook';
|
|
643
|
+
}
|
|
644
|
+
formatHookItemName(event, matcher, action) {
|
|
645
|
+
const matcherPart = matcher ? ` [${matcher}]` : '';
|
|
646
|
+
if (!action) {
|
|
647
|
+
return `${event}${matcherPart}`;
|
|
648
|
+
}
|
|
649
|
+
const target = this.formatHookActionTarget(action);
|
|
650
|
+
return `${event}${matcherPart} -> ${target}`;
|
|
651
|
+
}
|
|
652
|
+
flattenHookItems(event, matchers) {
|
|
653
|
+
if (!matchers || matchers.length === 0) {
|
|
654
|
+
return [{ name: event }];
|
|
655
|
+
}
|
|
656
|
+
const items = [];
|
|
657
|
+
for (const matcher of matchers) {
|
|
658
|
+
const hooks = matcher.hooks ?? [];
|
|
659
|
+
if (hooks.length === 0) {
|
|
660
|
+
items.push({ name: this.formatHookItemName(event, matcher.matcher) });
|
|
661
|
+
continue;
|
|
662
|
+
}
|
|
663
|
+
for (const action of hooks) {
|
|
664
|
+
items.push({ name: this.formatHookItemName(event, matcher.matcher, action) });
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
return items.length > 0 ? items : [{ name: event }];
|
|
668
|
+
}
|
|
497
669
|
toEditorItemRow(input, context) {
|
|
498
|
-
const { type, name, section, path, detectedScope } = input, { scopeFilter, projectState, userState } = context;
|
|
499
|
-
const managed = this.isAixManaged(name, section, projectState, userState), scope = detectedScope ?? managed?.scope;
|
|
670
|
+
const { editor, type, name, section, path, detectedScope, status = 'enabled', managedKey } = input, { scopeFilter, projectState, userState } = context, managed = this.isAixManaged({ editor, name: managedKey ?? name, section, projectState, userState }), scope = detectedScope ?? managed?.scope;
|
|
500
671
|
if (scopeFilter && scope !== scopeFilter) {
|
|
501
672
|
return [];
|
|
502
673
|
}
|
|
@@ -505,26 +676,28 @@ export default class List extends BaseCommand {
|
|
|
505
676
|
type,
|
|
506
677
|
name,
|
|
507
678
|
source: managed ? 'aix' : 'external',
|
|
679
|
+
status,
|
|
508
680
|
scope,
|
|
509
681
|
path,
|
|
510
682
|
},
|
|
511
683
|
];
|
|
512
684
|
}
|
|
513
685
|
printEditorRows(rows) {
|
|
514
|
-
const typeWidth = Math.max('type'.length, ...rows.map((row) => row.type.length)), scopeWidth = Math.max('scope'.length, ...rows.map((row) => (row.scope ?? 'unknown').length)), sourceWidth = Math.max('source'.length, ...rows.map((row) => row.source.length)), nameWidth = Math.max('name'.length, ...rows.map((row) => row.name.length));
|
|
515
|
-
const header = ` ${'type'.padEnd(typeWidth)} ${'scope'.padEnd(scopeWidth)} ${'source'.padEnd(sourceWidth)} ${'name'.padEnd(nameWidth)} path`;
|
|
686
|
+
const typeWidth = Math.max('type'.length, ...rows.map((row) => row.type.length)), scopeWidth = Math.max('scope'.length, ...rows.map((row) => (row.scope ?? 'unknown').length)), sourceWidth = Math.max('source'.length, ...rows.map((row) => row.source.length)), statusWidth = Math.max('status'.length, ...rows.map((row) => row.status.length)), nameWidth = Math.max('name'.length, ...rows.map((row) => row.name.length));
|
|
687
|
+
const header = ` ${'type'.padEnd(typeWidth)} ${'scope'.padEnd(scopeWidth)} ${'source'.padEnd(sourceWidth)} ${'status'.padEnd(statusWidth)} ${'name'.padEnd(nameWidth)} path`;
|
|
516
688
|
this.output.log(chalk.dim(header));
|
|
517
689
|
this.output.log(chalk.dim(` ${'-'.repeat(header.length - 2)}`));
|
|
518
690
|
for (const row of rows) {
|
|
519
|
-
const type = row.type.padEnd(typeWidth), scope = (row.scope ?? 'unknown').padEnd(scopeWidth), source = row.source.padEnd(sourceWidth), name = row.name.padEnd(nameWidth), sourceColor = row.source === 'aix' ? chalk.green : chalk.dim;
|
|
520
|
-
this.output.log(` ${chalk.magenta(type)} ${chalk.dim(scope)} ${sourceColor(source)} ${this.output.cyan(name)} ${chalk.dim(row.path ?? '')}`);
|
|
691
|
+
const type = row.type.padEnd(typeWidth), scope = (row.scope ?? 'unknown').padEnd(scopeWidth), source = row.source.padEnd(sourceWidth), status = row.status.padEnd(statusWidth), name = row.name.padEnd(nameWidth), sourceColor = row.source === 'aix' ? chalk.green : chalk.blue, statusColor = row.status === 'disabled' ? chalk.yellow : chalk.dim;
|
|
692
|
+
this.output.log(` ${chalk.magenta(type)} ${chalk.dim(scope)} ${sourceColor(source)} ${statusColor(status)} ${this.output.cyan(name)} ${chalk.dim(row.path ?? '')}`);
|
|
521
693
|
}
|
|
522
694
|
}
|
|
523
|
-
isAixManaged(
|
|
524
|
-
|
|
695
|
+
isAixManaged(options) {
|
|
696
|
+
const { editor, name, section, projectState, userState } = options;
|
|
697
|
+
if (projectState.installed[section][name]?.editors.includes(editor)) {
|
|
525
698
|
return { scope: 'project' };
|
|
526
699
|
}
|
|
527
|
-
if (userState.installed[section][name]) {
|
|
700
|
+
if (userState.installed[section][name]?.editors.includes(editor)) {
|
|
528
701
|
return { scope: 'user' };
|
|
529
702
|
}
|
|
530
703
|
return undefined;
|