Skip to content

feat: add Web Clipper intake protocol (openknowledge://clip) and clip-intake schema (#1174) - #1177

Open
Adityakk9031 wants to merge 1 commit into
inkeep:mainfrom
Adityakk9031:feat-web-clipper-intake
Open

feat: add Web Clipper intake protocol (openknowledge://clip) and clip-intake schema (#1174)#1177
Adityakk9031 wants to merge 1 commit into
inkeep:mainfrom
Adityakk9031:feat-web-clipper-intake

Conversation

@Adityakk9031

Copy link
Copy Markdown
Contributor

Resolves #1174

Description

This PR introduces the secure Web Clipper Desktop Intake Protocol (openknowledge://clip) and openknowledge.clip/v1 envelope schema as proposed in #1174.

What Changed

  • Core Package (packages/core):
    • Added ClipPayloadSchema and OkClipPayload in packages/core/src/schemas/api/clip-intake.ts validating openknowledge.clip/v1 Markdown envelopes.
    • Re-exported ClipPayloadSchema in core API schemas.
  • Desktop Package (packages/desktop):
    • Added parseClipUrl in packages/desktop/src/main/url-scheme.ts to parse and validate openknowledge://clip?destination=<id>&clipboard=true deep links with path traversal and null-byte defenses.
    • Created packages/desktop/src/main/clip-intake.ts providing filename sanitization and "Keep both" collision resolution (article.md -> article-1.md).
  • Tests & Changeset:
    • Added comprehensive unit tests in packages/desktop/src/main/url-scheme-clip.test.ts (9/9 tests passing).
    • Included changeset .changeset/add-web-clipper-intake-protocol.md.

Testing

  • Ran npx vitest run src/main/url-scheme-clip.test.ts (all 9 unit tests passed).
  • Verified parseClipUrl rejects null-bytes, missing destinations, invalid hosts, and path traversal attempts.

@github-actions

Copy link
Copy Markdown

Thanks for the contribution!

What happens next:

  • A maintainer will review your PR.
  • If you don't hear back within a few business days, please comment here to nudge our team.
  • This repository is maintained through an internal mirror. When your change is accepted, this PR will close automatically. Don't be alarmed when it closes — that's how it merges, and your authorship is preserved.

@Adityakk9031

Copy link
Copy Markdown
Contributor Author

@tim-inkeep and @anubra266 have a look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: OpenKnowledge Web Clipper with secure one-click capture into a configured project

1 participant