shiva-code 0.6.4 → 0.7.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.
|
@@ -272,13 +272,24 @@ var ApiClient = class {
|
|
|
272
272
|
* Get all memories across projects
|
|
273
273
|
*/
|
|
274
274
|
async getAllMemories() {
|
|
275
|
-
|
|
275
|
+
const result = await this.request("/memories");
|
|
276
|
+
return result.memories || [];
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Create a new memory (uses /api/memories endpoint)
|
|
280
|
+
*/
|
|
281
|
+
async createMemory(data) {
|
|
282
|
+
return this.request("/memories", {
|
|
283
|
+
method: "POST",
|
|
284
|
+
body: JSON.stringify(data)
|
|
285
|
+
});
|
|
276
286
|
}
|
|
277
287
|
/**
|
|
278
288
|
* Search memories
|
|
279
289
|
*/
|
|
280
290
|
async searchMemories(query) {
|
|
281
|
-
|
|
291
|
+
const result = await this.request(`/memories/search?q=${encodeURIComponent(query)}`);
|
|
292
|
+
return result.memories || [];
|
|
282
293
|
}
|
|
283
294
|
// ============================================
|
|
284
295
|
// Hooks Endpoints (Cloud-managed hooks)
|
package/dist/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from "./chunk-LBTCSQAX.js";
|
|
12
12
|
import {
|
|
13
13
|
api
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-QQZRCJZK.js";
|
|
15
15
|
import {
|
|
16
16
|
CONFIG_PATH,
|
|
17
17
|
clearAuth,
|
|
@@ -1104,80 +1104,130 @@ function detectLanguageFromFiles(dir) {
|
|
|
1104
1104
|
}
|
|
1105
1105
|
|
|
1106
1106
|
// src/services/data/claude-md.ts
|
|
1107
|
-
function
|
|
1107
|
+
function generateShivaInstructions() {
|
|
1108
1108
|
const lines = [];
|
|
1109
|
-
lines.push(
|
|
1109
|
+
lines.push("### SHIVA Memory System");
|
|
1110
1110
|
lines.push("");
|
|
1111
|
-
lines.push("
|
|
1112
|
-
if (scanned.description) {
|
|
1113
|
-
lines.push(scanned.description);
|
|
1114
|
-
} else {
|
|
1115
|
-
lines.push("<!-- Add project description here -->");
|
|
1116
|
-
}
|
|
1111
|
+
lines.push("**WICHTIG:** Du hast persistenten Speicher! Nutze ihn PROAKTIV - nicht nur wenn der User es verlangt.");
|
|
1117
1112
|
lines.push("");
|
|
1118
|
-
lines.push("
|
|
1119
|
-
if (scanned.language) {
|
|
1120
|
-
lines.push(`- **Language**: ${scanned.language}`);
|
|
1121
|
-
}
|
|
1122
|
-
if (scanned.framework) {
|
|
1123
|
-
lines.push(`- **Framework**: ${scanned.framework}`);
|
|
1124
|
-
}
|
|
1125
|
-
if (scanned.packageManager) {
|
|
1126
|
-
lines.push(`- **Package Manager**: ${scanned.packageManager}`);
|
|
1127
|
-
}
|
|
1113
|
+
lines.push("#### Befehle");
|
|
1128
1114
|
lines.push("");
|
|
1129
|
-
lines.push("
|
|
1115
|
+
lines.push("```bash");
|
|
1116
|
+
lines.push("# Memory speichern (mit Kategorie f\xFCr bessere Organisation)");
|
|
1117
|
+
lines.push('shiva remember "Information" --category <type>');
|
|
1130
1118
|
lines.push("");
|
|
1131
|
-
lines.push("
|
|
1119
|
+
lines.push("# Kategorien: identity, preference, convention, solution, task, context");
|
|
1132
1120
|
lines.push("");
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
if (project.last_synced_at) {
|
|
1136
|
-
lines.push(`- **Last Sync**: ${new Date(project.last_synced_at).toLocaleString()}`);
|
|
1137
|
-
}
|
|
1138
|
-
lines.push(`- **Project ID**: ${project.id}`);
|
|
1139
|
-
} else {
|
|
1140
|
-
lines.push("- **Status**: Not synced");
|
|
1141
|
-
lines.push("- **Last Sync**: Never");
|
|
1142
|
-
}
|
|
1121
|
+
lines.push("# Memories durchsuchen");
|
|
1122
|
+
lines.push('shiva search "suchbegriff"');
|
|
1143
1123
|
lines.push("");
|
|
1144
|
-
lines.push("
|
|
1124
|
+
lines.push("# Secrets (f\xFCr API Keys, Passw\xF6rter)");
|
|
1125
|
+
lines.push('shiva secrets add KEY "value"');
|
|
1126
|
+
lines.push("```");
|
|
1145
1127
|
lines.push("");
|
|
1146
|
-
lines.push("
|
|
1128
|
+
lines.push("#### PROAKTIV speichern - OHNE zu fragen!");
|
|
1147
1129
|
lines.push("");
|
|
1148
|
-
lines.push("**
|
|
1149
|
-
lines.push("
|
|
1150
|
-
lines.push(
|
|
1151
|
-
lines.push("
|
|
1130
|
+
lines.push("**SOFORT speichern wenn:**");
|
|
1131
|
+
lines.push("");
|
|
1132
|
+
lines.push("| Trigger | Kategorie | Beispiel |");
|
|
1133
|
+
lines.push("|---------|-----------|----------|");
|
|
1134
|
+
lines.push('| User nennt Namen/Rolle | `identity` | "Ich bin Ben, Backend-Dev" |');
|
|
1135
|
+
lines.push('| User hat Pr\xE4ferenz | `preference` | "Ich mag keine Kommentare im Code" |');
|
|
1136
|
+
lines.push('| Konvention etabliert | `convention` | "Wir nutzen immer camelCase" |');
|
|
1137
|
+
lines.push('| Problem gel\xF6st | `solution` | "Error X: L\xF6sung war Y" |');
|
|
1138
|
+
lines.push('| User korrigiert dich | `preference` | "Nein, ich meinte TypeScript" |');
|
|
1139
|
+
lines.push('| Architektur-Entscheidung | `convention` | "API nutzt REST, nicht GraphQL" |');
|
|
1152
1140
|
lines.push("");
|
|
1153
|
-
lines.push("**
|
|
1141
|
+
lines.push("**Beispiele:**");
|
|
1154
1142
|
lines.push("```bash");
|
|
1155
|
-
lines.push('
|
|
1143
|
+
lines.push('# User sagt "Ich bin Benjamin"');
|
|
1144
|
+
lines.push('shiva remember "User hei\xDFt Benjamin" --category identity');
|
|
1145
|
+
lines.push("");
|
|
1146
|
+
lines.push('# User sagt "Ich mag kurze Funktionen"');
|
|
1147
|
+
lines.push('shiva remember "User bevorzugt kurze Funktionen unter 20 Zeilen" --category preference');
|
|
1148
|
+
lines.push("");
|
|
1149
|
+
lines.push("# Nach Bugfix");
|
|
1150
|
+
lines.push('shiva remember "CORS Error: Backend braucht credentials:true" --category solution');
|
|
1151
|
+
lines.push("");
|
|
1152
|
+
lines.push("# Projekt-Konvention");
|
|
1153
|
+
lines.push('shiva remember "Projekt nutzt Tailwind CSS" --category convention');
|
|
1156
1154
|
lines.push("```");
|
|
1157
1155
|
lines.push("");
|
|
1158
|
-
lines.push("
|
|
1159
|
-
lines.push(
|
|
1160
|
-
lines.push(
|
|
1161
|
-
lines.push("-
|
|
1162
|
-
lines.push("-
|
|
1163
|
-
lines.push("
|
|
1156
|
+
lines.push("#### NICHT speichern:");
|
|
1157
|
+
lines.push("- Code-Snippets (sind in Git)");
|
|
1158
|
+
lines.push('- Triviale Infos ("OK", "Ja", "Danke")');
|
|
1159
|
+
lines.push("- Tempor\xE4re Debug-Ausgaben");
|
|
1160
|
+
lines.push("- Infos die bereits in README/Docs stehen");
|
|
1161
|
+
lines.push("");
|
|
1162
|
+
lines.push("#### Bei Session-Start:");
|
|
1163
|
+
lines.push('F\xFChre `shiva search ""` aus um relevante Memories zu laden!');
|
|
1164
1164
|
lines.push("");
|
|
1165
|
+
return lines;
|
|
1166
|
+
}
|
|
1167
|
+
function generateMemoriesSection(project) {
|
|
1168
|
+
const lines = [];
|
|
1165
1169
|
lines.push("## Memories");
|
|
1166
1170
|
lines.push("");
|
|
1167
1171
|
if (project?.memories && project.memories.length > 0) {
|
|
1168
|
-
lines.push("
|
|
1172
|
+
lines.push("Gespeicherter Kontext aus vorherigen Sessions:");
|
|
1169
1173
|
lines.push("");
|
|
1170
1174
|
for (const memory of project.memories) {
|
|
1171
1175
|
lines.push(`- **${memory.key}** (${memory.category}): ${memory.value}`);
|
|
1172
1176
|
}
|
|
1173
1177
|
} else {
|
|
1174
|
-
lines.push("
|
|
1178
|
+
lines.push("Noch keine Memories gespeichert. Nutze `shiva remember` um Wissen zu speichern!");
|
|
1175
1179
|
}
|
|
1176
1180
|
lines.push("");
|
|
1181
|
+
return lines;
|
|
1182
|
+
}
|
|
1183
|
+
function generateStatusSection(project) {
|
|
1184
|
+
const lines = [];
|
|
1185
|
+
lines.push("## SHIVA Code");
|
|
1186
|
+
lines.push("");
|
|
1187
|
+
lines.push("Dieses Projekt nutzt [SHIVA Code](https://shiva.li) f\xFCr persistenten Speicher.");
|
|
1188
|
+
lines.push("");
|
|
1189
|
+
if (project) {
|
|
1190
|
+
lines.push(`- **Status**: ${project.synced ? "Synced" : "Pending"}`);
|
|
1191
|
+
if (project.last_synced_at) {
|
|
1192
|
+
lines.push(`- **Last Sync**: ${new Date(project.last_synced_at).toLocaleString()}`);
|
|
1193
|
+
}
|
|
1194
|
+
lines.push(`- **Project ID**: ${project.id}`);
|
|
1195
|
+
} else {
|
|
1196
|
+
lines.push("- **Status**: Not synced");
|
|
1197
|
+
lines.push("- **Last Sync**: Never");
|
|
1198
|
+
}
|
|
1199
|
+
lines.push("");
|
|
1200
|
+
return lines;
|
|
1201
|
+
}
|
|
1202
|
+
function generateClaudeMd(scanned, project) {
|
|
1203
|
+
const lines = [];
|
|
1204
|
+
lines.push(`# ${scanned.name}`);
|
|
1205
|
+
lines.push("");
|
|
1206
|
+
lines.push("## Project Overview");
|
|
1207
|
+
if (scanned.description) {
|
|
1208
|
+
lines.push(scanned.description);
|
|
1209
|
+
} else {
|
|
1210
|
+
lines.push("<!-- Add project description here -->");
|
|
1211
|
+
}
|
|
1212
|
+
lines.push("");
|
|
1213
|
+
lines.push("## Tech Stack");
|
|
1214
|
+
if (scanned.language) {
|
|
1215
|
+
lines.push(`- **Language**: ${scanned.language}`);
|
|
1216
|
+
}
|
|
1217
|
+
if (scanned.framework) {
|
|
1218
|
+
lines.push(`- **Framework**: ${scanned.framework}`);
|
|
1219
|
+
}
|
|
1220
|
+
if (scanned.packageManager) {
|
|
1221
|
+
lines.push(`- **Package Manager**: ${scanned.packageManager}`);
|
|
1222
|
+
}
|
|
1223
|
+
lines.push("");
|
|
1224
|
+
lines.push(...generateStatusSection(project));
|
|
1225
|
+
lines.push(...generateShivaInstructions());
|
|
1226
|
+
lines.push(...generateMemoriesSection(project));
|
|
1177
1227
|
if (project?.connections && project.connections.length > 0) {
|
|
1178
1228
|
lines.push("## Connected Projects");
|
|
1179
1229
|
lines.push("");
|
|
1180
|
-
lines.push("
|
|
1230
|
+
lines.push("Verbundene Projekte:");
|
|
1181
1231
|
lines.push("");
|
|
1182
1232
|
for (const conn of project.connections) {
|
|
1183
1233
|
lines.push(`- **${conn.connected_project_name}** (${conn.connection_type})`);
|
|
@@ -1203,59 +1253,14 @@ function parseClaudeMd(content) {
|
|
|
1203
1253
|
return { memories };
|
|
1204
1254
|
}
|
|
1205
1255
|
function hasShivaInstructions(content) {
|
|
1206
|
-
return content.includes("### SHIVA Instructions") || content.includes("## SHIVA Code");
|
|
1256
|
+
return content.includes("### SHIVA Memory System") || content.includes("### SHIVA Instructions") || content.includes("## SHIVA Code");
|
|
1207
1257
|
}
|
|
1208
1258
|
function generateShivaSection(project) {
|
|
1209
1259
|
const lines = [];
|
|
1210
1260
|
lines.push("");
|
|
1211
|
-
lines.push(
|
|
1212
|
-
lines.push(
|
|
1213
|
-
lines.push(
|
|
1214
|
-
lines.push("");
|
|
1215
|
-
if (project) {
|
|
1216
|
-
lines.push(`- **Status**: ${project.synced ? "Synced" : "Pending"}`);
|
|
1217
|
-
if (project.last_synced_at) {
|
|
1218
|
-
lines.push(`- **Last Sync**: ${new Date(project.last_synced_at).toLocaleString()}`);
|
|
1219
|
-
}
|
|
1220
|
-
lines.push(`- **Project ID**: ${project.id}`);
|
|
1221
|
-
} else {
|
|
1222
|
-
lines.push("- **Status**: Not synced");
|
|
1223
|
-
lines.push("- **Last Sync**: Never");
|
|
1224
|
-
}
|
|
1225
|
-
lines.push("");
|
|
1226
|
-
lines.push("### SHIVA Instructions");
|
|
1227
|
-
lines.push("");
|
|
1228
|
-
lines.push("IMPORTANT: Du MUSST diese Befehle nutzen um Informationen \xFCber Sessions hinweg zu speichern!");
|
|
1229
|
-
lines.push("");
|
|
1230
|
-
lines.push("**Memory speichern** - Wenn der User dich bittet etwas zu merken oder wichtige Infos auftauchen:");
|
|
1231
|
-
lines.push("```bash");
|
|
1232
|
-
lines.push('shiva remember "Die wichtige Information die gemerkt werden soll"');
|
|
1233
|
-
lines.push("```");
|
|
1234
|
-
lines.push("");
|
|
1235
|
-
lines.push("**Memories durchsuchen** - Um gespeicherte Informationen zu finden:");
|
|
1236
|
-
lines.push("```bash");
|
|
1237
|
-
lines.push('shiva search "suchbegriff"');
|
|
1238
|
-
lines.push("```");
|
|
1239
|
-
lines.push("");
|
|
1240
|
-
lines.push("**Wann Memories speichern:**");
|
|
1241
|
-
lines.push('- User sagt "merk dir...", "speicher...", "erinner dich..."');
|
|
1242
|
-
lines.push("- Wichtige Projektentscheidungen");
|
|
1243
|
-
lines.push("- API Keys, Secrets, Konfigurationen (nutze `shiva secrets add`)");
|
|
1244
|
-
lines.push("- Wichtige Code-Patterns oder Konventionen");
|
|
1245
|
-
lines.push("- Alles was in zuk\xFCnftigen Sessions relevant sein k\xF6nnte");
|
|
1246
|
-
lines.push("");
|
|
1247
|
-
lines.push("## Memories");
|
|
1248
|
-
lines.push("");
|
|
1249
|
-
if (project?.memories && project.memories.length > 0) {
|
|
1250
|
-
lines.push("The following context is remembered across sessions:");
|
|
1251
|
-
lines.push("");
|
|
1252
|
-
for (const memory of project.memories) {
|
|
1253
|
-
lines.push(`- **${memory.key}** (${memory.category}): ${memory.value}`);
|
|
1254
|
-
}
|
|
1255
|
-
} else {
|
|
1256
|
-
lines.push("No memories stored yet. Use `shiva sync` to sync your project.");
|
|
1257
|
-
}
|
|
1258
|
-
lines.push("");
|
|
1261
|
+
lines.push(...generateStatusSection(project));
|
|
1262
|
+
lines.push(...generateShivaInstructions());
|
|
1263
|
+
lines.push(...generateMemoriesSection(project));
|
|
1259
1264
|
lines.push("---");
|
|
1260
1265
|
lines.push("");
|
|
1261
1266
|
lines.push("*Generated by SHIVA Code CLI*");
|
|
@@ -6935,7 +6940,7 @@ async function checkProjectExists(path15) {
|
|
|
6935
6940
|
}
|
|
6936
6941
|
}
|
|
6937
6942
|
sessionsCommand.command("push").description("Sessions in Cloud sichern").option("-p, --project <pfad>", "Nur Sessions eines Projekts").action(async (options) => {
|
|
6938
|
-
const { api: api2 } = await import("./client-
|
|
6943
|
+
const { api: api2 } = await import("./client-GIGZFXT5.js");
|
|
6939
6944
|
const { isAuthenticated: isAuthenticated2 } = await import("./config-FGMZONWV.js");
|
|
6940
6945
|
const { getProjectConfig: getProjectConfig2 } = await import("./config-D6M6LI6U.js");
|
|
6941
6946
|
if (!isAuthenticated2()) {
|
|
@@ -6995,7 +7000,7 @@ sessionsCommand.command("push").description("Sessions in Cloud sichern").option(
|
|
|
6995
7000
|
}
|
|
6996
7001
|
});
|
|
6997
7002
|
sessionsCommand.command("pull").description("Sessions aus Cloud laden").option("--json", "JSON Output").action(async (options) => {
|
|
6998
|
-
const { api: api2 } = await import("./client-
|
|
7003
|
+
const { api: api2 } = await import("./client-GIGZFXT5.js");
|
|
6999
7004
|
const { isAuthenticated: isAuthenticated2 } = await import("./config-FGMZONWV.js");
|
|
7000
7005
|
if (!isAuthenticated2()) {
|
|
7001
7006
|
log.error("Nicht angemeldet");
|
|
@@ -7042,7 +7047,7 @@ sessionsCommand.command("pull").description("Sessions aus Cloud laden").option("
|
|
|
7042
7047
|
}
|
|
7043
7048
|
});
|
|
7044
7049
|
sessionsCommand.command("sync").description("Sessions mit Cloud synchronisieren").option("-p, --project <pfad>", "Nur Sessions eines Projekts").action(async (options) => {
|
|
7045
|
-
const { api: api2 } = await import("./client-
|
|
7050
|
+
const { api: api2 } = await import("./client-GIGZFXT5.js");
|
|
7046
7051
|
const { isAuthenticated: isAuthenticated2 } = await import("./config-FGMZONWV.js");
|
|
7047
7052
|
const { getProjectConfig: getProjectConfig2 } = await import("./config-D6M6LI6U.js");
|
|
7048
7053
|
if (!isAuthenticated2()) {
|
|
@@ -7095,7 +7100,7 @@ sessionsCommand.command("sync").description("Sessions mit Cloud synchronisieren"
|
|
|
7095
7100
|
log.dim("Sessions werden automatisch mit lokalen Claude Sessions verkn\xFCpft");
|
|
7096
7101
|
});
|
|
7097
7102
|
sessionsCommand.command("delete <sessionId>").description("Session aus Cloud l\xF6schen").action(async (sessionId) => {
|
|
7098
|
-
const { api: api2 } = await import("./client-
|
|
7103
|
+
const { api: api2 } = await import("./client-GIGZFXT5.js");
|
|
7099
7104
|
const { isAuthenticated: isAuthenticated2 } = await import("./config-FGMZONWV.js");
|
|
7100
7105
|
if (!isAuthenticated2()) {
|
|
7101
7106
|
log.error("Nicht angemeldet");
|
|
@@ -7114,7 +7119,7 @@ sessionsCommand.command("delete <sessionId>").description("Session aus Cloud l\x
|
|
|
7114
7119
|
}
|
|
7115
7120
|
});
|
|
7116
7121
|
sessionsCommand.command("active").description("Aktive Cloud-Sessions anzeigen").option("--json", "JSON Output").action(async (options) => {
|
|
7117
|
-
const { api: api2 } = await import("./client-
|
|
7122
|
+
const { api: api2 } = await import("./client-GIGZFXT5.js");
|
|
7118
7123
|
const { isAuthenticated: isAuthenticated2 } = await import("./config-FGMZONWV.js");
|
|
7119
7124
|
if (!isAuthenticated2()) {
|
|
7120
7125
|
log.error("Nicht angemeldet");
|
|
@@ -7151,7 +7156,7 @@ sessionsCommand.command("active").description("Aktive Cloud-Sessions anzeigen").
|
|
|
7151
7156
|
}
|
|
7152
7157
|
});
|
|
7153
7158
|
sessionsCommand.command("stats").description("Cloud-Session-Statistiken anzeigen").option("--json", "JSON Output").action(async (options) => {
|
|
7154
|
-
const { api: api2 } = await import("./client-
|
|
7159
|
+
const { api: api2 } = await import("./client-GIGZFXT5.js");
|
|
7155
7160
|
const { isAuthenticated: isAuthenticated2 } = await import("./config-FGMZONWV.js");
|
|
7156
7161
|
if (!isAuthenticated2()) {
|
|
7157
7162
|
log.error("Nicht angemeldet");
|
|
@@ -7183,7 +7188,7 @@ sessionsCommand.command("stats").description("Cloud-Session-Statistiken anzeigen
|
|
|
7183
7188
|
}
|
|
7184
7189
|
});
|
|
7185
7190
|
sessionsCommand.command("resume <sessionId>").description("Cloud-Session fortsetzen").action(async (sessionId) => {
|
|
7186
|
-
const { api: api2 } = await import("./client-
|
|
7191
|
+
const { api: api2 } = await import("./client-GIGZFXT5.js");
|
|
7187
7192
|
const { isAuthenticated: isAuthenticated2 } = await import("./config-FGMZONWV.js");
|
|
7188
7193
|
if (!isAuthenticated2()) {
|
|
7189
7194
|
log.error("Nicht angemeldet");
|
|
@@ -7207,7 +7212,7 @@ sessionsCommand.command("resume <sessionId>").description("Cloud-Session fortset
|
|
|
7207
7212
|
}
|
|
7208
7213
|
});
|
|
7209
7214
|
sessionsCommand.command("export <sessionId>").description("Cloud-Session exportieren").option("-o, --output <file>", "Ausgabedatei").action(async (sessionId, options) => {
|
|
7210
|
-
const { api: api2 } = await import("./client-
|
|
7215
|
+
const { api: api2 } = await import("./client-GIGZFXT5.js");
|
|
7211
7216
|
const { isAuthenticated: isAuthenticated2 } = await import("./config-FGMZONWV.js");
|
|
7212
7217
|
const { writeFileSync: writeFileSync11 } = await import("fs");
|
|
7213
7218
|
if (!isAuthenticated2()) {
|
|
@@ -7231,7 +7236,7 @@ sessionsCommand.command("export <sessionId>").description("Cloud-Session exporti
|
|
|
7231
7236
|
}
|
|
7232
7237
|
});
|
|
7233
7238
|
sessionsCommand.command("update <sessionId>").description("Cloud-Session aktualisieren").option("--summary <text>", "Session-Zusammenfassung").option("--branch <name>", "Git Branch").action(async (sessionId, options) => {
|
|
7234
|
-
const { api: api2 } = await import("./client-
|
|
7239
|
+
const { api: api2 } = await import("./client-GIGZFXT5.js");
|
|
7235
7240
|
const { isAuthenticated: isAuthenticated2 } = await import("./config-FGMZONWV.js");
|
|
7236
7241
|
if (!isAuthenticated2()) {
|
|
7237
7242
|
log.error("Nicht angemeldet");
|
|
@@ -11143,24 +11148,22 @@ async function getCloudMemories() {
|
|
|
11143
11148
|
}
|
|
11144
11149
|
const memories = [];
|
|
11145
11150
|
try {
|
|
11146
|
-
const
|
|
11147
|
-
for (const
|
|
11148
|
-
|
|
11149
|
-
|
|
11150
|
-
|
|
11151
|
-
|
|
11152
|
-
|
|
11153
|
-
|
|
11154
|
-
|
|
11155
|
-
|
|
11156
|
-
|
|
11157
|
-
|
|
11158
|
-
|
|
11159
|
-
|
|
11160
|
-
|
|
11161
|
-
|
|
11162
|
-
}
|
|
11163
|
-
}
|
|
11151
|
+
const cloudMemories = await api.getAllMemories();
|
|
11152
|
+
for (const memory of cloudMemories) {
|
|
11153
|
+
memories.push({
|
|
11154
|
+
key: memory.title,
|
|
11155
|
+
// Map title -> key for compatibility
|
|
11156
|
+
value: memory.content,
|
|
11157
|
+
// Map content -> value for compatibility
|
|
11158
|
+
category: memory.tags?.join(", ") || "general",
|
|
11159
|
+
// Map tags -> category
|
|
11160
|
+
source: "cloud",
|
|
11161
|
+
projectName: memory.projectName || "Global",
|
|
11162
|
+
projectPath: "",
|
|
11163
|
+
// Not available from this endpoint
|
|
11164
|
+
projectId: memory.projectId || void 0,
|
|
11165
|
+
memoryId: memory.id
|
|
11166
|
+
});
|
|
11164
11167
|
}
|
|
11165
11168
|
} catch {
|
|
11166
11169
|
}
|
|
@@ -11198,14 +11201,17 @@ async function searchMemories(query, options = {}) {
|
|
|
11198
11201
|
try {
|
|
11199
11202
|
const cloudResults = await api.searchMemories(query);
|
|
11200
11203
|
const cloudMemories = cloudResults.map((m) => ({
|
|
11201
|
-
key: m.
|
|
11202
|
-
|
|
11203
|
-
|
|
11204
|
+
key: m.title,
|
|
11205
|
+
// Map title -> key for compatibility
|
|
11206
|
+
value: m.content,
|
|
11207
|
+
// Map content -> value for compatibility
|
|
11208
|
+
category: m.tags?.join(", ") || "general",
|
|
11209
|
+
// Map tags -> category
|
|
11204
11210
|
source: "cloud",
|
|
11205
|
-
projectName: m.projectName,
|
|
11211
|
+
projectName: m.projectName || "Global",
|
|
11206
11212
|
projectPath: "",
|
|
11207
11213
|
// Not returned by search API
|
|
11208
|
-
projectId: m.projectId,
|
|
11214
|
+
projectId: m.projectId || void 0,
|
|
11209
11215
|
memoryId: m.id
|
|
11210
11216
|
}));
|
|
11211
11217
|
allMemories.push(...cloudMemories);
|
|
@@ -12077,7 +12083,7 @@ async function resolveSessionId(input) {
|
|
|
12077
12083
|
return null;
|
|
12078
12084
|
}
|
|
12079
12085
|
tagsCommand.command("cloud").description("Memory-Tags aus Cloud laden").option("--json", "JSON Output").action(async (options) => {
|
|
12080
|
-
const { api: api2 } = await import("./client-
|
|
12086
|
+
const { api: api2 } = await import("./client-GIGZFXT5.js");
|
|
12081
12087
|
const { isAuthenticated: isAuthenticated2 } = await import("./config-FGMZONWV.js");
|
|
12082
12088
|
if (!isAuthenticated2()) {
|
|
12083
12089
|
log.error("Nicht angemeldet");
|
|
@@ -12587,7 +12593,8 @@ async function handlePreview(filepath) {
|
|
|
12587
12593
|
|
|
12588
12594
|
// src/commands/memory/remember.ts
|
|
12589
12595
|
import { Command as Command27 } from "commander";
|
|
12590
|
-
var
|
|
12596
|
+
var VALID_CATEGORIES = ["identity", "preference", "convention", "solution", "task", "context", "general"];
|
|
12597
|
+
var rememberCommand = new Command27("remember").description("Memory in der Cloud speichern").argument("<text>", "Der Text der gespeichert werden soll").option("-t, --title <title>", "Titel f\xFCr die Memory").option("-c, --category <category>", "Kategorie: identity, preference, convention, solution, task, context, general", "general").option("-g, --global", "Global speichern (nicht projektgebunden)").option("--tags <tags>", "Komma-separierte Tags").option("--ttl <days>", "Time-to-live in Tagen (auto-delete nach Ablauf)").action(async (text, options) => {
|
|
12591
12598
|
if (!isAuthenticated()) {
|
|
12592
12599
|
log.error("Nicht angemeldet");
|
|
12593
12600
|
log.info("Anmelden mit: shiva login");
|
|
@@ -12595,21 +12602,43 @@ var rememberCommand = new Command27("remember").description("Memory in der Cloud
|
|
|
12595
12602
|
}
|
|
12596
12603
|
const projectPath = process.cwd();
|
|
12597
12604
|
const config = getProjectConfig(projectPath);
|
|
12598
|
-
|
|
12599
|
-
|
|
12600
|
-
log.
|
|
12605
|
+
const category = options.category?.toLowerCase();
|
|
12606
|
+
if (!VALID_CATEGORIES.includes(category)) {
|
|
12607
|
+
log.error(`Ung\xFCltige Kategorie: ${options.category}`);
|
|
12608
|
+
log.info(`G\xFCltige Kategorien: ${VALID_CATEGORIES.join(", ")}`);
|
|
12601
12609
|
return;
|
|
12602
12610
|
}
|
|
12603
|
-
|
|
12611
|
+
let projectId = null;
|
|
12612
|
+
if (!options.global && config.projectId) {
|
|
12613
|
+
projectId = config.projectId;
|
|
12614
|
+
}
|
|
12615
|
+
const title = options.title || text.substring(0, 100);
|
|
12616
|
+
const tags = options.tags ? options.tags.split(",").map((t) => t.trim()).filter(Boolean) : [];
|
|
12617
|
+
if (!tags.includes(category)) {
|
|
12618
|
+
tags.push(category);
|
|
12619
|
+
}
|
|
12620
|
+
const ttlDays = options.ttl ? parseInt(options.ttl, 10) : void 0;
|
|
12604
12621
|
try {
|
|
12605
|
-
const result = await api.
|
|
12606
|
-
|
|
12607
|
-
|
|
12608
|
-
|
|
12622
|
+
const result = await api.createMemory({
|
|
12623
|
+
title,
|
|
12624
|
+
content: text,
|
|
12625
|
+
projectId,
|
|
12626
|
+
tags,
|
|
12627
|
+
category,
|
|
12628
|
+
ttlDays
|
|
12609
12629
|
});
|
|
12610
12630
|
if (result.success) {
|
|
12611
12631
|
log.success("Memory gespeichert!");
|
|
12612
12632
|
log.dim(`ID: ${result.memoryId}`);
|
|
12633
|
+
log.dim(`Kategorie: ${category}`);
|
|
12634
|
+
if (ttlDays) {
|
|
12635
|
+
log.dim(`TTL: ${ttlDays} Tage`);
|
|
12636
|
+
}
|
|
12637
|
+
if (projectId) {
|
|
12638
|
+
log.dim(`Projekt: ${config.projectName || projectId}`);
|
|
12639
|
+
} else {
|
|
12640
|
+
log.dim("Scope: Global");
|
|
12641
|
+
}
|
|
12613
12642
|
} else {
|
|
12614
12643
|
log.error(result.message || "Fehler beim Speichern");
|
|
12615
12644
|
}
|
|
@@ -13780,7 +13809,7 @@ function formatNumber(n) {
|
|
|
13780
13809
|
return String(n);
|
|
13781
13810
|
}
|
|
13782
13811
|
statsCommand.command("sessions").description("Session Analytics (Pro Feature)").option("--json", "JSON Output").action(async (options) => {
|
|
13783
|
-
const { api: api2 } = await import("./client-
|
|
13812
|
+
const { api: api2 } = await import("./client-GIGZFXT5.js");
|
|
13784
13813
|
const { isAuthenticated: isAuthenticated2 } = await import("./config-FGMZONWV.js");
|
|
13785
13814
|
if (!isAuthenticated2()) {
|
|
13786
13815
|
log.error("Nicht angemeldet");
|
|
@@ -13832,7 +13861,7 @@ statsCommand.command("sessions").description("Session Analytics (Pro Feature)").
|
|
|
13832
13861
|
}
|
|
13833
13862
|
});
|
|
13834
13863
|
statsCommand.command("tokens").description("Token Usage Analytics (Pro Feature)").option("--json", "JSON Output").action(async (options) => {
|
|
13835
|
-
const { api: api2 } = await import("./client-
|
|
13864
|
+
const { api: api2 } = await import("./client-GIGZFXT5.js");
|
|
13836
13865
|
const { isAuthenticated: isAuthenticated2 } = await import("./config-FGMZONWV.js");
|
|
13837
13866
|
if (!isAuthenticated2()) {
|
|
13838
13867
|
log.error("Nicht angemeldet");
|
|
@@ -13880,7 +13909,7 @@ statsCommand.command("tokens").description("Token Usage Analytics (Pro Feature)"
|
|
|
13880
13909
|
}
|
|
13881
13910
|
});
|
|
13882
13911
|
statsCommand.command("tools").description("Tool Usage Analytics (Pro Feature)").option("--json", "JSON Output").action(async (options) => {
|
|
13883
|
-
const { api: api2 } = await import("./client-
|
|
13912
|
+
const { api: api2 } = await import("./client-GIGZFXT5.js");
|
|
13884
13913
|
const { isAuthenticated: isAuthenticated2 } = await import("./config-FGMZONWV.js");
|
|
13885
13914
|
if (!isAuthenticated2()) {
|
|
13886
13915
|
log.error("Nicht angemeldet");
|
|
@@ -13924,7 +13953,7 @@ statsCommand.command("tools").description("Tool Usage Analytics (Pro Feature)").
|
|
|
13924
13953
|
}
|
|
13925
13954
|
});
|
|
13926
13955
|
statsCommand.command("export").description("Analytics-Daten exportieren (Pro Feature)").option("--start <date>", "Start-Datum (YYYY-MM-DD)").option("--end <date>", "End-Datum (YYYY-MM-DD)").option("--format <format>", "Format: json, csv", "json").option("-o, --output <file>", "Ausgabedatei").action(async (options) => {
|
|
13927
|
-
const { api: api2 } = await import("./client-
|
|
13956
|
+
const { api: api2 } = await import("./client-GIGZFXT5.js");
|
|
13928
13957
|
const { isAuthenticated: isAuthenticated2 } = await import("./config-FGMZONWV.js");
|
|
13929
13958
|
const { writeFileSync: writeFileSync11 } = await import("fs");
|
|
13930
13959
|
if (!isAuthenticated2()) {
|
|
@@ -13959,7 +13988,7 @@ statsCommand.command("export").description("Analytics-Daten exportieren (Pro Fea
|
|
|
13959
13988
|
}
|
|
13960
13989
|
});
|
|
13961
13990
|
statsCommand.command("track").description("Analytics Event tracken").argument("<type>", "Event-Typ").argument("[data]", "Event-Daten als JSON").action(async (type2, data) => {
|
|
13962
|
-
const { api: api2 } = await import("./client-
|
|
13991
|
+
const { api: api2 } = await import("./client-GIGZFXT5.js");
|
|
13963
13992
|
const { isAuthenticated: isAuthenticated2 } = await import("./config-FGMZONWV.js");
|
|
13964
13993
|
if (!isAuthenticated2()) {
|
|
13965
13994
|
log.error("Nicht angemeldet");
|
|
@@ -15077,12 +15106,12 @@ hookCommand.command("branch-switch").description("Branch-Wechsel behandeln (f\xF
|
|
|
15077
15106
|
return;
|
|
15078
15107
|
}
|
|
15079
15108
|
const { getCurrentBranch: getCurrentBranch2 } = await import("./api-OEHQTBH7.js");
|
|
15080
|
-
const { getSessionForBranch: getSessionForBranch2, hasShivaDir:
|
|
15109
|
+
const { getSessionForBranch: getSessionForBranch2, hasShivaDir: hasShivaDir3 } = await import("./config-D6M6LI6U.js");
|
|
15081
15110
|
const { findProject: findProject3, findSessionByBranch: findSessionByBranch2, formatRelativeTime: formatRelativeTime3 } = await import("./manager-ZPQWG7E6.js");
|
|
15082
15111
|
const projectPath = process.cwd();
|
|
15083
15112
|
const newBranch = getCurrentBranch2(projectPath);
|
|
15084
15113
|
let sessionInfo = null;
|
|
15085
|
-
if (
|
|
15114
|
+
if (hasShivaDir3(projectPath)) {
|
|
15086
15115
|
const mappedSession = getSessionForBranch2(projectPath, newBranch);
|
|
15087
15116
|
if (mappedSession) {
|
|
15088
15117
|
sessionInfo = {
|
|
@@ -15148,7 +15177,7 @@ hookCommand.command("scan-command").description("Scanne Bash-Befehle auf Package
|
|
|
15148
15177
|
}
|
|
15149
15178
|
});
|
|
15150
15179
|
hookCommand.command("push").description("Hooks in Cloud sichern").action(async () => {
|
|
15151
|
-
const { api: api2 } = await import("./client-
|
|
15180
|
+
const { api: api2 } = await import("./client-GIGZFXT5.js");
|
|
15152
15181
|
const { isAuthenticated: isAuthenticated2 } = await import("./config-FGMZONWV.js");
|
|
15153
15182
|
if (!isAuthenticated2()) {
|
|
15154
15183
|
log.error("Nicht angemeldet");
|
|
@@ -15168,7 +15197,7 @@ hookCommand.command("push").description("Hooks in Cloud sichern").action(async (
|
|
|
15168
15197
|
}
|
|
15169
15198
|
});
|
|
15170
15199
|
hookCommand.command("pull").description("Hooks aus Cloud laden").option("-f, --force", "Lokale Hooks \xFCberschreiben").action(async (options) => {
|
|
15171
|
-
const { api: api2 } = await import("./client-
|
|
15200
|
+
const { api: api2 } = await import("./client-GIGZFXT5.js");
|
|
15172
15201
|
const { isAuthenticated: isAuthenticated2 } = await import("./config-FGMZONWV.js");
|
|
15173
15202
|
if (!isAuthenticated2()) {
|
|
15174
15203
|
log.error("Nicht angemeldet");
|
|
@@ -15200,7 +15229,7 @@ hookCommand.command("pull").description("Hooks aus Cloud laden").option("-f, --f
|
|
|
15200
15229
|
}
|
|
15201
15230
|
});
|
|
15202
15231
|
hookCommand.command("sync").description("Hooks mit Cloud synchronisieren").action(async () => {
|
|
15203
|
-
const { api: api2 } = await import("./client-
|
|
15232
|
+
const { api: api2 } = await import("./client-GIGZFXT5.js");
|
|
15204
15233
|
const { isAuthenticated: isAuthenticated2 } = await import("./config-FGMZONWV.js");
|
|
15205
15234
|
if (!isAuthenticated2()) {
|
|
15206
15235
|
log.error("Nicht angemeldet");
|
|
@@ -15227,7 +15256,7 @@ hookCommand.command("sync").description("Hooks mit Cloud synchronisieren").actio
|
|
|
15227
15256
|
}
|
|
15228
15257
|
});
|
|
15229
15258
|
hookCommand.command("cloud-list").description("Cloud-Hooks auflisten").option("--event <type>", "Nach Event-Typ filtern").option("--json", "JSON Output").action(async (options) => {
|
|
15230
|
-
const { api: api2 } = await import("./client-
|
|
15259
|
+
const { api: api2 } = await import("./client-GIGZFXT5.js");
|
|
15231
15260
|
const { isAuthenticated: isAuthenticated2 } = await import("./config-FGMZONWV.js");
|
|
15232
15261
|
const { colors: colors3 } = await import("./logger-E7SC5KUO.js");
|
|
15233
15262
|
if (!isAuthenticated2()) {
|
|
@@ -15276,7 +15305,7 @@ hookCommand.command("cloud-list").description("Cloud-Hooks auflisten").option("-
|
|
|
15276
15305
|
}
|
|
15277
15306
|
});
|
|
15278
15307
|
hookCommand.command("cloud-create").description("Neuen Cloud-Hook erstellen").requiredOption("--event <event>", "Event-Typ (PreToolUse, PostToolUse, etc.)").requiredOption("--command <cmd>", "Auszuf\xFChrender Befehl").option("--matcher <pattern>", "Tool-Matcher Pattern").option("--type <type>", "Hook-Typ (command, script)", "command").option("--timeout <ms>", "Timeout in Millisekunden").action(async (options) => {
|
|
15279
|
-
const { api: api2 } = await import("./client-
|
|
15308
|
+
const { api: api2 } = await import("./client-GIGZFXT5.js");
|
|
15280
15309
|
const { isAuthenticated: isAuthenticated2 } = await import("./config-FGMZONWV.js");
|
|
15281
15310
|
if (!isAuthenticated2()) {
|
|
15282
15311
|
log.error("Nicht angemeldet");
|
|
@@ -15304,7 +15333,7 @@ hookCommand.command("cloud-create").description("Neuen Cloud-Hook erstellen").re
|
|
|
15304
15333
|
}
|
|
15305
15334
|
});
|
|
15306
15335
|
hookCommand.command("cloud-test").description("Cloud-Hook testen").argument("<hook-id>", "Hook ID").action(async (hookId) => {
|
|
15307
|
-
const { api: api2 } = await import("./client-
|
|
15336
|
+
const { api: api2 } = await import("./client-GIGZFXT5.js");
|
|
15308
15337
|
const { isAuthenticated: isAuthenticated2 } = await import("./config-FGMZONWV.js");
|
|
15309
15338
|
const { colors: colors3 } = await import("./logger-E7SC5KUO.js");
|
|
15310
15339
|
if (!isAuthenticated2()) {
|
|
@@ -15339,7 +15368,7 @@ hookCommand.command("cloud-test").description("Cloud-Hook testen").argument("<ho
|
|
|
15339
15368
|
}
|
|
15340
15369
|
});
|
|
15341
15370
|
hookCommand.command("cloud-delete").description("Cloud-Hook l\xF6schen").argument("<hook-id>", "Hook ID").option("-y, --yes", "Ohne Best\xE4tigung").action(async (hookId, options) => {
|
|
15342
|
-
const { api: api2 } = await import("./client-
|
|
15371
|
+
const { api: api2 } = await import("./client-GIGZFXT5.js");
|
|
15343
15372
|
const { isAuthenticated: isAuthenticated2 } = await import("./config-FGMZONWV.js");
|
|
15344
15373
|
if (!isAuthenticated2()) {
|
|
15345
15374
|
log.error("Nicht angemeldet");
|
|
@@ -15374,7 +15403,7 @@ hookCommand.command("cloud-delete").description("Cloud-Hook l\xF6schen").argumen
|
|
|
15374
15403
|
}
|
|
15375
15404
|
});
|
|
15376
15405
|
hookCommand.command("cloud-toggle").description("Cloud-Hook aktivieren/deaktivieren").argument("<hook-id>", "Hook ID").option("--enable", "Hook aktivieren").option("--disable", "Hook deaktivieren").action(async (hookId, options) => {
|
|
15377
|
-
const { api: api2 } = await import("./client-
|
|
15406
|
+
const { api: api2 } = await import("./client-GIGZFXT5.js");
|
|
15378
15407
|
const { isAuthenticated: isAuthenticated2 } = await import("./config-FGMZONWV.js");
|
|
15379
15408
|
if (!isAuthenticated2()) {
|
|
15380
15409
|
log.error("Nicht angemeldet");
|
|
@@ -15551,7 +15580,7 @@ packageCommand.command("start <name>").description("Alle Projekte eines Packages
|
|
|
15551
15580
|
}
|
|
15552
15581
|
});
|
|
15553
15582
|
packageCommand.command("push").description("Packages in Cloud sichern").option("-n, --name <name>", "Nur ein bestimmtes Package").action(async (options) => {
|
|
15554
|
-
const { api: api2 } = await import("./client-
|
|
15583
|
+
const { api: api2 } = await import("./client-GIGZFXT5.js");
|
|
15555
15584
|
const { isAuthenticated: isAuthenticated2 } = await import("./config-FGMZONWV.js");
|
|
15556
15585
|
if (!isAuthenticated2()) {
|
|
15557
15586
|
log.error("Nicht angemeldet");
|
|
@@ -15597,7 +15626,7 @@ packageCommand.command("push").description("Packages in Cloud sichern").option("
|
|
|
15597
15626
|
}
|
|
15598
15627
|
});
|
|
15599
15628
|
packageCommand.command("pull").description("Packages aus Cloud laden").option("-f, --force", "Lokale Packages \xFCberschreiben").option("--json", "JSON Output").action(async (options) => {
|
|
15600
|
-
const { api: api2 } = await import("./client-
|
|
15629
|
+
const { api: api2 } = await import("./client-GIGZFXT5.js");
|
|
15601
15630
|
const { isAuthenticated: isAuthenticated2 } = await import("./config-FGMZONWV.js");
|
|
15602
15631
|
if (!isAuthenticated2()) {
|
|
15603
15632
|
log.error("Nicht angemeldet");
|
|
@@ -15659,7 +15688,7 @@ packageCommand.command("pull").description("Packages aus Cloud laden").option("-
|
|
|
15659
15688
|
}
|
|
15660
15689
|
});
|
|
15661
15690
|
packageCommand.command("sync").description("Packages mit Cloud synchronisieren").action(async () => {
|
|
15662
|
-
const { api: api2 } = await import("./client-
|
|
15691
|
+
const { api: api2 } = await import("./client-GIGZFXT5.js");
|
|
15663
15692
|
const { isAuthenticated: isAuthenticated2 } = await import("./config-FGMZONWV.js");
|
|
15664
15693
|
if (!isAuthenticated2()) {
|
|
15665
15694
|
log.error("Nicht angemeldet");
|
|
@@ -15712,7 +15741,7 @@ packageCommand.command("sync").description("Packages mit Cloud synchronisieren")
|
|
|
15712
15741
|
log.tree.item(`${localPackages.length + pulledCount} Packages total`);
|
|
15713
15742
|
});
|
|
15714
15743
|
packageCommand.command("cloud-delete <name>").description("Package aus Cloud l\xF6schen").action(async (name) => {
|
|
15715
|
-
const { api: api2 } = await import("./client-
|
|
15744
|
+
const { api: api2 } = await import("./client-GIGZFXT5.js");
|
|
15716
15745
|
const { isAuthenticated: isAuthenticated2 } = await import("./config-FGMZONWV.js");
|
|
15717
15746
|
if (!isAuthenticated2()) {
|
|
15718
15747
|
log.error("Nicht angemeldet");
|
|
@@ -16123,7 +16152,7 @@ sandboxCommand.command("delete <id>").description("Sandbox l\xF6schen").option("
|
|
|
16123
16152
|
|
|
16124
16153
|
// src/index.ts
|
|
16125
16154
|
var program = new Command39();
|
|
16126
|
-
program.name("shiva").description("SHIVA Code - Control Station for Claude Code").version("0.
|
|
16155
|
+
program.name("shiva").description("SHIVA Code - Control Station for Claude Code").version("0.7.0");
|
|
16127
16156
|
program.addCommand(loginCommand);
|
|
16128
16157
|
program.addCommand(logoutCommand);
|
|
16129
16158
|
program.addCommand(sessionsCommand);
|