@herbertgao/pi-extensions 2026.8.14 ā 2026.8.15
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 +16 -13
- package/THIRD_PARTY_NOTICES.md +0 -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/@juicesharp/rpiv-ask-user-question/package.json +2 -2
- package/node_modules/@narumitw/pi-btw/README.md +125 -88
- package/node_modules/@narumitw/pi-btw/dist/index.ts +140 -45
- package/node_modules/@narumitw/pi-btw/dist/index.ts.map +2 -2
- 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 +106 -17
- 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/@tifan/pi-handoff/README.md +36 -13
- package/node_modules/@tifan/pi-handoff/package.json +2 -2
- package/node_modules/@tifan/pi-handoff/src/index.ts +160 -4
- 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 +15 -0
- package/node_modules/pi-mcp-adapter/README.md +2 -2
- package/node_modules/pi-mcp-adapter/commands.ts +1 -1
- package/node_modules/pi-mcp-adapter/dist/types.d.ts +1 -1
- package/node_modules/pi-mcp-adapter/mcp-auth-flow.ts +105 -32
- package/node_modules/pi-mcp-adapter/package.json +1 -1
- package/node_modules/pi-mcp-adapter/proxy-modes.ts +22 -12
- package/node_modules/pi-mcp-adapter/server-manager.ts +6 -0
- package/node_modules/pi-mcp-adapter/types.ts +1 -1
- 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 +16 -16
- 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
package/README.md
CHANGED
|
@@ -8,33 +8,36 @@ Aggregate installer for HerbertGao-maintained Pi extensions and pinned upstream
|
|
|
8
8
|
pi install npm:@herbertgao/pi-extensions
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
Requires Node.js 24 or newer.
|
|
11
|
+
Requires Node.js 24 or newer and Pi 0.84.4 or newer.
|
|
12
12
|
|
|
13
|
-
The package bundles
|
|
13
|
+
The package bundles 4 active `@herbertgao/*` child packagesā`pi-bark`, `pi-cc-extensions`, `resume-from`, and `pi-subagents`āplus the following upstream packages under their original names:
|
|
14
14
|
|
|
15
15
|
- `@dietrichgebert/ponytail@4.9.0`
|
|
16
|
-
- `@juicesharp/rpiv-ask-user-question@2.
|
|
16
|
+
- `@juicesharp/rpiv-ask-user-question@2.8.0`
|
|
17
17
|
- `@luxusai/pi-hindsight@0.12.0`
|
|
18
|
-
- `@narumitw/pi-btw@0.
|
|
18
|
+
- `@narumitw/pi-btw@0.56.0`
|
|
19
19
|
- `@pi-plugins/fast-mode@0.1.10`
|
|
20
20
|
- `@tifan/pi-copy-response@0.2.6`
|
|
21
|
-
- `@tifan/pi-handoff@2.0
|
|
21
|
+
- `@tifan/pi-handoff@2.2.0`
|
|
22
22
|
- `@tifan/pi-inline-skills@1.0.5`
|
|
23
23
|
- `@tifan/pi-mermaid-open@0.2.0`
|
|
24
24
|
- `@tifan/pi-preferred-thinking@1.0.1`
|
|
25
|
-
- `@tifan/pi-recap@0.4.
|
|
26
|
-
- `@tifan/pi-rename@0.
|
|
27
|
-
-
|
|
28
|
-
- `pi-mcp-adapter@2.30.0`
|
|
25
|
+
- `@tifan/pi-recap@0.4.6`
|
|
26
|
+
- `@tifan/pi-rename@0.6.0`
|
|
27
|
+
- `pi-mcp-adapter@2.31.0`
|
|
29
28
|
- `pi-footer@0.5.1`
|
|
30
|
-
- `pi-lens@4.1.
|
|
31
|
-
- `pi-web-access@0.
|
|
29
|
+
- `pi-lens@4.1.3`
|
|
30
|
+
- `pi-web-access@0.27.0`
|
|
32
31
|
- `remote-pi@0.7.0`
|
|
33
|
-
- `@czottmann/pi-automode@1.
|
|
32
|
+
- `@czottmann/pi-automode@1.15.0`
|
|
34
33
|
|
|
35
34
|
Pi loads their extensions and skills through `node_modules/` paths inside one package root. The upstream companions are pinned and bundled, not forked or renamed.
|
|
36
35
|
|
|
37
|
-
|
|
36
|
+
### Bark notifications
|
|
37
|
+
|
|
38
|
+
`@herbertgao/pi-bark` sends localized Bark pushes when a user-facing Pi run fully settles or `@juicesharp/rpiv-ask-user-question` needs an answer. Notifications include emoji-labeled machine/path metadata and support the bundled official Pi badge through Bark's `icon` parameter. Configure it in `$PI_CODING_AGENT_DIR/bark.json` (normally `~/.pi/agent/bark.json`); see the [package README](../pi-bark/README.md). Without a valid endpoint it stays inactive.
|
|
39
|
+
|
|
40
|
+
`@herbertgao/resume-from@0.2.0` keeps Claude Code sessions associated with their original repository when the active transcript later moves into a nested cwd. `pi-lens@4.1.3` expands language routing and bounds retained diagnostic facts across multi-root sessions. `pi-automode@1.15.0` preserves dynamic providers on legacy registries. `pi-web-access@0.27.0` adds configurable fetch deadlines and answer models plus isolated GitHub clone runtimes. Preferred Thinking 1.0.1 preserves an explicit subagent `--thinking` choice. Deprecated `@tifan/pi-titlebar-spinner` is no longer bundled; Rename remains the single owner of Herdr tab naming.
|
|
38
41
|
|
|
39
42
|
`pi-stash` is no longer bundled: `/btw` already preserves the main editor draft while handling side questions outside the main conversation. Prior `@herbertgao/pi-stash` releases remain available but are no longer maintained here.
|
|
40
43
|
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -4,6 +4,12 @@ All notable changes to this project are documented in this file.
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [1.15.0] - 2026-08-28
|
|
8
|
+
|
|
9
|
+
## Bug fixes
|
|
10
|
+
|
|
11
|
+
- **OMP 18 classifier compatibility** ā Support OMP 18 model registries that lack `complete()` and `getProvider()`. Load the legacy completion API only for these registries. Keep current Pi on its runtime registry path so extension-registered providers remain available. Thanks, @NarryG! (#29)
|
|
12
|
+
|
|
7
13
|
## [1.14.0] - 2026-08-27
|
|
8
14
|
|
|
9
15
|
## Bug fixes
|
|
@@ -45,7 +51,8 @@ All notable changes to this project are documented in this file.
|
|
|
45
51
|
- **Project config trust gate** ā Ignore `.pi/automode.local.json` and `.pi/automode.json` until Pi trusts the project. Apply the trust gate during startup and config reloads. (#16)
|
|
46
52
|
- **In-memory observability logs** ā Write logs to an extension-owned directory (`~/.pi/agent/extensions/pi-automode/logs/`) instead of the launching project directory. Thanks, @HerbertGao! (#13)
|
|
47
53
|
|
|
48
|
-
[Unreleased]: https://github.com/czottmann/pi-automode/compare/v1.
|
|
54
|
+
[Unreleased]: https://github.com/czottmann/pi-automode/compare/v1.15.0...HEAD
|
|
55
|
+
[1.15.0]: https://github.com/czottmann/pi-automode/compare/v1.14.0...v1.15.0
|
|
49
56
|
[1.14.0]: https://github.com/czottmann/pi-automode/compare/v1.13.0...v1.14.0
|
|
50
57
|
[1.13.0]: https://github.com/czottmann/pi-automode/compare/v1.12.0...v1.13.0
|
|
51
58
|
[1.12.0]: https://github.com/czottmann/pi-automode/compare/v1.11.0...v1.12.0
|
|
@@ -8,6 +8,10 @@ It is not a sandbox. Extensions run in the Pi process. A malicious extension can
|
|
|
8
8
|
|
|
9
9
|
Pi-automode does not guard user `!` or `!!` shell commands. It guards only agent tool calls. Use it to reduce unsafe autonomous tool use. Do not use it as an OS security boundary.
|
|
10
10
|
|
|
11
|
+
## Compatibility
|
|
12
|
+
|
|
13
|
+
Pi-automode supports Pi and Oh My Pi (OMP) 18. It automatically uses OMP's legacy completion API. The integration needs no OMP-specific configuration.
|
|
14
|
+
|
|
11
15
|
## Install
|
|
12
16
|
|
|
13
17
|
From npm:
|
|
@@ -84,10 +84,9 @@ async function resolveClassifier(
|
|
|
84
84
|
};
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
const rawComplete
|
|
88
|
-
ctx.modelRegistry
|
|
89
|
-
|
|
90
|
-
completeSimpleWithRegistry(ctx, callModel, context, options);
|
|
87
|
+
const { rawComplete, simpleComplete } = createRegistryCompletionFns(
|
|
88
|
+
ctx.modelRegistry,
|
|
89
|
+
);
|
|
91
90
|
const completionPlan = createClassifierCompletionPlan(
|
|
92
91
|
model,
|
|
93
92
|
config.classifierReasoningLevel,
|
|
@@ -125,6 +124,70 @@ export type ClassifierCompletionFn = (
|
|
|
125
124
|
},
|
|
126
125
|
) => Promise<AssistantMessage>;
|
|
127
126
|
|
|
127
|
+
type RegistryCompletionApi = {
|
|
128
|
+
complete?: ClassifierCompletionFn;
|
|
129
|
+
getProvider?: (provider: string) => {
|
|
130
|
+
streamSimple: (
|
|
131
|
+
model: Model<any>,
|
|
132
|
+
context: { systemPrompt: string; messages: UserMessage[] },
|
|
133
|
+
options: Parameters<ClassifierCompletionFn>[2],
|
|
134
|
+
) => { result: () => Promise<AssistantMessage> };
|
|
135
|
+
} | undefined;
|
|
136
|
+
};
|
|
137
|
+
type ClassifierCompletionFallbacks = {
|
|
138
|
+
rawComplete: ClassifierCompletionFn;
|
|
139
|
+
simpleComplete: ClassifierCompletionFn;
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
type ClassifierCompletionFallbackLoader =
|
|
143
|
+
() => Promise<ClassifierCompletionFallbacks>;
|
|
144
|
+
|
|
145
|
+
// Static import would initialize deprecated compat registries on current Pi;
|
|
146
|
+
// OMP rewrites this literal dynamic import to its native pi-ai module.
|
|
147
|
+
async function loadCompatCompletionFns(): Promise<ClassifierCompletionFallbacks> {
|
|
148
|
+
const { complete, completeSimple } = await import(
|
|
149
|
+
"@earendil-works/pi-ai/compat"
|
|
150
|
+
);
|
|
151
|
+
return {
|
|
152
|
+
rawComplete: complete as ClassifierCompletionFn,
|
|
153
|
+
simpleComplete: completeSimple as ClassifierCompletionFn,
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Prefer the current runtime registry so extension-registered providers remain
|
|
159
|
+
* visible. Older Pi-family runtimes (including OMP 18) expose neither
|
|
160
|
+
* `complete` nor `getProvider`; lazily load the compat API they already use.
|
|
161
|
+
*/
|
|
162
|
+
export function createRegistryCompletionFns(
|
|
163
|
+
registry: RegistryCompletionApi,
|
|
164
|
+
fallbackLoader: ClassifierCompletionFallbackLoader =
|
|
165
|
+
loadCompatCompletionFns,
|
|
166
|
+
): ClassifierCompletionFallbacks {
|
|
167
|
+
let fallbackPromise: Promise<ClassifierCompletionFallbacks> | undefined;
|
|
168
|
+
const rawComplete: ClassifierCompletionFn =
|
|
169
|
+
typeof registry.complete === "function"
|
|
170
|
+
? (model, context, options) =>
|
|
171
|
+
registry.complete!.call(registry, model, context, options)
|
|
172
|
+
: async (model, context, options) =>
|
|
173
|
+
(await (fallbackPromise ??= fallbackLoader())).rawComplete(
|
|
174
|
+
model,
|
|
175
|
+
context,
|
|
176
|
+
options,
|
|
177
|
+
);
|
|
178
|
+
const simpleComplete: ClassifierCompletionFn =
|
|
179
|
+
typeof registry.getProvider === "function"
|
|
180
|
+
? (model, context, options) =>
|
|
181
|
+
completeSimpleWithRegistry(registry, model, context, options)
|
|
182
|
+
: async (model, context, options) =>
|
|
183
|
+
(await (fallbackPromise ??= fallbackLoader())).simpleComplete(
|
|
184
|
+
model,
|
|
185
|
+
context,
|
|
186
|
+
options,
|
|
187
|
+
);
|
|
188
|
+
return { rawComplete, simpleComplete };
|
|
189
|
+
}
|
|
190
|
+
|
|
128
191
|
export type RetryOptions = {
|
|
129
192
|
maxAttempts?: number;
|
|
130
193
|
maxTokens?: number;
|
|
@@ -206,17 +269,16 @@ async function completeClassifierAttempt(
|
|
|
206
269
|
|
|
207
270
|
/**
|
|
208
271
|
* Run normalized Pi AI completion through the provider in Pi's runtime registry.
|
|
209
|
-
*
|
|
210
|
-
*
|
|
211
|
-
* that API when the project's minimum supported Pi version includes it.
|
|
272
|
+
* Callers use this only when the registry exposes `getProvider`; legacy
|
|
273
|
+
* registries take the compat completion path instead.
|
|
212
274
|
*/
|
|
213
275
|
async function completeSimpleWithRegistry(
|
|
214
|
-
|
|
276
|
+
registry: RegistryCompletionApi,
|
|
215
277
|
model: Model<any>,
|
|
216
278
|
context: { systemPrompt: string; messages: UserMessage[] },
|
|
217
279
|
options: Parameters<ClassifierCompletionFn>[2],
|
|
218
280
|
): Promise<AssistantMessage> {
|
|
219
|
-
const provider =
|
|
281
|
+
const provider = registry.getProvider?.(model.provider);
|
|
220
282
|
if (!provider) throw new Error(`Unknown provider: ${model.provider}`);
|
|
221
283
|
return provider.streamSimple(model, context, options).result();
|
|
222
284
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Herbert Gao
|
|
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,44 @@
|
|
|
1
|
+
# @herbertgao/pi-bark
|
|
2
|
+
|
|
3
|
+
Bark notifications for user-facing Pi sessions. It sends a notification when Pi fully settles and when [`@juicesharp/rpiv-ask-user-question`](https://github.com/juicesharp/rpiv-mono) opens a questionnaire. Requests follow Bark's official [POST form API](https://github.com/Finb/Bark/blob/master/docs/en-us/tutorial.md#request-methods).
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pi install npm:@herbertgao/pi-bark
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
The extension is also included in `@herbertgao/pi-extensions`.
|
|
12
|
+
|
|
13
|
+
## Configure
|
|
14
|
+
|
|
15
|
+
Create `$PI_CODING_AGENT_DIR/bark.json` (normally `~/.pi/agent/bark.json`):
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"endpoint": "https://api.day.app/your-device-key",
|
|
20
|
+
"machine": "MacBook Pro M1 Max",
|
|
21
|
+
"locale": "zh-CN",
|
|
22
|
+
"events": {
|
|
23
|
+
"agentSettled": true,
|
|
24
|
+
"askUserQuestion": true
|
|
25
|
+
},
|
|
26
|
+
"params": {
|
|
27
|
+
"group": "pi",
|
|
28
|
+
"icon": "https://raw.githubusercontent.com/HerbertGao/pi-extensions/master/packages/pi-bark/assets/pi-icon.png"
|
|
29
|
+
},
|
|
30
|
+
"timeoutMs": 4000
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
`endpoint` is required. `locale` accepts `auto` (default), `zh-CN`, `zh-TW`, or `en`; unsupported languages fall back to English. `params` accepts additional Bark POST parameters such as `group`, `sound`, `icon`, and `level`; dynamic `title` and `body` values always take precedence. Set `"enabled": false` to disable all notifications without removing the package.
|
|
35
|
+
|
|
36
|
+
The notification body uses `š»` for the configured machine name and `š` for Pi's full working directory. Questionnaire text is intentionally not sent because it may contain sensitive context. Only sessions with a user-facing UI notify, so nested `pi-subagents` sessions do not create duplicate pushes.
|
|
37
|
+
|
|
38
|
+
The bundled [`assets/pi-icon.png`](assets/pi-icon.png) is a 512Ć512 rasterization of Pi's official [square badge](https://pi.dev/favicon.svg) from the [Pi Press Kit](https://pi.dev/press-kit), suitable for Bark's iOS 15+ `icon` parameter.
|
|
39
|
+
|
|
40
|
+
Keep `bark.json` private because the endpoint normally contains the Bark device key. Restart Pi or run `/reload` after changing it.
|
|
41
|
+
|
|
42
|
+
## License
|
|
43
|
+
|
|
44
|
+
[MIT](LICENSE)
|
|
Binary file
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@herbertgao/pi-bark",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Send Bark notifications when Pi finishes or needs user input.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"bark",
|
|
7
|
+
"notifications",
|
|
8
|
+
"pi-extension",
|
|
9
|
+
"pi-package"
|
|
10
|
+
],
|
|
11
|
+
"homepage": "https://github.com/HerbertGao/pi-extensions/tree/master/packages/pi-bark#readme",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/HerbertGao/pi-extensions/issues"
|
|
14
|
+
},
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"author": "Herbert Gao",
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://github.com/HerbertGao/pi-extensions.git",
|
|
20
|
+
"directory": "packages/pi-bark"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"assets",
|
|
24
|
+
"src",
|
|
25
|
+
"README.md",
|
|
26
|
+
"LICENSE"
|
|
27
|
+
],
|
|
28
|
+
"type": "module",
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"access": "public",
|
|
31
|
+
"provenance": true
|
|
32
|
+
},
|
|
33
|
+
"scripts": {
|
|
34
|
+
"test": "node --test tests/**/*.test.ts",
|
|
35
|
+
"typecheck": "tsc --noEmit"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@types/node": "^24",
|
|
39
|
+
"typescript": "^5.9.3"
|
|
40
|
+
},
|
|
41
|
+
"peerDependencies": {
|
|
42
|
+
"@earendil-works/pi-coding-agent": "^0.84.0"
|
|
43
|
+
},
|
|
44
|
+
"engines": {
|
|
45
|
+
"node": ">=22.19.0"
|
|
46
|
+
},
|
|
47
|
+
"pi": {
|
|
48
|
+
"extensions": [
|
|
49
|
+
"./src/index.ts"
|
|
50
|
+
]
|
|
51
|
+
},
|
|
52
|
+
"x-origin": "original"
|
|
53
|
+
}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"
|
|
2
|
+
import { readFileSync } from "node:fs"
|
|
3
|
+
import { homedir, hostname } from "node:os"
|
|
4
|
+
import { join } from "node:path"
|
|
5
|
+
|
|
6
|
+
const ASK_USER_PROMPT_EVENT = "rpiv:ask-user:prompt"
|
|
7
|
+
const DEFAULT_TIMEOUT_MS = 4_000
|
|
8
|
+
|
|
9
|
+
export type BarkLocale = "en" | "zh-CN" | "zh-TW"
|
|
10
|
+
type NotificationEvent = "agentSettled" | "askUserQuestion"
|
|
11
|
+
|
|
12
|
+
const COPY: Record<BarkLocale, Record<NotificationEvent, string>> = {
|
|
13
|
+
en: {
|
|
14
|
+
agentSettled: "ā
Pi finished",
|
|
15
|
+
askUserQuestion: "š” Pi needs your input",
|
|
16
|
+
},
|
|
17
|
+
"zh-CN": {
|
|
18
|
+
agentSettled: "ā
Pi č·å®äŗ",
|
|
19
|
+
askUserQuestion: "š” Pi ēä½ åē",
|
|
20
|
+
},
|
|
21
|
+
"zh-TW": {
|
|
22
|
+
agentSettled: "ā
Pi å·²å®ę",
|
|
23
|
+
askUserQuestion: "š” Pi ēä½ åč¦",
|
|
24
|
+
},
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface BarkConfig {
|
|
28
|
+
endpoint: string
|
|
29
|
+
machine: string
|
|
30
|
+
locale: BarkLocale
|
|
31
|
+
events: {
|
|
32
|
+
agentSettled: boolean
|
|
33
|
+
askUserQuestion: boolean
|
|
34
|
+
}
|
|
35
|
+
params: Record<string, string | number | boolean>
|
|
36
|
+
timeoutMs: number
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function getConfigPath(): string {
|
|
40
|
+
return join(
|
|
41
|
+
process.env.PI_CODING_AGENT_DIR ?? join(homedir(), ".pi", "agent"),
|
|
42
|
+
"bark.json",
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function resolveLocale(input: unknown): BarkLocale {
|
|
47
|
+
const requested =
|
|
48
|
+
typeof input === "string" && input.toLowerCase() !== "auto"
|
|
49
|
+
? input
|
|
50
|
+
: Intl.DateTimeFormat().resolvedOptions().locale
|
|
51
|
+
const locale = requested.toLowerCase()
|
|
52
|
+
if (locale.includes("hant") || /^zh-(tw|hk|mo)/.test(locale)) return "zh-TW"
|
|
53
|
+
if (locale.startsWith("zh")) return "zh-CN"
|
|
54
|
+
return "en"
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export function notificationTitle(
|
|
58
|
+
locale: BarkLocale,
|
|
59
|
+
event: NotificationEvent,
|
|
60
|
+
): string {
|
|
61
|
+
return COPY[locale][event]
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function normalizeConfig(input: unknown): BarkConfig | undefined {
|
|
65
|
+
if (!input || typeof input !== "object") return undefined
|
|
66
|
+
const source = input as Record<string, unknown>
|
|
67
|
+
if (source.enabled === false || typeof source.endpoint !== "string")
|
|
68
|
+
return undefined
|
|
69
|
+
|
|
70
|
+
try {
|
|
71
|
+
const protocol = new URL(source.endpoint).protocol
|
|
72
|
+
if (protocol !== "http:" && protocol !== "https:") return undefined
|
|
73
|
+
} catch {
|
|
74
|
+
return undefined
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const eventSource =
|
|
78
|
+
source.events && typeof source.events === "object"
|
|
79
|
+
? (source.events as Record<string, unknown>)
|
|
80
|
+
: {}
|
|
81
|
+
const params =
|
|
82
|
+
source.params && typeof source.params === "object"
|
|
83
|
+
? Object.fromEntries(
|
|
84
|
+
Object.entries(source.params).filter((entry) =>
|
|
85
|
+
["string", "number", "boolean"].includes(typeof entry[1]),
|
|
86
|
+
),
|
|
87
|
+
)
|
|
88
|
+
: {}
|
|
89
|
+
const timeoutMs =
|
|
90
|
+
typeof source.timeoutMs === "number" &&
|
|
91
|
+
Number.isFinite(source.timeoutMs) &&
|
|
92
|
+
source.timeoutMs > 0
|
|
93
|
+
? source.timeoutMs
|
|
94
|
+
: DEFAULT_TIMEOUT_MS
|
|
95
|
+
|
|
96
|
+
return {
|
|
97
|
+
endpoint: source.endpoint,
|
|
98
|
+
machine:
|
|
99
|
+
typeof source.machine === "string" && source.machine.trim()
|
|
100
|
+
? source.machine.trim()
|
|
101
|
+
: hostname(),
|
|
102
|
+
locale: resolveLocale(source.locale),
|
|
103
|
+
events: {
|
|
104
|
+
agentSettled: eventSource.agentSettled !== false,
|
|
105
|
+
askUserQuestion: eventSource.askUserQuestion !== false,
|
|
106
|
+
},
|
|
107
|
+
params,
|
|
108
|
+
timeoutMs,
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export function loadConfig(path = getConfigPath()): BarkConfig | undefined {
|
|
113
|
+
try {
|
|
114
|
+
return normalizeConfig(JSON.parse(readFileSync(path, "utf8")))
|
|
115
|
+
} catch {
|
|
116
|
+
return undefined
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export function formatBody(config: BarkConfig, cwd: string): string {
|
|
121
|
+
return `š» ${config.machine}\nš ${cwd}`
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export async function sendBark(
|
|
125
|
+
config: BarkConfig,
|
|
126
|
+
title: string,
|
|
127
|
+
body: string,
|
|
128
|
+
fetcher: typeof fetch = fetch,
|
|
129
|
+
): Promise<void> {
|
|
130
|
+
const form = new URLSearchParams()
|
|
131
|
+
for (const [key, value] of Object.entries(config.params))
|
|
132
|
+
form.set(key, String(value))
|
|
133
|
+
form.set("title", title)
|
|
134
|
+
form.set("body", body)
|
|
135
|
+
|
|
136
|
+
const response = await fetcher(config.endpoint, {
|
|
137
|
+
method: "POST",
|
|
138
|
+
body: form,
|
|
139
|
+
signal: AbortSignal.timeout(config.timeoutMs),
|
|
140
|
+
})
|
|
141
|
+
if (!response.ok) throw new Error(`Bark returned HTTP ${response.status}`)
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export default function piBark(pi: ExtensionAPI): void {
|
|
145
|
+
let config: BarkConfig | undefined
|
|
146
|
+
let cwd = process.cwd()
|
|
147
|
+
let userFacingSession = false
|
|
148
|
+
|
|
149
|
+
const notify = async (title: string): Promise<void> => {
|
|
150
|
+
if (!config || !userFacingSession) return
|
|
151
|
+
try {
|
|
152
|
+
await sendBark(config, title, formatBody(config, cwd))
|
|
153
|
+
} catch {
|
|
154
|
+
// Notifications are best-effort and must never interrupt Pi.
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
const unsubscribeAskUser = pi.events.on(ASK_USER_PROMPT_EVENT, () => {
|
|
159
|
+
if (config?.events.askUserQuestion)
|
|
160
|
+
void notify(notificationTitle(config.locale, "askUserQuestion"))
|
|
161
|
+
})
|
|
162
|
+
|
|
163
|
+
pi.on("session_start", (_event, ctx) => {
|
|
164
|
+
config = loadConfig()
|
|
165
|
+
cwd = ctx.cwd
|
|
166
|
+
userFacingSession = ctx.hasUI
|
|
167
|
+
})
|
|
168
|
+
|
|
169
|
+
pi.on("agent_settled", (_event, ctx) => {
|
|
170
|
+
cwd = ctx.cwd
|
|
171
|
+
if (config?.events.agentSettled)
|
|
172
|
+
void notify(notificationTitle(config.locale, "agentSettled"))
|
|
173
|
+
})
|
|
174
|
+
|
|
175
|
+
pi.on("session_shutdown", () => {
|
|
176
|
+
unsubscribeAskUser()
|
|
177
|
+
})
|
|
178
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juicesharp/rpiv-ask-user-question",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.8.0",
|
|
4
4
|
"description": "Pi extension. A structured questionnaire the model can put to you when it would otherwise guess, with typed options instead of free-form replies.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package",
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
}
|
|
95
95
|
},
|
|
96
96
|
"dependencies": {
|
|
97
|
-
"@juicesharp/rpiv-config": "^2.
|
|
97
|
+
"@juicesharp/rpiv-config": "^2.8.0",
|
|
98
98
|
"typebox": "^1.1.24"
|
|
99
99
|
}
|
|
100
100
|
}
|