kiro-memory 1.0.4 → 1.1.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.
package/README.md CHANGED
@@ -2,7 +2,6 @@
2
2
 
3
3
  **Persistent cross-session memory for [Kiro CLI](https://kiro.dev/).**
4
4
 
5
- ![CI](https://github.com/auriti-web-design/kiro-memory/actions/workflows/ci.yml/badge.svg)
6
5
  ![npm](https://img.shields.io/npm/v/kiro-memory)
7
6
  ![License](https://img.shields.io/badge/license-AGPL--3.0-blue)
8
7
  ![Node](https://img.shields.io/badge/node-%3E%3D18-green)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kiro-memory",
3
- "version": "1.0.4",
3
+ "version": "1.1.0",
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",
@@ -1,5 +1,4 @@
1
1
  #!/usr/bin/env node
2
- #!/usr/bin/env node
3
2
  var __defProp = Object.defineProperty;
4
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
4
  var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
@@ -1163,7 +1163,45 @@ function createContextKit(config) {
1163
1163
  }
1164
1164
 
1165
1165
  // src/hooks/agentSpawn.ts
1166
+ import { spawn } from "child_process";
1167
+ import { dirname as dirname2, join as join3 } from "path";
1168
+ import { fileURLToPath as fileURLToPath2 } from "url";
1169
+ var __filename_hook = fileURLToPath2(import.meta.url);
1170
+ var __dirname_hook = dirname2(__filename_hook);
1171
+ async function ensureWorkerRunning() {
1172
+ const host = process.env.KIRO_MEMORY_WORKER_HOST || "127.0.0.1";
1173
+ const port = process.env.KIRO_MEMORY_WORKER_PORT || "3001";
1174
+ const healthUrl = `http://${host}:${port}/health`;
1175
+ try {
1176
+ const controller = new AbortController();
1177
+ const timeout = setTimeout(() => controller.abort(), 1500);
1178
+ const resp = await fetch(healthUrl, { signal: controller.signal });
1179
+ clearTimeout(timeout);
1180
+ if (resp.ok) return;
1181
+ } catch {
1182
+ }
1183
+ const workerPath = join3(__dirname_hook, "..", "worker-service.js");
1184
+ const child = spawn("node", [workerPath], {
1185
+ detached: true,
1186
+ stdio: "ignore",
1187
+ env: { ...process.env }
1188
+ });
1189
+ child.unref();
1190
+ for (let i = 0; i < 6; i++) {
1191
+ await new Promise((r) => setTimeout(r, 500));
1192
+ try {
1193
+ const controller = new AbortController();
1194
+ const timeout = setTimeout(() => controller.abort(), 800);
1195
+ const resp = await fetch(healthUrl, { signal: controller.signal });
1196
+ clearTimeout(timeout);
1197
+ if (resp.ok) return;
1198
+ } catch {
1199
+ }
1200
+ }
1201
+ }
1166
1202
  runHook("agentSpawn", async (input) => {
1203
+ await ensureWorkerRunning().catch(() => {
1204
+ });
1167
1205
  const project = detectProject(input.cwd);
1168
1206
  const sdk = createContextKit({ project });
1169
1207
  try {
@@ -1171,7 +1209,7 @@ runHook("agentSpawn", async (input) => {
1171
1209
  if (ctx.relevantObservations.length === 0 && ctx.relevantSummaries.length === 0) {
1172
1210
  return;
1173
1211
  }
1174
- let output = "# ContextKit: Contesto Sessioni Precedenti\n\n";
1212
+ let output = "# Kiro Memory: Contesto Sessioni Precedenti\n\n";
1175
1213
  output += formatContext({
1176
1214
  observations: ctx.relevantObservations,
1177
1215
  summaries: ctx.relevantSummaries,
@@ -1179,6 +1217,8 @@ runHook("agentSpawn", async (input) => {
1179
1217
  });
1180
1218
  output += `
1181
1219
  > Progetto: ${project} | Osservazioni: ${ctx.relevantObservations.length} | Sommari: ${ctx.relevantSummaries.length}
1220
+ `;
1221
+ output += `> UI disponibile su http://127.0.0.1:${process.env.KIRO_MEMORY_WORKER_PORT || "3001"}
1182
1222
  `;
1183
1223
  process.stdout.write(output);
1184
1224
  } finally {