@tokenring-ai/writer 0.2.4 → 0.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,7 +1,7 @@
1
1
  Copyright (c) 2025 Mark Dierolf
2
2
 
3
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the Software), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
4
 
5
5
  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
6
 
7
- THE SOFTWARE IS PROVIDED AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
7
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -2,88 +2,94 @@
2
2
 
3
3
  ## Overview
4
4
 
5
- TokenRing Writer (tr-writer) is a unified platform for writing and managing news articles & blog posts. It provides a
6
- powerful interface where you can create, edit, and publish content, leveraging AI to assist with writing, editing,
7
- formatting, and publishing workflows.
5
+ TokenRing Writer (tr-writer) is an AI-powered content creation and management platform. It provides a unified interface for creating, editing, and managing content with assistance from specialized AI agents. The application supports multiple AI providers, research tools, publishing integrations, and flexible UI options.
8
6
 
9
7
  ## Features
10
8
 
11
- - **Agent-based architecture**: Multiple specialized AI agents for different content creation tasks (writer, editor, researcher, publisher).
12
- - **Interactive chat interface**: Talk to agents in a conversational REPL for content creation assistance.
9
+ - **Agent-based architecture**: Multiple specialized AI agents for different content creation workflows (writer, managing editor).
10
+ - **Interactive chat interface**: Conversational REPL for interacting with AI agents during content creation.
13
11
  - **Persistent content history**: Sessions and content drafts are saved in a SQLite database.
14
12
  - **Command system**: Issue commands prefixed with `/` to manage agents, content, and workflows.
15
- - **Publishing integration**: Works directly with your content directory; can initialize with a TokenRing config.
16
- - **Multi-model support**: Support for various AI models from different providers.
17
- - **Research capabilities**: Built-in web search and Wikipedia integration for content research.
18
- - **File system integration**: Direct integration with local and cloud file systems.
13
+ - **HTTP server integration**: Start an HTTP server for web-based interaction with the application.
14
+ - **Multi-model support**: Support for various AI models from different providers (OpenAI, Anthropic, Google, Cerebras, DeepSeek, Groq, Perplexity, xAI).
15
+ - **Research capabilities**: Built-in web search, Wikipedia integration, and research tools for content research.
16
+ - **File system integration**: Direct integration with local and cloud file systems (S3, local filesystem).
17
+ - **Publishing integrations**: Support for WordPress, Ghost.io, Reddit, blog platforms, and CDN management.
18
+ - **Flexible UI options**: Support for different UI implementations (Inquirer, Ink CLI, or headless mode).
19
+ - **Task scheduling**: Automated scheduling and task management for content workflows.
20
+ - **Checkpoint and state management**: Persistent state and session recovery capabilities.
19
21
 
20
22
  ## Available Agents
21
23
 
22
24
  TokenRing Writer includes specialized AI agents for different content creation workflows:
23
25
 
24
- - **Content Writer**: Expert content writer specializing in creating engaging, well-structured articles and blog posts. Excels at research, storytelling, and adapting writing style to different audiences.
25
- - **Managing Editor**: Coordinates content creation by searching for trending news topics, evaluating newsworthiness, creating article assignments, and dispatching tasks to specialized writing agents.
26
+ - **Content Writer**: Expert content writer specializing in creating engaging, well-structured articles and blog posts. Excels at research, storytelling, and adapting writing style to different audiences. Uses research, blog, and websearch tools.
26
27
 
27
- ## Getting Started
28
-
29
- ### Quick Start (NPM)
30
-
31
- Run directly using npx without installation:
32
-
33
- ```bash
34
- npx @tokenring-ai/writer --source ./path-to-your-content --initialize
35
- ```
36
-
37
- ### Quick Start (Docker)
38
-
39
- Pull and run from GitHub Container Registry:
28
+ - **Managing Editor**: Coordinates content creation by searching for trending news topics, evaluating newsworthiness, creating article assignments, and dispatching tasks to specialized writing agents. Uses research, websearch, and agent tools with a max step limit of 75.
40
29
 
41
- ```bash
42
- docker pull ghcr.io/tokenring-ai/writer:latest
43
- docker run -ti --net host $(env | grep '_KEY' | sed 's/^/-e /') -v ./path-to-your-content:/repo:rw ghcr.io/tokenring-ai/writer:latest
44
- ```
30
+ ## Getting Started
45
31
 
