@tokenring-ai/writer 0.2.11 → 0.2.15

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/bin-wrapper.js ADDED
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env node
2
+ const { spawn } = require('child_process');
3
+
4
+ const platform = process.platform;
5
+ const arch = process.arch;
6
+
7
+ let packageName;
8
+ if (platform === 'darwin' && arch === 'arm64') {
9
+ packageName = '@tokenring-ai/writer-darwin-arm64';
10
+ } else if (platform === 'linux' && arch === 'x64') {
11
+ packageName = '@tokenring-ai/writer-linux-x64';
12
+ } else {
13
+ console.error(`Unsupported platform: ${platform}-${arch}`);
14
+ process.exit(1);
15
+ }
16
+
17
+ try {
18
+ const binary = require.resolve(`${packageName}/writer-${platform}-${arch}`);
19
+ const child = spawn(binary, process.argv.slice(2), { stdio: 'inherit' });
20
+ child.on('exit', (code) => process.exit(code));
21
+ } catch (e) {
22
+ console.error(`Failed to find ${packageName}. Please run: npm install ${packageName}`);
23
+ process.exit(1);
24
+ }
package/package.json CHANGED
@@ -1,81 +1,21 @@
1
1
  {
2
2
  "name": "@tokenring-ai/writer",
3
+ "version": "0.2.15",
3
4
  "description": "TokenRing Writer Application",
4
- "version": "0.2.11",
5
- "devDependencies": {
6
- "@inquirer/prompts": "^8.2.0",
7
- "@tokenring-ai/agent": "workspace:*",
8
- "@tokenring-ai/ai-client": "workspace:*",
9
- "@tokenring-ai/app": "workspace:*",
10
- "@tokenring-ai/blog": "workspace:*",
11
- "@tokenring-ai/cdn": "workspace:*",
12
- "@tokenring-ai/chat": "workspace:*",
13
- "@tokenring-ai/checkpoint": "workspace:*",
14
- "@tokenring-ai/chrome": "workspace:*",
15
- "@tokenring-ai/cli": "workspace:*",
16
- "@tokenring-ai/cli-ink": "workspace:*",
17
- "@tokenring-ai/cloudquote": "workspace:*",
18
- "@tokenring-ai/drizzle-storage": "workspace:*",
19
- "@tokenring-ai/feedback": "workspace:*",
20
- "@tokenring-ai/filesystem": "workspace:*",
21
- "@tokenring-ai/ghost-io": "workspace:*",
22
- "@tokenring-ai/image-generation": "workspace:*",
23
- "@tokenring-ai/kalshi": "workspace:*",
24
- "@tokenring-ai/local-filesystem": "workspace:*",
25
- "@tokenring-ai/polymarket": "workspace:*",
26
- "@tokenring-ai/mcp": "workspace:*",
27
- "@tokenring-ai/memory": "workspace:*",
28
- "@tokenring-ai/queue": "workspace:*",
29
- "@tokenring-ai/reddit": "workspace:*",
30
- "@tokenring-ai/research": "workspace:*",
31
- "@tokenring-ai/s3": "workspace:*",
32
- "@tokenring-ai/scheduler": "workspace:*",
33
- "@tokenring-ai/scraperapi": "workspace:*",
34
- "@tokenring-ai/scripting": "workspace:*",
35
- "@tokenring-ai/serper": "workspace:*",
36
- "@tokenring-ai/tasks": "workspace:*",
37
- "@tokenring-ai/template": "workspace:*",
38
- "@tokenring-ai/thinking": "workspace:*",
39
- "@tokenring-ai/utility": "workspace:*",
40
- "@tokenring-ai/web-host": "workspace:*",
41
- "@tokenring-ai/websearch": "workspace:*",
42
- "@tokenring-ai/wikipedia": "workspace:*",
43
- "@tokenring-ai/wordpress": "workspace:*",
44
- "@tokenring-ai/workflow": "workspace:*",
45
- "@tokenring-ai/vault": "workspace:*",
46
- "@types/bun": "catalog:",
47
- "bun-types": "catalog:",
48
- "chalk": "^5.6.2",
49
- "commander": "^14.0.2",
50
- "husky": "^9.1.7",
51
- "jsdom": "^27.4.0",
52
- "node-gyp": "^12.1.0",
53
- "typescript": "catalog:",
54
- "vitest": "catalog:",
55
- "zod": "catalog:"
56
- },
57
- "repository": {
58
- "type": "git",
59
- "url": "https://github.com/tokenring-ai/monorepo",
60
- "directory": "app/writer"
61
- },
62
5
  "license": "MIT",
63
6
  "bin": {
64
- "tr-writer": "dist/tr-writer"
7
+ "tr-writer": "bin-wrapper.js"
8
+ },
9
+ "optionalDependencies": {
10
+ "@tokenring-ai/writer-darwin-arm64": "0.2.15",
11
+ "@tokenring-ai/writer-linux-x64": "0.2.15"
65
12
  },
66
13
  "files": [
67
- "dist",
68
- "LICENSE",
69
- "README.md"
14
+ "bin-wrapper.js"
70
15
  ],
71
- "scripts": {
72
- "build": "bun build --compile --outfile=dist/tr-writer src/tr-writer.ts",
73
- "prepack": "bun run build && cp -Lr frontend dist",
74
- "writer": "bun src/tr-writer.js --source ./",
75
- "build-container": "docker build -t tr-writer:latest -f docker/Dockerfile .",
76
- "test": "vitest run",
77
- "test:watch": "vitest",
78
- "test:coverage": "vitest run --coverage"
79
- },
80
- "type": "module"
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "https://github.com/tokenring-ai/monorepo",
19
+ "directory": "app/writer"
20
+ }
81
21
  }
package/LICENSE DELETED
@@ -1,7 +0,0 @@
1
- Copyright (c) 2025 Mark Dierolf
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:
4
-
5
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
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.
package/README.md DELETED
@@ -1,335 +0,0 @@
1
- # TokenRing Writer (tr-writer)
2
-
3
- ## Overview
4
-
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.
6
-
7
- ## Features
8
-
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.
11
- - **Persistent content history**: Sessions and content drafts are saved in a SQLite database.
12
- - **Command system**: Issue commands prefixed with `/` to manage agents, content, and workflows.
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.
21
-
22
- ## Available Agents
23
-
24
- TokenRing Writer includes specialized AI agents for different content creation workflows:
25
-
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.
27
-
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.
29
-
30
- ## Getting Started
31
-
32
- ### Prerequisites
33
-
34
- - Bun (for local development)
35
- - Git initialized content directory
36
-
37
- ### Installation (Local Development)
38
-
39
- 1. **Sync git submodules**: This project uses git submodules that need to be initialized and updated before installation:
40
-
41
- ```bash
42
- git submodule update --init --recursive
43
- ```
44
-
45
- 2. **Install dependencies**: This project uses Bun as the package manager in a monorepo structure:
46
-
47
- ```bash
48
- bun install
49
- ```
50
-
51
- 3. **Run the application**: Use Bun to start the application:
52
-
53
- ```bash
54
- bun src/tr-writer.ts --source ./path-to-your-content
55
- ```
56
-
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:
77
-
78
- ```bash
79
- git submodule update --init --recursive
80
- ```
81
-
82
- 2. **Build the docker container**:
83
-
84
- ```bash
85
- # This command must be run in the root directory of the repo
86
- docker build -t tokenring-ai/writer:latest -f docker/Dockerfile .
87
- ```
88
-
89
- 3. **Run the docker container**:
90
-
91
- ```bash
92
- docker run -ti --net host $(env | grep '_KEY' | sed 's/^/-e /') -v ./:/repo:rw tokenring-ai/writer:latest
93
- ```
94
-
95
- #### Container Registry
96
-
97
- The Docker image is automatically built and published to GitHub Container Registry on version tags. Available tags:
98
-
99
- - `latest`: Latest stable release
100
- - `v*.*.*`: Specific version tags
101
- - `main`: Latest build from main branch
102
-
103
- ```bash
104
- docker pull ghcr.io/tokenring-ai/writer:latest
105
- ```
106
-
107
- ## Initialization
108
-
109
- To initialize your content directory with the necessary TokenRing configuration file, run:
110
-
111
- ```bash
112
- tr-writer --source ./path-to-your-content --initialize
113
- ```
114
-
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
224
-
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
255
-
256
- Once started, you enter the agent chat REPL:
257
-
258
- - Type natural language queries to interact with AI agents for content creation.
259
- - Use commands with `/` prefix, e.g., `/help`, `/agent switch writer`, `/tools enable`.
260
- - Switch between different agents specialized for writing, editing, research, and publishing.
261
- - Control commands: `/quit` to exit, `/agent list` to see available agents.
262
-
263
- ### Commands
264
-
265
- Some example commands:
266
-
267
- - `/help`: Show available commands.
268
- - `/agent list`: List available agents.
269
- - `/agent switch <name>`: Switch to a specific agent.
270
- - `/tools list`: Show available tools.
271
- - `/tools enable <pattern>`: Enable specific tools.
272
- - `/quit`: Exit the application.
273
-
274
- ## Architecture
275
-
276
- - **CLI**: Entry point with argument parsing and agent team initialization (`tr-writer.ts`).
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.
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
298
-
299
- ## Data Persistence
300
-
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
316
-
317
- ## Extensibility
318
-
319
- The system supports:
320
-
321
- - **Custom agents**: Define new agents with specific roles and capabilities.
322
- - **Multiple AI models**: Support for various providers (OpenAI, Anthropic, Google, Cerebras, DeepSeek, Groq, Perplexity, xAI).
323
- - **Service providers**: Pluggable services for file systems, web search, and content publishing.
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.
328
-
329
- ## Contributing
330
-
331
- Contributions are welcome! Feel free to fork the repository and submit pull requests.
332
-
333
- ## License
334
-
335
- MIT License - see [LICENSE](./LICENSE) file for details.