@herbertgao/pi-extensions 2026.8.11 → 2026.8.13
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 +23 -10
- package/{node_modules/@herbertgao/pi-mermaid-open/LICENSE → THIRD_PARTY_NOTICES.md} +19 -1
- package/node_modules/@czottmann/pi-automode/CHANGELOG.md +15 -0
- package/node_modules/@czottmann/pi-automode/README.md +5 -3
- package/node_modules/@czottmann/pi-automode/docs/adr/ADR-001-permission-precedence-and-trust-boundaries.md +2 -0
- package/node_modules/@czottmann/pi-automode/docs/adr/ADR-002-global-config-in-extension-data-directory.md +60 -0
- package/node_modules/@czottmann/pi-automode/docs/adr/INDEX.md +1 -0
- package/node_modules/@czottmann/pi-automode/docs/automode-classifier-flow.md +4 -4
- package/node_modules/@czottmann/pi-automode/docs/configuration.md +20 -4
- package/node_modules/@czottmann/pi-automode/docs/observability-logging.md +1 -1
- package/node_modules/@czottmann/pi-automode/extensions/auto-mode/bash.ts +692 -0
- package/node_modules/@czottmann/pi-automode/extensions/auto-mode/config.ts +181 -3
- package/node_modules/@czottmann/pi-automode/extensions/auto-mode/constants.ts +4 -1
- package/node_modules/@czottmann/pi-automode/extensions/auto-mode/extension.ts +143 -36
- package/node_modules/@czottmann/pi-automode/extensions/auto-mode/hard-deny.ts +103 -148
- package/node_modules/@czottmann/pi-automode/extensions/auto-mode/paths.ts +32 -6
- package/node_modules/@czottmann/pi-automode/extensions/auto-mode/permissions.ts +344 -22
- package/node_modules/@czottmann/pi-automode/extensions/auto-mode.ts +1 -0
- package/node_modules/@czottmann/pi-automode/package.json +4 -1
- package/node_modules/@herbertgao/pi-cc-extensions/README.en.md +2 -1
- package/node_modules/@herbertgao/pi-cc-extensions/README.md +2 -1
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/config.ts +4 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/panel.ts +21 -1
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/agent-summary/core.ts +1 -1
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/context.ts +19 -19
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/compact-mode.ts +4 -2
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/default-mode.ts +2 -1
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/grouping.ts +10 -2
- package/node_modules/@herbertgao/pi-cc-extensions/package.json +3 -3
- package/node_modules/@herbertgao/pi-subagents/CHANGELOG.md +10 -0
- package/node_modules/@herbertgao/pi-subagents/README.md +21 -15
- package/node_modules/@herbertgao/pi-subagents/package.json +3 -3
- package/node_modules/@herbertgao/pi-subagents/src/agent-file-toggle.ts +11 -8
- package/node_modules/@herbertgao/pi-subagents/src/agent-manager.ts +184 -106
- package/node_modules/@herbertgao/pi-subagents/src/cross-extension-rpc.ts +31 -11
- package/node_modules/@herbertgao/pi-subagents/src/custom-agents.ts +9 -1
- package/node_modules/@herbertgao/pi-subagents/src/index.ts +156 -31
- package/node_modules/@herbertgao/pi-subagents/src/invocation-config.ts +17 -0
- package/node_modules/@herbertgao/pi-subagents/src/model-resolver.ts +14 -0
- package/node_modules/@herbertgao/pi-subagents/src/schedule.ts +8 -0
- package/node_modules/@herbertgao/pi-subagents/src/settings.ts +32 -1
- package/node_modules/@herbertgao/pi-subagents/src/types.ts +17 -2
- package/node_modules/@herbertgao/pi-subagents/src/ui/agent-widget.ts +23 -2
- package/node_modules/@herbertgao/pi-subagents/src/ui/conversation-viewer.ts +259 -24
- package/node_modules/@juicesharp/rpiv-ask-user-question/package.json +2 -2
- package/node_modules/@luxusai/pi-hindsight/CHANGELOG.md +376 -0
- package/node_modules/@luxusai/pi-hindsight/README.md +92 -0
- package/node_modules/@luxusai/pi-hindsight/docs/adr/001-memory-lifecycle-and-scope.md +56 -0
- package/node_modules/@luxusai/pi-hindsight/docs/adr/002-explicit-routing-strategy-seam.md +169 -0
- package/node_modules/@luxusai/pi-hindsight/docs/adr/003-tui-memory-mode-vocabulary.md +107 -0
- package/node_modules/@luxusai/pi-hindsight/docs/adr/004-lifeos-dual-bank-design.md +89 -0
- package/node_modules/@luxusai/pi-hindsight/docs/adr/005-domain-banks-and-agent-first-surface.md +189 -0
- 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 +54 -0
- package/node_modules/@luxusai/pi-hindsight/docs/compatibility.md +75 -0
- package/node_modules/@luxusai/pi-hindsight/docs/hindsight-core-functions.md +300 -0
- package/node_modules/@luxusai/pi-hindsight/docs/mission-and-mental-model-quality.md +158 -0
- package/node_modules/@luxusai/pi-hindsight/docs/next-opt-out-design.md +164 -0
- package/node_modules/@luxusai/pi-hindsight/docs/risky-memory-modes.md +139 -0
- package/node_modules/@luxusai/pi-hindsight/docs/starter-mental-model-suggestions.md +74 -0
- package/node_modules/@luxusai/pi-hindsight/docs/surface-reference.md +261 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/banks/bank-operations.ts +151 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/banks/bank-selection.ts +18 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/banks/bank-settings-presenter.ts +46 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/banks/bank-templates.ts +383 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/banks/banking.ts +240 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/banks/knowledge-page-seed.ts +176 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/banks/retain-strategies.ts +178 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/client/client-retry.ts +41 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/client/client.ts +386 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/client/fetch-compat.ts +39 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/client/timeout.ts +34 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/config/config-defaults.ts +140 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/config/config-editing-model.ts +61 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/config/config-editing-registry.ts +925 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/config/config-field-paths.ts +247 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/config/config-normalize.ts +547 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/config/config-writer.ts +480 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/config/config.ts +182 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/config/setup-gate.ts +86 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/imports/import-execute.ts +1010 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/imports/import-parse.ts +175 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/imports/import-plan.ts +425 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/imports/import-presentation.ts +210 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/imports/import-sessions.ts +817 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/index.ts +25 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/git-seed.ts +319 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/memory-lifecycle-recall.ts +196 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/memory-lifecycle-retain.ts +189 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/memory-lifecycle-runtime.ts +65 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/memory-lifecycle.ts +260 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/mental-models.ts +244 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/observation-scopes.ts +59 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/recall-cleanup.ts +82 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/recall-visibility.ts +45 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/recall.ts +331 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/retain-cursor.ts +354 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/retain-job-builder.ts +66 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/retain-receipts.ts +132 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/retain.ts +228 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-bank-template-operations.ts +74 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-config-operations.ts +16 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-control-operations.ts +648 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-diagnostics-operations.ts +105 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-identity.ts +68 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-operation-service.ts +71 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-operation-types.ts +13 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-recall-operations.ts +162 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-retain-operations.ts +131 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-scope.ts +104 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-session-operations.ts +37 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/operation-catalog.ts +893 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/reflect-presenter.ts +35 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/scope-migrate.ts +177 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/tools.ts +7 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/queue/flush-presenter.ts +21 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/queue/jsonl-queue-store.ts +112 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/queue/queue-delivery.ts +111 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/queue/queue-lock.ts +214 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/queue/queue-operations.ts +70 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/queue/queue.ts +392 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/tui/bank-template-presentation.ts +45 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/tui/commands.ts +9 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/tui/guided-setup.ts +860 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/tui/prefill-input.ts +105 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-flow.ts +189 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-server-probe.ts +299 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-tui-actions.ts +201 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-tui-facts.ts +47 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-tui-render.ts +239 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-tui-types.ts +50 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-tui.ts +259 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/tui/tool-presenters.ts +77 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/types.ts +534 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/utils/diagnostics.ts +319 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/utils/messages.ts +325 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/utils/sanitize.ts +42 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/utils/session-memory-meta.ts +244 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/utils/session-operations.ts +56 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/utils/session.ts +50 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/utils/status-fields.ts +167 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/utils/status-health.ts +207 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/utils/status.ts +120 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/version.ts +8 -0
- package/node_modules/@luxusai/pi-hindsight/package.json +118 -0
- package/node_modules/@luxusai/pi-hindsight/skills/hindsight-memory-doctor/SKILL.md +75 -0
- package/node_modules/@narumitw/pi-btw/dist/index.ts +143 -46
- package/node_modules/@narumitw/pi-btw/dist/index.ts.map +3 -3
- package/node_modules/@narumitw/pi-btw/package.json +6 -6
- package/node_modules/@narumitw/pi-btw/src/fullscreen-ui.ts +136 -22
- package/node_modules/{@herbertgao → @tifan}/pi-copy-response/README.md +2 -4
- package/node_modules/{@herbertgao → @tifan}/pi-copy-response/package.json +5 -15
- package/node_modules/{@herbertgao → @tifan}/pi-handoff/README.md +4 -6
- package/node_modules/@tifan/pi-handoff/package.json +43 -0
- package/node_modules/{@herbertgao → @tifan}/pi-handoff/src/index.ts +1 -1
- package/node_modules/{@herbertgao → @tifan}/pi-inline-skills/README.md +2 -4
- package/node_modules/{@herbertgao → @tifan}/pi-inline-skills/package.json +5 -15
- package/node_modules/{@herbertgao → @tifan}/pi-mermaid-open/README.md +5 -7
- package/node_modules/{@herbertgao → @tifan}/pi-mermaid-open/package.json +5 -19
- package/node_modules/{@herbertgao → @tifan}/pi-preferred-thinking/README.md +4 -6
- package/node_modules/{@herbertgao → @tifan}/pi-preferred-thinking/package.json +6 -16
- package/node_modules/{@herbertgao → @tifan}/pi-preferred-thinking/src/index.ts +1 -6
- package/node_modules/{@herbertgao → @tifan}/pi-recap/README.md +4 -6
- package/node_modules/@tifan/pi-recap/package.json +42 -0
- package/node_modules/{@herbertgao → @tifan}/pi-recap/src/models.ts +1 -6
- package/node_modules/{@herbertgao → @tifan}/pi-rename/README.md +13 -8
- package/node_modules/@tifan/pi-rename/package.json +47 -0
- package/node_modules/@tifan/pi-rename/src/herdr-label.ts +4 -0
- package/node_modules/{@herbertgao → @tifan}/pi-rename/src/index.ts +4 -16
- package/node_modules/{@herbertgao → @tifan}/pi-rename/src/models.ts +1 -6
- package/node_modules/{@herbertgao → @tifan}/pi-titlebar-spinner/README.md +2 -4
- package/node_modules/{@herbertgao → @tifan}/pi-titlebar-spinner/package.json +5 -15
- package/node_modules/pi-lens/CHANGELOG.md +96 -1
- package/node_modules/pi-lens/dist/clients/actionable-warnings-logger.js +2 -1
- package/node_modules/pi-lens/dist/clients/actionable-warnings.js +14 -5
- package/node_modules/pi-lens/dist/clients/advisory-provenance.js +48 -18
- package/node_modules/pi-lens/dist/clients/ast-grep-client.js +1 -3
- package/node_modules/pi-lens/dist/clients/atomic-write-staging.js +16 -4
- package/node_modules/pi-lens/dist/clients/bash-file-access.js +3 -1
- package/node_modules/pi-lens/dist/clients/biome-client.js +1 -3
- package/node_modules/pi-lens/dist/clients/blocker-freshness.js +21 -8
- package/node_modules/pi-lens/dist/clients/bounded-cache.js +24 -8
- package/node_modules/pi-lens/dist/clients/bounded-pid-file-lock.js +4 -3
- package/node_modules/pi-lens/dist/clients/cache-manager.js +6 -7
- package/node_modules/pi-lens/dist/clients/cache-observability.js +461 -66
- package/node_modules/pi-lens/dist/clients/call-graph.js +238 -63
- package/node_modules/pi-lens/dist/clients/codebase-model.js +13 -5
- package/node_modules/pi-lens/dist/clients/complexity-client.js +1 -3
- package/node_modules/pi-lens/dist/clients/dead-code-client.js +19 -8
- package/node_modules/pi-lens/dist/clients/dead-code-logger.js +1 -2
- package/node_modules/pi-lens/dist/clients/deadline-utils.js +3 -1
- package/node_modules/pi-lens/dist/clients/debug-heap.js +8 -1
- package/node_modules/pi-lens/dist/clients/degradation-ledger.js +1 -1
- package/node_modules/pi-lens/dist/clients/dependency-checker.js +11 -7
- package/node_modules/pi-lens/dist/clients/diagnostic-dispositions.js +39 -2
- package/node_modules/pi-lens/dist/clients/diagnostic-line-freshness.js +5 -1
- package/node_modules/pi-lens/dist/clients/dispatch/auxiliary-lsp.js +2 -3
- package/node_modules/pi-lens/dist/clients/dispatch/dispatcher.js +13 -1
- package/node_modules/pi-lens/dist/clients/dispatch/facts/function-facts.js +3 -1
- package/node_modules/pi-lens/dist/clients/dispatch/facts/import-facts.js +2 -1
- package/node_modules/pi-lens/dist/clients/dispatch/facts/tree-sitter-facts.js +1 -1
- package/node_modules/pi-lens/dist/clients/dispatch/integration.js +9 -4
- package/node_modules/pi-lens/dist/clients/dispatch/rules/error-swallowing.js +3 -1
- package/node_modules/pi-lens/dist/clients/dispatch/rules/pass-through-wrappers.js +6 -2
- package/node_modules/pi-lens/dist/clients/dispatch/rules/unsafe-boundary.js +31 -7
- package/node_modules/pi-lens/dist/clients/dispatch/runners/actionlint.js +5 -2
- package/node_modules/pi-lens/dist/clients/dispatch/runners/biome-check.js +10 -14
- package/node_modules/pi-lens/dist/clients/dispatch/runners/cpp-check.js +5 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/dotnet-build.js +1 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/elixir-check.js +3 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/eslint.js +25 -6
- package/node_modules/pi-lens/dist/clients/dispatch/runners/fish-indent.js +1 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/gleam-check.js +1 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/golangci-lint.js +3 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/hadolint.js +13 -8
- package/node_modules/pi-lens/dist/clients/dispatch/runners/helm-lint.js +4 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/htmlhint.js +25 -10
- package/node_modules/pi-lens/dist/clients/dispatch/runners/javac.js +1 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/ktlint.js +1 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/lsp.js +1 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/markdownlint.js +28 -4
- package/node_modules/pi-lens/dist/clients/dispatch/runners/mypy.js +6 -8
- package/node_modules/pi-lens/dist/clients/dispatch/runners/oxlint.js +212 -11
- package/node_modules/pi-lens/dist/clients/dispatch/runners/php-lint.js +1 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/phpstan.js +8 -4
- package/node_modules/pi-lens/dist/clients/dispatch/runners/psscriptanalyzer.js +10 -6
- package/node_modules/pi-lens/dist/clients/dispatch/runners/pyright.js +23 -14
- package/node_modules/pi-lens/dist/clients/dispatch/runners/rust-clippy.js +1 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/shellcheck.js +7 -9
- package/node_modules/pi-lens/dist/clients/dispatch/runners/shfmt.js +5 -2
- package/node_modules/pi-lens/dist/clients/dispatch/runners/sqlfluff.js +7 -7
- package/node_modules/pi-lens/dist/clients/dispatch/runners/stylelint.js +6 -8
- package/node_modules/pi-lens/dist/clients/dispatch/runners/terragrunt.js +13 -8
- package/node_modules/pi-lens/dist/clients/dispatch/runners/tflint.js +13 -8
- package/node_modules/pi-lens/dist/clients/dispatch/runners/tree-sitter.js +17 -3
- package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/candidate-probe.js +7 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/runner-helpers.js +24 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/tool-failure.js +35 -0
- package/node_modules/pi-lens/dist/clients/dispatch/runners/yaml-rule-parser.js +1 -3
- package/node_modules/pi-lens/dist/clients/dispatch/runners/yamllint.js +6 -8
- package/node_modules/pi-lens/dist/clients/dispatch/runners/zig-check.js +1 -1
- package/node_modules/pi-lens/dist/clients/dispatch/suppress-writer.js +2 -1
- package/node_modules/pi-lens/dist/clients/dispatch/types.js +6 -1
- package/node_modules/pi-lens/dist/clients/dispatch/utils/lsp-diagnostics.js +6 -2
- package/node_modules/pi-lens/dist/clients/extension-log.js +5 -3
- package/node_modules/pi-lens/dist/clients/feature-hints.js +8 -1
- package/node_modules/pi-lens/dist/clients/file-kinds.js +34 -129
- package/node_modules/pi-lens/dist/clients/file-utils.js +17 -1
- package/node_modules/pi-lens/dist/clients/finding-delivery-gate.js +57 -2
- package/node_modules/pi-lens/dist/clients/formatters.js +144 -27
- package/node_modules/pi-lens/dist/clients/freshness.js +38 -0
- package/node_modules/pi-lens/dist/clients/git-guard.js +43 -13
- package/node_modules/pi-lens/dist/clients/go-client.js +1 -3
- package/node_modules/pi-lens/dist/clients/grammar-source.js +1 -1
- package/node_modules/pi-lens/dist/clients/gzip-stage-write.js +30 -4
- package/node_modules/pi-lens/dist/clients/host-edit-normalize.js +1 -3
- package/node_modules/pi-lens/dist/clients/install-diagnostics.js +4 -2
- package/node_modules/pi-lens/dist/clients/installer/index.js +86 -77
- package/node_modules/pi-lens/dist/clients/instance-reaper.js +5 -2
- package/node_modules/pi-lens/dist/clients/instance-registry.js +4 -2
- package/node_modules/pi-lens/dist/clients/jscpd-client.js +6 -1
- package/node_modules/pi-lens/dist/clients/knip-client.js +29 -15
- package/node_modules/pi-lens/dist/clients/language-profile.js +4 -1
- package/node_modules/pi-lens/dist/clients/latency-logger.js +13 -2
- package/node_modules/pi-lens/dist/clients/lens-config.js +1 -1
- package/node_modules/pi-lens/dist/clients/lens-map.js +8 -3
- package/node_modules/pi-lens/dist/clients/live-bus-emitter.js +1 -1
- package/node_modules/pi-lens/dist/clients/lsp/config.js +4 -6
- package/node_modules/pi-lens/dist/clients/lsp/edits.js +119 -32
- package/node_modules/pi-lens/dist/clients/lsp/index.js +94 -35
- package/node_modules/pi-lens/dist/clients/lsp/inferred-project.js +2 -1
- package/node_modules/pi-lens/dist/clients/lsp/jvm-runtime.js +4 -1
- package/node_modules/pi-lens/dist/clients/lsp/launch.js +11 -3
- package/node_modules/pi-lens/dist/clients/lsp/pending-aux-coverage.js +152 -0
- package/node_modules/pi-lens/dist/clients/lsp/server.js +19 -7
- package/node_modules/pi-lens/dist/clients/lsp/tsserver-sync.js +10 -2
- package/node_modules/pi-lens/dist/clients/lsp/workspace-diagnostics-cache.js +9 -4
- package/node_modules/pi-lens/dist/clients/lsp-document-symbols.js +1 -3
- package/node_modules/pi-lens/dist/clients/lsp-mutation.js +10 -20
- package/node_modules/pi-lens/dist/clients/mcp/host-shim.js +1 -1
- package/node_modules/pi-lens/dist/clients/memory-sampler.js +73 -7
- package/node_modules/pi-lens/dist/clients/metrics-client.js +1 -3
- package/node_modules/pi-lens/dist/clients/middle-man-analysis.js +8 -3
- package/node_modules/pi-lens/dist/clients/module-report-lsp.js +7 -1
- package/node_modules/pi-lens/dist/clients/module-report.js +14 -17
- package/node_modules/pi-lens/dist/clients/ndjson-logger.js +3 -5
- package/node_modules/pi-lens/dist/clients/opaque-mutation-scan.js +220 -0
- package/node_modules/pi-lens/dist/clients/package-manager.js +6 -1
- package/node_modules/pi-lens/dist/clients/pipeline.js +57 -9
- package/node_modules/pi-lens/dist/clients/project-conventions.js +2 -8
- package/node_modules/pi-lens/dist/clients/project-diagnostics/cache.js +10 -7
- package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/call-graph-impact.js +2 -1
- package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/gitleaks.js +3 -1
- package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/runner-findings.js +13 -9
- package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/trivy.js +3 -1
- package/node_modules/pi-lens/dist/clients/project-diagnostics/scanner.js +5 -2
- package/node_modules/pi-lens/dist/clients/project-lens-config.js +12 -5
- package/node_modules/pi-lens/dist/clients/project-snapshot-fingerprint.js +48 -0
- package/node_modules/pi-lens/dist/clients/project-snapshot-persist-worker.js +15 -1
- package/node_modules/pi-lens/dist/clients/project-snapshot.js +472 -66
- package/node_modules/pi-lens/dist/clients/read-expansion.js +12 -2
- package/node_modules/pi-lens/dist/clients/read-guard-logger.js +5 -4
- package/node_modules/pi-lens/dist/clients/read-guard-tool-lines.js +5 -2
- package/node_modules/pi-lens/dist/clients/read-guard.js +1 -1
- package/node_modules/pi-lens/dist/clients/resource-sampler.js +1 -1
- package/node_modules/pi-lens/dist/clients/reverse-deps.js +6 -5
- package/node_modules/pi-lens/dist/clients/review-graph/builder.js +42 -17
- package/node_modules/pi-lens/dist/clients/review-graph/git-identity.js +8 -2
- package/node_modules/pi-lens/dist/clients/review-graph/import-resolvers.js +10 -1
- package/node_modules/pi-lens/dist/clients/review-graph/query.js +2 -1
- package/node_modules/pi-lens/dist/clients/review-graph/tsconfig-paths.js +4 -2
- package/node_modules/pi-lens/dist/clients/review-graph/workspace-modules.js +2 -2
- package/node_modules/pi-lens/dist/clients/ruff-client.js +6 -5
- package/node_modules/pi-lens/dist/clients/runtime-agent-end.js +63 -31
- package/node_modules/pi-lens/dist/clients/runtime-context.js +12 -4
- package/node_modules/pi-lens/dist/clients/runtime-coordinator.js +83 -4
- package/node_modules/pi-lens/dist/clients/runtime-session.js +14 -0
- package/node_modules/pi-lens/dist/clients/runtime-tool-call.js +59 -3
- package/node_modules/pi-lens/dist/clients/runtime-tool-result.js +148 -34
- package/node_modules/pi-lens/dist/clients/runtime-turn.js +147 -6
- package/node_modules/pi-lens/dist/clients/rust-client.js +1 -3
- package/node_modules/pi-lens/dist/clients/safe-spawn.js +150 -11
- package/node_modules/pi-lens/dist/clients/security-scan-client.js +1 -3
- package/node_modules/pi-lens/dist/clients/session-summary.js +3 -1
- package/node_modules/pi-lens/dist/clients/sg-runner.js +1 -3
- package/node_modules/pi-lens/dist/clients/source-filter.js +10 -6
- package/node_modules/pi-lens/dist/clients/source-walker.js +1 -1
- package/node_modules/pi-lens/dist/clients/spawn-timeout-cooldown.js +96 -0
- package/node_modules/pi-lens/dist/clients/startup-scan.js +4 -1
- package/node_modules/pi-lens/dist/clients/tool-definition.js +7 -0
- package/node_modules/pi-lens/dist/clients/tool-policy.js +26 -11
- package/node_modules/pi-lens/dist/clients/tool-render.js +2 -1
- package/node_modules/pi-lens/dist/clients/tree-sitter-client.js +10 -4
- package/node_modules/pi-lens/dist/clients/tree-sitter-logger.js +2 -2
- package/node_modules/pi-lens/dist/clients/tree-sitter-symbol-extractor.js +12 -5
- package/node_modules/pi-lens/dist/clients/warm-attach.js +12 -5
- package/node_modules/pi-lens/dist/clients/widget-state.js +27 -11
- package/node_modules/pi-lens/dist/clients/word-index.js +3 -1
- package/node_modules/pi-lens/dist/clients/workspace-topology.js +8 -2
- package/node_modules/pi-lens/dist/clients/zizmor-config.js +9 -1
- package/node_modules/pi-lens/dist/i18n.js +13 -5
- package/node_modules/pi-lens/dist/index.js +10797 -8627
- package/node_modules/pi-lens/dist/mcp/server.js +3 -1
- package/node_modules/pi-lens/dist/tools/ast-grep-replace.js +68 -12
- package/node_modules/pi-lens/dist/tools/lens-diagnostic-mark.js +21 -7
- package/node_modules/pi-lens/dist/tools/lens-diagnostics.js +164 -35
- package/node_modules/pi-lens/dist/tools/lsp-diagnostics.js +24 -7
- package/node_modules/pi-lens/dist/tools/lsp-navigation.js +3 -1
- package/node_modules/pi-lens/dist/tools/module-report.js +1 -1
- package/node_modules/pi-lens/dist/tools/project-report.js +1 -1
- package/node_modules/pi-lens/dist/tools/symbol-search.js +5 -2
- package/node_modules/pi-lens/docs/durable-store-audit-1202.md +1 -1
- package/node_modules/pi-lens/docs/servercapabilities.md +1 -1
- package/node_modules/pi-lens/package.json +160 -156
- package/node_modules/pi-lens/rules/typos/_typos.toml +2 -2
- package/node_modules/pi-lens/scripts/analyze-pi-lens-logs.mjs +31 -13
- package/node_modules/pi-lens/scripts/download-grammars.js +9 -3
- package/node_modules/pi-lens/scripts/rpc-load-check.mjs +30 -9
- package/node_modules/pi-mcp-adapter/CHANGELOG.md +47 -0
- package/node_modules/pi-mcp-adapter/README.md +42 -13
- package/node_modules/pi-mcp-adapter/commands.ts +4 -2
- package/node_modules/pi-mcp-adapter/config.ts +45 -5
- package/node_modules/pi-mcp-adapter/direct-tools.ts +103 -92
- package/node_modules/pi-mcp-adapter/dist/agent-dir.d.ts +10 -0
- package/node_modules/pi-mcp-adapter/dist/agent-dir.js +63 -0
- package/node_modules/pi-mcp-adapter/dist/agent-dir.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/agent-plugin-loader.d.ts +8 -0
- package/node_modules/pi-mcp-adapter/dist/agent-plugin-loader.js +356 -0
- package/node_modules/pi-mcp-adapter/dist/agent-plugin-loader.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/config.d.ts +123 -0
- package/node_modules/pi-mcp-adapter/dist/config.js +1087 -0
- package/node_modules/pi-mcp-adapter/dist/config.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/metadata-cache.d.ts +19 -0
- package/node_modules/pi-mcp-adapter/dist/metadata-cache.js +319 -0
- package/node_modules/pi-mcp-adapter/dist/metadata-cache.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/package-mcp-loader.d.ts +2 -0
- package/node_modules/pi-mcp-adapter/dist/package-mcp-loader.js +156 -0
- package/node_modules/pi-mcp-adapter/dist/package-mcp-loader.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/resource-tools.d.ts +1 -0
- package/node_modules/pi-mcp-adapter/dist/resource-tools.js +15 -0
- package/node_modules/pi-mcp-adapter/dist/resource-tools.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/types.d.ts +564 -0
- package/node_modules/pi-mcp-adapter/dist/types.js +287 -0
- package/node_modules/pi-mcp-adapter/dist/types.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/ui-app-bridge-helpers.d.ts +6 -0
- package/node_modules/pi-mcp-adapter/dist/ui-app-bridge-helpers.js +37 -0
- package/node_modules/pi-mcp-adapter/dist/ui-app-bridge-helpers.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/ui-stream-types.d.ts +104 -0
- package/node_modules/pi-mcp-adapter/dist/ui-stream-types.js +59 -0
- package/node_modules/pi-mcp-adapter/dist/ui-stream-types.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/ui-tool-visibility.d.ts +4 -0
- package/node_modules/pi-mcp-adapter/dist/ui-tool-visibility.js +27 -0
- package/node_modules/pi-mcp-adapter/dist/ui-tool-visibility.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/utils.d.ts +32 -0
- package/node_modules/pi-mcp-adapter/dist/utils.js +338 -0
- package/node_modules/pi-mcp-adapter/dist/utils.js.map +1 -0
- package/node_modules/pi-mcp-adapter/failure-backoff.ts +23 -0
- package/node_modules/pi-mcp-adapter/index.ts +204 -82
- package/node_modules/pi-mcp-adapter/init.ts +41 -30
- package/node_modules/pi-mcp-adapter/lifecycle.ts +16 -8
- package/node_modules/pi-mcp-adapter/mcp-code.ts +2 -0
- package/node_modules/pi-mcp-adapter/mcp-oauth-provider.ts +66 -16
- package/node_modules/pi-mcp-adapter/mcp-output-guard.ts +95 -7
- package/node_modules/pi-mcp-adapter/mcp-probe.ts +18 -4
- package/node_modules/pi-mcp-adapter/mcp-references.ts +368 -0
- package/node_modules/pi-mcp-adapter/mcp-status.ts +8 -19
- package/node_modules/pi-mcp-adapter/metadata-cache.ts +20 -12
- package/node_modules/pi-mcp-adapter/namespace-tools.ts +276 -0
- package/node_modules/pi-mcp-adapter/package.json +24 -6
- package/node_modules/pi-mcp-adapter/proxy-modes.ts +66 -10
- package/node_modules/pi-mcp-adapter/search-ranking.ts +2 -0
- package/node_modules/pi-mcp-adapter/server-manager.ts +63 -12
- package/node_modules/pi-mcp-adapter/state.ts +1 -3
- package/node_modules/pi-mcp-adapter/tool-result-renderer.ts +16 -2
- package/node_modules/pi-mcp-adapter/types.ts +48 -1
- package/node_modules/pi-mcp-adapter/ui-server.ts +3 -19
- package/node_modules/pi-mcp-adapter/ui-session.ts +2 -1
- package/node_modules/pi-mcp-adapter/utils.ts +21 -19
- package/node_modules/pi-web-access/CHANGELOG.md +26 -0
- package/node_modules/pi-web-access/README.md +71 -14
- package/node_modules/pi-web-access/chrome-cookies.ts +115 -35
- package/node_modules/pi-web-access/credential-source.ts +6 -2
- package/node_modules/pi-web-access/curator-page.ts +5 -3
- package/node_modules/pi-web-access/curator-server.ts +2 -1
- package/node_modules/pi-web-access/extract.ts +89 -9
- package/node_modules/pi-web-access/fetch-params.ts +13 -0
- package/node_modules/pi-web-access/gemini-adc.ts +298 -0
- package/node_modules/pi-web-access/gemini-api.ts +59 -15
- package/node_modules/pi-web-access/gemini-search.ts +58 -18
- package/node_modules/pi-web-access/gemini-url-context.ts +3 -2
- package/node_modules/pi-web-access/gemini-web-config.ts +57 -7
- package/node_modules/pi-web-access/gemini-web.ts +9 -3
- package/node_modules/pi-web-access/github-api.ts +5 -4
- package/node_modules/pi-web-access/github-issue-pr.ts +700 -0
- package/node_modules/pi-web-access/index.ts +403 -297
- package/node_modules/pi-web-access/kimi-search.ts +234 -0
- package/node_modules/pi-web-access/openai-search.ts +118 -21
- package/node_modules/pi-web-access/package.json +3 -2
- package/node_modules/pi-web-access/ssrf-protection.ts +4 -1
- package/node_modules/pi-web-access/utils.ts +307 -1
- package/node_modules/pi-web-access/youtube-extract.ts +2 -2
- package/package.json +46 -37
- package/node_modules/@herbertgao/pi-copy-response/CHANGELOG.md +0 -49
- package/node_modules/@herbertgao/pi-copy-response/LICENSE +0 -22
- package/node_modules/@herbertgao/pi-handoff/CHANGELOG.md +0 -83
- package/node_modules/@herbertgao/pi-handoff/LICENSE +0 -22
- package/node_modules/@herbertgao/pi-handoff/package.json +0 -60
- package/node_modules/@herbertgao/pi-inline-skills/CHANGELOG.md +0 -57
- package/node_modules/@herbertgao/pi-inline-skills/LICENSE +0 -22
- package/node_modules/@herbertgao/pi-mermaid-open/CHANGELOG.md +0 -39
- package/node_modules/@herbertgao/pi-preferred-thinking/CHANGELOG.md +0 -63
- package/node_modules/@herbertgao/pi-preferred-thinking/LICENSE +0 -22
- package/node_modules/@herbertgao/pi-recap/CHANGELOG.md +0 -101
- package/node_modules/@herbertgao/pi-recap/LICENSE +0 -22
- package/node_modules/@herbertgao/pi-recap/package.json +0 -55
- package/node_modules/@herbertgao/pi-rename/CHANGELOG.md +0 -49
- package/node_modules/@herbertgao/pi-rename/LICENSE +0 -22
- package/node_modules/@herbertgao/pi-rename/package.json +0 -63
- package/node_modules/@herbertgao/pi-titlebar-spinner/CHANGELOG.md +0 -25
- package/node_modules/@herbertgao/pi-titlebar-spinner/LICENSE +0 -22
- /package/node_modules/{@herbertgao → @tifan}/pi-copy-response/src/index.ts +0 -0
- /package/node_modules/{@herbertgao → @tifan}/pi-handoff/src/complete-text.ts +0 -0
- /package/node_modules/{@herbertgao → @tifan}/pi-handoff/src/session-query.ts +0 -0
- /package/node_modules/{@herbertgao → @tifan}/pi-inline-skills/src/index.ts +0 -0
- /package/node_modules/{@herbertgao → @tifan}/pi-mermaid-open/herdr-plugin/herdr-plugin.toml +0 -0
- /package/node_modules/{@herbertgao → @tifan}/pi-mermaid-open/herdr-plugin/viewer.mjs +0 -0
- /package/node_modules/{@herbertgao → @tifan}/pi-mermaid-open/src/index.ts +0 -0
- /package/node_modules/{@herbertgao → @tifan}/pi-recap/src/index.ts +0 -0
- /package/node_modules/{@herbertgao → @tifan}/pi-recap/src/model-picker.ts +0 -0
- /package/node_modules/{@herbertgao → @tifan}/pi-recap/src/sanitize.ts +0 -0
- /package/node_modules/{@herbertgao → @tifan}/pi-recap/src/tui.ts +0 -0
- /package/node_modules/{@herbertgao → @tifan}/pi-rename/src/model-picker.ts +0 -0
- /package/node_modules/{@herbertgao → @tifan}/pi-rename/src/naming.ts +0 -0
- /package/node_modules/{@herbertgao → @tifan}/pi-rename/src/sanitize.ts +0 -0
- /package/node_modules/{@herbertgao → @tifan}/pi-titlebar-spinner/src/index.ts +0 -0
|
@@ -0,0 +1,207 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
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";
|
|
@@ -0,0 +1,118 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
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.
|