2.1 KiB
Browser Inbox Create Link Conversion Design
Purpose
Browser captures should be convertible into a lightweight link artifact without
forcing every URL into Notes. This slice adds a public Files API conversion that
creates an ordinary human-readable .url file in the workspace.
Scope
This slice adds one conversion action inside verstak.browser-inbox:
- render
Create Linkfor captures that have bothworkspaceRootPathand a URL; - write a
.urlshortcut file to<workspaceRootPath>/Links/<safe-title>.urlthroughapi.files.writeText; - publish
browser.capture.convertedwithconversionType: "link"; - remove the converted capture from the inbox queue after a successful write;
- leave the capture in place and show an error if the write fails.
It does not add a core link entity model, a link resolver plugin, bulk conversion, or file attachment capture.
Link File Format
The generated file is a plain text Internet shortcut:
[InternetShortcut]
URL=https://example.com/article
The plugin writes with:
api.files.writeText(linkPath, content, {
createIfMissing: true,
overwrite: false
})
This preserves explicit conflict behavior. The plugin must not silently append a suffix when a link file already exists.
Event Contract
After a successful conversion the plugin publishes:
api.events.publish('browser.capture.converted', {
captureId,
conversionType: 'link',
linkPath,
workspaceRootPath,
title,
url,
sourcePluginId: 'verstak.browser-inbox'
})
Activity can record this through the already-supported
browser.capture.converted event.
Testing
scripts/smoke-browser-inbox-plugin.js must prove:
- a workspace capture with a URL renders
Create Link; - clicking it writes the
.urlfile throughapi.files.writeText; - the write uses
createIfMissing: trueandoverwrite: false; - the capture is removed from its queue after success;
browser.capture.convertedis published withconversionType: "link";- when the write rejects, the capture remains in the queue and an error status is rendered.