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.
- package/README.md +307 -532
- 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 +8 -0
- package/contracts/extension-cli-compatibility.v1.json +9 -2
- package/contracts/mirror-ops.v1.json +16 -0
- package/contracts/published-contract-catalog.v1.json +38 -1
- package/contracts/runtime-command-surface.v1.json +190 -7
- package/contracts/transparency-evidence.v1.json +13 -0
- package/contracts/workspace-archive-capabilities.v1.json +17 -6
- package/contracts/workspace-contract.v1.json +78 -0
- package/contracts/workspace-intelligence/studio-blocker-handoff.v1.json +4 -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 +212 -0
- 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 +7 -4
- package/contracts/workspace-intelligence-chain.v1.json +51 -4
- 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-XIVFLY6G.js → chunk-2GHUZDYA.js} +1 -1
- package/dist/chunk-2TEDAKP6.js +2 -0
- package/dist/chunk-52PBRX7F.js +1 -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-DXPU4DDV.js → chunk-BSRVO52Y.js} +92 -78
- package/dist/chunk-COARSXRC.js +1 -0
- package/dist/chunk-CV5HKU4P.js +1 -0
- package/dist/chunk-CW7PGBIQ.js +13 -0
- package/dist/{chunk-KU4S7RCM.js → chunk-DV6GJD4K.js} +1 -1
- package/dist/chunk-EYJ2CQSK.js +1 -0
- package/dist/chunk-FB7SCXAZ.js +1 -0
- package/dist/chunk-FPJNWPKU.js +1 -0
- package/dist/{chunk-JP25YL3J.js → chunk-FTY7GGXJ.js} +2 -2
- package/dist/chunk-FXQJX34Z.js +1 -0
- package/dist/{chunk-J4AICQFB.js → chunk-HSGFUKCN.js} +1 -1
- package/dist/{chunk-OOOPYUL2.js → chunk-ITCAMC2E.js} +1 -1
- package/dist/chunk-KB44JP4M.js +2 -0
- package/dist/{chunk-WANW4QA4.js → chunk-KZZ36CK5.js} +1 -1
- package/dist/chunk-LNRAB7UY.js +1 -0
- package/dist/chunk-MEMHNE7Y.js +80 -0
- package/dist/chunk-MER6ZBN2.js +13 -0
- 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-2QOWRBQD.js → chunk-U5EZHZBX.js} +1 -1
- package/dist/{chunk-K63BSU56.js → chunk-VBSQ7MF6.js} +62 -51
- 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-KFR6FLRT.js → create-7JKJDAQV.js} +1 -1
- package/dist/doctor-PGPNIS76.js +1 -0
- package/dist/{dotnet-webapi-clean-BYUUHX5Y.js → dotnet-webapi-clean-6TVFBTVI.js} +20 -20
- package/dist/{gofiber-standard-B6UK5GR7.js → gofiber-standard-2BL7GWZB.js} +1 -1
- package/dist/{gogin-standard-BXU44VEM.js → gogin-standard-XGP3KBXA.js} +1 -1
- package/dist/index.d.ts +112 -16
- package/dist/index.js +198 -195
- package/dist/pipeline-IB6ILJSV.js +5 -0
- package/dist/{platform-capabilities-YICBF4FA.js → platform-capabilities-2B4QMZXE.js} +1 -1
- package/dist/{pythonRapidkitExec-UJYIB6FL.js → pythonRapidkitExec-CVCIK225.js} +1 -1
- package/dist/{springboot-standard-PEHDKH2L.js → springboot-standard-JJNUID6M.js} +6 -6
- package/dist/workspace-H3QXBFGB.js +1 -0
- package/dist/{workspace-agent-sync-G5YVI3BJ.js → workspace-agent-sync-C7SG2Z5W.js} +1 -1
- package/dist/workspace-archive-P76EDIUG.js +10 -0
- package/dist/{workspace-context-E3UFWL5X.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-SEFTVF6J.js +1 -0
- package/dist/{workspace-feedback-YY6WQPWQ.js → workspace-feedback-WAID3IOE.js} +1 -1
- package/dist/{workspace-foundation-3C2DLCVI.js → workspace-foundation-5OOJEO2D.js} +1 -1
- package/dist/workspace-graph-token-efficiency-CFGFCJ5V.js +1 -0
- package/dist/{workspace-history-VF3CHDYQ.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-python-engine-state-2MLKJYQG.js +2 -0
- package/dist/workspace-registry-summary-A3YDL63D.js +1 -0
- package/dist/workspace-run-M4LNJILC.js +1 -0
- package/dist/{workspace-verify-ZNT6JX7D.js → workspace-verify-ZGH3NXAH.js} +1 -1
- package/dist/workspace-watch-EVBJTMV7.js +1 -0
- package/docs/AI_DYNAMIC_INTEGRATION.md +73 -432
- package/docs/AI_EXAMPLES.md +37 -395
- package/docs/AI_FEATURES.md +76 -465
- package/docs/AI_QUICKSTART.md +49 -209
- package/docs/DEVELOPMENT.md +5 -5
- package/docs/From Code to Shared Understanding.png +0 -0
- package/docs/GLOSSARY.md +60 -0
- package/docs/OPEN_SOURCE_USER_SCENARIOS.md +91 -9
- package/docs/OPTIMIZATION_GUIDE.md +19 -51
- package/docs/PACKAGE_MANAGER_POLICY.md +4 -1
- package/docs/README.md +91 -42
- package/docs/SECURITY.md +13 -6
- package/docs/SETUP.md +6 -3
- package/docs/UTILITIES.md +8 -20
- package/docs/WORKSPACE_MARKER_SPEC.md +27 -20
- package/docs/ci-workflows.md +19 -5
- package/docs/commands-reference.md +88 -13
- package/docs/config-file-guide.md +67 -246
- package/docs/contracts/ARTIFACT_CATALOG.md +78 -36
- package/docs/contracts/CLI_LOG_EVENT_STREAM.md +1 -1
- package/docs/contracts/README.md +48 -9
- package/docs/contracts/RUNTIME_ACCEPTANCE_MATRIX.md +4 -4
- package/docs/contracts/RUNTIME_SUPPORT_MATRIX.md +14 -10
- package/docs/creating-workspaces-and-projects.md +649 -0
- package/docs/doctor-command.md +5 -4
- package/docs/examples/ci-agent-grounding.yml +16 -10
- package/docs/from-code-to-shared-understanding.md +69 -38
- package/docs/graph-benchmark-methodology.md +121 -0
- package/docs/workspace-intelligence-runner.md +186 -0
- package/docs/workspace-knowledge-graph.md +295 -0
- package/docs/workspace-operations.md +78 -11
- package/docs/workspace-run.md +4 -1
- package/package.json +10 -8
- package/rapidkit.config.example.cjs +5 -5
- package/scripts/enforce-package-manager.cjs +1 -1
- package/scripts/prepack-enterprise.mjs +4 -0
- package/workspai.config.example.cjs +12 -47
- package/dist/analyze-YLV7NVLF.js +0 -1
- package/dist/artifact-remediation-plan-WLZGROUU.js +0 -3
- package/dist/autopilot-release-YBN3SWAA.js +0 -1
- package/dist/chunk-2K3GYCPS.js +0 -1
- package/dist/chunk-42G2OK64.js +0 -1
- package/dist/chunk-5AKYMAIL.js +0 -1
- package/dist/chunk-5GNT4RJI.js +0 -8
- package/dist/chunk-5PVEQ6CZ.js +0 -13
- package/dist/chunk-6AA3WWQZ.js +0 -2
- package/dist/chunk-6ZENXBMG.js +0 -33
- package/dist/chunk-7RIWU5TZ.js +0 -1
- package/dist/chunk-7UZVOYF5.js +0 -2
- package/dist/chunk-BJLE5CH7.js +0 -4
- package/dist/chunk-G3H5R3RR.js +0 -1
- package/dist/chunk-HYJK7W3B.js +0 -1
- package/dist/chunk-IMUU5Q2V.js +0 -13
- package/dist/chunk-KPPGZCUW.js +0 -78
- package/dist/chunk-LCRROMRR.js +0 -2
- package/dist/chunk-LG6RFLPZ.js +0 -1
- package/dist/chunk-P424XYHP.js +0 -1
- package/dist/chunk-P7SCWJFG.js +0 -8
- package/dist/chunk-QWU2CZBG.js +0 -2
- package/dist/chunk-V2H2KRMZ.js +0 -1
- package/dist/chunk-XZGVNGRB.js +0 -1
- package/dist/chunk-ZWO6K24C.js +0 -2
- package/dist/doctor-YJDM5XBH.js +0 -1
- package/dist/imported-projects-registry-FOIE27WT.js +0 -1
- package/dist/pipeline-FEDYO3IA.js +0 -5
- package/dist/workspace-PLXOO6ST.js +0 -1
- package/dist/workspace-archive-EEGLHZDW.js +0 -10
- package/dist/workspace-contract-LQJDZV36.js +0 -1
- package/dist/workspace-explain-G74ZIF23.js +0 -1
- package/dist/workspace-explain-contract-KT757JGQ.js +0 -1
- package/dist/workspace-intelligence-3GG7GEDQ.js +0 -1
- package/dist/workspace-mcp-serve-MJMUV4RY.js +0 -3
- package/dist/workspace-model-NG45SRM5.js +0 -1
- package/dist/workspace-python-engine-state-MTWIIZPY.js +0 -2
- package/dist/workspace-registry-summary-JM2XY52C.js +0 -1
- package/dist/workspace-run-WEQYIERE.js +0 -1
- package/dist/workspace-watch-W47T4RX2.js +0 -1
package/docs/AI_FEATURES.md
CHANGED
|
@@ -1,493 +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
|
-
|
|
20
|
+
Use `npx workspai` instead of `workspai` when the CLI is not installed globally.
|
|
10
21
|
|
|
11
|
-
|
|
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
|
-
```
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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
|
-
|
|
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
|
-
|
|
60
|
-
npx workspai ai recommend "user authentication"
|
|
61
|
-
```
|
|
41
|
+
## Interpreting a result
|
|
62
42
|
|
|
63
|
-
|
|
43
|
+
A recommendation contains module identity, description, category, declared
|
|
44
|
+
dependencies, similarity score, and a short match reason.
|
|
64
45
|
|
|
65
|
-
|
|
46
|
+
Treat the score as a ranking signal only:
|
|
66
47
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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
|
-
|
|
72
|
-
|
|
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
|
-
|
|
58
|
+
## Provider and mock behavior
|
|
80
59
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
99
|
-
Email sending with templates, SMTP/SendGrid/AWS SES support
|
|
100
|
-
Match: 95% - Matches: email, notification
|
|
74
|
+
The preferred order is:
|
|
101
75
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
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
|
-
|
|
107
|
-
|
|
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
|
-
|
|
84
|
+
## JSON automation
|
|
153
85
|
|
|
154
86
|
```bash
|
|
155
|
-
npx workspai
|
|
156
|
-
npx workspai config ai disable
|
|
87
|
+
npx workspai ai recommend "PostgreSQL with migrations" --number 3 --json
|
|
157
88
|
```
|
|
158
89
|
|
|
159
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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).
|