70 Commits
Author SHA1 Message Date
Matteo Benedetto a5e1a80301 feat: supporto ai Focus Modes di Perplexity (parametro 'focus')
CI / test (push) Canceled after 0s
- Aggiunto il parametro 'focus' al tool perplexity_search per selezionare la
  fonte di conoscenza (Focus Mode).
- FOCUS_MAP: mappa focus -> search_focus + sources usati dall'endpoint
  perplexity_ask (internet/web, academic/scholar, writing, wolfram, youtube,
  reddit, math, social, finance).
- default: internet (comportamento invariato).
- README aggiornato.
2026-08-11 21:22:56 +02:00
Ivan Pereira 72ce74541f chore(release): 0.4.0 2026-07-16 16:01:38 +01:00
Ivan Pereira f94c08072e feat(models): add GLM-5.2 and harden reported-model fallback
Perplexity's model fields are inconsistent per model: Claude Sonnet 5 reports the real slug in user_selected_model with display_model "turbo", while GLM-5.2 reports the inverse. Pick whichever field is present and not "turbo", and fall back to the requested model when both are missing or "turbo".

Also add glm_5_2 to KNOWN_MODELS.

Refs #7 (follow-up comment)
2026-07-16 15:59:30 +01:00
9f5c87c1c4 feat(models): add Claude Sonnet 5 models and honor user_selected_model (#8)
Perplexity's /rest/models/config now exposes claude50sonnet and
claude50sonnetthinking. Add both to KNOWN_MODELS with the official
labels from the config.

The stream's display_model can report "turbo" even when the requested
model was honored, so prefer user_selected_model when present and not
"turbo" so tool metadata reflects the model actually used.

Closes #7

Co-authored-by: Ivan Pereira <183991+ivanrvpereira@users.noreply.github.com>
2026-07-16 15:40:59 +01:00
97aab3e9b9 refactor(search): always send searches as incognito (#14)
Hardcode is_incognito: true in the Perplexity request and remove the
toggle surface: the incognito tool parameter, PI_PERPLEXITY_INCOGNITO
env var, config file field, /perplexity-config prompt, and TUI status
indicators. Config and resolveDefaultModel are now model-only.

Supersedes the incognito portion of PR #4.

Co-authored-by: Ivan Pereira <183991+ivanrvpereira@users.noreply.github.com>
2026-07-16 15:28:02 +01:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
a9f252715e chore(deps): bump actions/setup-node from 4.4.0 to 7.0.0 (#13)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 4.4.0 to 7.0.0.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/49933ea5288caeca8642d1e84afbd3f7d6820020...820762786026740c76f36085b0efc47a31fe5020)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-14 13:11:08 +01:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
7977720146 chore(deps): bump actions/checkout from 4.3.1 to 7.0.0 (#12)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.3.1 to 7.0.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/34e114876b0b11c390a56381ad16ebd13914f8d5...9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-14 13:11:05 +01:00
Ivan Pereira 11a238a2cb chore(release): 0.3.0 2026-07-14 12:56:19 +01:00
Ivan PereiraandGitHub a2c31ef118 Merge pull request #6 from ivanrvpereira/review/overengineering-audit
refactor(auth): separate browser credential parsing
2026-07-14 12:55:24 +01:00
Ivan Pereira 4d9ac2b5dd fix(auth): accept bare session tokens from cookie env vars
parseBrowserAuthInput returns an access-only credential for a bare
__Secure-next-auth.session-token value, which /perplexity-login
--browser accepts but credentialsFromEnvironment rejected because it
required .cookies. Only reject when parsing fails entirely.
2026-07-14 12:54:10 +01:00
Ivan Pereira 17e4267e7f chore: migrate to @earendil-works pi packages
@mariozechner/pi-coding-agent is deprecated in favor of
@earendil-works/pi-coding-agent (github.com/earendil-works/pi).
Import Type from @earendil-works/pi-ai instead of @sinclair/typebox,
which the new ecosystem replaces with plain typebox. Upgrading to
0.80.6 also resolves all 31 open Dependabot alerts from the old
package's transitive dev dependencies.
2026-07-14 12:49:49 +01:00
Ivan Pereira 6158714acf docs: add security policy 2026-07-14 12:42:56 +01:00
Ivan Pereira 3cfe36db0b chore: add dependabot config for npm and github-actions 2026-07-14 12:42:56 +01:00
Ivan Pereira a24b4e5b05 ci: harden workflows against token exfiltration
Disable checkout credential persistence so repository-controlled code
run by npm ci/test cannot read GITHUB_TOKEN from .git/config, and pin
actions to full commit SHAs to guard against mutable-tag supply-chain
attacks.
2026-07-14 12:42:55 +01:00
Ivan Pereira e5f054272d ci: restrict npm publish tags to main 2026-07-14 12:19:06 +01:00
Ivan Pereira 16df0a56c6 test(auth): exercise desktop token extraction on CI 2026-07-14 12:09:24 +01:00
Ivan Pereira 6a8cf7139f chore(release): 0.2.5 2026-07-14 12:07:11 +01:00
Ivan Pereira 5a3a1e82bf docs: backfill changelog and add release verification 2026-07-14 12:06:42 +01:00
Ivan Pereira 838644734f fix: address auth and source handling review findings 2026-07-14 12:06:33 +01:00
Ivan Pereira e6a194bd85 ci: run typecheck and tests before npm publish 2026-07-14 03:26:33 +01:00
Ivan Pereira 5b6bb41c3f refactor: drop dead model/limit plumbing and unused render helper
resolveSearchDefaults no longer accepts a per-call model override and
SearchParams no longer carries limit; neither was reachable from the
tool schema (limit is applied client-side in formatForLLM). Also fold
asPositiveNumber into asPositiveInteger and simplify recency matching.
2026-07-14 03:26:27 +01:00
Ivan Pereira 39d977c403 refactor(auth): route browser paste login through /perplexity-login
The perplexity_search tool no longer prompts for pasted browser
credentials mid-search; /perplexity-login --browser is the single
entry point for that flow. Drop the now-unused promptForBrowserAuth
option and its Cloudflare-challenge fallback from authenticate().
2026-07-14 03:26:00 +01:00
Ivan Pereira f8919e254c refactor(auth): separate browser credential parsing 2026-06-24 17:51:37 +01:00
Ivan Pereira 2b107f13d1 chore(release): 0.2.4 2026-06-24 17:34:14 +01:00
Ivan PereiraandGitHub 3e3a110252 Merge pull request #5 from ivanrvpereira/feat/browser-cookie-auth
feat(auth): add browser cookie login fallback
2026-06-24 17:33:04 +01:00
Ivan Pereira 8d889add43 fix(auth): address browser cookie review comments 2026-06-24 17:31:53 +01:00
Ivan Pereira d01cfc86bc feat(auth): add browser cookie login fallback 2026-06-24 17:19:38 +01:00
Ivan Pereira 388235c602 docs(agents): clean project instructions 2026-06-24 16:09:19 +01:00
Ivan Pereira 4a7cf66c42 chore(release): 0.2.3 2026-06-24 15:38:44 +01:00
Ivan Pereira bbb5623f25 refactor(runtime): replace Bun dependency with Node fetch
Run Perplexity search and auth requests through pi's Node runtime instead of
shelling out to Bun. Move development and CI commands to npm, add a Node test
build path, and keep OTP auth fail-fast when Set-Cookie headers are not
available.
2026-06-23 15:51:16 +01:00
Ivan Pereira 142640d96c fix(auth): avoid CSRF challenges during OTP login 2026-06-22 11:33:40 +01:00
Ivan Pereira 4e77f38d5d fix(config): respect configured model 2026-05-11 15:16:42 +01:00
Ivan Pereira 18e38ac89a 0.2.0 2026-03-21 22:26:28 +00:00
Ivan PereiraandGitHub 692d39e618 Merge pull request #3 from ivanrvpereira/issue-2-expose-model-preference
feat: expose model preference and incognito as configurable parameters
2026-03-22 00:25:55 +02:00
Ivan Pereira e1a0a17f04 docs: add CHANGELOG.md 2026-03-21 21:34:17 +00:00
Ivan Pereira 0f301e7f47 fix(test): isolate tests from mock.module cache pollution
mock.module() in index-execute.test.ts permanently poisons Bun's
module cache — mock.restore() does not undo it in Bun 1.3.11.

Use cache-busted dynamic imports (../src/mod.ts?t=${Date.now()}) in
beforeEach for the three affected test files so each test gets a
fresh, unpoisoned module instance.
2026-03-21 21:29:00 +00:00
Ivan Pereira 96a3246d1e fix(search): restore error rendering and safe error handling
- Re-add isError flag to error details so renderPerplexityResult
  shows error styling instead of green success rows
- Use errorMessage() for unknown errors instead of unsafe cast
- Trim whitespace-only PI_PERPLEXITY_MODEL env var values
- Add comment explaining clearToken() on AUTH rejection
2026-03-21 21:28:51 +00:00
Ivan Pereira fcc7613edc fix(config): simplify current model label 2026-03-21 21:02:44 +00:00
Ivan Pereira 041d30651a fix(config): apply defaults to perplexity UI 2026-03-21 20:54:41 +00:00
Ivan Pereira 11c543c0de 0.1.3 2026-02-23 18:07:48 +00:00
Ivan Pereira 89b4ea50d0 Add pi-extension keyword 2026-02-23 18:07:36 +00:00
Ivan Pereira a9007cd69a 0.1.2 2026-02-23 12:58:02 +00:00
Ivan PereiraandGitHub 2d5bf1ef75 Simplify README description for pi extension 2026-02-23 12:49:07 +00:00
Ivan Pereira 6ef681adb1 Fix install commands in README 2026-02-23 12:43:58 +00:00
Ivan Pereira 048ec32a3c Strip v prefix in version check 2026-02-23 12:40:55 +00:00
Ivan Pereira 12dcd11384 Fix tag pattern to match v-prefixed tags 2026-02-23 12:40:43 +00:00
Ivan Pereira ef81cdee18 0.1.1 2026-02-23 12:40:25 +00:00
Ivan Pereira 29723c50e3 Upgrade npm to latest before publish for OIDC support 2026-02-23 12:36:34 +00:00
Ivan Pereira 6737807356 Switch to OIDC trusted publishing, drop NPM_TOKEN 2026-02-23 12:35:44 +00:00
Ivan Pereira 10c2b1cf6b Add npm publish GitHub Actions workflow 2026-02-23 12:32:53 +00:00