mirror of
https://github.com/lossless-group/perplexed-plugin.git
synced 2026-07-22 06:49:50 +00:00
Directory-template runs with sonar-deep-research were silently discarding
~99% of every response. Perplexity's deep-research model delivers its whole
finished document in the first SSE event's message.content; the streaming
reader took delta.content (correct for the token-streaming sonar models) and
captured only a ~75-character tail fragment of a ~10,000-character report.
toolkit-profile shipped with sonar-deep-research as its default model, so
the default was the broken one. This release fixes the streaming, hardens it
against mid-stream disconnects, and adds the tooling the directory-template
research workflow was missing.
Both streaming paths now read Perplexity's cumulative message.content
snapshot and append only the new tail — correct for token-streaming sonar
models and for deep research's first-event document dump alike. A timed-out
or dropped stream now keeps the partial content and the citations it already
received instead of discarding the whole run. "Apply directory template"
gained a run dialog with a per-run model selector, so the model is no longer
locked to the template file, and the loading notice names the model that is
actually running instead of a hardcoded "deep research" string.
Streaming (perplexityService.ts, directoryTemplateService.ts):
- Read message.content (cumulative snapshot), diff against written text,
append the tail; a startsWith guard skips a changed prefix rather than
corrupting the note.
- streamPerplexityToFile returns a partial result with a `truncated` flag on
a read error instead of throwing; applyTemplate writes the partial with
its sources footer and a truncation notice. The modal catch block salvages
its citation metadata the same way.
- Deep-research idle timeout 90s -> 270s; request-timeout default 5 -> 10 min.
Model selection (DirectoryTemplateRunModal.ts, main.ts):
- New run dialog: a template dropdown plus a Perplexity model dropdown that
defaults to the template's cft model and overrides it for that run only.
- cf_last_run_model now stamps the model that actually ran.
Search scoping (directoryTemplateService.ts):
- search_domain_filter support via cf_search_domains (target frontmatter)
and search-domains (cft block); allow/deny entries, capped at 10; job
boards are denied automatically.
Template (src/docs/templates/toolkit-profile.md):
- System prompt rebuilt: anchors the entity on its real name rather than the
scraped marketing tagline, makes source quality a triage task instead of
an allow/deny list, adds a search-don't-recall rule and per-section length
ceilings. Default model -> sonar-pro.
Files changed:
- src/services/perplexityService.ts
- src/services/directoryTemplateService.ts
- src/modals/DirectoryTemplateRunModal.ts
- main.ts
- src/docs/templates/toolkit-profile.md
- manifest.json
- package.json
- versions.json
- changelog/releases/0.2.1.md
- release-notes/0.2.1.md
Also included:
- manifest.json description aligned with package.json ("Perplexica (now Vane)").
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
42 lines
1.2 KiB
JSON
42 lines
1.2 KiB
JSON
{
|
|
"name": "perplexed",
|
|
"version": "0.2.1",
|
|
"description": "Generate source-cited research content through prompts and templates. From Perplexity, Anthropic Claude, Google Gemini, Perplexica (now Vane), or local LM Studio — directly into your notes.",
|
|
"main": "main.js",
|
|
"scripts": {
|
|
"dev": "node esbuild.config.mjs",
|
|
"build": "eslint . --report-unused-disable-directives && tsc -noEmit -skipLibCheck && node esbuild.config.mjs production",
|
|
"lint": "eslint . --report-unused-disable-directives",
|
|
"version": "node version-bump.mjs && git add manifest.json versions.json"
|
|
},
|
|
"keywords": [
|
|
"Obsidian",
|
|
"Plugin",
|
|
"LLM Research",
|
|
"AI-Powered Content Generation",
|
|
"Content Generation",
|
|
"Perplexity",
|
|
"Perplexica",
|
|
"Footnotes",
|
|
"Citations"
|
|
],
|
|
"author": "The Lossless Group",
|
|
"license": "MIT",
|
|
"devDependencies": {
|
|
"@eslint/js": "^10.0.1",
|
|
"@types/node": "^25.6.0",
|
|
"@typescript-eslint/eslint-plugin": "8.59.1",
|
|
"@typescript-eslint/parser": "8.59.1",
|
|
"esbuild": "0.28.0",
|
|
"eslint": "^10.3.0",
|
|
"eslint-plugin-obsidianmd": "^0.2.9",
|
|
"globals": "^17.6.0",
|
|
"obsidian": "latest",
|
|
"tslib": "2.8.1",
|
|
"typescript": "6.0.3",
|
|
"typescript-eslint": "^8.59.1"
|
|
},
|
|
"dependencies": {
|
|
"@anthropic-ai/sdk": "^0.92.0"
|
|
}
|
|
}
|