opencode-swarm 7.88.3 → 7.89.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/agents/agent-output-schema.d.ts +1 -1
- package/dist/agents/curator-agent.d.ts +1 -1
- package/dist/agents/explorer.d.ts +1 -0
- package/dist/cli/{config-doctor-jzbgpbdh.js → config-doctor-g04wdz19.js} +2 -2
- package/dist/cli/{explorer-gz70sm9b.js → explorer-h2fnj343.js} +4 -2
- package/dist/cli/{guardrail-explain-eqypvw60.js → guardrail-explain-hy0zz0p6.js} +8 -8
- package/dist/cli/{guardrail-log-c7egm5km.js → guardrail-log-m3285thy.js} +3 -3
- package/dist/cli/{index-0asbrmdx.js → index-123s7kjc.js} +88 -2
- package/dist/cli/{index-32axfg6h.js → index-1ccnwh54.js} +98 -25
- package/dist/cli/{index-ds057q5k.js → index-6k31ysgd.js} +2 -2
- package/dist/cli/{index-g00qm2gf.js → index-6tnmt41c.js} +1 -1
- package/dist/cli/{index-g6f4tt38.js → index-9w07ye9b.js} +906 -431
- package/dist/cli/{index-e8pk68cc.js → index-axwxkbdd.js} +166 -23
- package/dist/cli/{index-yhsmmv2z.js → index-bm4f0nme.js} +25 -1
- package/dist/cli/{index-819xp49y.js → index-bywt2171.js} +1 -1
- package/dist/cli/{index-0rt5aamg.js → index-dprk5c5f.js} +13 -9
- package/dist/cli/{index-vjsr9bqt.js → index-gg589mfw.js} +1 -1
- package/dist/cli/index.js +7 -7
- package/dist/cli/{knowledge-store-n4x6zyk7.js → knowledge-store-gsy6p46z.js} +1 -1
- package/dist/cli/{schema-vb6jkxgg.js → schema-t9th7frq.js} +1 -1
- package/dist/cli/{skill-generator-kz4q8e49.js → skill-generator-1hzfyhth.js} +2 -2
- package/dist/commands/index.d.ts +2 -0
- package/dist/commands/link.d.ts +19 -0
- package/dist/commands/memory.d.ts +1 -0
- package/dist/commands/registry.d.ts +31 -0
- package/dist/commands/unlink.d.ts +13 -0
- package/dist/config/agent-names.d.ts +2 -2
- package/dist/config/schema.d.ts +60 -0
- package/dist/hooks/curator-llm-factory.d.ts +1 -1
- package/dist/hooks/knowledge-events.d.ts +3 -3
- package/dist/hooks/knowledge-link.d.ts +82 -0
- package/dist/hooks/knowledge-validator.d.ts +1 -1
- package/dist/index.js +3177 -1765
- package/dist/knowledge/identity.d.ts +9 -0
- package/dist/memory/config.d.ts +35 -0
- package/dist/memory/consolidation-log.d.ts +29 -0
- package/dist/memory/consolidation.d.ts +124 -0
- package/dist/memory/decay.d.ts +24 -0
- package/dist/memory/gateway.d.ts +14 -2
- package/dist/memory/maintenance.d.ts +18 -0
- package/dist/memory/run-log.d.ts +8 -1
- package/dist/memory/schema.d.ts +3 -3
- package/dist/memory/scoring.d.ts +45 -0
- package/dist/memory/sentinel.d.ts +15 -0
- package/dist/services/memory-consolidation.d.ts +32 -0
- package/dist/services/skill-generator.d.ts +8 -1
- package/dist/session/worktree-link-suggestion.d.ts +27 -0
- package/dist/state.d.ts +4 -2
- package/package.json +1 -1
|
@@ -146,12 +146,12 @@ export type KnowledgeEventInput = KnowledgeEvent extends infer T ? T extends Kno
|
|
|
146
146
|
} : never : never;
|
|
147
147
|
/** Receipt event verbs that reference a single knowledge_id. */
|
|
148
148
|
export declare const RECEIPT_EVENT_TYPES: ReadonlySet<string>;
|
|
149
|
-
/** Returns
|
|
149
|
+
/** Returns the knowledge-events.jsonl path (link-aware via resolveKnowledgeStoreDir). */
|
|
150
150
|
export declare function resolveKnowledgeEventsPath(directory: string): string;
|
|
151
|
-
/** Returns
|
|
151
|
+
/** Returns the knowledge-counter-baseline.json path (link-aware). */
|
|
152
152
|
export declare function resolveKnowledgeCounterBaselinePath(directory: string): string;
|
|
153
153
|
export declare function resolveHiveEventsPath(): string;
|
|
154
|
-
/** Returns
|
|
154
|
+
/** Returns the knowledge-application.jsonl path for legacy v2 audit records (link-aware). */
|
|
155
155
|
export declare function resolveLegacyApplicationLogPath(directory: string): string;
|
|
156
156
|
/** Generate a fresh trace id. One per retrieval; receipts reference it. */
|
|
157
157
|
export declare function newTraceId(): string;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Knowledge "link" resolution for the opencode-swarm knowledge system.
|
|
3
|
+
*
|
|
4
|
+
* Problem: the swarm knowledge tier is rooted at `<directory>/.swarm/`, where
|
|
5
|
+
* `directory` is `ctx.directory`. When several swarms run in separate git
|
|
6
|
+
* worktrees of the same repository, each worktree has its own `.swarm/` and
|
|
7
|
+
* therefore its own isolated knowledge store — lessons one swarm learns are
|
|
8
|
+
* invisible to the others. The hive tier is the opposite extreme: global to
|
|
9
|
+
* EVERY project on the machine.
|
|
10
|
+
*
|
|
11
|
+
* A "link" ties multiple worktrees (or several deliberately "similar" repos)
|
|
12
|
+
* to one shared knowledge store that sits between the per-worktree swarm tier
|
|
13
|
+
* and the global hive tier. Membership is declared by an opt-in pointer file at
|
|
14
|
+
* `<directory>/.swarm/link.json`. When that pointer is active, the swarm
|
|
15
|
+
* knowledge *family* (store, events, rejected, retractions, counters,
|
|
16
|
+
* quarantine, unactionable) redirects from `<directory>/.swarm` to a shared
|
|
17
|
+
* link directory in the platform data dir — co-located with the hive store.
|
|
18
|
+
*
|
|
19
|
+
* Intentionally NOT redirected (stays per-worktree): `.knowledge-shown.json`
|
|
20
|
+
* (phase-keyed, session-local outcome bookkeeping), `plan.json`, evidence, and
|
|
21
|
+
* session state. Only id-keyed / append-only knowledge data is pooled.
|
|
22
|
+
*
|
|
23
|
+
* This module is self-contained (node builtins + the atomic-write helper only)
|
|
24
|
+
* so it can be imported by knowledge-store.ts, knowledge-events.ts, and
|
|
25
|
+
* knowledge-validator.ts without coupling to the heavily test-mocked store
|
|
26
|
+
* module and without import cycles.
|
|
27
|
+
*/
|
|
28
|
+
/** On-disk pointer at `<directory>/.swarm/link.json`. */
|
|
29
|
+
export interface LinkPointer {
|
|
30
|
+
version: 1;
|
|
31
|
+
/** Path-safe identifier of the shared store (projectHash or sanitized name). */
|
|
32
|
+
linkId: string;
|
|
33
|
+
/** Human-friendly name when the link was created from an explicit name. */
|
|
34
|
+
name?: string;
|
|
35
|
+
/** ISO 8601 creation timestamp. */
|
|
36
|
+
createdAt: string;
|
|
37
|
+
/** How the link was established. */
|
|
38
|
+
source: 'manual' | 'auto';
|
|
39
|
+
}
|
|
40
|
+
export declare const LINK_POINTER_FILENAME = "link.json";
|
|
41
|
+
/** Root directory under which all shared link stores live: `<dataDir>/links`. */
|
|
42
|
+
export declare function resolveLinkBaseDir(): string;
|
|
43
|
+
/** Directory of the shared knowledge family for a given link id. */
|
|
44
|
+
export declare function resolveLinkDir(linkId: string): string;
|
|
45
|
+
/**
|
|
46
|
+
* Coerce an arbitrary user-supplied name into a single, path-safe directory
|
|
47
|
+
* segment. Returns null when nothing usable remains (caller falls back to the
|
|
48
|
+
* project hash). Lowercased for case-insensitive stability across worktrees.
|
|
49
|
+
*/
|
|
50
|
+
export declare function sanitizeLinkId(name: string): string | null;
|
|
51
|
+
/** Read and validate the link pointer for a worktree. Null if absent/invalid. */
|
|
52
|
+
export declare function readLinkPointer(directory: string): LinkPointer | null;
|
|
53
|
+
/** Write the link pointer atomically and invalidate the resolution cache. */
|
|
54
|
+
export declare function writeLinkPointer(directory: string, pointer: LinkPointer): Promise<void>;
|
|
55
|
+
/** Remove the link pointer (idempotent) and invalidate the resolution cache. */
|
|
56
|
+
export declare function removeLinkPointer(directory: string): Promise<void>;
|
|
57
|
+
/**
|
|
58
|
+
* Resolve the directory that holds the swarm knowledge family for `directory`.
|
|
59
|
+
*
|
|
60
|
+
* Returns the shared link directory when an active pointer is present, otherwise
|
|
61
|
+
* the local `<directory>/.swarm`. Fail-open: any read/parse error degrades to the
|
|
62
|
+
* local directory, so a corrupt pointer never strands knowledge. Synchronous and
|
|
63
|
+
* cached so the hot retrieval path pays at most one tiny file read per TTL window.
|
|
64
|
+
*
|
|
65
|
+
* NOTE: when unlinked, the return value is byte-identical to the legacy
|
|
66
|
+
* `path.join(directory, '.swarm')`, so existing callers/tests are unaffected.
|
|
67
|
+
*/
|
|
68
|
+
export declare function resolveKnowledgeStoreDir(directory: string): string;
|
|
69
|
+
/** Drop cached resolution(s). Pass a directory to invalidate one, omit for all. */
|
|
70
|
+
export declare function invalidateKnowledgeStoreDirCache(directory?: string): void;
|
|
71
|
+
/** True when the worktree currently redirects to a shared link store. */
|
|
72
|
+
export declare function isLinked(directory: string): boolean;
|
|
73
|
+
export declare const _internals: {
|
|
74
|
+
resolveKnowledgeStoreDir: typeof resolveKnowledgeStoreDir;
|
|
75
|
+
readLinkPointer: typeof readLinkPointer;
|
|
76
|
+
writeLinkPointer: typeof writeLinkPointer;
|
|
77
|
+
removeLinkPointer: typeof removeLinkPointer;
|
|
78
|
+
invalidateKnowledgeStoreDirCache: typeof invalidateKnowledgeStoreDirCache;
|
|
79
|
+
resolveLinkDir: typeof resolveLinkDir;
|
|
80
|
+
resolveLinkBaseDir: typeof resolveLinkBaseDir;
|
|
81
|
+
sanitizeLinkId: typeof sanitizeLinkId;
|
|
82
|
+
};
|
|
@@ -68,7 +68,7 @@ export interface ActionabilityResult {
|
|
|
68
68
|
* quarantined rather than activated.
|
|
69
69
|
*/
|
|
70
70
|
export declare function validateActionability(entry: Pick<KnowledgeEntryBase, 'forbidden_actions' | 'required_actions' | 'verification_checks' | 'verification_predicate' | 'applies_to_tools' | 'applies_to_agents'>): ActionabilityResult;
|
|
71
|
-
/** Returns
|
|
71
|
+
/** Returns the knowledge-unactionable.jsonl path for the given directory (link-aware). */
|
|
72
72
|
export declare function resolveUnactionablePath(directory: string): string;
|
|
73
73
|
/** One quarantined-unactionable record. */
|
|
74
74
|
export interface UnactionableRecord extends KnowledgeEntryBase {
|