lossless-group_perplexed-pl.../package.json
mpstaton 01897c0903 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 14:41:12 -05:00

42 lines
1.2 KiB
JSON

{
"name": "perplexed",
"version": "0.3.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"
}
}