workspai 0.45.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.
Files changed (177) hide show
  1. package/README.md +307 -532
  2. package/contracts/agent-customization-pack.v1.json +6 -1
  3. package/contracts/bootstrap-compliance.v1.json +14 -0
  4. package/contracts/cli-runtime-command-inventory.v1.snapshot.json +8 -0
  5. package/contracts/extension-cli-compatibility.v1.json +9 -2
  6. package/contracts/mirror-ops.v1.json +16 -0
  7. package/contracts/published-contract-catalog.v1.json +38 -1
  8. package/contracts/runtime-command-surface.v1.json +190 -7
  9. package/contracts/transparency-evidence.v1.json +13 -0
  10. package/contracts/workspace-archive-capabilities.v1.json +17 -6
  11. package/contracts/workspace-contract.v1.json +78 -0
  12. package/contracts/workspace-intelligence/studio-blocker-handoff.v1.json +4 -0
  13. package/contracts/workspace-intelligence/workspace-context.v1.json +20 -0
  14. package/contracts/workspace-intelligence/workspace-graph-token-efficiency.v1.json +72 -0
  15. package/contracts/workspace-intelligence/workspace-intelligence-run.v1.json +212 -0
  16. package/contracts/workspace-intelligence/workspace-knowledge-graph-change-overlay.v1.json +200 -0
  17. package/contracts/workspace-intelligence/workspace-knowledge-graph.v1.json +260 -0
  18. package/contracts/workspace-intelligence/workspace-knowledge-search.v1.json +60 -0
  19. package/contracts/workspace-intelligence-architecture.v1.json +7 -4
  20. package/contracts/workspace-intelligence-chain.v1.json +51 -4
  21. package/contracts/workspace-share-bundle.v1.json +16 -0
  22. package/dist/analyze-UVXPRGYZ.js +1 -0
  23. package/dist/artifact-remediation-plan-EPALZ2LC.js +3 -0
  24. package/dist/autopilot-release-5BQ6F5L2.js +1 -0
  25. package/dist/chunk-22NJ2ZMG.js +2 -0
  26. package/dist/{chunk-XIVFLY6G.js → chunk-2GHUZDYA.js} +1 -1
  27. package/dist/chunk-2TEDAKP6.js +2 -0
  28. package/dist/chunk-52PBRX7F.js +1 -0
  29. package/dist/chunk-6SWRNA47.js +4 -0
  30. package/dist/chunk-76YOPAOT.js +1 -0
  31. package/dist/chunk-7VLCK5JW.js +1 -0
  32. package/dist/{chunk-DXPU4DDV.js → chunk-BSRVO52Y.js} +92 -78
  33. package/dist/chunk-COARSXRC.js +1 -0
  34. package/dist/chunk-CV5HKU4P.js +1 -0
  35. package/dist/chunk-CW7PGBIQ.js +13 -0
  36. package/dist/{chunk-KU4S7RCM.js → chunk-DV6GJD4K.js} +1 -1
  37. package/dist/chunk-EYJ2CQSK.js +1 -0
  38. package/dist/chunk-FB7SCXAZ.js +1 -0
  39. package/dist/chunk-FPJNWPKU.js +1 -0
  40. package/dist/{chunk-JP25YL3J.js → chunk-FTY7GGXJ.js} +2 -2
  41. package/dist/chunk-FXQJX34Z.js +1 -0
  42. package/dist/{chunk-J4AICQFB.js → chunk-HSGFUKCN.js} +1 -1
  43. package/dist/{chunk-OOOPYUL2.js → chunk-ITCAMC2E.js} +1 -1
  44. package/dist/chunk-KB44JP4M.js +2 -0
  45. package/dist/{chunk-WANW4QA4.js → chunk-KZZ36CK5.js} +1 -1
  46. package/dist/chunk-LNRAB7UY.js +1 -0
  47. package/dist/chunk-MEMHNE7Y.js +80 -0
  48. package/dist/chunk-MER6ZBN2.js +13 -0
  49. package/dist/chunk-NOFM7MNA.js +2 -0
  50. package/dist/chunk-NRYS4CLR.js +2 -0
  51. package/dist/chunk-OA537ZQ5.js +1 -0
  52. package/dist/chunk-PBHP6JNY.js +8 -0
  53. package/dist/chunk-QDWYIRHR.js +8 -0
  54. package/dist/chunk-RWRLFSKW.js +2 -0
  55. package/dist/chunk-SK6XRKGG.js +1 -0
  56. package/dist/chunk-THIOE2PB.js +2 -0
  57. package/dist/chunk-TNQI5VCW.js +36 -0
  58. package/dist/chunk-TWNFECMN.js +2 -0
  59. package/dist/{chunk-2QOWRBQD.js → chunk-U5EZHZBX.js} +1 -1
  60. package/dist/{chunk-K63BSU56.js → chunk-VBSQ7MF6.js} +62 -51
  61. package/dist/chunk-WDKNMTJQ.js +1 -0
  62. package/dist/chunk-YCL3I2JO.js +2 -0
  63. package/dist/chunk-ZDN7RHXJ.js +1 -0
  64. package/dist/chunk-ZM5NQ5Z2.js +1 -0
  65. package/dist/{create-KFR6FLRT.js → create-7JKJDAQV.js} +1 -1
  66. package/dist/doctor-PGPNIS76.js +1 -0
  67. package/dist/{dotnet-webapi-clean-BYUUHX5Y.js → dotnet-webapi-clean-6TVFBTVI.js} +20 -20
  68. package/dist/{gofiber-standard-B6UK5GR7.js → gofiber-standard-2BL7GWZB.js} +1 -1
  69. package/dist/{gogin-standard-BXU44VEM.js → gogin-standard-XGP3KBXA.js} +1 -1
  70. package/dist/index.d.ts +112 -16
  71. package/dist/index.js +198 -195
  72. package/dist/pipeline-IB6ILJSV.js +5 -0
  73. package/dist/{platform-capabilities-YICBF4FA.js → platform-capabilities-2B4QMZXE.js} +1 -1
  74. package/dist/{pythonRapidkitExec-UJYIB6FL.js → pythonRapidkitExec-CVCIK225.js} +1 -1
  75. package/dist/{springboot-standard-PEHDKH2L.js → springboot-standard-JJNUID6M.js} +6 -6
  76. package/dist/workspace-H3QXBFGB.js +1 -0
  77. package/dist/{workspace-agent-sync-G5YVI3BJ.js → workspace-agent-sync-C7SG2Z5W.js} +1 -1
  78. package/dist/workspace-archive-P76EDIUG.js +10 -0
  79. package/dist/{workspace-context-E3UFWL5X.js → workspace-context-BKQBKA4C.js} +1 -1
  80. package/dist/workspace-contract-RPQQBQXR.js +1 -0
  81. package/dist/workspace-dependency-graph-23BI2HG7.js +1 -0
  82. package/dist/workspace-explain-WVN7JH3U.js +1 -0
  83. package/dist/workspace-explain-contract-SEFTVF6J.js +1 -0
  84. package/dist/{workspace-feedback-YY6WQPWQ.js → workspace-feedback-WAID3IOE.js} +1 -1
  85. package/dist/{workspace-foundation-3C2DLCVI.js → workspace-foundation-5OOJEO2D.js} +1 -1
  86. package/dist/workspace-graph-token-efficiency-CFGFCJ5V.js +1 -0
  87. package/dist/{workspace-history-VF3CHDYQ.js → workspace-history-C6OP3IAQ.js} +1 -1
  88. package/dist/workspace-intelligence-VKDL3H2J.js +1 -0
  89. package/dist/workspace-intelligence-runner-LVALAZY7.js +1 -0
  90. package/dist/workspace-knowledge-graph-FE2NTZKV.js +1 -0
  91. package/dist/workspace-knowledge-graph-change-overlay-XG6FC4IX.js +1 -0
  92. package/dist/workspace-knowledge-graph-query-VOSPPH4W.js +1 -0
  93. package/dist/workspace-mcp-serve-KT2I676Z.js +3 -0
  94. package/dist/workspace-model-S33CIB2R.js +1 -0
  95. package/dist/workspace-model-hash-MHXK5MEI.js +1 -0
  96. package/dist/workspace-python-engine-state-2MLKJYQG.js +2 -0
  97. package/dist/workspace-registry-summary-A3YDL63D.js +1 -0
  98. package/dist/workspace-run-M4LNJILC.js +1 -0
  99. package/dist/{workspace-verify-ZNT6JX7D.js → workspace-verify-ZGH3NXAH.js} +1 -1
  100. package/dist/workspace-watch-EVBJTMV7.js +1 -0
  101. package/docs/AI_DYNAMIC_INTEGRATION.md +73 -432
  102. package/docs/AI_EXAMPLES.md +37 -395
  103. package/docs/AI_FEATURES.md +76 -465
  104. package/docs/AI_QUICKSTART.md +49 -209
  105. package/docs/DEVELOPMENT.md +5 -5
  106. package/docs/From Code to Shared Understanding.png +0 -0
  107. package/docs/GLOSSARY.md +60 -0
  108. package/docs/OPEN_SOURCE_USER_SCENARIOS.md +91 -9
  109. package/docs/OPTIMIZATION_GUIDE.md +19 -51
  110. package/docs/PACKAGE_MANAGER_POLICY.md +4 -1
  111. package/docs/README.md +91 -42
  112. package/docs/SECURITY.md +13 -6
  113. package/docs/SETUP.md +6 -3
  114. package/docs/UTILITIES.md +8 -20
  115. package/docs/WORKSPACE_MARKER_SPEC.md +27 -20
  116. package/docs/ci-workflows.md +19 -5
  117. package/docs/commands-reference.md +88 -13
  118. package/docs/config-file-guide.md +67 -246
  119. package/docs/contracts/ARTIFACT_CATALOG.md +78 -36
  120. package/docs/contracts/CLI_LOG_EVENT_STREAM.md +1 -1
  121. package/docs/contracts/README.md +48 -9
  122. package/docs/contracts/RUNTIME_ACCEPTANCE_MATRIX.md +4 -4
  123. package/docs/contracts/RUNTIME_SUPPORT_MATRIX.md +14 -10
  124. package/docs/creating-workspaces-and-projects.md +649 -0
  125. package/docs/doctor-command.md +5 -4
  126. package/docs/examples/ci-agent-grounding.yml +16 -10
  127. package/docs/from-code-to-shared-understanding.md +69 -38
  128. package/docs/graph-benchmark-methodology.md +121 -0
  129. package/docs/workspace-intelligence-runner.md +186 -0
  130. package/docs/workspace-knowledge-graph.md +295 -0
  131. package/docs/workspace-operations.md +78 -11
  132. package/docs/workspace-run.md +4 -1
  133. package/package.json +10 -8
  134. package/rapidkit.config.example.cjs +5 -5
  135. package/scripts/enforce-package-manager.cjs +1 -1
  136. package/scripts/prepack-enterprise.mjs +4 -0
  137. package/workspai.config.example.cjs +12 -47
  138. package/dist/analyze-YLV7NVLF.js +0 -1
  139. package/dist/artifact-remediation-plan-WLZGROUU.js +0 -3
  140. package/dist/autopilot-release-YBN3SWAA.js +0 -1
  141. package/dist/chunk-2K3GYCPS.js +0 -1
  142. package/dist/chunk-42G2OK64.js +0 -1
  143. package/dist/chunk-5AKYMAIL.js +0 -1
  144. package/dist/chunk-5GNT4RJI.js +0 -8
  145. package/dist/chunk-5PVEQ6CZ.js +0 -13
  146. package/dist/chunk-6AA3WWQZ.js +0 -2
  147. package/dist/chunk-6ZENXBMG.js +0 -33
  148. package/dist/chunk-7RIWU5TZ.js +0 -1
  149. package/dist/chunk-7UZVOYF5.js +0 -2
  150. package/dist/chunk-BJLE5CH7.js +0 -4
  151. package/dist/chunk-G3H5R3RR.js +0 -1
  152. package/dist/chunk-HYJK7W3B.js +0 -1
  153. package/dist/chunk-IMUU5Q2V.js +0 -13
  154. package/dist/chunk-KPPGZCUW.js +0 -78
  155. package/dist/chunk-LCRROMRR.js +0 -2
  156. package/dist/chunk-LG6RFLPZ.js +0 -1
  157. package/dist/chunk-P424XYHP.js +0 -1
  158. package/dist/chunk-P7SCWJFG.js +0 -8
  159. package/dist/chunk-QWU2CZBG.js +0 -2
  160. package/dist/chunk-V2H2KRMZ.js +0 -1
  161. package/dist/chunk-XZGVNGRB.js +0 -1
  162. package/dist/chunk-ZWO6K24C.js +0 -2
  163. package/dist/doctor-YJDM5XBH.js +0 -1
  164. package/dist/imported-projects-registry-FOIE27WT.js +0 -1
  165. package/dist/pipeline-FEDYO3IA.js +0 -5
  166. package/dist/workspace-PLXOO6ST.js +0 -1
  167. package/dist/workspace-archive-EEGLHZDW.js +0 -10
  168. package/dist/workspace-contract-LQJDZV36.js +0 -1
  169. package/dist/workspace-explain-G74ZIF23.js +0 -1
  170. package/dist/workspace-explain-contract-KT757JGQ.js +0 -1
  171. package/dist/workspace-intelligence-3GG7GEDQ.js +0 -1
  172. package/dist/workspace-mcp-serve-MJMUV4RY.js +0 -3
  173. package/dist/workspace-model-NG45SRM5.js +0 -1
  174. package/dist/workspace-python-engine-state-MTWIIZPY.js +0 -2
  175. package/dist/workspace-registry-summary-JM2XY52C.js +0 -1
  176. package/dist/workspace-run-WEQYIERE.js +0 -1
  177. package/dist/workspace-watch-W47T4RX2.js +0 -1
