opencode-swarm 7.116.1 → 7.117.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.
Files changed (33) hide show
  1. package/dist/cli/{curator-yxmtp8py.js → curator-fr2m5hna.js} +7 -7
  2. package/dist/cli/{curator-llm-factory-9qn52fnv.js → curator-llm-factory-m0kvna8n.js} +7 -7
  3. package/dist/cli/{guardrail-explain-xvyz2eag.js → guardrail-explain-xjgk822d.js} +8 -8
  4. package/dist/cli/{hive-promoter-ykqc60w1.js → hive-promoter-zpk5jmx0.js} +7 -7
  5. package/dist/cli/{index-34g1mv3c.js → index-4f4zv8pb.js} +28 -6
  6. package/dist/cli/{index-wegc6xwr.js → index-af94ke83.js} +3 -3
  7. package/dist/cli/{index-5h7d37nf.js → index-aws8yhwq.js} +3 -3
  8. package/dist/cli/{index-t5f01hnz.js → index-c9m5skgs.js} +2 -2
  9. package/dist/cli/{index-g4p13g8t.js → index-dc3j6jmk.js} +4 -3
  10. package/dist/cli/{index-wxkf3089.js → index-hskmya46.js} +3 -3
  11. package/dist/cli/{index-efdyjgeh.js → index-n3sm9ewn.js} +1 -1
  12. package/dist/cli/{index-p9jf8gt8.js → index-pgtqxat4.js} +8 -8
  13. package/dist/cli/{index-7kcpkm4y.js → index-vkdr12ek.js} +1473 -867
  14. package/dist/cli/index.js +7 -7
  15. package/dist/cli/{knowledge-escalator-tthw6c9q.js → knowledge-escalator-bmk725p4.js} +4 -4
  16. package/dist/cli/{knowledge-events-hrbmwxxj.js → knowledge-events-px14n75v.js} +2 -2
  17. package/dist/cli/{knowledge-store-5cns5sns.js → knowledge-store-z9znvtn2.js} +2 -2
  18. package/dist/cli/{knowledge-validator-xre0s774.js → knowledge-validator-7r5t821g.js} +3 -3
  19. package/dist/cli/{skill-generator-22nk6c6a.js → skill-generator-4d3w8sqt.js} +5 -5
  20. package/dist/commands/link.d.ts +7 -4
  21. package/dist/commands/unlink.d.ts +12 -5
  22. package/dist/hooks/knowledge-events.d.ts +2 -0
  23. package/dist/hooks/knowledge-link.d.ts +31 -4
  24. package/dist/index.js +211 -203
  25. package/dist/knowledge/cohort-identity.d.ts +103 -0
  26. package/dist/knowledge/config-fingerprint.d.ts +57 -0
  27. package/dist/knowledge/family-manifest.d.ts +50 -0
  28. package/dist/knowledge/family-migration.d.ts +109 -0
  29. package/dist/knowledge/identity.d.ts +12 -2
  30. package/dist/knowledge/index.d.ts +1 -0
  31. package/dist/services/knowledge-diagnostics.d.ts +27 -0
  32. package/dist/services/status-service.d.ts +13 -0
  33. package/package.json +1 -1
@@ -14,7 +14,7 @@ import {
14
14
  runCuratorInit,
15
15
  runCuratorPhase,
16
16
  writeCuratorSummary
17
- } from "./index-7kcpkm4y.js";
17
+ } from "./index-vkdr12ek.js";
18
18
  import"./index-nprawcc0.js";
19
19
  import"./index-8j5d3ytd.js";
20
20
  import"./index-c8s9a3zh.js";
@@ -24,13 +24,13 @@ import"./index-xdsd2hma.js";
24
24
  import"./index-scww5b77.js";
25
25
  import"./index-4905hd2m.js";
26
26
  import"./index-5bcrp3bc.js";
27
- import"./index-wxkf3089.js";
28
- import"./index-t5f01hnz.js";
29
- import"./index-wegc6xwr.js";
30
- import"./index-g4p13g8t.js";
31
- import"./index-5h7d37nf.js";
27
+ import"./index-hskmya46.js";
28
+ import"./index-c9m5skgs.js";
29
+ import"./index-af94ke83.js";
30
+ import"./index-dc3j6jmk.js";
31
+ import"./index-aws8yhwq.js";
32
32
  import"./index-bfwt3abw.js";
