@untitled-devs/wasla 0.1.1 → 0.1.3
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 +20 -15
- package/dist/adapters/base.d.ts +0 -1
- package/dist/adapters/base.js +0 -1
- package/dist/adapters/claude.d.ts +0 -1
- package/dist/adapters/claude.js +0 -1
- package/dist/adapters/cursor.d.ts +0 -1
- package/dist/adapters/cursor.js +0 -1
- package/dist/adapters/factory.d.ts +0 -1
- package/dist/adapters/factory.js +0 -1
- package/dist/adapters/gemini.d.ts +0 -1
- package/dist/adapters/gemini.js +0 -1
- package/dist/adapters/github-copilot-cli.d.ts +0 -1
- package/dist/adapters/github-copilot-cli.js +0 -1
- package/dist/adapters/github-copilot.d.ts +0 -1
- package/dist/adapters/github-copilot.js +0 -1
- package/dist/adapters/openclaw.d.ts +0 -1
- package/dist/adapters/openclaw.js +0 -1
- package/dist/adapters/opencode.d.ts +0 -1
- package/dist/adapters/opencode.js +0 -1
- package/dist/cli/commands/config.d.ts +1 -2
- package/dist/cli/commands/config.js +38 -42
- package/dist/cli/commands/install.d.ts +0 -1
- package/dist/cli/commands/install.js +10 -6
- package/dist/cli/commands/register.d.ts +0 -1
- package/dist/cli/commands/register.js +4 -3
- package/dist/cli/commands/status.d.ts +1 -6
- package/dist/cli/commands/status.js +15 -13
- package/dist/cli/commands/sync-to.d.ts +0 -2
- package/dist/cli/commands/sync-to.js +3 -3
- package/dist/cli/commands/sync.d.ts +2 -3
- package/dist/cli/commands/sync.js +33 -11
- package/dist/cli/commands/visualizer.d.ts +0 -2
- package/dist/cli/commands/visualizer.js +2 -2
- package/dist/cli/commands/watch.d.ts +1 -6
- package/dist/cli/commands/watch.js +3 -3
- package/dist/cli/index.d.ts +0 -1
- package/dist/cli/index.js +11 -14
- package/dist/core/registry.d.ts +0 -1
- package/dist/core/registry.js +0 -1
- package/dist/core/scanner.d.ts +0 -1
- package/dist/core/scanner.js +8 -4
- package/dist/core/types.d.ts +0 -2
- package/dist/core/types.js +0 -1
- package/dist/core/visualizer-types.d.ts +0 -1
- package/dist/core/visualizer-types.js +0 -1
- package/dist/syncer/index.d.ts +0 -1
- package/dist/syncer/index.js +0 -1
- package/dist/utils/cli-output.d.ts +4 -1
- package/dist/utils/cli-output.js +60 -7
- package/dist/utils/config.d.ts +6 -0
- package/dist/utils/config.js +34 -0
- package/dist/utils/fs.d.ts +0 -1
- package/dist/utils/fs.js +13 -8
- package/dist/utils/paths.d.ts +0 -1
- package/dist/utils/paths.js +0 -1
- package/package.json +50 -46
- package/src/visualizer/dist/assets/{index-BRmeXR7T.js → index-C6aJB2Yl.js} +1 -1
- package/src/visualizer/dist/index.html +1 -1
- package/dist/adapters/base.d.ts.map +0 -1
- package/dist/adapters/base.js.map +0 -1
- package/dist/adapters/claude.d.ts.map +0 -1
- package/dist/adapters/claude.js.map +0 -1
- package/dist/adapters/cursor.d.ts.map +0 -1
- package/dist/adapters/cursor.js.map +0 -1
- package/dist/adapters/factory.d.ts.map +0 -1
- package/dist/adapters/factory.js.map +0 -1
- package/dist/adapters/gemini.d.ts.map +0 -1
- package/dist/adapters/gemini.js.map +0 -1
- package/dist/adapters/github-copilot-cli.d.ts.map +0 -1
- package/dist/adapters/github-copilot-cli.js.map +0 -1
- package/dist/adapters/github-copilot.d.ts.map +0 -1
- package/dist/adapters/github-copilot.js.map +0 -1
- package/dist/adapters/openclaw.d.ts.map +0 -1
- package/dist/adapters/openclaw.js.map +0 -1
- package/dist/adapters/opencode.d.ts.map +0 -1
- package/dist/adapters/opencode.js.map +0 -1
- package/dist/cli/commands/config.d.ts.map +0 -1
- package/dist/cli/commands/config.js.map +0 -1
- package/dist/cli/commands/install.d.ts.map +0 -1
- package/dist/cli/commands/install.js.map +0 -1
- package/dist/cli/commands/register.d.ts.map +0 -1
- package/dist/cli/commands/register.js.map +0 -1
- package/dist/cli/commands/status.d.ts.map +0 -1
- package/dist/cli/commands/status.js.map +0 -1
- package/dist/cli/commands/sync-to.d.ts.map +0 -1
- package/dist/cli/commands/sync-to.js.map +0 -1
- package/dist/cli/commands/sync.d.ts.map +0 -1
- package/dist/cli/commands/sync.js.map +0 -1
- package/dist/cli/commands/visualizer.d.ts.map +0 -1
- package/dist/cli/commands/visualizer.js.map +0 -1
- package/dist/cli/commands/watch.d.ts.map +0 -1
- package/dist/cli/commands/watch.js.map +0 -1
- package/dist/cli/index.d.ts.map +0 -1
- package/dist/cli/index.js.map +0 -1
- package/dist/core/registry.d.ts.map +0 -1
- package/dist/core/registry.js.map +0 -1
- package/dist/core/scanner.d.ts.map +0 -1
- package/dist/core/scanner.js.map +0 -1
- package/dist/core/types.d.ts.map +0 -1
- package/dist/core/types.js.map +0 -1
- package/dist/core/visualizer-types.d.ts.map +0 -1
- package/dist/core/visualizer-types.js.map +0 -1
- package/dist/syncer/index.d.ts.map +0 -1
- package/dist/syncer/index.js.map +0 -1
- package/dist/utils/cli-output.d.ts.map +0 -1
- package/dist/utils/cli-output.js.map +0 -1
- package/dist/utils/fs.d.ts.map +0 -1
- package/dist/utils/fs.js.map +0 -1
- package/dist/utils/paths.d.ts.map +0 -1
- package/dist/utils/paths.js.map +0 -1
package/README.md
CHANGED
|
@@ -121,15 +121,18 @@ The same pattern applies across every asset type:
|
|
|
121
121
|
WaslaGenie is cross-platform via `npx` — no global install required:
|
|
122
122
|
|
|
123
123
|
```bash
|
|
124
|
+
npx @untitled-devs/wasla config --scope workspace
|
|
124
125
|
npx @untitled-devs/wasla sync
|
|
125
126
|
```
|
|
126
127
|
|
|
127
|
-
|
|
128
|
+
Choose `workspace` or `user` once before running operational commands. This runs the CLI directly.
|
|
129
|
+
It does not register helper skills inside Claude, Gemini, or other tools.
|
|
128
130
|
|
|
129
131
|
**Or install globally:**
|
|
130
132
|
|
|
131
133
|
```bash
|
|
132
134
|
npm install -g @untitled-devs/wasla
|
|
135
|
+
waslagenie config --scope workspace
|
|
133
136
|
waslagenie sync
|
|
134
137
|
```
|
|
135
138
|
|
|
@@ -178,10 +181,10 @@ npx @untitled-devs/wasla visualizer
|
|
|
178
181
|
### You (developing this repo)
|
|
179
182
|
|
|
180
183
|
```bash
|
|
181
|
-
# Build + run sync
|
|
184
|
+
# Build + run sync using your configured scope
|
|
182
185
|
npm run sync
|
|
183
186
|
|
|
184
|
-
# Build + run watch
|
|
187
|
+
# Build + run watch using your configured scope
|
|
185
188
|
npm run watch
|
|
186
189
|
```
|
|
187
190
|
|
|
@@ -257,14 +260,18 @@ No restart. No manual trigger. The moment something changes — it's everywhere.
|
|
|
257
260
|
|
|
258
261
|
### Scope — workspace or user level
|
|
259
262
|
|
|
263
|
+
Choose the active scope before running sync, watch, status, or the visualizer:
|
|
264
|
+
|
|
260
265
|
```bash
|
|
261
|
-
#
|
|
262
|
-
waslagenie
|
|
266
|
+
# Use the current project workspace registry
|
|
267
|
+
waslagenie config --scope workspace
|
|
263
268
|
|
|
264
|
-
#
|
|
265
|
-
waslagenie
|
|
269
|
+
# Use the user-level registry across projects
|
|
270
|
+
waslagenie config --scope user
|
|
266
271
|
```
|
|
267
272
|
|
|
273
|
+
All other commands use the saved scope automatically. They do not accept `--scope`.
|
|
274
|
+
|
|
268
275
|
---
|
|
269
276
|
|
|
270
277
|
### Status — see everything and where it lives
|
|
@@ -312,22 +319,19 @@ review-pr command openclaw claude ✔ gemini ✔ codex ✔ her
|
|
|
312
319
|
|
|
313
320
|
## 🗃️ Registry Storage
|
|
314
321
|
|
|
315
|
-
WaslaGenie keeps its own state separately from all orchestrators. You choose the scope
|
|
322
|
+
WaslaGenie keeps its own state separately from all orchestrators. You choose the active scope explicitly before the first sync:
|
|
316
323
|
|
|
317
|
-
**User-level** (
|
|
324
|
+
**User-level** (available across all your projects):
|
|
318
325
|
```
|
|
319
326
|
~/.waslagenie/
|
|
320
|
-
├── registry.json ←
|
|
321
|
-
|
|
322
|
-
└── config.json ← your scope and preferences
|
|
327
|
+
├── registry.json ← user-scope assets and stub locations
|
|
328
|
+
└── config.json ← active scope preference
|
|
323
329
|
```
|
|
324
330
|
|
|
325
331
|
**Workspace-level** (scoped to current project only):
|
|
326
332
|
```
|
|
327
333
|
.waslagenie/
|
|
328
|
-
|
|
329
|
-
├── stubs/
|
|
330
|
-
└── config.json
|
|
334
|
+
└── registry.json ← workspace-scope assets and stub locations
|
|
331
335
|
```
|
|
332
336
|
|
|
333
337
|
Switch anytime:
|
|
@@ -419,6 +423,7 @@ npm run dev
|
|
|
419
423
|
|
|
420
424
|
- [Contributing Guide](CONTRIBUTING.md)
|
|
421
425
|
- [Architecture Docs](docs/docs/architecture/index.md)
|
|
426
|
+
- [Release Guide](RELEASING.md)
|
|
422
427
|
|
|
423
428
|
---
|
|
424
429
|
|
package/dist/adapters/base.d.ts
CHANGED
package/dist/adapters/base.js
CHANGED
package/dist/adapters/claude.js
CHANGED
package/dist/adapters/cursor.js
CHANGED
|
@@ -2,4 +2,3 @@ import { WaslaGenieAdapter } from '../core/types.js';
|
|
|
2
2
|
export declare function getAdapter(toolName: string, scope?: 'user' | 'workspace'): WaslaGenieAdapter;
|
|
3
3
|
export declare function getInstalledAdapters(scope?: 'user' | 'workspace'): Promise<WaslaGenieAdapter[]>;
|
|
4
4
|
export declare function getAllAdapters(scope?: 'user' | 'workspace'): WaslaGenieAdapter[];
|
|
5
|
-
//# sourceMappingURL=factory.d.ts.map
|
package/dist/adapters/factory.js
CHANGED
package/dist/adapters/gemini.js
CHANGED
|
@@ -2,6 +2,5 @@ interface ConfigOptions {
|
|
|
2
2
|
scope?: string;
|
|
3
3
|
show?: boolean;
|
|
4
4
|
}
|
|
5
|
-
export declare function configCommand(options: ConfigOptions): Promise<
|
|
5
|
+
export declare function configCommand(options: ConfigOptions): Promise<boolean>;
|
|
6
6
|
export {};
|
|
7
|
-
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1,26 +1,16 @@
|
|
|
1
|
-
import { RegistryManager } from '../../core/registry.js';
|
|
2
1
|
import { section, success, error, spacer, info } from '../../utils/cli-output.js';
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
2
|
+
import prompts from 'prompts';
|
|
3
|
+
import { getConfigPath, getConfiguredRegistryPath, readConfiguredScope, writeConfiguredScope, } from '../../utils/config.js';
|
|
5
4
|
export async function configCommand(options) {
|
|
6
5
|
try {
|
|
7
|
-
|
|
8
|
-
const userPath = getRegistryPath('user');
|
|
9
|
-
const workspacePath = getRegistryPath('workspace');
|
|
10
|
-
const userExists = await fileExists(userPath);
|
|
11
|
-
const workspaceExists = await fileExists(workspacePath);
|
|
12
|
-
let currentScope = 'user';
|
|
13
|
-
if (workspaceExists && !userExists) {
|
|
14
|
-
currentScope = 'workspace';
|
|
15
|
-
}
|
|
6
|
+
const currentScope = await readConfiguredScope();
|
|
16
7
|
// Show current config
|
|
17
8
|
if (options.show) {
|
|
18
9
|
section('Current Configuration');
|
|
19
10
|
spacer();
|
|
20
|
-
|
|
21
|
-
info(`Registry: ${getRegistryPath(currentScope)}`);
|
|
11
|
+
showConfig(currentScope);
|
|
22
12
|
spacer();
|
|
23
|
-
return;
|
|
13
|
+
return true;
|
|
24
14
|
}
|
|
25
15
|
// Change scope if requested
|
|
26
16
|
if (options.scope) {
|
|
@@ -29,38 +19,44 @@ export async function configCommand(options) {
|
|
|
29
19
|
error('Invalid scope. Use: user or workspace');
|
|
30
20
|
process.exit(1);
|
|
31
21
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
if ((currentScope === 'user' && userExists) ||
|
|
35
|
-
(currentScope === 'workspace' && workspaceExists)) {
|
|
36
|
-
await registry.load();
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
// Create empty registry
|
|
40
|
-
await registry.load();
|
|
41
|
-
}
|
|
42
|
-
// Change scope and save
|
|
43
|
-
registry.setScope(newScope);
|
|
44
|
-
await registry.save();
|
|
45
|
-
success(`Scope changed to: ${newScope}`);
|
|
46
|
-
info(`Registry: ${getRegistryPath(newScope)}`);
|
|
47
|
-
spacer();
|
|
48
|
-
return;
|
|
22
|
+
await saveScope(newScope);
|
|
23
|
+
return true;
|
|
49
24
|
}
|
|
50
|
-
|
|
51
|
-
section('Current Configuration');
|
|
25
|
+
section('Configure Scope');
|
|
52
26
|
spacer();
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
27
|
+
const response = await prompts({
|
|
28
|
+
type: 'select',
|
|
29
|
+
name: 'scope',
|
|
30
|
+
message: 'Where should WaslaGenie store and sync assets?',
|
|
31
|
+
choices: [
|
|
32
|
+
{ title: 'Workspace - current project only', value: 'workspace' },
|
|
33
|
+
{ title: 'User - available across all projects', value: 'user' },
|
|
34
|
+
],
|
|
35
|
+
initial: currentScope === 'user' ? 1 : 0,
|
|
36
|
+
});
|
|
37
|
+
const scope = response.scope;
|
|
38
|
+
if (!scope) {
|
|
39
|
+
info('Configuration cancelled');
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
await saveScope(scope);
|
|
43
|
+
return true;
|
|
60
44
|
}
|
|
61
45
|
catch (err) {
|
|
62
46
|
error(`Config failed: ${err}`);
|
|
63
47
|
process.exit(1);
|
|
64
48
|
}
|
|
65
49
|
}
|
|
66
|
-
|
|
50
|
+
async function saveScope(scope) {
|
|
51
|
+
await writeConfiguredScope(scope);
|
|
52
|
+
success(`Scope changed to: ${scope}`);
|
|
53
|
+
info(`Config: ${getConfigPath()}`);
|
|
54
|
+
info(`Registry: ${getConfiguredRegistryPath(scope)}`);
|
|
55
|
+
spacer();
|
|
56
|
+
}
|
|
57
|
+
function showConfig(scope) {
|
|
58
|
+
info(`Scope: ${scope ?? 'not configured'}`);
|
|
59
|
+
info(`Config: ${getConfigPath()}`);
|
|
60
|
+
if (scope)
|
|
61
|
+
info(`Registry: ${getConfiguredRegistryPath(scope)}`);
|
|
62
|
+
}
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import { section, success, error, highlight, spacer } from '../../utils/cli-output.js';
|
|
2
|
-
import {
|
|
3
|
-
import { ensureDir } from '../../utils/fs.js';
|
|
2
|
+
import { readConfiguredScope } from '../../utils/config.js';
|
|
4
3
|
export async function installCommand() {
|
|
5
4
|
try {
|
|
6
5
|
section('Preparing WaslaGenie CLI...');
|
|
7
6
|
spacer();
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
const scope = await readConfiguredScope();
|
|
8
|
+
if (scope) {
|
|
9
|
+
success(`Scope configured: ${scope}`);
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
console.log('Choose a scope before running sync:');
|
|
13
|
+
console.log(' waslagenie config --scope user');
|
|
14
|
+
console.log(' waslagenie config --scope workspace');
|
|
15
|
+
}
|
|
11
16
|
spacer();
|
|
12
17
|
highlight('CLI setup complete!');
|
|
13
18
|
console.log('');
|
|
@@ -24,4 +29,3 @@ export async function installCommand() {
|
|
|
24
29
|
process.exit(1);
|
|
25
30
|
}
|
|
26
31
|
}
|
|
27
|
-
//# sourceMappingURL=install.js.map
|
|
@@ -2,11 +2,13 @@ import { getInstalledAdapters } from '../../adapters/factory.js';
|
|
|
2
2
|
import { section, success, error, warning, highlight, spacer } from '../../utils/cli-output.js';
|
|
3
3
|
import { getRegistryDir } from '../../utils/paths.js';
|
|
4
4
|
import { ensureDir } from '../../utils/fs.js';
|
|
5
|
+
import { requireConfiguredScope } from '../../utils/config.js';
|
|
5
6
|
export async function registerCommand(options = {}) {
|
|
6
7
|
try {
|
|
7
8
|
section('Detecting installed orchestrators...');
|
|
8
9
|
spacer();
|
|
9
|
-
const
|
|
10
|
+
const scope = await requireConfiguredScope();
|
|
11
|
+
const adapters = await getInstalledAdapters(scope);
|
|
10
12
|
if (adapters.length === 0) {
|
|
11
13
|
error('No supported orchestrators found');
|
|
12
14
|
warning('Please install Claude Code, Gemini CLI, or OpenCode first');
|
|
@@ -35,7 +37,7 @@ export async function registerCommand(options = {}) {
|
|
|
35
37
|
spacer();
|
|
36
38
|
section('Registering WaslaGenie helper skills...');
|
|
37
39
|
spacer();
|
|
38
|
-
await ensureDir(getRegistryDir(
|
|
40
|
+
await ensureDir(getRegistryDir(scope));
|
|
39
41
|
for (const adapter of targets) {
|
|
40
42
|
try {
|
|
41
43
|
await adapter.installSkill();
|
|
@@ -53,4 +55,3 @@ export async function registerCommand(options = {}) {
|
|
|
53
55
|
process.exit(1);
|
|
54
56
|
}
|
|
55
57
|
}
|
|
56
|
-
//# sourceMappingURL=register.js.map
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { RegistryManager } from '../../core/registry.js';
|
|
2
|
-
import {
|
|
2
|
+
import { Scanner } from '../../core/scanner.js';
|
|
3
|
+
import { assetList, section, error, info, metric, spacer } from '../../utils/cli-output.js';
|
|
3
4
|
import { fileExists } from '../../utils/fs.js';
|
|
4
5
|
import { getRegistryPath } from '../../utils/paths.js';
|
|
5
|
-
|
|
6
|
+
import { requireConfiguredScope } from '../../utils/config.js';
|
|
7
|
+
export async function statusCommand() {
|
|
6
8
|
try {
|
|
7
|
-
const scope = (
|
|
9
|
+
const scope = await requireConfiguredScope();
|
|
8
10
|
const registryPath = getRegistryPath(scope);
|
|
9
11
|
if (!(await fileExists(registryPath))) {
|
|
10
12
|
error('Registry not found. Run: waslagenie sync');
|
|
@@ -13,25 +15,25 @@ export async function statusCommand(options) {
|
|
|
13
15
|
const registry = new RegistryManager(scope);
|
|
14
16
|
await registry.load();
|
|
15
17
|
const registryData = registry.get();
|
|
18
|
+
const installedTools = await new Scanner(scope).detectInstalledTools();
|
|
19
|
+
section('Registry status');
|
|
20
|
+
info(`Scope: ${scope}`);
|
|
21
|
+
info(`Registry: ${registryPath}`);
|
|
22
|
+
spacer();
|
|
23
|
+
metric('Assets', registryData.assets.length);
|
|
24
|
+
metric('Conflicts', registryData.conflicts.length);
|
|
16
25
|
if (registryData.assets.length === 0) {
|
|
26
|
+
spacer();
|
|
17
27
|
section('No assets synced yet');
|
|
18
28
|
spacer();
|
|
19
29
|
return;
|
|
20
30
|
}
|
|
21
|
-
section('Synced
|
|
22
|
-
spacer();
|
|
23
|
-
const rows = registryData.assets.map((asset) => [
|
|
24
|
-
asset.name,
|
|
25
|
-
asset.type,
|
|
26
|
-
asset.stubs.map((s) => s.tool).join(', ') || 'none',
|
|
27
|
-
new Date(asset.last_modified_at).toLocaleString(),
|
|
28
|
-
]);
|
|
29
|
-
table([['ASSET', 'TYPE', 'STUBS', 'LAST MODIFIED'], ...rows.map((row) => row.map(String))], [20, 8, 20, 24]);
|
|
31
|
+
section('Synced assets');
|
|
30
32
|
spacer();
|
|
33
|
+
assetList(registryData.assets, true, installedTools);
|
|
31
34
|
}
|
|
32
35
|
catch (err) {
|
|
33
36
|
error(`Status check failed: ${err}`);
|
|
34
37
|
process.exit(1);
|
|
35
38
|
}
|
|
36
39
|
}
|
|
37
|
-
//# sourceMappingURL=status.js.map
|
|
@@ -2,14 +2,15 @@ import { RegistryManager } from '../../core/registry.js';
|
|
|
2
2
|
import { Scanner } from '../../core/scanner.js';
|
|
3
3
|
import { Syncer } from '../../syncer/index.js';
|
|
4
4
|
import { section, error, highlight, spacer } from '../../utils/cli-output.js';
|
|
5
|
+
import { requireConfiguredScope } from '../../utils/config.js';
|
|
5
6
|
export async function syncToCommand(options) {
|
|
6
7
|
try {
|
|
7
|
-
const scope = (
|
|
8
|
+
const scope = await requireConfiguredScope();
|
|
8
9
|
const from = options.from;
|
|
9
10
|
const to = options.to;
|
|
10
11
|
if (!from || !to) {
|
|
11
12
|
error('Error: --from and --to are required');
|
|
12
|
-
console.log('Usage: waslagenie sync-to --from <source> --to <target>
|
|
13
|
+
console.log('Usage: waslagenie sync-to --from <source> --to <target>');
|
|
13
14
|
console.log('Example: waslagenie sync-to --from gemini --to claude');
|
|
14
15
|
process.exit(1);
|
|
15
16
|
}
|
|
@@ -32,4 +33,3 @@ export async function syncToCommand(options) {
|
|
|
32
33
|
process.exit(1);
|
|
33
34
|
}
|
|
34
35
|
}
|
|
35
|
-
//# sourceMappingURL=sync-to.js.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
interface SyncOptions {
|
|
2
|
-
|
|
2
|
+
promptForScope?: boolean;
|
|
3
3
|
}
|
|
4
|
-
export declare function syncCommand(options
|
|
4
|
+
export declare function syncCommand(options?: SyncOptions): Promise<void>;
|
|
5
5
|
export {};
|
|
6
|
-
//# sourceMappingURL=sync.d.ts.map
|
|
@@ -1,27 +1,49 @@
|
|
|
1
1
|
import { RegistryManager } from '../../core/registry.js';
|
|
2
2
|
import { Scanner } from '../../core/scanner.js';
|
|
3
3
|
import { Syncer } from '../../syncer/index.js';
|
|
4
|
-
import { section, error, highlight, spacer } from '../../utils/cli-output.js';
|
|
5
|
-
|
|
4
|
+
import { assetList, bulletPoint, section, error, highlight, info, metric, spacer, } from '../../utils/cli-output.js';
|
|
5
|
+
import { getConfiguredRegistryPath, requireConfiguredScope } from '../../utils/config.js';
|
|
6
|
+
import { configCommand } from './config.js';
|
|
7
|
+
export async function syncCommand(options = {}) {
|
|
6
8
|
try {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
+
if (options.promptForScope !== false && !(await configCommand({}))) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
const scope = await requireConfiguredScope();
|
|
13
|
+
section('Syncing assets');
|
|
14
|
+
info(`Scope: ${scope}`);
|
|
15
|
+
info(`Registry: ${getConfiguredRegistryPath(scope)}`);
|
|
9
16
|
spacer();
|
|
17
|
+
section('Scanning providers');
|
|
10
18
|
const registry = new RegistryManager(scope);
|
|
11
19
|
await registry.load();
|
|
12
20
|
const scanner = new Scanner(scope);
|
|
21
|
+
const installedTools = await scanner.detectInstalledTools();
|
|
22
|
+
info(`${installedTools.length} providers detected`);
|
|
23
|
+
for (const tool of installedTools) {
|
|
24
|
+
bulletPoint(tool, 1);
|
|
25
|
+
}
|
|
26
|
+
spacer();
|
|
13
27
|
const syncer = new Syncer(registry, scanner, scope);
|
|
14
|
-
const result = await syncer.sync(
|
|
28
|
+
const result = await syncer.sync(false);
|
|
29
|
+
spacer();
|
|
30
|
+
highlight('Sync complete');
|
|
31
|
+
spacer();
|
|
32
|
+
metric('Assets discovered', result.assetsDiscovered);
|
|
33
|
+
metric('Stubs written', result.stubsWritten);
|
|
34
|
+
metric('Stubs deleted', result.stubsDeleted);
|
|
15
35
|
spacer();
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
36
|
+
if (registry.get().assets.length === 0) {
|
|
37
|
+
info('No assets discovered');
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
section('Discovered assets');
|
|
41
|
+
spacer();
|
|
42
|
+
assetList(registry.get().assets, false, installedTools);
|
|
43
|
+
}
|
|
21
44
|
}
|
|
22
45
|
catch (err) {
|
|
23
46
|
error(`Sync failed: ${err}`);
|
|
24
47
|
process.exit(1);
|
|
25
48
|
}
|
|
26
49
|
}
|
|
27
|
-
//# sourceMappingURL=sync.js.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export declare function resolveVisualizerDist(moduleUrl: string): string;
|
|
2
2
|
interface VisualizerOptions {
|
|
3
|
-
scope?: string;
|
|
4
3
|
port?: string;
|
|
5
4
|
host?: string;
|
|
6
5
|
noOpen?: boolean;
|
|
@@ -8,4 +7,3 @@ interface VisualizerOptions {
|
|
|
8
7
|
export declare const PROVIDER_ICONS: Record<string, string>;
|
|
9
8
|
export declare function visualizerCommand(options: VisualizerOptions): Promise<void>;
|
|
10
9
|
export {};
|
|
11
|
-
//# sourceMappingURL=visualizer.d.ts.map
|
|
@@ -10,6 +10,7 @@ import { RegistryManager } from '../../core/registry.js';
|
|
|
10
10
|
import { getInstalledAdapters } from '../../adapters/factory.js';
|
|
11
11
|
import { error, highlight, info, section, spacer } from '../../utils/cli-output.js';
|
|
12
12
|
import { Syncer } from '../../syncer/index.js';
|
|
13
|
+
import { requireConfiguredScope } from '../../utils/config.js';
|
|
13
14
|
export function resolveVisualizerDist(moduleUrl) {
|
|
14
15
|
return resolve(dirname(fileURLToPath(moduleUrl)), '../../../src/visualizer/dist');
|
|
15
16
|
}
|
|
@@ -138,7 +139,7 @@ function sendJson(res, statusCode, body) {
|
|
|
138
139
|
}
|
|
139
140
|
export async function visualizerCommand(options) {
|
|
140
141
|
try {
|
|
141
|
-
const scope = (
|
|
142
|
+
const scope = await requireConfiguredScope();
|
|
142
143
|
const host = options.host || '127.0.0.1';
|
|
143
144
|
const port = Number(options.port || 4072);
|
|
144
145
|
const shouldOpen = options.noOpen !== true;
|
|
@@ -238,4 +239,3 @@ export async function visualizerCommand(options) {
|
|
|
238
239
|
process.exit(1);
|
|
239
240
|
}
|
|
240
241
|
}
|
|
241
|
-
//# sourceMappingURL=visualizer.js.map
|
|
@@ -4,9 +4,10 @@ import { Scanner } from '../../core/scanner.js';
|
|
|
4
4
|
import { Syncer } from '../../syncer/index.js';
|
|
5
5
|
import { getAllAdapters } from '../../adapters/factory.js';
|
|
6
6
|
import { section, success, error, info, spacer } from '../../utils/cli-output.js';
|
|
7
|
-
|
|
7
|
+
import { requireConfiguredScope } from '../../utils/config.js';
|
|
8
|
+
export async function watchCommand() {
|
|
8
9
|
try {
|
|
9
|
-
const scope = (
|
|
10
|
+
const scope = await requireConfiguredScope();
|
|
10
11
|
section('Watching for changes...');
|
|
11
12
|
spacer();
|
|
12
13
|
const registry = new RegistryManager(scope);
|
|
@@ -83,4 +84,3 @@ export async function watchCommand(options) {
|
|
|
83
84
|
process.exit(1);
|
|
84
85
|
}
|
|
85
86
|
}
|
|
86
|
-
//# sourceMappingURL=watch.js.map
|
package/dist/cli/index.d.ts
CHANGED