Skip to content

[feat] Add site-aware content adaptation actions #28

Description

@ThreeLight2000

Motivation

Context OS already detects the active browser URL and uses it when saving records. This feature makes the current site an execution context so the extension can expose platform-specific content actions without silently replacing the user draft.

The initial use case is adapting a Korean memo for X or Threads before the user reviews and publishes it.

Scope

In scope:

  • Resolve supported site capabilities from the active URL hostname.
  • Show Adapt for X on x.com and www.x.com.
  • Translate Korean drafts into natural English for X and respect a configurable post limit, defaulting to 280 characters.
  • Show Adapt for Threads on threads.net and www.threads.net.
  • Preserve Korean and rewrite Threads drafts in a casual, monologue-style voice with a configurable post limit, defaulting to 500 characters.
  • Split long content into ordered posts at sentence or paragraph boundaries when possible.
  • Render actions through a generic SiteCapability and ContextAction model, separate from the UI.
  • Show the generated content in a review preview with explicit Apply and Copy controls.
  • Keep the original Memo unchanged until the user explicitly applies the generated content.
  • Persist per-platform post limits with the existing extension settings and provide defaults for new or migrated data.

Out of scope:

  • Automatically publishing to X or Threads.
  • Automatically saving generated content as a separate Context record.
  • Media-aware or account-plan-aware real-time platform limit detection.
  • GitHub, LinkedIn, Gmail, or other future platform adapters beyond the initial capability model.

Acceptance criteria

  • The active hostname resolves to zero or more site capabilities through a generic resolver.
  • X and Threads capabilities are implemented for their supported hosts.
  • The contextual action is hidden on unsupported sites.
  • The action is disabled for an empty or whitespace-only Memo.
  • Disabled actions still expose accessible hover and keyboard-focus usage guidance.
  • X output is natural English, preserves the draft intent, and each ordered post respects the configured limit.
  • Threads output remains Korean, uses a casual monologue style, and each ordered post respects the configured limit.
  • Long output is split into ordered posts without losing content or thread boundaries.
  • Generated output is shown separately for review and does not mutate the original Memo automatically.
  • Apply is an explicit replacement of Memo and Copy preserves the ordered post separation.
  • Platform rules and splitting logic are owned by platform adapters or actions, not by the UI component.
  • Brain Server exposes a generic adapt-content action with validated input and ordered posts output.

Verification plan

  • Add unit tests for hostname matching, supported aliases, and unsupported pages.
  • Add client tests for action visibility, empty Memo disabled state, request errors, preview behavior, and original draft preservation.
  • Add Brain Server tests for action registration, input and output validation, X and Threads prompts, configurable limits, and long-content splitting.
  • Add storage migration tests for platform limit defaults.
  • Run the Chrome client typecheck, tests, build, and verify scripts.
  • Manually verify X, Threads, unsupported sites, empty Memo, short content, long content, Apply, and Copy flows.

Implementation notes

Use the existing Brain Server Action Registry and /v1/actions endpoint. Introduce a generic SiteCapability / ContextAction contract on the client and a generic adapt-content action on Brain Server with platform-specific adapters.

The repository Project is Context OS Work. The Priority field exists but currently has no configured options, so Priority must not be set to an invented value; configure an official option before assigning it.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions