@tokenring-ai/writer 0.1.6

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 ADDED
@@ -0,0 +1,7 @@
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 ADDED
@@ -0,0 +1,140 @@
1
+ # TokenRing Writer (tr-writer)
2
+
3
+ ## Overview
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.
8
+
9
+ ## Features
10
+
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.
13
+ - **Persistent content history**: Sessions and content drafts are saved in a SQLite database.
14
+ - **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.
19
+
20
+ ## Getting Started
21
+
22
+ ### Prerequisites
23
+
24
+ - Bun
25
+ - Git initialized content directory
26
+
27
+ ### Installation (local)
28
+
29
+ 1. **Sync git submodules**: This project uses git submodules that need to be initialized and updated before
30
+ installation:
31
+ ```bash
32
+ git submodule update --init --recursive
33
+ ```
34
+
35
+ 2. **Install dependencies**: This project uses Bun as the package manager in a monorepo structure:
36
+ ```bash
37
+ bun install
38
+ ```
39
+
40
+ 3. **Run the application**: Use Bun to start the application:
41
+
42
+ ```bash
43
+ bun src/tr-writer.ts --source ./path-to-your-content
44
+ ```
45
+
46
+ ### Installation (As local docker container)
47
+
48
+ 1. **Sync git submodules**: This project uses git submodules that need to be initialized and updated before
49
+ installation:
50
+ ```bash
51
+ git submodule update --init --recursive
52
+ ```
53
+
54
+ 2. **Build the docker container**:
55
+ ```bash
56
+ # This command must be run in the root directory of the repo
57
+ docker build -t token-ring/writer:latest -f docker/Dockerfile .
58
+ ```
59
+
60
+ 3. **Run the docker container**:
61
+ ```bash
62
+ docker run -ti --net host $(env | grep '_KEY' | sed 's/^/-e /') -v ./:/repo:rw token-ring/writer:latest
63
+ ```
64
+
65
+ #### Container Registry
66
+
67
+ TODO: This is not implemented yet
68
+ The Docker image is automatically built and published to GitHub Container Registry on each push to the main branch. You
69
+ can pull the latest image with:
70
+
71
+ ```bash
72
+ docker pull ghcr.io/[owner]/tokenring-writer:latest
73
+ ```
74
+
75
+ Replace `[owner]` with the GitHub repository owner.
76
+
77
+ ### Initialization
78
+
79
+ To initialize your content directory with the necessary TokenRing configuration file, pass the --initialize flag after
80
+ your content directory.
81
+ This will initialize a new .tokenring directory in your project, which stores a writer-config.js config file for your
82
+ project that you can customize, as well as a sqlite database which stores your content history.
83
+
84
+ ```
85
+ tr-writer --source ./path-to-your-content --initialize
86
+ ```
87
+
88
+ This copies a default `.tokenring/writer-config.js` into your content directory.
89
+
90
+ ### Chat and Commands
91
+
92
+ Once started, you enter the agent chat REPL:
93
+
94
+ - Type natural language queries to interact with AI agents for content creation.
95
+ - Use commands with `/` prefix, e.g., `/help`, `/agent switch writer`, `/tools enable`.
96
+ - Switch between different agents specialized for writing, editing, research, and publishing.
97
+ - Control commands: `/quit` to exit, `/agent list` to see available agents.
98
+
99
+ ### Commands
100
+
101
+ Some example commands:
102
+
103
+ - `/help`: Show available commands.
104
+ - `/agent list`: List available agents.
105
+ - `/agent switch <name>`: Switch to a specific agent.
106
+ - `/tools list`: Show available tools.
107
+ - `/tools enable <pattern>`: Enable specific tools.
108
+
109
+ ## Architecture
110
+
111
+ - **CLI**: Entry point with argument parsing and agent team initialization (`tr-writer.ts`).
112
+ - **Agents**: Specialized AI agents for different content creation tasks (writer, editor, researcher, publisher).
113
+ - **Services**: Core services for file system, web search, models, and database management.
114
+ - **Configuration**: Flexible configuration system supporting multiple models and services.
115
+
116
+ ## Data Persistence
117
+
118
+ Content data and sessions are stored in a SQLite database (`writer-database.sqlite`) managed through the Bun SQLite
119
+ package.
120
+
121
+ ## Extensibility
122
+
123
+ The system supports:
124
+ - **Custom agents**: Define new agents with specific roles and capabilities.
125
+ - **Multiple AI models**: Support for various providers (OpenAI, Anthropic, Google, etc.).
126
+ - **Service providers**: Pluggable services for file systems, web search, and content publishing.
127
+ - **Tool integration**: Extensible tool system for agent capabilities.
128
+
129
+ ## Contributing
130
+
131
+ Contributions are welcome! Feel free to fork the repository and submit pull requests.
132
+
133
+ ## License
134
+
135
+ This project is MIT licensed
136
+
137
+ ---
138
+
139
+ This README provides a high-level overview of the TokenRing Writer (tr-writer) functionality and usage. For detailed
140
+ command usage, use `/help` inside the chat REPL.
package/dist/tr-writer ADDED
Binary file
package/package.json ADDED
@@ -0,0 +1,64 @@
1
+ {
2
+ "name": "@tokenring-ai/writer",
3
+ "description": "TokenRing Writer Application",
4
+ "version": "0.1.6",
5
+ "dependencies": {
6
+ "@dotenvx/dotenvx": "^1.48.4",
7
+ "@inquirer/prompts": "^7.8.1",
8
+ "@tokenring-ai/ai-client": "0.1.0",
9
+ "@tokenring-ai/blog": "0.1.0",
10
+ "@tokenring-ai/agent": "0.1.0",
11
+ "@tokenring-ai/chrome": "0.1.0",
12
+ "@tokenring-ai/checkpoint": "0.1.0",
13
+ "@tokenring-ai/cli": "0.1.0",
14
+ "@tokenring-ai/cloudquote": "0.1.0",
15
+ "@tokenring-ai/feedback": "0.1.0",
16
+ "@tokenring-ai/ghost-io": "0.1.0",
17
+ "@tokenring-ai/local-filesystem": "0.1.0",
18
+ "@tokenring-ai/mcp": "0.1.0",
19
+ "@tokenring-ai/memory": "0.1.0",
20
+ "@tokenring-ai/queue": "0.1.0",
21
+ "@tokenring-ai/tasks": "0.1.0",
22
+ "@tokenring-ai/reddit": "0.1.0",
23
+ "@tokenring-ai/s3": "0.1.0",
24
+ "@tokenring-ai/scripting": "0.1.0",
25
+ "@tokenring-ai/sqlite-storage": "0.1.0",
26
+ "@tokenring-ai/template": "0.1.0",
27
+ "@tokenring-ai/wikipedia": "0.1.0",
28
+ "commander": "^14.0.0",
29
+ "path-browserify": "^1.0.1"
30
+ },
31
+ "devDependencies": {
32
+ "@biomejs/biome": "^2.2.0",
33
+ "husky": "^9.1.7",
34
+ "jsdom": "^26.1.0",
35
+ "node-gyp": "^11.3.0",
36
+ "trufflehog": "^0.0.5",
37
+ "ts": "^0.2.2",
38
+ "vitest": "^3.2.4"
39
+ },
40
+ "license": "MIT",
41
+ "bin": {
42
+ "tr-writer": "./dist/tr-writer"
43
+ },
44
+ "files": [
45
+ "dist",
46
+ "LICENSE",
47
+ "README.md"
48
+ ],
49
+ "scripts": {
50
+ "build": "bun build --compile --outfile=dist/tr-writer src/tr-writer.ts",
51
+ "prepublishOnly": "bun run build",
52
+ "build-container": "docker build -t tokenring-ai/coder:latest -f docker/Dockerfile .",
53
+ "coder": "bun ../tokenring-coder/src/tr-coder.js --source ./",
54
+ "test": "vitest run",
55
+ "prepare": "husky",
56
+ "biome": "biome format --fix",
57
+ "update-all-dependencies-latest": "git submodule foreach npx npm-check-updates -u",
58
+ "release:patch": "NEWVERSION=`bun pm version patch` && git add package.json && git commit -m \"Bump version to ${NEWVERSION}\" && git tag ${NEWVERSION} && git submodule foreach git push && git push && git push --tags"
59
+ },
60
+ "type": "module",
61
+ "workspaces": [
62
+ "pkg/*"
63
+ ]
64
+ }