@herbertgao/pi-extensions 2026.8.14 → 2026.9.0
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 +19 -13
- package/THIRD_PARTY_NOTICES.md +26 -1
- package/node_modules/@czottmann/pi-automode/CHANGELOG.md +8 -1
- package/node_modules/@czottmann/pi-automode/README.md +4 -0
- package/node_modules/@czottmann/pi-automode/extensions/auto-mode/classifier.ts +71 -9
- package/node_modules/@czottmann/pi-automode/package.json +1 -1
- package/node_modules/@herbertgao/pi-bark/LICENSE +21 -0
- package/node_modules/@herbertgao/pi-bark/README.md +44 -0
- package/node_modules/@herbertgao/pi-bark/assets/pi-icon.png +0 -0
- package/node_modules/@herbertgao/pi-bark/package.json +53 -0
- package/node_modules/@herbertgao/pi-bark/src/index.ts +178 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/config.ts +20 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/panel.ts +46 -3
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/interaction.ts +55 -17
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/packets.ts +6 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/scroll.ts +5 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/result.ts +34 -30
- package/node_modules/@herbertgao/pi-cc-extensions/package.json +3 -3
- package/node_modules/@juicesharp/rpiv-ask-user-question/package.json +2 -2
- package/node_modules/@narumitw/pi-btw/README.md +129 -88
- package/node_modules/@narumitw/pi-btw/dist/index.ts +283 -59
- package/node_modules/@narumitw/pi-btw/dist/index.ts.map +3 -3
- package/node_modules/@narumitw/pi-btw/package.json +5 -8
- package/node_modules/@narumitw/pi-btw/src/btw.ts +31 -26
- package/node_modules/@narumitw/pi-btw/src/fullscreen-ui.ts +264 -24
- package/node_modules/@narumitw/pi-btw/src/menu.ts +34 -2
- package/node_modules/@narumitw/pi-btw/src/settings.ts +16 -0
- package/node_modules/@narumitw/pi-btw/src/text.ts +18 -0
- package/node_modules/@narumitw/pi-btw/src/transcript-pager.ts +5 -16
- package/node_modules/@narumitw/pi-caffeinate/LICENSE +21 -0
- package/node_modules/@narumitw/pi-caffeinate/README.md +224 -0
- package/node_modules/@narumitw/pi-caffeinate/dist/index.ts +1112 -0
- package/node_modules/@narumitw/pi-caffeinate/dist/index.ts.map +7 -0
- package/node_modules/@narumitw/pi-caffeinate/package.json +53 -0
- package/node_modules/@narumitw/pi-caffeinate/src/caffeinate.ts +811 -0
- package/node_modules/@narumitw/pi-caffeinate/src/dbus-inhibit.ts +153 -0
- package/node_modules/@narumitw/pi-caffeinate/src/index.ts +1 -0
- package/node_modules/@narumitw/pi-caffeinate/src/inhibitor-process.ts +43 -0
- package/node_modules/@narumitw/pi-caffeinate/src/inhibitors.ts +167 -0
- package/node_modules/@narumitw/pi-caffeinate/src/settings.ts +202 -0
- package/node_modules/@tifan/pi-handoff/README.md +39 -13
- package/node_modules/@tifan/pi-handoff/package.json +2 -2
- package/node_modules/@tifan/pi-handoff/src/index.ts +166 -5
- package/node_modules/@tifan/pi-recap/README.md +1 -1
- package/node_modules/@tifan/pi-recap/package.json +2 -2
- package/node_modules/@tifan/pi-recap/src/index.ts +15 -0
- package/node_modules/@tifan/pi-rename/README.md +42 -21
- package/node_modules/@tifan/pi-rename/package.json +1 -1
- package/node_modules/@tifan/pi-rename/src/index.ts +62 -11
- package/node_modules/@tifan/pi-rename/src/language.ts +18 -0
- package/node_modules/@tifan/pi-rename/src/models.ts +69 -13
- package/node_modules/@tifan/pi-rename/src/naming.ts +36 -7
- package/node_modules/@tifan/pi-rename/src/sanitize.ts +22 -14
- package/node_modules/pi-lens/CHANGELOG.md +320 -0
- package/node_modules/pi-lens/config/dependency-cruiser-eager-allowlist.json +79 -0
- package/node_modules/pi-lens/dist/clients/actionable-warnings-logger.js +16 -1
- package/node_modules/pi-lens/dist/clients/ast-grep-client.js +13 -6
- package/node_modules/pi-lens/dist/clients/availability-probe-flight.js +12 -0
- package/node_modules/pi-lens/dist/clients/biome-client.js +7 -0
- package/node_modules/pi-lens/dist/clients/blocker-freshness.js +20 -0
- package/node_modules/pi-lens/dist/clients/bounded-telemetry.js +56 -19
- package/node_modules/pi-lens/dist/clients/build-identity.js +95 -0
- package/node_modules/pi-lens/dist/clients/bus-publish.js +3 -0
- package/node_modules/pi-lens/dist/clients/cache/rule-cache.js +2 -1
- package/node_modules/pi-lens/dist/clients/cache-observability.js +2 -1
- package/node_modules/pi-lens/dist/clients/cascade-logger.js +15 -1
- package/node_modules/pi-lens/dist/clients/dead-code-client.js +14 -11
- package/node_modules/pi-lens/dist/clients/degradation-ledger.js +56 -4
- package/node_modules/pi-lens/dist/clients/demoted-finding-render.js +14 -0
- package/node_modules/pi-lens/dist/clients/dependency-checker.js +20 -3
- package/node_modules/pi-lens/dist/clients/deps/minimatch.js +1 -1
- package/node_modules/pi-lens/dist/clients/dispatch/collect-later-tier.js +39 -0
- package/node_modules/pi-lens/dist/clients/dispatch/dispatcher.js +150 -9
- package/node_modules/pi-lens/dist/clients/dispatch/fact-store.js +231 -9
- package/node_modules/pi-lens/dist/clients/dispatch/integration.js +205 -100
- package/node_modules/pi-lens/dist/clients/dispatch/pending-runner-findings.js +87 -0
- package/node_modules/pi-lens/dist/clients/dispatch/plan.js +21 -5
- package/node_modules/pi-lens/dist/clients/dispatch/runners/ast-grep-napi.js +174 -55
- package/node_modules/pi-lens/dist/clients/dispatch/runners/eslint.js +5 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/helm-lint.js +16 -3
- package/node_modules/pi-lens/dist/clients/dispatch/runners/helm-render.js +54 -9
- package/node_modules/pi-lens/dist/clients/dispatch/runners/index.js +1 -3
- package/node_modules/pi-lens/dist/clients/dispatch/runners/lsp.js +37 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/markdownlint.js +4 -1
- package/node_modules/pi-lens/dist/clients/dispatch/runners/oxlint.js +11 -4
- package/node_modules/pi-lens/dist/clients/dispatch/runners/psscriptanalyzer.js +4 -0
- package/node_modules/pi-lens/dist/clients/dispatch/runners/rust-clippy.js +8 -3
- package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/runner-helpers.js +76 -25
- package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/spawn-outcome.js +4 -0
- package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/tool-failure.js +19 -7
- package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/toolchain-availability.js +7 -13
- package/node_modules/pi-lens/dist/clients/dispatch/runners/yaml-rule-parser.js +51 -17
- package/node_modules/pi-lens/dist/clients/event-loop-monitor.js +66 -1
- package/node_modules/pi-lens/dist/clients/file-utils.js +157 -7
- package/node_modules/pi-lens/dist/clients/finding-delivery-gate.js +5 -0
- package/node_modules/pi-lens/dist/clients/formatters.js +28 -3
- package/node_modules/pi-lens/dist/clients/git-guard.js +197 -47
- package/node_modules/pi-lens/dist/clients/git-tracked-ignore.js +32 -1
- package/node_modules/pi-lens/dist/clients/govulncheck-client.js +5 -1
- package/node_modules/pi-lens/dist/clients/gzip-stage-write.js +7 -0
- package/node_modules/pi-lens/dist/clients/installer/index.js +131 -34
- package/node_modules/pi-lens/dist/clients/installer/managed-tool-refresh.js +3 -1
- package/node_modules/pi-lens/dist/clients/instance-reaper.js +4 -13
- package/node_modules/pi-lens/dist/clients/instance-registry-lock.js +145 -0
- package/node_modules/pi-lens/dist/clients/instance-registry.js +432 -122
- package/node_modules/pi-lens/dist/clients/jscpd-client.js +6 -1
- package/node_modules/pi-lens/dist/clients/language-profile.js +4 -2
- package/node_modules/pi-lens/dist/clients/latency-logger.js +19 -1
- package/node_modules/pi-lens/dist/clients/lens-flag-registry.js +8 -0
- package/node_modules/pi-lens/dist/clients/lens-map.js +3 -1
- package/node_modules/pi-lens/dist/clients/lsp/cascade-tier.js +4 -0
- package/node_modules/pi-lens/dist/clients/lsp/client.js +516 -31
- package/node_modules/pi-lens/dist/clients/lsp/config.js +25 -2
- package/node_modules/pi-lens/dist/clients/lsp/diagnostic-binding.js +9 -4
- package/node_modules/pi-lens/dist/clients/lsp/index.js +509 -182
- package/node_modules/pi-lens/dist/clients/lsp/jvm-runtime.js +5 -0
- package/node_modules/pi-lens/dist/clients/lsp/launch.js +36 -8
- package/node_modules/pi-lens/dist/clients/lsp/pending-aux-coverage.js +116 -4
- package/node_modules/pi-lens/dist/clients/lsp/server.js +142 -13
- package/node_modules/pi-lens/dist/clients/lsp/session-roots.js +99 -0
- package/node_modules/pi-lens/dist/clients/lsp/workspace-diagnostics-cache.js +16 -6
- package/node_modules/pi-lens/dist/clients/lsp/workspace-sweep-hold.js +32 -23
- package/node_modules/pi-lens/dist/clients/lsp-mutation.js +16 -2
- package/node_modules/pi-lens/dist/clients/mcp/analyze.js +12 -6
- package/node_modules/pi-lens/dist/clients/mcp/session.js +14 -1
- package/node_modules/pi-lens/dist/clients/memory-sampler.js +23 -1
- package/node_modules/pi-lens/dist/clients/message-end-attribution.js +30 -0
- package/node_modules/pi-lens/dist/clients/metrics-history.js +21 -4
- package/node_modules/pi-lens/dist/clients/opaque-mutation-scan.js +232 -18
- package/node_modules/pi-lens/dist/clients/package-manager.js +6 -18
- package/node_modules/pi-lens/dist/clients/path-keyed-map.js +14 -1
- package/node_modules/pi-lens/dist/clients/path-utils.js +32 -0
- package/node_modules/pi-lens/dist/clients/pipeline.js +0 -8
- package/node_modules/pi-lens/dist/clients/process-singletons.js +210 -0
- package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/madge.js +2 -1
- package/node_modules/pi-lens/dist/clients/project-diagnostics/scanner.js +10 -4
- package/node_modules/pi-lens/dist/clients/project-snapshot.js +33 -11
- package/node_modules/pi-lens/dist/clients/read-guard-logger.js +24 -2
- package/node_modules/pi-lens/dist/clients/read-guard.js +74 -7
- package/node_modules/pi-lens/dist/clients/recent-touches.js +17 -5
- package/node_modules/pi-lens/dist/clients/review-graph/builder.js +639 -62
- package/node_modules/pi-lens/dist/clients/review-graph/tsconfig-paths.js +5 -1
- package/node_modules/pi-lens/dist/clients/review-graph-logger.js +21 -1
- package/node_modules/pi-lens/dist/clients/runtime-coordinator.js +68 -0
- package/node_modules/pi-lens/dist/clients/runtime-session.js +30 -12
- package/node_modules/pi-lens/dist/clients/runtime-tool-call.js +15 -0
- package/node_modules/pi-lens/dist/clients/runtime-tool-result.js +106 -7
- package/node_modules/pi-lens/dist/clients/runtime-turn.js +242 -27
- package/node_modules/pi-lens/dist/clients/safe-spawn.js +158 -18
- package/node_modules/pi-lens/dist/clients/security-scan-client.js +48 -17
- package/node_modules/pi-lens/dist/clients/session-lifecycle.js +238 -42
- package/node_modules/pi-lens/dist/clients/sg-runner.js +27 -15
- package/node_modules/pi-lens/dist/clients/shared-checkout-guard.js +338 -0
- package/node_modules/pi-lens/dist/clients/spawn-output-cap.js +37 -0
- package/node_modules/pi-lens/dist/clients/spawn-timeout-cooldown.js +15 -1
- package/node_modules/pi-lens/dist/clients/startup-scan.js +6 -7
- package/node_modules/pi-lens/dist/clients/startup-timing.js +69 -4
- package/node_modules/pi-lens/dist/clients/string-utils.js +20 -0
- package/node_modules/pi-lens/dist/clients/test-runner-client.js +419 -88
- package/node_modules/pi-lens/dist/clients/tool-policy.js +1 -1
- package/node_modules/pi-lens/dist/clients/tree-sitter-client.js +11 -5
- package/node_modules/pi-lens/dist/clients/tree-sitter-logger.js +17 -1
- package/node_modules/pi-lens/dist/clients/warm-attach.js +8 -10
- package/node_modules/pi-lens/dist/clients/word-index-logger.js +13 -1
- package/node_modules/pi-lens/dist/clients/word-index-store.js +448 -0
- package/node_modules/pi-lens/dist/clients/word-index.js +582 -104
- package/node_modules/pi-lens/dist/clients/workspace-topology.js +17 -0
- package/node_modules/pi-lens/dist/clients/zizmor-config.js +26 -6
- package/node_modules/pi-lens/dist/index.js +11243 -6651
- package/node_modules/pi-lens/dist/mcp/build-staleness.js +8 -7
- package/node_modules/pi-lens/dist/mcp/cli.js +3 -1
- package/node_modules/pi-lens/dist/mcp/server.js +6 -1
- package/node_modules/pi-lens/dist/tools/lens-diagnostics.js +4 -0
- package/node_modules/pi-lens/dist/tools/lsp-diagnostics.js +14 -5
- package/node_modules/pi-lens/dist/tools/lsp-navigation.js +3 -1
- package/node_modules/pi-lens/docs/agent-guide.md +4 -2
- package/node_modules/pi-lens/docs/ast-grep_rules_catalog.md +41 -10
- package/node_modules/pi-lens/docs/astplayground.md +26 -17
- package/node_modules/pi-lens/package.json +5 -1
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/c-no-malloc-free-test.yml +20 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/cpp-no-malloc-free-test.yml +25 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/cpp-no-printf-test.yml +19 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/go-no-fmt-println-test.yml +19 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/go-no-panic-in-lib-test.yml +17 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/go-no-underscore-func-name-test.yml +18 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/go-prefer-errors-is-test.yml +15 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/go-prefer-string-builder-test.yml +21 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/hyphenated-svg-attribute-test.yml +11 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/kotlin-no-lateinit-test.yml +17 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/kotlin-no-nullable-boolean-test.yml +15 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/kotlin-no-println-test.yml +19 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/kotlin-no-unnecessary-let-test.yml +7 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/kotlin-no-unsafe-cast-test.yml +7 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/kotlin-no-var-test.yml +7 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/kotlin-prefer-data-class-test.yml +25 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/kotlin-prefer-is-empty-test.yml +11 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-important-test.yml +21 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-raw-types-test.yml +30 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-string-concat-in-loop-test.yml +100 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-system-out-println-test.yml +7 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/prefer-string-is-empty-test.yml +7 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/python-optional-type-test.yml +9 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/reducible-list-comprehension-test.yml +11 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/ruby-symbol-to-proc-candidate-test.yml +10 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/rust-no-chars-enumerate-test.yml +7 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/c-no-malloc-free.yml +39 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/cpp-no-malloc-free.yml +45 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/cpp-no-printf.yml +41 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/go-no-fmt-println.yml +43 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/go-no-panic-in-lib.yml +41 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/go-no-underscore-func-name.yml +35 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/go-prefer-errors-is.yml +40 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/go-prefer-string-builder.yml +43 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/hyphenated-svg-attribute.yml +32 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/kotlin-no-lateinit.yml +37 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/kotlin-no-nullable-boolean.yml +33 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/kotlin-no-println.yml +42 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/kotlin-no-unnecessary-let.yml +28 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/kotlin-no-unsafe-cast.yml +28 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/kotlin-no-var.yml +35 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/kotlin-prefer-data-class.yml +66 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/kotlin-prefer-is-empty.yml +35 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-important.yml +21 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-raw-types.yml +33 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-string-concat-in-loop.yml +90 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-system-out-println.yml +16 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/prefer-string-is-empty.yml +11 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/python-optional-type.yml +22 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/reducible-list-comprehension.yml +29 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/ruby-symbol-to-proc-candidate.yml +25 -0
- package/node_modules/pi-lens/rules/ast-grep-rules/rules/rust-no-chars-enumerate.yml +19 -0
- package/node_modules/pi-mcp-adapter/CHANGELOG.md +42 -0
- package/node_modules/pi-mcp-adapter/README.md +15 -15
- package/node_modules/pi-mcp-adapter/commands.ts +59 -22
- package/node_modules/pi-mcp-adapter/config.ts +18 -4
- package/node_modules/pi-mcp-adapter/direct-tools.ts +26 -6
- package/node_modules/pi-mcp-adapter/dist/config.d.ts +4 -0
- package/node_modules/pi-mcp-adapter/dist/config.js +13 -4
- package/node_modules/pi-mcp-adapter/dist/config.js.map +1 -1
- package/node_modules/pi-mcp-adapter/dist/types.d.ts +12 -4
- package/node_modules/pi-mcp-adapter/dist/types.js.map +1 -1
- package/node_modules/pi-mcp-adapter/error-signal.ts +15 -4
- package/node_modules/pi-mcp-adapter/errors.ts +141 -0
- package/node_modules/pi-mcp-adapter/host-html-template.ts +58 -5
- package/node_modules/pi-mcp-adapter/index.ts +2 -3
- package/node_modules/pi-mcp-adapter/init.ts +5 -0
- package/node_modules/pi-mcp-adapter/mcp-auth-flow.ts +105 -32
- package/node_modules/pi-mcp-adapter/mcp-panel.ts +30 -9
- package/node_modules/pi-mcp-adapter/mcp-setup-panel.ts +66 -28
- package/node_modules/pi-mcp-adapter/mcp-status.ts +2 -0
- package/node_modules/pi-mcp-adapter/package.json +2 -1
- package/node_modules/pi-mcp-adapter/proxy-modes.ts +88 -25
- package/node_modules/pi-mcp-adapter/sandbox-proxy-template.ts +217 -0
- package/node_modules/pi-mcp-adapter/server-manager.ts +343 -6
- package/node_modules/pi-mcp-adapter/skills/mcp-scripting/SKILL.md +1 -0
- package/node_modules/pi-mcp-adapter/types.ts +19 -4
- package/node_modules/pi-mcp-adapter/ui-resource-handler.ts +18 -2
- package/node_modules/pi-mcp-adapter/ui-server.ts +179 -54
- package/node_modules/pi-mcp-adapter/ui-session.ts +28 -8
- package/node_modules/pi-web-access/CHANGELOG.md +20 -0
- package/node_modules/pi-web-access/README.md +15 -2
- package/node_modules/pi-web-access/extract.ts +57 -12
- package/node_modules/pi-web-access/github-extract.ts +47 -3
- package/node_modules/pi-web-access/index.ts +1 -1
- package/node_modules/pi-web-access/package.json +1 -1
- package/node_modules/pi-web-access/page-query.ts +61 -8
- package/package.json +21 -17
- package/node_modules/@tifan/pi-titlebar-spinner/README.md +0 -24
- package/node_modules/@tifan/pi-titlebar-spinner/package.json +0 -39
- package/node_modules/@tifan/pi-titlebar-spinner/src/index.ts +0 -49
|
@@ -6,6 +6,7 @@ import { getAgentDir } from "@earendil-works/pi-coding-agent";
|
|
|
6
6
|
import { BTW_THINKING_LEVELS, type BtwThinkingLevel } from "./side-thread.js";
|
|
7
7
|
|
|
8
8
|
export const BTW_SETTINGS_FILE = "pi-btw.json";
|
|
9
|
+
export const DEFAULT_FULLSCREEN_COPY_ON_SELECT = true;
|
|
9
10
|
export const DEFAULT_REMEMBER_THINKING_LEVEL_CHANGES = true;
|
|
10
11
|
const MAX_SETTINGS_BYTES = 64 * 1024;
|
|
11
12
|
|
|
@@ -13,6 +14,7 @@ export interface BtwSettings {
|
|
|
13
14
|
model?: string;
|
|
14
15
|
thinkingLevel?: BtwThinkingLevel;
|
|
15
16
|
rememberThinkingLevelChanges?: boolean;
|
|
17
|
+
fullscreenCopyOnSelect?: boolean;
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
export type BtwSettingsLoadResult =
|
|
@@ -23,6 +25,7 @@ export type BtwSettingsLoadResult =
|
|
|
23
25
|
export interface BtwSettingsPatch {
|
|
24
26
|
thinkingLevel?: BtwThinkingLevel;
|
|
25
27
|
rememberThinkingLevelChanges?: boolean;
|
|
28
|
+
fullscreenCopyOnSelect?: boolean;
|
|
26
29
|
}
|
|
27
30
|
|
|
28
31
|
export interface UpdateBtwSettingsOptions {
|
|
@@ -58,6 +61,11 @@ export function normalizeBtwSettings(value: unknown): BtwSettings | undefined {
|
|
|
58
61
|
if (typeof remember !== "boolean") return undefined;
|
|
59
62
|
settings.rememberThinkingLevelChanges = remember;
|
|
60
63
|
}
|
|
64
|
+
if (Object.hasOwn(value, "fullscreenCopyOnSelect")) {
|
|
65
|
+
const copyOnSelect = Reflect.get(value, "fullscreenCopyOnSelect");
|
|
66
|
+
if (typeof copyOnSelect !== "boolean") return undefined;
|
|
67
|
+
settings.fullscreenCopyOnSelect = copyOnSelect;
|
|
68
|
+
}
|
|
61
69
|
return settings;
|
|
62
70
|
}
|
|
63
71
|
|
|
@@ -70,6 +78,10 @@ export function parseBtwModelReference(
|
|
|
70
78
|
return { provider: reference.slice(0, separator), modelId: reference.slice(separator + 1) };
|
|
71
79
|
}
|
|
72
80
|
|
|
81
|
+
export function effectiveFullscreenCopyOnSelect(settings: BtwSettings): boolean {
|
|
82
|
+
return settings.fullscreenCopyOnSelect ?? DEFAULT_FULLSCREEN_COPY_ON_SELECT;
|
|
83
|
+
}
|
|
84
|
+
|
|
73
85
|
export function effectiveRememberThinkingLevelChanges(settings: BtwSettings): boolean {
|
|
74
86
|
return settings.rememberThinkingLevelChanges ?? DEFAULT_REMEMBER_THINKING_LEVEL_CHANGES;
|
|
75
87
|
}
|
|
@@ -233,6 +245,10 @@ function applyBtwSettingsPatch(
|
|
|
233
245
|
if (Object.hasOwn(patch, "rememberThinkingLevelChanges")) {
|
|
234
246
|
updated.rememberThinkingLevelChanges = patch.rememberThinkingLevelChanges;
|
|
235
247
|
}
|
|
248
|
+
if (Object.hasOwn(patch, "fullscreenCopyOnSelect")) {
|
|
249
|
+
if (patch.fullscreenCopyOnSelect === undefined) delete updated.fullscreenCopyOnSelect;
|
|
250
|
+
else updated.fullscreenCopyOnSelect = patch.fullscreenCopyOnSelect;
|
|
251
|
+
}
|
|
236
252
|
return updated;
|
|
237
253
|
}
|
|
238
254
|
|
|
@@ -8,3 +8,21 @@ export function sanitizeSingleLine(text: string): string {
|
|
|
8
8
|
.replace(/ +/gu, " ")
|
|
9
9
|
.trim();
|
|
10
10
|
}
|
|
11
|
+
|
|
12
|
+
export function formatKeyLabel(key: string): string {
|
|
13
|
+
const sanitized = sanitizeSingleLine(key);
|
|
14
|
+
if (!sanitized) return "";
|
|
15
|
+
return sanitized
|
|
16
|
+
.split("+")
|
|
17
|
+
.map((part) => {
|
|
18
|
+
const lower = part.toLowerCase();
|
|
19
|
+
if (lower === "shift") return "Shift";
|
|
20
|
+
if (lower === "ctrl") return "Ctrl";
|
|
21
|
+
if (lower === "alt") return "Alt";
|
|
22
|
+
if (lower === "super") return "Super";
|
|
23
|
+
return part.length === 1
|
|
24
|
+
? part.toUpperCase()
|
|
25
|
+
: `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`;
|
|
26
|
+
})
|
|
27
|
+
.join("+");
|
|
28
|
+
}
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
} from "@earendil-works/pi-tui";
|
|
25
25
|
import type { BtwFullscreenLayoutComponent } from "./fullscreen-ui.js";
|
|
26
26
|
import type { BtwThinkingLevel, SideThreadTurn } from "./side-thread.js";
|
|
27
|
-
import { sanitizeSingleLine } from "./text.js";
|
|
27
|
+
import { formatKeyLabel, sanitizeSingleLine } from "./text.js";
|
|
28
28
|
|
|
29
29
|
const TRANSCRIPT_CHROME_LINES = 2;
|
|
30
30
|
const MAX_STEERING_DISPLAY_LINES = 3;
|
|
@@ -613,21 +613,10 @@ function renderSideThreadHeader(
|
|
|
613
613
|
}
|
|
614
614
|
|
|
615
615
|
function thinkingKeyLabel(keybindings: KeybindingsManager): string {
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
"Shift+Tab"
|
|
619
|
-
|
|
620
|
-
.split("+")
|
|
621
|
-
.map((part) => {
|
|
622
|
-
const lower = part.toLowerCase();
|
|
623
|
-
if (lower === "shift") return "Shift";
|
|
624
|
-
if (lower === "ctrl") return "Ctrl";
|
|
625
|
-
if (lower === "alt") return "Alt";
|
|
626
|
-
return part.length === 1
|
|
627
|
-
? part.toUpperCase()
|
|
628
|
-
: `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`;
|
|
629
|
-
})
|
|
630
|
-
.join("+");
|
|
616
|
+
return (
|
|
617
|
+
formatKeyLabel(String(keybindings.getKeys("app.thinking.cycle")[0] ?? "shift+tab")) ||
|
|
618
|
+
"Shift+Tab"
|
|
619
|
+
);
|
|
631
620
|
}
|
|
632
621
|
|
|
633
622
|
function fitComposerLayout(
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 narumiruna
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
# ☕ pi-caffeinate — Keep Your Computer Awake While Pi Runs
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@narumitw/pi-caffeinate) [](https://pi.dev) [](./LICENSE)
|
|
4
|
+
|
|
5
|
+
Prevent system or display sleep while Pi is running an agent task, then release the inhibitor when the run ends.
|
|
6
|
+
|
|
7
|
+
## ✨ Features
|
|
8
|
+
|
|
9
|
+
- Starts an OS sleep inhibitor when a Pi run begins and releases it when the run or session ends.
|
|
10
|
+
- Supports macOS, Windows, WSL, and Linux, with display-awake as the default.
|
|
11
|
+
- Provides `/caffeinate` controls for keep-awake mode and status.
|
|
12
|
+
- Persists preferences locally and accepts an optional custom inhibitor command.
|
|
13
|
+
- Falls back when possible, warns on partial activation, and reports when no inhibitor is available.
|
|
14
|
+
|
|
15
|
+
## 📦 Install
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pi install npm:@narumitw/pi-caffeinate
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Try without installing permanently:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
pi -e npm:@narumitw/pi-caffeinate
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Try this package locally from the repository root:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm --workspace @narumitw/pi-caffeinate run build
|
|
31
|
+
pi -e ./packages/pi-caffeinate
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
The package declares `dist/index.ts`, so an unbuilt local checkout must be built before Pi loads the package directory.
|
|
35
|
+
Pi extensions run with the Pi process's user permissions, so install only trusted packages.
|
|
36
|
+
|
|
37
|
+
## 🚀 Quick start
|
|
38
|
+
|
|
39
|
+
Load the extension and use Pi normally.
|
|
40
|
+
During each agent run, pi-caffeinate uses the saved mode and defaults to keeping the system and display awake.
|
|
41
|
+
Run `/caffeinate` for controls or `/caffeinate status` for the current state.
|
|
42
|
+
|
|
43
|
+
## 🖥️ Supported platforms
|
|
44
|
+
|
|
45
|
+
The default `display` mode prevents system sleep, suspend, or hibernate and keeps the display awake.
|
|
46
|
+
Use `/caffeinate sleep` to prevent system sleep while allowing normal screen blanking or monitor power-off.
|
|
47
|
+
|
|
48
|
+
| Platform | `sleep` mode | `display` mode, default |
|
|
49
|
+
| --- | --- | --- |
|
|
50
|
+
| macOS | `caffeinate -ims` | `caffeinate -dimsu` |
|
|
51
|
+
| Windows | PowerShell `SetThreadExecutionState(0x80000001)` | PowerShell `SetThreadExecutionState(0x80000003)` |
|
|
52
|
+
| WSL | Windows `powershell.exe` with `SetThreadExecutionState(0x80000001)` | Windows `powershell.exe` with `SetThreadExecutionState(0x80000003)` |
|
|
53
|
+
| Linux with systemd | `systemd-inhibit --what=sleep ... sleep infinity` | D-Bus `org.freedesktop.ScreenSaver.Inhibit` + `systemd-inhibit --what=idle:sleep ... sleep infinity` |
|
|
54
|
+
| Linux without systemd | `caffeinate -ims` when available | D-Bus `org.freedesktop.ScreenSaver.Inhibit` + `caffeinate -dimsu` when available; D-Bus only otherwise |
|
|
55
|
+
|
|
56
|
+
On Linux, `display` mode requests idle inhibition from `org.freedesktop.ScreenSaver` over D-Bus.
|
|
57
|
+
It tries `/org/freedesktop/ScreenSaver` and `/ScreenSaver` for desktop compatibility and keeps the session-bus connection open for the agent turn.
|
|
58
|
+
Calling `UnInhibit` or closing the connection releases the request.
|
|
59
|
+
`systemd-inhibit --what=idle:sleep` runs alongside D-Bus to preserve logind idle and sleep inhibition.
|
|
60
|
+
If the ScreenSaver service is unavailable, pi-caffeinate keeps the systemd or `caffeinate` blocker and warns that activation is partial.
|
|
61
|
+
If only D-Bus is available, it warns that direct system suspend may remain possible.
|
|
62
|
+
D-Bus calls have 2-second deadlines, and stop or shutdown aborts an in-progress acquisition before closing the connection.
|
|
63
|
+
|
|
64
|
+
If no supported inhibitor is available, the extension stays loaded and reports that caffeinate is unavailable.
|
|
65
|
+
|
|
66
|
+
## 💬 Commands
|
|
67
|
+
|
|
68
|
+
```text
|
|
69
|
+
/caffeinate
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Opens keep-awake controls in TUI or RPC mode.
|
|
73
|
+
Print and JSON modes reject the interactive menu.
|
|
74
|
+
Direct routes avoid interactive UI, but Pi's print and JSON modes do not display their notification feedback.
|
|
75
|
+
|
|
76
|
+
```text
|
|
77
|
+
/caffeinate display
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Keeps the system and screen/display awake.
|
|
81
|
+
If an inhibitor is currently active, it is restarted so the new mode applies immediately.
|
|
82
|
+
|
|
83
|
+
```text
|
|
84
|
+
/caffeinate sleep
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Keeps the system awake while allowing normal display sleep.
|
|
88
|
+
If an inhibitor is currently active, it is restarted so the new mode applies immediately.
|
|
89
|
+
|
|
90
|
+
```text
|
|
91
|
+
/caffeinate status
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Shows whether the inhibitor is active, unavailable, disabled, or idle.
|
|
95
|
+
The result includes the mode, quiet-mode state, and settings path.
|
|
96
|
+
|
|
97
|
+
```text
|
|
98
|
+
/caffeinate mode
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Opens the keep-awake mode selector in TUI or RPC mode.
|
|
102
|
+
Escape closes it.
|
|
103
|
+
|
|
104
|
+
```text
|
|
105
|
+
/caffeinate stop
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Releases the active inhibitor until Pi starts another agent run.
|
|
109
|
+
|
|
110
|
+
```text
|
|
111
|
+
/caffeinate help
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Shows the canonical command routes.
|
|
115
|
+
In TUI and RPC mode, unknown commands and trailing text show a rejection with the command guide.
|
|
116
|
+
Compatibility aliases are `screen` for `display`, `system` for `sleep`, `off` for `stop`, and `config` or `settings` for `mode`.
|
|
117
|
+
|
|
118
|
+
## ⚙️ Settings
|
|
119
|
+
|
|
120
|
+
### Persisted settings
|
|
121
|
+
|
|
122
|
+
`/caffeinate sleep` and `/caffeinate display` save the selected mode to:
|
|
123
|
+
|
|
124
|
+
```text
|
|
125
|
+
${PI_CODING_AGENT_DIR:-~/.pi/agent}/pi-caffeinate.json
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Example:
|
|
129
|
+
|
|
130
|
+
```json
|
|
131
|
+
{
|
|
132
|
+
"mode": "display",
|
|
133
|
+
"quiet": true,
|
|
134
|
+
"updatedAt": 1791763200000
|
|
135
|
+
}
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Set `"quiet": true` to hide routine start and release notifications and clear the `caffeinate` status item while active or unavailable.
|
|
139
|
+
Quiet mode does not hide warnings or explicit command feedback.
|
|
140
|
+
It defaults to `false` when omitted.
|
|
141
|
+
The file is read at startup and on `/reload`.
|
|
142
|
+
After editing it in a running session, run `/reload` before using mode commands.
|
|
143
|
+
|
|
144
|
+
Missing, invalid, or deleted settings use `display` mode with quiet mode off.
|
|
145
|
+
A missing file stays absent until the first successful mode change.
|
|
146
|
+
Within one Pi process, mode saves run in invocation order, reread the latest valid document, and preserve unknown fields.
|
|
147
|
+
Malformed JSON or an invalid recognized field blocks saves until repaired.
|
|
148
|
+
A failed save keeps the previous runtime mode.
|
|
149
|
+
If applying a published mode fails while an inhibitor is active, the extension restores the previous saved mode and inhibitor or reports a rollback failure.
|
|
150
|
+
|
|
151
|
+
Older versions used `pi-caffeinate-settings.json`.
|
|
152
|
+
A legacy-only file remains readable with a warning and is not modified automatically; rename it to `pi-caffeinate.json`.
|
|
153
|
+
The next settings save writes the canonical file.
|
|
154
|
+
If both files exist, `pi-caffeinate.json` takes precedence.
|
|
155
|
+
The legacy filename is deprecated and will be removed in a future major release.
|
|
156
|
+
|
|
157
|
+
### Environment variables
|
|
158
|
+
|
|
159
|
+
Disable the extension:
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
PI_CAFFEINATE_DISABLED=1 pi
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
Use a custom inhibitor command:
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
PI_CAFFEINATE_COMMAND='systemd-inhibit --what=idle:sleep --why="pi running" --mode=block sleep infinity' pi
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
The custom command uses shell-like argument parsing but runs directly without a shell.
|
|
172
|
+
`PI_CAFFEINATE_COMMAND` overrides the saved mode, and `/caffeinate status` reports the override.
|
|
173
|
+
|
|
174
|
+
Deprecated: `PI_CAFFEINATE_ICON` still works for now.
|
|
175
|
+
If you use `@narumitw/pi-statusline`, move the icon to `${PI_CODING_AGENT_DIR:-~/.pi/agent}/pi-statusline.json`:
|
|
176
|
+
|
|
177
|
+
```json
|
|
178
|
+
{
|
|
179
|
+
"extensionStatusIcons": {
|
|
180
|
+
"caffeinate": "☕️"
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
Without `@narumitw/pi-statusline`, keep using `PI_CAFFEINATE_ICON` during the compatibility window.
|
|
186
|
+
In `pi-statusline.json`, use an empty string to show caffeinate status without an icon.
|
|
187
|
+
|
|
188
|
+
Status output calls `display` mode `display-awake` and `sleep` mode `system-awake`.
|
|
189
|
+
|
|
190
|
+
## 📦 Dependencies
|
|
191
|
+
|
|
192
|
+
On Linux, `display` mode uses the pure-JavaScript `dbus-native` package to call `org.freedesktop.ScreenSaver` on the session bus.
|
|
193
|
+
|
|
194
|
+
## 🗂️ Package layout
|
|
195
|
+
|
|
196
|
+
```txt
|
|
197
|
+
packages/pi-caffeinate/
|
|
198
|
+
├── src/
|
|
199
|
+
│ ├── index.ts # Pi package entrypoint
|
|
200
|
+
│ ├── caffeinate.ts # Extension registration and lifecycle orchestration
|
|
201
|
+
│ └── *.ts # Package-local inhibitor and settings modules
|
|
202
|
+
├── dist/ # Generated source-mapped Jiti runtime
|
|
203
|
+
├── scripts/
|
|
204
|
+
│ └── build-runtime.mjs
|
|
205
|
+
├── test/
|
|
206
|
+
│ ├── build-runtime.test.ts
|
|
207
|
+
│ └── caffeinate.test.ts
|
|
208
|
+
├── README.md
|
|
209
|
+
├── LICENSE
|
|
210
|
+
├── tsconfig.json
|
|
211
|
+
└── package.json
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
`src/index.ts` remains the thin authoritative forwarder, while Pi loads the generated `dist/index.ts` runtime.
|
|
215
|
+
The other source modules are internal.
|
|
216
|
+
|
|
217
|
+
## 🔎 Keywords
|
|
218
|
+
|
|
219
|
+
Pi extension, Pi coding agent, caffeinate, prevent sleep, keep awake, sleep inhibitor, AI agent automation, long-running coding task, TypeScript Pi package.
|
|
220
|
+
|
|
221
|
+
## 📄 License
|
|
222
|
+
|
|
223
|
+
MIT.
|
|
224
|
+
See [`LICENSE`](./LICENSE).
|