33
- import"./index-34g1mv3c.js";
33
+ import"./index-4f4zv8pb.js";
34
34
  import"./index-vxv732ex.js";
35
35
  import"./index-8fwhhayc.js";
36
36
  import"./index-q1exe2b3.js";
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  createCuratorLLMDelegate
4
- } from "./index-7kcpkm4y.js";
4
+ } from "./index-vkdr12ek.js";
5
5
  import"./index-nprawcc0.js";
6
6
  import"./index-8j5d3ytd.js";
7
7
  import"./index-c8s9a3zh.js";
@@ -11,13 +11,13 @@ import"./index-xdsd2hma.js";
11
11
  import"./index-scww5b77.js";
12
12
  import"./index-4905hd2m.js";
13
13
  import"./index-5bcrp3bc.js";
14
- import"./index-wxkf3089.js";
15
- import"./index-t5f01hnz.js";
16
- import"./index-wegc6xwr.js";
17
- import"./index-g4p13g8t.js";
18
- import"./index-5h7d37nf.js";
14
+ import"./index-hskmya46.js";
15
+ import"./index-c9m5skgs.js";
16
+ import"./index-af94ke83.js";
17
+ import"./index-dc3j6jmk.js";
18
+ import"./index-aws8yhwq.js";
19
19
  import"./index-bfwt3abw.js";
20
- import"./index-34g1mv3c.js";
20
+ import"./index-4f4zv8pb.js";
21
21
  import"./index-vxv732ex.js";
22
22
  import"./index-8fwhhayc.js";
23
23
  import"./index-q1exe2b3.js";
@@ -1,8 +1,8 @@
1
1
  // @bun
2
2
  import {
3
3
  handleGuardrailExplain
4
- } from "./index-efdyjgeh.js";
5
- import"./index-7kcpkm4y.js";
4
+ } from "./index-n3sm9ewn.js";
5
+ import"./index-vkdr12ek.js";
6
6
  import"./index-nprawcc0.js";
7
7
  import"./index-8j5d3ytd.js";
8
8
  import"./index-c8s9a3zh.js";
@@ -12,13 +12,13 @@ import"./index-xdsd2hma.js";
12
12
  import"./index-scww5b77.js";
13
13
  import"./index-4905hd2m.js";
14
14
  import"./index-5bcrp3bc.js";
15
- import"./index-wxkf3089.js";
16
- import"./index-t5f01hnz.js";
17
- import"./index-wegc6xwr.js";
18
- import"./index-g4p13g8t.js";
19
- import"./index-5h7d37nf.js";
15
+ import"./index-hskmya46.js";
16
+ import"./index-c9m5skgs.js";
17
+ import"./index-af94ke83.js";
18
+ import"./index-dc3j6jmk.js";
19
+ import"./index-aws8yhwq.js";
20
20
  import"./index-bfwt3abw.js";
21
- import"./index-34g1mv3c.js";
21
+ import"./index-4f4zv8pb.js";
22
22
  import"./index-vxv732ex.js";
23
23
  import"./index-8fwhhayc.js";
24
24
  import"./index-q1exe2b3.js";
@@ -6,7 +6,7 @@ import {
6
6
  isHiveEligible,
7
7
  promoteFromSwarm,
8
8
  promoteToHive
9
- } from "./index-7kcpkm4y.js";
9
+ } from "./index-vkdr12ek.js";
10
10
  import"./index-nprawcc0.js";
11
11
  import"./index-8j5d3ytd.js";
12
12
  import"./index-c8s9a3zh.js";
@@ -16,13 +16,13 @@ import"./index-xdsd2hma.js";
16
16
  import"./index-scww5b77.js";
17
17
  import"./index-4905hd2m.js";
18
18
  import"./index-5bcrp3bc.js";
19
- import"./index-wxkf3089.js";
20
- import"./index-t5f01hnz.js";
21
- import"./index-wegc6xwr.js";
22
- import"./index-g4p13g8t.js";
23
- import"./index-5h7d37nf.js";
19
+ import"./index-hskmya46.js";
20
+ import"./index-c9m5skgs.js";
21
+ import"./index-af94ke83.js";
22
+ import"./index-dc3j6jmk.js";
23
+ import"./index-aws8yhwq.js";
24
24
  import"./index-bfwt3abw.js";
