@ngockhoale/ukit 3.1.4 → 3.1.5
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/CHANGELOG.md +4 -0
- package/package.json +1 -1
- package/src/cli/commands/install.js +24 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to UKit are documented here.
|
|
4
4
|
|
|
5
|
+
## 3.1.5 - 2026-09-26
|
|
6
|
+
|
|
7
|
+
- **Install/update warns when the decision lane has no API key.** After a project refresh, `ukit install` (and `ukit update`'s refresh) prints a bold-red warning with setup instructions — `ukit decision --base-url <url> --key <key>`, `~/.ukit/storage/gatewayDecision.json`, or `UKIT_DECISION_API_KEY` — whenever no dedicated decision key and no shared UNIC token are resolvable. When a key (or the shared UNIC token fallback) is found, a one-line confirmation is printed instead.
|
|
8
|
+
|
|
5
9
|
## 3.1.4 - 2026-09-26
|
|
6
10
|
|
|
7
11
|
- **`ukit decision` — user-facing decision-lane gateway setup.** Resolution order (per field): env `UKIT_DECISION_BASE_URL`/`UKIT_DECISION_API_KEY`/`UKIT_DECISION_SCHEME` → `~/.ukit/storage/gatewayDecision.json` (new per-lane file; `gateway<Lane>.json` pattern) → `~/.ukit/storage/config.json` `decisionGateway` → `openai.unicjsc.com` + shared UNIC token. File field names mirror the env vars; `scheme` selects `Authorization: Bearer` vs `x-api-key`. Both files are seeded by `ukit install` with the full key set (`mergeStrategy: skip` — `ukit update` never overwrites user values). Commands: `--status`, `--base-url/--key/--scheme`, `--set-unic`, `--clear`.
|
package/package.json
CHANGED
|
@@ -2,6 +2,7 @@ import { buildPathConfig } from '../../core/paths.js';
|
|
|
2
2
|
import { runInstallPipeline } from '../../core/runInstallPipeline.js';
|
|
3
3
|
import { formatRepairReport } from '../../core/repairBrokenHooks.js';
|
|
4
4
|
import { formatGatewayResilienceReport } from '../../core/gatewayResilienceEnv.js';
|
|
5
|
+
import { resolveDecisionApiKey, resolveDecisionBaseUrl } from '../../core/gatewayProbe.js';
|
|
5
6
|
import { buildCodeIndex, buildDerivedIndexArtifacts } from '../../index/buildIndex.js';
|
|
6
7
|
import { installIndexRefreshHooks } from '../../index/gitHooks.js';
|
|
7
8
|
import fs from 'node:fs/promises';
|
|
@@ -339,6 +340,29 @@ export async function runInstall({ packageRoot, projectRoot, packageVersion, arg
|
|
|
339
340
|
console.log(`[UKit] ${line}`);
|
|
340
341
|
}
|
|
341
342
|
|
|
343
|
+
// Decision-lane credential check: warn (bold red) when no dedicated key is
|
|
344
|
+
// configured. Resolution: env UKIT_DECISION_API_KEY →
|
|
345
|
+
// ~/.ukit/storage/gatewayDecision.json → config.json decisionGateway →
|
|
346
|
+
// shared UNIC token. Tell the user exactly how to set it.
|
|
347
|
+
try {
|
|
348
|
+
const decisionKey = await resolveDecisionApiKey({ projectRoot });
|
|
349
|
+
const decisionBase = resolveDecisionBaseUrl({});
|
|
350
|
+
const R = '[1;31m';
|
|
351
|
+
const X = '[0m';
|
|
352
|
+
if (!decisionKey?.value) {
|
|
353
|
+
console.warn(`${R}[UKit] WARNING — decision lane (unic-decision) has NO API key configured.${X}`);
|
|
354
|
+
console.warn(`${R}[UKit] The typed-decision features will report 'unavailable' and fall back to deterministic rules.${X}`);
|
|
355
|
+
console.warn(`${R}[UKit] Set it with: ukit decision --base-url https://openai.unicjsc.com --key <YOUR_KEY>${X}`);
|
|
356
|
+
console.warn(`${R}[UKit] Or edit ~/.ukit/storage/gatewayDecision.json -> UKIT_DECISION_API_KEY, or export UKIT_DECISION_API_KEY=<key>.${X}`);
|
|
357
|
+
} else if (decisionKey.source === 'shared-unic-token') {
|
|
358
|
+
console.log(`[UKit] Decision lane: using shared UNIC token at ${decisionBase.baseUrl} (no dedicated key needed).`);
|
|
359
|
+
} else {
|
|
360
|
+
console.log(`[UKit] Decision lane: key configured (${decisionKey.source}) at ${decisionBase.baseUrl}.`);
|
|
361
|
+
}
|
|
362
|
+
} catch {
|
|
363
|
+
// advisory only — never fail install on the check
|
|
364
|
+
}
|
|
365
|
+
|
|
342
366
|
const docsLabels = [
|
|
343
367
|
'docs/PROJECT.md',
|
|
344
368
|
'docs/MEMORY.md',
|