opencode-swarm 7.130.1 → 7.131.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/dist/cli/{config-doctor-489wej17.js → config-doctor-rjvb0hhn.js} +2 -2
- package/dist/cli/{curation-policy-aaz0hap6.js → curation-policy-f5bybzmh.js} +2 -2
- package/dist/cli/{curator-by14m5fc.js → curator-kjzqa5m7.js} +14 -14
- package/dist/cli/{curator-llm-factory-7rz7mvcr.js → curator-llm-factory-ezq4fakt.js} +14 -14
- package/dist/cli/{evidence-summary-service-hf7qq777.js → evidence-summary-service-jfagmvrh.js} +1 -1
- package/dist/cli/{guardrail-explain-mvct2n9f.js → guardrail-explain-n93qh8k6.js} +15 -15
- package/dist/cli/{guardrail-log-2cejc33f.js → guardrail-log-h4tmcjwx.js} +3 -3
- package/dist/cli/{hive-promoter-trezcyrd.js → hive-promoter-mammxe5p.js} +14 -14
- package/dist/cli/{index-jvyn76xe.js → index-01nyrk95.js} +3 -3
- package/dist/cli/{index-kzvwb2se.js → index-03zyn94g.js} +110 -85
- package/dist/cli/{index-xa29259t.js → index-1atz85c8.js} +1 -1
- package/dist/cli/{index-j0py44fv.js → index-6vg0qczz.js} +2 -2
- package/dist/cli/{index-zft4hp35.js → index-cnwh164k.js} +1 -1
- package/dist/cli/{index-hjar4crm.js → index-cq22pnd2.js} +1 -1
- package/dist/cli/{index-4qrbvrz5.js → index-d2tgc580.js} +2689 -1241
- package/dist/cli/{index-jxha73tm.js → index-fepakwhp.js} +1 -1
- package/dist/cli/{index-f2y46pda.js → index-h3k62043.js} +20 -6
- package/dist/cli/{index-5xxgeksy.js → index-hynbzh7s.js} +46 -2
- package/dist/cli/{index-p6qgjkbt.js → index-kbfhyxtv.js} +9 -1
- package/dist/cli/{index-3rnkyb60.js → index-m6zfm7cm.js} +5 -5
- package/dist/cli/{index-s8h2cedv.js → index-pft1qxqh.js} +1 -1
- package/dist/cli/{index-ts9wh1ba.js → index-q68sprcy.js} +60 -8
- package/dist/cli/{index-agte9w1e.js → index-szkswbqf.js} +2 -2
- package/dist/cli/{index-nr5pr54q.js → index-tw33v84d.js} +1 -1
- package/dist/cli/{index-xdx5b4s1.js → index-xhd797bz.js} +16 -16
- package/dist/cli/{index-wy3q73j2.js → index-xv2ydncg.js} +18 -14
- package/dist/cli/index.js +14 -14
- package/dist/cli/{knowledge-escalator-1ypz0266.js → knowledge-escalator-cf1kkmfe.js} +3 -3
- package/dist/cli/{knowledge-events-yvcczmja.js → knowledge-events-p8t5ev44.js} +1 -1
- package/dist/cli/{knowledge-store-h8bp9eje.js → knowledge-store-vpdmcwem.js} +3 -1
- package/dist/cli/{knowledge-validator-sz9v1fdq.js → knowledge-validator-w1t0sw5f.js} +4 -4
- package/dist/cli/{scan-cursor-k9zyt374.js → scan-cursor-z4c51902.js} +2 -2
- package/dist/cli/{schema-fkpn2r1s.js → schema-yqzzfavj.js} +5 -1
- package/dist/cli/{skill-generator-a6a9jxfd.js → skill-generator-aaabj00n.js} +5 -5
- package/dist/cli/{workspace-snapshot-jwkjg790.js → workspace-snapshot-35qc0y8a.js} +1 -1
- 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 +427 -419
- 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/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 +13 -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 +1 -0
- package/dist/tools/knowledge-add.d.ts +34 -0
- package/dist/tools/manifest.d.ts +1 -0
- package/dist/tools/tool-metadata.d.ts +4 -0
- package/package.json +1 -1
|
@@ -608,7 +608,7 @@ async function applyKnowledgeVerdictFeedback(directory, options) {
|
|
|
608
608
|
deltas.push({ id, delta });
|
|
609
609
|
}
|
|
610
610
|
if (deltas.length > 0) {
|
|
611
|
-
const { bumpKnowledgeConfidenceBatch } = await import("./knowledge-store-
|
|
611
|
+
const { bumpKnowledgeConfidenceBatch } = await import("./knowledge-store-vpdmcwem.js");
|
|
612
612
|
await bumpKnowledgeConfidenceBatch(directory, deltas, options?.floorOptions);
|
|
613
613
|
}
|
|
614
614
|
return {
|
|
@@ -340,11 +340,14 @@ async function resolveIsWorkingTreeCleanAsync(directory) {
|
|
|
340
340
|
return status === null ? null : status.length === 0;
|
|
341
341
|
}
|
|
342
342
|
function resolveCommitCountSince(directory, baseHeadSha, currentHeadSha) {
|
|
343
|
+
if (!isSafeGitRevisionToken(baseHeadSha) || !isSafeGitRevisionToken(currentHeadSha))
|
|
344
|
+
return null;
|
|
343
345
|
const output = runGit(directory, [
|
|
344
346
|
"rev-list",
|
|
345
347
|
"--count",
|
|
346
348
|
"--ancestry-path",
|
|
347
|
-
`${baseHeadSha}..${currentHeadSha}
|
|
349
|
+
`${baseHeadSha}..${currentHeadSha}`,
|
|
350
|
+
"--"
|
|
348
351
|
]);
|
|
349
352
|
if (!output || !/^\d+$/.test(output))
|
|
350
353
|
return null;
|
|
@@ -352,11 +355,14 @@ function resolveCommitCountSince(directory, baseHeadSha, currentHeadSha) {
|
|
|
352
355
|
return Number.isSafeInteger(count) ? count : null;
|
|
353
356
|
}
|
|
354
357
|
async function resolveCommitCountSinceAsync(directory, baseHeadSha, currentHeadSha) {
|
|
358
|
+
if (!isSafeGitRevisionToken(baseHeadSha) || !isSafeGitRevisionToken(currentHeadSha))
|
|
359
|
+
return null;
|
|
355
360
|
const output = await runGitAsync(directory, [
|
|
356
361
|
"rev-list",
|
|
357
362
|
"--count",
|
|
358
363
|
"--ancestry-path",
|
|
359
|
-
`${baseHeadSha}..${currentHeadSha}
|
|
364
|
+
`${baseHeadSha}..${currentHeadSha}`,
|
|
365
|
+
"--"
|
|
360
366
|
]);
|
|
361
367
|
if (!output || !/^\d+$/.test(output))
|
|
362
368
|
return null;
|
|
@@ -364,15 +370,19 @@ async function resolveCommitCountSinceAsync(directory, baseHeadSha, currentHeadS
|
|
|
364
370
|
return Number.isSafeInteger(count) ? count : null;
|
|
365
371
|
}
|
|
366
372
|
function resolveIsExactSingleChildCommit(directory, baseHeadSha, currentHeadSha) {
|
|
373
|
+
if (!isSafeGitRevisionToken(baseHeadSha) || !isSafeGitRevisionToken(currentHeadSha))
|
|
374
|
+
return null;
|
|
367
375
|
const base = runGit(directory, [
|
|
368
376
|
"rev-parse",
|
|
369
377
|
"--verify",
|
|
370
|
-
`${baseHeadSha}^{commit}
|
|
378
|
+
`${baseHeadSha}^{commit}`,
|
|
379
|
+
"--"
|
|
371
380
|
]);
|
|
372
381
|
const current = runGit(directory, [
|
|
373
382
|
"rev-parse",
|
|
374
383
|
"--verify",
|
|
375
|
-
`${currentHeadSha}^{commit}
|
|
384
|
+
`${currentHeadSha}^{commit}`,
|
|
385
|
+
"--"
|
|
376
386
|
]);
|
|
377
387
|
if (!base || !current)
|
|
378
388
|
return null;
|
|
@@ -389,15 +399,19 @@ function resolveIsExactSingleChildCommit(directory, baseHeadSha, currentHeadSha)
|
|
|
389
399
|
return fields.length === 2 && fields[0]?.toLowerCase() === current.toLowerCase() && fields[1]?.toLowerCase() === base.toLowerCase();
|
|
390
400
|
}
|
|
391
401
|
async function resolveIsExactSingleChildCommitAsync(directory, baseHeadSha, currentHeadSha) {
|
|
402
|
+
if (!isSafeGitRevisionToken(baseHeadSha) || !isSafeGitRevisionToken(currentHeadSha))
|
|
403
|
+
return null;
|
|
392
404
|
const base = await runGitAsync(directory, [
|
|
393
405
|
"rev-parse",
|
|
394
406
|
"--verify",
|
|
395
|
-
`${baseHeadSha}^{commit}
|
|
407
|
+
`${baseHeadSha}^{commit}`,
|
|
408
|
+
"--"
|
|
396
409
|
]);
|
|
397
410
|
const current = await runGitAsync(directory, [
|
|
398
411
|
"rev-parse",
|
|
399
412
|
"--verify",
|
|
400
|
-
`${currentHeadSha}^{commit}
|
|
413
|
+
`${currentHeadSha}^{commit}`,
|
|
414
|
+
"--"
|
|
401
415
|
]);
|
|
402
416
|
if (!base || !current)
|
|
403
417
|
return null;
|
|
@@ -431,6 +431,10 @@ var init_tool_metadata = __esm(() => {
|
|
|
431
431
|
description: "run curator phase analysis and optionally apply knowledge recommendations",
|
|
432
432
|
agents: ["architect"]
|
|
433
433
|
},
|
|
434
|
+
consensus_mine: {
|
|
435
|
+
description: "mine cross-run consensus from existing .swarm evidence into an immutable proposals-only report; also deletes its own reports past consensus.report_retention, appends to the shared recommendation dedup ledger (in the shared cohort root, outside this project, when a knowledge link is active), and mirrors proposals into pending swarm-memory proposals when memory is enabled",
|
|
436
|
+
agents: ["architect", "curator_phase", "curator_postmortem"]
|
|
437
|
+
},
|
|
434
438
|
knowledge_add: {
|
|
435
439
|
description: "store a new lesson in the knowledge base",
|
|
436
440
|
agents: ["architect", "coder"]
|
|
@@ -1243,7 +1247,7 @@ function resolveExternalSkillsConfig(input) {
|
|
|
1243
1247
|
};
|
|
1244
1248
|
return merged;
|
|
1245
1249
|
}
|
|
1246
|
-
var _internals, SEPARATORS, CANONICAL_ROLES_LONGEST_FIRST, CANONICAL_ROLES_SET, AgentReasoningConfigSchema, AgentThinkingConfigSchema, FALLBACK_MODELS_MAX = 3, AgentOverrideConfigSchema, SwarmConfigSchema, ModelPricingConfigSchema, PricingConfigSchema, HooksConfigSchema, ScoringWeightsSchema, DecisionDecaySchema, TokenRatiosSchema, ScoringConfigSchema, ContextBudgetConfigSchema, EvidenceConfigSchema, GateFeatureSchema, PlaceholderScanConfigSchema, QualityBudgetConfigSchema, GATE_CONFIG_KNOWN_SECTION_KEYS, GateConfigSchema, PipelineConfigSchema, PhaseCompleteConfigSchema, SummaryConfigSchema, ReviewPassesConfigSchema, AutoReviewConfigSchema, AdversarialDetectionConfigSchema, AdversarialTestingConfigSchemaBase, AdversarialTestingConfigSchema, IntegrationAnalysisConfigSchema, DocsConfigSchema, DesignDocsConfigSchema, UIReviewConfigSchema, CompactionAdvisoryConfigSchema, LintConfigSchema, SecretscanConfigSchema, GuardrailsProfileSchema, DEFAULT_AGENT_PROFILES, DEFAULT_ARCHITECT_PROFILE, GuardrailsConfigSchema, WatchdogConfigSchema, SelfReviewConfigSchema, ToolFilterConfigSchema, PlanCursorConfigSchema, ContextMapConfigSchema, RepoGraphConfigSchema, INVALID_CHECKPOINT_PROTO_FIELD = "__swarm_invalid_checkpoint_proto__", FORBIDDEN_CHECKPOINT_CONFIG_KEYS, CheckpointConfigSchema, ApplyPatchConfigSchema, AutomationModeSchema, AutomationCapabilitiesSchema, AutomationConfigSchemaBase, AutomationConfigSchema, KnowledgeConfigSchema, MemoryConfigSchema, CuratorConfigSchema, ArchitecturalSupervisionConfigSchema, KnowledgeApplicationConfigSchema, SkillPropagationAudienceSchema, SkillPropagationConfigSchema, SkillImproverConfigSchema, SkillsConfigSchema, SpecWriterConfigSchema, SlopDetectorConfigSchema, IncrementalVerifyConfigSchema, CompactionConfigSchema, PrmConfigSchema, AgentAuthorityRuleSchema, AuthorityConfigSchema, GeneralCouncilMemberConfigSchema, GeneralCouncilConfigSchema, CouncilConfigSchema, PrMonitorConfigSchema, ParallelizationConfigSchema, WorktreeIsolationConfigSchema, LeanTurboConfigSchema, EpicConfigSchema, StandardTurboConfigSchema, LeanTurboStrategyConfigSchema, TurboConfigSchema, ExternalSkillCandidateSourceTypeSchema, ExternalSkillCandidateEvaluationVerdictSchema, DiscoverySourceSchema, ExternalSkillCandidateSchema, ExternalSkillsConfigSchema, DEFAULT_EXTERNAL_SKILLS_CONFIG, DEFAULT_SKILLS_CONFIG, PluginConfigSchema;
|
|
1250
|
+
var _internals, SEPARATORS, CANONICAL_ROLES_LONGEST_FIRST, CANONICAL_ROLES_SET, AgentReasoningConfigSchema, AgentThinkingConfigSchema, FALLBACK_MODELS_MAX = 3, AgentOverrideConfigSchema, SwarmConfigSchema, ModelPricingConfigSchema, PricingConfigSchema, HooksConfigSchema, ScoringWeightsSchema, DecisionDecaySchema, TokenRatiosSchema, ScoringConfigSchema, ContextBudgetConfigSchema, EvidenceConfigSchema, GateFeatureSchema, PlaceholderScanConfigSchema, QualityBudgetConfigSchema, GATE_CONFIG_KNOWN_SECTION_KEYS, GateConfigSchema, PipelineConfigSchema, PhaseCompleteConfigSchema, SummaryConfigSchema, ReviewPassesConfigSchema, AutoReviewConfigSchema, AdversarialDetectionConfigSchema, AdversarialTestingConfigSchemaBase, AdversarialTestingConfigSchema, IntegrationAnalysisConfigSchema, DocsConfigSchema, DesignDocsConfigSchema, UIReviewConfigSchema, CompactionAdvisoryConfigSchema, LintConfigSchema, SecretscanConfigSchema, GuardrailsProfileSchema, DEFAULT_AGENT_PROFILES, DEFAULT_ARCHITECT_PROFILE, GuardrailsConfigSchema, WatchdogConfigSchema, SelfReviewConfigSchema, ToolFilterConfigSchema, PlanCursorConfigSchema, ContextMapConfigSchema, RepoGraphConfigSchema, INVALID_CHECKPOINT_PROTO_FIELD = "__swarm_invalid_checkpoint_proto__", FORBIDDEN_CHECKPOINT_CONFIG_KEYS, CheckpointConfigSchema, ApplyPatchConfigSchema, AutomationModeSchema, AutomationCapabilitiesSchema, AutomationConfigSchemaBase, AutomationConfigSchema, KnowledgeConfigSchema, LearningConfigSchema, ConsensusConfigSchema, MemoryConfigSchema, CuratorConfigSchema, ArchitecturalSupervisionConfigSchema, KnowledgeApplicationConfigSchema, SkillPropagationAudienceSchema, SkillPropagationConfigSchema, SkillImproverConfigSchema, SkillsConfigSchema, SpecWriterConfigSchema, SlopDetectorConfigSchema, IncrementalVerifyConfigSchema, CompactionConfigSchema, PrmConfigSchema, AgentAuthorityRuleSchema, AuthorityConfigSchema, GeneralCouncilMemberConfigSchema, GeneralCouncilConfigSchema, CouncilConfigSchema, PrMonitorConfigSchema, ParallelizationConfigSchema, WorktreeIsolationConfigSchema, LeanTurboConfigSchema, EpicConfigSchema, StandardTurboConfigSchema, LeanTurboStrategyConfigSchema, TurboConfigSchema, ExternalSkillCandidateSourceTypeSchema, ExternalSkillCandidateEvaluationVerdictSchema, DiscoverySourceSchema, ExternalSkillCandidateSchema, ExternalSkillsConfigSchema, DEFAULT_EXTERNAL_SKILLS_CONFIG, DEFAULT_SKILLS_CONFIG, PluginConfigSchema;
|
|
1247
1251
|
var init_schema = __esm(() => {
|
|
1248
1252
|
init_zod();
|
|
1249
1253
|
init_knowledge_types();
|
|
@@ -1790,6 +1794,7 @@ var init_schema = __esm(() => {
|
|
|
1790
1794
|
promoted_demotion_signal_threshold: exports_external.number().min(-1).max(1).default(OUTCOME_BLOCK_THRESHOLD),
|
|
1791
1795
|
promotion_min_terminal_applications: exports_external.number().min(0).max(100).default(0),
|
|
1792
1796
|
promotion_min_distinct_cohorts: exports_external.number().min(0).max(50).default(0),
|
|
1797
|
+
promotion_require_actionable: exports_external.boolean().default(true),
|
|
1793
1798
|
realtime_learning_nudge: exports_external.object({
|
|
1794
1799
|
enabled: exports_external.boolean().default(true),
|
|
1795
1800
|
first_after_tool_calls: exports_external.number().int().min(1).max(1000).default(10),
|
|
@@ -1812,6 +1817,43 @@ var init_schema = __esm(() => {
|
|
|
1812
1817
|
batch_size: exports_external.number().int().min(1).max(100).optional()
|
|
1813
1818
|
}).default({ max_calls_per_day: 30, quota_window: "utc" })
|
|
1814
1819
|
});
|
|
1820
|
+
LearningConfigSchema = exports_external.object({
|
|
1821
|
+
realtime_admission: exports_external.object({
|
|
1822
|
+
enabled: exports_external.boolean().default(true),
|
|
1823
|
+
max_queue_size: exports_external.number().int().min(1).max(500).default(50),
|
|
1824
|
+
min_drain: exports_external.number().int().min(1).max(50).default(1),
|
|
1825
|
+
max_drain: exports_external.number().int().min(1).max(100).default(10),
|
|
1826
|
+
drain_depth_factor: exports_external.number().min(0).max(1).default(0.5),
|
|
1827
|
+
drain_velocity_factor: exports_external.number().min(0).max(1).default(0.25),
|
|
1828
|
+
max_llm_calls_per_session: exports_external.number().int().min(0).max(500).default(20),
|
|
1829
|
+
max_tokens_per_session: exports_external.number().int().min(0).default(50000),
|
|
1830
|
+
max_concurrent_admissions: exports_external.number().int().min(1).max(16).default(2),
|
|
1831
|
+
max_retries_per_candidate: exports_external.number().int().min(0).max(5).default(1),
|
|
1832
|
+
per_candidate_llm_timeout_ms: exports_external.number().int().min(0).default(60000),
|
|
1833
|
+
max_drain_wall_time_ms: exports_external.number().int().min(0).default(1e4),
|
|
1834
|
+
supersede_nudge: exports_external.boolean().default(true)
|
|
1835
|
+
}).prefault({}),
|
|
1836
|
+
prm_persistence: exports_external.object({
|
|
1837
|
+
enabled: exports_external.boolean().default(true),
|
|
1838
|
+
min_support: exports_external.number().int().min(1).max(20).default(3),
|
|
1839
|
+
cooldown_ms: exports_external.number().int().min(0).default(900000)
|
|
1840
|
+
}).prefault({}),
|
|
1841
|
+
dedup_sweep: exports_external.object({
|
|
1842
|
+
enabled: exports_external.boolean().default(true),
|
|
1843
|
+
max_comparisons: exports_external.number().int().min(0).default(2000),
|
|
1844
|
+
max_merges_per_sweep: exports_external.number().int().min(0).default(10)
|
|
1845
|
+
}).prefault({})
|
|
1846
|
+
});
|
|
1847
|
+
ConsensusConfigSchema = exports_external.object({
|
|
1848
|
+
enabled: exports_external.boolean().default(true),
|
|
1849
|
+
default_min_support: exports_external.number().int().min(1).default(3),
|
|
1850
|
+
default_min_successful_runs: exports_external.number().int().min(0).default(2),
|
|
1851
|
+
default_max_evidence_items: exports_external.number().int().min(1).default(50),
|
|
1852
|
+
max_excerpt_chars: exports_external.number().int().min(1).default(500),
|
|
1853
|
+
llm_summarization_enabled: exports_external.boolean().default(true),
|
|
1854
|
+
llm_timeout_ms: exports_external.number().int().min(0).default(60000),
|
|
1855
|
+
report_retention: exports_external.number().int().min(0).default(50)
|
|
1856
|
+
});
|
|
1815
1857
|
MemoryConfigSchema = exports_external.object({
|
|
1816
1858
|
enabled: exports_external.boolean().default(false),
|
|
1817
1859
|
provider: exports_external.enum(["local-jsonl", "sqlite"]).default("sqlite"),
|
|
@@ -2447,6 +2489,8 @@ var init_schema = __esm(() => {
|
|
|
2447
2489
|
automation: AutomationConfigSchema.optional(),
|
|
2448
2490
|
knowledge: KnowledgeConfigSchema.optional(),
|
|
2449
2491
|
memory: MemoryConfigSchema.optional(),
|
|
2492
|
+
learning: LearningConfigSchema.optional(),
|
|
2493
|
+
consensus: ConsensusConfigSchema.optional(),
|
|
2450
2494
|
curator: CuratorConfigSchema.optional(),
|
|
2451
2495
|
architectural_supervision: ArchitecturalSupervisionConfigSchema.optional(),
|
|
2452
2496
|
knowledge_application: KnowledgeApplicationConfigSchema.optional(),
|
|
@@ -2634,4 +2678,4 @@ var init_schema = __esm(() => {
|
|
|
2634
2678
|
});
|
|
2635
2679
|
});
|
|
2636
2680
|
|
|
2637
|
-
export { QA_AGENTS, PIPELINE_AGENTS, ORCHESTRATOR_NAME, ALL_SUBAGENT_NAMES, ALL_AGENT_NAMES, init_agent_names, TOOL_NAMES, TOOL_NAME_SET, AGENT_TOOL_MAP, init_tool_metadata, DEFAULT_MODELS, DEFAULT_AGENT_CONFIGS, isQAAgent, isSubagent, DEFAULT_WORKTREE_ISOLATION_CONFIG, init_constants, _internals, isKnownCanonicalRole, getCanonicalAgentRole, resolveGeneratedAgentRole, stripKnownSwarmPrefix, AgentReasoningConfigSchema, AgentThinkingConfigSchema, FALLBACK_MODELS_MAX, AgentOverrideConfigSchema, SwarmConfigSchema, ModelPricingConfigSchema, PricingConfigSchema, HooksConfigSchema, ScoringWeightsSchema, DecisionDecaySchema, TokenRatiosSchema, ScoringConfigSchema, ContextBudgetConfigSchema, EvidenceConfigSchema, GateFeatureSchema, PlaceholderScanConfigSchema, QualityBudgetConfigSchema, GATE_CONFIG_KNOWN_SECTION_KEYS, GateConfigSchema, PipelineConfigSchema, PhaseCompleteConfigSchema, SummaryConfigSchema, ReviewPassesConfigSchema, AutoReviewConfigSchema, AdversarialDetectionConfigSchema, AdversarialTestingConfigSchema, IntegrationAnalysisConfigSchema, DocsConfigSchema, DesignDocsConfigSchema, UIReviewConfigSchema, CompactionAdvisoryConfigSchema, LintConfigSchema, SecretscanConfigSchema, GuardrailsProfileSchema, DEFAULT_AGENT_PROFILES, DEFAULT_ARCHITECT_PROFILE, GuardrailsConfigSchema, WatchdogConfigSchema, SelfReviewConfigSchema, resolveGuardrailsConfig, ToolFilterConfigSchema, PlanCursorConfigSchema, ContextMapConfigSchema, RepoGraphConfigSchema, CheckpointConfigSchema, ApplyPatchConfigSchema, AutomationModeSchema, AutomationCapabilitiesSchema, AutomationConfigSchema, KnowledgeConfigSchema, MemoryConfigSchema, CuratorConfigSchema, ArchitecturalSupervisionConfigSchema, KnowledgeApplicationConfigSchema, SkillPropagationConfigSchema, SkillImproverConfigSchema, SkillsConfigSchema, SpecWriterConfigSchema, SlopDetectorConfigSchema, IncrementalVerifyConfigSchema, CompactionConfigSchema, PrmConfigSchema, AgentAuthorityRuleSchema, AuthorityConfigSchema, GeneralCouncilConfigSchema, CouncilConfigSchema, PrMonitorConfigSchema, ParallelizationConfigSchema, WorktreeIsolationConfigSchema, LeanTurboConfigSchema, EpicConfigSchema, StandardTurboConfigSchema, LeanTurboStrategyConfigSchema, TurboConfigSchema, ExternalSkillCandidateSourceTypeSchema, ExternalSkillCandidateEvaluationVerdictSchema, DiscoverySourceSchema, ExternalSkillCandidateSchema, ExternalSkillsConfigSchema, DEFAULT_EXTERNAL_SKILLS_CONFIG, DEFAULT_SKILLS_CONFIG, resolveExternalSkillsConfig, PluginConfigSchema, init_schema };
|
|
2681
|
+
export { QA_AGENTS, PIPELINE_AGENTS, ORCHESTRATOR_NAME, ALL_SUBAGENT_NAMES, ALL_AGENT_NAMES, init_agent_names, TOOL_NAMES, TOOL_NAME_SET, AGENT_TOOL_MAP, init_tool_metadata, DEFAULT_MODELS, DEFAULT_AGENT_CONFIGS, isQAAgent, isSubagent, DEFAULT_WORKTREE_ISOLATION_CONFIG, init_constants, _internals, isKnownCanonicalRole, getCanonicalAgentRole, resolveGeneratedAgentRole, stripKnownSwarmPrefix, AgentReasoningConfigSchema, AgentThinkingConfigSchema, FALLBACK_MODELS_MAX, AgentOverrideConfigSchema, SwarmConfigSchema, ModelPricingConfigSchema, PricingConfigSchema, HooksConfigSchema, ScoringWeightsSchema, DecisionDecaySchema, TokenRatiosSchema, ScoringConfigSchema, ContextBudgetConfigSchema, EvidenceConfigSchema, GateFeatureSchema, PlaceholderScanConfigSchema, QualityBudgetConfigSchema, GATE_CONFIG_KNOWN_SECTION_KEYS, GateConfigSchema, PipelineConfigSchema, PhaseCompleteConfigSchema, SummaryConfigSchema, ReviewPassesConfigSchema, AutoReviewConfigSchema, AdversarialDetectionConfigSchema, AdversarialTestingConfigSchema, IntegrationAnalysisConfigSchema, DocsConfigSchema, DesignDocsConfigSchema, UIReviewConfigSchema, CompactionAdvisoryConfigSchema, LintConfigSchema, SecretscanConfigSchema, GuardrailsProfileSchema, DEFAULT_AGENT_PROFILES, DEFAULT_ARCHITECT_PROFILE, GuardrailsConfigSchema, WatchdogConfigSchema, SelfReviewConfigSchema, resolveGuardrailsConfig, ToolFilterConfigSchema, PlanCursorConfigSchema, ContextMapConfigSchema, RepoGraphConfigSchema, CheckpointConfigSchema, ApplyPatchConfigSchema, AutomationModeSchema, AutomationCapabilitiesSchema, AutomationConfigSchema, KnowledgeConfigSchema, LearningConfigSchema, ConsensusConfigSchema, MemoryConfigSchema, CuratorConfigSchema, ArchitecturalSupervisionConfigSchema, KnowledgeApplicationConfigSchema, SkillPropagationConfigSchema, SkillImproverConfigSchema, SkillsConfigSchema, SpecWriterConfigSchema, SlopDetectorConfigSchema, IncrementalVerifyConfigSchema, CompactionConfigSchema, PrmConfigSchema, AgentAuthorityRuleSchema, AuthorityConfigSchema, GeneralCouncilConfigSchema, CouncilConfigSchema, PrMonitorConfigSchema, ParallelizationConfigSchema, WorktreeIsolationConfigSchema, LeanTurboConfigSchema, EpicConfigSchema, StandardTurboConfigSchema, LeanTurboStrategyConfigSchema, TurboConfigSchema, ExternalSkillCandidateSourceTypeSchema, ExternalSkillCandidateEvaluationVerdictSchema, DiscoverySourceSchema, ExternalSkillCandidateSchema, ExternalSkillsConfigSchema, DEFAULT_EXTERNAL_SKILLS_CONFIG, DEFAULT_SKILLS_CONFIG, resolveExternalSkillsConfig, PluginConfigSchema, init_schema };
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
init_constants,
|
|
9
9
|
init_schema,
|
|
10
10
|
stripKnownSwarmPrefix
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-hynbzh7s.js";
|
|
12
12
|
import {
|
|
13
13
|
log
|
|
14
14
|
} from "./index-zgwm4ryv.js";
|
|
@@ -926,6 +926,14 @@ function validateConfigKey(path2, value) {
|
|
|
926
926
|
emitObjectTypeMismatch("memory", value, findings);
|
|
927
927
|
break;
|
|
928
928
|
}
|
|
929
|
+
case "learning": {
|
|
930
|
+
emitObjectTypeMismatch("learning", value, findings);
|
|
931
|
+
break;
|
|
932
|
+
}
|
|
933
|
+
case "consensus": {
|
|
934
|
+
emitObjectTypeMismatch("consensus", value, findings);
|
|
935
|
+
break;
|
|
936
|
+
}
|
|
929
937
|
case "curator": {
|
|
930
938
|
emitObjectTypeMismatch("curator", value, findings);
|
|
931
939
|
break;
|
|
@@ -6,13 +6,13 @@ import {
|
|
|
6
6
|
resolveSwarmKnowledgePath,
|
|
7
7
|
transactKnowledge,
|
|
8
8
|
wordBigrams
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-q68sprcy.js";
|
|
10
10
|
import {
|
|
11
11
|
countEntryContradictionsInWindow,
|
|
12
12
|
countEntryViolationsInWindow,
|
|
13
13
|
readKnowledgeEvents,
|
|
14
14
|
recordKnowledgeEvent
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-fepakwhp.js";
|
|
16
16
|
import {
|
|
17
17
|
init_knowledge_types,
|
|
18
18
|
isActiveStatus
|
|
@@ -190,11 +190,11 @@ async function maybeQuarantineOnContradiction(directory, entryId, threshold, win
|
|
|
190
190
|
alreadyInactive: true
|
|
191
191
|
};
|
|
192
192
|
}
|
|
193
|
-
const { quarantineEntry } = await import("./knowledge-validator-
|
|
193
|
+
const { quarantineEntry } = await import("./knowledge-validator-w1t0sw5f.js");
|
|
194
194
|
let policyConfig;
|
|
195
195
|
try {
|
|
196
|
-
const { KnowledgeConfigSchema } = await import("./schema-
|
|
197
|
-
const { loadPluginConfigWithMeta } = await import("./index-
|
|
196
|
+
const { KnowledgeConfigSchema } = await import("./schema-yqzzfavj.js");
|
|
197
|
+
const { loadPluginConfigWithMeta } = await import("./index-szkswbqf.js");
|
|
198
198
|
const { config: loadedConfig } = loadPluginConfigWithMeta(directory);
|
|
199
199
|
policyConfig = KnowledgeConfigSchema.parse(loadedConfig.knowledge ?? {});
|
|
200
200
|
} catch {
|
|
@@ -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-p8t5ev44.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-w1t0sw5f.js");
|
|
773
|
+
const { KnowledgeConfigSchema } = await import("./schema-yqzzfavj.js");
|
|
722
774
|
let config;
|
|
723
775
|
try {
|
|
724
|
-
const { loadPluginConfigWithMeta } = await import("./index-
|
|
776
|
+
const { loadPluginConfigWithMeta } = await import("./index-szkswbqf.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 };
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
loadPluginConfigWithMeta,
|
|
8
8
|
loadPluginConfigWithMetaAsync,
|
|
9
9
|
resolveWorktreeIsolationConfig
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-tw33v84d.js";
|
|
11
11
|
import {
|
|
12
12
|
ApprovalEvidenceSchema,
|
|
13
13
|
BaseEvidenceSchema,
|
|
@@ -59,7 +59,7 @@ import {
|
|
|
59
59
|
WorktreeIsolationConfigSchema,
|
|
60
60
|
isQAAgent,
|
|
61
61
|
isSubagent
|
|
62
|
-
} from "./index-
|
|
62
|
+
} from "./index-hynbzh7s.js";
|
|
63
63
|
import"./index-bk5tah7q.js";
|
|
64
64
|
import {
|
|
65
65
|
MigrationStatusSchema,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
handleGuardrailExplain
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-6vg0qczz.js";
|
|
5
5
|
import {
|
|
6
6
|
handleGuardrailLog
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-cnwh164k.js";
|
|
8
8
|
import {
|
|
9
9
|
COMMAND_REGISTRY,
|
|
10
10
|
SWARM_COMMAND_TOOL_ALLOWLIST,
|
|
@@ -83,28 +83,28 @@ import {
|
|
|
83
83
|
handleWriteRetroCommand,
|
|
84
84
|
normalizeSwarmCommandInput,
|
|
85
85
|
resolveCommand
|
|
86
|
-
} from "./index-
|
|
87
|
-
import"./index-
|
|
88
|
-
import"./index-
|
|
89
|
-
import"./index-
|
|
86
|
+
} from "./index-d2tgc580.js";
|
|
87
|
+
import"./index-cq22pnd2.js";
|
|
88
|
+
import"./index-kbfhyxtv.js";
|
|
89
|
+
import"./index-03zyn94g.js";
|
|
90
90
|
import"./index-4905hd2m.js";
|
|
91
91
|
import"./index-134d35c1.js";
|
|
92
92
|
import"./index-9f71ye47.js";
|
|
93
|
-
import"./index-
|
|
94
|
-
import"./index-
|
|
95
|
-
import"./index-
|
|
93
|
+
import"./index-01nyrk95.js";
|
|
94
|
+
import"./index-m6zfm7cm.js";
|
|
95
|
+
import"./index-pft1qxqh.js";
|
|
96
96
|
import"./index-vxv732ex.js";
|
|
97
97
|
import"./index-c8s9a3zh.js";
|
|
98
98
|
import"./index-9ss2m4rs.js";
|
|
99
99
|
import"./index-g4mnf3p5.js";
|
|
100
|
-
import"./index-
|
|
101
|
-
import"./index-
|
|
100
|
+
import"./index-xv2ydncg.js";
|
|
101
|
+
import"./index-1atz85c8.js";
|
|
102
102
|
import"./index-rtry5xyf.js";
|
|
103
|
-
import"./index-
|
|
104
|
-
import"./index-
|
|
103
|
+
import"./index-q68sprcy.js";
|
|
104
|
+
import"./index-fepakwhp.js";
|
|
105
105
|
import"./index-ae75rja9.js";
|
|
106
106
|
import"./index-q27bajqb.js";
|
|
107
|
-
import"./index-
|
|
107
|
+
import"./index-tw33v84d.js";
|
|
108
108
|
import"./index-k5jrywpr.js";
|
|
109
109
|
import"./index-n832052r.js";
|
|
110
110
|
import {
|
|
@@ -113,7 +113,7 @@ import {
|
|
|
113
113
|
init_constants,
|
|
114
114
|
init_schema,
|
|
115
115
|
stripKnownSwarmPrefix
|
|
116
|
-
} from "./index-
|
|
116
|
+
} from "./index-hynbzh7s.js";
|
|
117
117
|
import"./index-bk5tah7q.js";
|
|
118
118
|
import"./index-8fwhhayc.js";
|
|
119
119
|
import"./index-q1exe2b3.js";
|
|
@@ -127,7 +127,7 @@ import"./index-s80bsjkj.js";
|
|
|
127
127
|
import"./index-z6xqpmqg.js";
|
|
128
128
|
import"./index-zjygnfay.js";
|
|
129
129
|
import"./index-zgwm4ryv.js";
|
|
130
|
-
import"./index-
|
|
130
|
+
import"./index-h3k62043.js";
|
|
131
131
|
import"./index-3x761jqv.js";
|
|
132
132
|
import"./index-7mkpsw6g.js";
|
|
133
133
|
import"./index-fsrp8wp3.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
authorizeCuration
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-1atz85c8.js";
|
|
5
5
|
import {
|
|
6
6
|
findNearDuplicate,
|
|
7
7
|
inferTags,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
resolveSwarmKnowledgePath,
|
|
10
10
|
resolveSwarmRejectedPath,
|
|
11
11
|
transactKnowledge
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-q68sprcy.js";
|
|
13
13
|
import {
|
|
14
14
|
resolveKnowledgeStoreDir
|
|
15
15
|
} from "./index-q27bajqb.js";
|
|
@@ -32,6 +32,21 @@ var import_proper_lockfile = __toESM(require_proper_lockfile(), 1);
|
|
|
32
32
|
import { appendFile, mkdir } from "fs/promises";
|
|
33
33
|
import * as path from "path";
|
|
34
34
|
init_logger();
|
|
35
|
+
|
|
36
|
+
// src/hooks/actionability-predicate.ts
|
|
37
|
+
function hasNonEmptyList(v) {
|
|
38
|
+
return Array.isArray(v) && v.length > 0;
|
|
39
|
+
}
|
|
40
|
+
function validateActionability(entry) {
|
|
41
|
+
const hasPredicate = hasNonEmptyList(entry.forbidden_actions) || hasNonEmptyList(entry.required_actions) || hasNonEmptyList(entry.verification_checks) || typeof entry.verification_predicate === "string" && entry.verification_predicate.trim().length > 0;
|
|
42
|
+
const hasScope = hasNonEmptyList(entry.applies_to_tools) || hasNonEmptyList(entry.applies_to_agents);
|
|
43
|
+
if (hasPredicate && hasScope)
|
|
44
|
+
return { actionable: true };
|
|
45
|
+
const reason = !hasPredicate && !hasScope ? "missing_predicate_and_scope" : !hasPredicate ? "missing_predicate" : "missing_scope";
|
|
46
|
+
return { actionable: false, reason };
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// src/hooks/knowledge-validator.ts
|
|
35
50
|
var DANGEROUS_COMMAND_ERROR_PATTERNS = [
|
|
36
51
|
/\brm\s+-rf\b/,
|
|
37
52
|
/\bsudo\s+rm\b/,
|
|
@@ -522,17 +537,6 @@ function validateActionableFields(fields) {
|
|
|
522
537
|
}
|
|
523
538
|
return { valid: errors.length === 0, errors };
|
|
524
539
|
}
|
|
525
|
-
function hasNonEmptyList(v) {
|
|
526
|
-
return Array.isArray(v) && v.length > 0;
|
|
527
|
-
}
|
|
528
|
-
function validateActionability(entry) {
|
|
529
|
-
const hasPredicate = hasNonEmptyList(entry.forbidden_actions) || hasNonEmptyList(entry.required_actions) || hasNonEmptyList(entry.verification_checks) || typeof entry.verification_predicate === "string" && entry.verification_predicate.trim().length > 0;
|
|
530
|
-
const hasScope = hasNonEmptyList(entry.applies_to_tools) || hasNonEmptyList(entry.applies_to_agents);
|
|
531
|
-
if (hasPredicate && hasScope)
|
|
532
|
-
return { actionable: true };
|
|
533
|
-
const reason = !hasPredicate && !hasScope ? "missing_predicate_and_scope" : !hasPredicate ? "missing_predicate" : "missing_scope";
|
|
534
|
-
return { actionable: false, reason };
|
|
535
|
-
}
|
|
536
540
|
function resolveUnactionablePath(directory) {
|
|
537
541
|
return path.join(resolveKnowledgeStoreDir(directory), "knowledge-unactionable.jsonl");
|
|
538
542
|
}
|
|
@@ -818,4 +822,4 @@ var _internals = {
|
|
|
818
822
|
hasSignificantOverlap
|
|
819
823
|
};
|
|
820
824
|
|
|
821
|
-
export { DANGEROUS_COMMAND_ERROR_PATTERNS, DANGEROUS_COMMAND_WARNING_PATTERNS, DANGEROUS_COMMAND_PATTERNS, SECURITY_DEGRADING_PATTERNS, INVISIBLE_FORMAT_CHARS, INJECTION_PATTERNS, scanContentSafety, validateLesson, ACTIONABLE_STRING_MAX, ACTIONABLE_LIST_MAX, RETIRED_SKILL_HISTORY_MAX, ALLOWED_SKILL_PATH_PREFIXES, validateSkillPath, validateSkillCandidatePath, validateActionableFields,
|
|
825
|
+
export { validateActionability, DANGEROUS_COMMAND_ERROR_PATTERNS, DANGEROUS_COMMAND_WARNING_PATTERNS, DANGEROUS_COMMAND_PATTERNS, SECURITY_DEGRADING_PATTERNS, INVISIBLE_FORMAT_CHARS, INJECTION_PATTERNS, scanContentSafety, validateLesson, ACTIONABLE_STRING_MAX, ACTIONABLE_LIST_MAX, RETIRED_SKILL_HISTORY_MAX, ALLOWED_SKILL_PATH_PREFIXES, validateSkillPath, validateSkillCandidatePath, validateActionableFields, resolveUnactionablePath, appendUnactionable, auditEntryHealth, quarantineEntry, restoreEntry, unarchiveEntry, _internals };
|
package/dist/cli/index.js
CHANGED
|
@@ -7,34 +7,34 @@ import {
|
|
|
7
7
|
getPluginLockFilePaths,
|
|
8
8
|
package_default,
|
|
9
9
|
resolveCommand
|
|
10
|
-
} from "./index-
|
|
11
|
-
import"./index-
|
|
12
|
-
import"./index-
|
|
13
|
-
import"./index-
|
|
10
|
+
} from "./index-d2tgc580.js";
|
|
11
|
+
import"./index-cq22pnd2.js";
|
|
12
|
+
import"./index-kbfhyxtv.js";
|
|
13
|
+
import"./index-03zyn94g.js";
|
|
14
14
|
import"./index-4905hd2m.js";
|
|
15
15
|
import"./index-134d35c1.js";
|
|
16
16
|
import"./index-9f71ye47.js";
|
|
17
|
-
import"./index-
|
|
18
|
-
import"./index-
|
|
19
|
-
import"./index-
|
|
17
|
+
import"./index-01nyrk95.js";
|
|
18
|
+
import"./index-m6zfm7cm.js";
|
|
19
|
+
import"./index-pft1qxqh.js";
|
|
20
20
|
import"./index-vxv732ex.js";
|
|
21
21
|
import"./index-c8s9a3zh.js";
|
|
22
22
|
import"./index-9ss2m4rs.js";
|
|
23
23
|
import"./index-g4mnf3p5.js";
|
|
24
|
-
import"./index-
|
|
25
|
-
import"./index-
|
|
24
|
+
import"./index-xv2ydncg.js";
|
|
25
|
+
import"./index-1atz85c8.js";
|
|
26
26
|
import"./index-rtry5xyf.js";
|
|
27
|
-
import"./index-
|
|
28
|
-
import"./index-
|
|
27
|
+
import"./index-q68sprcy.js";
|
|
28
|
+
import"./index-fepakwhp.js";
|
|
29
29
|
import"./index-ae75rja9.js";
|
|
30
30
|
import"./index-q27bajqb.js";
|
|
31
|
-
import"./index-
|
|
31
|
+
import"./index-tw33v84d.js";
|
|
32
32
|
import"./index-k5jrywpr.js";
|
|
33
33
|
import"./index-n832052r.js";
|
|
34
34
|
import {
|
|
35
35
|
DEFAULT_AGENT_CONFIGS,
|
|
36
36
|
init_constants
|
|
37
|
-
} from "./index-
|
|
37
|
+
} from "./index-hynbzh7s.js";
|
|
38
38
|
import"./index-bk5tah7q.js";
|
|
39
39
|
import"./index-8fwhhayc.js";
|
|
40
40
|
import"./index-q1exe2b3.js";
|
|
@@ -48,7 +48,7 @@ import"./index-s80bsjkj.js";
|
|
|
48
48
|
import"./index-z6xqpmqg.js";
|
|
49
49
|
import"./index-zjygnfay.js";
|
|
50
50
|
import"./index-zgwm4ryv.js";
|
|
51
|
-
import"./index-
|
|
51
|
+
import"./index-h3k62043.js";
|
|
52
52
|
import"./index-3x761jqv.js";
|
|
53
53
|
import"./index-7mkpsw6g.js";
|
|
54
54
|
import"./index-fsrp8wp3.js";
|
|
@@ -8,9 +8,9 @@ import {
|
|
|
8
8
|
maybeEscalateOnViolation,
|
|
9
9
|
maybeQuarantineOnContradiction,
|
|
10
10
|
readRecentEscalations
|
|
11
|
-
} from "./index-
|
|
12
|
-
import"./index-
|
|
13
|
-
import"./index-
|
|
11
|
+
} from "./index-m6zfm7cm.js";
|
|
12
|
+
import"./index-q68sprcy.js";
|
|
13
|
+
import"./index-fepakwhp.js";
|
|
14
14
|
import"./index-ae75rja9.js";
|
|
15
15
|
import"./index-q27bajqb.js";
|
|
16
16
|
import"./index-bk5tah7q.js";
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
resolveKnowledgeCounterBaselinePath,
|
|
27
27
|
resolveKnowledgeEventsPath,
|
|
28
28
|
resolveLegacyApplicationLogPath
|
|
29
|
-
} from "./index-
|
|
29
|
+
} from "./index-fepakwhp.js";
|
|
30
30
|
import"./index-ae75rja9.js";
|
|
31
31
|
import"./index-q27bajqb.js";
|
|
32
32
|
import"./index-zgwm4ryv.js";
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
computeContentHash,
|
|
14
14
|
computeOutcomeSignal,
|
|
15
15
|
confirmEntriesPhase,
|
|
16
|
+
dedupeCapped,
|
|
16
17
|
enforceKnowledgeCap,
|
|
17
18
|
findNearDuplicate,
|
|
18
19
|
getArchivedKnowledgeIds,
|
|
@@ -40,7 +41,7 @@ import {
|
|
|
40
41
|
transactKnowledge,
|
|
41
42
|
transactKnowledgeWithCas,
|
|
42
43
|
wordBigrams
|
|
43
|
-
} from "./index-
|
|
44
|
+
} from "./index-q68sprcy.js";
|
|
44
45
|
import {
|
|
45
46
|
resolveHiveDataDir
|
|
46
47
|
} from "./index-ae75rja9.js";
|
|
@@ -83,6 +84,7 @@ export {
|
|
|
83
84
|
getArchivedKnowledgeIds,
|
|
84
85
|
findNearDuplicate,
|
|
85
86
|
enforceKnowledgeCap,
|
|
87
|
+
dedupeCapped,
|
|
86
88
|
confirmEntriesPhase,
|
|
87
89
|
computeOutcomeSignal,
|
|
88
90
|
computeContentHash,
|