workthin 1.0.0 → 1.0.2
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 +21 -0
- package/README.md +11 -118
- package/README.npm.md +39 -0
- package/README.repo.md +146 -0
- package/dist/cli/index.js +118 -118
- package/package.json +43 -22
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 workthin
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -2,30 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Knowledge vaccination for AI. Turn every solved problem into a reusable vaccine. One project's experience becomes everyone's immunity.
|
|
4
4
|
|
|
5
|
-
**[workthin.app](https://workthin.app)** | **[Docs](https://workthin.app/docs)** | **[Pricing](https://workthin.app/pricing)**
|
|
6
|
-
|
|
7
|
-
## What is workthin?
|
|
8
|
-
|
|
9
|
-
workthin captures problem→solution knowledge from AI conversations and makes it searchable across your team. When an AI tool encounters a problem someone already solved, workthin provides the answer instantly — reducing token costs by up to 90%.
|
|
10
|
-
|
|
11
|
-
### How it works
|
|
12
|
-
|
|
13
|
-
1. **Capture** — AI work logs are structured into problem → environment → attempts → solution. Secrets are masked automatically.
|
|
14
|
-
2. **Search** — Semantic vector search in milliseconds. Three detail levels: L1 (~100 tokens), L2 (~500), L3 (~2,000).
|
|
15
|
-
3. **Immunize** — Each resolve strengthens the vaccine. Escalation rates drop weekly. Knowledge compounds.
|
|
16
|
-
|
|
17
|
-
## Features
|
|
18
|
-
|
|
19
|
-
- **MCP Server** — Works with Claude Code, Claude Desktop, ChatGPT, Cursor, VS Code / GitHub Copilot, Codex CLI, GitHub Copilot CLI, Gemini CLI, and any MCP-compatible tool
|
|
20
|
-
- **CLI** — `wt search`, `wt create`, `wt init`, `wt hooks` for terminal-native workflows
|
|
21
|
-
- **Automatic Hooks** — `wt hooks` sets up SessionStart search and Stop/SessionEnd capture reminders for all major AI tools
|
|
22
|
-
- **REST API** — Full CRUD + semantic search via Bearer token auth
|
|
23
|
-
- **OAuth 2.1** — PKCE, dynamic client registration, JWT access tokens
|
|
24
|
-
- **3-Stage Secret Protection** — Regex patterns + Shannon entropy + AI classification
|
|
25
|
-
- **Scope System** — Personal, project, and global knowledge visibility
|
|
26
|
-
- **Knowledge Chains** — Link related solutions, fork and branch knowledge
|
|
27
|
-
- **Contributor Rewards** — Track who creates the most valuable vaccines
|
|
28
|
-
|
|
29
5
|
## Quick Start
|
|
30
6
|
|
|
31
7
|
```bash
|
|
@@ -34,6 +10,8 @@ npx workthin@latest init
|
|
|
34
10
|
|
|
35
11
|
One command handles authentication, project detection, MCP configuration, hooks setup, and optional global CLI install.
|
|
36
12
|
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
37
15
|
```bash
|
|
38
16
|
# Search existing knowledge
|
|
39
17
|
wt search "supabase timeout"
|
|
@@ -41,106 +19,21 @@ wt search "supabase timeout"
|
|
|
41
19
|
# Create new knowledge
|
|
42
20
|
wt create "Fix: Edge Functions timeout at 30s" \
|
|
43
21
|
--body "Set function timeout to 150s in supabase/config.toml"
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
## Tech Stack
|
|
47
22
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
| Framework | Next.js 16 (App Router, React 19, Turbopack) |
|
|
51
|
-
| Language | TypeScript 5.9 |
|
|
52
|
-
| UI | Tailwind CSS 4, DaisyUI 5 |
|
|
53
|
-
| API | Hono (Valibot validation) |
|
|
54
|
-
| Database | Supabase (PostgreSQL + pgvector + RLS) |
|
|
55
|
-
| Auth | Supabase Auth (Google OAuth, GitHub OAuth, Magic Link) |
|
|
56
|
-
| AI | OpenAI GPT-5-mini (structuring, tagging, classification) |
|
|
57
|
-
| Embeddings | text-embedding-3-small (1536 dimensions) |
|
|
58
|
-
| Payment | Stripe (subscriptions + webhook) |
|
|
59
|
-
| MCP | Model Context Protocol (HTTP transport, OAuth 2.1) |
|
|
60
|
-
| Rate Limiting | Upstash Redis |
|
|
61
|
-
| Error Tracking | Sentry |
|
|
62
|
-
| Analytics | PostHog, Vercel Analytics |
|
|
63
|
-
| Lint / Format | Biome |
|
|
64
|
-
| Test | Vitest (970 tests, 92% line coverage) |
|
|
65
|
-
| Docs | Fumadocs |
|
|
66
|
-
|
|
67
|
-
## Architecture
|
|
68
|
-
|
|
69
|
-
```
|
|
70
|
-
src/
|
|
71
|
-
├── app/ # Next.js App Router
|
|
72
|
-
│ ├── (marketing)/ # Landing, pricing, legal pages
|
|
73
|
-
│ ├── (dashboard)/app/ # Dashboard (SSR + Client Components)
|
|
74
|
-
│ ├── (auth)/ # Sign in (Magic Link + OAuth)
|
|
75
|
-
│ ├── api/
|
|
76
|
-
│ │ ├── [[...route]]/ # Hono API catch-all
|
|
77
|
-
│ │ ├── routes/ # REST API (knowledge, search, auth, stripe)
|
|
78
|
-
│ │ └── mcp/ # MCP HTTP endpoint + tools
|
|
79
|
-
│ ├── oauth/ # OAuth 2.1 (authorize, token, register)
|
|
80
|
-
│ └── .well-known/ # OAuth discovery endpoints
|
|
81
|
-
├── core/
|
|
82
|
-
│ ├── knowledge/ # CRUD, search, chain, check, resolve
|
|
83
|
-
│ ├── protection/ # 3-stage secret masking pipeline
|
|
84
|
-
│ ├── structuring/ # AI structuring, tagging, embedding
|
|
85
|
-
│ ├── oauth/ # JWT, tokens, codes, clients
|
|
86
|
-
│ └── auth/ # API keys, device code flow
|
|
87
|
-
├── lib/
|
|
88
|
-
│ ├── supabase/ # Server/admin clients, queries, actions
|
|
89
|
-
│ ├── stripe/ # Subscription management
|
|
90
|
-
│ └── format.ts # Shared utilities
|
|
91
|
-
├── cli/ # CLI commands (init, login, search, create, hooks)
|
|
92
|
-
└── components/ # UI components
|
|
23
|
+
# Set up hooks for auto-search/capture
|
|
24
|
+
wt hooks
|
|
93
25
|
```
|
|
94
26
|
|
|
95
|
-
##
|
|
96
|
-
|
|
97
|
-
### Prerequisites
|
|
98
|
-
|
|
99
|
-
- [Bun](https://bun.sh/) (runtime + package manager)
|
|
100
|
-
- [Supabase CLI](https://supabase.com/docs/guides/cli) (local DB)
|
|
101
|
-
|
|
102
|
-
### Setup
|
|
103
|
-
|
|
104
|
-
```bash
|
|
105
|
-
bun install
|
|
106
|
-
cp .env.example .env # Fill in required values
|
|
107
|
-
bun run supabase:start
|
|
108
|
-
bun run supabase:reset
|
|
109
|
-
bun run dev # http://localhost:3001
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
### Commands
|
|
113
|
-
|
|
114
|
-
```bash
|
|
115
|
-
bun run dev # Dev server (port 3001)
|
|
116
|
-
bun run build # Production build
|
|
117
|
-
bun run test # Vitest + coverage (85% threshold)
|
|
118
|
-
bun run lint # Biome check + format
|
|
119
|
-
bun run type-check # TypeScript strict check
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
### Environment Variables
|
|
123
|
-
|
|
124
|
-
See [`.env.example`](.env.example) for the full list. Required:
|
|
27
|
+
## Supported AI Tools
|
|
125
28
|
|
|
126
|
-
|
|
127
|
-
|----------|---------|
|
|
128
|
-
| `NEXT_PUBLIC_SUPABASE_URL` | Supabase |
|
|
129
|
-
| `NEXT_PUBLIC_SUPABASE_PUBLIC_KEY` | Supabase |
|
|
130
|
-
| `SUPABASE_SECRET_KEY` | Supabase |
|
|
131
|
-
| `OPENAI_API_KEY` | OpenAI |
|
|
132
|
-
| `UPSTASH_REDIS_REST_URL` / `TOKEN` | Upstash |
|
|
29
|
+
Claude Code, Claude Desktop, ChatGPT, Cursor, VS Code / GitHub Copilot, OpenAI Codex CLI, GitHub Copilot CLI, Gemini CLI, and any other MCP-compatible tool.
|
|
133
30
|
|
|
134
|
-
##
|
|
31
|
+
## Links
|
|
135
32
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
| Global reads | 30 / month | Unlimited |
|
|
140
|
-
| CLI + MCP | Yes | Yes |
|
|
141
|
-
| Secret protection | Yes | Yes |
|
|
142
|
-
| Custom security rules | — | Yes |
|
|
33
|
+
- [Documentation](https://workthin.app/docs)
|
|
34
|
+
- [Quick Start Guide](https://workthin.app/docs/quick-start)
|
|
35
|
+
- [Pricing](https://workthin.app/pricing)
|
|
143
36
|
|
|
144
37
|
## License
|
|
145
38
|
|
|
146
|
-
|
|
39
|
+
MIT
|
package/README.npm.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# workthin
|
|
2
|
+
|
|
3
|
+
Knowledge vaccination for AI. Turn every solved problem into a reusable vaccine. One project's experience becomes everyone's immunity.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npx workthin@latest init
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
One command handles authentication, project detection, MCP configuration, hooks setup, and optional global CLI install.
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# Search existing knowledge
|
|
17
|
+
wt search "supabase timeout"
|
|
18
|
+
|
|
19
|
+
# Create new knowledge
|
|
20
|
+
wt create "Fix: Edge Functions timeout at 30s" \
|
|
21
|
+
--body "Set function timeout to 150s in supabase/config.toml"
|
|
22
|
+
|
|
23
|
+
# Set up hooks for auto-search/capture
|
|
24
|
+
wt hooks
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Supported AI Tools
|
|
28
|
+
|
|
29
|
+
Claude Code, Claude Desktop, ChatGPT, Cursor, VS Code / GitHub Copilot, OpenAI Codex CLI, GitHub Copilot CLI, Gemini CLI, and any other MCP-compatible tool.
|
|
30
|
+
|
|
31
|
+
## Links
|
|
32
|
+
|
|
33
|
+
- [Documentation](https://workthin.app/docs)
|
|
34
|
+
- [Quick Start Guide](https://workthin.app/docs/quick-start)
|
|
35
|
+
- [Pricing](https://workthin.app/pricing)
|
|
36
|
+
|
|
37
|
+
## License
|
|
38
|
+
|
|
39
|
+
MIT
|
package/README.repo.md
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
# workthin
|
|
2
|
+
|
|
3
|
+
Knowledge vaccination for AI. Turn every solved problem into a reusable vaccine. One project's experience becomes everyone's immunity.
|
|
4
|
+
|
|
5
|
+
**[workthin.app](https://workthin.app)** | **[Docs](https://workthin.app/docs)** | **[Pricing](https://workthin.app/pricing)**
|
|
6
|
+
|
|
7
|
+
## What is workthin?
|
|
8
|
+
|
|
9
|
+
workthin captures problem→solution knowledge from AI conversations and makes it searchable across your team. When an AI tool encounters a problem someone already solved, workthin provides the answer instantly — reducing token costs by up to 90%.
|
|
10
|
+
|
|
11
|
+
### How it works
|
|
12
|
+
|
|
13
|
+
1. **Capture** — AI work logs are structured into problem → environment → attempts → solution. Secrets are masked automatically.
|
|
14
|
+
2. **Search** — Semantic vector search in milliseconds. Three detail levels: L1 (~100 tokens), L2 (~500), L3 (~2,000).
|
|
15
|
+
3. **Immunize** — Each resolve strengthens the vaccine. Escalation rates drop weekly. Knowledge compounds.
|
|
16
|
+
|
|
17
|
+
## Features
|
|
18
|
+
|
|
19
|
+
- **MCP Server** — Works with Claude Code, Claude Desktop, ChatGPT, Cursor, VS Code / GitHub Copilot, Codex CLI, GitHub Copilot CLI, Gemini CLI, and any MCP-compatible tool
|
|
20
|
+
- **CLI** — `wt search`, `wt create`, `wt init`, `wt hooks` for terminal-native workflows
|
|
21
|
+
- **Automatic Hooks** — `wt hooks` sets up SessionStart search and Stop/SessionEnd capture reminders for all major AI tools
|
|
22
|
+
- **REST API** — Full CRUD + semantic search via Bearer token auth
|
|
23
|
+
- **OAuth 2.1** — PKCE, dynamic client registration, JWT access tokens
|
|
24
|
+
- **3-Stage Secret Protection** — Regex patterns + Shannon entropy + AI classification
|
|
25
|
+
- **Scope System** — Personal, project, and global knowledge visibility
|
|
26
|
+
- **Knowledge Chains** — Link related solutions, fork and branch knowledge
|
|
27
|
+
- **Contributor Rewards** — Track who creates the most valuable vaccines
|
|
28
|
+
|
|
29
|
+
## Quick Start
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npx workthin@latest init
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
One command handles authentication, project detection, MCP configuration, hooks setup, and optional global CLI install.
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
# Search existing knowledge
|
|
39
|
+
wt search "supabase timeout"
|
|
40
|
+
|
|
41
|
+
# Create new knowledge
|
|
42
|
+
wt create "Fix: Edge Functions timeout at 30s" \
|
|
43
|
+
--body "Set function timeout to 150s in supabase/config.toml"
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Tech Stack
|
|
47
|
+
|
|
48
|
+
| Category | Technology |
|
|
49
|
+
|----------|-----------|
|
|
50
|
+
| Framework | Next.js 16 (App Router, React 19, Turbopack) |
|
|
51
|
+
| Language | TypeScript 5.9 |
|
|
52
|
+
| UI | Tailwind CSS 4, DaisyUI 5 |
|
|
53
|
+
| API | Hono (Valibot validation) |
|
|
54
|
+
| Database | Supabase (PostgreSQL + pgvector + RLS) |
|
|
55
|
+
| Auth | Supabase Auth (Google OAuth, GitHub OAuth, Magic Link) |
|
|
56
|
+
| AI | OpenAI GPT-5-mini (structuring, tagging, classification) |
|
|
57
|
+
| Embeddings | text-embedding-3-small (1536 dimensions) |
|
|
58
|
+
| Payment | Stripe (subscriptions + webhook) |
|
|
59
|
+
| MCP | Model Context Protocol (HTTP transport, OAuth 2.1) |
|
|
60
|
+
| Rate Limiting | Upstash Redis |
|
|
61
|
+
| Error Tracking | Sentry |
|
|
62
|
+
| Analytics | PostHog, Vercel Analytics |
|
|
63
|
+
| Lint / Format | Biome |
|
|
64
|
+
| Test | Vitest (970 tests, 92% line coverage) |
|
|
65
|
+
| Docs | Fumadocs |
|
|
66
|
+
|
|
67
|
+
## Architecture
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
src/
|
|
71
|
+
├── app/ # Next.js App Router
|
|
72
|
+
│ ├── (marketing)/ # Landing, pricing, legal pages
|
|
73
|
+
│ ├── (dashboard)/app/ # Dashboard (SSR + Client Components)
|
|
74
|
+
│ ├── (auth)/ # Sign in (Magic Link + OAuth)
|
|
75
|
+
│ ├── api/
|
|
76
|
+
│ │ ├── [[...route]]/ # Hono API catch-all
|
|
77
|
+
│ │ ├── routes/ # REST API (knowledge, search, auth, stripe)
|
|
78
|
+
│ │ └── mcp/ # MCP HTTP endpoint + tools
|
|
79
|
+
│ ├── oauth/ # OAuth 2.1 (authorize, token, register)
|
|
80
|
+
│ └── .well-known/ # OAuth discovery endpoints
|
|
81
|
+
├── core/
|
|
82
|
+
│ ├── knowledge/ # CRUD, search, chain, check, resolve
|
|
83
|
+
│ ├── protection/ # 3-stage secret masking pipeline
|
|
84
|
+
│ ├── structuring/ # AI structuring, tagging, embedding
|
|
85
|
+
│ ├── oauth/ # JWT, tokens, codes, clients
|
|
86
|
+
│ └── auth/ # API keys, device code flow
|
|
87
|
+
├── lib/
|
|
88
|
+
│ ├── supabase/ # Server/admin clients, queries, actions
|
|
89
|
+
│ ├── stripe/ # Subscription management
|
|
90
|
+
│ └── format.ts # Shared utilities
|
|
91
|
+
├── cli/ # CLI commands (init, login, search, create, hooks)
|
|
92
|
+
└── components/ # UI components
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Development
|
|
96
|
+
|
|
97
|
+
### Prerequisites
|
|
98
|
+
|
|
99
|
+
- [Bun](https://bun.sh/) (runtime + package manager)
|
|
100
|
+
- [Supabase CLI](https://supabase.com/docs/guides/cli) (local DB)
|
|
101
|
+
|
|
102
|
+
### Setup
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
bun install
|
|
106
|
+
cp .env.example .env # Fill in required values
|
|
107
|
+
bun run supabase:start
|
|
108
|
+
bun run supabase:reset
|
|
109
|
+
bun run dev # http://localhost:3001
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Commands
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
bun run dev # Dev server (port 3001)
|
|
116
|
+
bun run build # Production build
|
|
117
|
+
bun run test # Vitest + coverage (85% threshold)
|
|
118
|
+
bun run lint # Biome check + format
|
|
119
|
+
bun run type-check # TypeScript strict check
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Environment Variables
|
|
123
|
+
|
|
124
|
+
See [`.env.example`](.env.example) for the full list. Required:
|
|
125
|
+
|
|
126
|
+
| Variable | Service |
|
|
127
|
+
|----------|---------|
|
|
128
|
+
| `NEXT_PUBLIC_SUPABASE_URL` | Supabase |
|
|
129
|
+
| `NEXT_PUBLIC_SUPABASE_PUBLIC_KEY` | Supabase |
|
|
130
|
+
| `SUPABASE_SECRET_KEY` | Supabase |
|
|
131
|
+
| `OPENAI_API_KEY` | OpenAI |
|
|
132
|
+
| `UPSTASH_REDIS_REST_URL` / `TOKEN` | Upstash |
|
|
133
|
+
|
|
134
|
+
## Plans
|
|
135
|
+
|
|
136
|
+
| | Free | Pro |
|
|
137
|
+
|--|------|-----|
|
|
138
|
+
| Knowledge storage | Unlimited | Unlimited |
|
|
139
|
+
| Global reads | 30 / month | Unlimited |
|
|
140
|
+
| CLI + MCP | Yes | Yes |
|
|
141
|
+
| Secret protection | Yes | Yes |
|
|
142
|
+
| Custom security rules | — | Yes |
|
|
143
|
+
|
|
144
|
+
## License
|
|
145
|
+
|
|
146
|
+
MIT
|