opencode-swarm 7.103.2 → 7.104.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.
Files changed (39) hide show
  1. package/dist/cli/{config-doctor-4rxjsg22.js → config-doctor-5m8z8jeg.js} +2 -2
  2. package/dist/cli/{guardrail-explain-4pnnjmyb.js → guardrail-explain-2zat1bxh.js} +5 -5
  3. package/dist/cli/{guardrail-log-vg0atkrx.js → guardrail-log-zhshjbpk.js} +3 -3
  4. package/dist/cli/{index-9zb70qfe.js → index-0derejrq.js} +1 -1
  5. package/dist/cli/{index-h0h4qjmc.js → index-5tywmqeh.js} +1 -1
  6. package/dist/cli/{index-4fnw0ebs.js → index-e7nhwa9k.js} +8 -6
  7. package/dist/cli/{index-5xy6kv7p.js → index-fk8ta8zw.js} +2 -2
  8. package/dist/cli/{index-m9keg83x.js → index-kcbcy6wq.js} +1 -1
  9. package/dist/cli/{index-3ahcme4e.js → index-n3ys2eny.js} +655 -55
  10. package/dist/cli/{index-ga7et2xw.js → index-t1vfvtg9.js} +21 -0
  11. package/dist/cli/index.js +4 -4
  12. package/dist/cli/{schema-az0hgfv0.js → schema-yxkdx5g5.js} +1 -1
  13. package/dist/commands/index.d.ts +1 -1
  14. package/dist/commands/memory.d.ts +1 -0
  15. package/dist/commands/registry.d.ts +8 -0
  16. package/dist/config/schema.d.ts +22 -0
  17. package/dist/council/types.d.ts +9 -0
  18. package/dist/graph/import-extractor.d.ts +1 -1
  19. package/dist/hooks/knowledge-application.d.ts +2 -2
  20. package/dist/hooks/knowledge-events.d.ts +3 -0
  21. package/dist/index.js +79 -44
  22. package/dist/lang/symbol-visibility.d.ts +2 -0
  23. package/dist/memory/config.d.ts +20 -0
  24. package/dist/memory/gateway.d.ts +1 -0
  25. package/dist/memory/index.d.ts +2 -1
  26. package/dist/memory/maintenance.d.ts +4 -1
  27. package/dist/memory/provider-pool.d.ts +23 -0
  28. package/dist/memory/provider.d.ts +53 -0
  29. package/dist/memory/reward.d.ts +39 -0
  30. package/dist/memory/schema.d.ts +2 -0
  31. package/dist/memory/scoring.d.ts +2 -0
  32. package/dist/memory/sqlite-provider.d.ts +53 -1
  33. package/dist/memory/types.d.ts +5 -0
  34. package/dist/state.d.ts +2 -2
  35. package/dist/tools/convene-council.d.ts +2 -0
  36. package/dist/tools/repo-graph/builder.d.ts +4 -2
  37. package/dist/tools/submit-phase-council-verdicts.d.ts +1 -0
  38. package/dist/tools/symbols.d.ts +2 -0
  39. package/package.json +1 -1
@@ -1568,6 +1568,27 @@ var MemoryConfigSchema = exports_external.object({
1568
1568
  tokenBudget: 1000
1569
1569
  }
1570
1570
  }),
1571
+ learning: exports_external.object({
1572
+ learningRate: exports_external.number().min(0).max(1).default(0.1),
1573
+ propagationFactor: exports_external.number().min(0).max(1).default(0.3),
1574
+ qValueBoostWeight: exports_external.number().min(0).max(1).default(0.1),
1575
+ suppressionThreshold: exports_external.number().min(0).max(1).default(0.15),
1576
+ promotionThreshold: exports_external.number().min(0).max(1).default(0.85),
1577
+ propagationTokenOverlapThreshold: exports_external.number().min(0).max(1).default(0.4),
1578
+ propagationEmbeddingCosineThreshold: exports_external.number().min(0).max(1).default(0.7),
1579
+ propagationFanout: exports_external.number().int().min(0).max(1000).default(20),
1580
+ propagationLookbackDays: exports_external.number().int().min(1).max(3650).default(30)
1581
+ }).default({
1582
+ learningRate: 0.1,
1583
+ propagationFactor: 0.3,
1584
+ qValueBoostWeight: 0.1,
1585
+ suppressionThreshold: 0.15,
1586
+ promotionThreshold: 0.85,
1587
+ propagationTokenOverlapThreshold: 0.4,
1588
+ propagationEmbeddingCosineThreshold: 0.7,
1589
+ propagationFanout: 20,
1590
+ propagationLookbackDays: 30
1591
+ }),
1571
1592
  writes: exports_external.object({
1572
1593
  mode: exports_external.literal("propose").default("propose")
1573
1594
  }).default({ mode: "propose" }),
package/dist/cli/index.js CHANGED
@@ -7,15 +7,15 @@ import {
7
7
  getPluginLockFilePaths,
8
8
  package_default,
9
9
  resolveCommand
10
- } from "./index-3ahcme4e.js";
11
- import"./index-m9keg83x.js";
10
+ } from "./index-n3ys2eny.js";
11
+ import"./index-kcbcy6wq.js";
12
12
  import"./index-ydgy7vg5.js";
