kiro-memory 1.1.1 → 1.1.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kiro-memory",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "Persistent cross-session memory for Kiro CLI. Automatically tracks context, observations, and summaries across coding sessions.",
5
5
  "keywords": [
6
6
  "kiro",
@@ -429,6 +429,22 @@ function detectProject(cwd) {
429
429
  return cwd.split("/").pop() || "default";
430
430
  }
431
431
  }
432
+ async function notifyWorker(event, data) {
433
+ const host = process.env.KIRO_MEMORY_WORKER_HOST || "127.0.0.1";
434
+ const port = process.env.KIRO_MEMORY_WORKER_PORT || "3001";
435
+ try {
436
+ const controller = new AbortController();
437
+ const timeout = setTimeout(() => controller.abort(), 1500);
438
+ await fetch(`http://${host}:${port}/api/notify`, {
439
+ method: "POST",
440
+ headers: { "Content-Type": "application/json" },
441
+ body: JSON.stringify({ event, data: data || {} }),
442
+ signal: controller.signal
443
+ });
444
+ clearTimeout(timeout);
445
+ } catch {
446
+ }
447
+ }
432
448
  async function runHook(name, handler) {
433
449
  try {
434
450
  const input = await readStdin();
@@ -1156,6 +1172,7 @@ runHook("postToolUse", async (input) => {
1156
1172
  content,
1157
1173
  files
1158
1174
  });
1175
+ await notifyWorker("observation-created", { project, title, type });
1159
1176
  } finally {
1160
1177
  sdk.close();
1161
1178
  }
@@ -429,6 +429,22 @@ function detectProject(cwd) {
429
429
  return cwd.split("/").pop() || "default";
430
430
  }
431
431
  }
432
+ async function notifyWorker(event, data) {
433
+ const host = process.env.KIRO_MEMORY_WORKER_HOST || "127.0.0.1";
434
+ const port = process.env.KIRO_MEMORY_WORKER_PORT || "3001";
435
+ try {
436
+ const controller = new AbortController();
437
+ const timeout = setTimeout(() => controller.abort(), 1500);
438
+ await fetch(`http://${host}:${port}/api/notify`, {
439
+ method: "POST",
440
+ headers: { "Content-Type": "application/json" },
441
+ body: JSON.stringify({ event, data: data || {} }),
442
+ signal: controller.signal
443
+ });
444
+ clearTimeout(timeout);
445
+ } catch {
446
+ }
447
+ }
432
448
  async function runHook(name, handler) {
433
449
  try {
434
450
  const input = await readStdin();
@@ -1158,6 +1174,7 @@ runHook("stop", async (input) => {
1158
1174
  learned: learned || void 0,
1159
1175
  nextSteps: filesModified.length > 0 ? `File modificati: ${filesModified.join(", ")}` : void 0
1160
1176
  });
1177
+ await notifyWorker("summary-created", { project });
1161
1178
  } finally {
1162
1179
  sdk.close();
1163
1180
  }
@@ -429,6 +429,22 @@ function detectProject(cwd) {
429
429
  return cwd.split("/").pop() || "default";
430
430
  }
431
431
  }
432
+ async function notifyWorker(event, data) {
433
+ const host = process.env.KIRO_MEMORY_WORKER_HOST || "127.0.0.1";
434
+ const port = process.env.KIRO_MEMORY_WORKER_PORT || "3001";
435
+ try {
436
+ const controller = new AbortController();
437
+ const timeout = setTimeout(() => controller.abort(), 1500);
438
+ await fetch(`http://${host}:${port}/api/notify`, {
439
+ method: "POST",
440
+ headers: { "Content-Type": "application/json" },
441
+ body: JSON.stringify({ event, data: data || {} }),
442
+ signal: controller.signal
443
+ });
444
+ clearTimeout(timeout);
445
+ } catch {
446
+ }
447
+ }
432
448
  async function runHook(name, handler) {
433
449
  try {
434
450
  const input = await readStdin();
@@ -1147,6 +1163,7 @@ runHook("userPromptSubmit", async (input) => {
1147
1163
  if (!promptText || promptText === '""') return;
1148
1164
  const sessionId = `kiro-${(/* @__PURE__ */ new Date()).toISOString().split("T")[0]}-${project}`;
1149
1165
  await sdk.storePrompt(sessionId, Date.now(), promptText);
1166
+ await notifyWorker("prompt-created", { project });
1150
1167
  } finally {
1151
1168
  sdk.close();
1152
1169
  }
@@ -808,6 +808,15 @@ data: ${JSON.stringify(data)}
808
808
  }
809
809
  });
810
810
  }
811
+ app.post("/api/notify", express.json(), (req, res) => {
812
+ const { event, data } = req.body || {};
813
+ if (event && typeof event === "string") {
814
+ broadcast(event, data || {});
815
+ res.json({ ok: true });
816
+ } else {
817
+ res.status(400).json({ error: 'Campo "event" richiesto' });
818
+ }
819
+ });
811
820
  app.get("/health", (req, res) => {
812
821
  res.json({
813
822
  status: "ok",