knowmind 0.1.23 → 0.1.24
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/bin/knowmind.js +23 -1
- package/package.json +1 -1
- package/src/install.js +12 -0
- package/src/mcp-stdio.js +2 -2
package/bin/knowmind.js
CHANGED
|
@@ -76,10 +76,29 @@ ENV-Override:
|
|
|
76
76
|
`);
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
+
/**
|
|
80
|
+
* Klarer Hinweis, wo man ein kostenloses Konto + Token bekommt. Wird gezeigt,
|
|
81
|
+
* sobald (noch) kein gültiger Token vorliegt — der häufigste Stolperstein für
|
|
82
|
+
* Erstnutzer. API/CLI sind im kostenlosen Tarif enthalten (bis 2.500 Memories).
|
|
83
|
+
* apiUrl wird dynamisch bezogen (--api / KNOWMIND_API_URL / Default), nie geraten.
|
|
84
|
+
*/
|
|
85
|
+
function printRegisterHint(api) {
|
|
86
|
+
const base = api || process.env.KNOWMIND_API_URL || "https://knowmind.de";
|
|
87
|
+
console.log(
|
|
88
|
+
"\nknowmind braucht ein kostenloses Konto + einen API-Token:\n" +
|
|
89
|
+
` 1. Konto anlegen: ${base}/signin?mode=register\n` +
|
|
90
|
+
` 2. Token erzeugen: ${base}/dashboard/tokens (Dashboard -> API-Tokens -> Token erstellen)\n` +
|
|
91
|
+
" 3. Einloggen: knowmind login --token kmt_...\n\n" +
|
|
92
|
+
"API und CLI sind im kostenlosen Tarif enthalten (bis 2.500 Erinnerungen).\n",
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
|
|
79
96
|
async function runLogin() {
|
|
80
97
|
let token = parseFlag("--token", null);
|
|
81
98
|
const api = parseFlag("--api", null);
|
|
82
99
|
if (!token) {
|
|
100
|
+
// Kein Token übergeben -> erst zeigen, wo man ihn herbekommt, dann fragen.
|
|
101
|
+
printRegisterHint(api);
|
|
83
102
|
// Interaktiv von stdin lesen
|
|
84
103
|
process.stdout.write("API-Token (kmt_…): ");
|
|
85
104
|
const line = await new Promise((resolve) => {
|
|
@@ -87,8 +106,10 @@ async function runLogin() {
|
|
|
87
106
|
});
|
|
88
107
|
token = line;
|
|
89
108
|
}
|
|
90
|
-
if (!token || !token.startsWith("kmt_"))
|
|
109
|
+
if (!token || !token.startsWith("kmt_")) {
|
|
110
|
+
printRegisterHint(api);
|
|
91
111
|
throw new Error("Token muss mit kmt_ beginnen.");
|
|
112
|
+
}
|
|
92
113
|
|
|
93
114
|
// Vor dem Speichern: Token gegen Server verifizieren. Sonst wäre jeder
|
|
94
115
|
// Phantasie-String akzeptiert und alle späteren Aufrufe scheitern erst
|
|
@@ -114,6 +135,7 @@ async function runLogin() {
|
|
|
114
135
|
process.stdout.write("ABGELEHNT\n");
|
|
115
136
|
const code = data.error?.code ?? r.status;
|
|
116
137
|
const msg = data.error?.message ?? `HTTP ${r.status}`;
|
|
138
|
+
printRegisterHint(api);
|
|
117
139
|
throw new Error(`Token ungültig: ${code} — ${msg}`);
|
|
118
140
|
}
|
|
119
141
|
process.stdout.write("ok\n");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "knowmind",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.24",
|
|
4
4
|
"mcpName": "io.github.Schubeler-Consulting/knowmind",
|
|
5
5
|
"description": "Knowmind — das Agentengehirn aus Deutschland: CLI + MCP-Server (Langzeitgedächtnis & Wissensgraph für Ihre KI, Server in Deutschland).",
|
|
6
6
|
"type": "module",
|
package/src/install.js
CHANGED
|
@@ -252,4 +252,16 @@ export function runInstall(opts) {
|
|
|
252
252
|
console.log(` → ${path} nutzt \${KNOWMIND_TOKEN} aus der Umgebung (git-sicher).`);
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
|
+
|
|
256
|
+
// Wer ohne --token installiert, braucht noch einen Token aus einem (kostenlosen)
|
|
257
|
+
// Konto — genau hier scheitern Erstnutzer. Daher der klare Weg zum Abschluss.
|
|
258
|
+
if (!literalToken && !dryRun && !printOnly) {
|
|
259
|
+
const base = apiUrl || DEFAULT_API;
|
|
260
|
+
console.log(
|
|
261
|
+
"\nNoch kein Token? knowmind ist im kostenlosen Tarif voll nutzbar (bis 2.500 Erinnerungen):\n" +
|
|
262
|
+
` 1. Konto anlegen: ${base}/signin?mode=register\n` +
|
|
263
|
+
` 2. Token erzeugen: ${base}/dashboard/tokens\n` +
|
|
264
|
+
" 3. knowmind login --token kmt_... (oder KNOWMIND_TOKEN setzen)\n",
|
|
265
|
+
);
|
|
266
|
+
}
|
|
255
267
|
}
|
package/src/mcp-stdio.js
CHANGED
|
@@ -116,7 +116,7 @@ async function probeAuth() {
|
|
|
116
116
|
return {
|
|
117
117
|
ok: false,
|
|
118
118
|
reason:
|
|
119
|
-
"Kein Knowmind-Token konfiguriert.
|
|
119
|
+
"Kein Knowmind-Token konfiguriert. Kostenloses Konto + Token: https://knowmind.de/signin?mode=register (danach Dashboard -> API-Tokens), dann `knowmind login` im Terminal.",
|
|
120
120
|
};
|
|
121
121
|
}
|
|
122
122
|
if (!cfg.token.startsWith("kmt_")) {
|
|
@@ -181,7 +181,7 @@ export async function runStdioServer() {
|
|
|
181
181
|
? {
|
|
182
182
|
ok: false,
|
|
183
183
|
reason:
|
|
184
|
-
"Kein Knowmind-Token konfiguriert.
|
|
184
|
+
"Kein Knowmind-Token konfiguriert. Kostenloses Konto + Token: https://knowmind.de/signin?mode=register (danach Dashboard -> API-Tokens), dann `knowmind login` im Terminal.",
|
|
185
185
|
}
|
|
186
186
|
: await probeAuth();
|
|
187
187
|
if (discoveryMode) {
|