@dev-sergeev/datalab-kit 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/README.md +26 -8
- package/THIRD_PARTY_NOTICES.md +6 -2
- package/dist/extension.js +8 -1
- package/dist/recap.d.ts +2 -0
- package/dist/recap.js +31 -0
- package/docs/adr/0002-package-delivery.md +2 -0
- package/node_modules/@gotgenes/pi-permission-system/src/authority/permission-prompt-component.ts +0 -11
- package/node_modules/@gotgenes/pi-permission-system/src/config/config-store.ts +0 -5
- package/node_modules/@gotgenes/pi-permission-system/src/index.ts +3 -15
- package/node_modules/@pi-plugins/elapsed/LICENSE +21 -0
- package/node_modules/@pi-plugins/elapsed/README.md +45 -0
- package/node_modules/@pi-plugins/elapsed/dist/index.d.mts +8 -0
- package/node_modules/@pi-plugins/elapsed/dist/index.d.mts.map +1 -0
- package/node_modules/@pi-plugins/elapsed/dist/index.mjs +47 -0
- package/node_modules/@pi-plugins/elapsed/dist/index.mjs.map +1 -0
- package/node_modules/@pi-plugins/elapsed/package.json +65 -0
- package/node_modules/@tifan/pi-recap/README.md +61 -0
- package/node_modules/@tifan/pi-recap/package.json +43 -0
- package/node_modules/@tifan/pi-recap/src/index.ts +584 -0
- package/node_modules/@tifan/pi-recap/src/model-picker.ts +233 -0
- package/node_modules/@tifan/pi-recap/src/models.ts +183 -0
- package/node_modules/@tifan/pi-recap/src/sanitize.ts +119 -0
- package/node_modules/@tifan/pi-recap/src/tui.ts +155 -0
- package/node_modules/@zigai/pi-extension-internals/README.md +24 -0
- package/node_modules/@zigai/pi-extension-internals/dist/editor-enhancer-registry.d.ts +21 -0
- package/node_modules/@zigai/pi-extension-internals/dist/editor-enhancer-registry.js +233 -0
- package/node_modules/@zigai/pi-extension-internals/dist/index.d.ts +6 -0
- package/node_modules/@zigai/pi-extension-internals/dist/index.js +3 -0
- package/node_modules/@zigai/pi-extension-internals/dist/linked-method-patch.d.ts +34 -0
- package/node_modules/@zigai/pi-extension-internals/dist/linked-method-patch.js +272 -0
- package/node_modules/@zigai/pi-extension-internals/dist/pi-internal-import.d.ts +11 -0
- package/node_modules/@zigai/pi-extension-internals/dist/pi-internal-import.js +139 -0
- package/node_modules/@zigai/pi-extension-internals/package.json +41 -0
- package/node_modules/@zigai/pi-extension-settings/LICENSE +21 -0
- package/node_modules/@zigai/pi-extension-settings/README.md +36 -0
- package/node_modules/@zigai/pi-extension-settings/dist/artifacts.d.ts +23 -0
- package/node_modules/@zigai/pi-extension-settings/dist/artifacts.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/artifacts.js +75 -0
- package/node_modules/@zigai/pi-extension-settings/dist/artifacts.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/cli-entry.d.ts +3 -0
- package/node_modules/@zigai/pi-extension-settings/dist/cli-entry.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/cli-entry.js +5 -0
- package/node_modules/@zigai/pi-extension-settings/dist/cli-entry.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/cli.d.ts +6 -0
- package/node_modules/@zigai/pi-extension-settings/dist/cli.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/cli.js +87 -0
- package/node_modules/@zigai/pi-extension-settings/dist/cli.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/definition-marker.d.ts +2 -0
- package/node_modules/@zigai/pi-extension-settings/dist/definition-marker.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/definition-marker.js +2 -0
- package/node_modules/@zigai/pi-extension-settings/dist/definition-marker.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/definition.d.ts +159 -0
- package/node_modules/@zigai/pi-extension-settings/dist/definition.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/definition.js +248 -0
- package/node_modules/@zigai/pi-extension-settings/dist/definition.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/file-system.d.ts +10 -0
- package/node_modules/@zigai/pi-extension-settings/dist/file-system.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/file-system.js +115 -0
- package/node_modules/@zigai/pi-extension-settings/dist/file-system.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/index.d.ts +2 -0
- package/node_modules/@zigai/pi-extension-settings/dist/index.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/index.js +2 -0
- package/node_modules/@zigai/pi-extension-settings/dist/index.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/json-value.d.ts +18 -0
- package/node_modules/@zigai/pi-extension-settings/dist/json-value.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/json-value.js +56 -0
- package/node_modules/@zigai/pi-extension-settings/dist/json-value.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/paths.d.ts +11 -0
- package/node_modules/@zigai/pi-extension-settings/dist/paths.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/paths.js +23 -0
- package/node_modules/@zigai/pi-extension-settings/dist/paths.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/pi-host-paths.d.ts +5 -0
- package/node_modules/@zigai/pi-extension-settings/dist/pi-host-paths.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/pi-host-paths.js +21 -0
- package/node_modules/@zigai/pi-extension-settings/dist/pi-host-paths.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/pi.d.ts +106 -0
- package/node_modules/@zigai/pi-extension-settings/dist/pi.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/pi.js +122 -0
- package/node_modules/@zigai/pi-extension-settings/dist/pi.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/pi.ts +2537 -0
- package/node_modules/@zigai/pi-extension-settings/dist/pi.ts.map +7 -0
- package/node_modules/@zigai/pi-extension-settings/dist/projects.d.ts +10 -0
- package/node_modules/@zigai/pi-extension-settings/dist/projects.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/projects.js +177 -0
- package/node_modules/@zigai/pi-extension-settings/dist/projects.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/runtime.d.ts +40 -0
- package/node_modules/@zigai/pi-extension-settings/dist/runtime.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/runtime.js +158 -0
- package/node_modules/@zigai/pi-extension-settings/dist/runtime.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/runtime.ts +158 -0
- package/node_modules/@zigai/pi-extension-settings/dist/runtime.ts.map +7 -0
- package/node_modules/@zigai/pi-extension-settings/dist/schema-document.d.ts +19 -0
- package/node_modules/@zigai/pi-extension-settings/dist/schema-document.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/schema-document.js +168 -0
- package/node_modules/@zigai/pi-extension-settings/dist/schema-document.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-documentation.d.ts +9 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-documentation.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-documentation.js +242 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-documentation.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-layer.d.ts +59 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-layer.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-layer.js +98 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-layer.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-loader.d.ts +80 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-loader.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-loader.js +144 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-loader.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-merge.d.ts +5 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-merge.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-merge.js +30 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-merge.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-revision.d.ts +10 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-revision.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-revision.js +16 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-revision.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-transaction.d.ts +54 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-transaction.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-transaction.js +202 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-transaction.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/typebox-runtime.d.ts +5 -0
- package/node_modules/@zigai/pi-extension-settings/dist/typebox-runtime.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/typebox-runtime.js +9 -0
- package/node_modules/@zigai/pi-extension-settings/dist/typebox-runtime.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/docs/generation.md +71 -0
- package/node_modules/@zigai/pi-extension-settings/docs/manual-setup.md +98 -0
- package/node_modules/@zigai/pi-extension-settings/docs/runtime.md +100 -0
- package/node_modules/@zigai/pi-extension-settings/docs/ui-controls.md +31 -0
- package/node_modules/@zigai/pi-extension-settings/package.json +97 -0
- package/node_modules/@zigai/pi-mention-anything/README.md +113 -0
- package/node_modules/@zigai/pi-mention-anything/config.schema.json +313 -0
- package/node_modules/@zigai/pi-mention-anything/docs/command-protocol.md +106 -0
- package/node_modules/@zigai/pi-mention-anything/docs/providers.md +128 -0
- package/node_modules/@zigai/pi-mention-anything/examples/query-command.mjs +96 -0
- package/node_modules/@zigai/pi-mention-anything/examples/recursive-tree.ts +28 -0
- package/node_modules/@zigai/pi-mention-anything/examples/static.ts +28 -0
- package/node_modules/@zigai/pi-mention-anything/examples/tmux.ts +90 -0
- package/node_modules/@zigai/pi-mention-anything/examples/tree-settings.json +25 -0
- package/node_modules/@zigai/pi-mention-anything/package.json +58 -0
- package/node_modules/@zigai/pi-mention-anything/src/api.ts +75 -0
- package/node_modules/@zigai/pi-mention-anything/src/autocomplete.ts +231 -0
- package/node_modules/@zigai/pi-mention-anything/src/chain-autocomplete.ts +596 -0
- package/node_modules/@zigai/pi-mention-anything/src/chain-syntax.ts +345 -0
- package/node_modules/@zigai/pi-mention-anything/src/command-provider.ts +291 -0
- package/node_modules/@zigai/pi-mention-anything/src/configured-source.ts +66 -0
- package/node_modules/@zigai/pi-mention-anything/src/editor.ts +180 -0
- package/node_modules/@zigai/pi-mention-anything/src/expand-mentions.ts +162 -0
- package/node_modules/@zigai/pi-mention-anything/src/index.ts +54 -0
- package/node_modules/@zigai/pi-mention-anything/src/initial-suggestions.ts +190 -0
- package/node_modules/@zigai/pi-mention-anything/src/list-provider.ts +71 -0
- package/node_modules/@zigai/pi-mention-anything/src/mention-hub.ts +307 -0
- package/node_modules/@zigai/pi-mention-anything/src/mention-resolution.ts +374 -0
- package/node_modules/@zigai/pi-mention-anything/src/mention-syntax.ts +105 -0
- package/node_modules/@zigai/pi-mention-anything/src/register-mention.ts +89 -0
- package/node_modules/@zigai/pi-mention-anything/src/rendering.ts +53 -0
- package/node_modules/@zigai/pi-mention-anything/src/selected-items.ts +21 -0
- package/node_modules/@zigai/pi-mention-anything/src/selection-history.ts +135 -0
- package/node_modules/@zigai/pi-mention-anything/src/settings-input.ts +317 -0
- package/node_modules/@zigai/pi-mention-anything/src/settings.prevalidated.ts +57 -0
- package/node_modules/@zigai/pi-mention-anything/src/settings.ts +52 -0
- package/node_modules/@zigai/pi-mention-anything/src/source-contract.ts +174 -0
- package/node_modules/@zigai/pi-mention-anything/src/source-controller.ts +1070 -0
- package/node_modules/@zigai/pi-mention-anything/src/source-runtime.ts +99 -0
- package/node_modules/@zigai/pi-mention-skill/README.md +60 -0
- package/node_modules/@zigai/pi-mention-skill/config.schema.json +81 -0
- package/node_modules/@zigai/pi-mention-skill/package.json +56 -0
- package/node_modules/@zigai/pi-mention-skill/src/index.ts +60 -0
- package/node_modules/@zigai/pi-mention-skill/src/settings-input.ts +74 -0
- package/node_modules/@zigai/pi-mention-skill/src/settings.prevalidated.ts +18 -0
- package/node_modules/@zigai/pi-mention-skill/src/settings.ts +54 -0
- package/node_modules/@zigai/pi-mention-skill/src/skill-commands.ts +18 -0
- package/node_modules/@zigai/pi-mention-skill/src/skill-content.ts +60 -0
- package/node_modules/@zigai/pi-mention-skill/src/skill-provider.ts +105 -0
- package/node_modules/@zigai/pi-mention-skill/src/slash-skill-filter.ts +29 -0
- package/node_modules/argparse/LICENSE +21 -0
- package/node_modules/argparse/README.md +257 -0
- package/node_modules/argparse/index.js +3 -0
- package/node_modules/argparse/lib/action/append/constant.js +47 -0
- package/node_modules/argparse/lib/action/append.js +53 -0
- package/node_modules/argparse/lib/action/count.js +40 -0
- package/node_modules/argparse/lib/action/help.js +47 -0
- package/node_modules/argparse/lib/action/store/constant.js +43 -0
- package/node_modules/argparse/lib/action/store/false.js +27 -0
- package/node_modules/argparse/lib/action/store/true.js +26 -0
- package/node_modules/argparse/lib/action/store.js +50 -0
- package/node_modules/argparse/lib/action/subparsers.js +149 -0
- package/node_modules/argparse/lib/action/version.js +47 -0
- package/node_modules/argparse/lib/action.js +146 -0
- package/node_modules/argparse/lib/action_container.js +482 -0
- package/node_modules/argparse/lib/argparse.js +14 -0
- package/node_modules/argparse/lib/argument/error.js +50 -0
- package/node_modules/argparse/lib/argument/exclusive.js +54 -0
- package/node_modules/argparse/lib/argument/group.js +75 -0
- package/node_modules/argparse/lib/argument_parser.js +1161 -0
- package/node_modules/argparse/lib/const.js +21 -0
- package/node_modules/argparse/lib/help/added_formatters.js +87 -0
- package/node_modules/argparse/lib/help/formatter.js +795 -0
- package/node_modules/argparse/lib/namespace.js +76 -0
- package/node_modules/argparse/lib/utils.js +57 -0
- package/node_modules/argparse/package.json +34 -0
- package/node_modules/esprima/LICENSE.BSD +21 -0
- package/node_modules/esprima/README.md +46 -0
- package/node_modules/esprima/bin/esparse.js +139 -0
- package/node_modules/esprima/bin/esvalidate.js +236 -0
- package/node_modules/esprima/dist/esprima.js +6709 -0
- package/node_modules/esprima/package.json +112 -0
- package/node_modules/extend-shallow/LICENSE +21 -0
- package/node_modules/extend-shallow/README.md +61 -0
- package/node_modules/extend-shallow/index.js +33 -0
- package/node_modules/extend-shallow/package.json +56 -0
- package/node_modules/graceful-fs/LICENSE +15 -0
- package/node_modules/graceful-fs/README.md +143 -0
- package/node_modules/graceful-fs/clone.js +23 -0
- package/node_modules/graceful-fs/graceful-fs.js +448 -0
- package/node_modules/graceful-fs/legacy-streams.js +118 -0
- package/node_modules/graceful-fs/package.json +53 -0
- package/node_modules/graceful-fs/polyfills.js +355 -0
- package/node_modules/gray-matter/LICENSE +21 -0
- package/node_modules/gray-matter/README.md +565 -0
- package/node_modules/gray-matter/gray-matter.d.ts +114 -0
- package/node_modules/gray-matter/index.js +228 -0
- package/node_modules/gray-matter/lib/defaults.js +18 -0
- package/node_modules/gray-matter/lib/engine.js +30 -0
- package/node_modules/gray-matter/lib/engines.js +54 -0
- package/node_modules/gray-matter/lib/excerpt.js +32 -0
- package/node_modules/gray-matter/lib/parse.js +13 -0
- package/node_modules/gray-matter/lib/stringify.js +56 -0
- package/node_modules/gray-matter/lib/to-file.js +43 -0
- package/node_modules/gray-matter/lib/utils.js +66 -0
- package/node_modules/gray-matter/package.json +127 -0
- package/node_modules/is-extendable/LICENSE +21 -0
- package/node_modules/is-extendable/README.md +72 -0
- package/node_modules/is-extendable/index.js +13 -0
- package/node_modules/is-extendable/package.json +51 -0
- package/node_modules/js-yaml/LICENSE +21 -0
- package/node_modules/js-yaml/README.md +302 -0
- package/node_modules/js-yaml/bin/js-yaml.js +132 -0
- package/node_modules/js-yaml/dist/js-yaml.js +4024 -0
- package/node_modules/js-yaml/dist/js-yaml.min.js +1 -0
- package/node_modules/js-yaml/index.js +7 -0
- package/node_modules/js-yaml/lib/js-yaml/common.js +59 -0
- package/node_modules/js-yaml/lib/js-yaml/dumper.js +850 -0
- package/node_modules/js-yaml/lib/js-yaml/exception.js +43 -0
- package/node_modules/js-yaml/lib/js-yaml/loader.js +1679 -0
- package/node_modules/js-yaml/lib/js-yaml/mark.js +76 -0
- package/node_modules/js-yaml/lib/js-yaml/schema/core.js +18 -0
- package/node_modules/js-yaml/lib/js-yaml/schema/default_full.js +25 -0
- package/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js +28 -0
- package/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js +17 -0
- package/node_modules/js-yaml/lib/js-yaml/schema/json.js +25 -0
- package/node_modules/js-yaml/lib/js-yaml/schema.js +108 -0
- package/node_modules/js-yaml/lib/js-yaml/type/binary.js +138 -0
- package/node_modules/js-yaml/lib/js-yaml/type/bool.js +35 -0
- package/node_modules/js-yaml/lib/js-yaml/type/float.js +116 -0
- package/node_modules/js-yaml/lib/js-yaml/type/int.js +173 -0
- package/node_modules/js-yaml/lib/js-yaml/type/js/function.js +93 -0
- package/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js +60 -0
- package/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js +28 -0
- package/node_modules/js-yaml/lib/js-yaml/type/map.js +8 -0
- package/node_modules/js-yaml/lib/js-yaml/type/merge.js +12 -0
- package/node_modules/js-yaml/lib/js-yaml/type/null.js +34 -0
- package/node_modules/js-yaml/lib/js-yaml/type/omap.js +44 -0
- package/node_modules/js-yaml/lib/js-yaml/type/pairs.js +53 -0
- package/node_modules/js-yaml/lib/js-yaml/type/seq.js +8 -0
- package/node_modules/js-yaml/lib/js-yaml/type/set.js +29 -0
- package/node_modules/js-yaml/lib/js-yaml/type/str.js +8 -0
- package/node_modules/js-yaml/lib/js-yaml/type/timestamp.js +88 -0
- package/node_modules/js-yaml/lib/js-yaml/type.js +61 -0
- package/node_modules/js-yaml/lib/js-yaml.js +39 -0
- package/node_modules/js-yaml/package.json +52 -0
- package/node_modules/kind-of/LICENSE +21 -0
- package/node_modules/kind-of/README.md +367 -0
- package/node_modules/kind-of/index.js +129 -0
- package/node_modules/kind-of/package.json +88 -0
- package/node_modules/pi-toggle-skills/README.md +213 -0
- package/node_modules/pi-toggle-skills/package.json +60 -0
- package/node_modules/pi-toggle-skills/src/index.ts +112 -0
- package/node_modules/pi-toggle-skills/src/skill-discovery.ts +258 -0
- package/node_modules/pi-toggle-skills/src/skill-selector.ts +435 -0
- package/node_modules/pi-toggle-skills/toggle-skills.ts +316 -0
- package/node_modules/pi-toggle-skills/vitest.config.ts +15 -0
- package/node_modules/proper-lockfile/LICENSE +21 -0
- package/node_modules/proper-lockfile/README.md +183 -0
- package/node_modules/proper-lockfile/index.js +40 -0
- package/node_modules/proper-lockfile/lib/adapter.js +85 -0
- package/node_modules/proper-lockfile/lib/lockfile.js +342 -0
- package/node_modules/proper-lockfile/lib/mtime-precision.js +55 -0
- package/node_modules/proper-lockfile/node_modules/retry/.npmignore +3 -0
- package/node_modules/proper-lockfile/node_modules/retry/.travis.yml +15 -0
- package/node_modules/proper-lockfile/node_modules/retry/License +21 -0
- package/node_modules/proper-lockfile/node_modules/retry/Makefile +18 -0
- package/node_modules/proper-lockfile/node_modules/retry/README.md +227 -0
- package/node_modules/proper-lockfile/node_modules/retry/equation.gif +0 -0
- package/node_modules/proper-lockfile/node_modules/retry/example/dns.js +31 -0
- package/node_modules/proper-lockfile/node_modules/retry/example/stop.js +40 -0
- package/node_modules/proper-lockfile/node_modules/retry/index.js +1 -0
- package/node_modules/proper-lockfile/node_modules/retry/lib/retry.js +100 -0
- package/node_modules/proper-lockfile/node_modules/retry/lib/retry_operation.js +158 -0
- package/node_modules/proper-lockfile/node_modules/retry/package.json +32 -0
- package/node_modules/proper-lockfile/node_modules/retry/test/common.js +10 -0
- package/node_modules/proper-lockfile/node_modules/retry/test/integration/test-forever.js +24 -0
- package/node_modules/proper-lockfile/node_modules/retry/test/integration/test-retry-operation.js +258 -0
- package/node_modules/proper-lockfile/node_modules/retry/test/integration/test-retry-wrap.js +101 -0
- package/node_modules/proper-lockfile/node_modules/retry/test/integration/test-timeouts.js +69 -0
- package/node_modules/proper-lockfile/package.json +71 -0
- package/node_modules/section-matter/LICENSE +21 -0
- package/node_modules/section-matter/README.md +236 -0
- package/node_modules/section-matter/index.js +136 -0
- package/node_modules/section-matter/package.json +55 -0
- package/node_modules/signal-exit/LICENSE.txt +16 -0
- package/node_modules/signal-exit/README.md +39 -0
- package/node_modules/signal-exit/index.js +202 -0
- package/node_modules/signal-exit/package.json +38 -0
- package/node_modules/signal-exit/signals.js +53 -0
- package/node_modules/sprintf-js/.npmignore +1 -0
- package/node_modules/sprintf-js/LICENSE +24 -0
- package/node_modules/sprintf-js/README.md +88 -0
- package/node_modules/sprintf-js/bower.json +14 -0
- package/node_modules/sprintf-js/demo/angular.html +20 -0
- package/node_modules/sprintf-js/dist/angular-sprintf.min.js +4 -0
- package/node_modules/sprintf-js/dist/angular-sprintf.min.js.map +1 -0
- package/node_modules/sprintf-js/dist/angular-sprintf.min.map +1 -0
- package/node_modules/sprintf-js/dist/sprintf.min.js +4 -0
- package/node_modules/sprintf-js/dist/sprintf.min.js.map +1 -0
- package/node_modules/sprintf-js/dist/sprintf.min.map +1 -0
- package/node_modules/sprintf-js/gruntfile.js +36 -0
- package/node_modules/sprintf-js/package.json +22 -0
- package/node_modules/sprintf-js/src/angular-sprintf.js +18 -0
- package/node_modules/sprintf-js/src/sprintf.js +208 -0
- package/node_modules/sprintf-js/test/test.js +82 -0
- package/node_modules/strip-bom-string/LICENSE +21 -0
- package/node_modules/strip-bom-string/README.md +66 -0
- package/node_modules/strip-bom-string/index.js +15 -0
- package/node_modules/strip-bom-string/package.json +60 -0
- package/package.json +13 -4
- package/dist/confirmation.d.ts +0 -33
- package/dist/confirmation.js +0 -64
- package/dist/yolo.d.ts +0 -6
- package/dist/yolo.js +0 -33
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
import type { ChainCompletionSource } from "./chain-autocomplete.ts";
|
|
3
|
+
import {
|
|
4
|
+
createLazySelectionHistory,
|
|
5
|
+
rankWithSelectionHistory,
|
|
6
|
+
type SelectionHistory,
|
|
7
|
+
} from "./initial-suggestions.ts";
|
|
8
|
+
import type { ExpansionSource } from "./mention-resolution.ts";
|
|
9
|
+
import { createSourceController } from "./source-controller.ts";
|
|
10
|
+
import type { Candidate } from "./source-contract.ts";
|
|
11
|
+
import type { MentionConfiguration, MentionRegistration } from "./register-mention.ts";
|
|
12
|
+
|
|
13
|
+
export type SourceRuntime = {
|
|
14
|
+
readonly id: string;
|
|
15
|
+
readonly controller: ReturnType<typeof createSourceController>;
|
|
16
|
+
readonly source: ChainCompletionSource & ExpansionSource;
|
|
17
|
+
readonly history: SelectionHistory;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/** Compose one provider's discovery, ranking, persistence and expansion behavior. */
|
|
21
|
+
export function createSourceRuntime(
|
|
22
|
+
ctx: ExtensionContext,
|
|
23
|
+
registration: MentionRegistration,
|
|
24
|
+
configuration: MentionConfiguration,
|
|
25
|
+
): SourceRuntime {
|
|
26
|
+
const provider = registration.provider(ctx);
|
|
27
|
+
const controller = createSourceController(provider, {
|
|
28
|
+
...configuration,
|
|
29
|
+
sourceId: registration.id,
|
|
30
|
+
cwd: ctx.cwd,
|
|
31
|
+
trusted: ctx.isProjectTrusted(),
|
|
32
|
+
onError: () =>
|
|
33
|
+
ctx.ui.notify(
|
|
34
|
+
`Mention source ${registration.id} could not refresh its candidates.`,
|
|
35
|
+
"warning",
|
|
36
|
+
),
|
|
37
|
+
});
|
|
38
|
+
const history = createLazySelectionHistory({
|
|
39
|
+
stateFileName: `pi-mention-anything-${registration.id}-selections.json`,
|
|
40
|
+
errorMessage: `Mention source ${registration.id} could not use its selection history.`,
|
|
41
|
+
onError: (message) => ctx.ui.notify(message, "warning"),
|
|
42
|
+
});
|
|
43
|
+
let replacement: ExpansionSource["replacement"];
|
|
44
|
+
const registrationReplacement = registration.replacement;
|
|
45
|
+
if (registrationReplacement !== undefined) {
|
|
46
|
+
replacement = (
|
|
47
|
+
path,
|
|
48
|
+
options,
|
|
49
|
+
): ReturnType<NonNullable<MentionRegistration["replacement"]>> =>
|
|
50
|
+
registrationReplacement(path, ctx, options);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const source: ChainCompletionSource & ExpansionSource = {
|
|
54
|
+
id: registration.id,
|
|
55
|
+
trigger: configuration.trigger,
|
|
56
|
+
separator: configuration.separator,
|
|
57
|
+
completionSuffix: configuration.completionSuffix ?? " ",
|
|
58
|
+
filtering: provider.filtering,
|
|
59
|
+
expansionPolicy: configuration.expansionPolicy,
|
|
60
|
+
replacementTemplate: configuration.replacementTemplate,
|
|
61
|
+
async discover(request) {
|
|
62
|
+
const response = await controller.discover(request);
|
|
63
|
+
if (provider.filtering !== "local" || request.query !== "") return response;
|
|
64
|
+
|
|
65
|
+
const initial = configuration.initialSuggestions ?? {
|
|
66
|
+
strategy: "frecency",
|
|
67
|
+
pinned: [],
|
|
68
|
+
};
|
|
69
|
+
const identityOf = (candidate: Candidate): string =>
|
|
70
|
+
JSON.stringify([...request.path.map((parent) => parent.id), candidate.id]);
|
|
71
|
+
|
|
72
|
+
const pinned = initial.pinned.flatMap((name) =>
|
|
73
|
+
response.items
|
|
74
|
+
.filter((candidate) => candidate.id === name || candidate.segment === name)
|
|
75
|
+
.map(identityOf),
|
|
76
|
+
);
|
|
77
|
+
let ordered = response.items;
|
|
78
|
+
let strategy = initial.strategy;
|
|
79
|
+
if (initial.strategy === "alphabetical") {
|
|
80
|
+
ordered = [...response.items].sort((left, right) =>
|
|
81
|
+
left.label.localeCompare(right.label),
|
|
82
|
+
);
|
|
83
|
+
strategy = "sourceOrder";
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const items = await rankWithSelectionHistory(
|
|
87
|
+
ordered,
|
|
88
|
+
identityOf,
|
|
89
|
+
{ strategy, pinned },
|
|
90
|
+
history,
|
|
91
|
+
);
|
|
92
|
+
return { ...response, items };
|
|
93
|
+
},
|
|
94
|
+
resolve: async (segments, signal) => controller.resolve(segments, signal),
|
|
95
|
+
replacement,
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
return { id: registration.id, controller, source, history };
|
|
99
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Pi Mention Skill
|
|
2
|
+
|
|
3
|
+
<a href="https://www.npmjs.com/package/@zigai/pi-mention-skill"><img alt="npm version" src="https://img.shields.io/npm/v/@zigai/pi-mention-skill.svg?color=blue" style="display:inline-block;border:0" /></a> <a href="https://www.npmjs.com/package/@zigai/pi-mention-skill"><img alt="npm downloads" src="https://img.shields.io/npm/dm/@zigai/pi-mention-skill.svg" style="display:inline-block;border:0" /></a> <a href="https://github.com/zigai/pi-tweaks/blob/master/LICENSE"><img alt="license" src="https://img.shields.io/npm/l/@zigai/pi-mention-skill.svg" style="display:inline-block;border:0" /></a>
|
|
4
|
+
|
|
5
|
+
Move Pi skill selection from slash autocomplete to `$` mentions.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
pi install npm:@zigai/pi-mention-skill
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Features
|
|
14
|
+
|
|
15
|
+
- Adds fuzzy skill autocomplete with `$` mentions.
|
|
16
|
+
- Ranks initial suggestions by frecency, recency, frequency, name, or command order.
|
|
17
|
+
- Supports custom triggers, pinned skills, and optional project-local priority.
|
|
18
|
+
- Expands mentions such as `$skill-name` before the model sees the prompt.
|
|
19
|
+
- Keeps `/skill:*` entries out of slash autocomplete by default.
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
Type `$` in the prompt editor to open skill suggestions, then select a skill.
|
|
24
|
+
|
|
25
|
+
The selected mention loads the same skill content that `/skill:name` would have loaded, while keeping skills out of the normal slash command picker.
|
|
26
|
+
|
|
27
|
+
History-based ordering records autocomplete selections in `~/.pi/agent/state/pi-mention-skill-selections.json`. Frecency combines selection count with recency; manually typed mentions do not update this history.
|
|
28
|
+
|
|
29
|
+
<!-- pi-extension-settings:start -->
|
|
30
|
+
## Configuration
|
|
31
|
+
|
|
32
|
+
Global settings are stored in `~/.pi/agent/extension-settings/pi-mention-skill.json`.
|
|
33
|
+
|
|
34
|
+
| Option | Type | Default | Description |
|
|
35
|
+
| --- | --- | --- | --- |
|
|
36
|
+
| `trigger` | string | `"$"` | One or more non-whitespace, non-slash characters that start a skill mention. |
|
|
37
|
+
| `hideSlashSkills` | boolean | `true` | Hide skill commands from slash-command completion. |
|
|
38
|
+
| `completionSuffix` | string | `" "` | Text inserted after a completed skill mention. |
|
|
39
|
+
| `initialSuggestions.strategy` | `frecency` \| `recent` \| `frequent` \| `alphabetical` \| `sourceOrder` | `"frecency"` | Ordering used before any skill query text is entered. |
|
|
40
|
+
| `initialSuggestions.pinned` | string[] | `[]` | Skill names placed first, in this order, before the configured strategy. |
|
|
41
|
+
| `initialSuggestions.projectSkillsFirst` | boolean | `false` | Place project-local skills before user and temporary skills in initial suggestions. |
|
|
42
|
+
|
|
43
|
+
```json
|
|
44
|
+
{
|
|
45
|
+
"$schema": "./schemas/pi-mention-skill.schema.json",
|
|
46
|
+
"trigger": "$",
|
|
47
|
+
"hideSlashSkills": true,
|
|
48
|
+
"completionSuffix": " ",
|
|
49
|
+
"initialSuggestions": {
|
|
50
|
+
"strategy": "frecency",
|
|
51
|
+
"pinned": [],
|
|
52
|
+
"projectSkillsFirst": false
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
<!-- pi-extension-settings:end -->
|
|
57
|
+
|
|
58
|
+
## License
|
|
59
|
+
|
|
60
|
+
MIT
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://raw.githubusercontent.com/zigai/pi-tweaks/master/packages/pi-mention-skill/config.schema.json",
|
|
4
|
+
"title": "Pi Mention Skill settings",
|
|
5
|
+
"description": "Settings for skill mentions and slash-skill visibility.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"properties": {
|
|
9
|
+
"$schema": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"default": "./schemas/pi-mention-skill.schema.json",
|
|
12
|
+
"description": "JSON Schema used by editors for this settings file."
|
|
13
|
+
},
|
|
14
|
+
"trigger": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"minLength": 1,
|
|
17
|
+
"pattern": "^[^/\\s]+$",
|
|
18
|
+
"default": "$",
|
|
19
|
+
"description": "One or more non-whitespace, non-slash characters that start a skill mention."
|
|
20
|
+
},
|
|
21
|
+
"hideSlashSkills": {
|
|
22
|
+
"type": "boolean",
|
|
23
|
+
"default": true,
|
|
24
|
+
"description": "Hide skill commands from slash-command completion."
|
|
25
|
+
},
|
|
26
|
+
"completionSuffix": {
|
|
27
|
+
"type": "string",
|
|
28
|
+
"default": " ",
|
|
29
|
+
"description": "Text inserted after a completed skill mention."
|
|
30
|
+
},
|
|
31
|
+
"initialSuggestions": {
|
|
32
|
+
"type": "object",
|
|
33
|
+
"properties": {
|
|
34
|
+
"strategy": {
|
|
35
|
+
"anyOf": [
|
|
36
|
+
{
|
|
37
|
+
"type": "string",
|
|
38
|
+
"const": "frecency"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"type": "string",
|
|
42
|
+
"const": "recent"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"type": "string",
|
|
46
|
+
"const": "frequent"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"type": "string",
|
|
50
|
+
"const": "alphabetical"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"type": "string",
|
|
54
|
+
"const": "sourceOrder"
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
"default": "frecency",
|
|
58
|
+
"description": "Ordering used before any skill query text is entered."
|
|
59
|
+
},
|
|
60
|
+
"pinned": {
|
|
61
|
+
"type": "array",
|
|
62
|
+
"items": {
|
|
63
|
+
"type": "string",
|
|
64
|
+
"minLength": 1
|
|
65
|
+
},
|
|
66
|
+
"default": [],
|
|
67
|
+
"uniqueItems": true,
|
|
68
|
+
"description": "Skill names placed first, in this order, before the configured strategy."
|
|
69
|
+
},
|
|
70
|
+
"projectSkillsFirst": {
|
|
71
|
+
"type": "boolean",
|
|
72
|
+
"default": false,
|
|
73
|
+
"description": "Place project-local skills before user and temporary skills in initial suggestions."
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"default": {},
|
|
77
|
+
"additionalProperties": false,
|
|
78
|
+
"description": "Controls the entries shown immediately after the trigger."
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@zigai/pi-mention-skill",
|
|
3
|
+
"version": "0.10.4",
|
|
4
|
+
"description": "Pi package that moves skill discovery from slash commands to $ mentions.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"mention",
|
|
7
|
+
"pi",
|
|
8
|
+
"pi-coding-agent",
|
|
9
|
+
"pi-extension",
|
|
10
|
+
"pi-package",
|
|
11
|
+
"pi-tweaks",
|
|
12
|
+
"skill"
|
|
13
|
+
],
|
|
14
|
+
"homepage": "https://github.com/zigai/pi-tweaks/tree/main/packages/pi-mention-skill#readme",
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/zigai/pi-tweaks/issues"
|
|
17
|
+
},
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"author": "zigai",
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "git+https://github.com/zigai/pi-tweaks.git",
|
|
23
|
+
"directory": "packages/pi-mention-skill"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"src",
|
|
27
|
+
"README.md",
|
|
28
|
+
"*.json"
|
|
29
|
+
],
|
|
30
|
+
"type": "module",
|
|
31
|
+
"exports": {
|
|
32
|
+
".": "./src/index.ts"
|
|
33
|
+
},
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"access": "public"
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"@zigai/pi-extension-settings": "0.5.3",
|
|
39
|
+
"@zigai/pi-mention-anything": "0.1.4"
|
|
40
|
+
},
|
|
41
|
+
"peerDependencies": {
|
|
42
|
+
"@earendil-works/pi-coding-agent": "*",
|
|
43
|
+
"typebox": "*"
|
|
44
|
+
},
|
|
45
|
+
"pi": {
|
|
46
|
+
"extensions": [
|
|
47
|
+
"./src/index.ts"
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
"piExtensionSettings": {
|
|
51
|
+
"definition": "./src/settings-input.ts",
|
|
52
|
+
"schema": "./config.schema.json",
|
|
53
|
+
"readme": "./README.md",
|
|
54
|
+
"prevalidation": "./src/settings.prevalidated.ts"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
import { registerMention, type MentionExtensionApi } from "@zigai/pi-mention-anything/api";
|
|
3
|
+
import { createCachedSkillExpansionLoader } from "./skill-content.ts";
|
|
4
|
+
import { loadMentionSkillSettingsResult } from "./settings.ts";
|
|
5
|
+
import { createSkillProvider, resolveSkillCandidate } from "./skill-provider.ts";
|
|
6
|
+
import { getSkillCommands } from "./skill-commands.ts";
|
|
7
|
+
import { createSlashSkillFilter } from "./slash-skill-filter.ts";
|
|
8
|
+
|
|
9
|
+
export type MentionSkillExtensionApi = Pick<ExtensionAPI, "getCommands"> & MentionExtensionApi;
|
|
10
|
+
|
|
11
|
+
export default function (pi: MentionSkillExtensionApi): void {
|
|
12
|
+
const loadSkillExpansion = createCachedSkillExpansionLoader();
|
|
13
|
+
const settingsByContext = new WeakMap<
|
|
14
|
+
object,
|
|
15
|
+
ReturnType<typeof loadMentionSkillSettingsResult>
|
|
16
|
+
>();
|
|
17
|
+
const settingsFor = (ctx: Parameters<typeof loadMentionSkillSettingsResult>[0]) => {
|
|
18
|
+
const cached = settingsByContext.get(ctx);
|
|
19
|
+
if (cached !== undefined) return cached;
|
|
20
|
+
|
|
21
|
+
const loaded = loadMentionSkillSettingsResult(ctx);
|
|
22
|
+
settingsByContext.set(ctx, loaded);
|
|
23
|
+
return loaded;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
pi.on("session_start", (_event, ctx) => {
|
|
27
|
+
const loaded = settingsFor(ctx);
|
|
28
|
+
if (ctx.hasUI) {
|
|
29
|
+
for (const diagnostic of loaded.diagnostics) {
|
|
30
|
+
ctx.ui.notify(diagnostic.message, diagnostic.severity);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
if (ctx.hasUI && loaded.settings.hideSlashSkills) {
|
|
34
|
+
ctx.ui.addAutocompleteProvider(createSlashSkillFilter);
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
registerMention(pi, {
|
|
39
|
+
id: "skill",
|
|
40
|
+
configuration(ctx) {
|
|
41
|
+
const { settings } = settingsFor(ctx);
|
|
42
|
+
return {
|
|
43
|
+
trigger: settings.trigger,
|
|
44
|
+
completionSuffix: settings.completionSuffix,
|
|
45
|
+
initialSuggestions: settings.initialSuggestions,
|
|
46
|
+
expansionPolicy: "selected-or-resolved",
|
|
47
|
+
};
|
|
48
|
+
},
|
|
49
|
+
provider(ctx) {
|
|
50
|
+
const { settings } = settingsFor(ctx);
|
|
51
|
+
|
|
52
|
+
return createSkillProvider(() => getSkillCommands(pi), loadSkillExpansion, {
|
|
53
|
+
projectSkillsFirst: settings.initialSuggestions.projectSkillsFirst,
|
|
54
|
+
});
|
|
55
|
+
},
|
|
56
|
+
async replacement(candidatePath, _ctx, options) {
|
|
57
|
+
return resolveSkillCandidate(candidatePath, loadSkillExpansion, options.signal);
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { Type, type StaticDecode } from "typebox";
|
|
2
|
+
|
|
3
|
+
export const DEFAULT_MENTION_TRIGGER = "$";
|
|
4
|
+
export const DEFAULT_COMPLETION_SUFFIX = " ";
|
|
5
|
+
|
|
6
|
+
export const initialSuggestionStrategySchema = Type.Union(
|
|
7
|
+
[
|
|
8
|
+
Type.Literal("frecency"),
|
|
9
|
+
Type.Literal("recent"),
|
|
10
|
+
Type.Literal("frequent"),
|
|
11
|
+
Type.Literal("alphabetical"),
|
|
12
|
+
Type.Literal("sourceOrder"),
|
|
13
|
+
],
|
|
14
|
+
{
|
|
15
|
+
default: "frecency",
|
|
16
|
+
description: "Ordering used before any skill query text is entered.",
|
|
17
|
+
},
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
export const mentionSkillSettingsSchema = Type.Object(
|
|
21
|
+
{
|
|
22
|
+
trigger: Type.String({
|
|
23
|
+
minLength: 1,
|
|
24
|
+
pattern: "^[^/\\s]+$",
|
|
25
|
+
default: DEFAULT_MENTION_TRIGGER,
|
|
26
|
+
description:
|
|
27
|
+
"One or more non-whitespace, non-slash characters that start a skill mention.",
|
|
28
|
+
}),
|
|
29
|
+
hideSlashSkills: Type.Boolean({
|
|
30
|
+
default: true,
|
|
31
|
+
description: "Hide skill commands from slash-command completion.",
|
|
32
|
+
}),
|
|
33
|
+
completionSuffix: Type.String({
|
|
34
|
+
default: DEFAULT_COMPLETION_SUFFIX,
|
|
35
|
+
description: "Text inserted after a completed skill mention.",
|
|
36
|
+
}),
|
|
37
|
+
initialSuggestions: Type.Object(
|
|
38
|
+
{
|
|
39
|
+
strategy: initialSuggestionStrategySchema,
|
|
40
|
+
pinned: Type.Array(Type.String({ minLength: 1 }), {
|
|
41
|
+
default: [],
|
|
42
|
+
uniqueItems: true,
|
|
43
|
+
description:
|
|
44
|
+
"Skill names placed first, in this order, before the configured strategy.",
|
|
45
|
+
}),
|
|
46
|
+
projectSkillsFirst: Type.Boolean({
|
|
47
|
+
default: false,
|
|
48
|
+
description:
|
|
49
|
+
"Place project-local skills before user and temporary skills in initial suggestions.",
|
|
50
|
+
}),
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
default: {},
|
|
54
|
+
additionalProperties: false,
|
|
55
|
+
description: "Controls the entries shown immediately after the trigger.",
|
|
56
|
+
},
|
|
57
|
+
),
|
|
58
|
+
},
|
|
59
|
+
{ additionalProperties: false },
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
export type MentionSkillSettings = StaticDecode<typeof mentionSkillSettingsSchema>;
|
|
63
|
+
export type InitialSuggestionsSettings = MentionSkillSettings["initialSuggestions"];
|
|
64
|
+
|
|
65
|
+
export const extensionSettingsInput = {
|
|
66
|
+
id: "pi-mention-skill",
|
|
67
|
+
title: "Pi Mention Skill",
|
|
68
|
+
description: "Settings for skill mentions and slash-skill visibility.",
|
|
69
|
+
schemaId:
|
|
70
|
+
"https://raw.githubusercontent.com/zigai/pi-tweaks/master/packages/pi-mention-skill/config.schema.json",
|
|
71
|
+
schema: mentionSkillSettingsSchema,
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export default extensionSettingsInput;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Generated by pi-extension-settings. Do not edit.
|
|
2
|
+
const artifact = {
|
|
3
|
+
"formatVersion": 1,
|
|
4
|
+
"fingerprint": "json-sha256-v1:6068fb01eaa1b4e2e46d7bea643342bd95af1b52617b924f5b45e5bc0266821b",
|
|
5
|
+
"semanticFingerprint": "typebox-value-hash-v1:3ad1f77c03289771",
|
|
6
|
+
"defaultSettings": {
|
|
7
|
+
"trigger": "$",
|
|
8
|
+
"hideSlashSkills": true,
|
|
9
|
+
"completionSuffix": " ",
|
|
10
|
+
"initialSuggestions": {
|
|
11
|
+
"strategy": "frecency",
|
|
12
|
+
"pinned": [],
|
|
13
|
+
"projectSkillsFirst": false
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
} as const;
|
|
17
|
+
|
|
18
|
+
export default artifact;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
|
|
3
|
+
import { loadPiExtensionSettings } from "@zigai/pi-extension-settings/pi";
|
|
4
|
+
|
|
5
|
+
import { definePrevalidatedExtensionSettings } from "@zigai/pi-extension-settings/runtime";
|
|
6
|
+
import { MentionSkillSettings, extensionSettingsInput } from "./settings-input.ts";
|
|
7
|
+
import prevalidatedSettings from "./settings.prevalidated.ts";
|
|
8
|
+
|
|
9
|
+
export * from "./settings-input.ts";
|
|
10
|
+
|
|
11
|
+
export const mentionSkillSettingsDefinition = definePrevalidatedExtensionSettings(
|
|
12
|
+
extensionSettingsInput,
|
|
13
|
+
prevalidatedSettings,
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
export default mentionSkillSettingsDefinition;
|
|
17
|
+
|
|
18
|
+
export type MentionSkillSettingsContext = Pick<ExtensionContext, "cwd" | "isProjectTrusted">;
|
|
19
|
+
|
|
20
|
+
/** Load validated global and trusted-project mention settings with safe diagnostics. */
|
|
21
|
+
export function loadMentionSkillSettingsResult(ctx: MentionSkillSettingsContext) {
|
|
22
|
+
const loaded = loadPiExtensionSettings(
|
|
23
|
+
mentionSkillSettingsDefinition,
|
|
24
|
+
{
|
|
25
|
+
cwd: ctx.cwd,
|
|
26
|
+
isProjectTrusted: () => ctx.isProjectTrusted(),
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
bundledSchema: {
|
|
30
|
+
kind: "url",
|
|
31
|
+
url: new URL("../config.schema.json", import.meta.url),
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
return {
|
|
37
|
+
settings: {
|
|
38
|
+
trigger: loaded.settings.trigger,
|
|
39
|
+
hideSlashSkills: loaded.settings.hideSlashSkills,
|
|
40
|
+
completionSuffix: loaded.settings.completionSuffix,
|
|
41
|
+
initialSuggestions: {
|
|
42
|
+
strategy: loaded.settings.initialSuggestions.strategy,
|
|
43
|
+
pinned: [...loaded.settings.initialSuggestions.pinned],
|
|
44
|
+
projectSkillsFirst: loaded.settings.initialSuggestions.projectSkillsFirst,
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
diagnostics: loaded.diagnostics,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** Load validated global and trusted-project mention settings. */
|
|
52
|
+
export function loadMentionSkillSettings(ctx: MentionSkillSettingsContext): MentionSkillSettings {
|
|
53
|
+
return loadMentionSkillSettingsResult(ctx).settings;
|
|
54
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ExtensionAPI, SlashCommandInfo } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
|
|
3
|
+
export type SkillCommand = SlashCommandInfo & {
|
|
4
|
+
name: `skill:${string}`;
|
|
5
|
+
description: string;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const SKILL_COMMAND_PREFIX = "skill:";
|
|
9
|
+
|
|
10
|
+
export function getSkillCommands(pi: Pick<ExtensionAPI, "getCommands">): SkillCommand[] {
|
|
11
|
+
return pi.getCommands().filter((command): command is SkillCommand => {
|
|
12
|
+
return command.source === "skill" && command.name.startsWith(SKILL_COMMAND_PREFIX);
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function skillName(command: SkillCommand): string {
|
|
17
|
+
return command.name.slice(SKILL_COMMAND_PREFIX.length);
|
|
18
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import fs from "node:fs/promises";
|
|
2
|
+
|
|
3
|
+
export type SkillExpansion = {
|
|
4
|
+
name: string;
|
|
5
|
+
location: string;
|
|
6
|
+
body: string;
|
|
7
|
+
baseDir: string;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export type SkillExpansionTarget = Omit<SkillExpansion, "body">;
|
|
11
|
+
export type SkillExpansionLoader = (target: SkillExpansionTarget) => Promise<SkillExpansion>;
|
|
12
|
+
|
|
13
|
+
type CachedSkillExpansion = {
|
|
14
|
+
mtimeMs: number;
|
|
15
|
+
expansion: SkillExpansion;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export function stripFrontmatter(content: string): string {
|
|
19
|
+
if (!content.startsWith("---")) return content;
|
|
20
|
+
|
|
21
|
+
const end = content.indexOf("\n---", 3);
|
|
22
|
+
if (end === -1) return content;
|
|
23
|
+
|
|
24
|
+
const afterMarker = end + "\n---".length;
|
|
25
|
+
if (content[afterMarker] === "\r" && content[afterMarker + 1] === "\n") {
|
|
26
|
+
return content.slice(afterMarker + 2);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (content[afterMarker] === "\n") {
|
|
30
|
+
return content.slice(afterMarker + 1);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return content.slice(afterMarker);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
async function loadSkillExpansion(target: SkillExpansionTarget): Promise<SkillExpansion> {
|
|
37
|
+
const content = await fs.readFile(target.location, "utf8");
|
|
38
|
+
const body = stripFrontmatter(content).trim();
|
|
39
|
+
return { ...target, body };
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function createCachedSkillExpansionLoader(): SkillExpansionLoader {
|
|
43
|
+
const cache = new Map<string, CachedSkillExpansion>();
|
|
44
|
+
return async (target) => {
|
|
45
|
+
const stats = await fs.stat(target.location);
|
|
46
|
+
const cached = cache.get(target.location);
|
|
47
|
+
if (cached?.mtimeMs === stats.mtimeMs) {
|
|
48
|
+
return cached.expansion;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const expansion = await loadSkillExpansion(target);
|
|
52
|
+
cache.set(target.location, { mtimeMs: stats.mtimeMs, expansion });
|
|
53
|
+
|
|
54
|
+
return expansion;
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function formatSkillBlock(expansion: SkillExpansion): string {
|
|
59
|
+
return `<skill name="${expansion.name}" location="${expansion.location}">\nReferences are relative to ${expansion.baseDir}.\n\n${expansion.body}\n</skill>`;
|
|
60
|
+
}
|