@snap/valdi 1.0.8 → 1.1.5
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/.bootstrap/apps/cli_application/BUILD.bazel.template +7 -0
- package/.bootstrap/apps/cli_application/modules/{{MODULE_NAME}}/BUILD.bazel.template +11 -0
- package/.bootstrap/apps/cli_application/modules/{{MODULE_NAME}}/src/index.ts +1 -0
- package/.bootstrap/apps/ui_application/.eslint.rc +27 -0
- package/.bootstrap/apps/ui_application/BUILD.bazel.template +19 -0
- package/.bootstrap/apps/ui_application/modules/{{MODULE_NAME}}/BUILD.bazel.template +21 -0
- package/.bootstrap/apps/ui_application/modules/{{MODULE_NAME}}/res/valdi@3x.png +0 -0
- package/.bootstrap/apps/ui_application/modules/{{MODULE_NAME}}/src/App.tsx +133 -0
- package/.bootstrap/apps/ui_application/package.json +24 -0
- package/.bootstrap/modules/polyglot_bridge_module/BUILD.bazel.template +54 -0
- package/.bootstrap/modules/polyglot_bridge_module/android/CalculatorModuleFactory.kt.template +18 -0
- package/.bootstrap/modules/polyglot_bridge_module/ios/SCCCalculatorModuleFactory.m.template +31 -0
- package/.bootstrap/modules/polyglot_bridge_module/src/Calculator.d.ts +4 -0
- package/.bootstrap/modules/polyglot_bridge_module/web/Calculator.ts +11 -0
- package/.bootstrap/modules/polyglot_bridge_module/web/tsconfig.json +16 -0
- package/.bootstrap/modules/polyglot_view_module/BUILD.bazel.template +75 -0
- package/.bootstrap/modules/polyglot_view_module/android/PolyglotNativeView.kt.template +41 -0
- package/.bootstrap/modules/polyglot_view_module/android/PolyglotNativeViewAttributesBinder.kt.template +17 -0
- package/.bootstrap/modules/polyglot_view_module/ios/SCPolyglotView.h +8 -0
- package/.bootstrap/modules/polyglot_view_module/ios/SCPolyglotView.m +23 -0
- package/.bootstrap/modules/polyglot_view_module/macos/SCPolyglotView.h +8 -0
- package/.bootstrap/modules/polyglot_view_module/macos/SCPolyglotView.m +23 -0
- package/.bootstrap/modules/polyglot_view_module/src/PolyglotCustomView.tsx.template +23 -0
- package/.bootstrap/modules/polyglot_view_module/web/PolyglotWeb.ts.template +30 -0
- package/.bootstrap/modules/polyglot_view_module/web/tsconfig.json +16 -0
- package/.bootstrap/modules/ui_component/BUILD.bazel.template +34 -0
- package/.bootstrap/modules/ui_component/src/NewModuleComponent.tsx +45 -0
- package/.metadata/.bazelrc.template +92 -0
- package/.metadata/.bazelversion.template +1 -0
- package/.metadata/.editorconfig.template +37 -0
- package/.metadata/.eslintrc.js.template +27 -0
- package/.metadata/.gitignore.template +4 -0
- package/.metadata/.prettierrc.json.template +7 -0
- package/.metadata/.watchmanconfig.template +8 -0
- package/.metadata/AGENTS.md.template +16 -0
- package/.metadata/MODULE.bazel.template +62 -0
- package/.metadata/README.md.template +31 -0
- package/.metadata/config.yaml.template +1 -0
- package/.metadata/package.json.template +23 -0
- package/.metadata/skill-reference.tsx.template +8 -0
- package/.metadata/skill-tests-BUILD.bazel.template +21 -0
- package/.metadata/skill-tests-README.md.template +17 -0
- package/.metadata/skill.md.template +27 -0
- package/bundled-skills/registry.json +14 -2
- package/bundled-skills/skills/valdi-animations/skill.md +197 -0
- package/bundled-skills/skills/valdi-async/tests/src/reference.tsx +1 -1
- package/bundled-skills/skills/valdi-bazel/skill.md +21 -2
- package/bundled-skills/skills/valdi-component-dedup/skill.md +263 -0
- package/bundled-skills/skills/valdi-component-tests/tests/test/ProfileCardTest.spec.tsx +1 -1
- package/bundled-skills/skills/valdi-custom-view/skill.md +49 -5
- package/bundled-skills/skills/valdi-error-handling/skill.md +238 -0
- package/bundled-skills/skills/valdi-gestures/skill.md +198 -0
- package/bundled-skills/skills/valdi-inspect/skill.md +217 -0
- package/bundled-skills/skills/valdi-localization/skill.md +142 -0
- package/bundled-skills/skills/valdi-mock-breakdown/skill.md +327 -0
- package/bundled-skills/skills/valdi-mock-iterate/skill.md +216 -0
- package/bundled-skills/skills/valdi-mock-to-module/scripts/diff.py +392 -0
- package/bundled-skills/skills/valdi-mock-to-module/scripts/extract_colors.py +277 -0
- package/bundled-skills/skills/valdi-mock-to-module/scripts/find_icon.py +303 -0
- package/bundled-skills/skills/valdi-mock-to-module/scripts/snapshot-and-diff.sh +53 -0
- package/bundled-skills/skills/valdi-mock-to-module/scripts/test_diff.py +207 -0
- package/bundled-skills/skills/valdi-mock-to-module/scripts/test_extract_colors.py +167 -0
- package/bundled-skills/skills/valdi-mock-to-module/scripts/test_find_icon.py +188 -0
- package/bundled-skills/skills/valdi-mock-to-module/scripts/watch-and-diff.sh +181 -0
- package/bundled-skills/skills/valdi-mock-to-module/skill.md +451 -0
- package/bundled-skills/skills/valdi-navigation/skill.md +187 -0
- package/bundled-skills/skills/valdi-overview/skill.md +7 -4
- package/bundled-skills/skills/valdi-perf/skill.md +223 -0
- package/bundled-skills/skills/valdi-polyglot-module/skill.md +131 -12
- package/bundled-skills/skills/valdi-preview/skill.md +303 -0
- package/bundled-skills/skills/valdi-profile/skill.md +126 -0
- package/bundled-skills/skills/valdi-setup/skill.md +55 -5
- package/bundled-skills/skills/valdi-testing/skill.md +23 -7
- package/bundled-skills/skills/valdi-tsx/skill.md +69 -5
- package/bundled-skills/skills/valdi-tsx/tests/src/reference.tsx +29 -5
- package/dist/commands/agentCheck.js +184 -0
- package/dist/commands/analyze.js +16 -0
- package/dist/commands/analyze_commands/duplicates.js +134 -0
- package/dist/commands/bootstrap.js +57 -73
- package/dist/commands/doctor.js +40 -203
- package/dist/commands/hotreload.js +15 -0
- package/dist/commands/inspect.js +16 -0
- package/dist/commands/inspect_commands/contexts.js +55 -0
- package/dist/commands/inspect_commands/devices.js +53 -0
- package/dist/commands/inspect_commands/heap.js +59 -0
- package/dist/commands/inspect_commands/select.js +43 -0
- package/dist/commands/inspect_commands/snapshot.js +129 -0
- package/dist/commands/inspect_commands/snapshot.spec.js +105 -0
- package/dist/commands/inspect_commands/status.js +68 -0
- package/dist/commands/inspect_commands/tree.js +86 -0
- package/dist/commands/preview.js +81 -0
- package/dist/commands/profile.js +16 -0
- package/dist/commands/profile_commands/capture.js +106 -0
- package/dist/commands/projectsync.js +9 -7
- package/dist/commands/skills_commands/install.js +6 -1
- package/dist/commands/skills_commands/update.js +2 -1
- package/dist/core/analyze/clusterer.js +150 -0
- package/dist/core/analyze/fingerprint.js +2 -0
- package/dist/core/analyze/knownPatterns.js +76 -0
- package/dist/core/analyze/parser.js +177 -0
- package/dist/core/analyze/reporter.js +83 -0
- package/dist/core/analyze/scanner.js +172 -0
- package/dist/core/analyze/similarity.js +56 -0
- package/dist/core/constants.js +1 -1
- package/dist/core/packageFiles.spec.js +29 -0
- package/dist/preview/previewGenerator.js +240 -0
- package/dist/preview/previewGenerator.spec.js +203 -0
- package/dist/preview/viewModelParser.js +86 -0
- package/dist/preview/viewModelParser.spec.js +171 -0
- package/dist/setup/DevSetupHelper.js +0 -51
- package/dist/setup/linuxSetup.js +0 -2
- package/dist/setup/macOSSetup.js +1 -4
- package/dist/utils/BazelClient.js +15 -0
- package/dist/utils/daemonClient.js +344 -0
- package/dist/utils/hermesClient.js +252 -0
- package/dist/utils/skillsAdapters.js +86 -5
- package/dist/utils/skillsAdapters.spec.js +60 -0
- package/dist/utils/skillsRegistry.js +8 -0
- package/dist/utils/stringUtils.spec.js +1 -1
- package/package.json +30 -12
- package/dist/setup/versions.js +0 -8
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.handler = exports.builder = exports.describe = exports.command = void 0;
|
|
4
|
+
exports.firstElementId = firstElementId;
|
|
5
|
+
exports.findElementByKey = findElementByKey;
|
|
6
|
+
const tslib_1 = require("tslib");
|
|
7
|
+
const fs = tslib_1.__importStar(require("fs"));
|
|
8
|
+
const path = tslib_1.__importStar(require("path"));
|
|
9
|
+
const os = tslib_1.__importStar(require("os"));
|
|
10
|
+
const errorUtils_1 = require("../../utils/errorUtils");
|
|
11
|
+
const daemonClient_1 = require("../../utils/daemonClient");
|
|
12
|
+
const constants_1 = require("../../core/constants");
|
|
13
|
+
const logUtils_1 = require("../../utils/logUtils");
|
|
14
|
+
function firstElementId(node) {
|
|
15
|
+
if (node === null || typeof node !== 'object')
|
|
16
|
+
return null;
|
|
17
|
+
const obj = node;
|
|
18
|
+
if (obj['element'] && typeof obj['element'] === 'object') {
|
|
19
|
+
const elem = obj['element'];
|
|
20
|
+
if (elem['id'] !== undefined)
|
|
21
|
+
return String(elem['id']);
|
|
22
|
+
}
|
|
23
|
+
const children = obj['children'];
|
|
24
|
+
if (Array.isArray(children)) {
|
|
25
|
+
for (const child of children) {
|
|
26
|
+
const found = firstElementId(child);
|
|
27
|
+
if (found)
|
|
28
|
+
return found;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
function findElementByKey(node, targetKey) {
|
|
34
|
+
if (node === null || typeof node !== 'object')
|
|
35
|
+
return null;
|
|
36
|
+
const obj = node;
|
|
37
|
+
if (obj['key'] === targetKey && obj['element'] && typeof obj['element'] === 'object') {
|
|
38
|
+
const elem = obj['element'];
|
|
39
|
+
if (elem['id'] !== undefined)
|
|
40
|
+
return String(elem['id']);
|
|
41
|
+
}
|
|
42
|
+
if (obj['tag'] === targetKey && obj['element'] && typeof obj['element'] === 'object') {
|
|
43
|
+
const elem = obj['element'];
|
|
44
|
+
if (elem['id'] !== undefined)
|
|
45
|
+
return String(elem['id']);
|
|
46
|
+
}
|
|
47
|
+
if (obj['tag'] === targetKey && obj['component'] !== undefined) {
|
|
48
|
+
return firstElementId(obj);
|
|
49
|
+
}
|
|
50
|
+
const children = obj['children'];
|
|
51
|
+
if (Array.isArray(children)) {
|
|
52
|
+
for (const child of children) {
|
|
53
|
+
const found = findElementByKey(child, targetKey);
|
|
54
|
+
if (found)
|
|
55
|
+
return found;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
async function inspectSnapshot(argv) {
|
|
61
|
+
const elementIdArg = argv.getArgument('elementId');
|
|
62
|
+
const contextIdArg = argv.getArgument('contextId');
|
|
63
|
+
const port = argv.getArgument('port');
|
|
64
|
+
const clientOverride = argv.getArgument('client');
|
|
65
|
+
const outputOverride = argv.getArgument('output');
|
|
66
|
+
const keyOverride = argv.getArgument('key');
|
|
67
|
+
const conn = await (0, daemonClient_1.connectToDaemon)(port);
|
|
68
|
+
try {
|
|
69
|
+
await conn.configure();
|
|
70
|
+
const clientId = await (0, daemonClient_1.resolveClientId)(conn, clientOverride);
|
|
71
|
+
const contextId = await (0, daemonClient_1.resolveContextId)(conn, clientId, contextIdArg);
|
|
72
|
+
let elementId = elementIdArg;
|
|
73
|
+
if (keyOverride) {
|
|
74
|
+
const tree = await conn.getContextTree(clientId, contextId);
|
|
75
|
+
const found = findElementByKey(tree, keyOverride);
|
|
76
|
+
if (!found) {
|
|
77
|
+
throw new Error(`No element found with key "${keyOverride}". Use "valdi inspect tree" to see available keys.`);
|
|
78
|
+
}
|
|
79
|
+
elementId = found;
|
|
80
|
+
console.error((0, logUtils_1.wrapInColor)(`Resolved key "${keyOverride}" to element ID ${elementId}`, constants_1.ANSI_COLORS.GREEN_COLOR));
|
|
81
|
+
}
|
|
82
|
+
const base64Data = await conn.takeSnapshot(clientId, elementId, contextId);
|
|
83
|
+
const snapshotName = keyOverride || elementId;
|
|
84
|
+
const outPath = outputOverride
|
|
85
|
+
? path.resolve(outputOverride)
|
|
86
|
+
: path.join(os.tmpdir(), `valdi-snapshot-${snapshotName}.png`);
|
|
87
|
+
fs.writeFileSync(outPath, Buffer.from(base64Data, 'base64'));
|
|
88
|
+
console.log(JSON.stringify({ path: outPath }));
|
|
89
|
+
console.error((0, logUtils_1.wrapInColor)(`Screenshot saved: ${outPath}`, constants_1.ANSI_COLORS.GREEN_COLOR));
|
|
90
|
+
}
|
|
91
|
+
finally {
|
|
92
|
+
conn.close();
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
exports.command = 'snapshot [elementId] [contextId]';
|
|
96
|
+
exports.describe = 'Capture a screenshot of an element by ID or --key';
|
|
97
|
+
const builder = (yargs) => {
|
|
98
|
+
yargs
|
|
99
|
+
.positional('elementId', {
|
|
100
|
+
describe: 'Element ID to screenshot (not needed when using --key)',
|
|
101
|
+
type: 'string',
|
|
102
|
+
default: '0',
|
|
103
|
+
})
|
|
104
|
+
.positional('contextId', {
|
|
105
|
+
describe: 'Context ID containing the element (omit to auto-select or be prompted)',
|
|
106
|
+
type: 'string',
|
|
107
|
+
})
|
|
108
|
+
.option('key', {
|
|
109
|
+
describe: 'Find element by key or tag name in the tree (stable across hot-reloads)',
|
|
110
|
+
type: 'string',
|
|
111
|
+
alias: 'k',
|
|
112
|
+
})
|
|
113
|
+
.option('port', {
|
|
114
|
+
describe: 'Daemon TCP port',
|
|
115
|
+
type: 'number',
|
|
116
|
+
default: daemonClient_1.DEFAULT_PORT,
|
|
117
|
+
})
|
|
118
|
+
.option('client', {
|
|
119
|
+
describe: 'Client ID to target (from "valdi inspect devices")',
|
|
120
|
+
type: 'string',
|
|
121
|
+
})
|
|
122
|
+
.option('output', {
|
|
123
|
+
describe: 'Output PNG file path (defaults to /tmp/valdi-snapshot-<elementId>.png)',
|
|
124
|
+
type: 'string',
|
|
125
|
+
alias: 'o',
|
|
126
|
+
});
|
|
127
|
+
};
|
|
128
|
+
exports.builder = builder;
|
|
129
|
+
exports.handler = (0, errorUtils_1.makeCommandHandler)(inspectSnapshot);
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
require("jasmine");
|
|
4
|
+
const snapshot_1 = require("./snapshot");
|
|
5
|
+
describe('snapshot tree helpers', () => {
|
|
6
|
+
describe('firstElementId', () => {
|
|
7
|
+
it('returns null for null/non-object input', () => {
|
|
8
|
+
expect((0, snapshot_1.firstElementId)(null)).toBeNull();
|
|
9
|
+
expect((0, snapshot_1.firstElementId)(undefined)).toBeNull();
|
|
10
|
+
expect((0, snapshot_1.firstElementId)(42)).toBeNull();
|
|
11
|
+
expect((0, snapshot_1.firstElementId)('string')).toBeNull();
|
|
12
|
+
});
|
|
13
|
+
it('returns the element id from a direct element node', () => {
|
|
14
|
+
const node = { element: { id: 5 } };
|
|
15
|
+
expect((0, snapshot_1.firstElementId)(node)).toBe('5');
|
|
16
|
+
});
|
|
17
|
+
it('returns the first element id from nested children', () => {
|
|
18
|
+
const node = {
|
|
19
|
+
children: [
|
|
20
|
+
{ tag: 'view' },
|
|
21
|
+
{ children: [{ element: { id: 42 } }] },
|
|
22
|
+
],
|
|
23
|
+
};
|
|
24
|
+
expect((0, snapshot_1.firstElementId)(node)).toBe('42');
|
|
25
|
+
});
|
|
26
|
+
it('returns null when no element is found', () => {
|
|
27
|
+
const node = { children: [{ tag: 'view' }, { tag: 'label' }] };
|
|
28
|
+
expect((0, snapshot_1.firstElementId)(node)).toBeNull();
|
|
29
|
+
});
|
|
30
|
+
it('handles element id of 0', () => {
|
|
31
|
+
const node = { element: { id: 0 } };
|
|
32
|
+
expect((0, snapshot_1.firstElementId)(node)).toBe('0');
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
describe('findElementByKey', () => {
|
|
36
|
+
it('finds element by explicit key', () => {
|
|
37
|
+
const tree = {
|
|
38
|
+
children: [
|
|
39
|
+
{ key: 'header', element: { id: 10 } },
|
|
40
|
+
{ key: 'body', element: { id: 20 } },
|
|
41
|
+
],
|
|
42
|
+
};
|
|
43
|
+
expect((0, snapshot_1.findElementByKey)(tree, 'header')).toBe('10');
|
|
44
|
+
expect((0, snapshot_1.findElementByKey)(tree, 'body')).toBe('20');
|
|
45
|
+
});
|
|
46
|
+
it('finds element by tag name', () => {
|
|
47
|
+
const tree = {
|
|
48
|
+
children: [
|
|
49
|
+
{ tag: 'ChatFriendsList', element: { id: 15 } },
|
|
50
|
+
],
|
|
51
|
+
};
|
|
52
|
+
expect((0, snapshot_1.findElementByKey)(tree, 'ChatFriendsList')).toBe('15');
|
|
53
|
+
});
|
|
54
|
+
it('finds component node by tag and returns first child element id', () => {
|
|
55
|
+
const tree = {
|
|
56
|
+
children: [
|
|
57
|
+
{
|
|
58
|
+
tag: 'MyComponent',
|
|
59
|
+
component: 'MyComponent',
|
|
60
|
+
children: [
|
|
61
|
+
{ element: { id: 99 } },
|
|
62
|
+
],
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
};
|
|
66
|
+
expect((0, snapshot_1.findElementByKey)(tree, 'MyComponent')).toBe('99');
|
|
67
|
+
});
|
|
68
|
+
it('searches deeply nested trees', () => {
|
|
69
|
+
const tree = {
|
|
70
|
+
children: [
|
|
71
|
+
{
|
|
72
|
+
children: [
|
|
73
|
+
{
|
|
74
|
+
children: [
|
|
75
|
+
{ key: 'deep-key', element: { id: 77 } },
|
|
76
|
+
],
|
|
77
|
+
},
|
|
78
|
+
],
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
};
|
|
82
|
+
expect((0, snapshot_1.findElementByKey)(tree, 'deep-key')).toBe('77');
|
|
83
|
+
});
|
|
84
|
+
it('returns null when key is not found', () => {
|
|
85
|
+
const tree = {
|
|
86
|
+
children: [
|
|
87
|
+
{ key: 'exists', element: { id: 1 } },
|
|
88
|
+
],
|
|
89
|
+
};
|
|
90
|
+
expect((0, snapshot_1.findElementByKey)(tree, 'nonexistent')).toBeNull();
|
|
91
|
+
});
|
|
92
|
+
it('returns null for null input', () => {
|
|
93
|
+
expect((0, snapshot_1.findElementByKey)(null, 'anything')).toBeNull();
|
|
94
|
+
});
|
|
95
|
+
it('prefers key match over tag match', () => {
|
|
96
|
+
const tree = {
|
|
97
|
+
children: [
|
|
98
|
+
{ key: 'my-key', tag: 'SomeTag', element: { id: 1 } },
|
|
99
|
+
{ key: 'other', tag: 'my-key', element: { id: 2 } },
|
|
100
|
+
],
|
|
101
|
+
};
|
|
102
|
+
expect((0, snapshot_1.findElementByKey)(tree, 'my-key')).toBe('1');
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
});
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.handler = exports.builder = exports.describe = exports.command = void 0;
|
|
4
|
+
const errorUtils_1 = require("../../utils/errorUtils");
|
|
5
|
+
const daemonClient_1 = require("../../utils/daemonClient");
|
|
6
|
+
const constants_1 = require("../../core/constants");
|
|
7
|
+
const logUtils_1 = require("../../utils/logUtils");
|
|
8
|
+
async function inspectStatus(argv) {
|
|
9
|
+
const port = argv.getArgument('port');
|
|
10
|
+
const pretty = argv.getArgument('pretty');
|
|
11
|
+
let connected = false;
|
|
12
|
+
let clientCount = 0;
|
|
13
|
+
let error;
|
|
14
|
+
try {
|
|
15
|
+
const conn = await (0, daemonClient_1.connectToDaemon)(port);
|
|
16
|
+
try {
|
|
17
|
+
await conn.configure();
|
|
18
|
+
const clients = await conn.listConnectedClients();
|
|
19
|
+
connected = true;
|
|
20
|
+
clientCount = clients.length;
|
|
21
|
+
}
|
|
22
|
+
finally {
|
|
23
|
+
conn.close();
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
catch (err) {
|
|
27
|
+
error = err instanceof Error ? err.message : String(err);
|
|
28
|
+
}
|
|
29
|
+
const result = {
|
|
30
|
+
connected,
|
|
31
|
+
port,
|
|
32
|
+
connectedDevices: clientCount,
|
|
33
|
+
portName: port === daemonClient_1.MOBILE_PORT ? 'mobile' : port === daemonClient_1.STANDALONE_PORT ? 'standalone' : 'custom',
|
|
34
|
+
error: error ?? null,
|
|
35
|
+
};
|
|
36
|
+
if (pretty) {
|
|
37
|
+
const statusColor = connected ? constants_1.ANSI_COLORS.GREEN_COLOR : constants_1.ANSI_COLORS.RED_COLOR;
|
|
38
|
+
const statusLabel = connected ? '● connected' : '○ not connected';
|
|
39
|
+
console.log(`Daemon status: ${(0, logUtils_1.wrapInColor)(statusLabel, statusColor)}`);
|
|
40
|
+
console.log(`Port: ${(0, logUtils_1.wrapInColor)(String(port), constants_1.ANSI_COLORS.BLUE_COLOR)} (${result.portName})`);
|
|
41
|
+
if (connected) {
|
|
42
|
+
console.log(`Connected devices: ${(0, logUtils_1.wrapInColor)(String(clientCount), constants_1.ANSI_COLORS.GREEN_COLOR)}`);
|
|
43
|
+
}
|
|
44
|
+
if (error) {
|
|
45
|
+
console.log((0, logUtils_1.wrapInColor)(error, constants_1.ANSI_COLORS.RED_COLOR));
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
console.log(JSON.stringify(result));
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.command = 'status';
|
|
53
|
+
exports.describe = 'Check Valdi daemon connection status and connected device count';
|
|
54
|
+
const builder = (yargs) => {
|
|
55
|
+
yargs
|
|
56
|
+
.option('port', {
|
|
57
|
+
describe: 'Daemon TCP port',
|
|
58
|
+
type: 'number',
|
|
59
|
+
default: daemonClient_1.DEFAULT_PORT,
|
|
60
|
+
})
|
|
61
|
+
.option('pretty', {
|
|
62
|
+
describe: 'Human-readable output instead of JSON',
|
|
63
|
+
type: 'boolean',
|
|
64
|
+
default: false,
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
exports.builder = builder;
|
|
68
|
+
exports.handler = (0, errorUtils_1.makeCommandHandler)(inspectStatus);
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.handler = exports.builder = exports.describe = exports.command = void 0;
|
|
4
|
+
const errorUtils_1 = require("../../utils/errorUtils");
|
|
5
|
+
const daemonClient_1 = require("../../utils/daemonClient");
|
|
6
|
+
function trimDepth(node, depth) {
|
|
7
|
+
if (depth <= 0 || node === null || typeof node !== 'object')
|
|
8
|
+
return node;
|
|
9
|
+
const obj = node;
|
|
10
|
+
const result = {};
|
|
11
|
+
for (const key of Object.keys(obj)) {
|
|
12
|
+
if (key === 'children') {
|
|
13
|
+
const children = obj['children'];
|
|
14
|
+
if (depth === 1) {
|
|
15
|
+
const count = Array.isArray(children) ? children.length : 0;
|
|
16
|
+
if (count > 0)
|
|
17
|
+
result['_childrenTrimmed'] = count;
|
|
18
|
+
}
|
|
19
|
+
else if (Array.isArray(children)) {
|
|
20
|
+
result['children'] = children.map((c) => trimDepth(c, depth - 1));
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
result['children'] = children;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
result[key] = obj[key];
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return result;
|
|
31
|
+
}
|
|
32
|
+
async function inspectTree(argv) {
|
|
33
|
+
const contextIdArg = argv.getArgument('contextId');
|
|
34
|
+
const port = argv.getArgument('port');
|
|
35
|
+
const clientOverride = argv.getArgument('client');
|
|
36
|
+
const pretty = argv.getArgument('pretty');
|
|
37
|
+
const maxDepth = argv.getArgument('maxDepth');
|
|
38
|
+
const conn = await (0, daemonClient_1.connectToDaemon)(port);
|
|
39
|
+
try {
|
|
40
|
+
await conn.configure();
|
|
41
|
+
const clientId = await (0, daemonClient_1.resolveClientId)(conn, clientOverride);
|
|
42
|
+
const contextId = await (0, daemonClient_1.resolveContextId)(conn, clientId, contextIdArg);
|
|
43
|
+
let tree = await conn.getContextTree(clientId, contextId);
|
|
44
|
+
if (maxDepth !== undefined) {
|
|
45
|
+
tree = trimDepth(tree, maxDepth);
|
|
46
|
+
}
|
|
47
|
+
if (pretty) {
|
|
48
|
+
console.log(JSON.stringify(tree, null, 2));
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
console.log(JSON.stringify(tree));
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
finally {
|
|
55
|
+
conn.close();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.command = 'tree [contextId]';
|
|
59
|
+
exports.describe = 'Get the full rendered virtual node tree for a context';
|
|
60
|
+
const builder = (yargs) => {
|
|
61
|
+
yargs
|
|
62
|
+
.positional('contextId', {
|
|
63
|
+
describe: 'Context ID (omit to auto-select or be prompted)',
|
|
64
|
+
type: 'string',
|
|
65
|
+
})
|
|
66
|
+
.option('port', {
|
|
67
|
+
describe: 'Daemon TCP port',
|
|
68
|
+
type: 'number',
|
|
69
|
+
default: daemonClient_1.DEFAULT_PORT,
|
|
70
|
+
})
|
|
71
|
+
.option('client', {
|
|
72
|
+
describe: 'Client ID to target (from "valdi inspect devices")',
|
|
73
|
+
type: 'string',
|
|
74
|
+
})
|
|
75
|
+
.option('pretty', {
|
|
76
|
+
describe: 'Pretty-print JSON output',
|
|
77
|
+
type: 'boolean',
|
|
78
|
+
default: false,
|
|
79
|
+
})
|
|
80
|
+
.option('max-depth', {
|
|
81
|
+
describe: 'Trim the tree to this many levels deep (children beyond the limit are replaced with _childrenTrimmed count)',
|
|
82
|
+
type: 'number',
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
exports.builder = builder;
|
|
86
|
+
exports.handler = (0, errorUtils_1.makeCommandHandler)(inspectTree);
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.handler = exports.builder = exports.describe = exports.command = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
6
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
7
|
+
const constants_1 = require("../core/constants");
|
|
8
|
+
const errors_1 = require("../core/errors");
|
|
9
|
+
const BazelClient_1 = require("../utils/BazelClient");
|
|
10
|
+
const errorUtils_1 = require("../utils/errorUtils");
|
|
11
|
+
const logUtils_1 = require("../utils/logUtils");
|
|
12
|
+
const previewGenerator_1 = require("../preview/previewGenerator");
|
|
13
|
+
const viewModelParser_1 = require("../preview/viewModelParser");
|
|
14
|
+
function resolveComponentFile(component, workspaceRoot) {
|
|
15
|
+
if (component.endsWith('.tsx') || component.endsWith('.ts')) {
|
|
16
|
+
const abs = path_1.default.resolve(component);
|
|
17
|
+
if (fs_1.default.existsSync(abs))
|
|
18
|
+
return abs;
|
|
19
|
+
throw new errors_1.CliError(`Component file not found: ${abs}`);
|
|
20
|
+
}
|
|
21
|
+
const candidates = [
|
|
22
|
+
path_1.default.join(workspaceRoot, 'valdi_modules', component + '.tsx'),
|
|
23
|
+
path_1.default.join(workspaceRoot, 'src/valdi_modules/src/valdi', component + '.tsx'),
|
|
24
|
+
];
|
|
25
|
+
for (const candidate of candidates) {
|
|
26
|
+
if (fs_1.default.existsSync(candidate))
|
|
27
|
+
return candidate;
|
|
28
|
+
}
|
|
29
|
+
throw new errors_1.CliError(`Could not find component file for "${component}". Searched:\n` +
|
|
30
|
+
candidates.map(c => ` ${c}`).join('\n'));
|
|
31
|
+
}
|
|
32
|
+
function computeImportPath(filePath, moduleDir) {
|
|
33
|
+
const moduleName = path_1.default.basename(moduleDir);
|
|
34
|
+
const relFromModule = path_1.default.relative(moduleDir, filePath);
|
|
35
|
+
const withoutExt = relFromModule.replace(/\.tsx?$/, '');
|
|
36
|
+
return `${moduleName}/${withoutExt}`;
|
|
37
|
+
}
|
|
38
|
+
async function valdiPreview(argv) {
|
|
39
|
+
const bazel = new BazelClient_1.BazelClient();
|
|
40
|
+
const workspaceRoot = await bazel.getWorkspaceRoot();
|
|
41
|
+
const component = argv.getArgument('component');
|
|
42
|
+
console.log(`Resolving component: ${(0, logUtils_1.wrapInColor)(component, constants_1.ANSI_COLORS.GREEN_COLOR)}`);
|
|
43
|
+
const componentFile = resolveComponentFile(component, workspaceRoot);
|
|
44
|
+
const moduleDir = (0, previewGenerator_1.findModuleDir)(componentFile);
|
|
45
|
+
const moduleLabel = (0, previewGenerator_1.computeModuleLabel)(moduleDir, workspaceRoot);
|
|
46
|
+
const importPath = computeImportPath(componentFile, moduleDir);
|
|
47
|
+
console.log(`Module: ${(0, logUtils_1.wrapInColor)(moduleLabel, constants_1.ANSI_COLORS.BLUE_COLOR)}`);
|
|
48
|
+
console.log(`Import: ${(0, logUtils_1.wrapInColor)(importPath, constants_1.ANSI_COLORS.BLUE_COLOR)}`);
|
|
49
|
+
console.log('Parsing ViewModel...');
|
|
50
|
+
const viewModel = (0, viewModelParser_1.parseComponentFile)(componentFile);
|
|
51
|
+
const requiredProps = viewModel.props.filter(p => !p.optional);
|
|
52
|
+
console.log(`Found ${viewModel.props.length} props (${requiredProps.length} required) on ${(0, logUtils_1.wrapInColor)(viewModel.componentName, constants_1.ANSI_COLORS.GREEN_COLOR)}`);
|
|
53
|
+
const isValdi = (0, previewGenerator_1.isValdiWorkspace)(workspaceRoot);
|
|
54
|
+
(0, previewGenerator_1.generatePreviewFiles)({
|
|
55
|
+
componentFilePath: componentFile,
|
|
56
|
+
importPath,
|
|
57
|
+
moduleLabel,
|
|
58
|
+
workspaceRoot,
|
|
59
|
+
isValdiRepo: isValdi,
|
|
60
|
+
viewModel,
|
|
61
|
+
});
|
|
62
|
+
const previewDir = (0, previewGenerator_1.getPreviewDir)(workspaceRoot);
|
|
63
|
+
console.log(`Preview harness written to ${(0, logUtils_1.wrapInColor)(previewDir, constants_1.ANSI_COLORS.GRAY_COLOR)}`);
|
|
64
|
+
const target = '//apps/preview:preview_app_macos';
|
|
65
|
+
const buildFlags = constants_1.MACOS_BUILD_FLAGS.join(' ');
|
|
66
|
+
console.log(`\nBuilding and launching ${(0, logUtils_1.wrapInColor)(target, constants_1.ANSI_COLORS.GREEN_COLOR)}...`);
|
|
67
|
+
await bazel.runTarget(target, buildFlags);
|
|
68
|
+
}
|
|
69
|
+
exports.command = 'preview <component>';
|
|
70
|
+
exports.describe = 'Preview a Valdi component in a macOS window';
|
|
71
|
+
const builder = (yargs) => {
|
|
72
|
+
yargs.positional('component', {
|
|
73
|
+
describe: 'Component import path or file path\n' +
|
|
74
|
+
' e.g. widgets/src/components/button/Checkbox\n' +
|
|
75
|
+
' e.g. ./valdi_modules/widgets/src/components/button/Checkbox.tsx',
|
|
76
|
+
type: 'string',
|
|
77
|
+
demandOption: true,
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
exports.builder = builder;
|
|
81
|
+
exports.handler = (0, errorUtils_1.makeCommandHandler)(valdiPreview);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.handler = exports.builder = exports.describe = exports.command = void 0;
|
|
4
|
+
exports.command = 'profile <command>';
|
|
5
|
+
exports.describe = 'Capture a CPU profile from the Hermes JS runtime';
|
|
6
|
+
const builder = (yargs) => {
|
|
7
|
+
return yargs
|
|
8
|
+
.commandDir('profile_commands', { extensions: ['js', 'ts'] })
|
|
9
|
+
.demandCommand(1, 'Use: capture')
|
|
10
|
+
.recommendCommands()
|
|
11
|
+
.wrap(yargs.terminalWidth())
|
|
12
|
+
.help();
|
|
13
|
+
};
|
|
14
|
+
exports.builder = builder;
|
|
15
|
+
const handler = () => { };
|
|
16
|
+
exports.handler = handler;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.handler = exports.builder = exports.describe = exports.command = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const fs = tslib_1.__importStar(require("fs"));
|
|
6
|
+
const path = tslib_1.__importStar(require("path"));
|
|
7
|
+
const os = tslib_1.__importStar(require("os"));
|
|
8
|
+
const ora_1 = tslib_1.__importDefault(require("ora"));
|
|
9
|
+
const errorUtils_1 = require("../../utils/errorUtils");
|
|
10
|
+
const hermesClient_1 = require("../../utils/hermesClient");
|
|
11
|
+
const errors_1 = require("../../core/errors");
|
|
12
|
+
const cliUtils_1 = require("../../utils/cliUtils");
|
|
13
|
+
const constants_1 = require("../../core/constants");
|
|
14
|
+
const logUtils_1 = require("../../utils/logUtils");
|
|
15
|
+
async function profileCapture(argv) {
|
|
16
|
+
const duration = argv.getArgument('duration');
|
|
17
|
+
const outputOverride = argv.getArgument('output');
|
|
18
|
+
const port = argv.getArgument('port');
|
|
19
|
+
const contextOverride = argv.getArgument('context');
|
|
20
|
+
const devices = await (0, hermesClient_1.listHermesDevices)(port);
|
|
21
|
+
if (devices.length === 0) {
|
|
22
|
+
throw new errors_1.CliError('No debuggable JS contexts found. Make sure the Valdi app is running.');
|
|
23
|
+
}
|
|
24
|
+
let targetId;
|
|
25
|
+
if (contextOverride) {
|
|
26
|
+
if (!devices.some((d) => d.id === contextOverride)) {
|
|
27
|
+
throw new errors_1.CliError(`Context "${contextOverride}" not found.\n` +
|
|
28
|
+
`Available: ${devices.map((d) => d.id).join(', ')}`);
|
|
29
|
+
}
|
|
30
|
+
targetId = contextOverride;
|
|
31
|
+
}
|
|
32
|
+
else if (devices.length === 1) {
|
|
33
|
+
targetId = devices[0].id;
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
targetId = await (0, cliUtils_1.getUserChoice)(devices.map((d) => ({ name: `${d.id} ${d.title}`, value: d.id })), 'Multiple JS contexts found. Select one:');
|
|
37
|
+
}
|
|
38
|
+
const conn = await hermesClient_1.HermesConnection.connect(port, targetId);
|
|
39
|
+
try {
|
|
40
|
+
await conn.startProfiling();
|
|
41
|
+
const startMs = Date.now();
|
|
42
|
+
const spinner = (0, ora_1.default)({ stream: process.stderr });
|
|
43
|
+
await new Promise((resolve) => {
|
|
44
|
+
let timer;
|
|
45
|
+
const stop = () => {
|
|
46
|
+
if (timer)
|
|
47
|
+
clearTimeout(timer);
|
|
48
|
+
process.off('SIGINT', stop);
|
|
49
|
+
process.exitCode = 0;
|
|
50
|
+
resolve();
|
|
51
|
+
};
|
|
52
|
+
if (duration !== undefined) {
|
|
53
|
+
spinner.start(`Profiling context "${targetId}"… (${duration}s)`);
|
|
54
|
+
timer = setTimeout(stop, duration * 1000);
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
spinner.start(`Profiling context "${targetId}"… (Ctrl+C to stop)`);
|
|
58
|
+
}
|
|
59
|
+
process.once('SIGINT', stop);
|
|
60
|
+
});
|
|
61
|
+
spinner.text = 'Stopping profiler…';
|
|
62
|
+
const profile = await conn.stopProfiling();
|
|
63
|
+
spinner.stop();
|
|
64
|
+
const timestamp = new Date().toISOString().replace(/[:.]/g, '-').slice(0, 19);
|
|
65
|
+
const outPath = outputOverride
|
|
66
|
+
? path.resolve(outputOverride)
|
|
67
|
+
: path.join(os.tmpdir(), `valdi-profile-${timestamp}.cpuprofile`);
|
|
68
|
+
fs.writeFileSync(outPath, JSON.stringify(profile), 'utf8');
|
|
69
|
+
const elapsedS = ((Date.now() - startMs) / 1000).toFixed(1);
|
|
70
|
+
const sampleCount = profile.samples?.length ?? 0;
|
|
71
|
+
const sizeKb = Math.round(fs.statSync(outPath).size / 1024);
|
|
72
|
+
console.log(JSON.stringify({ path: outPath }));
|
|
73
|
+
console.error((0, logUtils_1.wrapInColor)(`Profile saved: ${outPath}`, constants_1.ANSI_COLORS.GREEN_COLOR) + '\n' +
|
|
74
|
+
` Duration: ${elapsedS}s | Samples: ${sampleCount} | Size: ${sizeKb} KB\n` +
|
|
75
|
+
` Open in: Chrome DevTools → Performance → Load | speedscope.app`);
|
|
76
|
+
}
|
|
77
|
+
finally {
|
|
78
|
+
conn.close();
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
exports.command = 'capture';
|
|
82
|
+
exports.describe = 'Capture a CPU profile from the Hermes JS runtime';
|
|
83
|
+
const builder = (yargs) => {
|
|
84
|
+
yargs
|
|
85
|
+
.option('duration', {
|
|
86
|
+
describe: 'Profile for N seconds then stop automatically (omit to stop with Ctrl+C)',
|
|
87
|
+
type: 'number',
|
|
88
|
+
alias: 'd',
|
|
89
|
+
})
|
|
90
|
+
.option('output', {
|
|
91
|
+
describe: 'Output .cpuprofile file path (default: /tmp/valdi-profile-<timestamp>.cpuprofile)',
|
|
92
|
+
type: 'string',
|
|
93
|
+
alias: 'o',
|
|
94
|
+
})
|
|
95
|
+
.option('port', {
|
|
96
|
+
describe: 'Hermes debug socket port',
|
|
97
|
+
type: 'number',
|
|
98
|
+
default: hermesClient_1.HERMES_PORT,
|
|
99
|
+
})
|
|
100
|
+
.option('context', {
|
|
101
|
+
describe: 'JS context ID to profile (from /json/list); auto-selected if only one',
|
|
102
|
+
type: 'string',
|
|
103
|
+
});
|
|
104
|
+
};
|
|
105
|
+
exports.builder = builder;
|
|
106
|
+
exports.handler = (0, errorUtils_1.makeCommandHandler)(profileCapture);
|
|
@@ -47,7 +47,7 @@ function isExternalLabel(workspaceInfo, label) {
|
|
|
47
47
|
return !!label.repo && label.repo !== workspaceInfo.workspaceName;
|
|
48
48
|
}
|
|
49
49
|
function getSymlinkedBazelExecutionRoot(workspaceInfo) {
|
|
50
|
-
return path_1.default.join(workspaceInfo.workspaceRoot, `bazel-${workspaceInfo.
|
|
50
|
+
return path_1.default.join(workspaceInfo.workspaceRoot, `bazel-${path_1.default.basename(workspaceInfo.workspaceRoot)}`);
|
|
51
51
|
}
|
|
52
52
|
function bazelLabelToAbsolutePath(workspaceInfo, label) {
|
|
53
53
|
const targetPath = label.target.slice(2);
|
|
@@ -73,17 +73,19 @@ async function syncPathsByLabel(client, workspaceInfo, pathsByLabel, projectSync
|
|
|
73
73
|
}
|
|
74
74
|
pathsByLabel.set(projectSyncOutput.target.toString(), paths);
|
|
75
75
|
}
|
|
76
|
-
const
|
|
76
|
+
const missingLabels = new Map();
|
|
77
77
|
for (const projectSyncOutput of projectSyncOutputs) {
|
|
78
78
|
for (const dependency of projectSyncOutput.dependencies) {
|
|
79
|
-
const
|
|
80
|
-
if (!pathsByLabel.has(
|
|
81
|
-
|
|
79
|
+
const key = dependency.toString();
|
|
80
|
+
if (!pathsByLabel.has(key)) {
|
|
81
|
+
missingLabels.set(key, dependency);
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
|
-
if (
|
|
86
|
-
const targets = [...
|
|
85
|
+
if (missingLabels.size > 0) {
|
|
86
|
+
const targets = [...missingLabels.values()]
|
|
87
|
+
.sort((a, b) => a.toString().localeCompare(b.toString()))
|
|
88
|
+
.map(label => `${label.toBuildableString()}_projectsync`);
|
|
87
89
|
const newProjectSyncOutputs = await buildProjectSyncs(client, workspaceInfo.workspaceRoot, targets);
|
|
88
90
|
await syncPathsByLabel(client, workspaceInfo, pathsByLabel, newProjectSyncOutputs);
|
|
89
91
|
}
|
|
@@ -58,8 +58,9 @@ async function skillsInstall(argv) {
|
|
|
58
58
|
const installSpinner = (0, ora_1.default)(`Installing ${skill.name}…`).start();
|
|
59
59
|
try {
|
|
60
60
|
const content = await (0, skillsRegistry_1.fetchSkillContent)(skill.path);
|
|
61
|
+
const resourceDir = (0, skillsRegistry_1.getSkillResourceDir)(skill.path) ?? undefined;
|
|
61
62
|
for (const adapter of adapters) {
|
|
62
|
-
adapter.install(skill.name, content, skill);
|
|
63
|
+
adapter.install(skill.name, content, skill, resourceDir);
|
|
63
64
|
}
|
|
64
65
|
installSpinner.succeed(`Installed ${(0, logUtils_1.wrapInColor)(skill.name, constants_1.ANSI_COLORS.GREEN_COLOR)}`);
|
|
65
66
|
}
|
|
@@ -68,7 +69,11 @@ async function skillsInstall(argv) {
|
|
|
68
69
|
installSpinner.fail(`Failed to install ${skill.name}: ${message}`);
|
|
69
70
|
}
|
|
70
71
|
}
|
|
72
|
+
const claudeInstalled = adapters.some((a) => a.name === 'claude');
|
|
71
73
|
console.log(`\nDone. Run ${(0, logUtils_1.wrapInColor)('valdi skills list', constants_1.ANSI_COLORS.BLUE_COLOR)} to see installed skills.`);
|
|
74
|
+
if (claudeInstalled) {
|
|
75
|
+
console.log((0, logUtils_1.wrapInColor)('Restart Claude Code to activate the new skills.', constants_1.ANSI_COLORS.YELLOW_COLOR));
|
|
76
|
+
}
|
|
72
77
|
if (!categoryFilter) {
|
|
73
78
|
console.log(`Tip: install only module-development skills with ${(0, logUtils_1.wrapInColor)('valdi skills install --category=client', constants_1.ANSI_COLORS.BLUE_COLOR)}`);
|
|
74
79
|
}
|
|
@@ -39,9 +39,10 @@ async function skillsUpdate(_argv) {
|
|
|
39
39
|
const updateSpinner = (0, ora_1.default)(`Updating ${skill.name}…`).start();
|
|
40
40
|
try {
|
|
41
41
|
const content = await (0, skillsRegistry_1.fetchSkillContent)(skill.path);
|
|
42
|
+
const resourceDir = (0, skillsRegistry_1.getSkillResourceDir)(skill.path) ?? undefined;
|
|
42
43
|
for (const adapter of adapters) {
|
|
43
44
|
if (adapter.listInstalled().includes(skill.name)) {
|
|
44
|
-
adapter.install(skill.name, content, skill);
|
|
45
|
+
adapter.install(skill.name, content, skill, resourceDir);
|
|
45
46
|
}
|
|
46
47
|
}
|
|
47
48
|
updateSpinner.succeed(`Updated ${(0, logUtils_1.wrapInColor)(skill.name, constants_1.ANSI_COLORS.GREEN_COLOR)}`);
|