lossless-group_perplexed-pl.../package.json

43 lines
1.2 KiB
JSON
Raw Permalink Normal View History

{
"name": "perplexed",
fix(perplexityService, directoryTemplateService): CORS bypass — Node.js https replaces activeWindow.fetch for all Perplexity streaming paths Perplexity's API stopped including Access-Control-Allow-Origin headers for app://obsidian.md, so Electron's Chromium renderer began blocking every streaming response body — even on successful 200 OK requests. Every Perplexity query that used streaming was silently producing nothing. Both streaming call sites now use https.request from node:https instead of activeWindow.fetch. Node.js routes through the OS network stack and has no CORS constraint at all. The resulting IncomingMessage stream is wrapped in a Web ReadableStream<Uint8Array> and passed to the existing SSE parsing machinery unchanged — idle-timeout, chunk accumulation, citations, images, and AbortController signal handling all preserved. Non-streaming requests (Obsidian's request() function) were never affected and are untouched. perplexityService.ts: - Added import * as https from 'node:https' + import type { IncomingMessage } - Replaced activeWindow.fetch in queryPerplexity streaming branch with https.request → IncomingMessage → ReadableStream<Uint8Array> bridge directoryTemplateService.ts: - Same imports - Replaced activeWindow.fetch in streamPerplexityToFile with same bridge - AbortController.signal threaded into https.request signal option so ceiling-timer and user-cancel abort behavior is fully preserved Bumps to 0.3.1 — manifest.json, package.json, versions.json updated. Files changed: - src/services/perplexityService.ts - src/services/directoryTemplateService.ts - manifest.json - package.json - versions.json - changelog/2026-07-06_01.md - changelog/releases/0.3.1.md Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-06 19:41:12 +00:00
"version": "0.3.1",
feat(release): 0.2.1 — deep research that actually keeps the research 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>
2026-05-22 20:28:53 +00:00
"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",
chore(marketplace): pass ObsidianReviewBot lint cleanly Applies all required fixes from the bot's review of PR #12513 (obsidianmd/obsidian-releases). ESLint now passes 0 errors with the Obsidian community ruleset; tsc passes; production build is clean. Lint setup: - Adopted eslint-plugin-obsidianmd@^0.2.9 in eslint.config.mjs - Mirrored the bot's rule surface locally so violations surface in `pnpm lint` instead of the marketplace PR thread - Configured the ui/sentence-case rule with a brand allowlist (Perplexity, Perplexica, Vane, Claude, Anthropic, LM Studio, Imgur, ImageKit, OpenAI, Ollama, Sonar, Llama, GPT, YAML, JSON, URL, API) so legitimate proper nouns aren't lowercased Code fixes (487 → 0): - console.log/info → console.debug across all sources (~130 sites) - UI strings normalized to sentence case (~150 sites) - Command IDs and names cleaned up: dropped "command" suffix, dropped "perplexed" plugin-name prefix - Settings tab section headers switched from createEl('h2') to new Setting().setHeading() (5 sites) - Inline element.style.color/width/minHeight/fontFamily migrated to a new CSS class (.perplexed-json-textarea + .is-tall / .is-extra-tall) in src/styles/settings-tab.css (8 textarea sites, 32 style assignments) - Async input handlers wrapped: addEventListener('input', () => void (async () => { ... })()) so the listener type matches (8 sites) - forEach((opt) => dd.addOption(...)) blocks made void-returning to satisfy no-misused-promises (9 modal sites) - JSON.parse results typed as unknown then narrowed - throw <string> → throw new Error(<string>) - ${unknown} interpolations narrowed via instanceof Error - Removed dotenv runtime dependency: published plugins shouldn't read .env at runtime; user enters API keys via the settings tab - Replaced builtin-modules dev-dependency with node:module's builtinModules — same data, no extra package - Logger console-method dispatch rewritten as a switch instead of dynamic console[level] indexing (which the bot rejects) Streaming exceptions: - src/services/{perplexityService,lmStudioService,perplexicaService}.ts retain `fetch()` for SSE / chunked streaming because Obsidian's `requestUrl` buffers the whole body. Each site has an `eslint-disable-next-line no-restricted-globals` with the marketplace `/skip` justification inline. Plan to surface these on the PR with a `/skip` reply. Reference docs: - context-v/issues/Obsidian-Review-Bot-Feedback-on-Perplexed-Submission.md (issue log distilled into…) - context-v/reminders/Obsidian-Marketplace-Compliance.md (the rules themselves, reusable for image-gin and cite-wide submissions) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-09 07:39:06 +00:00
"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": {
chore(marketplace): pass ObsidianReviewBot lint cleanly Applies all required fixes from the bot's review of PR #12513 (obsidianmd/obsidian-releases). ESLint now passes 0 errors with the Obsidian community ruleset; tsc passes; production build is clean. Lint setup: - Adopted eslint-plugin-obsidianmd@^0.2.9 in eslint.config.mjs - Mirrored the bot's rule surface locally so violations surface in `pnpm lint` instead of the marketplace PR thread - Configured the ui/sentence-case rule with a brand allowlist (Perplexity, Perplexica, Vane, Claude, Anthropic, LM Studio, Imgur, ImageKit, OpenAI, Ollama, Sonar, Llama, GPT, YAML, JSON, URL, API) so legitimate proper nouns aren't lowercased Code fixes (487 → 0): - console.log/info → console.debug across all sources (~130 sites) - UI strings normalized to sentence case (~150 sites) - Command IDs and names cleaned up: dropped "command" suffix, dropped "perplexed" plugin-name prefix - Settings tab section headers switched from createEl('h2') to new Setting().setHeading() (5 sites) - Inline element.style.color/width/minHeight/fontFamily migrated to a new CSS class (.perplexed-json-textarea + .is-tall / .is-extra-tall) in src/styles/settings-tab.css (8 textarea sites, 32 style assignments) - Async input handlers wrapped: addEventListener('input', () => void (async () => { ... })()) so the listener type matches (8 sites) - forEach((opt) => dd.addOption(...)) blocks made void-returning to satisfy no-misused-promises (9 modal sites) - JSON.parse results typed as unknown then narrowed - throw <string> → throw new Error(<string>) - ${unknown} interpolations narrowed via instanceof Error - Removed dotenv runtime dependency: published plugins shouldn't read .env at runtime; user enters API keys via the settings tab - Replaced builtin-modules dev-dependency with node:module's builtinModules — same data, no extra package - Logger console-method dispatch rewritten as a switch instead of dynamic console[level] indexing (which the bot rejects) Streaming exceptions: - src/services/{perplexityService,lmStudioService,perplexicaService}.ts retain `fetch()` for SSE / chunked streaming because Obsidian's `requestUrl` buffers the whole body. Each site has an `eslint-disable-next-line no-restricted-globals` with the marketplace `/skip` justification inline. Plan to surface these on the PR with a `/skip` reply. Reference docs: - context-v/issues/Obsidian-Review-Bot-Feedback-on-Perplexed-Submission.md (issue log distilled into…) - context-v/reminders/Obsidian-Marketplace-Compliance.md (the rules themselves, reusable for image-gin and cite-wide submissions) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-09 07:39:06 +00:00
"@anthropic-ai/sdk": "^0.92.0"
}
}