skill-universe 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -0
- package/bin/skillc.mjs +3 -0
- package/build/dev/javascript/argv/_gleam_artefacts/argv.cache +0 -0
- package/build/dev/javascript/argv/_gleam_artefacts/argv.cache_inline +0 -0
- package/build/dev/javascript/argv/_gleam_artefacts/argv.cache_meta +0 -0
- package/build/dev/javascript/argv/argv.erl +12 -0
- package/build/dev/javascript/argv/argv.mjs +31 -0
- package/build/dev/javascript/argv/argv_ffi.erl +27 -0
- package/build/dev/javascript/argv/argv_ffi.mjs +20 -0
- package/build/dev/javascript/argv/gleam.mjs +1 -0
- package/build/dev/javascript/filepath/_gleam_artefacts/filepath.cache +0 -0
- package/build/dev/javascript/filepath/_gleam_artefacts/filepath.cache_inline +0 -0
- package/build/dev/javascript/filepath/_gleam_artefacts/filepath.cache_meta +0 -0
- package/build/dev/javascript/filepath/filepath.erl +425 -0
- package/build/dev/javascript/filepath/filepath.mjs +529 -0
- package/build/dev/javascript/filepath/filepath_ffi.erl +9 -0
- package/build/dev/javascript/filepath/filepath_ffi.mjs +6 -0
- package/build/dev/javascript/filepath/gleam.mjs +1 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bit_array.cache +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bit_array.cache_inline +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bit_array.cache_meta +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bool.cache +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bool.cache_inline +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bool.cache_meta +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bytes_tree.cache +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bytes_tree.cache_inline +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bytes_tree.cache_meta +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dict.cache +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dict.cache_inline +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dict.cache_meta +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dynamic.cache +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dynamic.cache_inline +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dynamic.cache_meta +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dynamic@decode.cache +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dynamic@decode.cache_inline +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dynamic@decode.cache_meta +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@float.cache +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@float.cache_inline +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@float.cache_meta +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@function.cache +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@function.cache_inline +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@function.cache_meta +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@int.cache +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@int.cache_inline +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@int.cache_meta +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@io.cache +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@io.cache_inline +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@io.cache_meta +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@list.cache +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@list.cache_inline +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@list.cache_meta +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@option.cache +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@option.cache_inline +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@option.cache_meta +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@order.cache +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@order.cache_inline +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@order.cache_meta +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@pair.cache +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@pair.cache_inline +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@pair.cache_meta +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@result.cache +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@result.cache_inline +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@result.cache_meta +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@set.cache +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@set.cache_inline +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@set.cache_meta +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string.cache +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string.cache_inline +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string.cache_meta +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string_tree.cache +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string_tree.cache_inline +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string_tree.cache_meta +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@uri.cache +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@uri.cache_inline +0 -0
- package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@uri.cache_meta +0 -0
- package/build/dev/javascript/gleam_stdlib/dict.mjs +710 -0
- package/build/dev/javascript/gleam_stdlib/gleam/bit_array.mjs +285 -0
- package/build/dev/javascript/gleam_stdlib/gleam/bool.mjs +313 -0
- package/build/dev/javascript/gleam_stdlib/gleam/bytes_tree.mjs +225 -0
- package/build/dev/javascript/gleam_stdlib/gleam/dict.mjs +456 -0
- package/build/dev/javascript/gleam_stdlib/gleam/dynamic/decode.mjs +985 -0
- package/build/dev/javascript/gleam_stdlib/gleam/dynamic.mjs +35 -0
- package/build/dev/javascript/gleam_stdlib/gleam/float.mjs +572 -0
- package/build/dev/javascript/gleam_stdlib/gleam/function.mjs +6 -0
- package/build/dev/javascript/gleam_stdlib/gleam/int.mjs +832 -0
- package/build/dev/javascript/gleam_stdlib/gleam/io.mjs +8 -0
- package/build/dev/javascript/gleam_stdlib/gleam/list.mjs +3160 -0
- package/build/dev/javascript/gleam_stdlib/gleam/option.mjs +418 -0
- package/build/dev/javascript/gleam_stdlib/gleam/order.mjs +178 -0
- package/build/dev/javascript/gleam_stdlib/gleam/pair.mjs +102 -0
- package/build/dev/javascript/gleam_stdlib/gleam/result.mjs +480 -0
- package/build/dev/javascript/gleam_stdlib/gleam/set.mjs +416 -0
- package/build/dev/javascript/gleam_stdlib/gleam/string.mjs +723 -0
- package/build/dev/javascript/gleam_stdlib/gleam/string_tree.mjs +133 -0
- package/build/dev/javascript/gleam_stdlib/gleam/uri.mjs +1155 -0
- package/build/dev/javascript/gleam_stdlib/gleam.mjs +1 -0
- package/build/dev/javascript/gleam_stdlib/gleam@bit_array.erl +347 -0
- package/build/dev/javascript/gleam_stdlib/gleam@bool.erl +352 -0
- package/build/dev/javascript/gleam_stdlib/gleam@bytes_tree.erl +211 -0
- package/build/dev/javascript/gleam_stdlib/gleam@dict.erl +521 -0
- package/build/dev/javascript/gleam_stdlib/gleam@dynamic.erl +106 -0
- package/build/dev/javascript/gleam_stdlib/gleam@dynamic@decode.erl +1112 -0
- package/build/dev/javascript/gleam_stdlib/gleam@float.erl +764 -0
- package/build/dev/javascript/gleam_stdlib/gleam@function.erl +18 -0
- package/build/dev/javascript/gleam_stdlib/gleam@int.erl +1004 -0
- package/build/dev/javascript/gleam_stdlib/gleam@io.erl +80 -0
- package/build/dev/javascript/gleam_stdlib/gleam@list.erl +2832 -0
- package/build/dev/javascript/gleam_stdlib/gleam@option.erl +413 -0
- package/build/dev/javascript/gleam_stdlib/gleam@order.erl +200 -0
- package/build/dev/javascript/gleam_stdlib/gleam@pair.erl +110 -0
- package/build/dev/javascript/gleam_stdlib/gleam@result.erl +532 -0
- package/build/dev/javascript/gleam_stdlib/gleam@set.erl +433 -0
- package/build/dev/javascript/gleam_stdlib/gleam@string.erl +1012 -0
- package/build/dev/javascript/gleam_stdlib/gleam@string_tree.erl +207 -0
- package/build/dev/javascript/gleam_stdlib/gleam@uri.erl +1049 -0
- package/build/dev/javascript/gleam_stdlib/gleam_stdlib.erl +529 -0
- package/build/dev/javascript/gleam_stdlib/gleam_stdlib.mjs +1050 -0
- package/build/dev/javascript/gleam_version +1 -0
- package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit.cache +0 -0
- package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit.cache_inline +0 -0
- package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit.cache_meta +0 -0
- package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit@internal@gleam_panic.cache +0 -0
- package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit@internal@gleam_panic.cache_inline +0 -0
- package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit@internal@gleam_panic.cache_meta +0 -0
- package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit@internal@reporting.cache +0 -0
- package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit@internal@reporting.cache_inline +0 -0
- package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit@internal@reporting.cache_meta +0 -0
- package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit@should.cache +0 -0
- package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit@should.cache_inline +0 -0
- package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit@should.cache_meta +0 -0
- package/build/dev/javascript/gleeunit/gleam.mjs +1 -0
- package/build/dev/javascript/gleeunit/gleeunit/internal/gleam_panic.mjs +180 -0
- package/build/dev/javascript/gleeunit/gleeunit/internal/gleeunit_gleam_panic_ffi.erl +49 -0
- package/build/dev/javascript/gleeunit/gleeunit/internal/gleeunit_gleam_panic_ffi.mjs +91 -0
- package/build/dev/javascript/gleeunit/gleeunit/internal/reporting.mjs +256 -0
- package/build/dev/javascript/gleeunit/gleeunit/should.mjs +135 -0
- package/build/dev/javascript/gleeunit/gleeunit.erl +89 -0
- package/build/dev/javascript/gleeunit/gleeunit.mjs +62 -0
- package/build/dev/javascript/gleeunit/gleeunit@internal@gleam_panic.erl +56 -0
- package/build/dev/javascript/gleeunit/gleeunit@internal@reporting.erl +343 -0
- package/build/dev/javascript/gleeunit/gleeunit@should.erl +153 -0
- package/build/dev/javascript/gleeunit/gleeunit_ffi.erl +21 -0
- package/build/dev/javascript/gleeunit/gleeunit_ffi.mjs +100 -0
- package/build/dev/javascript/gleeunit/gleeunit_progress.erl +72 -0
- package/build/dev/javascript/prelude.mjs +1575 -0
- package/build/dev/javascript/simplifile/_gleam_artefacts/simplifile.cache +0 -0
- package/build/dev/javascript/simplifile/_gleam_artefacts/simplifile.cache_inline +0 -0
- package/build/dev/javascript/simplifile/_gleam_artefacts/simplifile.cache_meta +0 -0
- package/build/dev/javascript/simplifile/gleam.mjs +1 -0
- package/build/dev/javascript/simplifile/simplifile.erl +893 -0
- package/build/dev/javascript/simplifile/simplifile.mjs +893 -0
- package/build/dev/javascript/simplifile/simplifile_erl.erl +244 -0
- package/build/dev/javascript/simplifile/simplifile_js.mjs +400 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/cli_test.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/cli_test.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/cli_test.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/cli_test.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/compiler_test.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/compiler_test.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/compiler_test.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/compiler_test.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/config_test.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/config_test.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/config_test.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/config_test.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/importer_test.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/importer_test.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/importer_test.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/importer_test.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/parser_test.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/parser_test.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/parser_test.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/parser_test.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/path_test.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/path_test.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/path_test.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/path_test.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/provider_test.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/provider_test.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/provider_test.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/provider_test.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/registry_test.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/registry_test.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/registry_test.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/registry_test.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/scaffold_test.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/scaffold_test.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/scaffold_test.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/scaffold_test.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@compiler.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@compiler.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@compiler.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@compiler.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@config.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@config.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@config.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@config.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@error.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@error.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@error.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@error.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@fs.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@fs.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@fs.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@fs.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@importer.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@importer.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@importer.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@importer.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@parser.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@parser.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@parser.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@parser.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@path.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@path.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@path.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@path.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@platform.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@platform.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@platform.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@platform.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@provider.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@provider.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@provider.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@provider.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@registry.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@registry.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@registry.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@registry.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@scaffold.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@scaffold.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@scaffold.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@scaffold.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@semver.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@semver.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@semver.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@semver.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@shell.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@shell.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@shell.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@shell.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@template.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@template.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@template.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@template.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@types.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@types.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@types.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@types.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@version_constraint.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@version_constraint.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@version_constraint.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@version_constraint.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@yaml.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@yaml.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@yaml.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc@yaml.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc_test.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc_test.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc_test.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/skillc_test.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/template_test.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/template_test.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/template_test.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/template_test.cache_warnings +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/version_constraint_test.cache +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/version_constraint_test.cache_inline +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/version_constraint_test.cache_meta +0 -0
- package/build/dev/javascript/skillc/_gleam_artefacts/version_constraint_test.cache_warnings +0 -0
- package/build/dev/javascript/skillc/cli_test.mjs +461 -0
- package/build/dev/javascript/skillc/compiler_test.mjs +3089 -0
- package/build/dev/javascript/skillc/config_test.mjs +308 -0
- package/build/dev/javascript/skillc/gleam.main.mjs +2 -0
- package/build/dev/javascript/skillc/gleam.mjs +1 -0
- package/build/dev/javascript/skillc/importer_test.mjs +1643 -0
- package/build/dev/javascript/skillc/parser_test.mjs +1601 -0
- package/build/dev/javascript/skillc/path_test.mjs +26 -0
- package/build/dev/javascript/skillc/provider_test.mjs +221 -0
- package/build/dev/javascript/skillc/registry_test.mjs +359 -0
- package/build/dev/javascript/skillc/scaffold_test.mjs +405 -0
- package/build/dev/javascript/skillc/skillc/compiler.mjs +724 -0
- package/build/dev/javascript/skillc/skillc/config.mjs +172 -0
- package/build/dev/javascript/skillc/skillc/error.mjs +145 -0
- package/build/dev/javascript/skillc/skillc/fs.mjs +40 -0
- package/build/dev/javascript/skillc/skillc/importer.mjs +975 -0
- package/build/dev/javascript/skillc/skillc/parser.mjs +427 -0
- package/build/dev/javascript/skillc/skillc/path.mjs +52 -0
- package/build/dev/javascript/skillc/skillc/platform.mjs +44 -0
- package/build/dev/javascript/skillc/skillc/provider.mjs +86 -0
- package/build/dev/javascript/skillc/skillc/registry.mjs +701 -0
- package/build/dev/javascript/skillc/skillc/scaffold.mjs +117 -0
- package/build/dev/javascript/skillc/skillc/semver.mjs +293 -0
- package/build/dev/javascript/skillc/skillc/shell.mjs +14 -0
- package/build/dev/javascript/skillc/skillc/template.mjs +1177 -0
- package/build/dev/javascript/skillc/skillc/types.mjs +249 -0
- package/build/dev/javascript/skillc/skillc/version_constraint.mjs +290 -0
- package/build/dev/javascript/skillc/skillc/yaml.mjs +51 -0
- package/build/dev/javascript/skillc/skillc.mjs +873 -0
- package/build/dev/javascript/skillc/skillc_ffi.mjs +30 -0
- package/build/dev/javascript/skillc/skillc_test.mjs +5 -0
- package/build/dev/javascript/skillc/template_test.mjs +1638 -0
- package/build/dev/javascript/skillc/version_constraint_test.mjs +1325 -0
- package/build/dev/javascript/yay/_gleam_artefacts/yay.cache +0 -0
- package/build/dev/javascript/yay/_gleam_artefacts/yay.cache_inline +0 -0
- package/build/dev/javascript/yay/_gleam_artefacts/yay.cache_meta +0 -0
- package/build/dev/javascript/yay/gleam.mjs +1 -0
- package/build/dev/javascript/yay/yaml_ffi.erl +106 -0
- package/build/dev/javascript/yay/yaml_ffi.mjs +373 -0
- package/build/dev/javascript/yay/yay.erl +1218 -0
- package/build/dev/javascript/yay/yay.mjs +1403 -0
- package/package.json +28 -0
- package/src/skillc/compiler.gleam +561 -0
- package/src/skillc/config.gleam +91 -0
- package/src/skillc/error.gleam +37 -0
- package/src/skillc/fs.gleam +31 -0
- package/src/skillc/importer.gleam +709 -0
- package/src/skillc/parser.gleam +279 -0
- package/src/skillc/path.gleam +30 -0
- package/src/skillc/platform.gleam +25 -0
- package/src/skillc/provider.gleam +58 -0
- package/src/skillc/registry.gleam +472 -0
- package/src/skillc/scaffold.gleam +112 -0
- package/src/skillc/semver.gleam +165 -0
- package/src/skillc/shell.gleam +12 -0
- package/src/skillc/template.gleam +885 -0
- package/src/skillc/types.gleam +93 -0
- package/src/skillc/version_constraint.gleam +163 -0
- package/src/skillc/yaml.gleam +27 -0
- package/src/skillc.gleam +466 -0
- package/src/skillc_ffi.mjs +30 -0
|
@@ -0,0 +1,472 @@
|
|
|
1
|
+
import gleam/list
|
|
2
|
+
import gleam/option.{type Option, None, Some}
|
|
3
|
+
import gleam/result
|
|
4
|
+
import gleam/string
|
|
5
|
+
import simplifile
|
|
6
|
+
import skillc/compiler
|
|
7
|
+
import skillc/error.{type SkillError, RegistryError, map_file_error}
|
|
8
|
+
import skillc/parser
|
|
9
|
+
import skillc/path
|
|
10
|
+
import skillc/platform
|
|
11
|
+
import skillc/semver
|
|
12
|
+
import skillc/shell
|
|
13
|
+
import skillc/types
|
|
14
|
+
import skillc/version_constraint
|
|
15
|
+
|
|
16
|
+
// ============================================================================
|
|
17
|
+
// Publish
|
|
18
|
+
// ============================================================================
|
|
19
|
+
|
|
20
|
+
pub fn publish(skill_dir: String, repo: String) -> Result(String, SkillError) {
|
|
21
|
+
// 1. Validate skill
|
|
22
|
+
use skill_content <- result.try(
|
|
23
|
+
simplifile.read(skill_dir <> "/skill.yaml")
|
|
24
|
+
|> map_file_error(skill_dir <> "/skill.yaml"),
|
|
25
|
+
)
|
|
26
|
+
use skill <- result.try(parser.parse_skill_yaml(skill_content))
|
|
27
|
+
|
|
28
|
+
let version_str = semver.to_string(skill.version)
|
|
29
|
+
let tag = skill.name <> "-v" <> version_str
|
|
30
|
+
let tarball_name = skill.name <> "-" <> version_str <> ".tar.gz"
|
|
31
|
+
let tarball_path = platform.tmpdir() <> "/" <> tarball_name
|
|
32
|
+
|
|
33
|
+
// 2. Create tarball of skill source directory
|
|
34
|
+
let parent = path.parent_dir(skill_dir)
|
|
35
|
+
let dirname = path.basename(skill_dir)
|
|
36
|
+
use _ <- result.try(
|
|
37
|
+
shell.exec(
|
|
38
|
+
"tar czf "
|
|
39
|
+
<> tarball_path
|
|
40
|
+
<> " -C "
|
|
41
|
+
<> shell_quote(parent)
|
|
42
|
+
<> " "
|
|
43
|
+
<> shell_quote(dirname),
|
|
44
|
+
)
|
|
45
|
+
|> result.map_error(fn(e) {
|
|
46
|
+
RegistryError("Failed to create tarball: " <> e)
|
|
47
|
+
}),
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
// 3. Check gh is available
|
|
51
|
+
use _ <- result.try(
|
|
52
|
+
shell.exec("gh --version")
|
|
53
|
+
|> result.map_error(fn(_) {
|
|
54
|
+
RegistryError(
|
|
55
|
+
"GitHub CLI (gh) is not installed. Install it from https://cli.github.com",
|
|
56
|
+
)
|
|
57
|
+
}),
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
// 4. Create GitHub Release
|
|
61
|
+
use output <- result.try(
|
|
62
|
+
shell.exec(
|
|
63
|
+
"gh release create "
|
|
64
|
+
<> shell_quote(tag)
|
|
65
|
+
<> " "
|
|
66
|
+
<> shell_quote(tarball_path)
|
|
67
|
+
<> " --repo "
|
|
68
|
+
<> shell_quote(repo)
|
|
69
|
+
<> " --title "
|
|
70
|
+
<> shell_quote(skill.name <> " " <> tag)
|
|
71
|
+
<> " --notes "
|
|
72
|
+
<> shell_quote("Published by skillc"),
|
|
73
|
+
)
|
|
74
|
+
|> result.map_error(fn(e) {
|
|
75
|
+
RegistryError("Failed to create release: " <> e)
|
|
76
|
+
}),
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
// 5. Clean up tarball
|
|
80
|
+
let _ = simplifile.delete(tarball_path)
|
|
81
|
+
|
|
82
|
+
Ok(
|
|
83
|
+
"Published " <> skill.name <> " " <> tag <> " to " <> repo <> "\n" <> output,
|
|
84
|
+
)
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
pub fn infer_repo(skill_dir: String) -> Result(String, SkillError) {
|
|
88
|
+
use url <- result.try(
|
|
89
|
+
shell.exec("git -C " <> shell_quote(skill_dir) <> " remote get-url origin")
|
|
90
|
+
|> result.map_error(fn(_) {
|
|
91
|
+
RegistryError(
|
|
92
|
+
"Could not infer repository. Use --repo owner/repo or ensure a git remote is configured.",
|
|
93
|
+
)
|
|
94
|
+
}),
|
|
95
|
+
)
|
|
96
|
+
Ok(parse_repo_url(url))
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
pub fn parse_repo_url(url: String) -> String {
|
|
100
|
+
let url = string.trim(url)
|
|
101
|
+
// Handle git@github.com:owner/repo.git
|
|
102
|
+
let url = case string.contains(url, "@") {
|
|
103
|
+
True ->
|
|
104
|
+
case string.split_once(url, ":") {
|
|
105
|
+
Ok(#(_, path)) -> path
|
|
106
|
+
_ -> url
|
|
107
|
+
}
|
|
108
|
+
False -> url
|
|
109
|
+
}
|
|
110
|
+
// Handle https://github.com/owner/repo.git
|
|
111
|
+
let url = case string.split(url, "github.com/") {
|
|
112
|
+
[_, path] -> path
|
|
113
|
+
_ -> url
|
|
114
|
+
}
|
|
115
|
+
// Strip .git suffix
|
|
116
|
+
let url = case string.ends_with(url, ".git") {
|
|
117
|
+
True -> string.drop_end(url, 4)
|
|
118
|
+
False -> url
|
|
119
|
+
}
|
|
120
|
+
// Strip trailing slash
|
|
121
|
+
case string.ends_with(url, "/") {
|
|
122
|
+
True -> string.drop_end(url, 1)
|
|
123
|
+
False -> url
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// ============================================================================
|
|
128
|
+
// Search
|
|
129
|
+
// ============================================================================
|
|
130
|
+
|
|
131
|
+
pub fn search(query: String) -> Result(String, SkillError) {
|
|
132
|
+
use _ <- result.try(require_gh())
|
|
133
|
+
use output <- result.try(
|
|
134
|
+
shell.exec(
|
|
135
|
+
"gh search repos --topic skill-universe "
|
|
136
|
+
<> shell_quote(query)
|
|
137
|
+
<> " --json name,owner,description --jq "
|
|
138
|
+
<> shell_quote(".[] | \"\\(.owner.login)/\\(.name) - \\(.description)\"")
|
|
139
|
+
<> " --limit 20",
|
|
140
|
+
)
|
|
141
|
+
|> result.map_error(fn(e) { RegistryError("Search failed: " <> e) }),
|
|
142
|
+
)
|
|
143
|
+
case string.is_empty(string.trim(output)) {
|
|
144
|
+
True -> Ok("No skills found matching '" <> query <> "'")
|
|
145
|
+
False -> Ok(output)
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// ============================================================================
|
|
150
|
+
// Install
|
|
151
|
+
// ============================================================================
|
|
152
|
+
|
|
153
|
+
pub fn install(
|
|
154
|
+
spec: String,
|
|
155
|
+
target: Option(String),
|
|
156
|
+
output_dir: String,
|
|
157
|
+
) -> Result(String, SkillError) {
|
|
158
|
+
use _ <- result.try(require_gh())
|
|
159
|
+
|
|
160
|
+
// 1. Parse spec: "owner/repo", "owner/repo@v1.0", "owner/repo/skill", "owner/repo/skill@v1.0"
|
|
161
|
+
let #(repo, skill_name, version) = parse_install_spec(spec)
|
|
162
|
+
|
|
163
|
+
// 2. Create temp directory
|
|
164
|
+
let tmp_dir =
|
|
165
|
+
platform.tmpdir()
|
|
166
|
+
<> "/skillc-install-"
|
|
167
|
+
<> string.replace(repo, "/", "-")
|
|
168
|
+
let _ = simplifile.delete(tmp_dir)
|
|
169
|
+
use _ <- result.try(
|
|
170
|
+
simplifile.create_directory_all(tmp_dir)
|
|
171
|
+
|> map_file_error(tmp_dir),
|
|
172
|
+
)
|
|
173
|
+
|
|
174
|
+
// 3. Resolve the tag to download
|
|
175
|
+
use tag_flag <- result.try(resolve_install_tag(repo, skill_name, version))
|
|
176
|
+
|
|
177
|
+
// 4. Download release tarball
|
|
178
|
+
use _ <- result.try(
|
|
179
|
+
shell.exec(
|
|
180
|
+
"gh release download"
|
|
181
|
+
<> tag_flag
|
|
182
|
+
<> " --repo "
|
|
183
|
+
<> shell_quote(repo)
|
|
184
|
+
<> " --pattern '*.tar.gz'"
|
|
185
|
+
<> " --dir "
|
|
186
|
+
<> shell_quote(tmp_dir),
|
|
187
|
+
)
|
|
188
|
+
|> result.map_error(fn(e) {
|
|
189
|
+
RegistryError("Failed to download release: " <> e)
|
|
190
|
+
}),
|
|
191
|
+
)
|
|
192
|
+
|
|
193
|
+
// 5. Find the downloaded tarball
|
|
194
|
+
use tarball <- result.try(case simplifile.get_files(tmp_dir) {
|
|
195
|
+
Ok(files) ->
|
|
196
|
+
case list.find(files, fn(f) { string.ends_with(f, ".tar.gz") }) {
|
|
197
|
+
Ok(f) -> Ok(f)
|
|
198
|
+
Error(_) ->
|
|
199
|
+
Error(RegistryError("No tarball found in downloaded release"))
|
|
200
|
+
}
|
|
201
|
+
Error(_) -> Error(RegistryError("Failed to read temp directory"))
|
|
202
|
+
})
|
|
203
|
+
|
|
204
|
+
// 6. Extract tarball
|
|
205
|
+
let extract_dir = tmp_dir <> "/extracted"
|
|
206
|
+
use _ <- result.try(
|
|
207
|
+
simplifile.create_directory_all(extract_dir)
|
|
208
|
+
|> map_file_error(extract_dir),
|
|
209
|
+
)
|
|
210
|
+
use _ <- result.try(
|
|
211
|
+
shell.exec(
|
|
212
|
+
"tar xzf " <> shell_quote(tarball) <> " -C " <> shell_quote(extract_dir),
|
|
213
|
+
)
|
|
214
|
+
|> result.map_error(fn(e) {
|
|
215
|
+
RegistryError("Failed to extract tarball: " <> e)
|
|
216
|
+
}),
|
|
217
|
+
)
|
|
218
|
+
|
|
219
|
+
// 7. Find the skill directory (directory containing skill.yaml)
|
|
220
|
+
use skill_dir <- result.try(find_skill_dir(extract_dir))
|
|
221
|
+
|
|
222
|
+
// 8. Compile and emit
|
|
223
|
+
use result_msg <- result.try(case target {
|
|
224
|
+
Some(t) -> {
|
|
225
|
+
use compiled <- result.try(compiler.compile(skill_dir, t))
|
|
226
|
+
let name = compiled.name
|
|
227
|
+
use _ <- result.try(compiler.emit(compiled, output_dir, name))
|
|
228
|
+
Ok("Installed " <> name <> " (" <> t <> ") to " <> output_dir)
|
|
229
|
+
}
|
|
230
|
+
None -> {
|
|
231
|
+
use compiled_list <- result.try(compiler.compile_all(skill_dir))
|
|
232
|
+
use _ <- result.try(
|
|
233
|
+
list.try_each(compiled_list, fn(compiled) {
|
|
234
|
+
let name = compiled.name
|
|
235
|
+
compiler.emit(compiled, output_dir, name)
|
|
236
|
+
}),
|
|
237
|
+
)
|
|
238
|
+
let provider_names =
|
|
239
|
+
list.map(compiled_list, fn(c) { types.provider_to_string(c.provider) })
|
|
240
|
+
let name = case compiled_list {
|
|
241
|
+
[first, ..] -> first.name
|
|
242
|
+
[] -> "skill"
|
|
243
|
+
}
|
|
244
|
+
Ok(
|
|
245
|
+
"Installed "
|
|
246
|
+
<> name
|
|
247
|
+
<> " ("
|
|
248
|
+
<> string.join(provider_names, ", ")
|
|
249
|
+
<> ") to "
|
|
250
|
+
<> output_dir,
|
|
251
|
+
)
|
|
252
|
+
}
|
|
253
|
+
})
|
|
254
|
+
|
|
255
|
+
// 9. Check dependencies
|
|
256
|
+
let dep_warnings = check_install_dependencies(skill_dir, output_dir)
|
|
257
|
+
|
|
258
|
+
// 10. Clean up
|
|
259
|
+
let _ = simplifile.delete(tmp_dir)
|
|
260
|
+
|
|
261
|
+
Ok(result_msg <> dep_warnings)
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
pub fn parse_install_spec(
|
|
265
|
+
spec: String,
|
|
266
|
+
) -> #(String, Option(String), Option(String)) {
|
|
267
|
+
// Split off @version first if present
|
|
268
|
+
let #(path, version) = case string.split_once(spec, "@") {
|
|
269
|
+
Ok(#(p, v)) -> #(p, Some(v))
|
|
270
|
+
Error(_) -> #(spec, None)
|
|
271
|
+
}
|
|
272
|
+
// Split path into segments: owner/repo or owner/repo/skill-name
|
|
273
|
+
let segments = string.split(path, "/")
|
|
274
|
+
case segments {
|
|
275
|
+
[owner, repo, skill_name] ->
|
|
276
|
+
#(owner <> "/" <> repo, Some(skill_name), version)
|
|
277
|
+
_ -> #(path, None, version)
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
fn resolve_install_tag(
|
|
282
|
+
repo: String,
|
|
283
|
+
skill_name: Option(String),
|
|
284
|
+
version: Option(String),
|
|
285
|
+
) -> Result(String, SkillError) {
|
|
286
|
+
case skill_name, version {
|
|
287
|
+
// owner/repo@v1.0.0 — backward compat, download exact tag
|
|
288
|
+
None, Some(v) -> Ok(" " <> shell_quote(v))
|
|
289
|
+
// owner/repo — backward compat, latest release
|
|
290
|
+
None, None -> Ok(" --latest")
|
|
291
|
+
// owner/repo/skill@v1.0.0 — download tag {skill}-{version}
|
|
292
|
+
Some(name), Some(v) -> Ok(" " <> shell_quote(name <> "-" <> v))
|
|
293
|
+
// owner/repo/skill — find latest tag matching {skill}-v*
|
|
294
|
+
Some(name), None -> {
|
|
295
|
+
use output <- result.try(
|
|
296
|
+
shell.exec(
|
|
297
|
+
"gh release list --repo "
|
|
298
|
+
<> shell_quote(repo)
|
|
299
|
+
<> " --json tagName --jq "
|
|
300
|
+
<> shell_quote(
|
|
301
|
+
".[] | select(.tagName | startswith(\""
|
|
302
|
+
<> name
|
|
303
|
+
<> "-v\")) | .tagName",
|
|
304
|
+
),
|
|
305
|
+
)
|
|
306
|
+
|> result.map_error(fn(e) {
|
|
307
|
+
RegistryError("Failed to list releases: " <> e)
|
|
308
|
+
}),
|
|
309
|
+
)
|
|
310
|
+
let tags =
|
|
311
|
+
string.split(string.trim(output), "\n")
|
|
312
|
+
|> list.filter(fn(t) { !string.is_empty(t) })
|
|
313
|
+
case tags {
|
|
314
|
+
[latest, ..] -> Ok(" " <> shell_quote(latest))
|
|
315
|
+
[] ->
|
|
316
|
+
Error(RegistryError(
|
|
317
|
+
"No releases found for skill '" <> name <> "' in " <> repo,
|
|
318
|
+
))
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
fn find_skill_dir(base_dir: String) -> Result(String, SkillError) {
|
|
325
|
+
// Check if skill.yaml is directly in base_dir
|
|
326
|
+
case simplifile.is_file(base_dir <> "/skill.yaml") {
|
|
327
|
+
Ok(True) -> Ok(base_dir)
|
|
328
|
+
_ -> {
|
|
329
|
+
// Check one level of subdirectories
|
|
330
|
+
case simplifile.read_directory(base_dir) {
|
|
331
|
+
Ok(entries) -> {
|
|
332
|
+
let found =
|
|
333
|
+
list.find(entries, fn(entry) {
|
|
334
|
+
case
|
|
335
|
+
simplifile.is_file(base_dir <> "/" <> entry <> "/skill.yaml")
|
|
336
|
+
{
|
|
337
|
+
Ok(True) -> True
|
|
338
|
+
_ -> False
|
|
339
|
+
}
|
|
340
|
+
})
|
|
341
|
+
case found {
|
|
342
|
+
Ok(entry) -> Ok(base_dir <> "/" <> entry)
|
|
343
|
+
Error(_) ->
|
|
344
|
+
Error(RegistryError("No skill.yaml found in extracted archive"))
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
Error(_) -> Error(RegistryError("Failed to read extracted directory"))
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
// ============================================================================
|
|
354
|
+
// List
|
|
355
|
+
// ============================================================================
|
|
356
|
+
|
|
357
|
+
pub fn list_versions(
|
|
358
|
+
repo: String,
|
|
359
|
+
skill_name: Option(String),
|
|
360
|
+
) -> Result(String, SkillError) {
|
|
361
|
+
use _ <- result.try(require_gh())
|
|
362
|
+
let jq_expr = case skill_name {
|
|
363
|
+
Some(name) ->
|
|
364
|
+
".[] | select(.tagName | startswith(\""
|
|
365
|
+
<> name
|
|
366
|
+
<> "-v\")) | \"\\(.tagName)\\t\\(.publishedAt)\\(if .isLatest then \" (latest)\" else \"\" end)\""
|
|
367
|
+
None ->
|
|
368
|
+
".[] | \"\\(.tagName)\\t\\(.publishedAt)\\(if .isLatest then \" (latest)\" else \"\" end)\""
|
|
369
|
+
}
|
|
370
|
+
use output <- result.try(
|
|
371
|
+
shell.exec(
|
|
372
|
+
"gh release list --repo "
|
|
373
|
+
<> shell_quote(repo)
|
|
374
|
+
<> " --json tagName,publishedAt,isLatest --jq "
|
|
375
|
+
<> shell_quote(jq_expr),
|
|
376
|
+
)
|
|
377
|
+
|> result.map_error(fn(e) {
|
|
378
|
+
RegistryError("Failed to list versions: " <> e)
|
|
379
|
+
}),
|
|
380
|
+
)
|
|
381
|
+
let label = case skill_name {
|
|
382
|
+
Some(name) -> name <> " in " <> repo
|
|
383
|
+
None -> repo
|
|
384
|
+
}
|
|
385
|
+
case string.is_empty(string.trim(output)) {
|
|
386
|
+
True -> Ok("No releases found for " <> label)
|
|
387
|
+
False -> Ok(output)
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
pub fn list_installed(output_dir: String) -> Result(String, SkillError) {
|
|
392
|
+
case simplifile.read_directory(output_dir) {
|
|
393
|
+
Error(_) -> Ok("No skills installed in " <> output_dir)
|
|
394
|
+
Ok(entries) -> {
|
|
395
|
+
let skills =
|
|
396
|
+
list.flat_map(entries, fn(provider_dir) {
|
|
397
|
+
let provider_path = output_dir <> "/" <> provider_dir
|
|
398
|
+
case simplifile.read_directory(provider_path) {
|
|
399
|
+
Ok(skill_entries) ->
|
|
400
|
+
list.filter_map(skill_entries, fn(skill_name) {
|
|
401
|
+
let skill_md_path =
|
|
402
|
+
provider_path <> "/" <> skill_name <> "/SKILL.md"
|
|
403
|
+
case simplifile.is_file(skill_md_path) {
|
|
404
|
+
Ok(True) ->
|
|
405
|
+
Ok(" " <> skill_name <> " (" <> provider_dir <> ")")
|
|
406
|
+
_ -> Error(Nil)
|
|
407
|
+
}
|
|
408
|
+
})
|
|
409
|
+
Error(_) -> []
|
|
410
|
+
}
|
|
411
|
+
})
|
|
412
|
+
case skills {
|
|
413
|
+
[] -> Ok("No skills installed in " <> output_dir)
|
|
414
|
+
_ -> Ok("Installed skills:\n" <> string.join(skills, "\n"))
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
fn check_install_dependencies(
|
|
421
|
+
skill_dir: String,
|
|
422
|
+
output_dir: String,
|
|
423
|
+
) -> String {
|
|
424
|
+
case simplifile.read(skill_dir <> "/skill.yaml") {
|
|
425
|
+
Ok(content) ->
|
|
426
|
+
case parser.parse_skill_yaml(content) {
|
|
427
|
+
Ok(skill) -> {
|
|
428
|
+
let warnings = compiler.check_dependencies(skill, output_dir)
|
|
429
|
+
case warnings {
|
|
430
|
+
[] -> ""
|
|
431
|
+
_ -> {
|
|
432
|
+
let lines =
|
|
433
|
+
list.filter_map(warnings, fn(w) {
|
|
434
|
+
case w {
|
|
435
|
+
types.MissingDependency(dep) ->
|
|
436
|
+
Ok(
|
|
437
|
+
"\nWarning: missing dependency '"
|
|
438
|
+
<> dep.name
|
|
439
|
+
<> "' ("
|
|
440
|
+
<> version_constraint.to_string(dep.version)
|
|
441
|
+
<> ")",
|
|
442
|
+
)
|
|
443
|
+
_ -> Error(Nil)
|
|
444
|
+
}
|
|
445
|
+
})
|
|
446
|
+
string.join(lines, "")
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
Error(_) -> ""
|
|
451
|
+
}
|
|
452
|
+
Error(_) -> ""
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
// ============================================================================
|
|
457
|
+
// Helpers
|
|
458
|
+
// ============================================================================
|
|
459
|
+
|
|
460
|
+
fn require_gh() -> Result(Nil, SkillError) {
|
|
461
|
+
shell.exec("gh --version")
|
|
462
|
+
|> result.map(fn(_) { Nil })
|
|
463
|
+
|> result.map_error(fn(_) {
|
|
464
|
+
RegistryError(
|
|
465
|
+
"GitHub CLI (gh) is not installed. Install it from https://cli.github.com",
|
|
466
|
+
)
|
|
467
|
+
})
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
fn shell_quote(s: String) -> String {
|
|
471
|
+
shell.quote(s)
|
|
472
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import simplifile
|
|
2
|
+
import skillc/error.{type SkillError, FileError, ValidationError}
|
|
3
|
+
|
|
4
|
+
pub fn init_skill(skill_dir: String, name: String) -> Result(Nil, SkillError) {
|
|
5
|
+
// Guard against overwriting existing skills
|
|
6
|
+
case simplifile.is_file(skill_dir <> "/skill.yaml") {
|
|
7
|
+
Ok(True) ->
|
|
8
|
+
Error(ValidationError(
|
|
9
|
+
"init",
|
|
10
|
+
"skill.yaml already exists in " <> skill_dir,
|
|
11
|
+
))
|
|
12
|
+
_ -> do_init(skill_dir, name)
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
fn do_init(skill_dir: String, name: String) -> Result(Nil, SkillError) {
|
|
17
|
+
use _ <- try_write_dir(skill_dir)
|
|
18
|
+
use _ <- try_write_dir(skill_dir <> "/providers")
|
|
19
|
+
use _ <- try_write_dir(skill_dir <> "/providers/openclaw")
|
|
20
|
+
use _ <- try_write_dir(skill_dir <> "/providers/claude-code")
|
|
21
|
+
use _ <- try_write_dir(skill_dir <> "/providers/codex")
|
|
22
|
+
|
|
23
|
+
use _ <- try_write_file(skill_dir <> "/skill.yaml", skill_yaml_template(name))
|
|
24
|
+
use _ <- try_write_file(
|
|
25
|
+
skill_dir <> "/INSTRUCTIONS.md",
|
|
26
|
+
instructions_template(),
|
|
27
|
+
)
|
|
28
|
+
use _ <- try_write_file(
|
|
29
|
+
skill_dir <> "/providers/openclaw/metadata.yaml",
|
|
30
|
+
openclaw_metadata_template(),
|
|
31
|
+
)
|
|
32
|
+
use _ <- try_write_file(
|
|
33
|
+
skill_dir <> "/providers/claude-code/metadata.yaml",
|
|
34
|
+
claude_code_metadata_template(),
|
|
35
|
+
)
|
|
36
|
+
use _ <- try_write_file(
|
|
37
|
+
skill_dir <> "/providers/codex/metadata.yaml",
|
|
38
|
+
codex_metadata_template(),
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
Ok(Nil)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
fn try_write_dir(
|
|
45
|
+
path: String,
|
|
46
|
+
next: fn(Nil) -> Result(Nil, SkillError),
|
|
47
|
+
) -> Result(Nil, SkillError) {
|
|
48
|
+
case simplifile.create_directory_all(path) {
|
|
49
|
+
Ok(_) -> next(Nil)
|
|
50
|
+
Error(e) -> Error(FileError(path, e))
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
fn try_write_file(
|
|
55
|
+
path: String,
|
|
56
|
+
content: String,
|
|
57
|
+
next: fn(Nil) -> Result(Nil, SkillError),
|
|
58
|
+
) -> Result(Nil, SkillError) {
|
|
59
|
+
case simplifile.write(path, content) {
|
|
60
|
+
Ok(_) -> next(Nil)
|
|
61
|
+
Error(e) -> Error(FileError(path, e))
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
fn skill_yaml_template(name: String) -> String {
|
|
66
|
+
"name: " <> name <> "
|
|
67
|
+
description: Describe what this skill does
|
|
68
|
+
version: 0.1.0
|
|
69
|
+
|
|
70
|
+
metadata:
|
|
71
|
+
author: Your Name
|
|
72
|
+
tags: []
|
|
73
|
+
|
|
74
|
+
dependencies: []
|
|
75
|
+
|
|
76
|
+
config: []
|
|
77
|
+
"
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
fn instructions_template() -> String {
|
|
81
|
+
"# {{name}} v{{version}}
|
|
82
|
+
|
|
83
|
+
{{description}}
|
|
84
|
+
|
|
85
|
+
## When to Use
|
|
86
|
+
|
|
87
|
+
Describe when this skill should be triggered.
|
|
88
|
+
|
|
89
|
+
## Steps
|
|
90
|
+
|
|
91
|
+
1. Step one
|
|
92
|
+
2. Step two
|
|
93
|
+
"
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
fn openclaw_metadata_template() -> String {
|
|
97
|
+
"emoji: \"\"
|
|
98
|
+
category: general
|
|
99
|
+
"
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
fn claude_code_metadata_template() -> String {
|
|
103
|
+
"user-invocable: true
|
|
104
|
+
"
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
fn codex_metadata_template() -> String {
|
|
108
|
+
"interface:
|
|
109
|
+
display_name: \"\"
|
|
110
|
+
short_description: \"\"
|
|
111
|
+
"
|
|
112
|
+
}
|