25
- import"./index-34g1mv3c.js";
25
+ import"./index-4f4zv8pb.js";
26
26
  import"./index-vxv732ex.js";
27
27
  import"./index-8fwhhayc.js";
28
28
  import"./index-q1exe2b3.js";
@@ -13,7 +13,8 @@ import {
13
13
  lstatSync,
14
14
  mkdirSync,
15
15
  readFileSync,
16
- rmSync
16
+ rmSync,
17
+ statSync
17
18
  } from "fs";
18
19
  import * as os from "os";
19
20
  import * as path from "path";
@@ -93,12 +94,19 @@ function readLinkPointer(directory) {
93
94
  const safeId = sanitizeLinkId(linkId);
94
95
  if (!safeId)
95
96
  return null;
97
+ const rawVersion = obj.version;
98
+ const version = rawVersion === 2 ? 2 : 1;
96
99
  return {
97
- version: 1,
100
+ version,
98
101
  linkId: safeId,
99
102
  name: typeof obj.name === "string" ? obj.name : undefined,
100
103
  createdAt: typeof obj.createdAt === "string" ? obj.createdAt : new Date(0).toISOString(),
101
- source: obj.source === "auto" ? "auto" : "manual"
104
+ source: obj.source === "auto" ? "auto" : "manual",
105
+ cohortId: typeof obj.cohortId === "string" ? obj.cohortId : undefined,
106
+ identitySource: obj.identitySource === "remote" || obj.identitySource === "git-common-dir" || obj.identitySource === "path" ? obj.identitySource : undefined,
107
+ degraded: typeof obj.degraded === "boolean" ? obj.degraded : undefined,
108
+ configFingerprint: typeof obj.configFingerprint === "string" ? obj.configFingerprint : undefined,
109
+ generation: typeof obj.generation === "number" ? obj.generation : undefined
102
110
  };
103
111
  } catch {
104
112
  return null;
@@ -170,11 +178,21 @@ async function removeLinkPointer(directory) {
170
178
  }
171
179
  }
172
180
  var _resolutionCache = new Map;
181
+ function pointerStatFingerprint(directory) {
182
+ const pointerPath = resolveLinkPointerPath(directory);
183
+ try {
184
+ const st = statSync(pointerPath);
185
+ return `${st.mtimeMs}:${st.ctimeMs}:${st.size}`;
186
+ } catch {
187
+ return null;
188
+ }
189
+ }
173
190
  function resolveKnowledgeStoreDir(directory) {
174
191
  const localSwarm = path.join(directory, ".swarm");
175
192
  const now = Date.now();
176
193
  const cached = _resolutionCache.get(directory);
177
- if (cached && now < cached.expires) {
194
+ const currentStat = pointerStatFingerprint(directory);
195
+ if (cached && now < cached.expires && cached.pointerStat === currentStat) {
178
196
  return cached.linkDir ?? localSwarm;
179
197
  }
180
198
  let linkDir = null;
@@ -198,7 +216,11 @@ function resolveKnowledgeStoreDir(directory) {
198
216
  if (oldest !== undefined)
199
217
  _resolutionCache.delete(oldest);
200
218
  }
201
- _resolutionCache.set(directory, { linkDir, expires: now + CACHE_TTL_MS });
219
+ _resolutionCache.set(directory, {
220
+ linkDir,
221
+ expires: now + CACHE_TTL_MS,
222
+ pointerStat: currentStat
223
+ });
202
224
  return linkDir ?? localSwarm;
203
225
  }
204
226
  function invalidateKnowledgeStoreDirCache(directory) {
@@ -212,4 +234,4 @@ function isLinked(directory) {
212
234
  return readLinkPointer(directory) !== null;
213
235
  }
214
236
 
215
- export { resolveLinkDir, sanitizeLinkId, readLinkPointer, writeLinkPointer, removeLinkPointer, resolveKnowledgeStoreDir, isLinked };
237
+ export { resolveLinkDir, sanitizeLinkId, readLinkPointer, getLinkedLocalKnowledgeStatus, writeLinkPointer, removeLinkPointer, resolveKnowledgeStoreDir, isLinked };
@@ -4,7 +4,7 @@ import {
4
4
  countEntryViolationsInWindow,
5
5
  readKnowledgeEvents,
6
6
  recordKnowledgeEvent
7
- } from "./index-g4p13g8t.js";
7
+ } from "./index-dc3j6jmk.js";
8
8
  import {
9
9
  jaccardBigram,
10
10
  readKnowledge,
@@ -12,7 +12,7 @@ import {
12
12
  resolveSwarmKnowledgePath,
13
13
  transactKnowledge,
14
14
  wordBigrams
15
- } from "./index-5h7d37nf.js";
15
+ } from "./index-aws8yhwq.js";
16
16
  import {
17
17
  isActiveStatus
18
18
  } from "./index-bfwt3abw.js";
@@ -188,7 +188,7 @@ async function maybeQuarantineOnContradiction(directory, entryId, threshold, win
188
188
  alreadyInactive: true
189
189
  };
190
190
  }
