superlore-cli 0.7.1 → 0.7.3

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/config.d.ts CHANGED
@@ -35,6 +35,17 @@ interface SuperloreMcpConfig {
35
35
  /** Route the MCP is served at. Defaults to {@link DEFAULT_MCP_PATH}. */
36
36
  path?: string;
37
37
  }
38
+ /** A navbar logo — light/dark image paths + an optional home link, the mint.json way. */
39
+ interface SuperloreLogo {
40
+ light?: string;
41
+ dark?: string;
42
+ href?: string;
43
+ }
44
+ /** Brand typefaces — family names the layout wires to `--font-sans` / `--font-mono`. */
45
+ interface SuperloreFont {
46
+ sans?: string;
47
+ mono?: string;
48
+ }
38
49
  /** The parsed, validated shape of a `superlore.json` file. */
39
50
  interface SuperloreJson {
40
51
  /** Human-facing KB name. */
@@ -43,6 +54,14 @@ interface SuperloreJson {
43
54
  type: SuperloreType;
44
55
  /** Brand accent — any CSS colour. superlore derives the rest of the family (light + dark). */
45
56
  accent?: string;
57
+ /** Visual theme skin: "default" | "mint" (loose — forward-compatible with future skins). */
58
+ theme?: string;
59
+ /** Navbar logo — light/dark images + home link (mint.json-style). */
60
+ logo?: SuperloreLogo;
61
+ /** Favicon path (svg / png / ico). */
62
+ favicon?: string;
63
+ /** Brand typefaces (the layout wires these to `--font-sans` / `--font-mono`). */
64
+ font?: SuperloreFont;
46
65
  /** The human gate. Omitted ⇒ public. */
47
66
  auth?: SuperloreAuthConfig;
48
67
  /** The agent surface. Omitted ⇒ MCP enabled at the default path. */
@@ -84,4 +103,4 @@ declare function serializeSuperloreJson(config: SuperloreJson): string;
84
103
  /** Resolve the MCP path for a config, falling back to the default when enabled and unset. */
85
104
  declare function resolveMcpPath(config: SuperloreJson): string | undefined;
86
105
 
87
- export { DEFAULT_MCP_PATH, SUPERLORE_JSON_FILENAME, SUPERLORE_TYPES, type SuperloreAuthConfig, type SuperloreAuthProvider, type SuperloreJson, type SuperloreJsonIssue, type SuperloreJsonResult, type SuperloreMcpConfig, type SuperloreType, parseSuperloreJson, resolveMcpPath, serializeSuperloreJson, validateSuperloreJson };
106
+ export { DEFAULT_MCP_PATH, SUPERLORE_JSON_FILENAME, SUPERLORE_TYPES, type SuperloreAuthConfig, type SuperloreAuthProvider, type SuperloreFont, type SuperloreJson, type SuperloreJsonIssue, type SuperloreJsonResult, type SuperloreLogo, type SuperloreMcpConfig, type SuperloreType, parseSuperloreJson, resolveMcpPath, serializeSuperloreJson, validateSuperloreJson };
package/dist/config.js CHANGED
@@ -29,6 +29,49 @@ function validateSuperloreJson(input) {
29
29
  if (accent !== void 0 && (typeof accent !== "string" || accent.trim().length === 0)) {
30
30
  issues.push({ path: "accent", message: "must be a non-empty string (a CSS colour)" });
31
31
  }
32
+ const theme = input.theme;
33
+ if (theme !== void 0 && (typeof theme !== "string" || theme.trim().length === 0)) {
34
+ issues.push({ path: "theme", message: "must be a non-empty string" });
35
+ }
36
+ const favicon = input.favicon;
37
+ if (favicon !== void 0 && (typeof favicon !== "string" || favicon.trim().length === 0)) {
38
+ issues.push({ path: "favicon", message: "must be a non-empty string (a path or URL)" });
39
+ }
40
+ let font;
41
+ if (input.font !== void 0) {
42
+ if (!isRecord(input.font)) {
43
+ issues.push({ path: "font", message: "must be an object" });
44
+ } else {
45
+ const f = input.font;
46
+ for (const k of ["sans", "mono"]) {
47
+ if (f[k] !== void 0 && (typeof f[k] !== "string" || f[k].trim().length === 0)) {
48
+ issues.push({ path: `font.${k}`, message: "must be a non-empty string" });
49
+ }
50
+ }
51
+ font = {
52
+ sans: typeof f.sans === "string" ? f.sans : void 0,
53
+ mono: typeof f.mono === "string" ? f.mono : void 0
54
+ };
55
+ }
56
+ }
57
+ let logo;
58
+ if (input.logo !== void 0) {
59
+ if (!isRecord(input.logo)) {
60
+ issues.push({ path: "logo", message: "must be an object" });
61
+ } else {
62
+ const l = input.logo;
63
+ for (const k of ["light", "dark", "href"]) {
64
+ if (l[k] !== void 0 && (typeof l[k] !== "string" || l[k].trim().length === 0)) {
65
+ issues.push({ path: `logo.${k}`, message: "must be a non-empty string" });
66
+ }
67
+ }
68
+ logo = {
69
+ light: typeof l.light === "string" ? l.light : void 0,
70
+ dark: typeof l.dark === "string" ? l.dark : void 0,
71
+ href: typeof l.href === "string" ? l.href : void 0
72
+ };
73
+ }
74
+ }
32
75
  let auth;
33
76
  if (input.auth !== void 0) {
34
77
  if (!isRecord(input.auth)) {
@@ -82,6 +125,10 @@ function validateSuperloreJson(input) {
82
125
  type
83
126
  };
84
127
  if (typeof accent === "string") value.accent = accent.trim();
128
+ if (typeof theme === "string") value.theme = theme.trim();
129
+ if (typeof favicon === "string") value.favicon = favicon.trim();
130
+ if (font && (font.sans || font.mono)) value.font = font;
131
+ if (logo && (logo.light || logo.dark || logo.href)) value.logo = logo;
85
132
  if (auth) value.auth = auth;
86
133
  if (mcp) value.mcp = mcp;
87
134
  return { ok: true, value };
package/dist/index.d.ts CHANGED
@@ -37,6 +37,17 @@ interface SuperloreMcpConfig {
37
37
  /** Route the MCP is served at. Defaults to {@link DEFAULT_MCP_PATH}. */
38
38
  path?: string;
39
39
  }
40
+ /** A navbar logo — light/dark image paths + an optional home link, the mint.json way. */
41
+ interface SuperloreLogo {
42
+ light?: string;
43
+ dark?: string;
44
+ href?: string;
45
+ }
46
+ /** Brand typefaces — family names the layout wires to `--font-sans` / `--font-mono`. */
47
+ interface SuperloreFont {
48
+ sans?: string;
49
+ mono?: string;
50
+ }
40
51
  /** The parsed, validated shape of a `superlore.json` file. */
41
52
  interface SuperloreJson {
42
53
  /** Human-facing KB name. */
@@ -45,6 +56,14 @@ interface SuperloreJson {
45
56
  type: SuperloreType;
46
57
  /** Brand accent — any CSS colour. superlore derives the rest of the family (light + dark). */
47
58
  accent?: string;
59
+ /** Visual theme skin: "default" | "mint" (loose — forward-compatible with future skins). */
60
+ theme?: string;
61
+ /** Navbar logo — light/dark images + home link (mint.json-style). */
62
+ logo?: SuperloreLogo;
63
+ /** Favicon path (svg / png / ico). */
64
+ favicon?: string;
65
+ /** Brand typefaces (the layout wires these to `--font-sans` / `--font-mono`). */
66
+ font?: SuperloreFont;
48
67
  /** The human gate. Omitted ⇒ public. */
49
68
  auth?: SuperloreAuthConfig;
50
69
  /** The agent surface. Omitted ⇒ MCP enabled at the default path. */
@@ -87,10 +106,10 @@ declare function serializeSuperloreJson(config: SuperloreJson): string;
87
106
  declare function resolveMcpPath(config: SuperloreJson): string | undefined;
88
107
 
89
108
  /** The CLI version, kept in sync with package.json at build time. */
90
- declare const VERSION = "0.7.1";
109
+ declare const VERSION = "0.7.3";
91
110
  /** Build the argument parser. Exported for tests; `run()` wires it to argv. */
92
111
  declare function buildCli(argv?: readonly string[]): cac.CAC;
93
112
  /** Parse argv and dispatch. Reports unknown commands and unexpected errors cleanly. */
94
113
  declare function run(argv?: readonly string[]): Promise<void>;
95
114
 
96
- export { DEFAULT_MCP_PATH, SUPERLORE_JSON_FILENAME, SUPERLORE_TYPES, type SuperloreAuthConfig, type SuperloreAuthProvider, type SuperloreJson, type SuperloreJsonIssue, type SuperloreJsonResult, type SuperloreMcpConfig, type SuperloreType, VERSION, buildCli, parseSuperloreJson, resolveMcpPath, run, serializeSuperloreJson, validateSuperloreJson };
115
+ export { DEFAULT_MCP_PATH, SUPERLORE_JSON_FILENAME, SUPERLORE_TYPES, type SuperloreAuthConfig, type SuperloreAuthProvider, type SuperloreFont, type SuperloreJson, type SuperloreJsonIssue, type SuperloreJsonResult, type SuperloreLogo, type SuperloreMcpConfig, type SuperloreType, VERSION, buildCli, parseSuperloreJson, resolveMcpPath, run, serializeSuperloreJson, validateSuperloreJson };
package/dist/index.js CHANGED
@@ -100,6 +100,49 @@ function validateSuperloreJson(input) {
100
100
  if (accent2 !== void 0 && (typeof accent2 !== "string" || accent2.trim().length === 0)) {
101
101
  issues.push({ path: "accent", message: "must be a non-empty string (a CSS colour)" });
102
102
  }
103
+ const theme = input.theme;
104
+ if (theme !== void 0 && (typeof theme !== "string" || theme.trim().length === 0)) {
105
+ issues.push({ path: "theme", message: "must be a non-empty string" });
106
+ }
107
+ const favicon = input.favicon;
108
+ if (favicon !== void 0 && (typeof favicon !== "string" || favicon.trim().length === 0)) {
109
+ issues.push({ path: "favicon", message: "must be a non-empty string (a path or URL)" });
110
+ }
111
+ let font;
112
+ if (input.font !== void 0) {
113
+ if (!isRecord(input.font)) {
114
+ issues.push({ path: "font", message: "must be an object" });
115
+ } else {
116
+ const f = input.font;
117
+ for (const k of ["sans", "mono"]) {
118
+ if (f[k] !== void 0 && (typeof f[k] !== "string" || f[k].trim().length === 0)) {
119
+ issues.push({ path: `font.${k}`, message: "must be a non-empty string" });
120
+ }
121
+ }
122
+ font = {
123
+ sans: typeof f.sans === "string" ? f.sans : void 0,
124
+ mono: typeof f.mono === "string" ? f.mono : void 0
125
+ };
126
+ }
127
+ }
128
+ let logo;
129
+ if (input.logo !== void 0) {
130
+ if (!isRecord(input.logo)) {
131
+ issues.push({ path: "logo", message: "must be an object" });
132
+ } else {
133
+ const l = input.logo;
134
+ for (const k of ["light", "dark", "href"]) {
135
+ if (l[k] !== void 0 && (typeof l[k] !== "string" || l[k].trim().length === 0)) {
136
+ issues.push({ path: `logo.${k}`, message: "must be a non-empty string" });
137
+ }
138
+ }
139
+ logo = {
140
+ light: typeof l.light === "string" ? l.light : void 0,
141
+ dark: typeof l.dark === "string" ? l.dark : void 0,
142
+ href: typeof l.href === "string" ? l.href : void 0
143
+ };
144
+ }
145
+ }
103
146
  let auth;
104
147
  if (input.auth !== void 0) {
105
148
  if (!isRecord(input.auth)) {
@@ -153,6 +196,10 @@ function validateSuperloreJson(input) {
153
196
  type
154
197
  };
155
198
  if (typeof accent2 === "string") value.accent = accent2.trim();
199
+ if (typeof theme === "string") value.theme = theme.trim();
200
+ if (typeof favicon === "string") value.favicon = favicon.trim();
201
+ if (font && (font.sans || font.mono)) value.font = font;
202
+ if (logo && (logo.light || logo.dark || logo.href)) value.logo = logo;
156
203
  if (auth) value.auth = auth;
157
204
  if (mcp) value.mcp = mcp;
158
205
  return { ok: true, value };
@@ -1940,14 +1987,22 @@ export default config;
1940
1987
  "app/layout.tsx",
1941
1988
  `import type { ReactNode } from "react";
1942
1989
  import { RootProvider } from "superlore/ui";
1990
+ import config from "../superlore.json";
1943
1991
  import "./global.css";
1944
1992
 
1945
1993
  export default function RootLayout({ children }: { children: ReactNode }) {
1946
- // Light and dark are co-equal; default to the system preference.
1994
+ // Light and dark are co-equal; default to the system preference. From superlore.json: \`theme\`
1995
+ // picks the visual skin (default | mint | geist | ledger | obsidian | prism | paste) and \`accent\`
1996
+ // drives the whole brand palette \u2014 change them there, no code edits.
1997
+ const theme = (config as { theme?: string }).theme;
1947
1998
  return (
1948
- <html lang="en" suppressHydrationWarning>
1999
+ <html
2000
+ lang="en"
2001
+ suppressHydrationWarning
2002
+ data-sl-theme={theme && theme !== "default" ? theme : undefined}
2003
+ >
1949
2004
  <body>
1950
- <RootProvider>{children}</RootProvider>
2005
+ <RootProvider accent={(config as { accent?: string }).accent}>{children}</RootProvider>
1951
2006
  </body>
1952
2007
  </html>
1953
2008
  );
@@ -2372,6 +2427,8 @@ async function initCommand(dir, flags) {
2372
2427
  const auth = authEnabled ? { enabled: true, provider: "google", ...allowedDomain ? { allowedDomain } : {} } : void 0;
2373
2428
  const draft = { name, type };
2374
2429
  if (accentColor) draft.accent = accentColor;
2430
+ const themeName = flags.theme?.trim();
2431
+ if (themeName) draft.theme = themeName;
2375
2432
  if (auth) draft.auth = auth;
2376
2433
  draft.mcp = { enabled: mcpEnabled, ...mcpEnabled ? { path: DEFAULT_MCP_PATH } : {} };
2377
2434
  const result = validateSuperloreJson(draft);
@@ -2486,7 +2543,7 @@ function printNextSteps(root, config) {
2486
2543
  }
2487
2544
 
2488
2545
  // src/index.ts
2489
- var VERSION = "0.7.1";
2546
+ var VERSION = "0.7.3";
2490
2547
  function buildCli(argv = process3.argv) {
2491
2548
  const cli = cac("superlore");
2492
2549
  cli.command("init [dir]", "Scaffold a new superlore knowledge base").option("--name <name>", "KB name").option("--type <type>", "KB type: company-kb | product-docs | personal-kb").option("--auth", "Enable the Google SSO auth gate").option("--no-auth", "Disable the auth gate").option("--allowed-domain <domain>", "Restrict SSO to one email domain (implies --auth)").option("--accent <color>", "Brand accent colour (any CSS colour)").option("--no-mcp", "Disable the MCP endpoint (on by default)").option("--connect", "Install the editor extension after scaffolding (skip the prompt)").option("--no-connect", "Don't set up the editor extension").option("-y, --yes", "Skip prompts; use flags + defaults").example("superlore init my-kb --type product-docs").example("superlore init acme --type company-kb --auth --allowed-domain acme.com").example("superlore init me --type personal-kb").action(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "superlore-cli",
3
- "version": "0.7.1",
3
+ "version": "0.7.3",
4
4
  "description": "The superlore CLI — scaffold, run, and build an agent-native knowledge base. One corpus. Humans and agents.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Krishnan S G",