Skip to content

feat(socials): post to Bluesky and Nostr from the pit - #317

Merged
ralyodio merged 2 commits into
mainfrom
feat/socials
Aug 6, 2026
Merged

feat(socials): post to Bluesky and Nostr from the pit#317
ralyodio merged 2 commits into
mainfrom
feat/socials

Conversation

@ralyodio

@ralyodio ralyodio commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Re-lands the socials commit that was preserved on feat/alpaca-trade when #295 was closed. That PR bundled three unrelated changes; its Alpaca patch had already merged via #291, and the third-level DNS commit has since re-landed as #301. This is the remaining piece, split into its own focused PR as planned.

Cherry-picked verbatim from 010b8f0 onto current main — no conflicts, no changes to the original patch.

What it adds

  • /socials — prints the roster: bluesky (alias bsky) and nostr, with descriptions.
  • /post <social> "message" — builds a composer URL and opens the browser.

Posting is always an explicit browser confirmation. The CLI only hands over a draft; account authorization and the final publish stay in the user's browser.

Bluesky

Hands off to the official bsky.app/intent/compose intent.

Nostr

Hands off to a composer page served at /socials/nostr. The draft rides in the URL fragment, so it never reaches app.moshcode.sh access logs or Referer headers — the page reads it entirely client-side.

The page uses window.nostr.js (pinned to 0.5.0) as the NIP-07/NIP-46 signer bridge, builds a kind-1 event, and publishes to any relay that accepts it: relay.damus.io, nos.lol, relay.primal.net.

MOSHCODE_API is honored, so a self-hosted pit points at its own composer.

Tests

8 new tests across test/socials.test.mjs and apps/pwa/test/socials.test.mjs covering the roster, the Bluesky intent URL, fragment-only Nostr drafts, self-hosted origin override, browser-unavailable fallback, missing-message and unknown-network errors, the pinned signer bridge, kind-1 event creation, and relay fan-out.

Full suite on this branch: 1455 tests, 1452 pass, 0 fail, 3 skipped.

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

ThreatCrush Security Scan

92 finding(s)

HIGH/CRITICAL: 50 | MEDIUM: 42

