@snap/valdi 1.0.7 → 1.0.11

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.
Files changed (170) hide show
  1. package/.bootstrap/modules/{ios_android_bridge_module → polyglot_bridge_module}/BUILD.bazel.template +16 -1
  2. package/.bootstrap/modules/polyglot_bridge_module/web/Calculator.ts +11 -0
  3. package/.bootstrap/modules/polyglot_bridge_module/web/tsconfig.json +16 -0
  4. package/.bootstrap/modules/polyglot_view_module/BUILD.bazel.template +75 -0
  5. package/.bootstrap/modules/polyglot_view_module/android/PolyglotNativeView.kt.template +41 -0
  6. package/.bootstrap/modules/polyglot_view_module/android/PolyglotNativeViewAttributesBinder.kt.template +17 -0
  7. package/.bootstrap/modules/polyglot_view_module/ios/SCPolyglotView.h +8 -0
  8. package/.bootstrap/modules/polyglot_view_module/ios/SCPolyglotView.m +23 -0
  9. package/.bootstrap/modules/polyglot_view_module/macos/SCPolyglotView.h +8 -0
  10. package/.bootstrap/modules/polyglot_view_module/macos/SCPolyglotView.m +23 -0
  11. package/.bootstrap/modules/polyglot_view_module/src/PolyglotCustomView.tsx.template +23 -0
  12. package/.bootstrap/modules/polyglot_view_module/web/PolyglotWeb.ts.template +30 -0
  13. package/.bootstrap/modules/polyglot_view_module/web/tsconfig.json +16 -0
  14. package/.metadata/AGENTS.md.template +8 -274
  15. package/.metadata/skill-reference.tsx.template +8 -0
  16. package/.metadata/skill-tests-BUILD.bazel.template +21 -0
  17. package/.metadata/skill-tests-README.md.template +17 -0
  18. package/.metadata/skill.md.template +27 -0
  19. package/README.md +12 -3
  20. package/bundled-skills/CONTRIBUTING_SKILLS.md +74 -0
  21. package/bundled-skills/registry.json +21 -0
  22. package/bundled-skills/skills/valdi-android/skill.md +89 -0
  23. package/bundled-skills/skills/valdi-async/skill.md +246 -0
  24. package/bundled-skills/skills/valdi-async/tests/BUILD.bazel +19 -0
  25. package/bundled-skills/skills/valdi-async/tests/README.md +25 -0
  26. package/bundled-skills/skills/valdi-async/tests/src/reference.tsx +210 -0
  27. package/bundled-skills/skills/valdi-async/tests/tsconfig.json +1 -0
  28. package/bundled-skills/skills/valdi-bazel/skill.md +141 -0
  29. package/bundled-skills/skills/valdi-compiler/skill.md +108 -0
  30. package/bundled-skills/skills/valdi-component-tests/skill.md +430 -0
  31. package/bundled-skills/skills/valdi-component-tests/tests/BUILD.bazel +24 -0
  32. package/bundled-skills/skills/valdi-component-tests/tests/README.md +35 -0
  33. package/bundled-skills/skills/valdi-component-tests/tests/src/ProfileCard.tsx +38 -0
  34. package/bundled-skills/skills/valdi-component-tests/tests/test/ProfileCardTest.spec.tsx +107 -0
  35. package/bundled-skills/skills/valdi-component-tests/tests/tsconfig.json +1 -0
  36. package/bundled-skills/skills/valdi-cpp-runtime/skill.md +103 -0
  37. package/bundled-skills/skills/valdi-custom-view/skill.md +64 -0
  38. package/bundled-skills/skills/valdi-inspect/skill.md +199 -0
  39. package/bundled-skills/skills/valdi-ios/skill.md +93 -0
  40. package/bundled-skills/skills/valdi-migrate/skill.md +175 -0
  41. package/bundled-skills/skills/valdi-migrate/tests/BUILD.bazel +23 -0
  42. package/bundled-skills/skills/valdi-migrate/tests/README.md +70 -0
  43. package/bundled-skills/skills/valdi-migrate/tests/check_antipatterns.py +89 -0
  44. package/bundled-skills/skills/valdi-migrate/tests/compose_example.kt +94 -0
  45. package/bundled-skills/skills/valdi-migrate/tests/flutter_example.dart +129 -0
  46. package/bundled-skills/skills/valdi-migrate/tests/react_example.tsx +98 -0
  47. package/bundled-skills/skills/valdi-migrate/tests/src/expected_valdi.tsx +267 -0
  48. package/bundled-skills/skills/valdi-migrate/tests/tsconfig.json +3 -0
  49. package/bundled-skills/skills/valdi-overview/skill.md +63 -0
  50. package/bundled-skills/skills/valdi-perf/skill.md +197 -0
  51. package/bundled-skills/skills/valdi-perf/tests/BUILD.bazel +19 -0
  52. package/bundled-skills/skills/valdi-perf/tests/README.md +26 -0
  53. package/bundled-skills/skills/valdi-perf/tests/src/reference.tsx +202 -0
  54. package/bundled-skills/skills/valdi-perf/tests/tsconfig.json +1 -0
  55. package/bundled-skills/skills/valdi-polyglot-module/skill.md +124 -0
  56. package/bundled-skills/skills/valdi-profile/skill.md +126 -0
  57. package/bundled-skills/skills/valdi-setup/skill.md +129 -0
  58. package/bundled-skills/skills/valdi-testing/skill.md +65 -0
  59. package/bundled-skills/skills/valdi-tsx/skill.md +385 -0
  60. package/bundled-skills/skills/valdi-tsx/tests/BUILD.bazel +19 -0
  61. package/bundled-skills/skills/valdi-tsx/tests/README.md +29 -0
  62. package/bundled-skills/skills/valdi-tsx/tests/src/reference.tsx +173 -0
  63. package/bundled-skills/skills/valdi-tsx/tests/tsconfig.json +1 -0
  64. package/dist/commands/bootstrap.js +0 -7
  65. package/dist/commands/inspect.js +16 -0
  66. package/dist/commands/inspect_commands/contexts.js +55 -0
  67. package/dist/commands/inspect_commands/devices.js +53 -0
  68. package/dist/commands/inspect_commands/heap.js +59 -0
  69. package/dist/commands/inspect_commands/select.js +43 -0
  70. package/dist/commands/inspect_commands/snapshot.js +64 -0
  71. package/dist/commands/inspect_commands/status.js +68 -0
  72. package/dist/commands/inspect_commands/tree.js +86 -0
  73. package/dist/commands/newModule.js +10 -14
  74. package/dist/commands/profile.js +16 -0
  75. package/dist/commands/profile_commands/capture.js +106 -0
  76. package/dist/commands/skills.js +16 -0
  77. package/dist/commands/skills_commands/create.js +125 -0
  78. package/dist/commands/skills_commands/install.js +96 -0
  79. package/dist/commands/skills_commands/list.js +83 -0
  80. package/dist/commands/skills_commands/remove.js +41 -0
  81. package/dist/commands/skills_commands/update.js +59 -0
  82. package/dist/core/constants.js +0 -1
  83. package/dist/core/packageFiles.spec.js +29 -0
  84. package/dist/setup/versions.js +1 -1
  85. package/dist/utils/daemonClient.js +342 -0
  86. package/dist/utils/hermesClient.js +252 -0
  87. package/dist/utils/skillsAdapters.js +140 -0
  88. package/dist/utils/skillsRegistry.js +40 -0
  89. package/dist/utils/stringUtils.spec.js +1 -1
  90. package/package.json +20 -5
  91. package/.bazelignore +0 -2
  92. package/.bootstrap/modules/cpp_bridge_module/BUILD.bazel.template +0 -21
  93. package/.bootstrap/modules/cpp_bridge_module/cpp/CalculatorModuleFactory.cpp.template +0 -28
  94. package/.bootstrap/modules/ios_android_bridge_module/src/Calculator.d.ts +0 -4
  95. package/.bootstrap/modules/ios_android_view_module/BUILD.bazel.template +0 -41
  96. package/.bootstrap/modules/ios_android_view_module/android/CircleView.kt.template +0 -42
  97. package/.bootstrap/modules/ios_android_view_module/android/CircleViewAttributesBinder.kt.template +0 -60
  98. package/.bootstrap/modules/ios_android_view_module/ios/SCCCircleView.h +0 -6
  99. package/.bootstrap/modules/ios_android_view_module/ios/SCCCircleView.m +0 -82
  100. package/.bootstrap/modules/ios_android_view_module/src/Circle.tsx.template +0 -15
  101. package/.config/copyconfig.json +0 -10
  102. package/.editorconfig +0 -21
  103. package/.eslintignore +0 -1
  104. package/.eslintrc.js +0 -72
  105. package/.github/README.md +0 -164
  106. package/.metadata/.cursorrules.template +0 -60
  107. package/.prettierignore +0 -2
  108. package/.prettierrc.json +0 -7
  109. package/LINUX_COMPATIBILITY.md +0 -248
  110. package/prettier.config.js +0 -4
  111. package/scripts/sync-agents-md.sh +0 -44
  112. package/scripts/update-agents-templates.ts +0 -170
  113. package/spec/support/jasmine.json +0 -6
  114. package/src/commands/bootstrap.ts +0 -410
  115. package/src/commands/build.ts +0 -89
  116. package/src/commands/devSetup.ts +0 -17
  117. package/src/commands/doctor.ts +0 -1832
  118. package/src/commands/export.ts +0 -131
  119. package/src/commands/hotreload.ts +0 -108
  120. package/src/commands/install.ts +0 -93
  121. package/src/commands/lint.ts +0 -15
  122. package/src/commands/lint_commands/lintCheck.ts +0 -53
  123. package/src/commands/lint_commands/lintFormat.ts +0 -49
  124. package/src/commands/log.ts +0 -108
  125. package/src/commands/newModule.ts +0 -286
  126. package/src/commands/package.ts +0 -102
  127. package/src/commands/projectsync.ts +0 -488
  128. package/src/commands/test.ts +0 -68
  129. package/src/core/constants.ts +0 -98
  130. package/src/core/errors.ts +0 -10
  131. package/src/index.ts +0 -27
  132. package/src/setup/DevSetupHelper.ts +0 -290
  133. package/src/setup/linuxSetup.ts +0 -261
  134. package/src/setup/macOSSetup.ts +0 -156
  135. package/src/setup/setupEntryPoint.ts +0 -64
  136. package/src/setup/versions.ts +0 -8
  137. package/src/utils/ArgumentsResolver.ts +0 -23
  138. package/src/utils/BazelClient.ts +0 -285
  139. package/src/utils/Digraph.ts +0 -81
  140. package/src/utils/LoadingIndicator.ts +0 -43
  141. package/src/utils/applicationUtils.ts +0 -276
  142. package/src/utils/buildInfo.ts +0 -99
  143. package/src/utils/byString.ts +0 -3
  144. package/src/utils/cliUtils.ts +0 -112
  145. package/src/utils/copyBootstrapFiles.ts +0 -30
  146. package/src/utils/deviceUtils.ts +0 -76
  147. package/src/utils/errorUtils.ts +0 -63
  148. package/src/utils/fileUtils.ts +0 -257
  149. package/src/utils/githubUtils.ts +0 -102
  150. package/src/utils/jsonUtils.ts +0 -30
  151. package/src/utils/lintUtils.ts +0 -190
  152. package/src/utils/linuxDistro.spec.ts +0 -219
  153. package/src/utils/linuxDistro.ts +0 -326
  154. package/src/utils/logUtils.ts +0 -9
  155. package/src/utils/pathUtils.ts +0 -12
  156. package/src/utils/stringUtils.spec.ts +0 -95
  157. package/src/utils/stringUtils.ts +0 -103
  158. package/src/utils/tempDir.ts +0 -24
  159. package/src/utils/zipUtils.ts +0 -14
  160. package/test/ValdiSmokeTest.ts +0 -279
  161. package/test/helpers/AsyncHelpers.ts +0 -113
  162. package/test/helpers/CommandHelpers.ts +0 -37
  163. package/test/helpers/ProjectHelpers.ts +0 -153
  164. package/test/helpers/StreamHelpers.ts +0 -37
  165. package/test/helpers/TypeScriptClient.ts +0 -217
  166. package/tsconfig.dist.json +0 -8
  167. package/tsconfig.json +0 -42
  168. /package/.bootstrap/modules/{ios_android_bridge_module → polyglot_bridge_module}/android/CalculatorModuleFactory.kt.template +0 -0
  169. /package/.bootstrap/modules/{ios_android_bridge_module → polyglot_bridge_module}/ios/SCCCalculatorModuleFactory.m.template +0 -0
  170. /package/.bootstrap/modules/{cpp_bridge_module → polyglot_bridge_module}/src/Calculator.d.ts +0 -0