46
32
  ### Prerequisites
47
33
 
48
34
  - Bun (for local development)
49
35
  - Git initialized content directory
50
36
 
51
- ### Installation (local development)
37
+ ### Installation (Local Development)
38
+
39
+ 1. **Sync git submodules**: This project uses git submodules that need to be initialized and updated before installation:
52
40
 
53
- 1. **Sync git submodules**: This project uses git submodules that need to be initialized and updated before
54
- installation:
55
41
  ```bash
56
42
  git submodule update --init --recursive
57
43
  ```
58
44
 
59
45
  2. **Install dependencies**: This project uses Bun as the package manager in a monorepo structure:
46
+
60
47
  ```bash
61
48
  bun install
62
49
  ```
63
50
 
64
51
  3. **Run the application**: Use Bun to start the application:
65
52
 
66
- ```bash
67
- bun src/tr-writer.ts --source ./path-to-your-content
68
- ```
53
+ ```bash
54
+ bun src/tr-writer.ts --source ./path-to-your-content
55
+ ```
69
56
 
70
- ### Installation (As local docker container)
57
+ ### Quick Start (NPM)
58
+
59
+ Run directly using npx without installation:
60
+
61
+ ```bash
62
+ npx @tokenring-ai/writer --source ./path-to-your-content --initialize
63
+ ```
64
+
65
+ ### Quick Start (Docker)
66
+
67
+ Pull and run from GitHub Container Registry:
68
+
69
+ ```bash
70
+ docker pull ghcr.io/tokenring-ai/writer:latest
71
+ docker run -ti --net host $(env | grep '_KEY' | sed 's/^/-e /') -v ./path-to-your-content:/repo:rw ghcr.io/tokenring-ai/writer:latest
72
+ ```
73
+
74
+ ### Installation (As Local Docker Container)
75
+
76
+ 1. **Sync git submodules**: This project uses git submodules that need to be initialized and updated before installation:
71
77
 
72
- 1. **Sync git submodules**: This project uses git submodules that need to be initialized and updated before
73
- installation:
74
78
  ```bash
75
79
  git submodule update --init --recursive
76
80
  ```
77
81
 
78
82
  2. **Build the docker container**:
83
+
79
84
  ```bash
80
85
  # This command must be run in the root directory of the repo
81
- docker build -t token-ring/writer:latest -f docker/Dockerfile .
86
+ docker build -t tokenring-ai/writer:latest -f docker/Dockerfile .
82
87
  ```
83
88
 
84
89
  3. **Run the docker container**:
90
+
85
91
  ```bash
86
- docker run -ti --net host $(env | grep '_KEY' | sed 's/^/-e /') -v ./:/repo:rw token-ring/writer:latest
92
+ docker run -ti --net host $(env | grep '_KEY' | sed 's/^/-e /') -v ./:/repo:rw tokenring-ai/writer:latest
87
93
  ```
88
94
 
89
95
  #### Container Registry
@@ -98,20 +104,154 @@ The Docker image is automatically built and published to GitHub Container Regist
98
104
  docker pull ghcr.io/tokenring-ai/writer:latest
99
105
  ```
100
106
 
101
- ### Initialization
107
+ ## Initialization
102
108
 
103
- To initialize your content directory with the necessary TokenRing configuration file, pass the --initialize flag after
104
- your content directory.
105
- This will initialize a new .tokenring directory in your project, which stores a writer-config.js config file for your
106
- project that you can customize, as well as a sqlite database which stores your content history.
109
+ To initialize your content directory with the necessary TokenRing configuration file, run:
107
110
 
108
- ```
111
+ ```bash
109
112
  tr-writer --source ./path-to-your-content --initialize
110
113
  ```
111
114
 