191
- const { quarantineEntry } = await import("./knowledge-validator-xre0s774.js");
191
+ const { quarantineEntry } = await import("./knowledge-validator-7r5t821g.js");
192
192
  await quarantineEntry(directory, entryId, `repeat_contradiction: ${count} contradicted events in ${windowDays}d`, "auto");
193
193
  return { quarantined: true, entryId, contradictionsInWindow: count };
194
194
  } catch {
@@ -4,7 +4,7 @@ import {
4
4
  } from "./index-bfwt3abw.js";
5
5
  import {
6
6
  resolveKnowledgeStoreDir
7
- } from "./index-34g1mv3c.js";
7
+ } from "./index-4f4zv8pb.js";
8
8
  import {
9
9
  init_logger,
10
10
  log
@@ -595,7 +595,7 @@ async function applyConfidenceFloorAction(directory, touched, options) {
595
595
  const recovered = touched.filter((e) => e.confidence > CONFIDENCE_FLOOR + FLOOR_EPSILON && e.confidence_floor_demoted);
596
596
  if (atFloor.length === 0 && recovered.length === 0)
597
597
  return;
598
- const { readKnowledgeCounterRollups, effectiveRetrievalOutcomes } = await import("./knowledge-events-hrbmwxxj.js");
598
+ const { readKnowledgeCounterRollups, effectiveRetrievalOutcomes } = await import("./knowledge-events-px14n75v.js");
599
599
  const rollups = await readKnowledgeCounterRollups(directory);
600
600
  const flagIds = new Set;
601
601
  for (const e of atFloor) {
@@ -662,7 +662,7 @@ async function applyConfidenceFloorAction(directory, touched, options) {
662
662
  });
663
663
  }
664
664
  if (action === "quarantine" && toQuarantine.length > 0) {
665
- const { quarantineEntry } = await import("./knowledge-validator-xre0s774.js");
665
+ const { quarantineEntry } = await import("./knowledge-validator-7r5t821g.js");
666
666
  for (const { id } of toQuarantine) {
667
667
  await quarantineEntry(directory, id, "confidence_floor_negative_outcome", "auto").catch((err) => {
668
668
  log("[knowledge-store] confidence-floor quarantine failed (best-effort):", err instanceof Error ? err.message : String(err));
@@ -6,10 +6,10 @@ import {
6
6
  resolveSwarmKnowledgePath,
7
7
  resolveSwarmRejectedPath,
8
8
  transactKnowledge
9
- } from "./index-5h7d37nf.js";
9
+ } from "./index-aws8yhwq.js";
10
10
  import {
11
11
  resolveKnowledgeStoreDir
12
- } from "./index-34g1mv3c.js";
12
+ } from "./index-4f4zv8pb.js";
13
13
  import {
14
14
  init_logger,
15
15
  warn
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  resolveKnowledgeStoreDir
4
- } from "./index-34g1mv3c.js";
4
+ } from "./index-4f4zv8pb.js";
5
5
  import {
6
6
  init_logger,
7
7
  warn
@@ -594,7 +594,7 @@ async function applyKnowledgeVerdictFeedback(directory, options) {
594
594
  deltas.push({ id, delta });
595
595
  }
596
596
  if (deltas.length > 0) {
597
- const { bumpKnowledgeConfidenceBatch } = await import("./knowledge-store-5cns5sns.js");
597
+ const { bumpKnowledgeConfidenceBatch } = await import("./knowledge-store-z9znvtn2.js");
598
598
  await bumpKnowledgeConfidenceBatch(directory, deltas, options?.floorOptions);
599
599
  }
600
600
  return {
@@ -625,7 +625,8 @@ var _internals = {
625
625
  resolveHiveEventsPath,
626
626
  appendHiveKnowledgeEvent,
627
627
  recordHiveKnowledgeEvent,
628
- readHiveKnowledgeEvents
628
+ readHiveKnowledgeEvents,
629
+ mergeRollupInto
629
630
  };
630
631
 
631
632
  export { KNOWLEDGE_EVENT_SCHEMA_VERSION, MAX_EVENT_LOG_ENTRIES, RECEIPT_EVENT_TYPES, resolveKnowledgeEventsPath, resolveKnowledgeCounterBaselinePath, resolveHiveEventsPath, resolveLegacyApplicationLogPath, newTraceId, newEventId, appendKnowledgeEvent, recordKnowledgeEvent, appendHiveKnowledgeEvent, recordHiveKnowledgeEvent, readKnowledgeEvents, readHiveKnowledgeEvents, readLegacyApplicationRecords, MAX_VIOLATION_TIMESTAMPS, recomputeCounters, countViolationsInWindow, countEntryViolationsInWindow, countEntryContradictionsInWindow, readKnowledgeCounterRollups, effectiveRetrievalOutcomes, applyKnowledgeVerdictFeedback, _internals };
@@ -2,18 +2,18 @@
2
2
  import {
3
3
  ALLOWED_SKILL_PATH_PREFIXES,
4
4
  validateSkillPath
5
- } from "./index-t5f01hnz.js";
5
+ } from "./index-c9m5skgs.js";
6
6
  import {
7
7
  effectiveRetrievalOutcomes,
8
8
  readKnowledgeCounterRollups
9
- } from "./index-g4p13g8t.js";
9
+ } from "./index-dc3j6jmk.js";
10
10
  import {
11
11
  computeOutcomeSignal,
12
12
  readKnowledge,
13
13
  resolveHiveKnowledgePath,
14
14
  resolveSwarmKnowledgePath,
15
15
  transactKnowledge
16
- } from "./index-5h7d37nf.js";
16
+ } from "./index-aws8yhwq.js";
17
17
  import {
18
18
  isActiveStatus
19
19
  } from "./index-bfwt3abw.js";
@@ -12,7 +12,7 @@ import {
12
12
  detectPosixWrites,
13
13
  detectWindowsWrites,
14
14
  resolveWriteTargets
15
- } from "./index-7kcpkm4y.js";
15
+ } from "./index-vkdr12ek.js";
16
16
  import {
17
17
  checkFileAuthority,
18
18
  classifyFile,
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  handleGuardrailExplain
4
- } from "./index-efdyjgeh.js";
4
+ } from "./index-n3sm9ewn.js";
5
5
  import {
6
6
  handleGuardrailLog
7
7
  } from "./index-m43zgtjn.js";