@@ -0,0 +1,125 @@
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 inquirer_1 = tslib_1.__importDefault(require("inquirer"));
8
+ const errorUtils_1 = require("../../utils/errorUtils");
9
+ const constants_1 = require("../../core/constants");
10
+ const logUtils_1 = require("../../utils/logUtils");
11
+ function loadTemplate(filename, replacements) {
12
+ const raw = fs.readFileSync(path.join(constants_1.META_DIR_PATH, filename), 'utf8');
13
+ return Object.entries(replacements).reduce((content, [key, value]) => content.replaceAll(key, value), raw);
14
+ }
15
+ function toIosModuleName(skillName) {
16
+ const pascal = skillName
17
+ .split('-')
18
+ .map((w) => w.charAt(0).toUpperCase() + w.slice(1))
19
+ .join('');
20
+ return `SCCValdi${pascal}Ref`;
21
+ }
22
+ function findValdiRoot(dir) {
23
+ let current = path.resolve(dir);
24
+ while (true) {
25
+ if (fs.existsSync(path.join(current, 'ai-skills', 'registry.json'))) {
26
+ return current;
27
+ }
28
+ const parent = path.dirname(current);
29
+ if (parent === current)
30
+ return null;
31
+ current = parent;
32
+ }
33
+ }
34
+ async function skillsCreate(_argv) {
35
+ const valdiRoot = findValdiRoot(process.cwd());
36
+ if (valdiRoot == null) {
37
+ console.log((0, logUtils_1.wrapInColor)('Not inside a Valdi framework checkout. Run this command from within the Valdi repo.', constants_1.ANSI_COLORS.RED_COLOR));
38
+ console.log('Expected to find ai-skills/registry.json in the current directory or a parent.');
39
+ return;
40
+ }
41
+ const skillsDir = path.join(valdiRoot, 'ai-skills', 'skills');
42
+ const registryPath = path.join(valdiRoot, 'ai-skills', 'registry.json');
43
+ console.log((0, logUtils_1.wrapInColor)(`Valdi root: ${valdiRoot}\n`, constants_1.ANSI_COLORS.GRAY_COLOR));
44
+ console.log((0, logUtils_1.wrapInColor)('Create a new Valdi skill\n', constants_1.ANSI_COLORS.BLUE_COLOR));
45
+ const answers = await inquirer_1.default.prompt([
46
+ {
47
+ type: 'input',
48
+ name: 'name',
49
+ message: 'Skill name (e.g. valdi-animations):',
50
+ validate: (input) => {
51
+ if (!input.trim())
52
+ return 'Name is required';
53
+ if (!/^[\w-]+$/u.test(input.trim()))
54
+ return 'Name must be alphanumeric with hyphens only';
55
+ const existing = fs.existsSync(path.join(skillsDir, input.trim()));
56
+ if (existing)
57
+ return `Skill "${input.trim()}" already exists`;
58
+ return true;
59
+ },
60
+ filter: (input) => input.trim(),
61
+ },
62
+ {
63
+ type: 'input',
64
+ name: 'description',
65
+ message: 'Short description (one sentence):',
66
+ validate: (input) => (input.trim() ? true : 'Description is required'),
67
+ filter: (input) => input.trim(),
68
+ },
69
+ {
70
+ type: 'checkbox',
71
+ name: 'category',
72
+ message: 'Category (select all that apply):',
73
+ choices: [
74
+ { name: 'client — creating / updating / testing Valdi modules', value: 'client', checked: true },
75
+ { name: 'framework — working on the Valdi repo itself', value: 'framework' },
76
+ ],
77
+ validate: (input) => (input.length > 0 ? true : 'Select at least one category'),
78
+ },
79
+ {
80
+ type: 'input',
81
+ name: 'tags',
82
+ message: 'Tags (comma-separated, e.g. tsx,components):',
83
+ filter: (input) => input
84
+ .split(',')
85
+ .map((t) => t.trim())
86
+ .filter(Boolean)
87
+ .join(','),
88
+ },
89
+ ]);
90
+ const { name, description, category, tags } = answers;
91
+ const tagList = tags ? tags.split(',') : [];
92
+ const skillDir = path.join(skillsDir, name);
93
+ const skillFile = path.join(skillDir, 'skill.md');
94
+ const skillPath = `skills/${name}/skill.md`;
95
+ const testsDir = path.join(skillDir, 'tests');
96
+ const testsSrcDir = path.join(testsDir, 'src');
97
+ fs.mkdirSync(skillDir, { recursive: true });
98
+ fs.writeFileSync(skillFile, loadTemplate('skill.md.template', { SKILL_NAME: name, SKILL_DESCRIPTION: description }), 'utf8');
99
+ fs.mkdirSync(testsSrcDir, { recursive: true });
100
+ fs.writeFileSync(path.join(testsSrcDir, 'reference.tsx'), loadTemplate('skill-reference.tsx.template', { SKILL_NAME: name }), 'utf8');
101
+ fs.writeFileSync(path.join(testsDir, 'BUILD.bazel'), loadTemplate('skill-tests-BUILD.bazel.template', {
102
+ SKILL_NAME: name,
103
+ SKILL_IOS_MODULE_NAME: toIosModuleName(name),
104
+ }), 'utf8');
105
+ fs.writeFileSync(path.join(testsDir, 'tsconfig.json'), '{"extends": "../../../../src/valdi_modules/src/valdi/_configs/base.tsconfig.json"}\n', 'utf8');
106
+ fs.writeFileSync(path.join(testsDir, 'README.md'), loadTemplate('skill-tests-README.md.template', { SKILL_NAME: name }), 'utf8');
107
+ const registry = JSON.parse(fs.readFileSync(registryPath, 'utf8'));
108
+ const entry = { name, description, tags: tagList, path: skillPath, category };
109
+ registry.skills.push(entry);
110
+ fs.writeFileSync(registryPath, JSON.stringify(registry, null, 2) + '\n', 'utf8');
111
+ console.log(`\n${(0, logUtils_1.wrapInColor)('Created:', constants_1.ANSI_COLORS.GREEN_COLOR)} ${skillFile}`);
112
+ console.log(`${(0, logUtils_1.wrapInColor)('Created:', constants_1.ANSI_COLORS.GREEN_COLOR)} ${testsDir}/`);
113
+ console.log(`${(0, logUtils_1.wrapInColor)('Registered:', constants_1.ANSI_COLORS.GREEN_COLOR)} ${registryPath}`);
114
+ console.log(`\nNext steps:`);
115
+ console.log(` 1. Edit ${(0, logUtils_1.wrapInColor)(skillFile, constants_1.ANSI_COLORS.BLUE_COLOR)} — fill in the skill content`);
116
+ console.log(` 2. Edit ${(0, logUtils_1.wrapInColor)(path.join(testsDir, 'src', 'reference.tsx'), constants_1.ANSI_COLORS.BLUE_COLOR)} — add compile-check examples`);
117
+ console.log(` 3. Run ${(0, logUtils_1.wrapInColor)(`bazel build //ai-skills/skills/${name}/tests:tests`, constants_1.ANSI_COLORS.BLUE_COLOR)} to verify the reference compiles`);
118
+ console.log(` 4. Run ${(0, logUtils_1.wrapInColor)('valdi skills install', constants_1.ANSI_COLORS.BLUE_COLOR)} to test the skill locally`);
119
+ console.log(` 5. Open a PR against the Valdi repo to share it with the community`);
120
+ }
121
+ exports.command = 'create';
122
+ exports.describe = 'Scaffold a new skill in the Valdi framework checkout';
123
+ const builder = (_yargs) => { };
124
+ exports.builder = builder;
125
+ exports.handler = (0, errorUtils_1.makeCommandHandler)(skillsCreate);
@@ -0,0 +1,96 @@
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 ora_1 = tslib_1.__importDefault(require("ora"));
6
+ const errorUtils_1 = require("../../utils/errorUtils");
7
+ const skillsRegistry_1 = require("../../utils/skillsRegistry");
8
+ const skillsAdapters_1 = require("../../utils/skillsAdapters");
9
+ const constants_1 = require("../../core/constants");
10
+ const logUtils_1 = require("../../utils/logUtils");
11
+ async function skillsInstall(argv) {
12
+ const skillName = argv.getArgument('name');
13
+ const forAgent = argv.getArgument('for');
14
+ const categoryFilter = argv.getArgument('category');
15
+ let registry;
16
+ try {
17
+ registry = await (0, skillsRegistry_1.fetchRegistry)();
18
+ }
19
+ catch (error) {
20
+ console.log((0, logUtils_1.wrapInColor)(`Could not load skills: ${error instanceof Error ? error.message : String(error)}`, constants_1.ANSI_COLORS.RED_COLOR));
21
+ return;
22
+ }
23
+ let skillsToInstall = skillName
24
+ ? registry.skills.filter((s) => s.name === skillName)
25
+ : registry.skills;
26
+ if (skillName && skillsToInstall.length === 0) {
27
+ console.log((0, logUtils_1.wrapInColor)(`Skill "${skillName}" not found in registry.`, constants_1.ANSI_COLORS.RED_COLOR));
28
+ console.log(`Run ${(0, logUtils_1.wrapInColor)('valdi skills list', constants_1.ANSI_COLORS.BLUE_COLOR)} to see available skills.`);
29
+ return;
30
+ }
31
+ if (categoryFilter) {
32
+ skillsToInstall = skillsToInstall.filter((s) => s.category.includes(categoryFilter));
33
+ if (skillsToInstall.length === 0) {
34
+ console.log((0, logUtils_1.wrapInColor)(`No skills found for category "${categoryFilter}".`, constants_1.ANSI_COLORS.YELLOW_COLOR));
35
+ return;
36
+ }
37
+ }
38
+ let adapters = (0, skillsAdapters_1.detectAdapters)().filter((a) => a.name !== 'generic');
39
+ if (forAgent) {
40
+ if (forAgent === 'all') {
41
+ }
42
+ else {
43
+ const specific = (0, skillsAdapters_1.getAdapterByName)(forAgent);
44
+ if (!specific) {
45
+ console.log((0, logUtils_1.wrapInColor)(`Unknown agent "${forAgent}". Valid options: claude, cursor, copilot, all`, constants_1.ANSI_COLORS.RED_COLOR));
46
+ return;
47
+ }
48
+ adapters = [specific];
49
+ }
50
+ }
51
+ if (adapters.length === 0) {
52
+ console.log((0, logUtils_1.wrapInColor)('No supported AI agents detected.', constants_1.ANSI_COLORS.YELLOW_COLOR));
53
+ console.log('Use --for=claude, --for=cursor, or --for=copilot to install for a specific agent.');
54
+ return;
55
+ }
56
+ console.log(`Installing ${(0, logUtils_1.wrapInColor)(String(skillsToInstall.length), constants_1.ANSI_COLORS.GREEN_COLOR)} skill(s) for: ${(0, logUtils_1.wrapInColor)(adapters.map((a) => a.name).join(', '), constants_1.ANSI_COLORS.BLUE_COLOR)}\n`);
57
+ for (const skill of skillsToInstall) {
58
+ const installSpinner = (0, ora_1.default)(`Installing ${skill.name}…`).start();
59
+ try {
60
+ const content = await (0, skillsRegistry_1.fetchSkillContent)(skill.path);
61
+ for (const adapter of adapters) {
62
+ adapter.install(skill.name, content, skill);
63
+ }
64
+ installSpinner.succeed(`Installed ${(0, logUtils_1.wrapInColor)(skill.name, constants_1.ANSI_COLORS.GREEN_COLOR)}`);
65
+ }
66
+ catch (error) {
67
+ const message = error instanceof Error ? error.message : String(error);
68
+ installSpinner.fail(`Failed to install ${skill.name}: ${message}`);
69
+ }
70
+ }
71
+ console.log(`\nDone. Run ${(0, logUtils_1.wrapInColor)('valdi skills list', constants_1.ANSI_COLORS.BLUE_COLOR)} to see installed skills.`);
72
+ if (!categoryFilter) {
73
+ 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
+ }
75
+ }
76
+ exports.command = 'install [name]';
77
+ exports.describe = 'Install skills for detected AI agents (--category=framework|client to filter)';
78
+ const builder = (yargs) => {
79
+ yargs
80
+ .positional('name', {
81
+ describe: 'Skill name to install (omit to install all)',
82
+ type: 'string',
83
+ })
84
+ .option('for', {
85
+ describe: 'Target agent to install for',
86
+ type: 'string',
87
+ choices: ['claude', 'cursor', 'copilot', 'all'],
88
+ })
89
+ .option('category', {
90
+ describe: 'Only install skills in this category',
91
+ type: 'string',
92
+ choices: ['framework', 'client'],
93
+ });
94
+ };
95
+ exports.builder = builder;
96
+ exports.handler = (0, errorUtils_1.makeCommandHandler)(skillsInstall);
@@ -0,0 +1,83 @@
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 skillsRegistry_1 = require("../../utils/skillsRegistry");
6
+ const skillsAdapters_1 = require("../../utils/skillsAdapters");
7
+ const constants_1 = require("../../core/constants");
8
+ const logUtils_1 = require("../../utils/logUtils");
9
+ async function skillsList(argv) {
10
+ const categoryFilter = argv.getArgument('category');
11
+ let registry;
12
+ try {
13
+ registry = await (0, skillsRegistry_1.fetchRegistry)();
14
+ }
15
+ catch (error) {
16
+ console.log((0, logUtils_1.wrapInColor)(`Could not load skills: ${error instanceof Error ? error.message : String(error)}`, constants_1.ANSI_COLORS.RED_COLOR));
17
+ return;
18
+ }
19
+ const adapters = (0, skillsAdapters_1.detectAdapters)();
20
+ const adapterNames = adapters.map((a) => a.name);
21
+ const installedByAdapter = new Map();
22
+ for (const adapter of adapters) {
23
+ installedByAdapter.set(adapter.name, new Set(adapter.listInstalled()));
24
+ }
25
+ const skills = categoryFilter
26
+ ? registry.skills.filter((s) => s.category.includes(categoryFilter))
27
+ : registry.skills;
28
+ if (categoryFilter && skills.length === 0) {
29
+ console.log((0, logUtils_1.wrapInColor)(`No skills found for category "${categoryFilter}".`, constants_1.ANSI_COLORS.YELLOW_COLOR));
30
+ return;
31
+ }
32
+ const nameWidth = 28;
33
+ const catWidth = 18;
34
+ const descWidth = 44;
35
+ const colWidth = 8;
36
+ const headerParts = [
37
+ 'NAME'.padEnd(nameWidth),
38
+ 'CATEGORY'.padEnd(catWidth),
39
+ 'DESCRIPTION'.padEnd(descWidth),
40
+ ...adapterNames.map((n) => n.toUpperCase().padEnd(colWidth)),
41
+ ];
42
+ console.log((0, logUtils_1.wrapInColor)(headerParts.join(' '), constants_1.ANSI_COLORS.GRAY_COLOR));
43
+ console.log((0, logUtils_1.wrapInColor)('-'.repeat(nameWidth + catWidth + descWidth + adapterNames.length * (colWidth + 2) + 4), constants_1.ANSI_COLORS.GRAY_COLOR));
44
+ const categories = [...new Set(skills.flatMap((s) => s.category))];
45
+ for (const cat of categories) {
46
+ const group = skills.filter((s) => s.category.includes(cat));
47
+ if (categories.length > 1) {
48
+ console.log((0, logUtils_1.wrapInColor)(`\n[${cat}]`, constants_1.ANSI_COLORS.BLUE_COLOR));
49
+ }
50
+ for (const skill of group) {
51
+ const name = skill.name.padEnd(nameWidth);
52
+ const category = skill.category.join(', ').padEnd(catWidth);
53
+ const desc = skill.description.length > descWidth - 1
54
+ ? skill.description.slice(0, descWidth - 1) + '…'
55
+ : skill.description.padEnd(descWidth);
56
+ const statusCols = adapterNames.map((adapterName) => {
57
+ const installed = installedByAdapter.get(adapterName)?.has(skill.name) ?? false;
58
+ const mark = installed
59
+ ? (0, logUtils_1.wrapInColor)('✓', constants_1.ANSI_COLORS.GREEN_COLOR)
60
+ : (0, logUtils_1.wrapInColor)('-', constants_1.ANSI_COLORS.GRAY_COLOR);
61
+ return mark.padEnd(colWidth);
62
+ });
63
+ console.log([name, category, desc, ...statusCols].join(' '));
64
+ }
65
+ }
66
+ console.log(`\n${(0, logUtils_1.wrapInColor)(`${skills.length} skill(s) available`, constants_1.ANSI_COLORS.GRAY_COLOR)}` +
67
+ ` Detected agents: ${(0, logUtils_1.wrapInColor)(adapterNames.join(', '), constants_1.ANSI_COLORS.GREEN_COLOR)}`);
68
+ console.log(`\nInstall a skill: ${(0, logUtils_1.wrapInColor)('valdi skills install <name>', constants_1.ANSI_COLORS.BLUE_COLOR)}`);
69
+ if (!categoryFilter) {
70
+ console.log(`Filter by category: ${(0, logUtils_1.wrapInColor)('valdi skills list --category=framework', constants_1.ANSI_COLORS.BLUE_COLOR)}`);
71
+ }
72
+ }
73
+ exports.command = 'list';
74
+ exports.describe = 'List available skills and their installation status';
75
+ const builder = (yargs) => {
76
+ yargs.option('category', {
77
+ describe: 'Filter by category (framework, client)',
78
+ type: 'string',
79
+ choices: ['framework', 'client'],
80
+ });
81
+ };
82
+ exports.builder = builder;
83
+ exports.handler = (0, errorUtils_1.makeCommandHandler)(skillsList);
@@ -0,0 +1,41 @@
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 skillsAdapters_1 = require("../../utils/skillsAdapters");
6
+ const constants_1 = require("../../core/constants");
7
+ const logUtils_1 = require("../../utils/logUtils");
8
+ async function skillsRemove(argv) {
9
+ const skillName = argv.getArgument('name');
10
+ const adapters = (0, skillsAdapters_1.detectAdapters)();
11
+ let removedFromAny = false;
12
+ for (const adapter of adapters) {
13
+ const installed = adapter.listInstalled();
14
+ if (installed.includes(skillName)) {
15
+ try {
16
+ adapter.remove(skillName);
17
+ console.log(`Removed ${(0, logUtils_1.wrapInColor)(skillName, constants_1.ANSI_COLORS.GREEN_COLOR)} from ${(0, logUtils_1.wrapInColor)(adapter.name, constants_1.ANSI_COLORS.BLUE_COLOR)}`);
18
+ removedFromAny = true;
19
+ }
20
+ catch (error) {
21
+ const message = error instanceof Error ? error.message : String(error);
22
+ console.log((0, logUtils_1.wrapInColor)(`Failed to remove ${skillName} from ${adapter.name}: ${message}`, constants_1.ANSI_COLORS.RED_COLOR));
23
+ }
24
+ }
25
+ }
26
+ if (!removedFromAny) {
27
+ console.log((0, logUtils_1.wrapInColor)(`Skill "${skillName}" is not installed for any detected agent.`, constants_1.ANSI_COLORS.YELLOW_COLOR));
28
+ console.log(`Run ${(0, logUtils_1.wrapInColor)('valdi skills list', constants_1.ANSI_COLORS.BLUE_COLOR)} to see installed skills.`);
29
+ }
30
+ }
31
+ exports.command = 'remove <name>';
32
+ exports.describe = 'Remove a skill from all detected AI agents';
33
+ const builder = (yargs) => {
34
+ yargs.positional('name', {
35
+ describe: 'Name of the skill to remove',
36
+ type: 'string',
37
+ demandOption: true,
38
+ });
39
+ };
40
+ exports.builder = builder;
41
+ exports.handler = (0, errorUtils_1.makeCommandHandler)(skillsRemove);
@@ -0,0 +1,59 @@
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 ora_1 = tslib_1.__importDefault(require("ora"));
6
+ const errorUtils_1 = require("../../utils/errorUtils");
7
+ const skillsRegistry_1 = require("../../utils/skillsRegistry");
8
+ const skillsAdapters_1 = require("../../utils/skillsAdapters");
9
+ const constants_1 = require("../../core/constants");
10
+ const logUtils_1 = require("../../utils/logUtils");
11
+ async function skillsUpdate(_argv) {
12
+ const adapters = (0, skillsAdapters_1.detectAdapters)().filter((a) => a.name !== 'generic');
13
+ if (adapters.length === 0) {
14
+ console.log((0, logUtils_1.wrapInColor)('No supported AI agents detected. Nothing to update.', constants_1.ANSI_COLORS.YELLOW_COLOR));
15
+ return;
16
+ }
17
+ let registry;
18
+ try {
19
+ registry = await (0, skillsRegistry_1.fetchRegistry)();
20
+ }
21
+ catch (error) {
22
+ console.log((0, logUtils_1.wrapInColor)(`Could not load skills: ${error instanceof Error ? error.message : String(error)}`, constants_1.ANSI_COLORS.RED_COLOR));
23
+ return;
24
+ }
25
+ const installedSkillNames = new Set();
26
+ for (const adapter of adapters) {
27
+ for (const skillName of adapter.listInstalled()) {
28
+ installedSkillNames.add(skillName);
29
+ }
30
+ }
31
+ const skillsToUpdate = registry.skills.filter((s) => installedSkillNames.has(s.name));
32
+ if (skillsToUpdate.length === 0) {
33
+ console.log('No installed skills found to update.');
34
+ console.log(`Run ${(0, logUtils_1.wrapInColor)('valdi skills install', constants_1.ANSI_COLORS.BLUE_COLOR)} to install skills.`);
35
+ return;
36
+ }
37
+ console.log(`\nUpdating ${(0, logUtils_1.wrapInColor)(String(skillsToUpdate.length), constants_1.ANSI_COLORS.GREEN_COLOR)} installed skill(s) for: ${(0, logUtils_1.wrapInColor)(adapters.map((a) => a.name).join(', '), constants_1.ANSI_COLORS.BLUE_COLOR)}\n`);
38
+ for (const skill of skillsToUpdate) {
39
+ const updateSpinner = (0, ora_1.default)(`Updating ${skill.name}…`).start();
40
+ try {
41
+ const content = await (0, skillsRegistry_1.fetchSkillContent)(skill.path);
42
+ for (const adapter of adapters) {
43
+ if (adapter.listInstalled().includes(skill.name)) {
44
+ adapter.install(skill.name, content, skill);
45
+ }
46
+ }
47
+ updateSpinner.succeed(`Updated ${(0, logUtils_1.wrapInColor)(skill.name, constants_1.ANSI_COLORS.GREEN_COLOR)}`);
48
+ }
49
+ catch (error) {
50
+ updateSpinner.fail(`Failed to update ${skill.name}: ${error instanceof Error ? error.message : String(error)}`);
51
+ }
52
+ }
53
+ console.log(`\nAll installed skills updated.`);
54
+ }
55
+ exports.command = 'update';
56
+ exports.describe = 'Re-install all currently installed skills from the bundled package';
57
+ const builder = (_yargs) => { };
58
+ exports.builder = builder;
59
+ exports.handler = (0, errorUtils_1.makeCommandHandler)(skillsUpdate);
@@ -42,7 +42,6 @@ var TEMPLATE_BASE_PATHS;
42
42
  TEMPLATE_BASE_PATHS["WATCHMAN_CONFIG"] = ".watchmanconfig.template";
43
43
  TEMPLATE_BASE_PATHS["GIT_IGNORE"] = ".gitignore.template";
44
44
  TEMPLATE_BASE_PATHS["EDITOR_CONFIG"] = ".editorconfig.template";
45
- TEMPLATE_BASE_PATHS["CURSOR_RULES"] = ".cursorrules.template";
46
45
  TEMPLATE_BASE_PATHS["AGENTS"] = "AGENTS.md.template";
47
46
  })(TEMPLATE_BASE_PATHS || (exports.TEMPLATE_BASE_PATHS = TEMPLATE_BASE_PATHS = {}));