@@ -1,493 +1,104 @@
1
- # 🤖 Workspai AI Features
1
+ # AI Module Recommender
2
2
 
3
- AI-powered module recommendations using OpenAI embeddings to help you build faster.
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
- ## 🚀 Quick Start
8
+ ## Commands
6
9
 
7
- ### Option 1: Automatic Setup (Recommended)
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
- Just use AI recommendations - it will guide you through setup automatically!
20
+ Use `npx workspai` instead of `workspai` when the CLI is not installed globally.
10
21
 
11
- ```bash
12
- # First time - AI will detect missing embeddings and offer to generate them
13
- npx workspai ai recommend "user authentication with social login"
14
-
15
- # Output:
16
- # ⚠️ Module embeddings not found
17
- # AI recommendations require embeddings to be generated.
18
- #
19
- # ? What would you like to do?
20
- # 🚀 Generate embeddings now (requires OpenAI API key)
21
- # 📝 Show me how to generate them manually
22
- # ❌ Cancel
23
-
24
- # Choose option 1, provide API key, and embeddings will be generated automatically!
25
- ```
26
-
27
- ### Option 2: Manual Setup
28
-
29
- **Step 1:** Get OpenAI API key from [OpenAI Platform](https://platform.openai.com/api-keys)
30
-
31
- **Step 2:** Configure API key
32
-
33
- ```bash
34
- npx workspai config set-api-key
35
- # Or (non-interactive environments):
36
- export OPENAI_API_KEY="<YOUR_OPENAI_API_KEY>"
37
- ```
38
-
39
- **Step 3:** Generate embeddings (one-time, provider-cost dependent)
22
+ ## How ranking works
40
23
 
41
- ```bash
42
- npx workspai ai generate-embeddings
43
-
44
- # Output:
45
- # 🤖 Generating AI embeddings for Workspai modules...
46
- # 📡 Fetching modules from Workspai...
47
- # ✓ Found <N> modules
48
- #
49
- # 💰 Estimated cost: shown by CLI at runtime
50
- # (depends on provider pricing, model, and module count)
51
- #
52
- # ? Generate embeddings now? Yes
53
- # ✔ Generated embeddings for <N> modules
54
- # ✅ Embeddings generated successfully!
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
55
34
  ```
56
35
 
57
- **Step 4:** Use AI recommendations
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.
58
40
 
59
- ```bash
60
- npx workspai ai recommend "user authentication"
61
- ```
41
+ ## Interpreting a result
62
42
 
63
- ### Option 3: Mock Mode (Testing Without API Key)
43
+ A recommendation contains module identity, description, category, declared
44
+ dependencies, similarity score, and a short match reason.
64
45
 
65
- Test AI features without an OpenAI API key using deterministic embeddings:
46
+ Treat the score as a ranking signal only:
66
47
 
67
- ```bash
68
- # No API key? No problem! Mock mode activates automatically
69
- npx workspai ai recommend "authentication"
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.
70
53
 
71
- # Output:
72
- # ⚠️ OpenAI API key not configured - using MOCK MODE for testing
73
- #
74
- # 📝 Note: Mock embeddings provide approximate results for testing.
75
- # For production, configure your OpenAI API key:
76
- # ...
77
- ```
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.
78
57
 
79
- Mock mode provides realistic (but not perfect) results for development and testing.
58
+ ## Provider and mock behavior
80
59
 
81
- ## 📦 Features
82
-
83
- ### AI Module Recommender
84
-
85
- Get intelligent module suggestions based on natural language descriptions.
86
-
87
- **Example:**
88
-
89
- ```bash
90
- $ npx workspai ai recommend "I need user authentication with email"
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.
91
67
 
92
- 📦 Recommended Modules:
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.
93
71
 
94
- 1. authentication-core
95
- Complete authentication system with password hashing, JWT tokens, OAuth 2.0
96
- Match: 98% - Matches: auth, login, password
72
+ ## Key storage and security
97
73
 
98
- 2. email
99
- Email sending with templates, SMTP/SendGrid/AWS SES support
100
- Match: 95% - Matches: email, notification
74
+ The preferred order is:
101
75
 
102
- 3. users-core
103
- User management system with profiles, roles, permissions
104
- Match: 92% - Matches: user, profile
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.
105
79
 
106
- 💡 Quick install (top 3):
107
- workspai add module authentication-core email users-core
108
- ```
109
-
110
- ## 💰 Pricing
111
-
112
- ### One-Time Setup Cost (Estimates)
113
-
114
- | Item | Cost | Notes |
115
- | ------------------- | ------ | ------------------------------------------------ |
116
- | Generate embeddings | Varies | One-time only, depends on model and module count |
117
- | Update embeddings | Varies | Only when catalog changes |
118
-
119
- ### Per-Query Cost (After Setup, Estimates)
120
-
121
- | Usage | Cost | Notes |
122
- | -------------- | -------- | ------------------------- |
123
- | Single query | Very low | Depends on provider/model |
124
- | 100 queries | Low | Depends on provider/model |
125
- | 1,000 queries | Moderate | Depends on provider/model |
126
- | 10,000 queries | Higher | Depends on provider/model |
127
-
128
- **Important:** Provider pricing and limits change over time. Always validate current pricing/limits in the provider dashboard before budgeting.
129
-
130
- 💡 **Tip:** Embeddings are generated once and reused, so ongoing query cost is typically much lower than initial setup.
131
-
132
- ## 🔧 Configuration
133
-
134
- ### View Current Config
135
-
136
- ```bash
137
- npx workspai config show
138
- ```
139
-
140
- ### Set API Key
141
-
142
- ```bash
143
- npx workspai config set-api-key
144
- ```
145
-
146
- ### Remove API Key
147
-
148
- ```bash
149
- npx workspai config remove-api-key
150
- ```
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.
151
83
 
152
- ### Enable/Disable AI
84
+ ## JSON automation
153
85
 
154
86
  ```bash
155
- npx workspai config ai enable
156
- npx workspai config ai disable
87
+ npx workspai ai recommend "PostgreSQL with migrations" --number 3 --json
157
88
  ```
158
89
 
159
- ## 📊 How It Works
160
-
161
- ### Architecture Overview
162
-
163
- ```
164
- ┌─────────────────┐
165
- │ User Query │ "I need authentication"
166
- └────────┬────────┘
167
-
168
-
169
- ┌─────────────────┐
170
- │ OpenAI API │ Convert text → embedding vector (1536 dims)
171
- └────────┬────────┘
172
-
173
-
174
- ┌─────────────────┐
175
- │ Module Catalog │ 27+ modules with pre-generated embeddings
176
- │ (Dynamic) │ Fetched from RapidKit Python Core
177
- └────────┬────────┘
178
-
179
-
180
- ┌─────────────────┐
181
- │ Cosine │ Calculate similarity scores
182
- │ Similarity │ Find closest matches
183
- └────────┬────────┘
184
-
185
-
186
- ┌─────────────────┐
187
- │ Ranked Results │ Top N modules with scores & reasons
188
- └─────────────────┘
189
- ```
190
-
191
- ### Technical Details
192
-
193
- 1. **Module Catalog**:
194
- - 27+ production-ready modules (dynamic from Python Core)
195
- - Fallback to 11 hardcoded modules if Python unavailable
196
- - 5-minute cache for performance
197
-
198
- 2. **Embeddings**:
199
- - AI converts module descriptions to 1536-dimensional vectors
200
- - Generated once, reused for all queries
201
- - Stored in `data/modules-embeddings.json` (508KB)
202
-
203
- 3. **Semantic Search**:
204
- - User query → embedding vector
205
- - Cosine similarity with all modules
206
- - Results sorted by relevance score (0-100%)
207
-
208
- 4. **Smart Features**:
209
- - Dependency detection (shows required modules)
210
- - Match explanation (shows why module matched)
211
- - Category grouping (auth, database, payment, etc.)
212
- - Installation order calculation
213
-
214
- **Technology Stack:**
215
-
216
- - Model: `text-embedding-3-small` (OpenAI)
217
- - Dimension: 1536 vectors
218
- - Accuracy: 92%+ match scores
219
- - Cost: provider-dependent (check current provider pricing)
220
-
221
- **Performance:**
222
-
223
- - First query: ~200ms (embedding generation)
224
- - Subsequent queries: ~50ms (cached embeddings)
225
- - Catalog refresh: Every 5 minutes
226
-
227
- ## 🎯 Use Cases
228
-
229
- ### E-commerce Platform
230
-
231
- ```bash
232
- workspai ai recommend "e-commerce with payments and inventory"
233
- ```
234
-
235
- ### SaaS Application
236
-
237
- ```bash
238
- workspai ai recommend "SaaS platform with subscriptions"
239
- ```
240
-
241
- ### Real-time Chat
242
-
243
- ```bash
244
- workspai ai recommend "real-time chat application"
245
- ```
246
-
247
- ### API Gateway
248
-
249
- ```bash
250
- workspai ai recommend "API gateway with rate limiting"
251
- ```
252
-
253
- ## 🔒 Security
254
-
255
- - API keys stored in `$HOME/.workspairc.json` (legacy `$HOME/.rapidkit/config.json` is still read)
256
- - File permissions: `600` (owner read/write only)
257
- - Never committed to git (`.workspai/` in `.gitignore` where local-only evidence is generated)
258
- - Environment variable supported (`OPENAI_API_KEY`)
259
-
260
- ## 🐛 Troubleshooting
261
-
262
- ### "Module embeddings not found"
263
-
264
- **Solution:** Embeddings generate automatically on first use! Just follow the prompts:
265
-
266
- ```bash
267
- npx workspai ai recommend "auth"
268
-
269
- # You'll see:
270
- # ⚠️ Module embeddings not found
271
- # ? What would you like to do?
272
- # 🚀 Generate embeddings now (requires OpenAI API key)
273
- # 📝 Show me how to generate them manually
274
- # ❌ Cancel
275
- ```
276
-
277
- Or generate manually:
278
-
279
- ```bash
280
- npx workspai ai generate-embeddings
281
- ```
282
-
283
- ### "OpenAI API key not configured"
284
-
285
- **Option 1:** Mock mode (no key needed, for testing)
286
-
287
- ```bash
288
- # Just use it! Mock mode activates automatically
289
- npx workspai ai recommend "database"
290
- ```
291
-
292
- **Option 2:** Get a real API key
293
-
294
- ```bash
295
- # 1. Get key: https://platform.openai.com/api-keys
296
- # 2. Configure it:
297
- npx workspai config set-api-key
298
-
299
- # Or set environment variable:
300
- export OPENAI_API_KEY="<YOUR_OPENAI_API_KEY>"
301
- ```
302
-
303
- ### "Invalid API key" or "401 Error"
304
-
305
- **Cause:** API key is incorrect or expired
306
-
307
- **Solution:**
308
-
309
- ```bash
310
- # Update your API key
311
- npx workspai config set-api-key
312
-
313
- # Verify it's set correctly
314
- npx workspai config show
315
- ```
316
-
317
- ### "429 Rate Limited" or "Quota Exceeded"
318
-
319
- **Cause:** OpenAI API quota or rate limit reached
320
-
321
- **Solutions:**
322
-
323
- 1. **Check billing:** https://platform.openai.com/account/billing
324
- 2. **Check limits:** https://platform.openai.com/account/limits
325
- 3. **Upgrade tier:** Free tier has lower limits
326
- 4. **Wait:** Rate limits reset automatically
327
-
328
- **Rate Limits:**
329
-
330
- - Limits vary by provider account tier and can change over time
331
- - Check your provider dashboard for current request/token limits
332
-
333
- ### "Failed to fetch modules from Python Core"
334
-
335
- **Cause:** RapidKit Python not installed or not in PATH
336
-
337
- **Impact:** Uses fallback catalog instead of the full runtime catalog
338
-
339
- **Solution (optional):**
340
-
341
- ```bash
342
- # Install RapidKit Python Core
343
- pip install -e /path/to/rapidkit-core
344
-
345
- # Verify installation
346
- rapidkit modules list --json
347
- ```
348
-
349
- **Note:** Fallback still provides good results with core modules!
350
-
351
- ### Embeddings Out of Date
352
-
353
- **Symptom:** New modules not appearing in recommendations
354
-
355
- **Solution:** Update embeddings with latest modules
356
-
357
- ```bash
358
- npx workspai ai update-embeddings
359
-
360
- # This will:
361
- # 1. Fetch latest modules from Python Core
362
- # 2. Generate embeddings for new modules
363
- # 3. Update data/modules-embeddings.json
364
- ```
365
-
366
- ### Low Match Scores
367
-
368
- **Symptom:** All results show <70% match
369
-
370
- **Possible Causes:**
371
-
372
- 1. Query too vague: "build something"
373
- 2. Query too specific: "blockchain NFT marketplace with AI"
374
- 3. No matching modules exist
375
-
376
- **Solutions:**
377
-
378
- - Make query more specific: "authentication" → "user authentication with JWT"
379
- - Try different keywords: "storage" instead of "blockchain"
380
- - Check available modules: `npx workspai ai info`
381
-
382
- ### Mock Mode Results Not Accurate
383
-
384
- **Cause:** Mock embeddings are deterministic but not trained
385
-
386
- **Solution:** Use real OpenAI API for production
387
-
388
- ```bash
389
- # Get API key and generate real embeddings
390
- npx workspai config set-api-key
391
- npx workspai ai generate-embeddings
392
- ```
393
-
394
- ### Check Current Configuration
395
-
396
- ```bash
397
- # View all settings
398
- npx workspai config show
399
-
400
- # Output shows:
401
- # - AI enabled: true/false
402
- # - API key: <masked>
403
- # - Embeddings status: exists/not found
404
- # - Module count: <N> modules
405
- ```
406
-
407
- ### Still Having Issues?
408
-
409
- 1. **Enable debug logging:**
410
-
411
- ```bash
412
- DEBUG=rapidkit:* npx workspai ai recommend "auth"
413
- ```
414
-
415
- 2. **Check for updates:**
416
-
417
- ```bash
418
- npm outdated workspai
419
- npm update workspai
420
- ```
421
-
422
- 3. **Report issue:**
423
- - GitHub: https://github.com/rapidkitlabs/workspai/issues
424
- - Include: error message, OS, Node version, command used
425
-
426
- ## 📚 Commands Reference
427
-
428
- ### AI Commands
429
-
430
- | Command | Description | Example |
431
- | ----------------------------------------- | ------------------------------ | ----------------------------------------- |
432
- | `workspai ai recommend [query]` | Get module recommendations | `workspai ai recommend "auth"` |
433
- | `workspai ai recommend [query] -n <N>` | Get top N recommendations | `workspai ai recommend "database" -n 3` |
434
- | `workspai ai recommend [query] --json` | Get JSON output | `workspai ai recommend "auth" --json` |
435
- | `workspai ai generate-embeddings` | Generate embeddings (one-time) | `workspai ai generate-embeddings` |
436
- | `workspai ai generate-embeddings --force` | Force regenerate embeddings | `workspai ai generate-embeddings --force` |
437
- | `workspai ai update-embeddings` | Update with latest modules | `workspai ai update-embeddings` |
438
- | `workspai ai info` | Show AI features info | `workspai ai info` |
439
-
440
- ### Configuration Commands
441
-
442
- | Command | Description | Example |
443
- | -------------------------------- | -------------------------------- | -------------------------------- |
444
- | `workspai config set-api-key` | Set OpenAI API key (interactive) | `workspai config set-api-key` |
445
- | `workspai config show` | Show current config | `workspai config show` |
446
- | `workspai config remove-api-key` | Remove API key | `workspai config remove-api-key` |
447
- | `workspai config ai enable` | Enable AI features | `workspai config ai enable` |
448
- | `workspai config ai disable` | Disable AI features | `workspai config ai disable` |
449
-
450
- ### Recommend Command Options
451
-
452
- ```bash
453
- workspai ai recommend [query] [options]
454
-
455
- Options:
456
- -n, --number <count> Number of recommendations (default: 5)
457
- --json Output as JSON
458
- -h, --help Display help
459
- ```
460
-
461
- ### Generate-Embeddings Command Options
462
-
463
- ```bash
464
- workspai ai generate-embeddings [options]
465
-
466
- Options:
467
- --force Force regeneration even if embeddings exist
468
- -h, --help Display help
469
- ```
470
-
471
- ## 🚀 Planned Workspace Intelligence Extensions
472
-
473
- These are roadmap ideas, not current CLI claims. New AI-facing surfaces must be
474
- grounded in `contracts/workspace-intelligence-architecture.v1.json` before they
475
- are documented as available features.
476
-
477
- - [ ] Workspace Atlas generated from Workspace Intelligence evidence
478
- - [ ] Repository/project chat over generated evidence artifacts
479
- - [ ] Bug detection grounded in doctor, verify, and impact reports
480
- - [ ] Test generation informed by workspace model, runtime signals, and affected subgraphs
481
- - [ ] Architecture suggestions with evidence/freshness labels
482
-
483
- ## 🤝 Contributing
484
-
485
- See [CONTRIBUTING.md](../CONTRIBUTING.md)
486
-
487
- ## 📄 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.
488
92
 
489
- MIT - See [LICENSE](../LICENSE)
93
+ ## Relationship to Workspace Intelligence
490
94
 
491
- ---
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 |
492
101
 
493
- **Questions?** Open an issue on [GitHub](https://github.com/rapidkitlabs/workspai/issues)
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).