@@ -83,7 +83,7 @@ import {
83
83
  handleWriteRetroCommand,
84
84
  normalizeSwarmCommandInput,
85
85
  resolveCommand
86
- } from "./index-7kcpkm4y.js";
86
+ } from "./index-vkdr12ek.js";
87
87
  import"./index-nprawcc0.js";
88
88
  import"./index-8j5d3ytd.js";
89
89
  import"./index-c8s9a3zh.js";
@@ -97,13 +97,13 @@ import"./index-xdsd2hma.js";
97
97
  import"./index-scww5b77.js";
98
98
  import"./index-4905hd2m.js";
99
99
  import"./index-5bcrp3bc.js";
100
- import"./index-wxkf3089.js";
101
- import"./index-t5f01hnz.js";
102
- import"./index-wegc6xwr.js";
103
- import"./index-g4p13g8t.js";
104
- import"./index-5h7d37nf.js";
100
+ import"./index-hskmya46.js";
101
+ import"./index-c9m5skgs.js";
102
+ import"./index-af94ke83.js";
103
+ import"./index-dc3j6jmk.js";
104
+ import"./index-aws8yhwq.js";
105
105
  import"./index-bfwt3abw.js";
106
- import"./index-34g1mv3c.js";
106
+ import"./index-4f4zv8pb.js";
107
107
  import"./index-vxv732ex.js";
108
108
  import"./index-8fwhhayc.js";
109
109
  import"./index-q1exe2b3.js";