Severity Rule Location
HIGH manifest-typosquat apps/pwa/package.json:19
HIGH js-ssrf-outbound-request apps/pwa/public/sw.js:45
HIGH secret-generic-credential apps/pwa/test/apikey-bearer-scheme.test.mjs:30
HIGH secret-generic-credential apps/pwa/test/apikey-mask.test.mjs:38
HIGH secret-generic-credential apps/pwa/test/apikey-reveal.test.mjs:35
HIGH secret-generic-credential apps/pwa/test/approvals-context.test.mjs:28
HIGH secret-generic-credential apps/pwa/test/approvals-credits.test.mjs:28
HIGH secret-generic-credential apps/pwa/test/approvals-notify.test.mjs:26
HIGH secret-generic-credential apps/pwa/test/approvals-resolve-race.test.mjs:20
HIGH secret-generic-credential apps/pwa/test/auth-form-email.test.mjs:29
HIGH secret-generic-credential apps/pwa/test/auth-form-email.test.mjs:33
HIGH secret-generic-credential apps/pwa/test/auth-page-error.test.mjs:36
HIGH secret-generic-credential apps/pwa/test/cli-device-token.test.mjs:28
HIGH secret-generic-credential apps/pwa/test/cli-pages-balance.test.mjs:32
HIGH secret-generic-credential apps/pwa/test/cli-token.test.mjs:28
HIGH secret-generic-credential apps/pwa/test/credits-pack.test.mjs:51
HIGH secret-generic-credential apps/pwa/test/credits-webhook-event-match.test.mjs:35
HIGH secret-generic-credential apps/pwa/test/credits-webhook.test.mjs:28
HIGH secret-generic-credential apps/pwa/test/csrf-input-escaping.test.mjs:31
HIGH secret-generic-credential apps/pwa/test/csrf-input-escaping.test.mjs:101
HIGH secret-generic-credential apps/pwa/test/logout-csrf.test.mjs:29
HIGH secret-generic-credential apps/pwa/test/moshpit-api-key.test.mjs:28
HIGH secret-generic-credential apps/pwa/test/moshpit-bulk-claim.test.mjs:23
HIGH secret-generic-credential apps/pwa/test/moshpit-claim-full-name.test.mjs:29
HIGH secret-generic-credential apps/pwa/test/moshpit-crawlable.test.mjs:28
HIGH secret-generic-credential apps/pwa/test/moshpit-ending-page.test.mjs:28
HIGH secret-generic-credential apps/pwa/test/moshpit-pins.test.mjs:22
HIGH secret-generic-credential apps/pwa/test/moshpit-pit-page.test.mjs:33
HIGH secret-generic-credential apps/pwa/test/moshpit-records-page.test.mjs:23
HIGH secret-generic-credential apps/pwa/test/moshpit-records.test.mjs:23
HIGH secret-generic-credential apps/pwa/test/moshpit-registry.test.mjs:20
HIGH secret-generic-credential apps/pwa/test/moshpit-related-endings.test.mjs:28
HIGH secret-generic-credential apps/pwa/test/moshpit-sales.test.mjs:16
HIGH secret-generic-credential apps/pwa/test/moshpit-search.test.mjs:74
HIGH secret-generic-credential apps/pwa/test/moshpit-terms.test.mjs:19
HIGH secret-generic-credential apps/pwa/test/moshpit-tlds-pagination.test.mjs:28
HIGH secret-generic-credential apps/pwa/test/passkey-register-duplicate.test.mjs:38
HIGH secret-generic-credential apps/pwa/test/require-auth-next.test.mjs:31
HIGH secret-generic-credential apps/pwa/test/require-auth-next.test.mjs:35
HIGH secret-generic-credential apps/pwa/test/sessions-output-seq.test.mjs:30
HIGH secret-generic-credential apps/pwa/test/sessions-paste.test.mjs:24
HIGH secret-generic-credential apps/pwa/test/sessions-stream-replay.test.mjs:34
HIGH secret-generic-credential apps/pwa/test/sessions.test.mjs:24
HIGH secret-generic-credential apps/pwa/test/signature.test.mjs:6
HIGH secret-generic-credential test/auth.test.mjs:13
HIGH secret-generic-credential test/auth.test.mjs:148
HIGH secret-generic-credential test/console-cookie-malformed.test.mjs:15
HIGH secret-generic-credential test/console.test.mjs:12
HIGH secret-generic-credential test/mirror.test.mjs:37
HIGH secret-generic-credential test/mirror.test.mjs:77

…and 42 more. Full results in the Security tab.

Snippets are redacted; ThreatCrush never prints matched credential material.

apps/pwa is not a pnpm workspace package, so the root `pnpm install`
never installs its dependencies and CI's root `node --test` cannot
resolve express. The composer test imported the route module statically,
so that resolution failure crashed the file instead of skipping it.

Probe for express with createRequire and defer the route import, matching
the guard the other 38 PWA tests already use.
@ralyodio

ralyodio commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

Follow-up commit d24a21c: the composer test imported ../src/routes/socials.mjs statically, and that module pulls in express at load time. apps/pwa isn't a pnpm workspace package, so the root pnpm install --frozen-lockfile never installs its deps and CI's root node --test couldn't resolve express — the file crashed instead of skipping. Now it probes with createRequire and defers the route import, matching the guard the other 38 PWA tests already use. Verified both paths locally: 3/3 pass with deps present, 3/3 skip without. CI is green.

@ralyodio
ralyodio merged commit 9dd2a3f into main Aug 6, 2026
4 checks passed
@ralyodio ralyodio mentioned this pull request Aug 6, 2026
ralyodio added a commit that referenced this pull request Aug 6, 2026
Bump to v0.26.0, releasing two features that have been sitting on main
unreleased: posting to Bluesky and Nostr from the pit (#317), and equity
research via `moshcode ticker` / `/ticker` backed by advis0r.com, shipped
alongside moshcode's first Claude Code plugin marketplace (#318).

Minor rather than patch: both add commands, neither changes an existing one.

This release is also what makes the `ticker` plugin's primary path work.
install.sh serves the latest release tarball, not main, so every machine
running the installed binary reports `unknown command "ticker"` until a
release carries it — the plugin's slash commands fall back to curl in the
meantime, which works but skips the rendering the verb exists to do.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
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.

1 participant