workspai 0.46.0 → 0.47.0
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/README.md +61 -12
- package/contracts/agent-customization-pack.v1.json +6 -1
- package/contracts/bootstrap-compliance.v1.json +14 -0
- package/contracts/cli-runtime-command-inventory.v1.snapshot.json +4 -0
- package/contracts/extension-cli-compatibility.v1.json +7 -1
- package/contracts/mirror-ops.v1.json +16 -0
- package/contracts/published-contract-catalog.v1.json +31 -0
- package/contracts/runtime-command-surface.v1.json +149 -1
- package/contracts/transparency-evidence.v1.json +13 -0
- package/contracts/workspace-contract.v1.json +78 -0
- package/contracts/workspace-intelligence/workspace-context.v1.json +20 -0
- package/contracts/workspace-intelligence/workspace-graph-token-efficiency.v1.json +72 -0
- package/contracts/workspace-intelligence/workspace-intelligence-run.v1.json +6 -1
- package/contracts/workspace-intelligence/workspace-knowledge-graph-change-overlay.v1.json +200 -0
- package/contracts/workspace-intelligence/workspace-knowledge-graph.v1.json +260 -0
- package/contracts/workspace-intelligence/workspace-knowledge-search.v1.json +60 -0
- package/contracts/workspace-intelligence-architecture.v1.json +6 -3
- package/contracts/workspace-intelligence-chain.v1.json +14 -3
- package/contracts/workspace-share-bundle.v1.json +16 -0
- package/dist/analyze-UVXPRGYZ.js +1 -0
- package/dist/artifact-remediation-plan-EPALZ2LC.js +3 -0
- package/dist/autopilot-release-5BQ6F5L2.js +1 -0
- package/dist/chunk-22NJ2ZMG.js +2 -0
- package/dist/{chunk-UQWOVV6V.js → chunk-2GHUZDYA.js} +1 -1
- package/dist/chunk-2TEDAKP6.js +2 -0
- package/dist/chunk-6SWRNA47.js +4 -0
- package/dist/chunk-76YOPAOT.js +1 -0
- package/dist/chunk-7VLCK5JW.js +1 -0
- package/dist/{chunk-J5PIZCAU.js → chunk-BSRVO52Y.js} +1 -1
- package/dist/chunk-COARSXRC.js +1 -0
- package/dist/chunk-CV5HKU4P.js +1 -0
- package/dist/chunk-CW7PGBIQ.js +13 -0
- package/dist/{chunk-WPEEC5BX.js → chunk-DV6GJD4K.js} +1 -1
- package/dist/chunk-FB7SCXAZ.js +1 -0
- package/dist/{chunk-4LGXSBCN.js → chunk-HSGFUKCN.js} +1 -1
- package/dist/{chunk-ZKAI3PJE.js → chunk-ITCAMC2E.js} +1 -1
- package/dist/chunk-KB44JP4M.js +2 -0
- package/dist/{chunk-QA5BGEQW.js → chunk-KZZ36CK5.js} +1 -1
- package/dist/chunk-LNRAB7UY.js +1 -0
- package/dist/{chunk-VFDM65IE.js → chunk-MEMHNE7Y.js} +22 -22
- package/dist/chunk-NOFM7MNA.js +2 -0
- package/dist/chunk-NRYS4CLR.js +2 -0
- package/dist/chunk-OA537ZQ5.js +1 -0
- package/dist/chunk-PBHP6JNY.js +8 -0
- package/dist/chunk-QDWYIRHR.js +8 -0
- package/dist/chunk-RWRLFSKW.js +2 -0
- package/dist/chunk-SK6XRKGG.js +1 -0
- package/dist/chunk-THIOE2PB.js +2 -0
- package/dist/chunk-TNQI5VCW.js +36 -0
- package/dist/chunk-TWNFECMN.js +2 -0
- package/dist/{chunk-6IIZJQLV.js → chunk-U5EZHZBX.js} +1 -1
- package/dist/{chunk-YUATNVOT.js → chunk-VBSQ7MF6.js} +19 -19
- package/dist/chunk-WDKNMTJQ.js +1 -0
- package/dist/chunk-YCL3I2JO.js +2 -0
- package/dist/chunk-ZDN7RHXJ.js +1 -0
- package/dist/chunk-ZM5NQ5Z2.js +1 -0
- package/dist/{create-WCV3L6XH.js → create-7JKJDAQV.js} +1 -1
- package/dist/{doctor-5BWM2EMJ.js → doctor-PGPNIS76.js} +1 -1
- package/dist/index.d.ts +33 -12
- package/dist/index.js +317 -317
- package/dist/pipeline-IB6ILJSV.js +5 -0
- package/dist/{workspace-7OXW5YTJ.js → workspace-H3QXBFGB.js} +1 -1
- package/dist/{workspace-agent-sync-O4IA6VOA.js → workspace-agent-sync-C7SG2Z5W.js} +1 -1
- package/dist/{workspace-archive-H74NBBNW.js → workspace-archive-P76EDIUG.js} +1 -1
- package/dist/{workspace-context-R7IPUBPG.js → workspace-context-BKQBKA4C.js} +1 -1
- package/dist/workspace-contract-RPQQBQXR.js +1 -0
- package/dist/workspace-dependency-graph-23BI2HG7.js +1 -0
- package/dist/workspace-explain-WVN7JH3U.js +1 -0
- package/dist/{workspace-explain-contract-SVFJAAEI.js → workspace-explain-contract-SEFTVF6J.js} +1 -1
- package/dist/{workspace-feedback-REOS36ZZ.js → workspace-feedback-WAID3IOE.js} +1 -1
- package/dist/{workspace-foundation-KXT4QI5O.js → workspace-foundation-5OOJEO2D.js} +1 -1
- package/dist/workspace-graph-token-efficiency-CFGFCJ5V.js +1 -0
- package/dist/{workspace-history-OGOVSKZG.js → workspace-history-C6OP3IAQ.js} +1 -1
- package/dist/workspace-intelligence-VKDL3H2J.js +1 -0
- package/dist/workspace-intelligence-runner-LVALAZY7.js +1 -0
- package/dist/workspace-knowledge-graph-FE2NTZKV.js +1 -0
- package/dist/workspace-knowledge-graph-change-overlay-XG6FC4IX.js +1 -0
- package/dist/workspace-knowledge-graph-query-VOSPPH4W.js +1 -0
- package/dist/workspace-mcp-serve-KT2I676Z.js +3 -0
- package/dist/workspace-model-S33CIB2R.js +1 -0
- package/dist/workspace-model-hash-MHXK5MEI.js +1 -0
- package/dist/{workspace-registry-summary-SZ46R5PD.js → workspace-registry-summary-A3YDL63D.js} +1 -1
- package/dist/workspace-run-M4LNJILC.js +1 -0
- package/dist/{workspace-verify-MFQ7IXGD.js → workspace-verify-ZGH3NXAH.js} +1 -1
- package/dist/workspace-watch-EVBJTMV7.js +1 -0
- package/docs/AI_DYNAMIC_INTEGRATION.md +73 -428
- package/docs/AI_EXAMPLES.md +37 -395
- package/docs/AI_FEATURES.md +76 -456
- package/docs/AI_QUICKSTART.md +49 -212
- package/docs/GLOSSARY.md +60 -0
- package/docs/OPEN_SOURCE_USER_SCENARIOS.md +68 -7
- package/docs/README.md +63 -41
- package/docs/commands-reference.md +51 -4
- package/docs/config-file-guide.md +6 -2
- package/docs/contracts/ARTIFACT_CATALOG.md +67 -37
- package/docs/contracts/README.md +44 -8
- package/docs/graph-benchmark-methodology.md +121 -0
- package/docs/workspace-knowledge-graph.md +295 -0
- package/docs/workspace-operations.md +49 -0
- package/package.json +2 -1
- package/dist/analyze-BEBEZSZK.js +0 -1
- package/dist/artifact-remediation-plan-FFQSESAM.js +0 -3
- package/dist/autopilot-release-WUR4CQIT.js +0 -1
- package/dist/chunk-2G7FASAO.js +0 -2
- package/dist/chunk-4EPHWD27.js +0 -8
- package/dist/chunk-CVHMUSRX.js +0 -1
- package/dist/chunk-DIPD72H4.js +0 -2
- package/dist/chunk-EFYHGCGX.js +0 -2
- package/dist/chunk-FWRXA435.js +0 -2
- package/dist/chunk-HDURFXW5.js +0 -2
- package/dist/chunk-HMUKBW2S.js +0 -4
- package/dist/chunk-K4WNYXKK.js +0 -33
- package/dist/chunk-LG6RFLPZ.js +0 -1
- package/dist/chunk-N7DV5L7C.js +0 -1
- package/dist/chunk-PRBVYW3T.js +0 -1
- package/dist/chunk-QZLIURER.js +0 -13
- package/dist/chunk-RIEF2DDX.js +0 -8
- package/dist/chunk-SXMTSV5M.js +0 -1
- package/dist/chunk-SXPY523X.js +0 -1
- package/dist/chunk-V3LRQZ36.js +0 -1
- package/dist/chunk-WYFPXTTS.js +0 -2
- package/dist/pipeline-ORIWVVYM.js +0 -5
- package/dist/workspace-contract-HKCMOMFE.js +0 -1
- package/dist/workspace-explain-GOPQYTPQ.js +0 -1
- package/dist/workspace-intelligence-7IESQSXY.js +0 -1
- package/dist/workspace-intelligence-runner-6GJ5M4HB.js +0 -1
- package/dist/workspace-mcp-serve-FRVWBO36.js +0 -3
- package/dist/workspace-model-PPYX7B4S.js +0 -1
- package/dist/workspace-run-V3KKHTVF.js +0 -1
- package/dist/workspace-watch-SOPZHRWA.js +0 -1
package/docs/AI_FEATURES.md
CHANGED
|
@@ -1,484 +1,104 @@
|
|
|
1
|
-
#
|
|
1
|
+
# AI Module Recommender
|
|
2
2
|
|
|
3
|
-
AI
|
|
3
|
+
The AI module recommender translates a natural-language requirement into a
|
|
4
|
+
ranked list of modules. It is an optional catalog-discovery feature; it is not
|
|
5
|
+
the Workspace Intelligence model, graph, context engine, or autonomous repair
|
|
6
|
+
loop.
|
|
4
7
|
|
|
5
|
-
##
|
|
8
|
+
## Commands
|
|
6
9
|
|
|
7
|
-
|
|
10
|
+
| Task | Command |
|
|
11
|
+
| ----------------------------- | ------------------------------------------------------- |
|
|
12
|
+
| Recommend modules | `workspai ai recommend <query> [--number <n>] [--json]` |
|
|
13
|
+
| Show current AI configuration | `workspai ai info` |
|
|
14
|
+
| Generate a missing catalog | `workspai ai generate-embeddings [--force]` |
|
|
15
|
+
| Refresh an existing catalog | `workspai ai update-embeddings` |
|
|
16
|
+
| Enable or disable AI | `workspai config ai <enable\|disable>` |
|
|
17
|
+
| Store a local provider key | `workspai config set-api-key` |
|
|
18
|
+
| Remove the stored key | `workspai config remove-api-key [--yes]` |
|
|
8
19
|
|
|
9
|
-
|
|
10
|
-
key for query embeddings, then run a recommendation. The missing-embeddings
|
|
11
|
-
prompt below is a recovery path, not the normal first-run path.
|
|
20
|
+
Use `npx workspai` instead of `workspai` when the CLI is not installed globally.
|
|
12
21
|
|
|
13
|
-
|
|
14
|
-
# If bundled embeddings are missing, AI offers to regenerate them
|
|
15
|
-
npx workspai ai recommend "user authentication with social login"
|
|
16
|
-
|
|
17
|
-
# Output:
|
|
18
|
-
# ⚠️ Module embeddings not found
|
|
19
|
-
# AI recommendations require embeddings to be generated.
|
|
20
|
-
#
|
|
21
|
-
# ? What would you like to do?
|
|
22
|
-
# 🚀 Generate embeddings now (requires OpenAI API key)
|
|
23
|
-
# 📝 Show me how to generate them manually
|
|
24
|
-
# ❌ Cancel
|
|
25
|
-
|
|
26
|
-
# Choose option 1, provide API key, and embeddings will be generated automatically!
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
### Option 2: Manual Setup
|
|
30
|
-
|
|
31
|
-
**Step 1:** Get OpenAI API key from [OpenAI Platform](https://platform.openai.com/api-keys)
|
|
32
|
-
|
|
33
|
-
**Step 2:** Configure API key
|
|
34
|
-
|
|
35
|
-
```bash
|
|
36
|
-
npx workspai config set-api-key
|
|
37
|
-
# Or (non-interactive environments):
|
|
38
|
-
export OPENAI_API_KEY="<YOUR_OPENAI_API_KEY>"
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
**Step 3:** Generate embeddings (one-time, provider-cost dependent)
|
|
42
|
-
|
|
43
|
-
```bash
|
|
44
|
-
npx workspai ai generate-embeddings
|
|
45
|
-
|
|
46
|
-
# Output:
|
|
47
|
-
# 🤖 Generating AI embeddings for Workspai modules...
|
|
48
|
-
# 📡 Fetching modules from Workspai...
|
|
49
|
-
# ✓ Found <N> modules
|
|
50
|
-
#
|
|
51
|
-
# 💰 Estimated cost: shown by CLI at runtime
|
|
52
|
-
# (depends on provider pricing, model, and module count)
|
|
53
|
-
#
|
|
54
|
-
# ? Generate embeddings now? Yes
|
|
55
|
-
# ✔ Generated embeddings for <N> modules
|
|
56
|
-
# ✅ Embeddings generated successfully!
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
**Step 4:** Use AI recommendations
|
|
60
|
-
|
|
61
|
-
```bash
|
|
62
|
-
npx workspai ai recommend "user authentication"
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
### Option 3: Mock Mode (Testing Without API Key)
|
|
66
|
-
|
|
67
|
-
Test AI features without an OpenAI API key using deterministic embeddings:
|
|
68
|
-
|
|
69
|
-
```bash
|
|
70
|
-
# No API key? No problem! Mock mode activates automatically
|
|
71
|
-
npx workspai ai recommend "authentication"
|
|
72
|
-
|
|
73
|
-
# Output:
|
|
74
|
-
# ⚠️ OpenAI API key not configured - using MOCK MODE for testing
|
|
75
|
-
#
|
|
76
|
-
# 📝 Note: Mock embeddings provide approximate results for testing.
|
|
77
|
-
# For production, configure your OpenAI API key:
|
|
78
|
-
# ...
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
Mock mode provides realistic (but not perfect) results for development and testing.
|
|
82
|
-
|
|
83
|
-
## 📦 Features
|
|
84
|
-
|
|
85
|
-
### AI Module Recommender
|
|
86
|
-
|
|
87
|
-
Get intelligent module suggestions based on natural language descriptions.
|
|
88
|
-
|
|
89
|
-
**Example:**
|
|
90
|
-
|
|
91
|
-
```bash
|
|
92
|
-
$ npx workspai ai recommend "I need user authentication with email"
|
|
93
|
-
|
|
94
|
-
📦 Recommended Modules:
|
|
95
|
-
|
|
96
|
-
1. authentication-core ⭐
|
|
97
|
-
Complete authentication system with password hashing, JWT tokens, OAuth 2.0
|
|
98
|
-
Match: 98% - Matches: auth, login, password
|
|
99
|
-
|
|
100
|
-
2. email ⭐
|
|
101
|
-
Email sending with templates, SMTP/SendGrid/AWS SES support
|
|
102
|
-
Match: 95% - Matches: email, notification
|
|
103
|
-
|
|
104
|
-
3. users-core
|
|
105
|
-
User management system with profiles, roles, permissions
|
|
106
|
-
Match: 92% - Matches: user, profile
|
|
107
|
-
|
|
108
|
-
💡 Quick install (top 3):
|
|
109
|
-
workspai add module authentication-core email users-core
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
## 💰 Pricing
|
|
113
|
-
|
|
114
|
-
### One-Time Setup Cost (Estimates)
|
|
115
|
-
|
|
116
|
-
| Item | Cost | Notes |
|
|
117
|
-
| ------------------- | ------ | ------------------------------------------------ |
|
|
118
|
-
| Generate embeddings | Varies | One-time only, depends on model and module count |
|
|
119
|
-
| Update embeddings | Varies | Only when catalog changes |
|
|
120
|
-
|
|
121
|
-
### Per-Query Cost (After Setup, Estimates)
|
|
122
|
-
|
|
123
|
-
| Usage | Cost | Notes |
|
|
124
|
-
| -------------- | -------- | ------------------------- |
|
|
125
|
-
| Single query | Very low | Depends on provider/model |
|
|
126
|
-
| 100 queries | Low | Depends on provider/model |
|
|
127
|
-
| 1,000 queries | Moderate | Depends on provider/model |
|
|
128
|
-
| 10,000 queries | Higher | Depends on provider/model |
|
|
129
|
-
|
|
130
|
-
**Important:** Provider pricing and limits change over time. Always validate current pricing/limits in the provider dashboard before budgeting.
|
|
131
|
-
|
|
132
|
-
💡 **Tip:** Embeddings are generated once and reused, so ongoing query cost is typically much lower than initial setup.
|
|
133
|
-
|
|
134
|
-
## 🔧 Configuration
|
|
135
|
-
|
|
136
|
-
### View Current Config
|
|
137
|
-
|
|
138
|
-
```bash
|
|
139
|
-
npx workspai config show
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
### Set API Key
|
|
143
|
-
|
|
144
|
-
```bash
|
|
145
|
-
npx workspai config set-api-key
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
### Remove API Key
|
|
149
|
-
|
|
150
|
-
```bash
|
|
151
|
-
npx workspai config remove-api-key
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
### Enable/Disable AI
|
|
155
|
-
|
|
156
|
-
```bash
|
|
157
|
-
npx workspai config ai enable
|
|
158
|
-
npx workspai config ai disable
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
## 📊 How It Works
|
|
162
|
-
|
|
163
|
-
### Architecture Overview
|
|
164
|
-
|
|
165
|
-
```
|
|
166
|
-
┌─────────────────┐
|
|
167
|
-
│ User Query │ "I need authentication"
|
|
168
|
-
└────────┬────────┘
|
|
169
|
-
│
|
|
170
|
-
▼
|
|
171
|
-
┌─────────────────┐
|
|
172
|
-
│ OpenAI API │ Convert text → embedding vector (1536 dims)
|
|
173
|
-
└────────┬────────┘
|
|
174
|
-
│
|
|
175
|
-
▼
|
|
176
|
-
┌─────────────────┐
|
|
177
|
-
│ Module Catalog │ Runtime-dependent modules and bundled embeddings
|
|
178
|
-
│ (Dynamic) │ Fetched from RapidKit Python Core
|
|
179
|
-
└────────┬────────┘
|
|
180
|
-
│
|
|
181
|
-
▼
|
|
182
|
-
┌─────────────────┐
|
|
183
|
-
│ Cosine │ Calculate similarity scores
|
|
184
|
-
│ Similarity │ Find closest matches
|
|
185
|
-
└────────┬────────┘
|
|
186
|
-
│
|
|
187
|
-
▼
|
|
188
|
-
┌─────────────────┐
|
|
189
|
-
│ Ranked Results │ Top N modules with scores & reasons
|
|
190
|
-
└─────────────────┘
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
### Technical Details
|
|
194
|
-
|
|
195
|
-
1. **Module Catalog**:
|
|
196
|
-
- Runtime catalog from Python Core when available
|
|
197
|
-
- Bundled fallback catalog when Python is unavailable
|
|
198
|
-
- 5-minute cache for performance
|
|
199
|
-
|
|
200
|
-
2. **Embeddings**:
|
|
201
|
-
- AI converts module descriptions to 1536-dimensional vectors
|
|
202
|
-
- Generated once, reused for all queries
|
|
203
|
-
- Stored in `data/modules-embeddings.json`; size depends on catalog and model
|
|
204
|
-
|
|
205
|
-
3. **Semantic Search**:
|
|
206
|
-
- User query → embedding vector
|
|
207
|
-
- Cosine similarity with all modules
|
|
208
|
-
- Results sorted by relevance score (0-100%)
|
|
209
|
-
|
|
210
|
-
4. **Smart Features**:
|
|
211
|
-
- Dependency detection (shows required modules)
|
|
212
|
-
- Match explanation (shows why module matched)
|
|
213
|
-
- Category grouping (auth, database, payment, etc.)
|
|
214
|
-
- Installation order calculation
|
|
215
|
-
|
|
216
|
-
**Technology Stack:**
|
|
217
|
-
|
|
218
|
-
- Model: `text-embedding-3-small` (OpenAI)
|
|
219
|
-
- Dimension: 1536 vectors
|
|
220
|
-
- Match scores are similarity estimates, not a versioned accuracy benchmark
|
|
221
|
-
- Cost: provider-dependent (check current provider pricing)
|
|
222
|
-
|
|
223
|
-
Performance depends on provider latency, machine state, catalog size, and cache
|
|
224
|
-
state. The runtime catalog uses a five-minute in-process cache.
|
|
225
|
-
|
|
226
|
-
## 🎯 Use Cases
|
|
227
|
-
|
|
228
|
-
### E-commerce Platform
|
|
229
|
-
|
|
230
|
-
```bash
|
|
231
|
-
workspai ai recommend "e-commerce with payments and inventory"
|
|
232
|
-
```
|
|
233
|
-
|
|
234
|
-
### SaaS Application
|
|
235
|
-
|
|
236
|
-
```bash
|
|
237
|
-
workspai ai recommend "SaaS platform with subscriptions"
|
|
238
|
-
```
|
|
239
|
-
|
|
240
|
-
### Real-time Chat
|
|
241
|
-
|
|
242
|
-
```bash
|
|
243
|
-
workspai ai recommend "real-time chat application"
|
|
244
|
-
```
|
|
245
|
-
|
|
246
|
-
### API Gateway
|
|
247
|
-
|
|
248
|
-
```bash
|
|
249
|
-
workspai ai recommend "API gateway with rate limiting"
|
|
250
|
-
```
|
|
251
|
-
|
|
252
|
-
## 🔒 Security
|
|
253
|
-
|
|
254
|
-
- API keys stored in `$HOME/.workspairc.json` (legacy `$HOME/.rapidkit/config.json` is still read)
|
|
255
|
-
- File permissions: `600` (owner read/write only)
|
|
256
|
-
- Never committed to git (`.workspai/` in `.gitignore` where local-only evidence is generated)
|
|
257
|
-
- Environment variable supported (`OPENAI_API_KEY`)
|
|
258
|
-
|
|
259
|
-
## 🐛 Troubleshooting
|
|
260
|
-
|
|
261
|
-
### "Module embeddings not found"
|
|
262
|
-
|
|
263
|
-
**Solution:** Embeddings generate automatically on first use! Just follow the prompts:
|
|
264
|
-
|
|
265
|
-
```bash
|
|
266
|
-
npx workspai ai recommend "auth"
|
|
267
|
-
|
|
268
|
-
# You'll see:
|
|
269
|
-
# ⚠️ Module embeddings not found
|
|
270
|
-
# ? What would you like to do?
|
|
271
|
-
# 🚀 Generate embeddings now (requires OpenAI API key)
|
|
272
|
-
# 📝 Show me how to generate them manually
|
|
273
|
-
# ❌ Cancel
|
|
274
|
-
```
|
|
275
|
-
|
|
276
|
-
Or generate manually:
|
|
277
|
-
|
|
278
|
-
```bash
|
|
279
|
-
npx workspai ai generate-embeddings
|
|
280
|
-
```
|
|
281
|
-
|
|
282
|
-
### "OpenAI API key not configured"
|
|
283
|
-
|
|
284
|
-
**Option 1:** Mock mode (no key needed, for testing)
|
|
285
|
-
|
|
286
|
-
```bash
|
|
287
|
-
# Just use it! Mock mode activates automatically
|
|
288
|
-
npx workspai ai recommend "database"
|
|
289
|
-
```
|
|
290
|
-
|
|
291
|
-
**Option 2:** Get a real API key
|
|
292
|
-
|
|
293
|
-
```bash
|
|
294
|
-
# 1. Get key: https://platform.openai.com/api-keys
|
|
295
|
-
# 2. Configure it:
|
|
296
|
-
npx workspai config set-api-key
|
|
297
|
-
|
|
298
|
-
# Or set environment variable:
|
|
299
|
-
export OPENAI_API_KEY="<YOUR_OPENAI_API_KEY>"
|
|
300
|
-
```
|
|
301
|
-
|
|
302
|
-
### "Invalid API key" or "401 Error"
|
|
303
|
-
|
|
304
|
-
**Cause:** API key is incorrect or expired
|
|
305
|
-
|
|
306
|
-
**Solution:**
|
|
307
|
-
|
|
308
|
-
```bash
|
|
309
|
-
# Update your API key
|
|
310
|
-
npx workspai config set-api-key
|
|
311
|
-
|
|
312
|
-
# Verify it's set correctly
|
|
313
|
-
npx workspai config show
|
|
314
|
-
```
|
|
315
|
-
|
|
316
|
-
### "429 Rate Limited" or "Quota Exceeded"
|
|
22
|
+
## How ranking works
|
|
317
23
|
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
- Limits vary by provider account tier and can change over time
|
|
330
|
-
- Check your provider dashboard for current request/token limits
|
|
331
|
-
|
|
332
|
-
### "Failed to fetch modules from Python Core"
|
|
333
|
-
|
|
334
|
-
**Cause:** RapidKit Python not installed or not in PATH
|
|
335
|
-
|
|
336
|
-
**Impact:** Uses fallback catalog instead of the full runtime catalog
|
|
337
|
-
|
|
338
|
-
**Solution (optional):**
|
|
339
|
-
|
|
340
|
-
```bash
|
|
341
|
-
# Install RapidKit Python Core
|
|
342
|
-
pip install -e /path/to/rapidkit-core
|
|
343
|
-
|
|
344
|
-
# Verify installation
|
|
345
|
-
rapidkit modules list --json-schema 1
|
|
24
|
+
```text
|
|
25
|
+
Natural-language requirement
|
|
26
|
+
↓
|
|
27
|
+
Query embedding (provider or deterministic mock)
|
|
28
|
+
↓
|
|
29
|
+
Bundled/runtime module embedding catalog
|
|
30
|
+
↓
|
|
31
|
+
Cosine similarity + dependency metadata
|
|
32
|
+
↓
|
|
33
|
+
Ranked suggestions
|
|
346
34
|
```
|
|
347
35
|
|
|
348
|
-
|
|
36
|
+
The catalog is loaded from the published package when available. Development and
|
|
37
|
+
refresh workflows can obtain current module metadata through the validated
|
|
38
|
+
Python Core bridge. A bounded fallback catalog keeps discovery available when
|
|
39
|
+
Core is absent.
|
|
349
40
|
|
|
350
|
-
|
|
41
|
+
## Interpreting a result
|
|
351
42
|
|
|
352
|
-
|
|
43
|
+
A recommendation contains module identity, description, category, declared
|
|
44
|
+
dependencies, similarity score, and a short match reason.
|
|
353
45
|
|
|
354
|
-
|
|
46
|
+
Treat the score as a ranking signal only:
|
|
355
47
|
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
# 2. Generate embeddings for new modules
|
|
362
|
-
# 3. Update data/modules-embeddings.json
|
|
363
|
-
```
|
|
364
|
-
|
|
365
|
-
### Low Match Scores
|
|
366
|
-
|
|
367
|
-
**Symptom:** All results show <70% match
|
|
48
|
+
- it is not a probability that the module is correct;
|
|
49
|
+
- it does not prove framework/runtime compatibility;
|
|
50
|
+
- it does not approve licensing, security, or production readiness;
|
|
51
|
+
- it is not comparable across embedding models or catalog revisions without a
|
|
52
|
+
controlled benchmark.
|
|
368
53
|
|
|
369
|
-
|
|
54
|
+
Before installation, inspect the project capability and the selected module's
|
|
55
|
+
dependencies. Workspai refuses Core-backed installation when the current project
|
|
56
|
+
does not advertise the required command surface.
|
|
370
57
|
|
|
371
|
-
|
|
372
|
-
2. Query too specific: "blockchain NFT marketplace with AI"
|
|
373
|
-
3. No matching modules exist
|
|
58
|
+
## Provider and mock behavior
|
|
374
59
|
|
|
375
|
-
|
|
60
|
+
- With `OPENAI_API_KEY` or a stored key, the current implementation uses the
|
|
61
|
+
configured OpenAI embedding client.
|
|
62
|
+
- Without a key, deterministic mock mode exercises the workflow without a
|
|
63
|
+
network request.
|
|
64
|
+
- Mock results are for development and UI testing, not production selection.
|
|
65
|
+
- Provider latency, limits, model availability, and prices can change. Consult
|
|
66
|
+
the provider dashboard rather than relying on hard-coded cost estimates.
|
|
376
67
|
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
68
|
+
The current default embedding model and vector dimensions are implementation
|
|
69
|
+
details recorded with generated catalog data. Consumers must read that metadata
|
|
70
|
+
instead of assuming every catalog uses the same model.
|
|
380
71
|
|
|
381
|
-
|
|
72
|
+
## Key storage and security
|
|
382
73
|
|
|
383
|
-
|
|
74
|
+
The preferred order is:
|
|
384
75
|
|
|
385
|
-
|
|
76
|
+
1. environment secret (`OPENAI_API_KEY`) for CI and ephemeral sessions;
|
|
77
|
+
2. interactive user configuration for a trusted local machine;
|
|
78
|
+
3. never a committed workspace file, shell history entry, screenshot, or issue.
|
|
386
79
|
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
npx workspai ai generate-embeddings
|
|
391
|
-
```
|
|
80
|
+
`workspai config show` masks a stored key. `config remove-api-key --yes` supports
|
|
81
|
+
non-interactive cleanup. See [config-file-guide.md](./config-file-guide.md) for
|
|
82
|
+
configuration precedence and locations.
|
|
392
83
|
|
|
393
|
-
|
|
84
|
+
## JSON automation
|
|
394
85
|
|
|
395
86
|
```bash
|
|
396
|
-
|
|
397
|
-
npx workspai config show
|
|
398
|
-
|
|
399
|
-
# Output shows:
|
|
400
|
-
# - AI enabled: true/false
|
|
401
|
-
# - API key: <masked>
|
|
402
|
-
# - Embeddings status: exists/not found
|
|
403
|
-
# - Module count: <N> modules
|
|
87
|
+
npx workspai ai recommend "PostgreSQL with migrations" --number 3 --json
|
|
404
88
|
```
|
|
405
89
|
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
1. **Enable CLI debug logging where supported:**
|
|
409
|
-
|
|
410
|
-
```bash
|
|
411
|
-
npx workspai --debug ai recommend "auth"
|
|
412
|
-
```
|
|
413
|
-
|
|
414
|
-
2. **Check for updates:**
|
|
415
|
-
|
|
416
|
-
```bash
|
|
417
|
-
npm outdated workspai
|
|
418
|
-
npm update workspai
|
|
419
|
-
```
|
|
420
|
-
|
|
421
|
-
3. **Report issue:**
|
|
422
|
-
- GitHub: https://github.com/rapidkitlabs/workspai/issues
|
|
423
|
-
- Include: error message, OS, Node version, command used
|
|
424
|
-
|
|
425
|
-
## 📚 Commands Reference
|
|
426
|
-
|
|
427
|
-
### AI Commands
|
|
428
|
-
|
|
429
|
-
| Command | Description | Example |
|
|
430
|
-
| ----------------------------------------- | ------------------------------ | ----------------------------------------- |
|
|
431
|
-
| `workspai ai recommend [query]` | Get module recommendations | `workspai ai recommend "auth"` |
|
|
432
|
-
| `workspai ai recommend [query] -n <N>` | Get top N recommendations | `workspai ai recommend "database" -n 3` |
|
|
433
|
-
| `workspai ai recommend [query] --json` | Get JSON output | `workspai ai recommend "auth" --json` |
|
|
434
|
-
| `workspai ai generate-embeddings` | Generate or refresh embeddings | `workspai ai generate-embeddings` |
|
|
435
|
-
| `workspai ai update-embeddings` | Update with latest modules | `workspai ai update-embeddings` |
|
|
436
|
-
| `workspai ai info` | Show AI features info | `workspai ai info` |
|
|
437
|
-
|
|
438
|
-
### Configuration Commands
|
|
439
|
-
|
|
440
|
-
| Command | Description | Example |
|
|
441
|
-
| -------------------------------- | -------------------------------- | -------------------------------- |
|
|
442
|
-
| `workspai config set-api-key` | Set OpenAI API key (interactive) | `workspai config set-api-key` |
|
|
443
|
-
| `workspai config show` | Show current config | `workspai config show` |
|
|
444
|
-
| `workspai config remove-api-key` | Remove API key | `workspai config remove-api-key` |
|
|
445
|
-
| `workspai config ai enable` | Enable AI features | `workspai config ai enable` |
|
|
446
|
-
| `workspai config ai disable` | Disable AI features | `workspai config ai disable` |
|
|
447
|
-
|
|
448
|
-
### Recommend Command Options
|
|
449
|
-
|
|
450
|
-
```bash
|
|
451
|
-
workspai ai recommend [query] [options]
|
|
452
|
-
|
|
453
|
-
Options:
|
|
454
|
-
-n, --number <count> Number of recommendations (default: 5)
|
|
455
|
-
--json Output as JSON
|
|
456
|
-
-h, --help Display help
|
|
457
|
-
```
|
|
458
|
-
|
|
459
|
-
`generate-embeddings` currently regenerates when invoked. The accepted `--force`
|
|
460
|
-
flag does not alter that behavior and should not be used as a workflow branch.
|
|
461
|
-
|
|
462
|
-
## 🚀 Planned Workspace Intelligence Extensions
|
|
463
|
-
|
|
464
|
-
These are roadmap ideas, not current CLI claims. New AI-facing surfaces must be
|
|
465
|
-
grounded in `contracts/workspace-intelligence-architecture.v1.json` before they
|
|
466
|
-
are documented as available features.
|
|
467
|
-
|
|
468
|
-
- [ ] Workspace Atlas generated from Workspace Intelligence evidence
|
|
469
|
-
- [ ] Repository/project chat over generated evidence artifacts
|
|
470
|
-
- [ ] Bug detection grounded in doctor, verify, and impact reports
|
|
471
|
-
- [ ] Test generation informed by workspace model, runtime signals, and affected subgraphs
|
|
472
|
-
- [ ] Architecture suggestions with evidence/freshness labels
|
|
473
|
-
|
|
474
|
-
## 🤝 Contributing
|
|
475
|
-
|
|
476
|
-
See [CONTRIBUTING.md](../CONTRIBUTING.md)
|
|
477
|
-
|
|
478
|
-
## 📄 License
|
|
90
|
+
JSON mode is intended for scripts. Treat non-zero exit codes and structured error
|
|
91
|
+
codes as failures; do not scrape human-formatted output.
|
|
479
92
|
|
|
480
|
-
|
|
93
|
+
## Relationship to Workspace Intelligence
|
|
481
94
|
|
|
482
|
-
|
|
95
|
+
| Capability | Requires provider AI? | Durable evidence? | Main purpose |
|
|
96
|
+
| ----------------------- | --------------------- | ----------------- | ------------------------------------ |
|
|
97
|
+
| Module recommender | Optional | No | Discover modules from requirements |
|
|
98
|
+
| Workspace model/graph | No | Yes | Describe the current software system |
|
|
99
|
+
| Context and agent sync | No | Yes | Ground AI tools in shared evidence |
|
|
100
|
+
| Impact/verify/readiness | No | Yes | Govern changes and releases |
|
|
483
101
|
|
|
484
|
-
|
|
102
|
+
For the main Workspai architecture, start with
|
|
103
|
+
[workspace-knowledge-graph.md](./workspace-knowledge-graph.md) and
|
|
104
|
+
[workspace-intelligence-runner.md](./workspace-intelligence-runner.md).
|