@herbertgao/pi-extensions 2026.9.5 → 2026.9.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -22
- package/THIRD_PARTY_NOTICES.md +0 -4
- package/node_modules/@herbertgao/sol-pi/docs/compatibility.md +1 -1
- package/node_modules/@herbertgao/sol-pi/package.json +1 -1
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/action-fusion/index.ts +0 -5
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/online-context-compact/state.ts +3 -1
- package/node_modules/@narumitw/pi-btw/README.md +2 -0
- package/node_modules/@narumitw/pi-btw/dist/index.ts +284 -365
- package/node_modules/@narumitw/pi-btw/dist/index.ts.map +3 -3
- package/node_modules/@narumitw/pi-btw/package.json +52 -53
- package/node_modules/@narumitw/pi-btw/src/bring-to-main.ts +494 -547
- package/node_modules/@narumitw/pi-btw/src/btw.ts +814 -856
- package/node_modules/@narumitw/pi-btw/src/fullscreen-ui.ts +673 -674
- package/node_modules/@narumitw/pi-btw/src/keybindings.ts +228 -270
- package/node_modules/@narumitw/pi-btw/src/main-tree-picker.ts +309 -318
- package/node_modules/@narumitw/pi-btw/src/menu.ts +416 -454
- package/node_modules/@narumitw/pi-btw/src/settings.ts +203 -219
- package/node_modules/@narumitw/pi-btw/src/side-thread.ts +173 -201
- package/node_modules/@narumitw/pi-btw/src/text.ts +21 -23
- package/node_modules/@narumitw/pi-btw/src/transcript-markdown.ts +65 -0
- package/node_modules/@narumitw/pi-btw/src/transcript-pager.ts +611 -662
- package/node_modules/pi-lens/CHANGELOG.md +239 -0
- package/node_modules/pi-lens/config/dependency-cruiser-eager-allowlist.json +3 -0
- package/node_modules/pi-lens/dist/clients/actionable-warnings.js +30 -4
- package/node_modules/pi-lens/dist/clients/agent-behavior-client.js +2 -0
- package/node_modules/pi-lens/dist/clients/bash-file-access.js +26 -0
- package/node_modules/pi-lens/dist/clients/biome-client.js +1 -1
- package/node_modules/pi-lens/dist/clients/blocker-freshness.js +403 -35
- package/node_modules/pi-lens/dist/clients/bootstrap.js +6 -1
- package/node_modules/pi-lens/dist/clients/cascade-format.js +200 -4
- package/node_modules/pi-lens/dist/clients/code-quality-warnings.js +10 -2
- package/node_modules/pi-lens/dist/clients/degradation-ledger.js +16 -1
- package/node_modules/pi-lens/dist/clients/diagnostic-dispositions.js +12 -1
- package/node_modules/pi-lens/dist/clients/dispatch/ast-grep-catalog.js +65 -0
- package/node_modules/pi-lens/dist/clients/dispatch/auxiliary-lsp.js +28 -0
- package/node_modules/pi-lens/dist/clients/dispatch/dispatcher.js +9 -2
- package/node_modules/pi-lens/dist/clients/dispatch/finding-policy.js +222 -0
- package/node_modules/pi-lens/dist/clients/dispatch/indent-detect.js +389 -13
- package/node_modules/pi-lens/dist/clients/dispatch/integration.js +175 -25
- package/node_modules/pi-lens/dist/clients/dispatch/rule-ignores.js +62 -0
- package/node_modules/pi-lens/dist/clients/dispatch/runners/ast-grep-napi.js +21 -41
- package/node_modules/pi-lens/dist/clients/dispatch/runners/biome-check.js +6 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/rust-clippy.js +7 -7
- package/node_modules/pi-lens/dist/clients/dispatch/runners/shfmt.js +2 -12
- package/node_modules/pi-lens/dist/clients/dispatch/runners/tree-sitter.js +2 -21
- package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/runner-helpers.js +1 -1
- package/node_modules/pi-lens/dist/clients/dispatch/types.js +4 -1
- package/node_modules/pi-lens/dist/clients/disposition-publish.js +1 -0
- package/node_modules/pi-lens/dist/clients/effective-config.js +1 -1
- package/node_modules/pi-lens/dist/clients/file-kinds.js +26 -1
- package/node_modules/pi-lens/dist/clients/file-role.js +21 -21
- package/node_modules/pi-lens/dist/clients/file-utils.js +156 -10
- package/node_modules/pi-lens/dist/clients/finding-delivery-gate.js +56 -9
- package/node_modules/pi-lens/dist/clients/format-service.js +39 -21
- package/node_modules/pi-lens/dist/clients/formatters.js +60 -13
- package/node_modules/pi-lens/dist/clients/generation-guard.js +2 -2
- package/node_modules/pi-lens/dist/clients/git-guard.js +11 -3
- package/node_modules/pi-lens/dist/clients/indent-retarget.js +78 -8
- package/node_modules/pi-lens/dist/clients/installer/index.js +333 -114
- package/node_modules/pi-lens/dist/clients/instance-reaper-state.js +7 -0
- package/node_modules/pi-lens/dist/clients/instance-reaper.js +20 -10
- package/node_modules/pi-lens/dist/clients/language-profile.js +23 -1
- package/node_modules/pi-lens/dist/clients/language-registry.js +5 -1
- package/node_modules/pi-lens/dist/clients/latency-logger.js +4 -1
- package/node_modules/pi-lens/dist/clients/lens-engine.js +12 -3
- package/node_modules/pi-lens/dist/clients/lens-events.js +2 -1
- package/node_modules/pi-lens/dist/clients/lens-flag-registry.js +79 -0
- package/node_modules/pi-lens/dist/clients/live-bus-emitter.js +2 -1
- package/node_modules/pi-lens/dist/clients/lsp/client.js +25 -21
- package/node_modules/pi-lens/dist/clients/lsp/config.js +2 -2
- package/node_modules/pi-lens/dist/clients/lsp/index.js +7 -0
- package/node_modules/pi-lens/dist/clients/lsp/launch.js +16 -4
- package/node_modules/pi-lens/dist/clients/lsp/server.js +19 -2
- package/node_modules/pi-lens/dist/clients/lsp/workspace-diagnostics-cache.js +2 -1
- package/node_modules/pi-lens/dist/clients/lsp-mutation.js +5 -3
- package/node_modules/pi-lens/dist/clients/map-with-concurrency.js +12 -8
- package/node_modules/pi-lens/dist/clients/mcp/session.js +36 -4
- package/node_modules/pi-lens/dist/clients/ndjson-logger.js +24 -7
- package/node_modules/pi-lens/dist/clients/observed-mutation.js +40 -2
- package/node_modules/pi-lens/dist/clients/opaque-mutation-scan.js +23 -3
- package/node_modules/pi-lens/dist/clients/opengrep-client.js +110 -15
- package/node_modules/pi-lens/dist/clients/path-utils.js +123 -3
- package/node_modules/pi-lens/dist/clients/performance-report.js +5 -1
- package/node_modules/pi-lens/dist/clients/php-cs-fixer-config.js +1 -1
- package/node_modules/pi-lens/dist/clients/pipeline.js +74 -5
- package/node_modules/pi-lens/dist/clients/project-diagnostics/cache.js +37 -5
- package/node_modules/pi-lens/dist/clients/project-diagnostics/fresh-fetch.js +145 -18
- package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/dead-code.js +4 -1
- package/node_modules/pi-lens/dist/clients/project-diagnostics/scanner.js +59 -3
- package/node_modules/pi-lens/dist/clients/project-lens-config.js +45 -2
- package/node_modules/pi-lens/dist/clients/read-guard.js +70 -11
- package/node_modules/pi-lens/dist/clients/resource-sampler.js +147 -9
- package/node_modules/pi-lens/dist/clients/ruff-client.js +1 -1
- package/node_modules/pi-lens/dist/clients/runtime-agent-end.js +33 -5
- package/node_modules/pi-lens/dist/clients/runtime-context.js +6 -2
- package/node_modules/pi-lens/dist/clients/runtime-coordinator.js +77 -7
- package/node_modules/pi-lens/dist/clients/runtime-session.js +21 -2
- package/node_modules/pi-lens/dist/clients/runtime-tool-call.js +43 -12
- package/node_modules/pi-lens/dist/clients/runtime-tool-result.js +330 -85
- package/node_modules/pi-lens/dist/clients/runtime-turn.js +147 -17
- package/node_modules/pi-lens/dist/clients/safe-spawn.js +258 -5
- package/node_modules/pi-lens/dist/clients/scratch-tree-policy.js +6 -0
- package/node_modules/pi-lens/dist/clients/session-event-guard.js +50 -5
- package/node_modules/pi-lens/dist/clients/sg-runner.js +23 -11
- package/node_modules/pi-lens/dist/clients/sgconfig.js +79 -2
- package/node_modules/pi-lens/dist/clients/test-runner-client.js +6 -41
- package/node_modules/pi-lens/dist/clients/test-runner-delivery.js +43 -0
- package/node_modules/pi-lens/dist/clients/tool-agreement.js +423 -0
- package/node_modules/pi-lens/dist/clients/tool-config.js +50 -0
- package/node_modules/pi-lens/dist/clients/tool-cwd.js +47 -76
- package/node_modules/pi-lens/dist/clients/tool-policy.js +163 -7
- package/node_modules/pi-lens/dist/clients/tree-sitter-client.js +120 -0
- package/node_modules/pi-lens/dist/clients/tree-sitter-query-loader.js +127 -189
- package/node_modules/pi-lens/dist/clients/widget-state.js +98 -0
- package/node_modules/pi-lens/dist/clients/word-index.js +5 -2
- package/node_modules/pi-lens/dist/clients/write-ordering-guard.js +7 -0
- package/node_modules/pi-lens/dist/index.js +27416 -24153
- package/node_modules/pi-lens/dist/mcp/server.js +5 -2
- package/node_modules/pi-lens/dist/tools/lens-diagnostic-mark.js +7 -1
- package/node_modules/pi-lens/dist/tools/lens-diagnostics.js +168 -53
- package/node_modules/pi-lens/dist/tools/lsp-diagnostics.js +244 -72
- package/node_modules/pi-lens/docs/audit1.md +5 -5
- package/node_modules/pi-lens/docs/dependencies.md +11 -0
- package/node_modules/pi-lens/docs/dispositions.md +52 -0
- package/node_modules/pi-lens/docs/environment-variables.md +2 -2
- package/node_modules/pi-lens/docs/features.md +4 -4
- package/node_modules/pi-lens/docs/globalconfig.md +3 -1
- package/node_modules/pi-lens/docs/language-coverage.md +1 -0
- package/node_modules/pi-lens/docs/pi-lens-fixer.md +53 -94
- package/node_modules/pi-lens/docs/pi-lens-investigator.md +43 -38
- package/node_modules/pi-lens/docs/pi-lens-retro.md +97 -0
- package/node_modules/pi-lens/docs/pi-lens-reviewer.md +53 -66
- package/node_modules/pi-lens/docs/release-qa-baseline.md +22 -0
- package/node_modules/pi-lens/docs/settings.md +7 -4
- package/node_modules/pi-lens/docs/tree-sitter_rules_catalog.md +1 -1
- package/node_modules/pi-lens/docs/usage.md +2 -0
- package/node_modules/pi-lens/package.json +1 -1
- package/node_modules/pi-lens/rules/tree-sitter-queries/typescript/sql-injection.yml +24 -12
- package/node_modules/pi-lens/scripts/analyze-pi-lens-logs.mjs +40 -0
- package/node_modules/pi-lens/skills/pi-lens-ast-grep/SKILL.md +15 -0
- package/node_modules/pi-lens/skills/pi-lens-lsp-navigation/SKILL.md +7 -0
- package/package.json +6 -17
- package/examples/pi-footer.json +0 -275
- package/node_modules/@czottmann/pi-automode/CHANGELOG.md +0 -70
- package/node_modules/@czottmann/pi-automode/LICENSE.md +0 -21
- package/node_modules/@czottmann/pi-automode/README.md +0 -215
- package/node_modules/@czottmann/pi-automode/docs/GLOSSARY.md +0 -39
- package/node_modules/@czottmann/pi-automode/docs/adr/ADR-001-permission-precedence-and-trust-boundaries.md +0 -46
- package/node_modules/@czottmann/pi-automode/docs/adr/ADR-002-global-config-in-extension-data-directory.md +0 -60
- package/node_modules/@czottmann/pi-automode/docs/adr/INDEX.md +0 -6
- package/node_modules/@czottmann/pi-automode/docs/automode-classifier-flow.md +0 -428
- package/node_modules/@czottmann/pi-automode/docs/configuration.md +0 -171
- package/node_modules/@czottmann/pi-automode/docs/defaults.md +0 -178
- package/node_modules/@czottmann/pi-automode/docs/diagnostics.md +0 -90
- package/node_modules/@czottmann/pi-automode/docs/observability-logging.md +0 -160
- package/node_modules/@czottmann/pi-automode/examples/automode.local.json +0 -44
- package/node_modules/@czottmann/pi-automode/extensions/auto-mode/bash.ts +0 -692
- package/node_modules/@czottmann/pi-automode/extensions/auto-mode/classifier.ts +0 -852
- package/node_modules/@czottmann/pi-automode/extensions/auto-mode/config.ts +0 -904
- package/node_modules/@czottmann/pi-automode/extensions/auto-mode/constants.ts +0 -228
- package/node_modules/@czottmann/pi-automode/extensions/auto-mode/extension.ts +0 -954
- package/node_modules/@czottmann/pi-automode/extensions/auto-mode/hard-deny.ts +0 -429
- package/node_modules/@czottmann/pi-automode/extensions/auto-mode/log.ts +0 -173
- package/node_modules/@czottmann/pi-automode/extensions/auto-mode/model-selector.ts +0 -113
- package/node_modules/@czottmann/pi-automode/extensions/auto-mode/model.ts +0 -13
- package/node_modules/@czottmann/pi-automode/extensions/auto-mode/paths.ts +0 -297
- package/node_modules/@czottmann/pi-automode/extensions/auto-mode/permissions.ts +0 -623
- package/node_modules/@czottmann/pi-automode/extensions/auto-mode/state.ts +0 -102
- package/node_modules/@czottmann/pi-automode/extensions/auto-mode/transcript.ts +0 -236
- package/node_modules/@czottmann/pi-automode/extensions/auto-mode/types.ts +0 -205
- package/node_modules/@czottmann/pi-automode/extensions/auto-mode/utils.ts +0 -54
- package/node_modules/@czottmann/pi-automode/extensions/auto-mode.ts +0 -26
- package/node_modules/@czottmann/pi-automode/package.json +0 -61
- package/node_modules/@czottmann/pi-automode/skills/automode-diagnostics/SKILL.md +0 -63
- package/node_modules/@luxusai/pi-hindsight/CHANGELOG.md +0 -376
- package/node_modules/@luxusai/pi-hindsight/README.md +0 -92
- package/node_modules/@luxusai/pi-hindsight/docs/adr/001-memory-lifecycle-and-scope.md +0 -56
- package/node_modules/@luxusai/pi-hindsight/docs/adr/002-explicit-routing-strategy-seam.md +0 -169
- package/node_modules/@luxusai/pi-hindsight/docs/adr/003-tui-memory-mode-vocabulary.md +0 -107
- package/node_modules/@luxusai/pi-hindsight/docs/adr/004-lifeos-dual-bank-design.md +0 -89
- package/node_modules/@luxusai/pi-hindsight/docs/adr/005-domain-banks-and-agent-first-surface.md +0 -189
- package/node_modules/@luxusai/pi-hindsight/docs/assets/logos/pi-hindsight-logo-dark.webp +0 -0
- package/node_modules/@luxusai/pi-hindsight/docs/assets/logos/pi-hindsight-logo-dark@2x.webp +0 -0
- package/node_modules/@luxusai/pi-hindsight/docs/coding-memory-evaluation.md +0 -54
- package/node_modules/@luxusai/pi-hindsight/docs/compatibility.md +0 -75
- package/node_modules/@luxusai/pi-hindsight/docs/hindsight-core-functions.md +0 -300
- package/node_modules/@luxusai/pi-hindsight/docs/mission-and-mental-model-quality.md +0 -158
- package/node_modules/@luxusai/pi-hindsight/docs/next-opt-out-design.md +0 -164
- package/node_modules/@luxusai/pi-hindsight/docs/risky-memory-modes.md +0 -139
- package/node_modules/@luxusai/pi-hindsight/docs/starter-mental-model-suggestions.md +0 -74
- package/node_modules/@luxusai/pi-hindsight/docs/surface-reference.md +0 -261
- package/node_modules/@luxusai/pi-hindsight/extensions/banks/bank-operations.ts +0 -151
- package/node_modules/@luxusai/pi-hindsight/extensions/banks/bank-selection.ts +0 -18
- package/node_modules/@luxusai/pi-hindsight/extensions/banks/bank-settings-presenter.ts +0 -46
- package/node_modules/@luxusai/pi-hindsight/extensions/banks/bank-templates.ts +0 -383
- package/node_modules/@luxusai/pi-hindsight/extensions/banks/banking.ts +0 -240
- package/node_modules/@luxusai/pi-hindsight/extensions/banks/knowledge-page-seed.ts +0 -176
- package/node_modules/@luxusai/pi-hindsight/extensions/banks/retain-strategies.ts +0 -178
- package/node_modules/@luxusai/pi-hindsight/extensions/client/client-retry.ts +0 -41
- package/node_modules/@luxusai/pi-hindsight/extensions/client/client.ts +0 -386
- package/node_modules/@luxusai/pi-hindsight/extensions/client/fetch-compat.ts +0 -39
- package/node_modules/@luxusai/pi-hindsight/extensions/client/timeout.ts +0 -34
- package/node_modules/@luxusai/pi-hindsight/extensions/config/config-defaults.ts +0 -140
- package/node_modules/@luxusai/pi-hindsight/extensions/config/config-editing-model.ts +0 -61
- package/node_modules/@luxusai/pi-hindsight/extensions/config/config-editing-registry.ts +0 -925
- package/node_modules/@luxusai/pi-hindsight/extensions/config/config-field-paths.ts +0 -247
- package/node_modules/@luxusai/pi-hindsight/extensions/config/config-normalize.ts +0 -547
- package/node_modules/@luxusai/pi-hindsight/extensions/config/config-writer.ts +0 -480
- package/node_modules/@luxusai/pi-hindsight/extensions/config/config.ts +0 -182
- package/node_modules/@luxusai/pi-hindsight/extensions/config/setup-gate.ts +0 -86
- package/node_modules/@luxusai/pi-hindsight/extensions/imports/import-execute.ts +0 -1010
- package/node_modules/@luxusai/pi-hindsight/extensions/imports/import-parse.ts +0 -175
- package/node_modules/@luxusai/pi-hindsight/extensions/imports/import-plan.ts +0 -425
- package/node_modules/@luxusai/pi-hindsight/extensions/imports/import-presentation.ts +0 -210
- package/node_modules/@luxusai/pi-hindsight/extensions/imports/import-sessions.ts +0 -817
- package/node_modules/@luxusai/pi-hindsight/extensions/index.ts +0 -25
- package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/git-seed.ts +0 -319
- package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/memory-lifecycle-recall.ts +0 -196
- package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/memory-lifecycle-retain.ts +0 -189
- package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/memory-lifecycle-runtime.ts +0 -65
- package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/memory-lifecycle.ts +0 -260
- package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/mental-models.ts +0 -244
- package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/observation-scopes.ts +0 -59
- package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/recall-cleanup.ts +0 -82
- package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/recall-visibility.ts +0 -45
- package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/recall.ts +0 -331
- package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/retain-cursor.ts +0 -354
- package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/retain-job-builder.ts +0 -66
- package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/retain-receipts.ts +0 -132
- package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/retain.ts +0 -228
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-bank-template-operations.ts +0 -74
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-config-operations.ts +0 -16
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-control-operations.ts +0 -648
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-diagnostics-operations.ts +0 -105
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-identity.ts +0 -68
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-operation-service.ts +0 -71
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-operation-types.ts +0 -13
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-recall-operations.ts +0 -162
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-retain-operations.ts +0 -131
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-scope.ts +0 -104
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-session-operations.ts +0 -37
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/operation-catalog.ts +0 -893
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/reflect-presenter.ts +0 -35
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/scope-migrate.ts +0 -177
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/tools.ts +0 -7
- package/node_modules/@luxusai/pi-hindsight/extensions/queue/flush-presenter.ts +0 -21
- package/node_modules/@luxusai/pi-hindsight/extensions/queue/jsonl-queue-store.ts +0 -112
- package/node_modules/@luxusai/pi-hindsight/extensions/queue/queue-delivery.ts +0 -111
- package/node_modules/@luxusai/pi-hindsight/extensions/queue/queue-lock.ts +0 -214
- package/node_modules/@luxusai/pi-hindsight/extensions/queue/queue-operations.ts +0 -70
- package/node_modules/@luxusai/pi-hindsight/extensions/queue/queue.ts +0 -392
- package/node_modules/@luxusai/pi-hindsight/extensions/tui/bank-template-presentation.ts +0 -45
- package/node_modules/@luxusai/pi-hindsight/extensions/tui/commands.ts +0 -9
- package/node_modules/@luxusai/pi-hindsight/extensions/tui/guided-setup.ts +0 -860
- package/node_modules/@luxusai/pi-hindsight/extensions/tui/prefill-input.ts +0 -105
- package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-flow.ts +0 -189
- package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-server-probe.ts +0 -299
- package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-tui-actions.ts +0 -201
- package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-tui-facts.ts +0 -47
- package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-tui-render.ts +0 -239
- package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-tui-types.ts +0 -50
- package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-tui.ts +0 -259
- package/node_modules/@luxusai/pi-hindsight/extensions/tui/tool-presenters.ts +0 -77
- package/node_modules/@luxusai/pi-hindsight/extensions/types.ts +0 -534
- package/node_modules/@luxusai/pi-hindsight/extensions/utils/diagnostics.ts +0 -319
- package/node_modules/@luxusai/pi-hindsight/extensions/utils/messages.ts +0 -325
- package/node_modules/@luxusai/pi-hindsight/extensions/utils/sanitize.ts +0 -42
- package/node_modules/@luxusai/pi-hindsight/extensions/utils/session-memory-meta.ts +0 -244
- package/node_modules/@luxusai/pi-hindsight/extensions/utils/session-operations.ts +0 -56
- package/node_modules/@luxusai/pi-hindsight/extensions/utils/session.ts +0 -50
- package/node_modules/@luxusai/pi-hindsight/extensions/utils/status-fields.ts +0 -167
- package/node_modules/@luxusai/pi-hindsight/extensions/utils/status-health.ts +0 -207
- package/node_modules/@luxusai/pi-hindsight/extensions/utils/status.ts +0 -120
- package/node_modules/@luxusai/pi-hindsight/extensions/version.ts +0 -8
- package/node_modules/@luxusai/pi-hindsight/package.json +0 -118
- package/node_modules/@luxusai/pi-hindsight/skills/hindsight-memory-doctor/SKILL.md +0 -75
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
2
|
-
import {
|
|
3
|
-
fuzzyFilter,
|
|
4
|
-
Input,
|
|
5
|
-
matchesKey,
|
|
6
|
-
SelectList,
|
|
7
|
-
} from "@earendil-works/pi-tui";
|
|
8
|
-
import type { SelectItem } from "@earendil-works/pi-tui";
|
|
9
|
-
import { formatModelSpec } from "./model.ts";
|
|
10
|
-
|
|
11
|
-
/** Interactive model selector shown when `/automode model` is run without arguments. */
|
|
12
|
-
export function promptForClassifierModel(
|
|
13
|
-
ctx: ExtensionContext,
|
|
14
|
-
current?: string,
|
|
15
|
-
): Promise<string | undefined> {
|
|
16
|
-
if (!ctx.hasUI) {
|
|
17
|
-
return Promise.resolve(undefined);
|
|
18
|
-
}
|
|
19
|
-
const available = ctx.modelRegistry.getAvailable();
|
|
20
|
-
if (available.length === 0) {
|
|
21
|
-
return Promise.resolve(undefined);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const items: SelectItem[] = available.map((model) => {
|
|
25
|
-
const spec = formatModelSpec(model);
|
|
26
|
-
return {
|
|
27
|
-
value: spec,
|
|
28
|
-
label: `${model.id} \u001b[2m[${model.provider}]\u001b[0m`,
|
|
29
|
-
description: spec === current ? "\u2713" : undefined,
|
|
30
|
-
};
|
|
31
|
-
});
|
|
32
|
-
items.sort((a, b) => a.label.localeCompare(b.label));
|
|
33
|
-
|
|
34
|
-
return ctx.ui.custom<string | undefined>((tui, theme, _keybindings, done) => {
|
|
35
|
-
const filterInput = new Input();
|
|
36
|
-
filterInput.onEscape = () => done(undefined);
|
|
37
|
-
|
|
38
|
-
let filtered: SelectItem[] = items;
|
|
39
|
-
let selectList = buildModelList(filtered, theme, filterInput, done, tui);
|
|
40
|
-
|
|
41
|
-
function applyFilter(query: string): void {
|
|
42
|
-
filtered = query
|
|
43
|
-
? fuzzyFilter(items, query, (item) => `${item.label} ${item.value}`)
|
|
44
|
-
: items;
|
|
45
|
-
selectList = buildModelList(filtered, theme, filterInput, done, tui);
|
|
46
|
-
tui.requestRender();
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return {
|
|
50
|
-
render(width: number) {
|
|
51
|
-
const selected = selectList.getSelectedItem();
|
|
52
|
-
const lines: string[] = [];
|
|
53
|
-
lines.push(theme.fg("accent", theme.bold("Select classifier model")));
|
|
54
|
-
lines.push(
|
|
55
|
-
theme.fg(
|
|
56
|
-
"dim",
|
|
57
|
-
"Only showing models from configured providers. Use /login to add providers.",
|
|
58
|
-
),
|
|
59
|
-
);
|
|
60
|
-
lines.push("");
|
|
61
|
-
lines.push(filterInput.render(width).join("\n"));
|
|
62
|
-
lines.push("");
|
|
63
|
-
lines.push(...selectList.render(width));
|
|
64
|
-
lines.push("");
|
|
65
|
-
if (selected) {
|
|
66
|
-
lines.push(theme.fg("muted", `Model Name: ${selected.label}`));
|
|
67
|
-
}
|
|
68
|
-
return lines;
|
|
69
|
-
},
|
|
70
|
-
invalidate() {
|
|
71
|
-
/* no-op */
|
|
72
|
-
},
|
|
73
|
-
handleInput(data: string) {
|
|
74
|
-
if (
|
|
75
|
-
matchesKey(data, "up") || matchesKey(data, "down") ||
|
|
76
|
-
matchesKey(data, "return") || matchesKey(data, "escape")
|
|
77
|
-
) {
|
|
78
|
-
selectList.handleInput(data);
|
|
79
|
-
tui.requestRender();
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
filterInput.handleInput(data);
|
|
83
|
-
applyFilter(filterInput.getValue());
|
|
84
|
-
},
|
|
85
|
-
};
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
function buildModelList(
|
|
90
|
-
items: SelectItem[],
|
|
91
|
-
theme: any,
|
|
92
|
-
filterInput: Input,
|
|
93
|
-
done: (value: string | undefined) => void,
|
|
94
|
-
tui: any,
|
|
95
|
-
): SelectList {
|
|
96
|
-
const maxVisible = Math.min(10, Math.max(1, items.length));
|
|
97
|
-
const list = new SelectList(items, maxVisible, {
|
|
98
|
-
selectedPrefix: (text) => theme.fg("accent", text),
|
|
99
|
-
selectedText: (text) => theme.fg("accent", text),
|
|
100
|
-
description: (text) => theme.fg("muted", text),
|
|
101
|
-
scrollInfo: (text) => theme.fg("dim", text),
|
|
102
|
-
noMatch: (text) => theme.fg("warning", text),
|
|
103
|
-
});
|
|
104
|
-
list.setSelectedIndex(0);
|
|
105
|
-
list.onCancel = () => done(undefined);
|
|
106
|
-
list.onSelect = (item) => done(item.value);
|
|
107
|
-
list.onSelectionChange = () => tui.requestRender();
|
|
108
|
-
filterInput.onSubmit = () => {
|
|
109
|
-
const selected = list.getSelectedItem();
|
|
110
|
-
if (selected) done(selected.value);
|
|
111
|
-
};
|
|
112
|
-
return list;
|
|
113
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { Model } from "@earendil-works/pi-ai";
|
|
2
|
-
|
|
3
|
-
export function parseModelSpec(
|
|
4
|
-
spec: string,
|
|
5
|
-
): { provider: string; id: string } | undefined {
|
|
6
|
-
const slash = spec.indexOf("/");
|
|
7
|
-
if (slash <= 0 || slash >= spec.length - 1) return undefined;
|
|
8
|
-
return { provider: spec.slice(0, slash), id: spec.slice(slash + 1) };
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export function formatModelSpec(model: Model<any>): string {
|
|
12
|
-
return `${model.provider}/${model.id}`;
|
|
13
|
-
}
|
|
@@ -1,297 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
accessSync,
|
|
3
|
-
constants,
|
|
4
|
-
lstatSync,
|
|
5
|
-
readlinkSync,
|
|
6
|
-
realpathSync,
|
|
7
|
-
} from "node:fs";
|
|
8
|
-
import {
|
|
9
|
-
basename,
|
|
10
|
-
dirname,
|
|
11
|
-
isAbsolute,
|
|
12
|
-
join,
|
|
13
|
-
normalize,
|
|
14
|
-
relative,
|
|
15
|
-
resolve,
|
|
16
|
-
} from "node:path";
|
|
17
|
-
import { fileURLToPath } from "node:url";
|
|
18
|
-
import { HOME, PATH_BEARING_TOOLS, PROFILE_FILES } from "./constants.ts";
|
|
19
|
-
|
|
20
|
-
const UNICODE_SPACES = /[\u00A0\u2000-\u200A\u202F\u205F\u3000]/g;
|
|
21
|
-
|
|
22
|
-
/** Convert Git Bash, MSYS, Cygwin, and WSL drive paths for Windows APIs. */
|
|
23
|
-
function normalizeWindowsShellPath(path: string): string {
|
|
24
|
-
if (
|
|
25
|
-
process.platform !== "win32" ||
|
|
26
|
-
!path.startsWith("/") ||
|
|
27
|
-
path.startsWith("//") ||
|
|
28
|
-
path.includes("\\")
|
|
29
|
-
) {
|
|
30
|
-
return path;
|
|
31
|
-
}
|
|
32
|
-
const match = path.match(/^\/(?:mnt\/|cygdrive\/)?([a-z])(?:\/(.*))?$/i);
|
|
33
|
-
if (!match) return path;
|
|
34
|
-
const suffix = match[2]?.replaceAll("/", "\\");
|
|
35
|
-
return `${match[1]?.toUpperCase()}:\\${suffix ?? ""}`;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/** Mirror Pi's path normalization options. */
|
|
39
|
-
function normalizeInputPath(
|
|
40
|
-
value: string,
|
|
41
|
-
options: { normalizeUnicodeSpaces?: boolean; stripAtPrefix?: boolean } = {},
|
|
42
|
-
): string {
|
|
43
|
-
let normalized = options.normalizeUnicodeSpaces
|
|
44
|
-
? value.replace(UNICODE_SPACES, " ")
|
|
45
|
-
: value;
|
|
46
|
-
if (options.stripAtPrefix && normalized.startsWith("@")) {
|
|
47
|
-
normalized = normalized.slice(1);
|
|
48
|
-
}
|
|
49
|
-
normalized = normalizeWindowsShellPath(normalized);
|
|
50
|
-
if (normalized === "~") return HOME;
|
|
51
|
-
if (
|
|
52
|
-
normalized.startsWith("~/") ||
|
|
53
|
-
(process.platform === "win32" && normalized.startsWith("~\\"))
|
|
54
|
-
) {
|
|
55
|
-
return join(HOME, normalized.slice(2));
|
|
56
|
-
}
|
|
57
|
-
if (/^file:\/\//.test(normalized)) return fileURLToPath(normalized);
|
|
58
|
-
return normalized;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export function resolveInputPath(
|
|
62
|
-
cwd: string,
|
|
63
|
-
value: unknown,
|
|
64
|
-
): string | undefined {
|
|
65
|
-
if (typeof value !== "string") return undefined;
|
|
66
|
-
const normalized = normalizeInputPath(value, {
|
|
67
|
-
normalizeUnicodeSpaces: true,
|
|
68
|
-
stripAtPrefix: true,
|
|
69
|
-
});
|
|
70
|
-
return isAbsolute(normalized)
|
|
71
|
-
? resolve(normalized)
|
|
72
|
-
: resolve(normalizeInputPath(cwd), normalized);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
function existingReadVariant(path: string): string {
|
|
76
|
-
const candidates = [
|
|
77
|
-
path,
|
|
78
|
-
path.replace(/ (AM|PM)\./gi, "\u202F$1."),
|
|
79
|
-
path.normalize("NFD"),
|
|
80
|
-
path.replace(/'/g, "\u2019"),
|
|
81
|
-
path.normalize("NFD").replace(/'/g, "\u2019"),
|
|
82
|
-
];
|
|
83
|
-
for (const candidate of candidates) {
|
|
84
|
-
try {
|
|
85
|
-
accessSync(candidate, constants.F_OK);
|
|
86
|
-
return candidate;
|
|
87
|
-
} catch {
|
|
88
|
-
// Try the next Pi-compatible read fallback.
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
return path;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
/** Resolve the path that the named Pi file tool will operate on. */
|
|
95
|
-
export function resolveToolInputPath(
|
|
96
|
-
toolName: string,
|
|
97
|
-
cwd: string,
|
|
98
|
-
value: unknown,
|
|
99
|
-
): string | undefined {
|
|
100
|
-
const resolved = resolveInputPath(cwd, value);
|
|
101
|
-
if (!resolved || toolName !== "read") return resolved;
|
|
102
|
-
return existingReadVariant(resolved);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
/** The effective target path of a file tool, including Pi's `.` defaults. */
|
|
106
|
-
export function extractInputPath(
|
|
107
|
-
toolName: string,
|
|
108
|
-
input: Record<string, unknown>,
|
|
109
|
-
): string | undefined {
|
|
110
|
-
if (!PATH_BEARING_TOOLS.has(toolName)) return undefined;
|
|
111
|
-
const value = input.path;
|
|
112
|
-
if (typeof value === "string" && value !== "") return value;
|
|
113
|
-
if (toolName === "grep" || toolName === "find" || toolName === "ls") {
|
|
114
|
-
return ".";
|
|
115
|
-
}
|
|
116
|
-
return typeof value === "string" ? value : undefined;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
/** Expand a leading `~`, `$HOME`, or `${HOME}` in a path-denial pattern. */
|
|
120
|
-
export function expandHomePattern(pattern: string): string {
|
|
121
|
-
const home = HOME.replace(/\\/g, "/");
|
|
122
|
-
if (pattern === "~" || pattern === "$HOME" || pattern === "${HOME}") {
|
|
123
|
-
return home;
|
|
124
|
-
}
|
|
125
|
-
if (pattern.startsWith("~/")) return `${home}/${pattern.slice(2)}`;
|
|
126
|
-
if (pattern.startsWith("$HOME/")) return `${home}/${pattern.slice(6)}`;
|
|
127
|
-
if (pattern.startsWith("${HOME}/")) return `${home}/${pattern.slice(8)}`;
|
|
128
|
-
return pattern;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
export function normalizePathForMatch(path: string, cwd: string): string {
|
|
132
|
-
const normalized = normalize(path);
|
|
133
|
-
const rel = relative(cwd, normalized);
|
|
134
|
-
return rel && !rel.startsWith("..") && !isAbsolute(rel) ? rel : normalized;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
export function isInside(child: string, parent: string): boolean {
|
|
138
|
-
const rel = relative(parent, child);
|
|
139
|
-
return rel === "" || (!!rel && !rel.startsWith("..") && !isAbsolute(rel));
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
/** Resolve symlinks through the nearest existing ancestor of a path. */
|
|
143
|
-
export function resolvePathForPolicy(path: string): string | undefined {
|
|
144
|
-
return resolvePathForPolicyInner(resolve(path), new Set<string>());
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
function resolvePathForPolicyInner(
|
|
148
|
-
path: string,
|
|
149
|
-
visitedSymlinks: Set<string>,
|
|
150
|
-
): string | undefined {
|
|
151
|
-
let current = path;
|
|
152
|
-
const missingSegments: string[] = [];
|
|
153
|
-
|
|
154
|
-
while (true) {
|
|
155
|
-
try {
|
|
156
|
-
return resolve(realpathSync(current), ...missingSegments);
|
|
157
|
-
} catch {
|
|
158
|
-
try {
|
|
159
|
-
const stat = lstatSync(current);
|
|
160
|
-
if (!stat.isSymbolicLink() || visitedSymlinks.has(current)) {
|
|
161
|
-
return undefined;
|
|
162
|
-
}
|
|
163
|
-
visitedSymlinks.add(current);
|
|
164
|
-
const target = resolve(dirname(current), readlinkSync(current));
|
|
165
|
-
return resolvePathForPolicyInner(
|
|
166
|
-
resolve(target, ...missingSegments),
|
|
167
|
-
visitedSymlinks,
|
|
168
|
-
);
|
|
169
|
-
} catch (error) {
|
|
170
|
-
const code = error && typeof error === "object" && "code" in error
|
|
171
|
-
? String(error.code)
|
|
172
|
-
: undefined;
|
|
173
|
-
if (code !== "ENOENT" && code !== "ENOTDIR") return undefined;
|
|
174
|
-
const parent = dirname(current);
|
|
175
|
-
if (parent === current) return undefined;
|
|
176
|
-
missingSegments.unshift(basename(current));
|
|
177
|
-
current = parent;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
function normalizeProtectedPathForMatch(value: string): string {
|
|
184
|
-
return value
|
|
185
|
-
.replace(/\\/g, "/")
|
|
186
|
-
.normalize("NFC")
|
|
187
|
-
.toLowerCase()
|
|
188
|
-
.normalize("NFC");
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
export function matchesProtectedPath(
|
|
192
|
-
relativePath: string,
|
|
193
|
-
protectedPaths: string[],
|
|
194
|
-
): boolean {
|
|
195
|
-
const normalizedPath = normalizeProtectedPathForMatch(relativePath);
|
|
196
|
-
return protectedPaths.some((pattern) => {
|
|
197
|
-
const normalizedPattern = normalizeProtectedPathForMatch(pattern);
|
|
198
|
-
return normalizedPath === normalizedPattern ||
|
|
199
|
-
normalizedPath.startsWith(`${normalizedPattern}/`);
|
|
200
|
-
});
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
export function isProtectedPath(
|
|
204
|
-
path: string,
|
|
205
|
-
cwd: string,
|
|
206
|
-
protectedPaths: string[],
|
|
207
|
-
): boolean {
|
|
208
|
-
// Resolve through the nearest existing ancestor so symlinked directories are
|
|
209
|
-
// respected even when the final write target does not exist yet.
|
|
210
|
-
const resolved = resolvePathForPolicy(path) ?? path;
|
|
211
|
-
const resolvedCwd = resolvePathForPolicy(cwd) ?? cwd;
|
|
212
|
-
|
|
213
|
-
// For paths inside the project: use relative path for matching.
|
|
214
|
-
if (isInside(resolved, resolvedCwd)) {
|
|
215
|
-
return matchesProtectedPath(
|
|
216
|
-
relative(resolvedCwd, resolved),
|
|
217
|
-
protectedPaths,
|
|
218
|
-
);
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
// For paths outside the project: check every path component suffix.
|
|
222
|
-
// This catches writes like ../other-project/.git/config even when cwd
|
|
223
|
-
// doesn't contain the target.
|
|
224
|
-
const normalizedResolved = resolved.replace(/\\/g, "/");
|
|
225
|
-
const segments = normalizedResolved.split("/").filter(Boolean);
|
|
226
|
-
for (let i = 0; i < segments.length; i++) {
|
|
227
|
-
if (matchesProtectedPath(segments.slice(i).join("/"), protectedPaths)) {
|
|
228
|
-
return true;
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
return false;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
export function isSafetyControlPath(path: string, cwd: string): boolean {
|
|
235
|
-
const policyPath = resolvePathForPolicy(path) ?? resolve(path);
|
|
236
|
-
const policyCwd = resolvePathForPolicy(cwd) ?? resolve(cwd);
|
|
237
|
-
const normalized = normalizeProtectedPathForMatch(policyPath);
|
|
238
|
-
const file = basename(normalized);
|
|
239
|
-
const piAgentRoot = normalizeProtectedPathForMatch(
|
|
240
|
-
resolve(HOME, ".pi/agent"),
|
|
241
|
-
);
|
|
242
|
-
const globalExtensions = `${piAgentRoot}/extensions`;
|
|
243
|
-
const globalSettings = `${piAgentRoot}/settings`;
|
|
244
|
-
if (
|
|
245
|
-
normalized === `${piAgentRoot}/settings.json` ||
|
|
246
|
-
normalized === globalExtensions ||
|
|
247
|
-
normalized.startsWith(`${globalExtensions}/`) ||
|
|
248
|
-
normalized === globalSettings ||
|
|
249
|
-
normalized.startsWith(`${globalSettings}/`)
|
|
250
|
-
) {
|
|
251
|
-
return true;
|
|
252
|
-
}
|
|
253
|
-
if (
|
|
254
|
-
normalized.endsWith("/.pi/auto-mode.json") ||
|
|
255
|
-
normalized.endsWith("/auto-mode.json")
|
|
256
|
-
) {
|
|
257
|
-
return true;
|
|
258
|
-
}
|
|
259
|
-
if (normalized.includes("/.pi/extensions/") && file.includes("auto")) {
|
|
260
|
-
return true;
|
|
261
|
-
}
|
|
262
|
-
if (normalized.includes("/.pi/") && file.startsWith("automode")) return true;
|
|
263
|
-
if (
|
|
264
|
-
normalized.includes("/pi-automode/") ||
|
|
265
|
-
(isInside(policyPath, policyCwd) && file.includes("auto-mode"))
|
|
266
|
-
) {
|
|
267
|
-
return true;
|
|
268
|
-
}
|
|
269
|
-
return false;
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
export function shellPathTokenToPath(
|
|
273
|
-
token: string,
|
|
274
|
-
cwd: string,
|
|
275
|
-
shellText = token,
|
|
276
|
-
): string | undefined {
|
|
277
|
-
let value = token.trim();
|
|
278
|
-
if (!value || value === "-" || value.startsWith("&")) return undefined;
|
|
279
|
-
value = value
|
|
280
|
-
.replace(/^\$HOME(?=\/|$)/, HOME)
|
|
281
|
-
.replace(/^\$\{HOME\}(?=\/|$)/, HOME);
|
|
282
|
-
if (shellText === "~") value = HOME;
|
|
283
|
-
else if (shellText.startsWith("~/")) value = resolve(HOME, value.slice(2));
|
|
284
|
-
return isAbsolute(value) ? resolve(value) : resolve(cwd, value);
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
export function isProfileOrAuthorizedKeysPath(
|
|
288
|
-
path: string,
|
|
289
|
-
): string | undefined {
|
|
290
|
-
if (PROFILE_FILES.has(path)) {
|
|
291
|
-
return "shell profile modification is hard-denied";
|
|
292
|
-
}
|
|
293
|
-
if (path === resolve(HOME, ".ssh/authorized_keys")) {
|
|
294
|
-
return "SSH authorized_keys modification is hard-denied";
|
|
295
|
-
}
|
|
296
|
-
return undefined;
|
|
297
|
-
}
|