starling-ai 0.0.2 → 0.0.3

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 +14 -8
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -683,15 +683,21 @@ function removeSpace(id) {
683
683
  const idx = store.spaces.findIndex((s) => s.id === id || s.name === id);
684
684
  if (idx === -1) return false;
685
685
  const space = store.spaces[idx];
686
- for (const b of store.bookmarks) {
687
- b.space_ids = b.space_ids.filter((sid) => sid !== space.id);
688
- }
689
- for (const s of store.spaces) {
690
- if (s.parent_id === space.id) {
691
- s.parent_id = space.parent_id;
686
+ const idsToRemove = /* @__PURE__ */ new Set([space.id]);
687
+ let changed = true;
688
+ while (changed) {
689
+ changed = false;
690
+ for (const candidate of store.spaces) {
691
+ if (candidate.parent_id && idsToRemove.has(candidate.parent_id) && !idsToRemove.has(candidate.id)) {
692
+ idsToRemove.add(candidate.id);
693
+ changed = true;
694
+ }
692
695
  }
693
696
  }
694
- store.spaces.splice(idx, 1);
697
+ for (const b of store.bookmarks) {
698
+ b.space_ids = b.space_ids.filter((sid) => !idsToRemove.has(sid));
699
+ }
700
+ store.spaces = store.spaces.filter((s) => !idsToRemove.has(s.id));
695
701
  saveStore(store);
696
702
  return true;
697
703
  }
@@ -4694,7 +4700,7 @@ function escapeRegex(value) {
4694
4700
  // src/index.ts
4695
4701
  var program = new Command7();
4696
4702
  program.enablePositionalOptions();
4697
- program.name("starling").description("Agent session manager \u2014 discover, pin, and organize AI coding sessions").version("0.1.0");
4703
+ program.name("starling").description("Agent session manager \u2014 discover, pin, and organize AI coding sessions").version("0.0.3");
4698
4704
  registerSessionCommand(program);
4699
4705
  registerPinCommand(program);
4700
4706
  registerSpaceCommand(program);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "starling-ai",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "Agent session manager — discover, bookmark, and organize AI coding sessions",
5
5
  "type": "module",
6
6
  "repository": {