opencode-swarm 6.22.7 → 6.22.8
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 -0
- package/dist/agents/architect.d.ts +5 -1
- package/dist/cli/index.js +13358 -13339
- package/dist/commands/curate.d.ts +21 -0
- package/dist/commands/curate.test.d.ts +1 -0
- package/dist/commands/index.d.ts +1 -0
- package/dist/config/schema.d.ts +18 -0
- package/dist/hooks/hive-promoter.d.ts +10 -1
- package/dist/hooks/knowledge-types.d.ts +16 -0
- package/dist/index.js +2331 -1983
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/knowledge-query.d.ts +5 -0
- package/dist/tools/tool-names.d.ts +1 -1
- package/dist/tools/update-task-status.d.ts +2 -1
- package/package.json +1 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Handles the /swarm curate command.
|
|
3
|
+
* Runs knowledge curation and hive promotion review on-demand.
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
* - /swarm curate — Run curation on existing swarm entries
|
|
7
|
+
*
|
|
8
|
+
* Returns a summary with counts, or zero counts for empty-state.
|
|
9
|
+
*/
|
|
10
|
+
export interface CurationSummary {
|
|
11
|
+
timestamp: string;
|
|
12
|
+
new_promotions: number;
|
|
13
|
+
encounters_incremented: number;
|
|
14
|
+
advancements: number;
|
|
15
|
+
total_hive_entries: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Handles the /swarm curate command.
|
|
19
|
+
* Runs hive promotion review on existing swarm entries.
|
|
20
|
+
*/
|
|
21
|
+
export declare function handleCurateCommand(directory: string, _args: string[]): Promise<string>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/commands/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export { handleArchiveCommand } from './archive';
|
|
|
5
5
|
export { handleBenchmarkCommand } from './benchmark';
|
|
6
6
|
export { handleClarifyCommand } from './clarify';
|
|
7
7
|
export { handleConfigCommand } from './config';
|
|
8
|
+
export { handleCurateCommand } from './curate';
|
|
8
9
|
export { handleDarkMatterCommand } from './dark-matter';
|
|
9
10
|
export { handleDiagnoseCommand } from './diagnose';
|
|
10
11
|
export { handleDoctorCommand } from './doctor';
|
package/dist/config/schema.d.ts
CHANGED
|
@@ -235,6 +235,11 @@ export declare const AdversarialDetectionConfigSchema: z.ZodObject<{
|
|
|
235
235
|
pairs: z.ZodDefault<z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodString], null>>>;
|
|
236
236
|
}, z.core.$strip>;
|
|
237
237
|
export type AdversarialDetectionConfig = z.infer<typeof AdversarialDetectionConfigSchema>;
|
|
238
|
+
export type AdversarialTestingConfig = {
|
|
239
|
+
enabled: boolean;
|
|
240
|
+
scope: 'all' | 'security-only';
|
|
241
|
+
};
|
|
242
|
+
export declare const AdversarialTestingConfigSchema: z.ZodType<AdversarialTestingConfig>;
|
|
238
243
|
export declare const IntegrationAnalysisConfigSchema: z.ZodObject<{
|
|
239
244
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
240
245
|
}, z.core.$strip>;
|
|
@@ -397,6 +402,12 @@ export declare const KnowledgeConfigSchema: z.ZodObject<{
|
|
|
397
402
|
low_utility_threshold: z.ZodDefault<z.ZodNumber>;
|
|
398
403
|
min_retrievals_for_utility: z.ZodDefault<z.ZodNumber>;
|
|
399
404
|
schema_version: z.ZodDefault<z.ZodNumber>;
|
|
405
|
+
same_project_weight: z.ZodDefault<z.ZodNumber>;
|
|
406
|
+
cross_project_weight: z.ZodDefault<z.ZodNumber>;
|
|
407
|
+
min_encounter_score: z.ZodDefault<z.ZodNumber>;
|
|
408
|
+
initial_encounter_score: z.ZodDefault<z.ZodNumber>;
|
|
409
|
+
encounter_increment: z.ZodDefault<z.ZodNumber>;
|
|
410
|
+
max_encounter_score: z.ZodDefault<z.ZodNumber>;
|
|
400
411
|
}, z.core.$strip>;
|
|
401
412
|
export type KnowledgeConfig = z.infer<typeof KnowledgeConfigSchema>;
|
|
402
413
|
export declare const CuratorConfigSchema: z.ZodObject<{
|
|
@@ -575,6 +586,7 @@ export declare const PluginConfigSchema: z.ZodObject<{
|
|
|
575
586
|
}>>;
|
|
576
587
|
pairs: z.ZodDefault<z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodString], null>>>;
|
|
577
588
|
}, z.core.$strip>>;
|
|
589
|
+
adversarial_testing: z.ZodOptional<z.ZodType<AdversarialTestingConfig, unknown, z.core.$ZodTypeInternals<AdversarialTestingConfig, unknown>>>;
|
|
578
590
|
integration_analysis: z.ZodOptional<z.ZodObject<{
|
|
579
591
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
580
592
|
}, z.core.$strip>>;
|
|
@@ -653,6 +665,12 @@ export declare const PluginConfigSchema: z.ZodObject<{
|
|
|
653
665
|
low_utility_threshold: z.ZodDefault<z.ZodNumber>;
|
|
654
666
|
min_retrievals_for_utility: z.ZodDefault<z.ZodNumber>;
|
|
655
667
|
schema_version: z.ZodDefault<z.ZodNumber>;
|
|
668
|
+
same_project_weight: z.ZodDefault<z.ZodNumber>;
|
|
669
|
+
cross_project_weight: z.ZodDefault<z.ZodNumber>;
|
|
670
|
+
min_encounter_score: z.ZodDefault<z.ZodNumber>;
|
|
671
|
+
initial_encounter_score: z.ZodDefault<z.ZodNumber>;
|
|
672
|
+
encounter_increment: z.ZodDefault<z.ZodNumber>;
|
|
673
|
+
max_encounter_score: z.ZodDefault<z.ZodNumber>;
|
|
656
674
|
}, z.core.$strip>>;
|
|
657
675
|
curator: z.ZodOptional<z.ZodObject<{
|
|
658
676
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -1,14 +1,23 @@
|
|
|
1
1
|
/** Hive promoter hook for opencode-swarm v6.17 two-tier knowledge system. */
|
|
2
2
|
import type { KnowledgeConfig, SwarmKnowledgeEntry } from './knowledge-types.js';
|
|
3
|
+
/** Hive promotion summary for curator state */
|
|
4
|
+
export interface HivePromotionSummary {
|
|
5
|
+
timestamp: string;
|
|
6
|
+
new_promotions: number;
|
|
7
|
+
encounters_incremented: number;
|
|
8
|
+
advancements: number;
|
|
9
|
+
total_hive_entries: number;
|
|
10
|
+
}
|
|
3
11
|
/**
|
|
4
12
|
* Main promotion logic: checks swarm entries and promotes eligible ones to hive.
|
|
5
13
|
* Also updates existing hive entries with new project confirmations.
|
|
14
|
+
* Returns a summary of the promotion activity for curator state.
|
|
6
15
|
*
|
|
7
16
|
* @note The 'hive-fast-track' tag is treated as privileged — it bypasses the
|
|
8
17
|
* 3-phase confirmation requirement. It should only be set by authorized tooling
|
|
9
18
|
* (inferTags() never produces it automatically).
|
|
10
19
|
*/
|
|
11
|
-
export declare function checkHivePromotions(swarmEntries: SwarmKnowledgeEntry[], config: KnowledgeConfig): Promise<
|
|
20
|
+
export declare function checkHivePromotions(swarmEntries: SwarmKnowledgeEntry[], config: KnowledgeConfig): Promise<HivePromotionSummary>;
|
|
12
21
|
/**
|
|
13
22
|
* Create a hook that promotes swarm entries to the hive.
|
|
14
23
|
* The hook fires unconditionally - the caller decides when to invoke it.
|
|
@@ -42,6 +42,10 @@ export interface HiveKnowledgeEntry extends KnowledgeEntryBase {
|
|
|
42
42
|
tier: 'hive';
|
|
43
43
|
confirmed_by: ProjectConfirmationRecord[];
|
|
44
44
|
source_project: string;
|
|
45
|
+
/** Weighted encounter score for hive advancement. Starts at 1.0 for originating project. */
|
|
46
|
+
encounter_score: number;
|
|
47
|
+
/** @deprecated Legacy field for backward compatibility. Use encounter_score for weighting. */
|
|
48
|
+
encounter_count?: number;
|
|
45
49
|
}
|
|
46
50
|
export interface RejectedLesson {
|
|
47
51
|
id: string;
|
|
@@ -81,6 +85,18 @@ export interface KnowledgeConfig {
|
|
|
81
85
|
min_retrievals_for_utility: number;
|
|
82
86
|
/** JSONL schema version. Default: 1 */
|
|
83
87
|
schema_version: number;
|
|
88
|
+
/** Weighted scoring: multiplier for encounters from the source project. Default: 1.0 */
|
|
89
|
+
same_project_weight: number;
|
|
90
|
+
/** Weighted scoring: multiplier for encounters from other projects. Default: 0.5 */
|
|
91
|
+
cross_project_weight: number;
|
|
92
|
+
/** Weighted scoring: minimum encounter score floor. Default: 0.1 */
|
|
93
|
+
min_encounter_score: number;
|
|
94
|
+
/** Weighted scoring: initial score for newly promoted hive entries. Default: 1.0 */
|
|
95
|
+
initial_encounter_score: number;
|
|
96
|
+
/** Weighted scoring: score increment per encounter. Default: 0.1 */
|
|
97
|
+
encounter_increment: number;
|
|
98
|
+
/** Weighted scoring: maximum encounter score cap. Default: 10.0 */
|
|
99
|
+
max_encounter_score: number;
|
|
84
100
|
}
|
|
85
101
|
export interface MessageInfo {
|
|
86
102
|
role: string;
|