112
- This copies a default `.tokenring/writer-config.js` into your content directory.
115
+ This creates a `.tokenring` directory in your project, which stores:
116
+
117
+ - `writer-config.mjs`: Configuration file for your project
118
+ - `writer-database.sqlite`: SQLite database storing your content history
119
+ - `.gitignore`: File ignoring database files
120
+
121
+ ## Configuration
122
+
123
+ The application uses a configuration file located at `.tokenring/writer-config.mjs`. This file can be customized to:
124
+
125
+ - Configure different AI models and providers
126
+ - Set up web search integration
127
+ - Configure file system providers
128
+ - Set up HTTP server authentication
129
+ - Define custom agent configurations
130
+
131
+ Example configuration structure:
132
+
133
+ ```javascript
134
+ export default {
135
+ websearch: {
136
+ providers: {
137
+ serper: {
138
+ type: "serper",
139
+ apiKey: process.env.SERPER_API_KEY,
140
+ },
141
+ },
142
+ },
143
+ filesystem: {
144
+ defaultProvider: "local",
145
+ providers: {
146
+ local: {
147
+ type: "local",
148
+ },
149
+ },
150
+ },
151
+ wikipedia: {
152
+ baseUrl: "https://en.wikipedia.org",
153
+ },
154
+ research: {
155
+ researchModel: "Google:gemini-2.5-flash",
156
+ },
157
+ ai: {
158
+ defaultModel: "Google:gemini-2.5-flash",
159
+ models: {
160
+ // Configure various AI providers
161
+ Anthropic: {
162
+ provider: "anthropic",
163
+ apiKey: process.env.ANTHROPIC_API_KEY,
164
+ },
165
+ Google: {
166
+ provider: "google",
167
+ apiKey: process.env.GOOGLE_GENERATIVE_AI_API_KEY,
168
+ },
169
+ OpenAI: {
170
+ provider: "openai",
171
+ apiKey: process.env.OPENAI_API_KEY,
172
+ },
173
+ },
174
+ },
175
+ };
176
+ ```
177
+
178
+ ## Command Line Options
179
+
180
+ ```bash
181
+ tr-writer [options]
182
+ ```
183
+
184
+ ### Options
185
+
186
+ - `--ui <inquirer|ink|none>`: Select the UI to use for the application (default: inquirer)
187
+ - `--workingDirectory <path>`: Path to the working directory (default: cwd)
188
+ - `--dataDirectory <path>`: Path to the data directory (default: `<workingDirectory>/.tokenring`)
189
+ - `--http [host:port]`: Starts an HTTP server for web-based interaction
190
+ - `--httpPassword <user:password>`: Basic auth username and password
191
+ - `--httpBearer <user:bearer>`: Bearer token auth username and token
192
+
193
+ ### Examples
194
+
195
+ ```bash
196
+ # Run with default settings
197
+ tr-writer --source ./content
198
+
199
+ # Run with custom directories
200
+ tr-writer --source ./my-content --dataDirectory ./my-data
201
+
202
+ # Run with HTTP server
203
+ tr-writer --source ./content --http 127.0.0.1:3000
204
+
205
+ # Run with basic authentication
206
+ tr-writer --source ./content --http 127.0.0.1:3000 --httpPassword user:password
207
+
208
+ # Run with Ink CLI UI
209
+ tr-writer --source ./content --ui ink
210
+
211
+ # Run in headless mode
212
+ tr-writer --source ./content --ui none
213
+ ```
214
+
215
+ ## HTTP Server
216
+
217
+ The application can start an HTTP server for web-based interaction:
218
+
219
+ ```bash
220
+ tr-writer --source ./path-to-content --http 127.0.0.1:3000
221
+ ```
222
+
223
+ ### Authentication Options
113
224
 
114
- ### Chat and Commands
225
+ - **Basic Auth**:
226
+ ```bash
227
+ tr-writer --http 127.0.0.1:3000 --httpPassword user:password
228
+ ```
229
+
230
+ - **Bearer Token Auth**:
231
+ ```bash
232
+ tr-writer --http 127.0.0.1:3000 --httpBearer user:token
233
+ ```
234
+
235
+ ## UI Options
236
+
237
+ The application supports different UI implementations:
238
+
239
+ - **Inquirer UI** (default):
240
+ ```bash
241
+ tr-writer --source ./content --ui inquirer
242
+ ```
243
+
244
+ - **Ink CLI UI**:
245
+ ```bash
246
+ tr-writer --source ./content --ui ink
247
+ ```
248
+
249
+ - **Headless mode** (no UI):
250
+ ```bash
251
+ tr-writer --source ./content --ui none
252
+ ```
253
+
254
+ ## Chat and Commands
115
255
 
116
256
  Once started, you enter the agent chat REPL:
117
257
 
@@ -129,26 +269,62 @@ Some example commands:
129
269
  - `/agent switch <name>`: Switch to a specific agent.
130
270
  - `/tools list`: Show available tools.
131
271
  - `/tools enable <pattern>`: Enable specific tools.
