opencode-swarm 7.38.0 → 7.40.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/index.js +750 -20
- package/dist/commands/concurrency.d.ts +10 -0
- package/dist/commands/index.d.ts +2 -1
- package/dist/commands/memory.d.ts +4 -0
- package/dist/commands/registry.d.ts +35 -0
- package/dist/commands/tool-policy.d.ts +1 -1
- package/dist/config/schema.d.ts +8 -0
- package/dist/hooks/delegation-gate.d.ts +4 -1
- package/dist/index.js +763 -30
- package/dist/memory/config.d.ts +4 -0
- package/dist/memory/index.d.ts +2 -1
- package/dist/memory/local-jsonl-provider.d.ts +3 -1
- package/dist/memory/maintenance.d.ts +47 -0
- package/dist/memory/provider.d.ts +16 -0
- package/dist/memory/sqlite-provider.d.ts +3 -1
- package/dist/memory/types.d.ts +1 -0
- package/dist/session/snapshot-writer.d.ts +2 -0
- package/dist/state.d.ts +4 -0
- package/package.json +1 -1
package/dist/memory/config.d.ts
CHANGED
|
@@ -25,6 +25,10 @@ export interface MemoryConfig {
|
|
|
25
25
|
redaction: {
|
|
26
26
|
rejectDurableSecrets: boolean;
|
|
27
27
|
};
|
|
28
|
+
maintenance: {
|
|
29
|
+
lowUtilityMaxConfidence: number;
|
|
30
|
+
lowUtilityMinAgeDays: number;
|
|
31
|
+
};
|
|
28
32
|
hardDelete: boolean;
|
|
29
33
|
}
|
|
30
34
|
export declare const DEFAULT_MEMORY_CONFIG: MemoryConfig;
|
package/dist/memory/index.d.ts
CHANGED
|
@@ -7,8 +7,9 @@ export { createConfiguredMemoryProvider, createMemoryGateway, MemoryGateway, } f
|
|
|
7
7
|
export { createMemoryLifecycleHooks, type MemoryLifecycleHookOptions, type MemoryLifecycleHooks, } from './injector';
|
|
8
8
|
export { backupLegacyJsonl, getLegacyJsonlFileStatus, type JsonlBackupResult, type JsonlImportPayload, type JsonlInvalidRow, type JsonlMigrationReport, LEGACY_JSONL_MIGRATION_NAME, LEGACY_JSONL_MIGRATION_VERSION, readLegacyJsonl, readMigrationReport, resolveMemoryStorageDir, resolveSqliteDatabasePath, writeJsonlExport, writeMigrationReport, } from './jsonl-migration';
|
|
9
9
|
export { LocalJsonlMemoryProvider } from './local-jsonl-provider';
|
|
10
|
+
export { buildMemoryMaintenanceReport, type MemoryMaintenanceReport, type MemoryMaintenanceReportOptions, type MemoryRecallUsageByMemory, type MemoryRecallUsageByRole, type MemorySupersededChain, shouldCompactMemory, } from './maintenance';
|
|
10
11
|
export { buildRecallPromptBlock } from './prompt-block';
|
|
11
|
-
export type { MemoryProposalStore, MemoryProvider } from './provider';
|
|
12
|
+
export type { MemoryCompactOptions, MemoryCompactResult, MemoryProposalStore, MemoryProvider, MemoryRecallUsageEvent, MemoryRecallUsageFilter, } from './provider';
|
|
12
13
|
export { buildMemoryRecallPlan, type MemoryRecallPlan, type MemoryRecallPlannerInput, } from './recall-planner';
|
|
13
14
|
export { findSecrets, redactSecrets } from './redaction';
|
|
14
15
|
export { MEMORY_RECALL_PROFILES, type MemoryRecallProfile, normalizeMemoryAgentRole, resolveMemoryRecallProfile, } from './role-profiles';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type MemoryConfig } from './config';
|
|
2
|
-
import type { MemoryProposalStore, MemoryProvider, MemoryRecallUsageEvent } from './provider';
|
|
2
|
+
import type { MemoryCompactOptions, MemoryCompactResult, MemoryProposalStore, MemoryProvider, MemoryRecallUsageEvent, MemoryRecallUsageFilter } from './provider';
|
|
3
3
|
import type { RecallScoringDiagnostics } from './scoring';
|
|
4
4
|
import type { AppliedMemoryChange, MemoryListFilter, MemoryProposal, MemoryRecord, RecallRequest, RecallResultItem, ResolvedCuratorMemoryDecision } from './types';
|
|
5
5
|
export declare class LocalJsonlMemoryProvider implements MemoryProvider, MemoryProposalStore {
|
|
@@ -21,6 +21,7 @@ export declare class LocalJsonlMemoryProvider implements MemoryProvider, MemoryP
|
|
|
21
21
|
diagnostics: RecallScoringDiagnostics;
|
|
22
22
|
}>;
|
|
23
23
|
recordRecallUsage(event: MemoryRecallUsageEvent): Promise<void>;
|
|
24
|
+
listRecallUsage(filter?: MemoryRecallUsageFilter): Promise<MemoryRecallUsageEvent[]>;
|
|
24
25
|
list(filter?: MemoryListFilter): Promise<MemoryRecord[]>;
|
|
25
26
|
createProposal(proposal: MemoryProposal): Promise<MemoryProposal>;
|
|
26
27
|
listProposals(filter?: {
|
|
@@ -29,6 +30,7 @@ export declare class LocalJsonlMemoryProvider implements MemoryProvider, MemoryP
|
|
|
29
30
|
}): Promise<MemoryProposal[]>;
|
|
30
31
|
applyCuratorDecision(decision: ResolvedCuratorMemoryDecision): Promise<AppliedMemoryChange>;
|
|
31
32
|
compact(): Promise<void>;
|
|
33
|
+
compactMaintenance(options?: MemoryCompactOptions): Promise<MemoryCompactResult>;
|
|
32
34
|
private audit;
|
|
33
35
|
private activeMemory;
|
|
34
36
|
private validateDecisionMemory;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { MemoryProposalStore, MemoryProvider } from './provider';
|
|
2
|
+
import type { MemoryProposal, MemoryRecord } from './types';
|
|
3
|
+
export interface MemoryRecallUsageByMemory {
|
|
4
|
+
memoryId: string;
|
|
5
|
+
count: number;
|
|
6
|
+
lastRecalledAt: string;
|
|
7
|
+
agentRoles: Record<string, number>;
|
|
8
|
+
averageScore: number;
|
|
9
|
+
}
|
|
10
|
+
export interface MemoryRecallUsageByRole {
|
|
11
|
+
agentRole: string;
|
|
12
|
+
count: number;
|
|
13
|
+
memoryIds: Record<string, number>;
|
|
14
|
+
}
|
|
15
|
+
export interface MemorySupersededChain {
|
|
16
|
+
rootId: string;
|
|
17
|
+
chain: string[];
|
|
18
|
+
reason?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface MemoryMaintenanceReport {
|
|
21
|
+
generatedAt: string;
|
|
22
|
+
totalMemories: number;
|
|
23
|
+
activeMemories: number;
|
|
24
|
+
deletedMemories: MemoryRecord[];
|
|
25
|
+
expiredScratchMemories: MemoryRecord[];
|
|
26
|
+
supersededMemories: MemoryRecord[];
|
|
27
|
+
supersededChains: MemorySupersededChain[];
|
|
28
|
+
lowUtilityMemories: MemoryRecord[];
|
|
29
|
+
neverRecalledMemories: MemoryRecord[];
|
|
30
|
+
mostRecalledMemories: MemoryRecallUsageByMemory[];
|
|
31
|
+
recallByAgentRole: MemoryRecallUsageByRole[];
|
|
32
|
+
rejectedProposalReasons: MemoryProposal[];
|
|
33
|
+
pendingProposals: MemoryProposal[];
|
|
34
|
+
recallEventCount: number;
|
|
35
|
+
}
|
|
36
|
+
export interface MemoryMaintenanceReportOptions {
|
|
37
|
+
now?: Date;
|
|
38
|
+
limit?: number;
|
|
39
|
+
lowUtilityMaxConfidence?: number;
|
|
40
|
+
lowUtilityMinAgeDays?: number;
|
|
41
|
+
}
|
|
42
|
+
type ObservableProvider = MemoryProvider & Partial<MemoryProposalStore> & {
|
|
43
|
+
listRecallUsage?: MemoryProvider['listRecallUsage'];
|
|
44
|
+
};
|
|
45
|
+
export declare function buildMemoryMaintenanceReport(provider: ObservableProvider, options?: MemoryMaintenanceReportOptions): Promise<MemoryMaintenanceReport>;
|
|
46
|
+
export declare function shouldCompactMemory(memory: MemoryRecord, now?: Date): 'deleted' | 'superseded' | 'expired_scratch' | null;
|
|
47
|
+
export {};
|
|
@@ -16,6 +16,20 @@ export interface MemoryRecallUsageEvent {
|
|
|
16
16
|
runId?: string;
|
|
17
17
|
timestamp: string;
|
|
18
18
|
}
|
|
19
|
+
export interface MemoryRecallUsageFilter {
|
|
20
|
+
limit?: number;
|
|
21
|
+
}
|
|
22
|
+
export interface MemoryCompactOptions {
|
|
23
|
+
dryRun?: boolean;
|
|
24
|
+
now?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface MemoryCompactResult {
|
|
27
|
+
dryRun: boolean;
|
|
28
|
+
removedDeleted: number;
|
|
29
|
+
removedSuperseded: number;
|
|
30
|
+
removedExpiredScratch: number;
|
|
31
|
+
remaining: number;
|
|
32
|
+
}
|
|
19
33
|
export interface MemoryProvider {
|
|
20
34
|
readonly name: string;
|
|
21
35
|
initialize?(): Promise<void>;
|
|
@@ -26,6 +40,8 @@ export interface MemoryProvider {
|
|
|
26
40
|
recall(request: RecallRequest): Promise<RecallResultItem[]>;
|
|
27
41
|
recallWithDiagnostics?(request: RecallRequest): Promise<MemoryRecallResult>;
|
|
28
42
|
recordRecallUsage?(event: MemoryRecallUsageEvent): Promise<void>;
|
|
43
|
+
listRecallUsage?(filter?: MemoryRecallUsageFilter): Promise<MemoryRecallUsageEvent[]>;
|
|
44
|
+
compactMaintenance?(options?: MemoryCompactOptions): Promise<MemoryCompactResult>;
|
|
29
45
|
list(filter: MemoryListFilter): Promise<MemoryRecord[]>;
|
|
30
46
|
}
|
|
31
47
|
export interface MemoryProposalStore {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type MemoryConfig } from './config';
|
|
2
2
|
import { type JsonlMigrationReport } from './jsonl-migration';
|
|
3
|
-
import type { MemoryProposalStore, MemoryProvider, MemoryRecallUsageEvent } from './provider';
|
|
3
|
+
import type { MemoryCompactOptions, MemoryCompactResult, MemoryProposalStore, MemoryProvider, MemoryRecallUsageEvent, MemoryRecallUsageFilter } from './provider';
|
|
4
4
|
import type { RecallScoringDiagnostics } from './scoring';
|
|
5
5
|
import type { AppliedMemoryChange, MemoryListFilter, MemoryProposal, MemoryRecord, RecallRequest, RecallResultItem, ResolvedCuratorMemoryDecision } from './types';
|
|
6
6
|
export interface SQLiteJsonlImportResult {
|
|
@@ -31,6 +31,7 @@ export declare class SQLiteMemoryProvider implements MemoryProvider, MemoryPropo
|
|
|
31
31
|
diagnostics: RecallScoringDiagnostics;
|
|
32
32
|
}>;
|
|
33
33
|
recordRecallUsage(event: MemoryRecallUsageEvent): Promise<void>;
|
|
34
|
+
listRecallUsage(filter?: MemoryRecallUsageFilter): Promise<MemoryRecallUsageEvent[]>;
|
|
34
35
|
list(filter?: MemoryListFilter): Promise<MemoryRecord[]>;
|
|
35
36
|
createProposal(proposal: MemoryProposal): Promise<MemoryProposal>;
|
|
36
37
|
listProposals(filter?: {
|
|
@@ -47,6 +48,7 @@ export declare class SQLiteMemoryProvider implements MemoryProvider, MemoryPropo
|
|
|
47
48
|
memories: number;
|
|
48
49
|
proposals: number;
|
|
49
50
|
}>;
|
|
51
|
+
compactMaintenance(options?: MemoryCompactOptions): Promise<MemoryCompactResult>;
|
|
50
52
|
hasMigration(name: string): boolean;
|
|
51
53
|
markMigration(version: number, name: string): void;
|
|
52
54
|
private selectRecallCandidates;
|
package/dist/memory/types.d.ts
CHANGED
|
@@ -61,6 +61,8 @@ export interface SerializedAgentSession {
|
|
|
61
61
|
sessionRehydratedAt?: number;
|
|
62
62
|
/** Stage B completion tracking: per-task set of completed Stage B agents. Optional for backward compat with old snapshots. */
|
|
63
63
|
stageBCompletion?: Record<string, string[]>;
|
|
64
|
+
/** Session-scoped concurrency override for max_concurrent_tasks (Issue #761) */
|
|
65
|
+
maxConcurrencyOverride?: number;
|
|
64
66
|
}
|
|
65
67
|
/**
|
|
66
68
|
* Minimal interface for serialized InvocationWindow
|
package/dist/state.d.ts
CHANGED
|
@@ -165,6 +165,10 @@ export interface AgentSessionState {
|
|
|
165
165
|
leanTurboActive?: boolean;
|
|
166
166
|
/** Current phase number when Lean Turbo is active (for durable state sync). */
|
|
167
167
|
leanTurboCurrentPhase?: number;
|
|
168
|
+
/** Session-scoped concurrency override for max_concurrent_tasks (Issue #761).
|
|
169
|
+
* When set, overrides the plan's execution_profile.max_concurrent_tasks
|
|
170
|
+
* for delegation-gate guidance. Cleared on session reset. */
|
|
171
|
+
maxConcurrencyOverride?: number;
|
|
168
172
|
/** Session-level QA gate overrides layered on top of the spec-level profile.
|
|
169
173
|
* Overrides can only enable gates (true); false values are ignored by
|
|
170
174
|
* getEffectiveGates. Cleared on session reset. Optional for backwards
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-swarm",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.40.0",
|
|
4
4
|
"description": "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|