@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,139 @@
|
|
|
1
|
+
var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExtension) || function (path, preserveJsx) {
|
|
2
|
+
if (typeof path === "string" && /^\.\.?\//.test(path)) {
|
|
3
|
+
return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
|
|
4
|
+
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
|
|
5
|
+
});
|
|
6
|
+
}
|
|
7
|
+
return path;
|
|
8
|
+
};
|
|
9
|
+
import { existsSync, readFileSync, realpathSync } from "node:fs";
|
|
10
|
+
import { basename, dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
11
|
+
import { pathToFileURL } from "node:url";
|
|
12
|
+
function isCodingAgentPackageDirectory(directory) {
|
|
13
|
+
return (basename(directory) === "pi-coding-agent" &&
|
|
14
|
+
basename(dirname(directory)) === "@earendil-works");
|
|
15
|
+
}
|
|
16
|
+
function findEntrypointPackageDirectory() {
|
|
17
|
+
if (process.env.PI_CODING_AGENT !== "true")
|
|
18
|
+
return undefined;
|
|
19
|
+
const entrypoint = process.argv.at(1);
|
|
20
|
+
if (entrypoint === undefined || entrypoint.length === 0)
|
|
21
|
+
return undefined;
|
|
22
|
+
let directory = dirname(realpathSync(entrypoint));
|
|
23
|
+
for (;;) {
|
|
24
|
+
if (isCodingAgentPackageDirectory(directory) &&
|
|
25
|
+
existsSync(join(directory, "package.json"))) {
|
|
26
|
+
return directory;
|
|
27
|
+
}
|
|
28
|
+
const parent = dirname(directory);
|
|
29
|
+
if (parent === directory)
|
|
30
|
+
return undefined;
|
|
31
|
+
directory = parent;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
async function resolveRunningPiPackageDirectory() {
|
|
35
|
+
// A managed extension can have no Pi peer beside it. Prefer the explicit host
|
|
36
|
+
// path or the running CLI before trying package resolution from this library.
|
|
37
|
+
const configuredDirectory = process.env.PI_PACKAGE_DIR;
|
|
38
|
+
if (configuredDirectory !== undefined && configuredDirectory.length > 0) {
|
|
39
|
+
return resolve(configuredDirectory);
|
|
40
|
+
}
|
|
41
|
+
const runningDirectory = findEntrypointPackageDirectory();
|
|
42
|
+
if (runningDirectory !== undefined)
|
|
43
|
+
return runningDirectory;
|
|
44
|
+
const { getPackageDir } = await import("@earendil-works/pi-coding-agent");
|
|
45
|
+
return getPackageDir();
|
|
46
|
+
}
|
|
47
|
+
const ENTRYPOINT_IMPORT_PATTERN = /(?:\bfrom\s*|(?:^|;)\s*import\s*)["'](\.\/[^"']+\.js)["']/g;
|
|
48
|
+
async function resolvePiEntrypointModuleUrls() {
|
|
49
|
+
if (process.env.PI_CODING_AGENT !== "true")
|
|
50
|
+
return [];
|
|
51
|
+
const entrypoint = process.argv.at(1);
|
|
52
|
+
if (entrypoint === undefined || entrypoint.length === 0 || !existsSync(entrypoint))
|
|
53
|
+
return [];
|
|
54
|
+
const packageDirectory = resolve(await resolveRunningPiPackageDirectory());
|
|
55
|
+
const entrypointPath = realpathSync(entrypoint);
|
|
56
|
+
const entrypointWithinPackage = relative(packageDirectory, entrypointPath);
|
|
57
|
+
if (entrypointWithinPackage === ".." ||
|
|
58
|
+
entrypointWithinPackage.startsWith(`..${sep}`) ||
|
|
59
|
+
isAbsolute(entrypointWithinPackage)) {
|
|
60
|
+
return [];
|
|
61
|
+
}
|
|
62
|
+
const source = readFileSync(entrypointPath, "utf8");
|
|
63
|
+
const moduleUrls = [];
|
|
64
|
+
for (const match of source.matchAll(ENTRYPOINT_IMPORT_PATTERN)) {
|
|
65
|
+
const specifier = match.at(1);
|
|
66
|
+
if (specifier === undefined)
|
|
67
|
+
continue;
|
|
68
|
+
const modulePath = resolve(dirname(entrypointPath), specifier);
|
|
69
|
+
const moduleWithinPackage = relative(packageDirectory, modulePath);
|
|
70
|
+
if (moduleWithinPackage === ".." ||
|
|
71
|
+
moduleWithinPackage.startsWith(`..${sep}`) ||
|
|
72
|
+
isAbsolute(moduleWithinPackage)) {
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
moduleUrls.push(pathToFileURL(modulePath).href);
|
|
76
|
+
}
|
|
77
|
+
return [...new Set(moduleUrls)];
|
|
78
|
+
}
|
|
79
|
+
/** Resolves a path relative to the running Pi coding-agent distribution. */
|
|
80
|
+
async function resolvePiInternalModuleUrl(relativePath) {
|
|
81
|
+
const codingAgentDirectory = resolve(await resolveRunningPiPackageDirectory(), "dist");
|
|
82
|
+
if (relativePath.length === 0 || isAbsolute(relativePath)) {
|
|
83
|
+
throw new TypeError("Pi internal module path must be relative to the coding-agent package");
|
|
84
|
+
}
|
|
85
|
+
const modulePath = resolve(codingAgentDirectory, relativePath);
|
|
86
|
+
const pathWithinPackage = relative(codingAgentDirectory, modulePath);
|
|
87
|
+
if (pathWithinPackage.length === 0 ||
|
|
88
|
+
pathWithinPackage === ".." ||
|
|
89
|
+
pathWithinPackage.startsWith(`..${sep}`) ||
|
|
90
|
+
isAbsolute(pathWithinPackage)) {
|
|
91
|
+
throw new TypeError("Pi internal module path escapes the coding-agent package");
|
|
92
|
+
}
|
|
93
|
+
return pathToFileURL(modulePath).href;
|
|
94
|
+
}
|
|
95
|
+
/** Reports a disabled best-effort patch without interrupting extension startup. */
|
|
96
|
+
export function warnPiInternalPatchUnavailable(scope, feature, cause) {
|
|
97
|
+
let suffix = "";
|
|
98
|
+
if (cause instanceof Error && cause.message.length > 0) {
|
|
99
|
+
suffix = `: ${cause.message}`;
|
|
100
|
+
}
|
|
101
|
+
console.warn(`[${scope}] ${feature} unavailable; Pi internals may have changed${suffix}`);
|
|
102
|
+
}
|
|
103
|
+
async function parseImportedModule(moduleUrl, options) {
|
|
104
|
+
const imported = await import(__rewriteRelativeImportExtension(moduleUrl));
|
|
105
|
+
return options.parse(imported);
|
|
106
|
+
}
|
|
107
|
+
/** Loads and parses an unsupported Pi internal module, degrading to undefined on failure. */
|
|
108
|
+
export async function loadPiInternalModule(relativePath, options) {
|
|
109
|
+
try {
|
|
110
|
+
const parsed = await parseImportedModule(await resolvePiInternalModuleUrl(relativePath), options);
|
|
111
|
+
if (parsed !== undefined)
|
|
112
|
+
return parsed;
|
|
113
|
+
warnPiInternalPatchUnavailable(options.scope, options.feature);
|
|
114
|
+
return undefined;
|
|
115
|
+
}
|
|
116
|
+
catch (cause) {
|
|
117
|
+
warnPiInternalPatchUnavailable(options.scope, options.feature, cause);
|
|
118
|
+
return undefined;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
/** Loads a runtime-owned export from Pi's bundle before its unbundled fallback module. */
|
|
122
|
+
export async function loadPiRuntimeModule(fallbackRelativePath, options) {
|
|
123
|
+
try {
|
|
124
|
+
for (const moduleUrl of await resolvePiEntrypointModuleUrls()) {
|
|
125
|
+
const parsed = await parseImportedModule(moduleUrl, options);
|
|
126
|
+
if (parsed !== undefined)
|
|
127
|
+
return parsed;
|
|
128
|
+
}
|
|
129
|
+
const fallback = await parseImportedModule(await resolvePiInternalModuleUrl(fallbackRelativePath), options);
|
|
130
|
+
if (fallback !== undefined)
|
|
131
|
+
return fallback;
|
|
132
|
+
warnPiInternalPatchUnavailable(options.scope, options.feature);
|
|
133
|
+
return undefined;
|
|
134
|
+
}
|
|
135
|
+
catch (cause) {
|
|
136
|
+
warnPiInternalPatchUnavailable(options.scope, options.feature, cause);
|
|
137
|
+
return undefined;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@zigai/pi-extension-internals",
|
|
3
|
+
"version": "0.1.5",
|
|
4
|
+
"description": "Shared composition protocols and guarded Pi-internal loading for Pi extensions.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"pi",
|
|
7
|
+
"pi-coding-agent",
|
|
8
|
+
"pi-extension",
|
|
9
|
+
"prototype-patching"
|
|
10
|
+
],
|
|
11
|
+
"homepage": "https://github.com/zigai/pi-tweaks/tree/main/packages/pi-extension-internals#readme",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/zigai/pi-tweaks/issues"
|
|
14
|
+
},
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"author": "zigai",
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://github.com/zigai/pi-tweaks.git",
|
|
20
|
+
"directory": "packages/pi-extension-internals"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"dist",
|
|
24
|
+
"README.md"
|
|
25
|
+
],
|
|
26
|
+
"type": "module",
|
|
27
|
+
"types": "./dist/index.d.ts",
|
|
28
|
+
"exports": {
|
|
29
|
+
".": "./dist/index.js"
|
|
30
|
+
},
|
|
31
|
+
"publishConfig": {
|
|
32
|
+
"access": "public"
|
|
33
|
+
},
|
|
34
|
+
"scripts": {
|
|
35
|
+
"build": "tsc -p tsconfig.build.json",
|
|
36
|
+
"prepack": "npm run build"
|
|
37
|
+
},
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"@earendil-works/pi-coding-agent": "*"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 zigai
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Pi Extension Settings
|
|
2
|
+
|
|
3
|
+
Persistent, typed settings for [Pi](https://github.com/earendil-works/pi) extensions. Define one TypeBox schema and reuse it for runtime types, validation, defaults, editor schemas, and user documentation.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
Using [Pi Extension Template](https://github.com/zigai/pi-extension-template) is the recommended way to create a new extension. It generates the settings structure, commands, and runtime loader for you.
|
|
8
|
+
|
|
9
|
+
To add settings to an existing extension:
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
npm install @zigai/pi-extension-settings
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Then follow [Add settings to an existing Pi extension](docs/manual-setup.md).
|
|
16
|
+
|
|
17
|
+
## Features
|
|
18
|
+
|
|
19
|
+
- Typed defaults and decoded runtime values from one TypeBox schema
|
|
20
|
+
- Global settings with optional trusted-project overrides
|
|
21
|
+
- Generated `config.schema.json` and README configuration documentation
|
|
22
|
+
- A checked-in prevalidation artifact for the Pi runtime path
|
|
23
|
+
- Safe diagnostics that do not expose setting values
|
|
24
|
+
- Locked, validated, atomic settings updates when an extension needs to write configuration
|
|
25
|
+
|
|
26
|
+
## Documentation
|
|
27
|
+
|
|
28
|
+
- [Add settings to an existing Pi extension](docs/manual-setup.md)
|
|
29
|
+
- [Generated artifacts and command behavior](docs/generation.md)
|
|
30
|
+
- [Runtime loading and transactional updates](docs/runtime.md)
|
|
31
|
+
- [Optional settings-editor controls](docs/ui-controls.md)
|
|
32
|
+
- [Generate a complete extension with Pi Extension Template](https://github.com/zigai/pi-extension-template)
|
|
33
|
+
|
|
34
|
+
## License
|
|
35
|
+
|
|
36
|
+
[MIT](LICENSE)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ExtensionSettingsDefinition } from "./definition.ts";
|
|
2
|
+
export type SettingsArtifactTargets = {
|
|
3
|
+
readonly schemaPath: string;
|
|
4
|
+
readonly readmePath: string;
|
|
5
|
+
readonly prevalidationPath?: string;
|
|
6
|
+
readonly globalPath?: string;
|
|
7
|
+
};
|
|
8
|
+
export type RenderedSettingsArtifacts = {
|
|
9
|
+
readonly schema: string;
|
|
10
|
+
readonly readmeSection: string;
|
|
11
|
+
readonly prevalidation?: string;
|
|
12
|
+
};
|
|
13
|
+
export type GeneratedSettingsArtifacts = {
|
|
14
|
+
readonly changedPaths: readonly string[];
|
|
15
|
+
};
|
|
16
|
+
export type CheckedSettingsArtifacts = {
|
|
17
|
+
readonly current: boolean;
|
|
18
|
+
readonly stalePaths: readonly string[];
|
|
19
|
+
};
|
|
20
|
+
export declare function renderSettingsArtifacts(definition: ExtensionSettingsDefinition, targets: SettingsArtifactTargets): RenderedSettingsArtifacts;
|
|
21
|
+
export declare function generateSettingsArtifacts(definition: ExtensionSettingsDefinition, targets: SettingsArtifactTargets): GeneratedSettingsArtifacts;
|
|
22
|
+
export declare function checkSettingsArtifacts(definition: ExtensionSettingsDefinition, targets: SettingsArtifactTargets): CheckedSettingsArtifacts;
|
|
23
|
+
//# sourceMappingURL=artifacts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifacts.d.ts","sourceRoot":"","sources":["../src/artifacts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AAWnE,MAAM,MAAM,uBAAuB,GAAG;IAClC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IACpC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACpC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACrC,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;CAC5C,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACnC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;CAC1C,CAAC;AAiBF,wBAAgB,uBAAuB,CACnC,UAAU,EAAE,2BAA2B,EACvC,OAAO,EAAE,uBAAuB,GACjC,yBAAyB,CAQ3B;AAeD,wBAAgB,yBAAyB,CACrC,UAAU,EAAE,2BAA2B,EACvC,OAAO,EAAE,uBAAuB,GACjC,0BAA0B,CAoB5B;AAED,wBAAgB,sBAAsB,CAClC,UAAU,EAAE,2BAA2B,EACvC,OAAO,EAAE,uBAAuB,GACjC,wBAAwB,CAqB1B"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { readTextIfPresent, writeTextAtomically } from "./file-system.js";
|
|
2
|
+
import { formatJson } from "./json-value.js";
|
|
3
|
+
import { createPrevalidatedExtensionSettingsArtifact } from "./runtime.js";
|
|
4
|
+
import { renderReadmeSettingsSection, replaceGeneratedReadmeSection, } from "./settings-documentation.js";
|
|
5
|
+
import { createSettingsFileSchema } from "./schema-document.js";
|
|
6
|
+
function readmeRenderOptions(targets) {
|
|
7
|
+
return targets.globalPath === undefined ? {} : { globalPath: targets.globalPath };
|
|
8
|
+
}
|
|
9
|
+
function renderPrevalidation(definition) {
|
|
10
|
+
const artifact = createPrevalidatedExtensionSettingsArtifact(definition);
|
|
11
|
+
return [
|
|
12
|
+
"// Generated by pi-extension-settings. Do not edit.",
|
|
13
|
+
`const artifact = ${JSON.stringify(artifact, undefined, 4)} as const;`,
|
|
14
|
+
"",
|
|
15
|
+
"export default artifact;",
|
|
16
|
+
"",
|
|
17
|
+
].join("\n");
|
|
18
|
+
}
|
|
19
|
+
export function renderSettingsArtifacts(definition, targets) {
|
|
20
|
+
const rendered = {
|
|
21
|
+
schema: formatJson(createSettingsFileSchema(definition)),
|
|
22
|
+
readmeSection: renderReadmeSettingsSection(definition, readmeRenderOptions(targets)),
|
|
23
|
+
};
|
|
24
|
+
return targets.prevalidationPath === undefined
|
|
25
|
+
? rendered
|
|
26
|
+
: { ...rendered, prevalidation: renderPrevalidation(definition) };
|
|
27
|
+
}
|
|
28
|
+
function expectedReadme(readmePath, section) {
|
|
29
|
+
const current = readTextIfPresent(readmePath);
|
|
30
|
+
if (current === undefined) {
|
|
31
|
+
throw new Error(`README does not exist: ${readmePath}`);
|
|
32
|
+
}
|
|
33
|
+
const expected = replaceGeneratedReadmeSection(current, section);
|
|
34
|
+
if (expected === undefined) {
|
|
35
|
+
throw new Error(`README generation markers are invalid in ${readmePath}`);
|
|
36
|
+
}
|
|
37
|
+
return expected;
|
|
38
|
+
}
|
|
39
|
+
export function generateSettingsArtifacts(definition, targets) {
|
|
40
|
+
const rendered = renderSettingsArtifacts(definition, targets);
|
|
41
|
+
const readme = expectedReadme(targets.readmePath, rendered.readmeSection);
|
|
42
|
+
const changedPaths = [];
|
|
43
|
+
if (writeTextAtomically(targets.schemaPath, rendered.schema) !== "unchanged") {
|
|
44
|
+
changedPaths.push(targets.schemaPath);
|
|
45
|
+
}
|
|
46
|
+
if (writeTextAtomically(targets.readmePath, readme) !== "unchanged") {
|
|
47
|
+
changedPaths.push(targets.readmePath);
|
|
48
|
+
}
|
|
49
|
+
if (targets.prevalidationPath !== undefined &&
|
|
50
|
+
rendered.prevalidation !== undefined &&
|
|
51
|
+
writeTextAtomically(targets.prevalidationPath, rendered.prevalidation) !== "unchanged") {
|
|
52
|
+
changedPaths.push(targets.prevalidationPath);
|
|
53
|
+
}
|
|
54
|
+
return { changedPaths };
|
|
55
|
+
}
|
|
56
|
+
export function checkSettingsArtifacts(definition, targets) {
|
|
57
|
+
const rendered = renderSettingsArtifacts(definition, targets);
|
|
58
|
+
const readme = expectedReadme(targets.readmePath, rendered.readmeSection);
|
|
59
|
+
const schemaCurrent = readTextIfPresent(targets.schemaPath);
|
|
60
|
+
const readmeCurrent = readTextIfPresent(targets.readmePath);
|
|
61
|
+
const prevalidationCurrent = targets.prevalidationPath === undefined
|
|
62
|
+
? undefined
|
|
63
|
+
: readTextIfPresent(targets.prevalidationPath);
|
|
64
|
+
const stalePaths = [];
|
|
65
|
+
if (schemaCurrent !== rendered.schema)
|
|
66
|
+
stalePaths.push(targets.schemaPath);
|
|
67
|
+
if (readmeCurrent !== readme)
|
|
68
|
+
stalePaths.push(targets.readmePath);
|
|
69
|
+
if (targets.prevalidationPath !== undefined &&
|
|
70
|
+
prevalidationCurrent !== rendered.prevalidation) {
|
|
71
|
+
stalePaths.push(targets.prevalidationPath);
|
|
72
|
+
}
|
|
73
|
+
return { current: stalePaths.length === 0, stalePaths };
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=artifacts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifacts.js","sourceRoot":"","sources":["../src/artifacts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,C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CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAC9D,MAAM,MAAM,GAAG,cAAc,CAAC,OAAO,CAAC,UAAU,EAAE,QAAQ,CAAC,aAAa,CAAC,CAAC;IAC1E,MAAM,aAAa,GAAG,iBAAiB,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAC5D,MAAM,aAAa,GAAG,iBAAiB,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAC5D,MAAM,oBAAoB,GACtB,OAAO,CAAC,iBAAiB,KAAK,SAAS;QACnC,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,iBAAiB,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAEvD,MAAM,UAAU,GAAa,EAAE,CAAC;IAChC,IAAI,aAAa,KAAK,QAAQ,CAAC,MAAM;QAAE,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAC3E,IAAI,aAAa,KAAK,MAAM;QAAE,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAClE,IACI,OAAO,CAAC,iBAAiB,KAAK,SAAS;QACvC,oBAAoB,KAAK,QAAQ,CAAC,aAAa,EACjD,CAAC;QACC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAC/C,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,UAAU,EAAE,CAAC;AAC5D,CAAC","sourcesContent":["import type { ExtensionSettingsDefinition } from \"./definition.ts\";\nimport { readTextIfPresent, writeTextAtomically } from \"./file-system.ts\";\nimport { formatJson } from \"./json-value.ts\";\nimport { createPrevalidatedExtensionSettingsArtifact } from \"./runtime.ts\";\nimport {\n renderReadmeSettingsSection,\n replaceGeneratedReadmeSection,\n type RenderReadmeOptions,\n} from \"./settings-documentation.ts\";\nimport { createSettingsFileSchema } from \"./schema-document.ts\";\n\nexport type SettingsArtifactTargets = {\n readonly schemaPath: string;\n readonly readmePath: string;\n readonly prevalidationPath?: string;\n readonly globalPath?: string;\n};\n\nexport type RenderedSettingsArtifacts = {\n readonly schema: string;\n readonly readmeSection: string;\n readonly prevalidation?: string;\n};\n\nexport type GeneratedSettingsArtifacts = {\n readonly changedPaths: readonly string[];\n};\n\nexport type CheckedSettingsArtifacts = {\n readonly current: boolean;\n readonly stalePaths: readonly string[];\n};\n\nfunction readmeRenderOptions(targets: SettingsArtifactTargets): RenderReadmeOptions {\n return targets.globalPath === undefined ? {} : { globalPath: targets.globalPath };\n}\n\nfunction renderPrevalidation(definition: ExtensionSettingsDefinition): string {\n const artifact = createPrevalidatedExtensionSettingsArtifact(definition);\n return [\n \"// Generated by pi-extension-settings. Do not edit.\",\n `const artifact = ${JSON.stringify(artifact, undefined, 4)} as const;`,\n \"\",\n \"export default artifact;\",\n \"\",\n ].join(\"\\n\");\n}\n\nexport function renderSettingsArtifacts(\n definition: ExtensionSettingsDefinition,\n targets: SettingsArtifactTargets,\n): RenderedSettingsArtifacts {\n const rendered = {\n schema: formatJson(createSettingsFileSchema(definition)),\n readmeSection: renderReadmeSettingsSection(definition, readmeRenderOptions(targets)),\n };\n return targets.prevalidationPath === undefined\n ? rendered\n : { ...rendered, prevalidation: renderPrevalidation(definition) };\n}\n\nfunction expectedReadme(readmePath: string, section: string): string {\n const current = readTextIfPresent(readmePath);\n if (current === undefined) {\n throw new Error(`README does not exist: ${readmePath}`);\n }\n\n const expected = replaceGeneratedReadmeSection(current, section);\n if (expected === undefined) {\n throw new Error(`README generation markers are invalid in ${readmePath}`);\n }\n return expected;\n}\n\nexport function generateSettingsArtifacts(\n definition: ExtensionSettingsDefinition,\n targets: SettingsArtifactTargets,\n): GeneratedSettingsArtifacts {\n const rendered = renderSettingsArtifacts(definition, targets);\n const readme = expectedReadme(targets.readmePath, rendered.readmeSection);\n\n const changedPaths: string[] = [];\n if (writeTextAtomically(targets.schemaPath, rendered.schema) !== \"unchanged\") {\n changedPaths.push(targets.schemaPath);\n }\n if (writeTextAtomically(targets.readmePath, readme) !== \"unchanged\") {\n changedPaths.push(targets.readmePath);\n }\n if (\n targets.prevalidationPath !== undefined &&\n rendered.prevalidation !== undefined &&\n writeTextAtomically(targets.prevalidationPath, rendered.prevalidation) !== \"unchanged\"\n ) {\n changedPaths.push(targets.prevalidationPath);\n }\n\n return { changedPaths };\n}\n\nexport function checkSettingsArtifacts(\n definition: ExtensionSettingsDefinition,\n targets: SettingsArtifactTargets,\n): CheckedSettingsArtifacts {\n const rendered = renderSettingsArtifacts(definition, targets);\n const readme = expectedReadme(targets.readmePath, rendered.readmeSection);\n const schemaCurrent = readTextIfPresent(targets.schemaPath);\n const readmeCurrent = readTextIfPresent(targets.readmePath);\n const prevalidationCurrent =\n targets.prevalidationPath === undefined\n ? undefined\n : readTextIfPresent(targets.prevalidationPath);\n\n const stalePaths: string[] = [];\n if (schemaCurrent !== rendered.schema) stalePaths.push(targets.schemaPath);\n if (readmeCurrent !== readme) stalePaths.push(targets.readmePath);\n if (\n targets.prevalidationPath !== undefined &&\n prevalidationCurrent !== rendered.prevalidation\n ) {\n stalePaths.push(targets.prevalidationPath);\n }\n\n return { current: stalePaths.length === 0, stalePaths };\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-entry.d.ts","sourceRoot":"","sources":["../src/cli-entry.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-entry.js","sourceRoot":"","sources":["../src/cli-entry.ts"],"names":[],"mappings":";AAEA,OAAO,OAAO,MAAM,cAAc,CAAC;AAEnC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,CAAC,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC","sourcesContent":["#!/usr/bin/env node\n\nimport process from \"node:process\";\n\nimport { runCli } from \"./cli.ts\";\n\nprocess.exitCode = await runCli(process.argv.slice(2));\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAkBA,MAAM,MAAM,KAAK,GAAG;IAChB,QAAQ,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,QAAQ,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9C,CAAC;AAoEF,wBAAsB,MAAM,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,EAAE,GAAE,KAAiB,GAAG,OAAO,CAAC,MAAM,CAAC,CAkB5F"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { resolve } from "node:path";
|
|
2
|
+
import { checkSettingsArtifacts, generateSettingsArtifacts } from "./artifacts.js";
|
|
3
|
+
import { discoverSettingsProjects } from "./projects.js";
|
|
4
|
+
const HELP = `Usage: pi-extension-settings <command> [--root PATH]
|
|
5
|
+
|
|
6
|
+
Generate and verify TypeBox-derived Pi extension settings artifacts.
|
|
7
|
+
|
|
8
|
+
Commands:
|
|
9
|
+
generate Update generated schema, prevalidation, and marked README artifacts.
|
|
10
|
+
check Fail when any generated settings artifact is stale.
|
|
11
|
+
|
|
12
|
+
Options:
|
|
13
|
+
--root PATH Standalone package or npm workspace root (default: current directory)
|
|
14
|
+
--help Show this help message
|
|
15
|
+
`;
|
|
16
|
+
const processIo = {
|
|
17
|
+
stdout: process.stdout.write.bind(process.stdout),
|
|
18
|
+
stderr: process.stderr.write.bind(process.stderr),
|
|
19
|
+
};
|
|
20
|
+
function parseArguments(args) {
|
|
21
|
+
const command = args[0];
|
|
22
|
+
if (command !== "check" && command !== "generate")
|
|
23
|
+
return undefined;
|
|
24
|
+
let root = process.cwd();
|
|
25
|
+
for (let index = 1; index < args.length; index += 1) {
|
|
26
|
+
const argument = args[index];
|
|
27
|
+
if (argument !== "--root")
|
|
28
|
+
return undefined;
|
|
29
|
+
const value = args[index + 1];
|
|
30
|
+
if (value === undefined || value.startsWith("--"))
|
|
31
|
+
return undefined;
|
|
32
|
+
root = resolve(value);
|
|
33
|
+
index += 1;
|
|
34
|
+
}
|
|
35
|
+
return { command, root };
|
|
36
|
+
}
|
|
37
|
+
function line(message) {
|
|
38
|
+
return message.endsWith("\n") ? message : `${message}\n`;
|
|
39
|
+
}
|
|
40
|
+
async function runCommand(parsed, io) {
|
|
41
|
+
const projects = await discoverSettingsProjects(parsed.root);
|
|
42
|
+
if (projects.length === 0) {
|
|
43
|
+
io.stderr(line(`No package.json with a piExtensionSettings manifest was found under ${parsed.root}`));
|
|
44
|
+
return 1;
|
|
45
|
+
}
|
|
46
|
+
if (parsed.command === "generate") {
|
|
47
|
+
for (const project of projects) {
|
|
48
|
+
const generated = generateSettingsArtifacts(project.definition, project.targets);
|
|
49
|
+
for (const path of generated.changedPaths)
|
|
50
|
+
io.stdout(line(`updated ${path}`));
|
|
51
|
+
}
|
|
52
|
+
return 0;
|
|
53
|
+
}
|
|
54
|
+
let stale = false;
|
|
55
|
+
for (const project of projects) {
|
|
56
|
+
const checked = checkSettingsArtifacts(project.definition, project.targets);
|
|
57
|
+
for (const path of checked.stalePaths) {
|
|
58
|
+
stale = true;
|
|
59
|
+
io.stderr(line(`stale ${path}`));
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
if (stale) {
|
|
63
|
+
io.stderr(line("Run pi-extension-settings generate and commit the resulting changes."));
|
|
64
|
+
return 1;
|
|
65
|
+
}
|
|
66
|
+
io.stdout(line(`settings artifacts are current (${projects.length} package(s))`));
|
|
67
|
+
return 0;
|
|
68
|
+
}
|
|
69
|
+
export async function runCli(args, io = processIo) {
|
|
70
|
+
if (args.length === 0 || args.includes("--help")) {
|
|
71
|
+
io.stdout(HELP);
|
|
72
|
+
return 0;
|
|
73
|
+
}
|
|
74
|
+
const parsed = parseArguments(args);
|
|
75
|
+
if (parsed === undefined) {
|
|
76
|
+
io.stderr(line("Invalid arguments. Run pi-extension-settings --help for usage."));
|
|
77
|
+
return 2;
|
|
78
|
+
}
|
|
79
|
+
try {
|
|
80
|
+
return await runCommand(parsed, io);
|
|
81
|
+
}
|
|
82
|
+
catch (cause) {
|
|
83
|
+
io.stderr(line(cause instanceof Error ? cause.message : String(cause)));
|
|
84
|
+
return 1;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=cli.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AACnF,OAAO,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAEzD,MAAM,IAAI,GAAG;;;;;;;;;;;CAWZ,CAAC;AAOF,MAAM,SAAS,GAAU;IACrB,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC;IACjD,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC;CACpD,CAAC;AAOF,SAAS,cAAc,CAAC,IAAuB;IAC3C,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;IACxB,IAAI,OAAO,KAAK,OAAO,IAAI,OAAO,KAAK,UAAU;QAAE,OAAO,SAAS,CAAC;IAEpE,IAAI,IAAI,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IACzB,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QAClD,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;QAC7B,IAAI,QAAQ,KAAK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AO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACxE,OAAO,CAAC,CAAC;IACb,CAAC;AACL,CAAC","sourcesContent":["import { resolve } from \"node:path\";\n\nimport { checkSettingsArtifacts, generateSettingsArtifacts } from \"./artifacts.ts\";\nimport { discoverSettingsProjects } from \"./projects.ts\";\n\nconst HELP = `Usage: pi-extension-settings <command> [--root PATH]\n\nGenerate and verify TypeBox-derived Pi extension settings artifacts.\n\nCommands:\n generate Update generated schema, prevalidation, and marked README artifacts.\n check Fail when any generated settings artifact is stale.\n\nOptions:\n --root PATH Standalone package or npm workspace root (default: current directory)\n --help Show this help message\n`;\n\nexport type CliIo = {\n readonly stdout: (message: string) => void;\n readonly stderr: (message: string) => void;\n};\n\nconst processIo: CliIo = {\n stdout: process.stdout.write.bind(process.stdout),\n stderr: process.stderr.write.bind(process.stderr),\n};\n\ntype ParsedArguments = {\n readonly command: \"check\" | \"generate\";\n readonly root: string;\n};\n\nfunction parseArguments(args: readonly string[]): ParsedArguments | undefined {\n const command = args[0];\n if (command !== \"check\" && command !== \"generate\") return undefined;\n\n let root = process.cwd();\n for (let index = 1; index < args.length; index += 1) {\n const argument = args[index];\n if (argument !== \"--root\") return undefined;\n const value = args[index + 1];\n if (value === undefined || value.startsWith(\"--\")) return undefined;\n root = resolve(value);\n index += 1;\n }\n return { command, root };\n}\n\nfunction line(message: string): string {\n return message.endsWith(\"\\n\") ? message : `${message}\\n`;\n}\n\nasync function runCommand(parsed: ParsedArguments, io: CliIo): Promise<number> {\n const projects = await discoverSettingsProjects(parsed.root);\n if (projects.length === 0) {\n io.stderr(\n line(\n `No package.json with a piExtensionSettings manifest was found under ${parsed.root}`,\n ),\n );\n return 1;\n }\n\n if (parsed.command === \"generate\") {\n for (const project of projects) {\n const generated = generateSettingsArtifacts(project.definition, project.targets);\n for (const path of generated.changedPaths) io.stdout(line(`updated ${path}`));\n }\n return 0;\n }\n\n let stale = false;\n for (const project of projects) {\n const checked = checkSettingsArtifacts(project.definition, project.targets);\n for (const path of checked.stalePaths) {\n stale = true;\n io.stderr(line(`stale ${path}`));\n }\n }\n if (stale) {\n io.stderr(line(\"Run pi-extension-settings generate and commit the resulting changes.\"));\n return 1;\n }\n\n io.stdout(line(`settings artifacts are current (${projects.length} package(s))`));\n return 0;\n}\n\nexport async function runCli(args: readonly string[], io: CliIo = processIo): Promise<number> {\n if (args.length === 0 || args.includes(\"--help\")) {\n io.stdout(HELP);\n return 0;\n }\n\n const parsed = parseArguments(args);\n if (parsed === undefined) {\n io.stderr(line(\"Invalid arguments. Run pi-extension-settings --help for usage.\"));\n return 2;\n }\n\n try {\n return await runCommand(parsed, io);\n } catch (cause: unknown) {\n io.stderr(line(cause instanceof Error ? cause.message : String(cause)));\n return 1;\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definition-marker.d.ts","sourceRoot":"","sources":["../src/definition-marker.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iCAAiC,eAE7C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definition-marker.js","sourceRoot":"","sources":["../src/definition-marker.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,iCAAiC,GAAG,MAAM,CAAC,GAAG,CACvD,yCAAyC,CAC5C,CAAC","sourcesContent":["export const extensionSettingsDefinitionMarker = Symbol.for(\n \"@zigai/pi-extension-settings/definition\",\n);\n"]}
|