272
+ - `/quit`: Exit the application.
132
273
 
133
274
  ## Architecture
134
275
 
135
276
  - **CLI**: Entry point with argument parsing and agent team initialization (`tr-writer.ts`).
136
- - **Agents**: Specialized AI agents for different content creation tasks (writer, editor, researcher, publisher).
137
- - **Services**: Core services for file system, web search, models, and database management.
277
+ - **Agents**: Specialized AI agents for different content creation tasks (writer, managing editor).
278
+ - **Plugins**: 37 integrated plugins providing services for AI, chat, filesystem, research, publishing, and more.
279
+ - **Services**: Core services for file system, web search, models, database management, and scheduling.
138
280
  - **Configuration**: Flexible configuration system supporting multiple models and services.
281
+ - **HTTP Server**: Optional web server for remote interaction.
282
+ - **UI Frameworks**: Support for both Inquirer and Ink CLI interfaces.
283
+
284
+ ### Plugin Ecosystem
285
+
286
+ The application integrates the following plugin packages:
287
+
288
+ - **Core**: @agent, @ai-client, @app, @utility
289
+ - **Chat**: @chat, @chat-frontend
290
+ - **Content**: @blog, @wordpress, @ghost-io, @reddit
291
+ - **Data**: @checkpoint, @drizzle-storage, @vault, @memory
292
+ - **Filesystem**: @filesystem, @local-filesystem, @browser-file-system, @s3
293
+ - **Research**: @research, @websearch, @wikipedia, @serper
294
+ - **Infrastructure**: @web-host, @cli, @cli-ink, @scheduler
295
+ - **Integration**: @mcp, @scripting, @tasks, @workflow
296
+ - **Audio/Video**: @audio, @linux-audio, @chrome
297
+ - **Utility**: @feedback, @queue, @cdn, @cloudquote, @scraperapi, @thinking
139
298
 
140
299
  ## Data Persistence
141
300
 
142
- Content data and sessions are stored in a SQLite database (`writer-database.sqlite`) managed through the Bun SQLite
143
- package.
301
+ Content data and sessions are stored in a SQLite database (`writer-database.sqlite`) managed through the Checkpoint service. The database is located in the `.tokenring` directory.
302
+
303
+ ## Environment Variables
304
+
305
+ The application requires various API keys for external services. Common environment variables include:
306
+
307
+ - `ANTHROPIC_API_KEY`: Anthropic API key
308
+ - `CEREBRAS_API_KEY`: Cerebras API key
309
+ - `DEEPSEEK_API_KEY`: DeepSeek API key
310
+ - `GOOGLE_GENERATIVE_AI_API_KEY`: Google Gemini API key
311
+ - `GROQ_API_KEY`: Groq API key
312
+ - `OPENAI_API_KEY`: OpenAI API key
313
+ - `PERPLEXITY_API_KEY`: Perplexity API key
314
+ - `XAI_API_KEY`: xAI API key
315
+ - `SERPER_API_KEY`: Serper API key
144
316
 
145
317
  ## Extensibility
146
318
 
147
319
  The system supports:
320
+
148
321
  - **Custom agents**: Define new agents with specific roles and capabilities.
149
- - **Multiple AI models**: Support for various providers (OpenAI, Anthropic, Google, etc.).
322
+ - **Multiple AI models**: Support for various providers (OpenAI, Anthropic, Google, Cerebras, DeepSeek, Groq, Perplexity, xAI).
150
323
  - **Service providers**: Pluggable services for file systems, web search, and content publishing.
151
324
  - **Tool integration**: Extensible tool system for agent capabilities.
325
+ - **UI customization**: Support for different UI frameworks and headless mode.
326
+ - **Publishing integrations**: Connect to WordPress, Ghost.io, Reddit, and other platforms.
327
+ - **Workflow automation**: Task scheduling and workflow management for automated content pipelines.
152
328
 
153
329
  ## Contributing
154
330
 
@@ -156,9 +332,4 @@ Contributions are welcome! Feel free to fork the repository and submit pull requ
156
332
 
157
333
  ## License
158
334
 
159
- This project is MIT licensed
160
-
161
- ---
162
-
163
- This README provides a high-level overview of the TokenRing Writer (tr-writer) functionality and usage. For detailed
164
- command usage, use `/help` inside the chat REPL.
335
+ MIT License - see [LICENSE](./LICENSE) file for details.