13
13
  import"./index-vwyjkzgs.js";
14
14
  import"./index-f7nma02k.js";
15
- import"./index-h0h4qjmc.js";
15
+ import"./index-5tywmqeh.js";
16
16
  import {
17
17
  DEFAULT_AGENT_CONFIGS
18
- } from "./index-ga7et2xw.js";
18
+ } from "./index-t1vfvtg9.js";
19
19
  import"./index-k2rmw9sz.js";
20
20
  import"./index-8w4d325g.js";
21
21
  import"./index-v4fcn4tr.js";
@@ -85,7 +85,7 @@ import {
85
85
  resolveGeneratedAgentRole,
86
86
  resolveGuardrailsConfig,
87
87
  stripKnownSwarmPrefix
88
- } from "./index-ga7et2xw.js";
88
+ } from "./index-t1vfvtg9.js";
89
89
  import"./index-p0arc26j.js";
90
90
  import"./index-293f68mj.js";
91
91
  import"./index-a76rekgs.js";
@@ -34,7 +34,7 @@ export { handleHistoryCommand } from './history';
34
34
  export { handleKnowledgeListCommand, handleKnowledgeMigrateCommand, handleKnowledgeQuarantineCommand, handleKnowledgeRestoreCommand, handleKnowledgeRetryHardeningCommand, handleKnowledgeUnactionableCommand, } from './knowledge';
35
35
  export { handleLearningCommand } from './learning';
36
36
  export { handleLinkCommand } from './link';
37
- export { handleMemoryCommand, handleMemoryExportCommand, handleMemoryImportCommand, handleMemoryMigrateCommand, handleMemoryStatusCommand, } from './memory';
37
+ export { handleMemoryCommand, handleMemoryExportCommand, handleMemoryImportCommand, handleMemoryMigrateCommand, handleMemoryStatusCommand, handleMemoryValueLogCommand, } from './memory';
38
38
  export { handlePlanCommand } from './plan';
39
39
  export { handlePreflightCommand } from './preflight';
40
40
  export { handlePromoteCommand } from './promote';
@@ -3,6 +3,7 @@ export declare function handleMemoryConsolidationLogCommand(directory: string, a
3
3
  export declare function handleMemoryStatusCommand(directory: string, _args: string[]): Promise<string>;
4
4
  export declare function handleMemoryPendingCommand(directory: string, args: string[]): Promise<string>;
5
5
  export declare function handleMemoryRecallLogCommand(directory: string, args: string[]): Promise<string>;
6
+ export declare function handleMemoryValueLogCommand(directory: string, args: string[]): Promise<string>;
6
7
  export declare function handleMemoryStaleCommand(directory: string, args: string[]): Promise<string>;
7
8
  export declare function handleMemoryCompactCommand(directory: string, args: string[]): Promise<string>;
8
9
  export declare function handleMemoryMigrateCommand(directory: string, _args: string[]): Promise<string>;
@@ -798,6 +798,14 @@ export declare const COMMAND_REGISTRY: {
798
798
  readonly category: "diagnostics";
799
799
  readonly toolPolicy: "agent";
800
800
  };
801
+ readonly 'memory value-log': {
802
+ readonly handler: (ctx: CommandContext) => Promise<string>;
803
+ readonly description: "Show Swarm memory Q-value and reward updates";
804
+ readonly subcommandOf: "memory";
805
+ readonly args: "--limit <n>";
806
+ readonly category: "diagnostics";
807
+ readonly toolPolicy: "agent";
808
+ };
801
809
  readonly 'memory compact': {
802
810
  readonly handler: (ctx: CommandContext) => Promise<string>;
803
811
  readonly description: "Compact deleted, superseded, and expired scratch memories";
@@ -645,6 +645,17 @@ export declare const MemoryConfigSchema: z.ZodObject<{
645
645
  tokenBudget: z.ZodDefault<z.ZodNumber>;
646
646
  }, z.core.$strip>>;
647
647
  }, z.core.$strip>>;
648
+ learning: z.ZodDefault<z.ZodObject<{
649
+ learningRate: z.ZodDefault<z.ZodNumber>;
650
+ propagationFactor: z.ZodDefault<z.ZodNumber>;
651
+ qValueBoostWeight: z.ZodDefault<z.ZodNumber>;
652
+ suppressionThreshold: z.ZodDefault<z.ZodNumber>;
653
+ promotionThreshold: z.ZodDefault<z.ZodNumber>;
654
+ propagationTokenOverlapThreshold: z.ZodDefault<z.ZodNumber>;
655
+ propagationEmbeddingCosineThreshold: z.ZodDefault<z.ZodNumber>;
656
+ propagationFanout: z.ZodDefault<z.ZodNumber>;
657
+ propagationLookbackDays: z.ZodDefault<z.ZodNumber>;
658
+ }, z.core.$strip>>;
648
659
  writes: z.ZodDefault<z.ZodObject<{
649
660
  mode: z.ZodDefault<z.ZodLiteral<"propose">>;
650
661
  }, z.core.$strip>>;
@@ -1830,6 +1841,17 @@ export declare const PluginConfigSchema: z.ZodObject<{
1830
1841
  tokenBudget: z.ZodDefault<z.ZodNumber>;
1831
1842
  }, z.core.$strip>>;
1832
1843
  }, z.core.$strip>>;
