@kiroku-solutions/kiroku-ai 0.2.2 → 0.2.4

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 CHANGED
@@ -49,6 +49,7 @@ pnpm --dir CLI start init
49
49
  | `update` | Re-resolves the recorded stack, re-downloads, and prunes removed skills. |
50
50
  | `env [tool]` | Switches the AI tool: **migrates the folders** and regenerates its pointer. |
51
51
  | `scaffold` | Generates a runnable starter project for the recorded stack (Phase 2). |
52
+ | `analyze` | Scans the current project to detect its stack and missing technologies. |
52
53
 
53
54
  ### Setup modes
54
55
 
@@ -57,6 +58,7 @@ pnpm --dir CLI start init
57
58
  | Mode | What it asks |
58
59
  | ------------- | --------------------------------------------------------------------------------- |
59
60
  | **Quickstart**| Pick one predefined stack (see presets below), then just the AI tool. |
61
+ | **Auto-Detect**| Analyzes your codebase to infer the stack, warns about missing tech, then installs. |
60
62
  | **Guided** | The classic stack questionnaire (scope → frontend → backend → db → deploy → devops).|
61
63
  | **Modular** | Guided **plus** Architecture, Methodology and Development practices, and per-agent selection. |
62
64
 
package/bin/kiroku-ai.mjs CHANGED
@@ -213,7 +213,27 @@ async function main(argv) {
213
213
 
214
214
  const runtimeDir = join(CACHE_ROOT, REF.replace(/[^a-zA-Z0-9._-]/g, '_'));
215
215
  const cachedCli = join(runtimeDir, 'src', 'cli.mjs');
216
- const cacheValid = existsSync(cachedCli) && existsSync(join(runtimeDir, 'node_modules')) && !REFRESH;
216
+ let cacheValid = existsSync(cachedCli) && existsSync(join(runtimeDir, 'node_modules')) && !REFRESH;
217
+
218
+ if (cacheValid) {
219
+ try {
220
+ const meta = JSON.parse(await readFile(join(runtimeDir, '.kiroku-meta.json'), 'utf8'));
221
+ const token = await resolveToken();
222
+ if (token && meta.sha) {
223
+ const url = `${API}/repos/${ORG}/${REPO}/commits/${encodeURIComponent(REF)}`;
224
+ const res = await fetch(url, { headers: ghHeaders(token, 'application/vnd.github+json') });
225
+ if (res.ok) {
226
+ const data = await res.json();
227
+ if (data.sha && data.sha !== meta.sha) {
228
+ cacheValid = false;
229
+ process.stdout.write(`New CLI version detected (sha: ${data.sha.slice(0, 7)}). Refreshing...\n`);
230
+ }
231
+ }
232
+ }
233
+ } catch {
234
+ // Ignore errors (offline, missing meta, etc) - keep cacheValid as true
235
+ }
236
+ }
217
237
 
218
238
  if (!cacheValid) {
219
239
  const token = await ensureToken();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiroku-solutions/kiroku-ai",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "Interactive CLI to bootstrap Kiroku AI Standards (AI Context as Code) into any project.",
5
5
  "type": "module",
6
6
  "bin": {