@knowzai/core 0.1.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/dist/logger.js ADDED
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Structured logger with a pluggable secret redactor seam.
3
+ *
4
+ * N1 ships a no-op redactor; N3 installs the real secret-redaction filter via
5
+ * `logger.setRedactor(...)` during CLI startup, BEFORE any auth command runs.
6
+ * Human/log output goes to stderr; machine output (`--json`) is written to
7
+ * stdout by commands directly (not through this logger).
8
+ */
9
+ const LEVEL_RANK = { error: 0, warn: 1, info: 2, debug: 3 };
10
+ function resolveInitialLevel() {
11
+ const env = process.env.KNOWZ_LOG_LEVEL;
12
+ if (env && env in LEVEL_RANK)
13
+ return env;
14
+ return 'info';
15
+ }
16
+ export class Logger {
17
+ level = resolveInitialLevel();
18
+ redactor = (t) => t;
19
+ setRedactor(r) {
20
+ this.redactor = r;
21
+ }
22
+ setLevel(level) {
23
+ this.level = level;
24
+ }
25
+ write(level, msg, meta) {
26
+ if (LEVEL_RANK[level] > LEVEL_RANK[this.level])
27
+ return;
28
+ let line = msg;
29
+ if (meta !== undefined) {
30
+ const serialized = typeof meta === 'string' ? meta : safeStringify(meta);
31
+ line = `${line} ${serialized}`;
32
+ }
33
+ // Always pass output through the redactor before it reaches a stream.
34
+ process.stderr.write(`${this.redactor(line)}\n`);
35
+ }
36
+ error(msg, meta) {
37
+ this.write('error', msg, meta);
38
+ }
39
+ warn(msg, meta) {
40
+ this.write('warn', msg, meta);
41
+ }
42
+ info(msg, meta) {
43
+ this.write('info', msg, meta);
44
+ }
45
+ debug(msg, meta) {
46
+ this.write('debug', msg, meta);
47
+ }
48
+ /** Redact an arbitrary string using the installed redactor (for error rendering). */
49
+ redact(text) {
50
+ return this.redactor(text);
51
+ }
52
+ }
53
+ function safeStringify(value) {
54
+ try {
55
+ return JSON.stringify(value);
56
+ }
57
+ catch {
58
+ return String(value);
59
+ }
60
+ }
61
+ /** Process-wide logger singleton. */
62
+ export const logger = new Logger();
63
+ //# sourceMappingURL=logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,MAAM,UAAU,GAA6B,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;AAEtF,SAAS,mBAAmB;IAC1B,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC;IACxC,IAAI,GAAG,IAAI,GAAG,IAAI,UAAU;QAAE,OAAO,GAAe,CAAC;IACrD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,OAAO,MAAM;IACjB,KAAK,GAAa,mBAAmB,EAAE,CAAC;IAChC,QAAQ,GAAa,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IAEtC,WAAW,CAAC,CAAW;QACrB,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC;IACpB,CAAC;IAED,QAAQ,CAAC,KAAe;QACtB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAEO,KAAK,CAAC,KAAe,EAAE,GAAW,EAAE,IAAc;QACxD,IAAI,UAAU,CAAC,KAAK,CAAC,GAAG,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC;YAAE,OAAO;QACvD,IAAI,IAAI,GAAG,GAAG,CAAC;QACf,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACvB,MAAM,UAAU,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;YACzE,IAAI,GAAG,GAAG,IAAI,IAAI,UAAU,EAAE,CAAC;QACjC,CAAC;QACD,sEAAsE;QACtE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACnD,CAAC;IAED,KAAK,CAAC,GAAW,EAAE,IAAc;QAC/B,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;IACjC,CAAC;IACD,IAAI,CAAC,GAAW,EAAE,IAAc;QAC9B,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;IAChC,CAAC;IACD,IAAI,CAAC,GAAW,EAAE,IAAc;QAC9B,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;IAChC,CAAC;IACD,KAAK,CAAC,GAAW,EAAE,IAAc;QAC/B,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;IACjC,CAAC;IAED,qFAAqF;IACrF,MAAM,CAAC,IAAY;QACjB,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;CACF;AAED,SAAS,aAAa,CAAC,KAAc;IACnC,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;AACH,CAAC;AAED,qCAAqC;AACrC,MAAM,CAAC,MAAM,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type { Redactor } from './logger.js';
2
+ export declare function registerSecret(value: string | undefined | null): void;
3
+ /** Test helper — clear the literal-secret registry. */
4
+ export declare function resetSecretsForTest(): void;
5
+ /** Extract secret values from raw argv (--key/--password, space or = form). */
6
+ export declare function collectArgvSecrets(argv: readonly string[]): string[];
7
+ /**
8
+ * Build the secret-redaction filter (S-N3-5). Masks (1) any registered literal
9
+ * secret value, then (2) the body of any Knowz API key or Bearer token.
10
+ * Installed via `logger.setRedactor(createRedactor())` at CLI startup.
11
+ */
12
+ export declare function createRedactor(): Redactor;
13
+ //# sourceMappingURL=redactor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redactor.d.ts","sourceRoot":"","sources":["../src/redactor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAc5C,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,IAAI,CAErE;AAED,uDAAuD;AACvD,wBAAgB,mBAAmB,IAAI,IAAI,CAE1C;AAMD,+EAA+E;AAC/E,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAmBpE;AAED;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,QAAQ,CASzC"}
@@ -0,0 +1,60 @@
1
+ // kz_ / ukz_ / ksh_ / sh- followed by a key body, and `Bearer <token>`.
2
+ const KEY_RE = /(kzin_|kzai_|kz_|ukz_|ksh_|sh-)[A-Za-z0-9._-]{8,}/g;
3
+ const BEARER_RE = /(Bearer\s+)[A-Za-z0-9._-]{8,}/gi;
4
+ /**
5
+ * Literal-secret registry. Pattern matching can't catch an arbitrary value
6
+ * (e.g. a `--password`), so callers register exact secret strings to mask
7
+ * (SEC-N3-01). The redactor closure reads this live set, so registration may
8
+ * happen after `createRedactor()`.
9
+ */
10
+ const literalSecrets = new Set();
11
+ export function registerSecret(value) {
12
+ if (value && value.length >= 4)
13
+ literalSecrets.add(value);
14
+ }
15
+ /** Test helper — clear the literal-secret registry. */
16
+ export function resetSecretsForTest() {
17
+ literalSecrets.clear();
18
+ }
19
+ function escapeRegExp(s) {
20
+ return s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
21
+ }
22
+ /** Extract secret values from raw argv (--key/--password, space or = form). */
23
+ export function collectArgvSecrets(argv) {
24
+ const out = [];
25
+ const SECRET_FLAGS = new Set([
26
+ '--key',
27
+ '--password',
28
+ '--passphrase',
29
+ '--azure-api-key',
30
+ '--openai-api-key',
31
+ '--paste',
32
+ ]);
33
+ for (let i = 0; i < argv.length; i++) {
34
+ const a = argv[i];
35
+ if (SECRET_FLAGS.has(a) && argv[i + 1] !== undefined)
36
+ out.push(argv[i + 1]);
37
+ else {
38
+ const equalsAt = a.indexOf('=');
39
+ if (equalsAt > 0 && SECRET_FLAGS.has(a.slice(0, equalsAt)))
40
+ out.push(a.slice(equalsAt + 1));
41
+ }
42
+ }
43
+ return out;
44
+ }
45
+ /**
46
+ * Build the secret-redaction filter (S-N3-5). Masks (1) any registered literal
47
+ * secret value, then (2) the body of any Knowz API key or Bearer token.
48
+ * Installed via `logger.setRedactor(createRedactor())` at CLI startup.
49
+ */
50
+ export function createRedactor() {
51
+ return (text) => {
52
+ let out = text;
53
+ // Literal secrets first, longest-first to avoid partial overlaps.
54
+ for (const s of [...literalSecrets].sort((a, b) => b.length - a.length)) {
55
+ out = out.replace(new RegExp(escapeRegExp(s), 'g'), '***');
56
+ }
57
+ return out.replace(BEARER_RE, '$1***').replace(KEY_RE, (_m, prefix) => `${prefix}***`);
58
+ };
59
+ }
60
+ //# sourceMappingURL=redactor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redactor.js","sourceRoot":"","sources":["../src/redactor.ts"],"names":[],"mappings":"AAEA,wEAAwE;AACxE,MAAM,MAAM,GAAG,oDAAoD,CAAC;AACpE,MAAM,SAAS,GAAG,iCAAiC,CAAC;AAEpD;;;;;GAKG;AACH,MAAM,cAAc,GAAG,IAAI,GAAG,EAAU,CAAC;AAEzC,MAAM,UAAU,cAAc,CAAC,KAAgC;IAC7D,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM,IAAI,CAAC;QAAE,cAAc,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AAC5D,CAAC;AAED,uDAAuD;AACvD,MAAM,UAAU,mBAAmB;IACjC,cAAc,CAAC,KAAK,EAAE,CAAC;AACzB,CAAC;AAED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AC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;YACxE,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;QAC7D,CAAC;QACD,OAAO,GAAG,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,MAAc,EAAE,EAAE,CAAC,GAAG,MAAM,KAAK,CAAC,CAAC;IACjG,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Settings helpers: read/edit the config (profiles + active profile) with
3
+ * validation. Pure (operate on an in-memory KnowzConfig); commands load → mutate
4
+ * → saveConfig. No secrets live in config (credentials are in the keychain).
5
+ */
6
+ import { type KnowzConfig, type ProfileConfig } from './config.js';
7
+ export declare const SETTABLE_KEYS: readonly ["apiUrl", "defaultVaultId", "email", "label", "pgDsn"];
8
+ export type SettableKey = (typeof SETTABLE_KEYS)[number];
9
+ export declare function isSettableKey(k: string): k is SettableKey;
10
+ /** Flatten a profile to a `key: value` view (omitting undefined). */
11
+ export declare function profileView(profile: ProfileConfig): Record<string, string>;
12
+ /** Get a single setting from a profile. */
13
+ export declare function getProfileValue(cfg: KnowzConfig, profileName: string, key: string): string | undefined;
14
+ /** Set + validate a single setting on a profile (creates the profile if needed). */
15
+ export declare function setProfileValue(cfg: KnowzConfig, profileName: string, key: string, value: string): void;
16
+ export declare function addProfile(cfg: KnowzConfig, name: string, apiUrl: string): void;
17
+ export declare function useProfile(cfg: KnowzConfig, name: string): void;
18
+ export declare function removeProfile(cfg: KnowzConfig, name: string): void;
19
+ //# sourceMappingURL=settings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../src/settings.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,aAAa,EAInB,MAAM,aAAa,CAAC;AAGrB,eAAO,MAAM,aAAa,kEAAmE,CAAC;AAC9F,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,GAAG,CAAC,IAAI,WAAW,CAEzD;AAED,qEAAqE;AACrE,wBAAgB,WAAW,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAO1E;AAED,2CAA2C;AAC3C,wBAAgB,eAAe,CAC7B,GAAG,EAAE,WAAW,EAChB,WAAW,EAAE,MAAM,EACnB,GAAG,EAAE,MAAM,GACV,MAAM,GAAG,SAAS,CAQpB;AAED,oFAAoF;AACpF,wBAAgB,eAAe,CAC7B,GAAG,EAAE,WAAW,EAChB,WAAW,EAAE,MAAM,EACnB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,GACZ,IAAI,CAmBN;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAK/E;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAQ/D;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAMlE"}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Settings helpers: read/edit the config (profiles + active profile) with
3
+ * validation. Pure (operate on an in-memory KnowzConfig); commands load → mutate
4
+ * → saveConfig. No secrets live in config (credentials are in the keychain).
5
+ */
6
+ import { ProfileConfigSchema, BUILTIN_API_URLS, DEFAULT_API_URL, } from './config.js';
7
+ import { KnowzError, ExitCode } from './errors.js';
8
+ export const SETTABLE_KEYS = ['apiUrl', 'defaultVaultId', 'email', 'label', 'pgDsn'];
9
+ export function isSettableKey(k) {
10
+ return SETTABLE_KEYS.includes(k);
11
+ }
12
+ /** Flatten a profile to a `key: value` view (omitting undefined). */
13
+ export function profileView(profile) {
14
+ const out = {};
15
+ for (const k of SETTABLE_KEYS) {
16
+ const v = profile[k];
17
+ if (v !== undefined)
18
+ out[k] = v;
19
+ }
20
+ return out;
21
+ }
22
+ /** Get a single setting from a profile. */
23
+ export function getProfileValue(cfg, profileName, key) {
24
+ if (!isSettableKey(key)) {
25
+ throw new KnowzError(`Unknown setting '${key}'. Settable: ${SETTABLE_KEYS.join(', ')}`, ExitCode.Usage);
26
+ }
27
+ return cfg.profiles[profileName]?.[key];
28
+ }
29
+ /** Set + validate a single setting on a profile (creates the profile if needed). */
30
+ export function setProfileValue(cfg, profileName, key, value) {
31
+ if (!isSettableKey(key)) {
32
+ throw new KnowzError(`Unknown setting '${key}'. Settable: ${SETTABLE_KEYS.join(', ')}`, ExitCode.Usage);
33
+ }
34
+ const base = cfg.profiles[profileName] ?? { apiUrl: BUILTIN_API_URLS[profileName] ?? DEFAULT_API_URL };
35
+ const next = { ...base, [key]: value };
36
+ const parsed = ProfileConfigSchema.safeParse(next);
37
+ if (!parsed.success) {
38
+ const issue = parsed.error.issues[0];
39
+ throw new KnowzError(`Invalid value for '${key}'${issue ? `: ${issue.message}` : ''}`, ExitCode.Usage);
40
+ }
41
+ cfg.profiles[profileName] = parsed.data;
42
+ }
43
+ export function addProfile(cfg, name, apiUrl) {
44
+ if (cfg.profiles[name])
45
+ throw new KnowzError(`Profile '${name}' already exists.`, ExitCode.Usage);
46
+ const parsed = ProfileConfigSchema.safeParse({ apiUrl });
47
+ if (!parsed.success)
48
+ throw new KnowzError(`Invalid api-url: ${apiUrl}`, ExitCode.Usage);
49
+ cfg.profiles[name] = parsed.data;
50
+ }
51
+ export function useProfile(cfg, name) {
52
+ if (!cfg.profiles[name]) {
53
+ throw new KnowzError(`No profile '${name}'. Known: ${Object.keys(cfg.profiles).join(', ')}`, ExitCode.Usage);
54
+ }
55
+ cfg.activeProfile = name;
56
+ }
57
+ export function removeProfile(cfg, name) {
58
+ if (!cfg.profiles[name])
59
+ throw new KnowzError(`No profile '${name}'.`, ExitCode.Usage);
60
+ if (cfg.activeProfile === name) {
61
+ throw new KnowzError(`Cannot remove the active profile '${name}'. Switch first.`, ExitCode.Usage);
62
+ }
63
+ delete cfg.profiles[name];
64
+ }
65
+ //# sourceMappingURL=settings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings.js","sourceRoot":"","sources":["../src/settings.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAGL,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,GAChB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEnD,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,QAAQ,EAAE,gBAAgB,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAU,CAAC;AAG9F,MAAM,UAAU,aAAa,CAAC,CAAS;IACrC,OAAQ,aAAmC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;AAC1D,CAAC;AAED,qEAAqE;AACrE,MAAM,UAAU,WAAW,CAAC,OAAsB;IAChD,MAAM,GAAG,GAA2B,EAAE,CAAC;IACvC,KAAK,MAAM,CAAC,IAAI,aAAa,EAAE,CAAC;QAC9B,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;QACrB,IAAI,CAAC,KAAK,SAAS;YAAE,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IAClC,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,2CAA2C;AAC3C,MAAM,UAAU,eAAe,CAC7B,GAAgB,EAChB,WAAmB,EACnB,GAAW;IAEX,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,EAAE,CAAC;QACxB,MAAM,IAAI,UAAU,CAClB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@
1
+ {
2
+ "name": "@knowzai/core",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "exports": {
6
+ ".": {
7
+ "types": "./dist/index.d.ts",
8
+ "import": "./dist/index.js"
9
+ }
10
+ },
11
+ "main": "./dist/index.js",
12
+ "types": "./dist/index.d.ts",
13
+ "files": [
14
+ "dist"
15
+ ],
16
+ "dependencies": {
17
+ "@napi-rs/keyring": "^1.1.6",
18
+ "zod": "^3.24.1",
19
+ "@knowzai/types": "0.1.0"
20
+ },
21
+ "license": "MIT",
22
+ "author": "Knowz",
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "https://github.com/knowz-io/knowz-platform.git",
26
+ "directory": "cli/core"
27
+ },
28
+ "publishConfig": {
29
+ "access": "public"
30
+ },
31
+ "engines": {
32
+ "node": ">=20"
33
+ },
34
+ "scripts": {
35
+ "build": "tsc -b"
36
+ }
37
+ }