shiva-code 0.2.0 → 0.2.2

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.
Files changed (2) hide show
  1. package/dist/index.js +25 -11
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1138,7 +1138,15 @@ function saveClaudeSettings(settings) {
1138
1138
  }
1139
1139
  function hasShivaHook(hooks, event) {
1140
1140
  if (!hooks || !hooks[event]) return false;
1141
- return hooks[event].some((h) => h.command.includes("shiva"));
1141
+ const eventHooks = hooks[event];
1142
+ return eventHooks.some(
1143
+ (entry) => entry.hooks?.some((h) => h.command?.includes("shiva"))
1144
+ );
1145
+ }
1146
+ function removeShivaHooks(eventHooks) {
1147
+ return eventHooks.filter(
1148
+ (entry) => !entry.hooks?.some((h) => h.command?.includes("shiva"))
1149
+ );
1142
1150
  }
1143
1151
  var hookCommand = new Command9("hook").description("Claude Code Hook Integration verwalten");
1144
1152
  hookCommand.command("install").description("SHIVA Hooks in Claude Code installieren").action(() => {
@@ -1169,15 +1177,25 @@ hookCommand.command("install").description("SHIVA Hooks in Claude Code installie
1169
1177
  settings.hooks.SessionStart = [];
1170
1178
  }
1171
1179
  settings.hooks.SessionStart.push({
1172
- command: "shiva sync --pull --quiet",
1173
- timeout: 15e3
1180
+ hooks: [
1181
+ {
1182
+ type: "command",
1183
+ command: "shiva sync --pull --quiet",
1184
+ timeout: 30
1185
+ }
1186
+ ]
1174
1187
  });
1175
1188
  if (!settings.hooks.Stop) {
1176
1189
  settings.hooks.Stop = [];
1177
1190
  }
1178
1191
  settings.hooks.Stop.push({
1179
- command: "shiva sync --push --quiet",
1180
- timeout: 15e3
1192
+ hooks: [
1193
+ {
1194
+ type: "command",
1195
+ command: "shiva sync --push --quiet",
1196
+ timeout: 30
1197
+ }
1198
+ ]
1181
1199
  });
1182
1200
  saveClaudeSettings(settings);
1183
1201
  log.success("SHIVA Hooks installiert!");
@@ -1201,17 +1219,13 @@ hookCommand.command("uninstall").description("SHIVA Hooks aus Claude Code entfer
1201
1219
  let removed = false;
1202
1220
  if (settings.hooks.SessionStart) {
1203
1221
  const before = settings.hooks.SessionStart.length;
1204
- settings.hooks.SessionStart = settings.hooks.SessionStart.filter(
1205
- (h) => !h.command.includes("shiva")
1206
- );
1222
+ settings.hooks.SessionStart = removeShivaHooks(settings.hooks.SessionStart);
1207
1223
  if (settings.hooks.SessionStart.length < before) removed = true;
1208
1224
  if (settings.hooks.SessionStart.length === 0) delete settings.hooks.SessionStart;
1209
1225
  }
1210
1226
  if (settings.hooks.Stop) {
1211
1227
  const before = settings.hooks.Stop.length;
1212
- settings.hooks.Stop = settings.hooks.Stop.filter(
1213
- (h) => !h.command.includes("shiva")
1214
- );
1228
+ settings.hooks.Stop = removeShivaHooks(settings.hooks.Stop);
1215
1229
  if (settings.hooks.Stop.length < before) removed = true;
1216
1230
  if (settings.hooks.Stop.length === 0) delete settings.hooks.Stop;
1217
1231
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shiva-code",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Makes Claude Code Persistent - Cross-Project Memory CLI",
5
5
  "author": "SHIVA AI",
6
6
  "license": "MIT",