Commit graph

69 commits

Author SHA1 Message Date
mpstaton
e67d8ecc47 fix(directory-templates): streaming writes + anti-laziness/anti-hallucination measures
Real-vault use revealed Perplexity Deep Research was returning all-essay
content padded from training data instead of search results: zero inline
citations, "not available in current accessible sources" repeated for every
section. Diagnosis traced two root causes — laziness (the system prompt's
escape hatch "even if a section reads 'limited public information'" gave the
model permission to dodge search) and hallucination (no enforcement that
factual claims be tied to search results).

Fixes in this commit:

1. Streaming writes (replaces v0.2's buffer-then-write). fetch() with SSE,
   tokens flush to file every 500ms via app.vault.modify. Cancel mid-stream
   via existing batch-cancel flag; partial output remains in file.
2. Combined system prompt: perplexed's standard inline-citation directive
   prepends the template's role framing, matching how the working ask-
   perplexity command activates search.
3. Auto-prepended research framing to user prompt: "Research the entity X
   using web search... Every factual claim must be followed by [N]." The
   prompt no longer reads as a writing brief.
4. Post-stream cleanup runs after the write completes (per user spec):
   - Wraps any <think>...</think> blocks in ```think-output fenced code (raw
     <think> HTML breaks Obsidian rendering).
   - Appends a ## Sources footer listing search_results from the API
     response so evidence-of-search is visible even if the model failed to
     inline [N] markers.
5. Seed template (toolkit-profile.md) system prompt rewritten with positive
   directives only — no escape hatches, no "limited info" phrasing, no
   failure-mode descriptions. Encodes the project rule that telling a model
   it can be lazy makes it lazy.

ApplyOutcome now carries sourceCount; the user-facing notice reports it.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-09 16:13:38 -05:00
mpstaton
5e86570da9 feat(directory-templates): v0.2 — folder batch + append-below + arbitrary frontmatter interpolation
Three additions driven by real-vault use against ~1600 Tooling/ profile files:

1. Folder batch run. New command "Apply directory template to all files in
   folder" prompts for folder, then template, then a confirm modal showing
   total/fill/append counts before firing. Sequential execution with a
   live-updating progress notice. New "Stop directory template batch"
   command sets a cancel flag checked between files.

2. Append-below replaces abort-on-existing-body. If the target body is
   non-empty, the response is appended after a blank-line separator instead
   of skipping. Frontmatter still byte-identical. ApplyOutcome return type
   distinguishes fill / append / skip / error so batch can tally them.

3. Interpolation extended beyond {{title}} and {{frontmatter}}. Now supports
   {{frontmatter.X}} for explicit access and bare {{X}} as auto-fallback to
   frontmatter.X — so templates can use {{site_name}}, {{slug}}, etc.
   directly. Arrays render as comma-joined strings; nested objects as YAML.
   Also adds {{today}} → ISO date.

New files:
- src/modals/FolderPickerModal.ts — FuzzySuggestModal<TFolder>.
- src/modals/BatchConfirmModal.ts — confirm dialog showing batch counts.

Out of scope, still:
- v0.3: cf codefence in user notes.
- v0.4: section-aware writing + per-section output modes.
- v0.5: citation/backlink preservation.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-09 15:58:22 -05:00
mpstaton
115be9de5e rename(seed-template): tooling-profile → toolkit-profile
Match the user's preferred naming. The template file is "Toolkit Profile"
(its identity); it applies to entries under Tooling/ via applies-to-paths.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-09 15:44:44 -05:00
mpstaton
181a23e5e5 feat(directory-templates): v0.1 spike — apply Perplexity-driven profile templates per directory
Solves the immediate workload of populating ~1600 nearly-empty profile files
under Tooling/, Sources/, and Vocabulary/ with a consistent outline + body.

The user picks a template from a fuzzy palette (filtered by glob match against
the active file's path), and the plugin sends a single Perplexity Deep Research
request driven by the template's heading skeleton + per-section bullet
instructions. The response is buffered, then written into the empty body of the
target file. Frontmatter is byte-identical before and after.

Template anatomy (per context-v/specs/Per-Directory-Profile-Templates.md):
- Frontmatter — title, applies-to-paths globs, description.
- Pre-`cft` prose — explainer for humans, ignored at runtime.
- One `cft` codefence — YAML config + `system:` field. Config-only; no prompt
  body inside the fence.
- Post-`cft` skeleton — heading outline with model-facing bullet instructions.
  Sent as the user prompt with `{{title}}` and `{{frontmatter}}` interpolated.
- A `***` line below the skeleton terminates the user prompt; everything below
  is authoring scratch and never reaches the API.

New files:
- src/services/directoryTemplateService.ts — template loader, parser, glob
  matcher, frontmatter whitelist filter, prompt assembly, non-streaming
  Perplexity call, file writer.
- src/modals/DirectoryTemplatePickerModal.ts — FuzzySuggestModal wrapping the
  glob-matched template list.
- src/docs/templates/{tooling-profile,source-profile}.md — seed templates
  users can copy into their vault.

main.ts changes:
- New settings: directoryTemplatesRoot (default "zz-cf-lib/templates"),
  directoryTemplatesFrontmatterWhitelist (default ["title", "og_description",
  "tags", "og_image"]), directoryTemplatesRequestTimeoutMs (default 300000).
- New command: "Apply directory template to current file".
- New settings UI section under "Directory templates".

Out of scope for v0.1 — captured in the spec for later iterations:
- Folder-batch run with concurrency/progress/resume (v0.2).
- `cf` codefence runtime in user notes (v0.3).
- Section-aware writing + output modes (v0.4).
- Citation/backlink preservation (v0.5).
- Multi-provider, image generation, verb registry split (later).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-09 15:27:09 -05:00
mpstaton
4423052f04 chore(release): 0.1.1
Patch release bundling the marketplace-compliance lint pass for the
Obsidian community plugin re-submission. No user-visible behavior
changes from 0.1.0; this is the bot-clean version.

versions.json picks up "0.1.1": "1.8.10" matching the manifest's
minAppVersion.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-09 02:53:38 -05:00
mpstaton
7b17b3b6e7 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 02:39:06 -05:00
mpstaton
4483a8caa4 fix(perplexed): instruct Sonar to emit inline [N] citation markers
Perplexity's Sonar API stopped embedding inline citation markers in
message.content; responses now return prose plus separate citations
and search_results arrays. The plugin's addCitations() rendered a
correct bibliography, but the body had nothing to anchor the numbers
to.

Prepend a system message telling the model to append [1], [2], ...
markers inline, ordered to match search_results. All three payload
build sites now share one messagesWithSystem array.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-09 00:26:23 -05:00
mpstaton
090ce6210a fix(manifest): bump minAppVersion to 1.8.10 and add fundingUrl
Brings the manifest in line with the rest of the content-farm plugins —
1.8.10 is the team's current minAppVersion baseline (image-gin, plunk-it,
lmstud-yo, filestarter, file-transporter all use it); the 0.15.0 here
was a 2022-era inheritance from the original Obsidian sample plugin.

Also adds fundingUrl for parity with the rest of the farm.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-05 00:48:17 -05:00
mpstaton
1d47a095a1 revise(changelog): de-emphasize starter-fork lineage in retrospective
Tighten the retrospective to lead with this repo's own substance.
Lineage from the official Obsidian sample plugin is what every plugin
forks from on day one — not interesting and now relegated to a footnote
or removed entirely.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-04 21:57:51 -05:00
mpstaton
6dba1202e7 add(changelog): retrospective entry for 2025-07-19 substance commit
Seeds the changelog/ directory with a retrospective entry dated to the
first commit of substance in this repo, written in May 2026 from the
content-farm pseudomonorepo cleanup. The convention didn't exist when
the original work shipped; this entry exists so the upcoming GitHub
Content API roll-up loader has something from this plugin to surface
on the content-farm splash.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-04 21:50:11 -05:00
mpstaton
68edd23359 add(reminder): seed Obsidian-API-docs reminder for context-v
Adds a context-v/reminders/ note that points future humans and AI agents
to the canonical Obsidian API source of truth and lists the most common
community plugin review-bot rejection reasons. Same canonical reminder is
being seeded across every plugin in the content-farm ecosystem so the
content-farm splash's rolled-up context-v feed has reminders surfacing
from every plugin once the GitHub Content API loader lands.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-04 21:35:31 -05:00
mpstaton
be2fad757b docs(context-v): track provider-rebrand naming issue
Adds the Updating-Naming-to-Reflect-Provider-Rebrand issue note that
documents the surfaces touched by the Perplexica/Vane rename and the
ones intentionally left as internal symbols.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-04 19:53:05 -05:00
mpstaton
49168823f1 docs(perplexica): rename to "Perplexica / Vane" across user-facing surfaces
Background: the open-source self-hosted repo (ItzCrazyKns/Perplexica)
was renamed to Vane on 2026-03-09 by its maintainer (commit
'feat(app): rename to vane'). The hosted service at perplexica.io
remains live under the Perplexica brand — that's a separate hosted
product, not what users self-install for this plugin. The local API
surface (/api/search, focus modes, optimization modes) is unchanged
across the rename.

Updates "Perplexica" to "Perplexica / Vane" wherever a user can see
the string — command palette, modals, notice toasts, editor-injected
callouts, settings tab, README. Internal references (class names,
method names, CSS classes, command IDs, settings field names) are
left bare to avoid breaking compatibility or requiring migration.

main.ts
- Command names: 'Ask Perplexica' / 'Update Perplexica URL' /
  'Show Perplexica Settings' all gain '/ Vane'.
- Notice toasts (service not initialized, failed to open modal,
  current URL display) updated.
- Settings tab section heading 'Perplexica (Self-Hosted)' →
  'Perplexica / Vane (self-hosted)'; all 9 endpoint/model/template/
  prompt/placeholder labels and descriptions in that section
  updated to read 'Perplexica / Vane'.
- URLUpdateModal config (title + label) for the Update URL command
  updated to match the new command name.
- Default Perplexica query placeholder updated.

src/modals/PerplexicaModal.ts
- Header title, subtitle, submit button all read 'Ask Perplexica / Vane'.

src/services/perplexicaService.ts
- Editor-injected callout '**Perplexica Query**' / '### **Response
  from Perplexica**' both updated.
- Error notice prefix 'Perplexica Error:' → 'Perplexica / Vane Error:'.

README.md
- Top blurb, features bullet, network-use table row, "Using" section
  heading + TOC anchor (slug regenerated), full Commands table.
- Install section rewrite: heading marks the local-install
  requirement explicit; new rename callout points users at
  github.com/ItzCrazyKns/Vane for docs while explaining what got
  renamed and what didn't (perplexica.io is still a separate
  hosted brand).

Intentionally bare (justified):
- Example JSON content '"What is Perplexica's architecture?"'
  (sample content, not a UI label).
- Internal Error throws + console logs (dev-only surface).
- Code comments.
- Lines 98-102 of README, inside the rename callout itself —
  those sentences distinguish the two names by design.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 21:27:40 -05:00
mpstaton
14962edde1 meet(requirements): misc changes related to meeting Obsidian plugin community requirements
Six docs-derived blockers fixed in one pass; punch-list plan filed
under context-v/plans/ for traceability.

manifest.json
- description rewritten: action-verb start (was "A plugin for
  Obsidian…", which the docs call out as an anti-pattern), all four
  providers named (Perplexity, Anthropic Claude, Perplexica, LM
  Studio), 144 chars, ends with period.
- fundingUrl removed — was pointed at the company website, not a
  donation service. Docs: "If you don't accept donations, remove
  fundingUrl from your manifest."

main.ts
- Three command IDs un-prefixed: 'perplexed-debug-commands' →
  'debug-commands', 'perplexed-reset-prompts' → 'reset-prompts',
  'perplexed-reinitialize-services' → 'reinitialize-services'.
  Obsidian auto-prefixes commands with the plugin id, so the
  doubled form would have registered as 'perplexed.perplexed-…'.
- Deleted the top-level <h2>Perplexed Plugin Settings</h2> from the
  settings tab. Docs: "Avoid adding a top-level heading in the
  settings tab, such as 'General', 'Settings', or the name of your
  plugin."

README.md
- Placeholder URLs replaced with the real lossless-group/perplexed-plugin
  repo (clone command, Issues link x2, Discussions link).
- Stale "Version: 0.0.0.1" footer line deleted (manifest is the
  source of truth).
- New "## Network use and accounts" section: per-provider table with
  endpoint, account requirement, and API-key requirement, plus an
  explicit no-telemetry / no-self-update statement. Required by
  Developer Policies (network-use disclosure + paid-account
  disclosure). Key Features bullet updated to mention Claude.

context-v/plans/2026-05-02_Submission-Blockers-Punch-List.md
- New plan documenting the audit findings: six blockers fixed here,
  four will-be-flagged items (7-10: settings <h3>/<h4> → setHeading,
  sentence case, console.log hygiene, vault.adapter.write in
  logger.ts) deferred to a separate pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 20:34:40 -05:00
mpstaton
b3bc7e2f5c fix(streaming): hoist TextDecoder + add 90s idle timeout to surface stalls
Two open items from changelog/2026-05-02_01.md:

1. TextDecoder was being instantiated inside the read loop, so the
   {stream: true} flag (meant to carry partial multi-byte UTF-8 state
   across chunk boundaries) was discarded every iteration. Multi-byte
   characters split across a chunk boundary silently became U+FFFD,
   which then caused the JSON parse on that line to fail — caught and
   logged silently by the per-line try/catch. Hoisted the decoder
   outside the loop so the stream-state flag actually does its job.

2. Streaming responses occasionally truncated mid-answer with no
   console error and no Notice — the loop just stopped writing.
   Diagnosis (unverified) was that Perplexity's server or Obsidian's
   Electron fetch was closing the SSE socket without surfacing an
   error, leaving reader.read() blocked forever. Each read now races
   against a 90s idle timer; if no chunk arrives in that window, the
   timer rejects with a clear message ("stream went idle for 90s
   (likely API stall, rate limit, or socket close)") which propagates
   to the existing catch and produces a visible Streaming Error
   notice + editor line instead of silent truncation. 90s is generous
   enough for sonar-deep-research first-byte (30-60s typical) but
   short enough that a true stall is caught quickly.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 18:13:05 -05:00
mpstaton
ebebfa9f21 improve(modals): apply wide-modal pattern to LM Studio + Text Enhancement modals
Brings LMStudioModal, TextEnhancementModal, and TextEnhancementWithImagesModal
to the same shape as Ask Perplexity / Ask Claude / Ask Perplexica:
modalEl.addClass(...) wide-modal unlock, sectioned header/section/footer
layout, BEM-scoped class names, native Obsidian Setting components for
dropdowns and toggles, custom textareas where Setting is a poor fit,
Cmd/Ctrl+Enter submit, mobile breakpoint at 600px.

LMStudioModal: model dropdown with live taglines, Max Tokens input,
Temperature slider (0-2 with dynamic tooltip), optional System Prompt
textarea, Images + Stream toggles.

TextEnhancementModal + TextEnhancementWithImagesModal: read-only
Selected Text textarea (background-secondary tint to distinguish from
editable input) + editable prompt pre-filled from the plugin template,
button busy-state during the call.

Bonus: TextEnhancementWithImagesModal CSS class name now matches the
file/class name (was 'get-related-images-modal' on the .ts side while
the file was text-enhancement-with-images-modal.css).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 18:12:52 -05:00
mpstaton
19b300c10c improve(modals): upgrade Perplexical Modal UI, context and changelogs
On branch development
 Your branch is up to date with 'origin/development'.
 Changes to be committed:
	new file:   changelog/2026-04-30_01.md
	new file:   changelog/2026-05-01_01.md
	modified:   changelog/2026-05-02_01.md
	modified:   context-v/specs/Using-Files-as-Prompt-Outlines.md
	modified:   src/modals/PerplexicaModal.ts
	modified:   src/styles/perplexica-modal.css
	modified:   styles.css
2026-05-02 17:07:10 -05:00
mpstaton
46e4f24755 align(requirements): align Perplexed to Obsidian's plugin community
standards

 On branch development
 Your branch is up to date with 'origin/development'.
 Changes to be committed:
	new file:   LICENSE
	new file:   context-v/plans/20206-05-02_Assuring-Obsidian-Community-Plugin-Requirements.md
	modified:   eslint.config.mjs
	modified:   main.ts
	modified:   manifest.json
	modified:   package.json
	modified:   src/modals/ArticleGeneratorModal.ts
	modified:   src/modals/ClaudeModal.ts
	modified:   src/modals/LMStudioModal.ts
	modified:   src/modals/PerplexicaModal.ts
	modified:   src/modals/PerplexityModal.ts
	modified:   src/modals/TextEnhancementModal.ts
	modified:   src/modals/TextEnhancementWithImagesModal.ts
	modified:   src/modals/URLUpdateModal.ts
	modified:   src/services/lmStudioService.ts
	modified:   src/services/perplexicaService.ts
	modified:   src/services/perplexityService.ts
	modified:   src/types/obsidian.d.ts
	new file:   src/utils/coerce.ts
	modified:   src/utils/formatDate.ts
	modified:   src/utils/logger.ts
	modified:   styles.css
	modified:   versions.json
2026-05-02 14:46:59 -05:00
mpstaton
d7551d7bc7 stuck(model): stuck trying to get model Claude API working
On branch development
 Your branch is up to date with 'origin/development'.
 Changes to be committed:
	new file:   .logs/obsidian.md-1777711786079.log
	modified:   context-v/issue-resolutions/Getting-Claude-to-Respond-With-Research.md
	new file:   context-v/specs/Using-Files-as-Prompt-Outlines.md
	modified:   src/modals/ArticleGeneratorModal.ts
	modified:   src/modals/ClaudeModal.ts
	modified:   src/modals/PerplexityModal.ts
	modified:   src/services/claudeService.ts
	modified:   src/styles/article-generator-modal.css
	modified:   src/styles/perplexity-modal.css
	modified:   styles.css
2026-05-02 04:18:53 -05:00
mpstaton
b5a70c72a4 stuck(claude): claude not returning research citations or reference
definitions, just plain text

 On branch development
 Your branch is ahead of 'origin/development' by 1 commit.
   (use "git push" to publish your local commits)
 Changes to be committed:
	new file:   context-v/issue-resolutions/Getting-Claude-to-Respond-With-Research.md
	new file:   context-v/issue-resolutions/Widen-Modals-in-Obsidian-using-CSS.md
	modified:   package.json
2026-05-02 03:38:03 -05:00
mpstaton
9d5bc80ecf progress(model-provider): attempt to add new model, claude. Struggling
with getting returned research objects.

 On branch development
 Your branch is up to date with 'origin/development'.
 Changes to be committed:
	new file:   context-v/reminders/Ideal-and-Overkill-Schema-for-Max-Flexibility.md
	modified:   main.ts
	modified:   package.json
	modified:   pnpm-lock.yaml
	new file:   src/modals/ClaudeModal.ts
	new file:   src/services/claudeService.ts
	new file:   src/styles/claude-modal.css
	modified:   src/styles/main.css
	modified:   styles.css
2026-05-02 03:18:11 -05:00
mpstaton
d5e78076f6 update(dependencies): update all dependencies for Perplexed
On branch development
 Your branch is ahead of 'origin/development' by 1 commit.
   (use "git push" to publish your local commits)
 Changes to be committed:
	deleted:    .eslintignore
	deleted:    .eslintrc
	new file:   changelog/2026-05-02_01.md
	new file:   eslint.config.mjs
	modified:   package.json
	modified:   pnpm-lock.yaml
	modified:   src/services/perplexityService.ts
	modified:   styles.css
	modified:   tsconfig.json
2026-05-02 01:08:20 -05:00
mpstaton
a13b4e2292 Update styles.css 2025-11-14 14:35:58 +00:00
mpstaton
f75afbfe58 Add WARP.md documentation for development workflow 2025-11-14 14:25:16 +00:00
TanujKS
153894fa09 improve: Deep Research Streaming \nfeat: Enhance Text and Add Image from selection commands 2025-08-28 23:44:58 -07:00
TanujKS
f0ef900a13 improve: Deep Research Streaming \nfeat: Enhance Text and Add Image from selection commands 2025-08-28 23:44:17 -07:00
mpstaton
3e7eb3b51c update(styles): update css styles
On branch development
 Your branch is up to date with 'origin/development'.
 Changes to be committed:
	modified:   styles.css
2025-08-13 16:21:48 +02:00
Tanuj Siripurapu
70a2f31136 fixed image placement and added setting to position query at top or end of response 2025-08-11 23:47:14 -04:00
mpstaton
bf8f02221f fix(streaming): fix streaming for chat query.
On branch feature/perplexity-streaming
 Changes to be committed:
	modified:   README.md
	new file:   src/docs/Understanding-the-Perplexity-Response-Object.md
	modified:   src/services/lmStudioService.ts
	modified:   src/services/perplexicaService.ts
	modified:   src/services/perplexityService.ts
	new file:   src/utils/formatDate.ts
	modified:   styles.css
	new file:   test-perplexity-api.sh
	new file:   test-perplexity-non-streaming.sh
2025-08-08 19:10:06 +02:00
TanujKS
8b3149ee67 feat(prompts) All prompts can now be configured in settings 2025-07-23 13:19:10 -07:00
TanujKS
ef85565f19 improve(modal) All modals now inject the required prompt to place images THROUGHOUT a file 2025-07-22 13:37:21 -07:00
TanujKS
ee286d2330 feat: Refactor plugin architecture and enhance UI/UX
- Split monolithic main.ts into modular services and modals
- Created separate service classes: PerplexityService,
  PerplexicaService, LMStudioService
  - Created modular modal classes: PerplexityModal, PerplexicaModal,
    LMStudioModal, URLUpdateModal
    - Deleted unused legacy files: CitationModal.ts, citationService.ts,
      cleanReferencesSectionService.ts

      ## New Features
      - Added ArticleGeneratorModal for one-page article generation with
	predefined prompts
	- Implemented intelligent image placement with [IMAGE n:
	  description] markers
	  - Added auto-scrolling during streaming responses for better
	    UX
	    - Created full callout formatting for query blocks with
	      multi-line support

	      ## UI/UX Improvements
	      - Moved all inline styles to dedicated CSS files for
		better maintainability
		- Created modular CSS structure: perplexity-modal.css,
		  article-generator-modal.css, etc.
		  - Added proper spacing and padding to text inputs
		    across all modals
		    - Fixed sources placement to appear after last
		      non-empty line (no more huge gaps)
		      - Enhanced modal layouts with better visual
			hierarchy

			## Build System
			- Updated esbuild.config.mjs to properly bundle
			  CSS files
			  - Created src/styles/main.css as CSS entry
			    point
			    - Implemented proper CSS build process with
			      minification support

			      ## Bug Fixes
			      - Fixed TypeScript errors from unused
				imports and parameters
				- Resolved streaming scroll issues with
				  proper cursor tracking
				  - Fixed multi-line query formatting in
				    callout blocks
				    - Corrected sources insertion logic
				      for both streaming and
				      non-streaming responses

				      ## Code Quality
				      - Improved separation of concerns
					with service/modal architecture
					- Enhanced maintainability with
					  modular CSS structure
					  - Added comprehensive error
					    handling and logging
					    - Implemented consistent
					      coding patterns across all
					      services

					      ## Technical Details
					      - Services now handle API
						calls, streaming, and
						response processing
						- Modals focus purely on
						  UI and user
						  interaction
						  - CSS uses Obsidian's
						    design system
						    variables for
						    theming
						    - All modals support
						      both streaming and
						      non-streaming
						      modes
						      - Image placement
							supports both
							inline markers
							and fallback
							sections

							Breaking
							Changes: None
							Migration:
							Existing
							functionality
							preserved,
							enhanced with
							new features
2025-07-20 16:32:36 -07:00
mpstaton
15bbc0f565 improve(settings), new(api): add new LM Studio API, improve settings
On branch development
 Your branch is up to date with 'origin/development'.
 Changes to be committed:
	modified:   README.md
	modified:   main.ts
	modified:   styles.css
2025-07-20 01:48:39 +03:00
mpstaton
b01599a617 fix(typescript): fix typescript error
On branch development
 Your branch is up to date with 'origin/development'.
 Changes to be committed:
	modified:   main.ts
2025-07-19 23:11:01 +03:00
mpstaton
7b1364098e attempt(api-images): attempt to process API related image responses
On branch development
 Your branch is up to date with 'origin/development'.
 Changes to be committed:
	modified:   main.ts
2025-07-19 22:40:18 +03:00
mpstaton
880a442911 milestone(streaming): api-call to Perplexity as made through modal now
works and streams responses back.  Not perfect, but works!

 On branch development
 Your branch is up to date with 'origin/development'.
 Changes to be committed:
	modified:   main.ts
2025-07-19 21:33:08 +03:00
mpstaton
0e8b4ca114 milestone(settings): settings panel is better than good enough
On branch development
 Your branch is ahead of 'origin/development' by 1 commit.
   (use "git push" to publish your local commits)
 Changes to be committed:
	modified:   README.md
	modified:   main.ts
2025-07-19 21:13:34 +03:00
mpstaton
c81ca99aa8 improve(settings): improve settings UI
On branch development
 Your branch is up to date with 'origin/development'.
 Changes to be committed:
	modified:   main.ts
	new file:   package-lock.json
	modified:   package.json
	modified:   styles.css
2025-07-19 21:08:45 +03:00
mpstaton
7e6831c315 init(project): initial commit for Perplexed Obsidian Plugin with basic readme, manifest, package.json
On branch master
 Changes to be committed:
	modified:   README.md
	modified:   manifest.json
	modified:   package.json
2025-07-10 00:00:49 +03:00
mpstaton
7e2aeb7bb5 update(packages): updated packages and dependencies to latest
On branch master
 Your branch is up to date with 'origin/master'.
 Changes to be committed:
	modified:   package.json
	modified:   pnpm-lock.yaml
2025-07-09 23:34:17 +03:00
mpstaton
708e4a18c6 Merge development into master 2025-07-09 23:21:45 +03:00
mpstaton
5de4339c6c save(state): save state of starter code for any obsidian plugin
On branch development
 Changes to be committed:
	deleted:    .cursor/mcp.json
	deleted:    .windsurfrules
	modified:   README.md
	modified:   manifest.json
	modified:   package.json
	modified:   versions.json
2025-07-09 23:18:48 +03:00
mpstaton
cee8c2647c feat(move-citations): rearrange format by moving citations behind commas and periods.
- Move citations after punctuation (periods and commas) in document body
- Preserve reference section formatting
- Handle multiple citations before punctuation
- Add proper spacing between multiple citations
- Process entire document in one pass
- Add command to format citations via command palette

The command "Move Citations after Punctuation" is now available in the command palette (Ctrl/Cmd+P) to format citations throughout the document.
 On branch development
 Changes to be committed:
	modified:   main.ts
	modified:   src/services/citationService.ts
2025-07-08 20:12:25 +03:00
mpstaton
3d0eb2ac06 feat(clean-references): add reference cleanup service with colon formatting
- Implement cleanReferencesSectionService with addColonSyntaxWhereNone function
- Add command to format footnote references with consistent colon syntax
- Fix regex to handle various footnote reference formats
- Preserve leading whitespace and ensure single space after colon
- Add TypeScript type safety with proper null checks
- Integrate with main plugin command registry

The new command formats footnote references from:
  [^hexId] Text...
to:
  [^hexId]: Text...

This improves consistency in citation formatting throughout documents.
 On branch development
 Changes to be committed:
	modified:   main.ts
	new file:   src/services/cleanReferencesSectionService.ts
2025-07-08 19:24:11 +03:00
mpstaton
39945546a1 save(modal): save to hex modal as it mostly works
On branch development
 Changes to be committed:
	modified:   src/services/citationService.ts
2025-07-08 19:05:06 +03:00
mpstaton
262b2e95a9 feature(modal): covert citations modal now works
On branch development
 Changes to be committed:
	modified:   src/services/citationService.ts
2025-07-08 15:10:44 +03:00
mpstaton
6d616c9a63 improve(modal): isolate final reference for conversion to hex
On branch development
 Changes to be committed:
	modified:   src/modals/CitationModal.ts
	modified:   src/services/citationService.ts
	modified:   src/styles/citations.css
2025-07-08 03:29:52 +03:00
mpstaton
7337a11172 improve(modal): improve line identification in modal
On branch development
 Changes to be committed:
	modified:   src/services/citationService.ts
2025-07-08 02:54:29 +03:00
mpstaton
cf09cfa2c1 improve(modal): improve to hex modal by creating a pre-process function
On branch development
 Changes to be committed:
	modified:   src/services/citationService.ts
2025-07-08 02:39:49 +03:00
mpstaton
9f6cbfd4c0 progress(modal): progress on citations modal, now isolates single
citations

 On branch development
 Changes to be committed:
	modified:   src/modals/CitationModal.ts
	modified:   src/services/citationService.ts
	modified:   src/styles/citations.css
2025-07-08 02:12:40 +03:00