1844
+ learning: z.ZodDefault<z.ZodObject<{
1845
+ learningRate: z.ZodDefault<z.ZodNumber>;
1846
+ propagationFactor: z.ZodDefault<z.ZodNumber>;
1847
+ qValueBoostWeight: z.ZodDefault<z.ZodNumber>;
1848
+ suppressionThreshold: z.ZodDefault<z.ZodNumber>;
1849
+ promotionThreshold: z.ZodDefault<z.ZodNumber>;
1850
+ propagationTokenOverlapThreshold: z.ZodDefault<z.ZodNumber>;
1851
+ propagationEmbeddingCosineThreshold: z.ZodDefault<z.ZodNumber>;
1852
+ propagationFanout: z.ZodDefault<z.ZodNumber>;
1853
+ propagationLookbackDays: z.ZodDefault<z.ZodNumber>;
1854
+ }, z.core.$strip>>;
1833
1855
  writes: z.ZodDefault<z.ZodObject<{
1834
1856
  mode: z.ZodDefault<z.ZodLiteral<"propose">>;
1835
1857
  }, z.core.$strip>>;
@@ -31,6 +31,15 @@ export interface CouncilMemberVerdict {
31
31
  /** Criteria IDs that failed */
32
32
  criteriaUnmet: string[];
33
33
  durationMs: number;
34
+ /**
35
+ * Optional session id of the dispatched agent that produced this verdict.
36
+ * When supplied, the memory reward pathway rewards this member's own
37
+ * recall bundle in addition to the submitting session's, so sub-agent
38
+ * recalls are not silently skipped. Unvalidated caller input — the
39
+ * reward pathway must confirm this resolves to a real tracked session
40
+ * before trusting it.
41
+ */
42
+ sessionId?: string;
34
43
  }
35
44
  export interface CouncilSynthesis {
36
45
  taskId: string;
@@ -29,7 +29,7 @@ export interface ExtractImportsOptions {
29
29
  content?: string;
30
30
  }
31
31
  /** Source file extensions we know how to scan. */
32
- export declare const SOURCE_EXTENSIONS: readonly [".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs", ".py", ".go", ".rs"];
32
+ export declare const SOURCE_EXTENSIONS: readonly [".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs", ".py", ".pyw", ".go", ".rs"];
33
33
  export declare function getLanguageFromExtension(ext: string): string | null;
34
34
  /**
35
35
  * Extract import edges for a single file. Returns an empty array when the
@@ -33,14 +33,14 @@ export interface RecordContext {
33
33
  /** Record one or more knowledge IDs as "shown" (injected into context). */
34
34
  export declare function recordKnowledgeShown(directory: string, ids: string[], ctx: RecordContext): Promise<void>;
35
35
  /** Record an explicit acknowledgment outcome (applied / ignored / violated).
36
- * Per-(sessionId, knowledgeId, result, dayKey) dedup is enforced by the
36
+ * Per-(sessionId, knowledgeId, result) dedup is enforced by the
37
37
  * caller via swarmState.knowledgeAckDedup; this fn always records when
38
38
  * invoked, so test code can trigger duplicates if needed. The runtime
39
39
  * integration in src/index.ts uses recordAcknowledgmentDeduped instead. */
40
40
  export declare function recordAcknowledgment(directory: string, ack: ParsedAcknowledgment, ctx: RecordContext): Promise<void>;
41
41
  /** Build the dedup key. Exported so test code and the runtime integration
42
42
  * share the exact format. */
43
- export declare function buildAckDedupKey(sessionId: string, id: string, result: KnowledgeApplicationResult | 'n_a', now?: Date): string;
43
+ export declare function buildAckDedupKey(sessionId: string, id: string, result: KnowledgeApplicationResult | 'n_a', _now?: Date): string;
44
44
  /** Acknowledgment recording with dedup. Returns whether a record was actually
45
45
  * written (false on dedup hit). dedupSet should be swarmState.knowledgeAckDedup
46
46
  * in production; tests can pass a fresh Set. */
@@ -306,9 +306,12 @@ export declare function effectiveRetrievalOutcomes(stored: RetrievalOutcome | un
306
306
  */
307
307
  export declare function applyKnowledgeVerdictFeedback(directory: string, options?: {
308
308
  sinceTimestamp?: string;
309
+ sinceEventId?: string;
309
310
  }): Promise<{
310
311
  processed: number;
311
312
  bumps: number;
313
+ lastProcessedTimestamp?: string;
314
+ lastProcessedEventId?: string;
312
315
  }>;
313
316
  export declare const _internals: {
314
317
  resolveKnowledgeEventsPath: typeof resolveKnowledgeEventsPath;