48
47
  exports.VALID_PLATFORMS = [PLATFORM.ANDROID, PLATFORM.IOS, PLATFORM.MACOS, PLATFORM.CLI];
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ require("jasmine");
5
+ const child_process_1 = require("child_process");
6
+ const path_1 = tslib_1.__importDefault(require("path"));
7
+ describe('npm package contents', () => {
8
+ let packedFiles;
9
+ beforeAll(() => {
10
+ const cliRoot = path_1.default.join(__dirname, '../..');
11
+ packedFiles = (0, child_process_1.execSync)('npm pack --dry-run 2>&1', {
12
+ cwd: cliRoot,
13
+ encoding: 'utf-8',
14
+ });
15
+ });
16
+ it('includes .metadata templates for bootstrap config', () => {
17
+ expect(packedFiles).toContain('.metadata/config.yaml.template');
18
+ expect(packedFiles).toContain('.metadata/WORKSPACE.template');
19
+ });
20
+ it('includes .bootstrap templates for project scaffolding', () => {
21
+ expect(packedFiles).toContain('.bootstrap/');
22
+ });
23
+ it('includes dist output', () => {
24
+ expect(packedFiles).toContain('dist/');
25
+ });
26
+ it('includes bundled-skills', () => {
27
+ expect(packedFiles).toContain('bundled-skills/');
28
+ });
29
+ });
@@ -3,6 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ANDROID_LINUX_COMMANDLINE_TOOLS = exports.ANDROID_MACOS_COMMANDLINE_TOOLS = exports.ANDROID_PLATFORM_VERSION = exports.ANDROID_NDK_VERSION = exports.ANDROID_BUILD_TOOLS_VERSION = void 0;
4
4
  exports.ANDROID_BUILD_TOOLS_VERSION = '34.0.0';
5
5
  exports.ANDROID_NDK_VERSION = '25.2.9519653';
6
- exports.ANDROID_PLATFORM_VERSION = 'android-35';
6
+ exports.ANDROID_PLATFORM_VERSION = 'android-36';
7
7
  exports.ANDROID_MACOS_COMMANDLINE_TOOLS = 'https://dl.google.com/android/repository/commandlinetools-mac-13114758_latest.zip';
8
8
  exports.ANDROID_LINUX_COMMANDLINE_TOOLS = 'https://dl.google.com/android/repository/commandlinetools-linux-13114758_latest.zip';