nocaap 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Nitesh Pant
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 ADDED
@@ -0,0 +1,214 @@
1
+ # nocaap ๐Ÿงข
2
+
3
+ **Normalized Organizational Context-as-a-Package**
4
+
5
+ > "No scattered docs. No inconsistent AI. No cap."
6
+
7
+ **nocaap** is a developer-first tool that standardizes how AI agents (Cursor, Copilot, Claude) discover and consume organizational knowledge. It uses a **Hub-and-Spoke** Git architecture to fetch documentation from various repositories into a unified, AI-optimized local index.
8
+
9
+ ## ๐Ÿš€ Why?
10
+
11
+ Your AI coding assistant is only as good as its context.
12
+ * **The Problem:** Your Security SOPs are in one repo, Design Tokens in another, and API specs in a third. Your AI is guessing.
13
+ * **The Solution:** `nocaap` creates a standardized `.context/` folder in your project, populated with the exact versions of the documents your team needs.
14
+
15
+ ## โœจ Key Features
16
+
17
+ * **Hub-and-Spoke Discovery:** One "Registry" file maps your entire organization's knowledge. Users just select "Engineering" or "Finance" from a menu.
18
+ * **Native Git Security:** We don't handle tokens. If you have SSH access to the repo via GitHub/GitLab, it works. If you don't, it skips. Zero configuration.
19
+ * **Lightning Fast:** Uses `git sparse-checkout` and `partial clones` to fetch *only* the specific documentation folders you need, not the entire repo history.
20
+ * **AI Optimized:** Auto-generates a token-conscious `INDEX.md` that guides AI agents to the right files without blowing up context windows.
21
+ * **Private Repo Support:** Seamlessly handles private repositories using your existing SSH keys - no tokens to manage.
22
+
23
+ ## ๐Ÿ“ฆ Installation
24
+
25
+ ### Option 1: Install from GitHub (Recommended)
26
+
27
+ ```bash
28
+ # Install directly from GitHub
29
+ npm install -g git+https://github.com/niteshpant99/nocaap.git
30
+
31
+ # Or with SSH (if you have SSH keys configured)
32
+ npm install -g git+ssh://git@github.com:niteshpant99/nocaap.git
33
+ ```
34
+
35
+ ### Option 2: Install from Source
36
+
37
+ ```bash
38
+ # Clone the repo
39
+ git clone https://github.com/niteshpant99/nocaap.git
40
+ cd nocaap
41
+
42
+ # Install dependencies and build
43
+ pnpm install
44
+ pnpm run build
45
+
46
+ # Link globally (makes 'nocaap' command available)
47
+ npm link
48
+ ```
49
+
50
+ ### Option 3: npx (Run without installing)
51
+
52
+ ```bash
53
+ # Run setup directly from GitHub
54
+ npx github:niteshpant99/nocaap setup
55
+ ```
56
+
57
+ > **Coming Soon:** `npm install -g nocaap` (npm package publication in progress)
58
+
59
+ ## ๐Ÿ—๏ธ Setting Up Your Organization's Context Hub
60
+
61
+ Want to create your own context registry? Use the **official starter template**:
62
+
63
+ ๐Ÿ‘‰ **[nocaap-context-template](https://github.com/niteshpant99/nocaap-context-template)**
64
+
65
+ This template includes:
66
+ - ๐Ÿ“ Pre-configured folder structure for organizing contexts
67
+ - ๐Ÿ”„ Scripts to auto-generate `nocaap-registry.json` from your markdown files
68
+ - โšก GitHub Actions for automatic registry updates on push
69
+ - ๐Ÿ“ Example contexts to get you started
70
+
71
+ **Quick Start:**
72
+ 1. [Fork the template](https://github.com/niteshpant99/nocaap-context-template/fork)
73
+ 2. Add your organization's documentation
74
+ 3. Push - the registry auto-updates!
75
+
76
+ Your team can then point nocaap to your new registry and start using it immediately.
77
+
78
+ ---
79
+
80
+ ## ๐Ÿ”ง Configuration
81
+
82
+ ### Setting Your Organization's Registry
83
+
84
+ nocaap accepts any URL format - just paste what you copy from your browser:
85
+
86
+ ```bash
87
+ # GitHub repo URL (easiest - we figure out the rest)
88
+ nocaap config registry https://github.com/your-org/context-hub
89
+
90
+ # GitHub file URL (if registry is at a specific path)
91
+ nocaap config registry https://github.com/your-org/context-hub/blob/main/nocaap-registry.json
92
+
93
+ # Raw URL (for public repos)
94
+ nocaap config registry https://raw.githubusercontent.com/your-org/context-hub/main/nocaap-registry.json
95
+
96
+ # SSH URL (explicit, for power users)
97
+ nocaap config registry git@github.com:your-org/context-hub.git
98
+ ```
99
+
100
+ **How it works:**
101
+ 1. nocaap detects the URL format automatically
102
+ 2. Tries HTTP first (fast, works for public repos)
103
+ 3. Falls back to SSH if needed (works for private repos using your SSH keys)
104
+
105
+ **Private repos work seamlessly** - just have your SSH keys configured!
106
+
107
+ ```bash
108
+ # View current config
109
+ nocaap config --list
110
+
111
+ # Clear saved registry
112
+ nocaap config registry --clear
113
+ ```
114
+
115
+ ## ๐Ÿ› ๏ธ Usage
116
+
117
+ ### 1. The Setup Wizard (Recommended)
118
+ The easiest way to get started. Connects to your organization's registry map and lets you interactively select contexts.
119
+
120
+ ```bash
121
+ nocaap setup
122
+ ```
123
+ * Uses your saved registry, or prompts for one
124
+ * Checks access permissions (HTTP and SSH)
125
+ * Shows available contexts with descriptions
126
+ * Installs selected contexts
127
+
128
+ ### 2. Manual Add
129
+ Add a specific repository or folder directly.
130
+
131
+ ```bash
132
+ # Add a full repo
133
+ nocaap add git@github.com:your-org/engineering-standards.git
134
+
135
+ # Add a specific folder (Sparse Checkout)
136
+ nocaap add git@github.com:your-org/monorepo.git --path docs/security --alias security-docs
137
+ ```
138
+
139
+ ### 3. Update & Sync
140
+ Checks for updates, verifies file integrity, and regenerates the index.
141
+
142
+ ```bash
143
+ nocaap update
144
+ ```
145
+ * **Safety:** Checks for local changes ("Dirty State") before overwriting.
146
+ * **Drift:** Detects if the remote version or configured path has changed.
147
+
148
+ ### 4. Other Commands
149
+
150
+ ```bash
151
+ # List installed packages
152
+ nocaap list
153
+
154
+ # Remove a package
155
+ nocaap remove <alias>
156
+
157
+ # Regenerate INDEX.md
158
+ nocaap generate
159
+ ```
160
+
161
+ ## ๐Ÿ“‚ Directory Structure
162
+
163
+ `nocaap` manages everything inside `.context/`. You should commit `context.config.json` and `context.lock`, but **ignore** the packages.
164
+
165
+ ```text
166
+ project-root/
167
+ โ”œโ”€โ”€ .gitignore # Should include .context/packages/
168
+ โ”œโ”€โ”€ .context/
169
+ โ”‚ โ”œโ”€โ”€ context.config.json # Manifest of installed contexts
170
+ โ”‚ โ”œโ”€โ”€ context.lock # Exact commit SHAs for reproducibility
171
+ โ”‚ โ”œโ”€โ”€ INDEX.md # THE file you point your AI to
172
+ โ”‚ โ””โ”€โ”€ packages/ # Cloned content (Partial clones)
173
+ โ”‚ โ”œโ”€โ”€ engineering/
174
+ โ”‚ โ””โ”€โ”€ design-system/
175
+ ```
176
+
177
+ ## ๐Ÿค– AI Integration
178
+
179
+ To make your AI aware of the context, simply mention `@.context/INDEX.md` in your prompt, or configure your editor:
180
+
181
+ **VS Code / Cursor (`.vscode/settings.json`):**
182
+ ```json
183
+ {
184
+ "github.copilot.chat.context.additionalContextFiles": [
185
+ ".context/INDEX.md"
186
+ ]
187
+ }
188
+ ```
189
+
190
+ ## ๐Ÿ” Private Repository Support
191
+
192
+ nocaap uses your existing Git credentials for private repos:
193
+
194
+ | Repository Type | How It Works |
195
+ |----------------|--------------|
196
+ | **Public** | Direct HTTP fetch (fast) |
197
+ | **Private** | SSH clone (uses your `~/.ssh` keys) |
198
+
199
+ **Setup for private repos:**
200
+ 1. Ensure SSH keys are configured: `ssh -T git@github.com`
201
+ 2. Use any URL format - nocaap auto-detects and falls back to SSH if needed
202
+
203
+ No tokens to manage, no credentials to store - true "Zero Auth" design.
204
+
205
+ ## ๐Ÿค Contributing
206
+
207
+ This is an open-source PoC. We welcome contributions!
208
+ 1. Clone the repo.
209
+ 2. `pnpm install`
210
+ 3. `pnpm run dev`
211
+
212
+ ## ๐Ÿ“„ License
213
+
214
+ MIT
@@ -0,0 +1,2 @@
1
+
2
+ export { }