Metadata-Version: 2.4
Name: fred-capability-writable-document
Version: 4.5.0
Summary: Fred agent capability: co-author a session-scoped Markdown document from chat (writable_document).
Author-email: Thales <noreply@thalesgroup.com>
License: Apache-2.0
Project-URL: Homepage, https://site.fredlab.dev
Project-URL: Repository, https://github.com/ThalesGroup/fred
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Operating System :: OS Independent
Requires-Python: <3.13,>=3.12
Description-Content-Type: text/markdown
Requires-Dist: fred-core>=4.5.0
Requires-Dist: fred-sdk[agents]>=4.5.0
Requires-Dist: pydantic<3.0.0,>=2.7.0
Requires-Dist: langchain-core>=0.3.0
Requires-Dist: langchain>=0.3.0
Requires-Dist: fastapi>=0.110
Requires-Dist: python-docx>=1.1
Requires-Dist: sqlalchemy>=2.0
Provides-Extra: dev
Requires-Dist: bandit>=1.8.6; extra == "dev"
Requires-Dist: basedpyright==1.31.0; extra == "dev"
Requires-Dist: detect-secrets>=1.5.0; extra == "dev"
Requires-Dist: pytest>=8.4.2; extra == "dev"
Requires-Dist: pytest-asyncio>=1.2.0; extra == "dev"
Requires-Dist: pytest-cov>=6.2.1; extra == "dev"
Requires-Dist: pytest-socket>=0.7.0; extra == "dev"
Requires-Dist: ruff>=0.12.5; extra == "dev"

# fred-capability-writable-document

Fred agent capability that co-authors a session-scoped Markdown document from chat.

The agent calls a `write_document` tool to create or revise a deliverable
(report, email, memo, meeting notes) that is kept OUT of the conversation stream
and shown in a dedicated editor pane. The user can edit the document back, and
export it to Word (`.docx`) or Markdown. Documents are scoped to one chat
session and co-authored over time by the agent and the user; only the last
author is tracked.

This package is a Swift port of Kea's "Writable Document" feature (GitHub issue
#1905): the editor feature is one `AgentCapability` — the `write_document`
middleware (static tool + user-edit notification + open-documents catalog
prompt), one owned table (`cap_writable_document_docs`), the contributed
`writable_document` chat part, the editor side panel, and the list/get/put/export
router.

The package also registers a separately enabled, temporary
`open_writable_document` capability for Deep Agent demos. Its sole tool copies
an existing Markdown file from any readable mount in the current conversation
workspace into the editor. Enable both capabilities on the demo agent:
`writable_document` owns the editor and `open_writable_document` adds the import
tool. The copied document can be edited, but those edits do not update the
source workspace file.

## Registration

Installing this package *is* the registration: the fred-agents pod auto-discovers
the capability at boot via the `fred.capabilities` entry point declared in
`pyproject.toml`
(`writable_document = "fred_capability_writable_document.capability:WritableDocumentCapability"`).
The second entry point registers `open_writable_document` independently.
