@kb-labs/devkit 1.4.0 → 2.6.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/assets/claude/CLAUDE.md.snippet +30 -0
- package/assets/claude/manifest.json +47 -0
- package/assets/claude/skills/kb-labs-create-plugin/SKILL.md +144 -0
- package/assets/claude/skills/kb-labs-create-product/SKILL.md +144 -0
- package/assets/claude/skills/kb-labs-explore/SKILL.md +119 -0
- package/assets/claude/skills/kb-labs-quickstart/SKILL.md +72 -0
- package/assets/claude/skills/kb-labs-troubleshoot/SKILL.md +150 -0
- package/assets/claude/skills/kb-labs-update/SKILL.md +89 -0
- package/package.json +7 -6
- package/tsconfig/spa.json +7 -0
- package/vitest/node.js +8 -2
- package/vitest/react.js +8 -2
- package/.cursorrules +0 -32
- package/.github/CODEOWNERS +0 -2
- package/.github/actions/setup-node-pnpm/action.yml +0 -47
- package/.github/workflow-templates/ci.yml +0 -13
- package/.github/workflow-templates/deploy.yml +0 -28
- package/.github/workflow-templates/docker-build.yml +0 -25
- package/.github/workflow-templates/drift-check.yml +0 -10
- package/.github/workflow-templates/profiles-validate.yml +0 -16
- package/.github/workflow-templates/release.yml +0 -8
- package/.github/workflows/ci-reusable.yml +0 -131
- package/.github/workflows/deploy-reusable.yml +0 -110
- package/.github/workflows/docker-build-reusable.yml +0 -110
- package/.github/workflows/drift-check-reusable.yml +0 -23
- package/.github/workflows/fixtures.yml +0 -74
- package/.github/workflows/profiles-validate-reusable.yml +0 -67
- package/.github/workflows/release-reusable.yml +0 -50
- package/.vscode/settings.json +0 -23
- package/tsconfig/dist/__tests__/cache.spec.d.ts +0 -6
- package/tsconfig/dist/__tests__/cache.spec.d.ts.map +0 -1
- package/tsconfig/dist/__tests__/cache.spec.js +0 -85
- package/tsconfig/dist/__tests__/cache.spec.js.map +0 -1
- package/tsconfig/dist/__tests__/fs-atomic.spec.d.ts +0 -6
- package/tsconfig/dist/__tests__/fs-atomic.spec.d.ts.map +0 -1
- package/tsconfig/dist/__tests__/fs-atomic.spec.js +0 -153
- package/tsconfig/dist/__tests__/fs-atomic.spec.js.map +0 -1
- package/tsconfig/dist/__tests__/init-workspace.spec.d.ts +0 -6
- package/tsconfig/dist/__tests__/init-workspace.spec.d.ts.map +0 -1
- package/tsconfig/dist/__tests__/init-workspace.spec.js +0 -99
- package/tsconfig/dist/__tests__/init-workspace.spec.js.map +0 -1
- package/tsconfig/dist/__tests__/kb-error.spec.d.ts +0 -6
- package/tsconfig/dist/__tests__/kb-error.spec.d.ts.map +0 -1
- package/tsconfig/dist/__tests__/kb-error.spec.js +0 -190
- package/tsconfig/dist/__tests__/kb-error.spec.js.map +0 -1
- package/tsconfig/dist/__tests__/preset-lockfile.spec.d.ts +0 -6
- package/tsconfig/dist/__tests__/preset-lockfile.spec.d.ts.map +0 -1
- package/tsconfig/dist/__tests__/preset-lockfile.spec.js +0 -142
- package/tsconfig/dist/__tests__/preset-lockfile.spec.js.map +0 -1
- package/tsconfig/dist/__tests__/product-config-profiles.spec.d.ts +0 -6
- package/tsconfig/dist/__tests__/product-config-profiles.spec.d.ts.map +0 -1
- package/tsconfig/dist/__tests__/product-config-profiles.spec.js +0 -100
- package/tsconfig/dist/__tests__/product-config-profiles.spec.js.map +0 -1
- package/tsconfig/dist/__tests__/product-config.spec.d.ts +0 -6
- package/tsconfig/dist/__tests__/product-config.spec.d.ts.map +0 -1
- package/tsconfig/dist/__tests__/product-config.spec.js +0 -298
- package/tsconfig/dist/__tests__/product-config.spec.js.map +0 -1
- package/tsconfig/dist/__tests__/runtime.spec.d.ts +0 -2
- package/tsconfig/dist/__tests__/runtime.spec.d.ts.map +0 -1
- package/tsconfig/dist/__tests__/runtime.spec.js +0 -127
- package/tsconfig/dist/__tests__/runtime.spec.js.map +0 -1
- package/tsconfig/dist/__tests__/upsert-lockfile.spec.d.ts +0 -6
- package/tsconfig/dist/__tests__/upsert-lockfile.spec.d.ts.map +0 -1
- package/tsconfig/dist/__tests__/upsert-lockfile.spec.js +0 -251
- package/tsconfig/dist/__tests__/upsert-lockfile.spec.js.map +0 -1
- package/tsconfig/dist/__tests__/validate-config.spec.d.ts +0 -2
- package/tsconfig/dist/__tests__/validate-config.spec.d.ts.map +0 -1
- package/tsconfig/dist/__tests__/validate-config.spec.js +0 -14
- package/tsconfig/dist/__tests__/validate-config.spec.js.map +0 -1
- package/tsconfig/dist/api/init-workspace.d.ts +0 -10
- package/tsconfig/dist/api/init-workspace.d.ts.map +0 -1
- package/tsconfig/dist/api/init-workspace.js +0 -191
- package/tsconfig/dist/api/init-workspace.js.map +0 -1
- package/tsconfig/dist/api/product-config.d.ts +0 -21
- package/tsconfig/dist/api/product-config.d.ts.map +0 -1
- package/tsconfig/dist/api/product-config.js +0 -192
- package/tsconfig/dist/api/product-config.js.map +0 -1
- package/tsconfig/dist/api/read-config.d.ts +0 -22
- package/tsconfig/dist/api/read-config.d.ts.map +0 -1
- package/tsconfig/dist/api/read-config.js +0 -105
- package/tsconfig/dist/api/read-config.js.map +0 -1
- package/tsconfig/dist/api/upsert-lockfile.d.ts +0 -10
- package/tsconfig/dist/api/upsert-lockfile.d.ts.map +0 -1
- package/tsconfig/dist/api/upsert-lockfile.js +0 -63
- package/tsconfig/dist/api/upsert-lockfile.js.map +0 -1
- package/tsconfig/dist/cache/fs-cache.d.ts +0 -38
- package/tsconfig/dist/cache/fs-cache.d.ts.map +0 -1
- package/tsconfig/dist/cache/fs-cache.js +0 -142
- package/tsconfig/dist/cache/fs-cache.js.map +0 -1
- package/tsconfig/dist/errors/kb-error.d.ts +0 -32
- package/tsconfig/dist/errors/kb-error.d.ts.map +0 -1
- package/tsconfig/dist/errors/kb-error.js +0 -54
- package/tsconfig/dist/errors/kb-error.js.map +0 -1
- package/tsconfig/dist/fs/__tests__/fs.spec.d.ts +0 -2
- package/tsconfig/dist/fs/__tests__/fs.spec.d.ts.map +0 -1
- package/tsconfig/dist/fs/__tests__/fs.spec.js +0 -22
- package/tsconfig/dist/fs/__tests__/fs.spec.js.map +0 -1
- package/tsconfig/dist/fs/fs.d.ts +0 -6
- package/tsconfig/dist/fs/fs.d.ts.map +0 -1
- package/tsconfig/dist/fs/fs.js +0 -12
- package/tsconfig/dist/fs/fs.js.map +0 -1
- package/tsconfig/dist/fs/index.d.ts +0 -2
- package/tsconfig/dist/fs/index.d.ts.map +0 -1
- package/tsconfig/dist/fs/index.js +0 -2
- package/tsconfig/dist/fs/index.js.map +0 -1
- package/tsconfig/dist/hash/config-hash.d.ts +0 -17
- package/tsconfig/dist/hash/config-hash.d.ts.map +0 -1
- package/tsconfig/dist/hash/config-hash.js +0 -55
- package/tsconfig/dist/hash/config-hash.js.map +0 -1
- package/tsconfig/dist/index.d.ts +0 -5
- package/tsconfig/dist/index.d.ts.map +0 -1
- package/tsconfig/dist/index.js +0 -5
- package/tsconfig/dist/index.js.map +0 -1
- package/tsconfig/dist/lockfile/lockfile.d.ts +0 -54
- package/tsconfig/dist/lockfile/lockfile.d.ts.map +0 -1
- package/tsconfig/dist/lockfile/lockfile.js +0 -141
- package/tsconfig/dist/lockfile/lockfile.js.map +0 -1
- package/tsconfig/dist/logging/__tests__/logger.spec.d.ts +0 -2
- package/tsconfig/dist/logging/__tests__/logger.spec.d.ts.map +0 -1
- package/tsconfig/dist/logging/__tests__/logger.spec.js +0 -65
- package/tsconfig/dist/logging/__tests__/logger.spec.js.map +0 -1
- package/tsconfig/dist/logging/__tests__/redaction.spec.d.ts +0 -2
- package/tsconfig/dist/logging/__tests__/redaction.spec.d.ts.map +0 -1
- package/tsconfig/dist/logging/__tests__/redaction.spec.js +0 -34
- package/tsconfig/dist/logging/__tests__/redaction.spec.js.map +0 -1
- package/tsconfig/dist/logging/__tests__/sinks-and-env.spec.d.ts +0 -2
- package/tsconfig/dist/logging/__tests__/sinks-and-env.spec.d.ts.map +0 -1
- package/tsconfig/dist/logging/__tests__/sinks-and-env.spec.js +0 -90
- package/tsconfig/dist/logging/__tests__/sinks-and-env.spec.js.map +0 -1
- package/tsconfig/dist/logging/index.d.ts +0 -6
- package/tsconfig/dist/logging/index.d.ts.map +0 -1
- package/tsconfig/dist/logging/index.js +0 -6
- package/tsconfig/dist/logging/index.js.map +0 -1
- package/tsconfig/dist/logging/logger.d.ts +0 -9
- package/tsconfig/dist/logging/logger.d.ts.map +0 -1
- package/tsconfig/dist/logging/logger.js +0 -101
- package/tsconfig/dist/logging/logger.js.map +0 -1
- package/tsconfig/dist/logging/redaction.d.ts +0 -7
- package/tsconfig/dist/logging/redaction.d.ts.map +0 -1
- package/tsconfig/dist/logging/redaction.js +0 -23
- package/tsconfig/dist/logging/redaction.js.map +0 -1
- package/tsconfig/dist/logging/sinks/json.d.ts +0 -4
- package/tsconfig/dist/logging/sinks/json.d.ts.map +0 -1
- package/tsconfig/dist/logging/sinks/json.js +0 -23
- package/tsconfig/dist/logging/sinks/json.js.map +0 -1
- package/tsconfig/dist/logging/sinks/stdout.d.ts +0 -3
- package/tsconfig/dist/logging/sinks/stdout.d.ts.map +0 -1
- package/tsconfig/dist/logging/sinks/stdout.js +0 -24
- package/tsconfig/dist/logging/sinks/stdout.js.map +0 -1
- package/tsconfig/dist/logging/types/index.d.ts +0 -2
- package/tsconfig/dist/logging/types/index.d.ts.map +0 -1
- package/tsconfig/dist/logging/types/index.js +0 -2
- package/tsconfig/dist/logging/types/index.js.map +0 -1
- package/tsconfig/dist/logging/types/types.d.ts +0 -37
- package/tsconfig/dist/logging/types/types.d.ts.map +0 -1
- package/tsconfig/dist/logging/types/types.js +0 -2
- package/tsconfig/dist/logging/types/types.js.map +0 -1
- package/tsconfig/dist/merge/layered-merge.d.ts +0 -16
- package/tsconfig/dist/merge/layered-merge.d.ts.map +0 -1
- package/tsconfig/dist/merge/layered-merge.js +0 -97
- package/tsconfig/dist/merge/layered-merge.js.map +0 -1
- package/tsconfig/dist/preset/resolve-preset.d.ts +0 -29
- package/tsconfig/dist/preset/resolve-preset.d.ts.map +0 -1
- package/tsconfig/dist/preset/resolve-preset.js +0 -104
- package/tsconfig/dist/preset/resolve-preset.js.map +0 -1
- package/tsconfig/dist/repo/__tests__/repo.spec.d.ts +0 -2
- package/tsconfig/dist/repo/__tests__/repo.spec.d.ts.map +0 -1
- package/tsconfig/dist/repo/__tests__/repo.spec.js +0 -25
- package/tsconfig/dist/repo/__tests__/repo.spec.js.map +0 -1
- package/tsconfig/dist/repo/index.d.ts +0 -2
- package/tsconfig/dist/repo/index.d.ts.map +0 -1
- package/tsconfig/dist/repo/index.js +0 -2
- package/tsconfig/dist/repo/index.js.map +0 -1
- package/tsconfig/dist/repo/repo.d.ts +0 -6
- package/tsconfig/dist/repo/repo.d.ts.map +0 -1
- package/tsconfig/dist/repo/repo.js +0 -25
- package/tsconfig/dist/repo/repo.js.map +0 -1
- package/tsconfig/dist/runtime/index.d.ts +0 -2
- package/tsconfig/dist/runtime/index.d.ts.map +0 -1
- package/tsconfig/dist/runtime/index.js +0 -2
- package/tsconfig/dist/runtime/index.js.map +0 -1
- package/tsconfig/dist/runtime/runtime.d.ts +0 -46
- package/tsconfig/dist/runtime/runtime.d.ts.map +0 -1
- package/tsconfig/dist/runtime/runtime.js +0 -126
- package/tsconfig/dist/runtime/runtime.js.map +0 -1
- package/tsconfig/dist/tsconfig.tools.tsbuildinfo +0 -1
- package/tsconfig/dist/tsconfig.tsbuildinfo +0 -1
- package/tsconfig/dist/types/index.d.ts +0 -2
- package/tsconfig/dist/types/index.d.ts.map +0 -1
- package/tsconfig/dist/types/index.js +0 -2
- package/tsconfig/dist/types/index.js.map +0 -1
- package/tsconfig/dist/types/init.d.ts +0 -34
- package/tsconfig/dist/types/init.d.ts.map +0 -1
- package/tsconfig/dist/types/init.js +0 -6
- package/tsconfig/dist/types/init.js.map +0 -1
- package/tsconfig/dist/types/preset.d.ts +0 -27
- package/tsconfig/dist/types/preset.d.ts.map +0 -1
- package/tsconfig/dist/types/preset.js +0 -6
- package/tsconfig/dist/types/preset.js.map +0 -1
- package/tsconfig/dist/types/types.d.ts +0 -6
- package/tsconfig/dist/types/types.d.ts.map +0 -1
- package/tsconfig/dist/types/types.js +0 -2
- package/tsconfig/dist/types/types.js.map +0 -1
- package/tsconfig/dist/utils/__tests__/env.spec.d.ts +0 -2
- package/tsconfig/dist/utils/__tests__/env.spec.d.ts.map +0 -1
- package/tsconfig/dist/utils/__tests__/env.spec.js +0 -33
- package/tsconfig/dist/utils/__tests__/env.spec.js.map +0 -1
- package/tsconfig/dist/utils/env.d.ts +0 -7
- package/tsconfig/dist/utils/env.d.ts.map +0 -1
- package/tsconfig/dist/utils/env.js +0 -25
- package/tsconfig/dist/utils/env.js.map +0 -1
- package/tsconfig/dist/utils/fs-atomic.d.ts +0 -15
- package/tsconfig/dist/utils/fs-atomic.d.ts.map +0 -1
- package/tsconfig/dist/utils/fs-atomic.js +0 -45
- package/tsconfig/dist/utils/fs-atomic.js.map +0 -1
- package/tsconfig/dist/utils/index.d.ts +0 -3
- package/tsconfig/dist/utils/index.d.ts.map +0 -1
- package/tsconfig/dist/utils/index.js +0 -3
- package/tsconfig/dist/utils/index.js.map +0 -1
- package/tsconfig/dist/utils/paths.d.ts +0 -21
- package/tsconfig/dist/utils/paths.d.ts.map +0 -1
- package/tsconfig/dist/utils/paths.js +0 -32
- package/tsconfig/dist/utils/paths.js.map +0 -1
- package/tsconfig/dist/utils/product-normalize.d.ts +0 -27
- package/tsconfig/dist/utils/product-normalize.d.ts.map +0 -1
- package/tsconfig/dist/utils/product-normalize.js +0 -45
- package/tsconfig/dist/utils/product-normalize.js.map +0 -1
- package/tsconfig/dist/validation/validate-config.d.ts +0 -7
- package/tsconfig/dist/validation/validate-config.d.ts.map +0 -1
- package/tsconfig/dist/validation/validate-config.js +0 -22
- package/tsconfig/dist/validation/validate-config.js.map +0 -1
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module @kb-labs/core/utils/env
|
|
3
|
-
* Small helpers to convert ENV strings to typed values.
|
|
4
|
-
*/
|
|
5
|
-
export function toBool(v) {
|
|
6
|
-
if (v === undefined) {
|
|
7
|
-
return undefined;
|
|
8
|
-
}
|
|
9
|
-
const s = v.trim().toLowerCase();
|
|
10
|
-
if (s === "1" || s === "true" || s === "yes" || s === "on") {
|
|
11
|
-
return true;
|
|
12
|
-
}
|
|
13
|
-
if (s === "0" || s === "false" || s === "no" || s === "off") {
|
|
14
|
-
return false;
|
|
15
|
-
}
|
|
16
|
-
return undefined; // unknown → let caller decide default
|
|
17
|
-
}
|
|
18
|
-
export function toInt(v) {
|
|
19
|
-
if (v === undefined) {
|
|
20
|
-
return undefined;
|
|
21
|
-
}
|
|
22
|
-
const n = Number(v);
|
|
23
|
-
return Number.isFinite(n) ? n : undefined;
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=env.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"env.js","sourceRoot":"","sources":["../../../../kb-labs-core/packages/config/src/utils/env.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,UAAU,MAAM,CAAC,CAAqB;IACxC,IAAI,CAAC,KAAK,SAAS,EAAE,CAAC;QAAA,OAAO,SAAS,CAAC;IAAA,CAAC;IACxC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACjC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,MAAM,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;QAAA,OAAO,IAAI,CAAC;IAAA,CAAC;IAC1E,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,OAAO,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,KAAK,EAAE,CAAC;QAAA,OAAO,KAAK,CAAC;IAAA,CAAC;IAC5E,OAAO,SAAS,CAAC,CAAC,sCAAsC;AAC5D,CAAC;AAED,MAAM,UAAU,KAAK,CAAC,CAAqB;IACvC,IAAI,CAAC,KAAK,SAAS,EAAE,CAAC;QAAA,OAAO,SAAS,CAAC;IAAA,CAAC;IACxC,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IACpB,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAC9C,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module @kb-labs/core/config/utils/fs-atomic
|
|
3
|
-
* Atomic file write operations using tmp+rename pattern
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Write file atomically using tmp+rename pattern
|
|
7
|
-
* This ensures that the file is never partially written in case of crashes
|
|
8
|
-
*/
|
|
9
|
-
export declare function writeFileAtomic(path: string, data: string | Uint8Array): Promise<void>;
|
|
10
|
-
/**
|
|
11
|
-
* Ensure a path is within the workspace root
|
|
12
|
-
* Throws ERR_PATH_OUTSIDE_WORKSPACE if the path escapes the workspace
|
|
13
|
-
*/
|
|
14
|
-
export declare function ensureWithinWorkspace(targetPath: string, workspaceRoot: string): void;
|
|
15
|
-
//# sourceMappingURL=fs-atomic.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fs-atomic.d.ts","sourceRoot":"","sources":["../../../../kb-labs-core/packages/config/src/utils/fs-atomic.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH;;;GAGG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,GAAG,UAAU,GACxB,OAAO,CAAC,IAAI,CAAC,CAqBf;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,IAAI,CAYrF"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module @kb-labs/core/config/utils/fs-atomic
|
|
3
|
-
* Atomic file write operations using tmp+rename pattern
|
|
4
|
-
*/
|
|
5
|
-
import { promises as fs } from 'node:fs';
|
|
6
|
-
import { resolve } from 'node:path';
|
|
7
|
-
import { KbError } from '../errors/kb-error';
|
|
8
|
-
import { dirname } from 'node:path';
|
|
9
|
-
/**
|
|
10
|
-
* Write file atomically using tmp+rename pattern
|
|
11
|
-
* This ensures that the file is never partially written in case of crashes
|
|
12
|
-
*/
|
|
13
|
-
export async function writeFileAtomic(path, data) {
|
|
14
|
-
const tmp = `${path}.tmp-${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
15
|
-
try {
|
|
16
|
-
// Ensure parent directory exists
|
|
17
|
-
await fs.mkdir(dirname(path), { recursive: true });
|
|
18
|
-
// Write to temp file
|
|
19
|
-
await fs.writeFile(tmp, data, 'utf-8');
|
|
20
|
-
// Atomic rename
|
|
21
|
-
await fs.rename(tmp, path);
|
|
22
|
-
}
|
|
23
|
-
catch (error) {
|
|
24
|
-
// Clean up temp file if it exists
|
|
25
|
-
try {
|
|
26
|
-
await fs.unlink(tmp);
|
|
27
|
-
}
|
|
28
|
-
catch {
|
|
29
|
-
// Ignore cleanup errors
|
|
30
|
-
}
|
|
31
|
-
throw error;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Ensure a path is within the workspace root
|
|
36
|
-
* Throws ERR_PATH_OUTSIDE_WORKSPACE if the path escapes the workspace
|
|
37
|
-
*/
|
|
38
|
-
export function ensureWithinWorkspace(targetPath, workspaceRoot) {
|
|
39
|
-
const absTarget = resolve(targetPath);
|
|
40
|
-
const absRoot = resolve(workspaceRoot);
|
|
41
|
-
if (!absTarget.startsWith(absRoot)) {
|
|
42
|
-
throw new KbError('ERR_PATH_OUTSIDE_WORKSPACE', `Refusing to write outside workspace: ${targetPath}`, 'Check cwd or use a relative path within the workspace', { targetPath, workspaceRoot });
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
//# sourceMappingURL=fs-atomic.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fs-atomic.js","sourceRoot":"","sources":["../../../../kb-labs-core/packages/config/src/utils/fs-atomic.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,IAAY,EACZ,IAAyB;IAEzB,MAAM,GAAG,GAAG,GAAG,IAAI,QAAQ,IAAI,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;IAE/E,IAAI,CAAC;QACH,iCAAiC;QACjC,MAAM,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAEnD,qBAAqB;QACrB,MAAM,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;QAEvC,gBAAgB;QAChB,MAAM,EAAE,CAAC,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAC7B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,kCAAkC;QAClC,IAAI,CAAC;YACH,MAAM,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACvB,CAAC;QAAC,MAAM,CAAC;YACP,wBAAwB;QAC1B,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CAAC,UAAkB,EAAE,aAAqB;IAC7E,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IACtC,MAAM,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IAEvC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QACnC,MAAM,IAAI,OAAO,CACf,4BAA4B,EAC5B,wCAAwC,UAAU,EAAE,EACpD,uDAAuD,EACvD,EAAE,UAAU,EAAE,aAAa,EAAE,CAC9B,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../kb-labs-core/packages/config/src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAA;AACrB,cAAc,qBAAqB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../kb-labs-core/packages/config/src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAA;AACrB,cAAc,qBAAqB,CAAA"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Get profiles root directory
|
|
3
|
-
*/
|
|
4
|
-
export declare function getProfilesRootDir(cwd: string): string;
|
|
5
|
-
/**
|
|
6
|
-
* Get product configuration directory
|
|
7
|
-
*/
|
|
8
|
-
export declare function getProductConfigDir(cwd: string, fsProduct: string): string;
|
|
9
|
-
/**
|
|
10
|
-
* Get product configuration file path
|
|
11
|
-
*/
|
|
12
|
-
export declare function getProductConfigPath(cwd: string, fsProduct: string): string;
|
|
13
|
-
/**
|
|
14
|
-
* Get .kb root directory
|
|
15
|
-
*/
|
|
16
|
-
export declare function getKbRootDir(cwd: string): string;
|
|
17
|
-
/**
|
|
18
|
-
* Get lockfile path
|
|
19
|
-
*/
|
|
20
|
-
export declare function getLockfilePath(cwd: string): string;
|
|
21
|
-
//# sourceMappingURL=paths.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../../../kb-labs-core/packages/config/src/utils/paths.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAE1E;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAE3E;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEhD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEnD"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import path from 'node:path';
|
|
2
|
-
/**
|
|
3
|
-
* Get profiles root directory
|
|
4
|
-
*/
|
|
5
|
-
export function getProfilesRootDir(cwd) {
|
|
6
|
-
return path.join(cwd, '.kb', 'profiles');
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Get product configuration directory
|
|
10
|
-
*/
|
|
11
|
-
export function getProductConfigDir(cwd, fsProduct) {
|
|
12
|
-
return path.join(cwd, '.kb', fsProduct);
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Get product configuration file path
|
|
16
|
-
*/
|
|
17
|
-
export function getProductConfigPath(cwd, fsProduct) {
|
|
18
|
-
return path.join(getProductConfigDir(cwd, fsProduct), `${fsProduct}.config.json`);
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Get .kb root directory
|
|
22
|
-
*/
|
|
23
|
-
export function getKbRootDir(cwd) {
|
|
24
|
-
return path.join(cwd, '.kb');
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Get lockfile path
|
|
28
|
-
*/
|
|
29
|
-
export function getLockfilePath(cwd) {
|
|
30
|
-
return path.join(getKbRootDir(cwd), 'lock.json');
|
|
31
|
-
}
|
|
32
|
-
//# sourceMappingURL=paths.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../../../kb-labs-core/packages/config/src/utils/paths.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,GAAW;IAC5C,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC;AAC3C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,GAAW,EAAE,SAAiB;IAChE,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;AAC1C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,GAAW,EAAE,SAAiB;IACjE,OAAO,IAAI,CAAC,IAAI,CAAC,mBAAmB,CAAC,GAAG,EAAE,SAAS,CAAC,EAAE,GAAG,SAAS,cAAc,CAAC,CAAC;AACpF,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,GAAW;IACtC,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;AAC/B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,GAAW;IACzC,OAAO,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,WAAW,CAAC,CAAC;AACnD,CAAC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module @kb-labs/core/config/utils/product-normalize
|
|
3
|
-
* Product ID normalization between code (camelCase) and filesystem (kebab-case)
|
|
4
|
-
*/
|
|
5
|
-
import type { ProductId } from '../types/types';
|
|
6
|
-
export type { ProductId } from '../types/types';
|
|
7
|
-
/**
|
|
8
|
-
* Convert ProductId to filesystem kebab-case format
|
|
9
|
-
* @param id ProductId in camelCase
|
|
10
|
-
* @returns kebab-case string for filesystem paths
|
|
11
|
-
*/
|
|
12
|
-
export declare function toFsProduct(id: ProductId): string;
|
|
13
|
-
/**
|
|
14
|
-
* Convert filesystem kebab-case key to ProductId
|
|
15
|
-
* @param fsKey kebab-case string from filesystem
|
|
16
|
-
* @returns ProductId in camelCase
|
|
17
|
-
*/
|
|
18
|
-
export declare function toConfigProduct(fsKey: string): ProductId;
|
|
19
|
-
/**
|
|
20
|
-
* Check if a string is a valid ProductId
|
|
21
|
-
*/
|
|
22
|
-
export declare function isValidProductId(value: string): value is ProductId;
|
|
23
|
-
/**
|
|
24
|
-
* Get all valid ProductId values
|
|
25
|
-
*/
|
|
26
|
-
export declare function getAllProductIds(): ProductId[];
|
|
27
|
-
//# sourceMappingURL=product-normalize.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"product-normalize.d.ts","sourceRoot":"","sources":["../../../../kb-labs-core/packages/config/src/utils/product-normalize.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAGhD,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAUhD;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,EAAE,EAAE,SAAS,GAAG,MAAM,CAEjD;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAKxD;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,SAAS,CAElE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,SAAS,EAAE,CAE9C"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module @kb-labs/core/config/utils/product-normalize
|
|
3
|
-
* Product ID normalization between code (camelCase) and filesystem (kebab-case)
|
|
4
|
-
*/
|
|
5
|
-
const FS_MAP = new Map([
|
|
6
|
-
['aiReview', 'ai-review'],
|
|
7
|
-
['aiDocs', 'ai-docs'],
|
|
8
|
-
['devlink', 'devlink'],
|
|
9
|
-
['release', 'release'],
|
|
10
|
-
['devkit', 'devkit'],
|
|
11
|
-
]);
|
|
12
|
-
/**
|
|
13
|
-
* Convert ProductId to filesystem kebab-case format
|
|
14
|
-
* @param id ProductId in camelCase
|
|
15
|
-
* @returns kebab-case string for filesystem paths
|
|
16
|
-
*/
|
|
17
|
-
export function toFsProduct(id) {
|
|
18
|
-
return FS_MAP.get(id) ?? id;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Convert filesystem kebab-case key to ProductId
|
|
22
|
-
* @param fsKey kebab-case string from filesystem
|
|
23
|
-
* @returns ProductId in camelCase
|
|
24
|
-
*/
|
|
25
|
-
export function toConfigProduct(fsKey) {
|
|
26
|
-
for (const [k, v] of FS_MAP) {
|
|
27
|
-
if (v === fsKey) {
|
|
28
|
-
return k;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
return fsKey;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Check if a string is a valid ProductId
|
|
35
|
-
*/
|
|
36
|
-
export function isValidProductId(value) {
|
|
37
|
-
return FS_MAP.has(value);
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Get all valid ProductId values
|
|
41
|
-
*/
|
|
42
|
-
export function getAllProductIds() {
|
|
43
|
-
return Array.from(FS_MAP.keys());
|
|
44
|
-
}
|
|
45
|
-
//# sourceMappingURL=product-normalize.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"product-normalize.js","sourceRoot":"","sources":["../../../../kb-labs-core/packages/config/src/utils/product-normalize.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC;IACrB,CAAC,UAAU,EAAE,WAAW,CAAC;IACzB,CAAC,QAAQ,EAAE,SAAS,CAAC;IACrB,CAAC,SAAS,EAAE,SAAS,CAAC;IACtB,CAAC,SAAS,EAAE,SAAS,CAAC;IACtB,CAAC,QAAQ,EAAE,QAAQ,CAAC;CACrB,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,EAAa;IACvC,OAAO,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC;AAC9B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,KAAa;IAC3C,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,MAAM,EAAE,CAAC;QAC5B,IAAI,CAAC,KAAK,KAAK,EAAE,CAAC;YAAA,OAAO,CAAc,CAAC;QAAA,CAAC;IAC3C,CAAC;IACD,OAAO,KAAkB,CAAC;AAC5B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAa;IAC5C,OAAO,MAAM,CAAC,GAAG,CAAC,KAAkB,CAAC,CAAC;AACxC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB;IAC9B,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAgB,CAAC;AAClD,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ProductId } from '../types';
|
|
2
|
-
export type ValidationResult = {
|
|
3
|
-
ok: boolean;
|
|
4
|
-
errors: any[] | null;
|
|
5
|
-
};
|
|
6
|
-
export declare function validateProductConfig(product: ProductId, config: unknown): ValidationResult;
|
|
7
|
-
//# sourceMappingURL=validate-config.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validate-config.d.ts","sourceRoot":"","sources":["../../../../kb-labs-core/packages/config/src/validation/validate-config.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAU1C,MAAM,MAAM,gBAAgB,GAAG;IAAE,EAAE,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,CAAA;CAAE,CAAC;AAcrE,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,GAAG,gBAAgB,CAO3F"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import Ajv from 'ajv';
|
|
2
|
-
import addFormats from 'ajv-formats';
|
|
3
|
-
import { review as reviewSchema, docs as docsSchema, tests as testsSchema, assistant as assistantSchema, devlink as devlinkSchema, } from '@kb-labs/profile-schemas';
|
|
4
|
-
const ajv = new Ajv({ allErrors: true, strict: false });
|
|
5
|
-
addFormats(ajv);
|
|
6
|
-
const schemaMap = {
|
|
7
|
-
aiReview: reviewSchema,
|
|
8
|
-
aiDocs: docsSchema,
|
|
9
|
-
devlink: devlinkSchema,
|
|
10
|
-
devkit: testsSchema, // placeholder mapping
|
|
11
|
-
release: assistantSchema, // placeholder mapping
|
|
12
|
-
// extend with more products as needed
|
|
13
|
-
};
|
|
14
|
-
export function validateProductConfig(product, config) {
|
|
15
|
-
const schema = schemaMap[product];
|
|
16
|
-
if (!schema)
|
|
17
|
-
return { ok: true, errors: null };
|
|
18
|
-
const validate = ajv.compile(schema);
|
|
19
|
-
const ok = validate(config);
|
|
20
|
-
return { ok: !!ok, errors: validate.errors || null };
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=validate-config.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validate-config.js","sourceRoot":"","sources":["../../../../kb-labs-core/packages/config/src/validation/validate-config.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,UAAU,MAAM,aAAa,CAAC;AAErC,OAAO,EACL,MAAM,IAAI,YAAY,EACtB,IAAI,IAAI,UAAU,EAClB,KAAK,IAAI,WAAW,EACpB,SAAS,IAAI,eAAe,EAC5B,OAAO,IAAI,aAAa,GAEzB,MAAM,0BAA0B,CAAC;AAIlC,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;AACxD,UAAU,CAAC,GAAG,CAAC,CAAC;AAEhB,MAAM,SAAS,GAAoC;IACjD,QAAQ,EAAE,YAAY;IACtB,MAAM,EAAE,UAAU;IAClB,OAAO,EAAE,aAAa;IACtB,MAAM,EAAE,WAAW,EAAE,sBAAsB;IAC3C,OAAO,EAAE,eAAe,EAAE,sBAAsB;IAChD,sCAAsC;CACvC,CAAC;AAEF,MAAM,UAAU,qBAAqB,CAAC,OAAkB,EAAE,MAAe;IACvE,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;IAClC,IAAI,CAAC,MAAM;QAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAE/C,MAAM,QAAQ,GAAG,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACrC,MAAM,EAAE,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC5B,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,IAAI,IAAI,EAAE,CAAC;AACvD,CAAC"}
|