opencode-swarm 7.130.2 → 7.132.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 +2 -2
- package/dist/cli/{config-doctor-489wej17.js → config-doctor-3rssa871.js} +2 -2
- package/dist/cli/{curation-policy-aaz0hap6.js → curation-policy-3914h3g9.js} +2 -2
- package/dist/cli/{curator-s2ynewsr.js → curator-1e77dq6x.js} +13 -13
- package/dist/cli/{curator-llm-factory-mxjcctn8.js → curator-llm-factory-41c17ybs.js} +13 -13
- package/dist/cli/{evidence-summary-service-hf7qq777.js → evidence-summary-service-jfagmvrh.js} +1 -1
- package/dist/cli/{guardrail-explain-s85kv81r.js → guardrail-explain-624brj1y.js} +14 -14
- package/dist/cli/{guardrail-log-2cejc33f.js → guardrail-log-vfka4tcn.js} +3 -3
- package/dist/cli/{hive-promoter-qdgxajht.js → hive-promoter-mw5prfy2.js} +13 -13
- package/dist/cli/{index-kzvwb2se.js → index-03zyn94g.js} +110 -85
- package/dist/cli/{index-xa29259t.js → index-2dtwjx39.js} +1 -1
- package/dist/cli/{index-5xxgeksy.js → index-5x3g1q91.js} +50 -2
- package/dist/cli/{index-zft4hp35.js → index-64z5dvam.js} +1 -1
- package/dist/cli/{index-ts9wh1ba.js → index-6mcx76j9.js} +60 -8
- package/dist/cli/{index-etdgtk3m.js → index-8w3sp149.js} +3502 -1947
- package/dist/cli/{index-6fqj8fcp.js → index-99tq1zd5.js} +2 -2
- package/dist/cli/{index-jvyn76xe.js → index-e630fw43.js} +3 -3
- package/dist/cli/{index-nr5pr54q.js → index-exs5bt14.js} +1 -1
- package/dist/cli/{index-hjar4crm.js → index-fegng5pv.js} +1 -1
- package/dist/cli/{index-jxha73tm.js → index-nsxchdx0.js} +1 -1
- package/dist/cli/{index-3rnkyb60.js → index-ppkp20fp.js} +5 -5
- package/dist/cli/{index-p6qgjkbt.js → index-q0ysv66x.js} +9 -1
- package/dist/cli/{index-jvwkxz8q.js → index-qg1cj1ev.js} +15 -15
- package/dist/cli/{index-s8h2cedv.js → index-sbq3gbjs.js} +1 -1
- package/dist/cli/{index-wy3q73j2.js → index-zah4qws8.js} +18 -14
- package/dist/cli/{index-agte9w1e.js → index-zrh07ykv.js} +2 -2
- package/dist/cli/index.js +13 -13
- package/dist/cli/{knowledge-escalator-1ypz0266.js → knowledge-escalator-5hv2dwhz.js} +3 -3
- package/dist/cli/{knowledge-events-yvcczmja.js → knowledge-events-434663dp.js} +1 -1
- package/dist/cli/{knowledge-store-h8bp9eje.js → knowledge-store-73ykq5j3.js} +3 -1
- package/dist/cli/{knowledge-validator-sz9v1fdq.js → knowledge-validator-tnadtt1h.js} +4 -4
- package/dist/cli/{scan-cursor-k9zyt374.js → scan-cursor-e33n9pej.js} +2 -2
- package/dist/cli/{schema-fkpn2r1s.js → schema-1kwmcayk.js} +5 -1
- package/dist/cli/{skill-generator-a6a9jxfd.js → skill-generator-k111qfdw.js} +5 -5
- package/dist/commands/consolidate.d.ts +14 -0
- package/dist/commands/curate.d.ts +2 -0
- package/dist/commands/promote.d.ts +25 -0
- package/dist/commands/registry.d.ts +2 -2
- package/dist/config/schema.d.ts +101 -0
- package/dist/consensus/contracts.d.ts +479 -0
- package/dist/consensus/corpus.d.ts +261 -0
- package/dist/consensus/miner.d.ts +200 -0
- package/dist/consensus/public-api.d.ts +42 -0
- package/dist/consensus/store.d.ts +119 -0
- package/dist/evidence/immutable-store.d.ts +86 -0
- package/dist/evidence/manager.d.ts +31 -1
- package/dist/hooks/actionability-predicate.d.ts +36 -0
- package/dist/hooks/curator.d.ts +3 -0
- package/dist/hooks/hive-policy.d.ts +11 -0
- package/dist/hooks/hive-promoter.d.ts +27 -1
- package/dist/hooks/knowledge-dedup-sweep.d.ts +145 -0
- package/dist/hooks/knowledge-injector.d.ts +4 -0
- package/dist/hooks/knowledge-store.d.ts +26 -0
- package/dist/hooks/knowledge-types.d.ts +6 -0
- package/dist/hooks/knowledge-validator.d.ts +10 -14
- package/dist/hooks/micro-reflector.d.ts +106 -2
- package/dist/hooks/realtime-learning-nudge.d.ts +19 -0
- package/dist/index.js +464 -456
- package/dist/knowledge/entry-merge.d.ts +112 -0
- package/dist/knowledge/family-migration.d.ts +6 -2
- package/dist/learning/admission.d.ts +154 -0
- package/dist/learning/candidate-queue.d.ts +178 -0
- package/dist/learning/fingerprint.d.ts +56 -0
- package/dist/learning/prm-pattern-support.d.ts +124 -0
- package/dist/learning/provenance.d.ts +86 -0
- package/dist/parallel/index.d.ts +0 -2
- package/dist/plan/parallel-verdict.d.ts +94 -0
- package/dist/prm/index.d.ts +46 -1
- package/dist/services/recommendation-ledger.d.ts +266 -0
- package/dist/services/skill-improver.d.ts +4 -0
- package/dist/services/status-service.d.ts +27 -0
- package/dist/services/trajectory-cluster.d.ts +65 -2
- package/dist/tools/consensus-mine.d.ts +172 -0
- package/dist/tools/index.d.ts +2 -0
- package/dist/tools/knowledge-add.d.ts +34 -0
- package/dist/tools/lean-turbo-run-phase.d.ts +7 -0
- package/dist/tools/manifest.d.ts +2 -0
- package/dist/tools/plan-conflict-check.d.ts +61 -0
- package/dist/tools/tool-metadata.d.ts +8 -0
- package/dist/turbo/lean/recovery.d.ts +90 -0
- package/dist/turbo/lean/runner.d.ts +16 -1
- package/dist/worktree/merge.d.ts +5 -0
- package/package.json +1 -1
- package/dist/parallel/dependency-graph.d.ts +0 -34
- package/dist/parallel/meta-indexer.d.ts +0 -32
|
@@ -235,6 +235,58 @@ async function appendRewriteHistory(directory, record) {
|
|
|
235
235
|
async function readRewriteHistory(directory) {
|
|
236
236
|
return readKnowledge(resolveRewriteHistoryPath(directory));
|
|
237
237
|
}
|
|
238
|
+
function dedupeCapped(values, opts) {
|
|
239
|
+
if (!Array.isArray(values))
|
|
240
|
+
return [];
|
|
241
|
+
const seen = new Set;
|
|
242
|
+
const out = [];
|
|
243
|
+
for (const raw of values) {
|
|
244
|
+
if (out.length >= opts.cap)
|
|
245
|
+
break;
|
|
246
|
+
if (typeof raw !== "string")
|
|
247
|
+
continue;
|
|
248
|
+
const item = opts.itemMaxChars === undefined ? raw : raw.slice(0, opts.itemMaxChars);
|
|
249
|
+
const key = item.toLowerCase();
|
|
250
|
+
if (seen.has(key))
|
|
251
|
+
continue;
|
|
252
|
+
seen.add(key);
|
|
253
|
+
out.push(item);
|
|
254
|
+
}
|
|
255
|
+
return out;
|
|
256
|
+
}
|
|
257
|
+
var WRITE_FIELD_CAP = 20;
|
|
258
|
+
var WRITE_NORMALIZED_ARRAY_FIELDS = [
|
|
259
|
+
"tags",
|
|
260
|
+
"applies_to_agents",
|
|
261
|
+
"applies_to_tools",
|
|
262
|
+
"required_actions",
|
|
263
|
+
"forbidden_actions",
|
|
264
|
+
"verification_checks"
|
|
265
|
+
];
|
|
266
|
+
function normalizeEntryArraysForWrite(entry) {
|
|
267
|
+
if (!entry || typeof entry !== "object" || Array.isArray(entry))
|
|
268
|
+
return entry;
|
|
269
|
+
const obj = entry;
|
|
270
|
+
let copy = null;
|
|
271
|
+
for (const field of WRITE_NORMALIZED_ARRAY_FIELDS) {
|
|
272
|
+
let value;
|
|
273
|
+
try {
|
|
274
|
+
value = obj[field];
|
|
275
|
+
} catch {
|
|
276
|
+
continue;
|
|
277
|
+
}
|
|
278
|
+
if (!Array.isArray(value))
|
|
279
|
+
continue;
|
|
280
|
+
const normalized = dedupeCapped(value, { cap: WRITE_FIELD_CAP });
|
|
281
|
+
if (normalized.length === value.length && normalized.every((v, i) => v === value[i])) {
|
|
282
|
+
continue;
|
|
283
|
+
}
|
|
284
|
+
if (!copy)
|
|
285
|
+
copy = { ...obj };
|
|
286
|
+
copy[field] = normalized;
|
|
287
|
+
}
|
|
288
|
+
return copy ?? entry;
|
|
289
|
+
}
|
|
238
290
|
async function appendKnowledge(filePath, entry) {
|
|
239
291
|
const dir = path.dirname(filePath);
|
|
240
292
|
await mkdir(dir, { recursive: true });
|
|
@@ -244,7 +296,7 @@ async function appendKnowledge(filePath, entry) {
|
|
|
244
296
|
retries: { retries: 5, minTimeout: 100, maxTimeout: 500 },
|
|
245
297
|
stale: 5000
|
|
246
298
|
});
|
|
247
|
-
await appendFile(filePath, `${JSON.stringify(entry)}
|
|
299
|
+
await appendFile(filePath, `${JSON.stringify(normalizeEntryArraysForWrite(entry))}
|
|
248
300
|
`, "utf-8");
|
|
249
301
|
} finally {
|
|
250
302
|
if (release) {
|
|
@@ -263,7 +315,7 @@ async function rewriteKnowledge(filePath, entries) {
|
|
|
263
315
|
retries: { retries: 5, minTimeout: 100, maxTimeout: 500 },
|
|
264
316
|
stale: 5000
|
|
265
317
|
});
|
|
266
|
-
const content = entries.map((e) => JSON.stringify(e)).join(`
|
|
318
|
+
const content = entries.map((e) => JSON.stringify(normalizeEntryArraysForWrite(e))).join(`
|
|
267
319
|
`) + (entries.length > 0 ? `
|
|
268
320
|
` : "");
|
|
269
321
|
await atomicWriteFile(filePath, content);
|
|
@@ -304,7 +356,7 @@ async function transactFile(filePath, read, write, mutate) {
|
|
|
304
356
|
}
|
|
305
357
|
async function transactKnowledge(filePath, mutate) {
|
|
306
358
|
return transactFile(filePath, readKnowledge, async (fp, entries) => {
|
|
307
|
-
const content = entries.map((e) => JSON.stringify(e)).join(`
|
|
359
|
+
const content = entries.map((e) => JSON.stringify(normalizeEntryArraysForWrite(e))).join(`
|
|
308
360
|
`) + (entries.length > 0 ? `
|
|
309
361
|
` : "");
|
|
310
362
|
await atomicWriteFile(fp, content);
|
|
@@ -650,7 +702,7 @@ async function applyConfidenceFloorAction(directory, touched, options) {
|
|
|
650
702
|
const recovered = touched.filter((e) => e.confidence > CONFIDENCE_FLOOR + FLOOR_EPSILON && e.confidence_floor_demoted);
|
|
651
703
|
if (atFloor.length === 0 && recovered.length === 0)
|
|
652
704
|
return;
|
|
653
|
-
const { readKnowledgeCounterRollups, effectiveRetrievalOutcomes } = await import("./knowledge-events-
|
|
705
|
+
const { readKnowledgeCounterRollups, effectiveRetrievalOutcomes } = await import("./knowledge-events-434663dp.js");
|
|
654
706
|
const rollups = await readKnowledgeCounterRollups(directory);
|
|
655
707
|
const flagIds = new Set;
|
|
656
708
|
for (const e of atFloor) {
|
|
@@ -717,11 +769,11 @@ async function applyConfidenceFloorAction(directory, touched, options) {
|
|
|
717
769
|
});
|
|
718
770
|
}
|
|
719
771
|
if (action === "quarantine" && toQuarantine.length > 0) {
|
|
720
|
-
const { quarantineEntry } = await import("./knowledge-validator-
|
|
721
|
-
const { KnowledgeConfigSchema } = await import("./schema-
|
|
772
|
+
const { quarantineEntry } = await import("./knowledge-validator-tnadtt1h.js");
|
|
773
|
+
const { KnowledgeConfigSchema } = await import("./schema-1kwmcayk.js");
|
|
722
774
|
let config;
|
|
723
775
|
try {
|
|
724
|
-
const { loadPluginConfigWithMeta } = await import("./index-
|
|
776
|
+
const { loadPluginConfigWithMeta } = await import("./index-zrh07ykv.js");
|
|
725
777
|
const { config: loadedConfig } = loadPluginConfigWithMeta(directory);
|
|
726
778
|
config = KnowledgeConfigSchema.parse(loadedConfig.knowledge ?? {});
|
|
727
779
|
} catch {
|
|
@@ -818,4 +870,4 @@ var _internals = {
|
|
|
818
870
|
getArchivedKnowledgeIds
|
|
819
871
|
};
|
|
820
872
|
|
|
821
|
-
export { findActiveSwarmNearDuplicate, reinforceSwarmKnowledgeEntry, getPlatformConfigDir, resolveSwarmKnowledgePath, resolveSwarmRejectedPath, resolveSwarmRetractionsPath, resolveRewriteHistoryPath, resolveHiveKnowledgePath2 as resolveHiveKnowledgePath, resolveHiveRejectedPath2 as resolveHiveRejectedPath, resolveHiveEventsPath2 as resolveHiveEventsPath, readKnowledge, normalizeEntry, computeContentHash, readRejectedLessons, readRetractionRecords, appendRetractionRecord, appendRewriteHistory, readRewriteHistory, appendKnowledge, rewriteKnowledge, transactFile, transactKnowledge, transactKnowledgeWithCas, getArchivedKnowledgeIds, appendKnowledgeWithCapEnforcement, enforceKnowledgeCap, selectKnowledgeCapSurvivors, sweepAgedEntries, sweepStaleTodos, appendRejectedLesson, normalize, wordBigrams, jaccardBigram, findNearDuplicate, computeConfidence, MAX_CONFIRMED_BY, confirmEntriesPhase, OUTCOME_SIGNAL_SMOOTHING, computeOutcomeSignal, inferTags, bumpKnowledgeConfidenceBatch, _internals };
|
|
873
|
+
export { isActiveSwarmKnowledgeEntry, findActiveSwarmNearDuplicate, reinforceSwarmKnowledgeEntry, getPlatformConfigDir, resolveSwarmKnowledgePath, resolveSwarmRejectedPath, resolveSwarmRetractionsPath, resolveRewriteHistoryPath, resolveHiveKnowledgePath2 as resolveHiveKnowledgePath, resolveHiveRejectedPath2 as resolveHiveRejectedPath, resolveHiveEventsPath2 as resolveHiveEventsPath, readKnowledge, normalizeEntry, computeContentHash, readRejectedLessons, readRetractionRecords, appendRetractionRecord, appendRewriteHistory, readRewriteHistory, dedupeCapped, appendKnowledge, rewriteKnowledge, transactFile, transactKnowledge, transactKnowledgeWithCas, getArchivedKnowledgeIds, appendKnowledgeWithCapEnforcement, enforceKnowledgeCap, selectKnowledgeCapSurvivors, sweepAgedEntries, sweepStaleTodos, appendRejectedLesson, normalize, wordBigrams, jaccardBigram, findNearDuplicate, computeConfidence, MAX_CONFIRMED_BY, confirmEntriesPhase, OUTCOME_SIGNAL_SMOOTHING, computeOutcomeSignal, inferTags, bumpKnowledgeConfidenceBatch, _internals };
|