opencode-swarm 6.19.0 → 6.19.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.
- package/dist/cli/index.js +6644 -6648
- package/dist/commands/index.d.ts +2 -1
- package/dist/commands/knowledge.d.ts +5 -0
- package/dist/commands/promote.d.ts +10 -0
- package/dist/hooks/adversarial-detector.d.ts +1 -1
- package/dist/hooks/delegation-sanitizer.d.ts +24 -0
- package/dist/hooks/hive-promoter.d.ts +15 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/knowledge-reader.d.ts +5 -1
- package/dist/index.js +2460 -3306
- package/package.json +1 -1
package/dist/commands/index.d.ts
CHANGED
|
@@ -11,9 +11,10 @@ export { handleDoctorCommand } from './doctor';
|
|
|
11
11
|
export { handleEvidenceCommand, handleEvidenceSummaryCommand, } from './evidence';
|
|
12
12
|
export { handleExportCommand } from './export';
|
|
13
13
|
export { handleHistoryCommand } from './history';
|
|
14
|
-
export { handleKnowledgeMigrateCommand, handleKnowledgeQuarantineCommand, handleKnowledgeRestoreCommand, } from './knowledge';
|
|
14
|
+
export { handleKnowledgeListCommand, handleKnowledgeMigrateCommand, handleKnowledgeQuarantineCommand, handleKnowledgeRestoreCommand, } from './knowledge';
|
|
15
15
|
export { handlePlanCommand } from './plan';
|
|
16
16
|
export { handlePreflightCommand } from './preflight';
|
|
17
|
+
export { handlePromoteCommand } from './promote';
|
|
17
18
|
export { handleResetCommand } from './reset';
|
|
18
19
|
export { handleRetrieveCommand } from './retrieve';
|
|
19
20
|
export { handleRollbackCommand } from './rollback';
|
|
@@ -13,3 +13,8 @@ export declare function handleKnowledgeRestoreCommand(directory: string, args: s
|
|
|
13
13
|
* Triggers one-time migration from .swarm/context.md to .swarm/knowledge.jsonl.
|
|
14
14
|
*/
|
|
15
15
|
export declare function handleKnowledgeMigrateCommand(directory: string, args: string[]): Promise<string>;
|
|
16
|
+
/**
|
|
17
|
+
* Handles /swarm knowledge command (no subcommand) - lists knowledge entries.
|
|
18
|
+
* Lists entries from .swarm/knowledge.jsonl with id, category, confidence, truncated text.
|
|
19
|
+
*/
|
|
20
|
+
export declare function handleKnowledgeListCommand(directory: string, _args: string[]): Promise<string>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Handles the /swarm promote command.
|
|
3
|
+
* Manually promotes lessons to hive knowledge.
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
* - /swarm promote "<lesson text>" — Promote direct text
|
|
7
|
+
* - /swarm promote --category <category> "<lesson text>" — Promote with category
|
|
8
|
+
* - /swarm promote --from-swarm <lesson-id> — Promote from existing swarm lesson
|
|
9
|
+
*/
|
|
10
|
+
export declare function handlePromoteCommand(directory: string, args: string[]): Promise<string>;
|
|
@@ -18,7 +18,7 @@ export declare function formatAdversarialWarning(agentA: string, agentB: string,
|
|
|
18
18
|
* Uses string/regex matching to detect sophisticated adversarial behaviors.
|
|
19
19
|
*/
|
|
20
20
|
export interface AdversarialPatternMatch {
|
|
21
|
-
pattern: 'PRECEDENT_MANIPULATION' | 'SELF_REVIEW' | 'CONTENT_EXEMPTION' | 'GATE_DELEGATION_BYPASS' | 'VELOCITY_RATIONALIZATION';
|
|
21
|
+
pattern: 'PRECEDENT_MANIPULATION' | 'SELF_REVIEW' | 'CONTENT_EXEMPTION' | 'GATE_DELEGATION_BYPASS' | 'VELOCITY_RATIONALIZATION' | 'INTER_AGENT_MANIPULATION' | 'GATE_MISCLASSIFICATION';
|
|
22
22
|
severity: 'HIGHEST' | 'HIGH' | 'MEDIUM' | 'LOW';
|
|
23
23
|
matchedText: string;
|
|
24
24
|
confidence: 'HIGH' | 'MEDIUM' | 'LOW';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Delegation message sanitization - Layer 2 defense against inter-agent manipulation.
|
|
3
|
+
* Strips attempt metadata, urgency references, and consequence claims from gate agent messages.
|
|
4
|
+
*/
|
|
5
|
+
declare const SANITIZATION_PATTERNS: RegExp[];
|
|
6
|
+
/**
|
|
7
|
+
* Sanitize a message by stripping manipulation patterns.
|
|
8
|
+
* Returns sanitized text and logs if any stripping occurred.
|
|
9
|
+
*/
|
|
10
|
+
export declare function sanitizeMessage(text: string, patterns?: RegExp[]): {
|
|
11
|
+
sanitized: string;
|
|
12
|
+
modified: boolean;
|
|
13
|
+
stripped: string[];
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Check if message is to a gate agent (reviewer, test_engineer, critic).
|
|
17
|
+
*/
|
|
18
|
+
export declare function isGateAgentMessage(agentName: string): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Create a hook that sanitizes delegation messages to gate agents.
|
|
21
|
+
* @param directory - The project directory containing the .swarm folder
|
|
22
|
+
*/
|
|
23
|
+
export declare function createDelegationSanitizerHook(directory: string): (input: unknown, output: unknown) => Promise<void>;
|
|
24
|
+
export { SANITIZATION_PATTERNS };
|
|
@@ -14,3 +14,18 @@ export declare function checkHivePromotions(swarmEntries: SwarmKnowledgeEntry[],
|
|
|
14
14
|
* The hook fires unconditionally - the caller decides when to invoke it.
|
|
15
15
|
*/
|
|
16
16
|
export declare function createHivePromoterHook(directory: string, config: KnowledgeConfig): (input: unknown, output: unknown) => Promise<void>;
|
|
17
|
+
/**
|
|
18
|
+
* Promote a lesson directly to the hive (manual promotion).
|
|
19
|
+
* @param directory - Project directory
|
|
20
|
+
* @param lesson - The lesson text to promote
|
|
21
|
+
* @param category - Optional category (defaults to 'process')
|
|
22
|
+
* @returns Confirmation message
|
|
23
|
+
*/
|
|
24
|
+
export declare function promoteToHive(directory: string, lesson: string, category?: string): Promise<string>;
|
|
25
|
+
/**
|
|
26
|
+
* Promote a lesson from swarm knowledge to hive.
|
|
27
|
+
* @param directory - Project directory
|
|
28
|
+
* @param lessonId - The ID of the lesson to promote from swarm
|
|
29
|
+
* @returns Confirmation message
|
|
30
|
+
*/
|
|
31
|
+
export declare function promoteFromSwarm(directory: string, lessonId: string): Promise<string>;
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export { createAgentActivityHooks } from './agent-activity';
|
|
|
2
2
|
export { createCompactionCustomizerHook } from './compaction-customizer';
|
|
3
3
|
export { createContextBudgetHandler } from './context-budget';
|
|
4
4
|
export { createDelegationGateHook } from './delegation-gate';
|
|
5
|
+
export { createDelegationSanitizerHook } from './delegation-sanitizer';
|
|
5
6
|
export { createDelegationTrackerHook } from './delegation-tracker';
|
|
6
7
|
export { extractCurrentPhase, extractCurrentPhaseFromPlan, extractCurrentTask, extractCurrentTaskFromPlan, extractDecisions, extractIncompleteTasks, extractIncompleteTasksFromPlan, extractPatterns, } from './extractors';
|
|
7
8
|
export { createGuardrailsHooks } from './guardrails';
|
|
@@ -11,7 +11,11 @@ export interface ProjectContext {
|
|
|
11
11
|
}
|
|
12
12
|
export interface RankedEntry extends KnowledgeEntryBase {
|
|
13
13
|
tier: 'swarm' | 'hive';
|
|
14
|
-
relevanceScore:
|
|
14
|
+
relevanceScore: {
|
|
15
|
+
category: number;
|
|
16
|
+
confidence: number;
|
|
17
|
+
keywords: number;
|
|
18
|
+
};
|
|
15
19
|
finalScore: number;
|
|
16
20
|
}
|
|
17
21
|
export declare function readMergedKnowledge(directory: string, config: KnowledgeConfig, context?: ProjectContext): Promise<RankedEntry[]>;
|