@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,207 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
bankConfigOverrideSummaryLines,
|
|
3
|
-
bankSettingsTargetDisplay,
|
|
4
|
-
} from "../banks/bank-settings-presenter.js";
|
|
5
|
-
import type { HindsightLikeClient, ResolvedConfig } from "../types.js";
|
|
6
|
-
import { redactError } from "./sanitize.js";
|
|
7
|
-
|
|
8
|
-
export type StatusHealthFacts = Array<[string, string]>;
|
|
9
|
-
|
|
10
|
-
type BankRoute = {
|
|
11
|
-
label: "Project bank" | "User bank";
|
|
12
|
-
location: "Project" | "User";
|
|
13
|
-
bankId: string;
|
|
14
|
-
};
|
|
15
|
-
const STATUS_HEALTH_TIMEOUT_MS = 1_500;
|
|
16
|
-
|
|
17
|
-
async function withStatusTimeout<T>(promise: Promise<T>, label: string): Promise<T> {
|
|
18
|
-
let timer: NodeJS.Timeout | undefined;
|
|
19
|
-
try {
|
|
20
|
-
return await Promise.race([
|
|
21
|
-
promise,
|
|
22
|
-
new Promise<never>((_resolve, reject) => {
|
|
23
|
-
timer = setTimeout(
|
|
24
|
-
() => reject(new Error(`${label} timed out after ${STATUS_HEALTH_TIMEOUT_MS}ms`)),
|
|
25
|
-
STATUS_HEALTH_TIMEOUT_MS,
|
|
26
|
-
);
|
|
27
|
-
}),
|
|
28
|
-
]);
|
|
29
|
-
} finally {
|
|
30
|
-
if (timer) clearTimeout(timer);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
35
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function numberField(value: unknown, key: string): number | undefined {
|
|
39
|
-
return isRecord(value) && typeof value[key] === "number" ? value[key] : undefined;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function dateField(value: unknown, key: string): string | undefined {
|
|
43
|
-
return isRecord(value) && typeof value[key] === "string" ? value[key] : undefined;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
function bankRoutes(config: ResolvedConfig, projectBankId: string): BankRoute[] {
|
|
47
|
-
return [
|
|
48
|
-
...(config.banks.project.enabled
|
|
49
|
-
? [{ label: "Project bank" as const, location: "Project" as const, bankId: projectBankId }]
|
|
50
|
-
: []),
|
|
51
|
-
...(config.banks.user.enabled && config.banks.user.bankId
|
|
52
|
-
? [
|
|
53
|
-
{
|
|
54
|
-
label: "User bank" as const,
|
|
55
|
-
location: "User" as const,
|
|
56
|
-
bankId: config.banks.user.bankId,
|
|
57
|
-
},
|
|
58
|
-
]
|
|
59
|
-
: []),
|
|
60
|
-
];
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
function textField(value: unknown, key: string): string | undefined {
|
|
64
|
-
return isRecord(value) && typeof value[key] === "string" ? value[key] : undefined;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
function nestedRecord(value: unknown, key: string): Record<string, unknown> | undefined {
|
|
68
|
-
return isRecord(value) && isRecord(value[key]) ? value[key] : undefined;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
function missionSummary(value: string | undefined): string | undefined {
|
|
72
|
-
if (!value) return undefined;
|
|
73
|
-
return value.length > 90 ? `${value.slice(0, 87)}...` : value;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
function formatMissionConfig(configResponse: unknown): string | undefined {
|
|
77
|
-
const config = nestedRecord(configResponse, "config");
|
|
78
|
-
const overrides = nestedRecord(configResponse, "overrides");
|
|
79
|
-
const retain =
|
|
80
|
-
textField(overrides, "retain_custom_instructions") ??
|
|
81
|
-
textField(overrides, "retain_mission") ??
|
|
82
|
-
textField(config, "retain_custom_instructions") ??
|
|
83
|
-
textField(config, "retain_mission");
|
|
84
|
-
const reflect = textField(overrides, "reflect_mission") ?? textField(config, "reflect_mission");
|
|
85
|
-
const observations =
|
|
86
|
-
textField(overrides, "observations_mission") ?? textField(config, "observations_mission");
|
|
87
|
-
const parts = [
|
|
88
|
-
retain ? `retain ${missionSummary(retain)}` : undefined,
|
|
89
|
-
reflect ? `reflect ${missionSummary(reflect)}` : undefined,
|
|
90
|
-
observations ? `observations ${missionSummary(observations)}` : undefined,
|
|
91
|
-
].filter(Boolean);
|
|
92
|
-
return parts.length ? parts.join(" · ") : undefined;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
function formatStats(stats: unknown): string | undefined {
|
|
96
|
-
const memories = numberField(stats, "total_nodes");
|
|
97
|
-
const documents = numberField(stats, "total_documents");
|
|
98
|
-
const observations = numberField(stats, "total_observations");
|
|
99
|
-
const facts = numberField(stats, "fact_count");
|
|
100
|
-
const pending = numberField(stats, "pending_consolidation");
|
|
101
|
-
const failed = numberField(stats, "failed_consolidation");
|
|
102
|
-
const last = dateField(stats, "last_consolidated_at");
|
|
103
|
-
const lastDocument = dateField(stats, "last_document_at");
|
|
104
|
-
const parts = [
|
|
105
|
-
memories !== undefined ? `memories ${memories}` : undefined,
|
|
106
|
-
documents !== undefined ? `docs ${documents}` : undefined,
|
|
107
|
-
observations !== undefined ? `observations ${observations}` : undefined,
|
|
108
|
-
facts !== undefined ? `facts ${facts}` : undefined,
|
|
109
|
-
pending !== undefined ? `pending ${pending}` : undefined,
|
|
110
|
-
failed !== undefined ? `failed ${failed}` : undefined,
|
|
111
|
-
last ? `last consolidated ${last}` : undefined,
|
|
112
|
-
lastDocument ? `last document ${lastDocument}` : undefined,
|
|
113
|
-
].filter(Boolean);
|
|
114
|
-
return parts.length ? parts.join(" · ") : undefined;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
async function bankFact(client: HindsightLikeClient, route: BankRoute): Promise<StatusHealthFacts> {
|
|
118
|
-
try {
|
|
119
|
-
const profile = client.getBankProfile
|
|
120
|
-
? await withStatusTimeout(client.getBankProfile(route.bankId), `${route.label} profile`)
|
|
121
|
-
: undefined;
|
|
122
|
-
const name =
|
|
123
|
-
isRecord(profile) && typeof profile.name === "string" ? profile.name : route.bankId;
|
|
124
|
-
const target = bankSettingsTargetDisplay({ location: route.location, bankId: route.bankId });
|
|
125
|
-
const facts: StatusHealthFacts = [[route.label, `reachable · ${name} · ${target.reviewLine}`]];
|
|
126
|
-
if (client.getBankConfig) {
|
|
127
|
-
try {
|
|
128
|
-
const config = await withStatusTimeout(
|
|
129
|
-
client.getBankConfig(route.bankId),
|
|
130
|
-
`${route.label} config`,
|
|
131
|
-
);
|
|
132
|
-
const summary = formatMissionConfig(config);
|
|
133
|
-
const overrideSummary = bankConfigOverrideSummaryLines(config).join(" · ");
|
|
134
|
-
facts.push([`${route.label} config`, overrideSummary]);
|
|
135
|
-
if (summary) facts.push([`${route.label} missions`, `db · ${summary}`]);
|
|
136
|
-
} catch (error) {
|
|
137
|
-
facts.push([`${route.label} missions`, `unavailable · ${redactError(error)}`]);
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
if (client.getBankStats) {
|
|
141
|
-
try {
|
|
142
|
-
const stats = await withStatusTimeout(
|
|
143
|
-
client.getBankStats(route.bankId),
|
|
144
|
-
`${route.label} stats`,
|
|
145
|
-
);
|
|
146
|
-
const summary = formatStats(stats);
|
|
147
|
-
if (summary) facts.push([`${route.label} stats`, summary]);
|
|
148
|
-
const failed = numberField(stats, "failed_consolidation");
|
|
149
|
-
if (failed !== undefined && failed > 0)
|
|
150
|
-
facts.push([
|
|
151
|
-
`${route.label} consolidation`,
|
|
152
|
-
`failed ${failed} · run hindsight_recover_consolidation`,
|
|
153
|
-
]);
|
|
154
|
-
} catch (error) {
|
|
155
|
-
facts.push([`${route.label} stats`, `unavailable · ${redactError(error)}`]);
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
return facts;
|
|
159
|
-
} catch (error) {
|
|
160
|
-
return [[route.label, `unreachable · ${redactError(error)}`]];
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
async function serverVersionFact(
|
|
165
|
-
client: HindsightLikeClient,
|
|
166
|
-
): Promise<[string, string] | undefined> {
|
|
167
|
-
if (!client.getVersion) return undefined;
|
|
168
|
-
try {
|
|
169
|
-
const version = await withStatusTimeout(client.getVersion(), "Hindsight version");
|
|
170
|
-
const apiVersion = textField(version, "api_version");
|
|
171
|
-
if (!apiVersion) return undefined;
|
|
172
|
-
const features = nestedRecord(version, "features");
|
|
173
|
-
const enabled = features
|
|
174
|
-
? Object.keys(features)
|
|
175
|
-
.filter((key) => features[key] === true)
|
|
176
|
-
.sort()
|
|
177
|
-
: [];
|
|
178
|
-
return [
|
|
179
|
-
"Server version",
|
|
180
|
-
enabled.length ? `${apiVersion} · features: ${enabled.join(", ")}` : apiVersion,
|
|
181
|
-
];
|
|
182
|
-
} catch {
|
|
183
|
-
// Version endpoint is optional enrichment; older servers lack /version.
|
|
184
|
-
return undefined;
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
export async function collectStatusHealthFacts(args: {
|
|
189
|
-
client: HindsightLikeClient;
|
|
190
|
-
config: ResolvedConfig;
|
|
191
|
-
projectBankId: string;
|
|
192
|
-
}): Promise<StatusHealthFacts> {
|
|
193
|
-
const facts: StatusHealthFacts = [];
|
|
194
|
-
try {
|
|
195
|
-
if (args.client.health) await withStatusTimeout(args.client.health(), "Hindsight health");
|
|
196
|
-
facts.push(["Server", "reachable"]);
|
|
197
|
-
const versionFact = await serverVersionFact(args.client);
|
|
198
|
-
if (versionFact) facts.push(versionFact);
|
|
199
|
-
} catch (error) {
|
|
200
|
-
facts.push(["Server", `unreachable · ${redactError(error)}`]);
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
const routes = bankRoutes(args.config, args.projectBankId);
|
|
204
|
-
if (!routes.length) return [...facts, ["Banks", "none configured"]];
|
|
205
|
-
for (const route of routes) facts.push(...(await bankFact(args.client, route)));
|
|
206
|
-
return facts;
|
|
207
|
-
}
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import { basename } from "node:path";
|
|
2
|
-
import type { ResolvedConfig, StatusStyle } from "../types.js";
|
|
3
|
-
|
|
4
|
-
export type HindsightActivity =
|
|
5
|
-
| "idle"
|
|
6
|
-
| "connected"
|
|
7
|
-
| "offline"
|
|
8
|
-
| "recalling"
|
|
9
|
-
| "recalled"
|
|
10
|
-
| "recall-empty"
|
|
11
|
-
| "recall-failed"
|
|
12
|
-
| "retaining"
|
|
13
|
-
| "retained"
|
|
14
|
-
| "retain-queued"
|
|
15
|
-
| "retain-failed"
|
|
16
|
-
| "importing"
|
|
17
|
-
| "imported"
|
|
18
|
-
| "import-queued"
|
|
19
|
-
| "import-failed";
|
|
20
|
-
|
|
21
|
-
export interface HindsightStatusState {
|
|
22
|
-
projectBankId: string;
|
|
23
|
-
cwd: string;
|
|
24
|
-
activity: HindsightActivity;
|
|
25
|
-
memoryCount?: number;
|
|
26
|
-
queueRemaining?: number;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function truncate(value: string, max: number): string {
|
|
30
|
-
if (max <= 0) return "";
|
|
31
|
-
if (value.length <= max) return value;
|
|
32
|
-
return `${value.slice(0, Math.max(1, max - 1))}…`;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function shortProject(cwd: string, max: number): string {
|
|
36
|
-
return truncate(basename(cwd) || "project", max);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
function shortBank(bankId: string, max: number): string {
|
|
40
|
-
return truncate(bankId.replace(/^pi-project-/, ""), max);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export function formatHindsightActivity(
|
|
44
|
-
activity: HindsightActivity,
|
|
45
|
-
memoryCount?: number,
|
|
46
|
-
queueRemaining?: number,
|
|
47
|
-
): string {
|
|
48
|
-
switch (activity) {
|
|
49
|
-
case "connected":
|
|
50
|
-
return "connected";
|
|
51
|
-
case "offline":
|
|
52
|
-
return "offline";
|
|
53
|
-
case "recalling":
|
|
54
|
-
return "recalling";
|
|
55
|
-
case "recalled":
|
|
56
|
-
return memoryCount !== undefined ? `recalled:${memoryCount}` : "recalled";
|
|
57
|
-
case "recall-empty":
|
|
58
|
-
return "no-memory";
|
|
59
|
-
case "recall-failed":
|
|
60
|
-
return "recall-failed";
|
|
61
|
-
case "retaining":
|
|
62
|
-
return "retaining";
|
|
63
|
-
case "retained":
|
|
64
|
-
return queueRemaining ? `queued:${queueRemaining}` : "retained";
|
|
65
|
-
case "retain-queued":
|
|
66
|
-
return queueRemaining !== undefined ? `queued:${queueRemaining}` : "queued";
|
|
67
|
-
case "retain-failed":
|
|
68
|
-
return "retain-failed";
|
|
69
|
-
case "importing":
|
|
70
|
-
return "importing";
|
|
71
|
-
case "imported":
|
|
72
|
-
return queueRemaining ? `imported+queued:${queueRemaining}` : "imported";
|
|
73
|
-
case "import-queued":
|
|
74
|
-
return queueRemaining !== undefined ? `import-queued:${queueRemaining}` : "import-queued";
|
|
75
|
-
case "import-failed":
|
|
76
|
-
return "import-failed";
|
|
77
|
-
default:
|
|
78
|
-
return "idle";
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
function prefix(style: StatusStyle, activity: HindsightActivity): string {
|
|
83
|
-
if (style === "emoji") {
|
|
84
|
-
if (activity.includes("failed") || activity === "offline") return "🤯";
|
|
85
|
-
return "🧠";
|
|
86
|
-
}
|
|
87
|
-
if (style === "nerdfont") {
|
|
88
|
-
if (activity.includes("failed") || activity === "offline") return "";
|
|
89
|
-
if (activity === "recalling" || activity === "recalled") return "";
|
|
90
|
-
if (activity === "retaining" || activity === "retained") return "";
|
|
91
|
-
if (activity === "importing" || activity === "imported" || activity === "import-queued")
|
|
92
|
-
return "";
|
|
93
|
-
return "";
|
|
94
|
-
}
|
|
95
|
-
return "mem";
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
export function formatHindsightStatus(
|
|
99
|
-
config: ResolvedConfig,
|
|
100
|
-
state: HindsightStatusState,
|
|
101
|
-
): string | undefined {
|
|
102
|
-
if (!config.enabled) return undefined;
|
|
103
|
-
const { style, detail, maxLength, showActivity } = config.status;
|
|
104
|
-
if (style === "off") return undefined;
|
|
105
|
-
const p = prefix(style, state.activity);
|
|
106
|
-
const project = shortProject(state.cwd, Math.max(4, maxLength));
|
|
107
|
-
const bank = shortBank(state.projectBankId, Math.max(8, maxLength));
|
|
108
|
-
const activity = showActivity
|
|
109
|
-
? formatHindsightActivity(state.activity, state.memoryCount, state.queueRemaining)
|
|
110
|
-
: "idle";
|
|
111
|
-
|
|
112
|
-
let body: string;
|
|
113
|
-
if (detail === "minimal") body = "";
|
|
114
|
-
else if (detail === "project") body = bank;
|
|
115
|
-
else if (detail === "activity") body = activity;
|
|
116
|
-
else body = `${project}:${bank}:${activity}`;
|
|
117
|
-
|
|
118
|
-
const separator = style === "text" ? ":" : " ";
|
|
119
|
-
return truncate(body ? `${p}${separator}${body}` : p, maxLength);
|
|
120
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export const PI_HINDSIGHT_VERSION = "0.12.0"; // x-release-please-version
|
|
2
|
-
export const PI_HINDSIGHT_USER_AGENT = `pi-hindsight/${PI_HINDSIGHT_VERSION}`;
|
|
3
|
-
|
|
4
|
-
export const PI_HINDSIGHT_SUPPORTED_NODE = ">=20";
|
|
5
|
-
export const PI_HINDSIGHT_SUPPORTED_NPM = ">=10";
|
|
6
|
-
export const PI_HINDSIGHT_CLIENT_PACKAGE = "@vectorize-io/hindsight-client";
|
|
7
|
-
export const PI_HINDSIGHT_CLIENT_RANGE = "^0.9.0";
|
|
8
|
-
export const PI_HINDSIGHT_SUPPORTED_TYPEBOX = ">=1.1.24 <2";
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@luxusai/pi-hindsight",
|
|
3
|
-
"version": "0.12.0",
|
|
4
|
-
"description": "Pi extension for durable Hindsight-backed long-term memory.",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"hindsight",
|
|
7
|
-
"memory",
|
|
8
|
-
"pi",
|
|
9
|
-
"pi-package"
|
|
10
|
-
],
|
|
11
|
-
"homepage": "https://luxus.github.io/pi-hindsight/",
|
|
12
|
-
"bugs": {
|
|
13
|
-
"url": "https://github.com/luxus/pi-hindsight/issues"
|
|
14
|
-
},
|
|
15
|
-
"license": "MIT",
|
|
16
|
-
"repository": {
|
|
17
|
-
"type": "git",
|
|
18
|
-
"url": "git+https://github.com/luxus/pi-hindsight.git"
|
|
19
|
-
},
|
|
20
|
-
"files": [
|
|
21
|
-
"extensions",
|
|
22
|
-
"README.md",
|
|
23
|
-
"CHANGELOG.md",
|
|
24
|
-
"docs/adr",
|
|
25
|
-
"docs/assets",
|
|
26
|
-
"docs/compatibility.md",
|
|
27
|
-
"docs/hindsight-core-functions.md",
|
|
28
|
-
"docs/risky-memory-modes.md",
|
|
29
|
-
"docs/next-opt-out-design.md",
|
|
30
|
-
"docs/surface-reference.md",
|
|
31
|
-
"docs/starter-mental-model-suggestions.md",
|
|
32
|
-
"docs/coding-memory-evaluation.md",
|
|
33
|
-
"docs/mission-and-mental-model-quality.md",
|
|
34
|
-
"skills"
|
|
35
|
-
],
|
|
36
|
-
"type": "module",
|
|
37
|
-
"publishConfig": {
|
|
38
|
-
"access": "public"
|
|
39
|
-
},
|
|
40
|
-
"scripts": {
|
|
41
|
-
"typecheck": "tsgo -p tsconfig.json --noEmit",
|
|
42
|
-
"typecheck:tsc": "tsc --noEmit",
|
|
43
|
-
"lint": "oxlint --type-aware --type-check extensions tests",
|
|
44
|
-
"lint:fix": "oxlint --type-aware --type-check --fix extensions tests",
|
|
45
|
-
"format": "oxfmt --check --no-error-on-unmatched-pattern \"extensions/**/*.ts\" \"tests/**/*.ts\" \"tests/**/*.mjs\" \"scripts/**/*.mjs\" \"scripts/**/*.ts\" \"docs/**/*.md\" \"README.md\" \"CONTEXT.md\" \"CONTRIBUTING.md\" \"SECURITY.md\" \"package.json\" \"package-lock.json\" \"tsconfig.json\" \"vitest.config.ts\" \".oxfmtrc.json\" \".commitlintrc.json\" \"*.yml\" \".github/**/*.yml\" \".github/**/*.md\" \"docs-site/src/content/docs/**/*.md\" \"docs-site/src/content/docs/**/*.mdx\" \"astro.config.mjs\" \"docs-site/src/content.config.ts\"",
|
|
46
|
-
"format:fix": "oxfmt --write --no-error-on-unmatched-pattern \"extensions/**/*.ts\" \"tests/**/*.ts\" \"tests/**/*.mjs\" \"scripts/**/*.mjs\" \"scripts/**/*.ts\" \"docs/**/*.md\" \"README.md\" \"CONTEXT.md\" \"CONTRIBUTING.md\" \"SECURITY.md\" \"package.json\" \"package-lock.json\" \"tsconfig.json\" \"vitest.config.ts\" \".oxfmtrc.json\" \".commitlintrc.json\" \"*.yml\" \".github/**/*.yml\" \".github/**/*.md\" \"docs-site/src/content/docs/**/*.md\" \"docs-site/src/content/docs/**/*.mdx\" \"astro.config.mjs\" \"docs-site/src/content.config.ts\"",
|
|
47
|
-
"surface-reference": "tsx scripts/generate-surface-reference.ts",
|
|
48
|
-
"surface-reference:check": "tsx scripts/generate-surface-reference.ts --check",
|
|
49
|
-
"check": "npm run docs:check && npm run format && npm run lint && npm run typecheck && npm test",
|
|
50
|
-
"check:ci": "npm run check && npm run check:coverage",
|
|
51
|
-
"check:release": "npm run check && npm run check:coverage && npm run typecheck:tsc && npm run audit:signatures && npm run pack:verify && npm run smoke:hindsight",
|
|
52
|
-
"install-hooks": "node scripts/install-hooks.mjs",
|
|
53
|
-
"prepare": "npm run install-hooks",
|
|
54
|
-
"precommit": "npm run check",
|
|
55
|
-
"test": "vitest run",
|
|
56
|
-
"smoke:hindsight": "tsx scripts/smoke-hindsight.ts",
|
|
57
|
-
"bench:memory": "tsx scripts/bench-memory.ts",
|
|
58
|
-
"changelog": "node scripts/generate-changelog.mjs",
|
|
59
|
-
"version": "npm run changelog && npm run format:fix && git add CHANGELOG.md",
|
|
60
|
-
"test:coverage": "vitest run --coverage",
|
|
61
|
-
"check:coverage": "npm run test:coverage",
|
|
62
|
-
"pack:verify": "npm run release:verify && npm pack --dry-run && node scripts/install-smoke.mjs",
|
|
63
|
-
"audit:signatures": "npm audit signatures",
|
|
64
|
-
"release:verify": "node scripts/verify-release.mjs",
|
|
65
|
-
"pr:check": "node scripts/check-pr-body.mjs",
|
|
66
|
-
"docs:dev": "astro dev",
|
|
67
|
-
"docs:build": "astro build",
|
|
68
|
-
"docs:links": "node scripts/check-docs.mjs",
|
|
69
|
-
"docs:check": "npm run surface-reference:check && npm run code-map:check && npm run docs:links && npm run docs:build",
|
|
70
|
-
"code-map": "node scripts/generate-code-map.mjs",
|
|
71
|
-
"code-map:check": "node scripts/generate-code-map.mjs --check"
|
|
72
|
-
},
|
|
73
|
-
"dependencies": {
|
|
74
|
-
"@vectorize-io/hindsight-client": "^0.9.0",
|
|
75
|
-
"jsonc-parser": "^3.3.1"
|
|
76
|
-
},
|
|
77
|
-
"devDependencies": {
|
|
78
|
-
"@astrojs/starlight": "^0.41.3",
|
|
79
|
-
"@commitlint/cli": "^21.0.0",
|
|
80
|
-
"@commitlint/config-conventional": "^21.0.1",
|
|
81
|
-
"@earendil-works/pi-agent-core": "0.84.1",
|
|
82
|
-
"@earendil-works/pi-coding-agent": "0.84.1",
|
|
83
|
-
"@earendil-works/pi-tui": "0.84.1",
|
|
84
|
-
"@mermaid-js/layout-elk": "^0.2.1",
|
|
85
|
-
"@types/node": "^25.9.1",
|
|
86
|
-
"@typescript/native-preview": "7.0.0-dev.20260707.2",
|
|
87
|
-
"@vitest/coverage-v8": "^4.1.5",
|
|
88
|
-
"astro": "^7.0.6",
|
|
89
|
-
"astro-mermaid": "^2.0.1",
|
|
90
|
-
"mermaid": "^11.14.0",
|
|
91
|
-
"oxfmt": "^0.56.0",
|
|
92
|
-
"oxlint": "^1.61.0",
|
|
93
|
-
"oxlint-tsgolint": "^7.0.2001",
|
|
94
|
-
"starlight-llm-button": "^0.0.8",
|
|
95
|
-
"tsx": "4.23.0",
|
|
96
|
-
"typebox": "1.3.9",
|
|
97
|
-
"typescript": "^7.0.2",
|
|
98
|
-
"vitest": "^4.1.5"
|
|
99
|
-
},
|
|
100
|
-
"peerDependencies": {
|
|
101
|
-
"@earendil-works/pi-agent-core": "*",
|
|
102
|
-
"@earendil-works/pi-coding-agent": "*",
|
|
103
|
-
"@earendil-works/pi-tui": "*",
|
|
104
|
-
"typebox": ">=1.1.24 <2"
|
|
105
|
-
},
|
|
106
|
-
"engines": {
|
|
107
|
-
"node": ">=20",
|
|
108
|
-
"npm": ">=10"
|
|
109
|
-
},
|
|
110
|
-
"pi": {
|
|
111
|
-
"extensions": [
|
|
112
|
-
"./extensions"
|
|
113
|
-
],
|
|
114
|
-
"skills": [
|
|
115
|
-
"./skills"
|
|
116
|
-
]
|
|
117
|
-
}
|
|
118
|
-
}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: hindsight-memory-doctor
|
|
3
|
-
description: >
|
|
4
|
-
Self-check Pi Hindsight memory when the user is frustrated, confused, or
|
|
5
|
-
complains about memory quality (wrong prefs, missing context, "it forgot",
|
|
6
|
-
"never ask questions" vs wants questions, empty inject, wrong project).
|
|
7
|
-
Inspect status/scope/mental models/bank missions, compare to quality docs,
|
|
8
|
-
propose dry-run fixes. Trigger on memory complaints, "memory is wrong",
|
|
9
|
-
"forgot", "why did it inject", /hindsight-memory-doctor, or conflict with
|
|
10
|
-
recalled/MM content. Do NOT run every turn.
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
# Hindsight memory doctor
|
|
14
|
-
|
|
15
|
-
When the user is **upset or skeptical about memory**, behave like a careful human under conflict: **stop, inspect, question the memory stack**, then propose a small fix. Do not argue from broken inject. Do not mutate banks silently.
|
|
16
|
-
|
|
17
|
-
Authoritative criteria: `docs/mission-and-mental-model-quality.md` (packaged; also docs-site _Mission and mental-model quality_).
|
|
18
|
-
|
|
19
|
-
## Trigger (yes)
|
|
20
|
-
|
|
21
|
-
- User complains about memory / Hindsight / inject / prefs / “forgot” / wrong project context
|
|
22
|
-
- Injected MM or recall **contradicts** the user (e.g. “do not ask questions” vs wants high-signal questions)
|
|
23
|
-
- User asks why memory looks wrong or empty
|
|
24
|
-
- Explicit `/skill:hindsight-memory-doctor`
|
|
25
|
-
|
|
26
|
-
## Do not trigger
|
|
27
|
-
|
|
28
|
-
- Normal coding with healthy inject
|
|
29
|
-
- Single imperfect recall hit
|
|
30
|
-
- Every turn “maybe refresh?”
|
|
31
|
-
|
|
32
|
-
## Workflow (always)
|
|
33
|
-
|
|
34
|
-
1. **Acknowledge** the complaint in one line. Treat it as a possible **system** issue, not only user error.
|
|
35
|
-
2. **Inspect** (tools; no dry-run needed for reads):
|
|
36
|
-
- `hindsight_status`
|
|
37
|
-
- `hindsight_scope`
|
|
38
|
-
- `hindsight_mental_model` action=list (coding bank; life/user if enabled)
|
|
39
|
-
- `hindsight_mental_model` action=get for broken/suspicious ids
|
|
40
|
-
- `hindsight_bank` action=get for coding (and life if enabled) — missions
|
|
41
|
-
3. **Score against the quality guide** (priority order):
|
|
42
|
-
1. Broken/empty MM content (`#`, empty, Generating…) — prefs MMs may need `fact_types` world+experience+observation, not observation-only
|
|
43
|
-
2. Prefs contradict the user
|
|
44
|
-
3. Missing starters for **this** `project:<id>`
|
|
45
|
-
4. Fat inject / truncation
|
|
46
|
-
5. Mission noise (only if multi-session pattern)
|
|
47
|
-
6. Polish-only → skip
|
|
48
|
-
4. **Propose** a short plan (max 3 actions). Prefer:
|
|
49
|
-
- explicit retain of the **correct** durable fact
|
|
50
|
-
- refresh (or clear+refresh if delta-drift)
|
|
51
|
-
- create missing starters for this project
|
|
52
|
-
- mission patch only if extraction is systematically wrong
|
|
53
|
-
5. **Dry-run first** for any mutation (`hindsight_mental_model` / `hindsight_bank` dryRun true). Apply only after user ok (`dryRun: false` or hub).
|
|
54
|
-
6. **Verify** list/get again. Note inject cache may lag (`mentalModels.cacheTtlMs`, often ~5 min) — new session or wait.
|
|
55
|
-
|
|
56
|
-
## Output shape
|
|
57
|
-
|
|
58
|
-
```text
|
|
59
|
-
Memory doctor
|
|
60
|
-
- What I checked: …
|
|
61
|
-
- What’s wrong (priority): …
|
|
62
|
-
- Proposed fixes (dry-run): …
|
|
63
|
-
- Not doing: … (noise / other projects / silent rewrite)
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
## Hard rules
|
|
67
|
-
|
|
68
|
-
- Never silent create/update/delete of mental models or missions.
|
|
69
|
-
- Never edit another project’s `project:<other>` models to “fix” this session.
|
|
70
|
-
- Same-turn retain + rely-on-recall is invalid; refresh after retain has landed.
|
|
71
|
-
- If tools unavailable / setup incomplete: say so and point to `/hindsight` setup.
|
|
72
|
-
|
|
73
|
-
## Optional user invoke
|
|
74
|
-
|
|
75
|
-
`/skill:hindsight-memory-doctor` — run full workflow once.
|