negotium 0.2.17 → 0.2.19
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/agent-helpers.js +41 -32
- package/dist/agent-helpers.js.map +10 -10
- package/dist/{chunk-5cpdbbeh.js → chunk-fc58cqry.js} +3 -1
- package/dist/{chunk-5cpdbbeh.js.map → chunk-fc58cqry.js.map} +3 -3
- package/dist/hosted-agent.js +4 -2
- package/dist/hosted-agent.js.map +4 -4
- package/dist/main.js +1377 -285
- package/dist/main.js.map +14 -13
- package/dist/mcp-factories.js +1497 -403
- package/dist/mcp-factories.js.map +14 -13
- package/dist/prompts.js +8 -8
- package/dist/prompts.js.map +3 -3
- package/dist/registry.js +3 -3
- package/dist/registry.js.map +2 -2
- package/dist/rollout.js +1 -1
- package/dist/runtime/src/agents/archiver.ts +1 -1
- package/dist/runtime/src/agents/idle-archiver.ts +3 -2
- package/dist/runtime/src/mcp/canonical-proxy-server.ts +31 -15
- package/dist/runtime/src/mcp/wiki-search-index.ts +359 -0
- package/dist/runtime/src/mcp/wiki-server.ts +1358 -155
- package/dist/runtime/src/platform/mcp-config.ts +2 -1
- package/dist/runtime/src/prompts/agents/wiki-archiver.md +73 -48
- package/dist/runtime/src/prompts/builders.ts +17 -34
- package/dist/runtime/src/runtime/turn-runner.ts +14 -17
- package/dist/runtime/src/storage/api-topics.ts +13 -4
- package/dist/runtime/src/topics/lifecycle.ts +3 -2
- package/dist/runtime/src/types/api.ts +6 -0
- package/dist/runtime/src/version.ts +1 -1
- package/dist/storage.js +12 -6
- package/dist/storage.js.map +3 -3
- package/dist/types/packages/core/src/agents/archiver.d.ts +1 -1
- package/dist/types/packages/core/src/mcp/wiki-search-index.d.ts +59 -0
- package/dist/types/packages/core/src/mcp/wiki-server.d.ts +4 -0
- package/dist/types/packages/core/src/prompts/builders.d.ts +2 -4
- package/dist/types/packages/core/src/storage/api-topics.d.ts +1 -0
- package/dist/types/packages/core/src/types/api.d.ts +6 -0
- package/dist/types/packages/core/src/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -73,7 +73,7 @@ export interface ArchiverRuntime {
|
|
|
73
73
|
export declare function createArchiverRuntime(host: ArchiverHost): ArchiverRuntime;
|
|
74
74
|
/**
|
|
75
75
|
* Locate the summary the archiver turn just wrote. The wiki MCP's
|
|
76
|
-
* `
|
|
76
|
+
* `wiki_write(kind="summary")` writes `summaries/<date>-<title>[~N].md`.
|
|
77
77
|
*/
|
|
78
78
|
export declare function findSummaryFile(storage: ArchiverStorageHost, topicTitle: string, date: string, sinceMs: number, topicId?: string): string | null;
|
|
79
79
|
export declare function runArchiverTurn(params: RunArchiverTurnParams): boolean;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
export type IndexedWikiKind = "article" | "summary";
|
|
2
|
+
export interface WikiSearchIndexSource {
|
|
3
|
+
kind: IndexedWikiKind;
|
|
4
|
+
key: string;
|
|
5
|
+
path: string;
|
|
6
|
+
mtimeMs: number;
|
|
7
|
+
size: number;
|
|
8
|
+
}
|
|
9
|
+
export interface PreparedWikiSearchDocument {
|
|
10
|
+
title: string;
|
|
11
|
+
text: string;
|
|
12
|
+
tokens: string[];
|
|
13
|
+
date?: string;
|
|
14
|
+
family?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface WikiSearchIndexDocument extends PreparedWikiSearchDocument {
|
|
17
|
+
id: string;
|
|
18
|
+
kind: IndexedWikiKind;
|
|
19
|
+
key: string;
|
|
20
|
+
path: string;
|
|
21
|
+
}
|
|
22
|
+
export interface WikiSearchIndexMetadata {
|
|
23
|
+
id: string;
|
|
24
|
+
kind: IndexedWikiKind;
|
|
25
|
+
key: string;
|
|
26
|
+
title: string;
|
|
27
|
+
date?: string;
|
|
28
|
+
}
|
|
29
|
+
export interface WikiSummaryTemporalQuery {
|
|
30
|
+
year?: string;
|
|
31
|
+
month?: string;
|
|
32
|
+
direction: "latest" | "oldest";
|
|
33
|
+
limit: number;
|
|
34
|
+
}
|
|
35
|
+
export interface WikiSearchIndexSyncResult {
|
|
36
|
+
added: number;
|
|
37
|
+
updated: number;
|
|
38
|
+
removed: number;
|
|
39
|
+
}
|
|
40
|
+
export declare class WikiSearchIndex {
|
|
41
|
+
#private;
|
|
42
|
+
readonly path: string;
|
|
43
|
+
constructor(path: string);
|
|
44
|
+
close(): void;
|
|
45
|
+
/**
|
|
46
|
+
* Record one document that was just written.
|
|
47
|
+
*
|
|
48
|
+
* The write path already holds the document text, so the index is maintained
|
|
49
|
+
* incrementally and never needs to scan the content directories. `sync` stays
|
|
50
|
+
* for the explicit backfill of documents that predate the write tool.
|
|
51
|
+
*/
|
|
52
|
+
upsert(source: WikiSearchIndexSource, document: PreparedWikiSearchDocument): void;
|
|
53
|
+
sync(sources: WikiSearchIndexSource[], prepare: (source: WikiSearchIndexSource, text: string) => PreparedWikiSearchDocument): WikiSearchIndexSyncResult;
|
|
54
|
+
metadata(kinds: IndexedWikiKind[]): WikiSearchIndexMetadata[];
|
|
55
|
+
summaryMetadataByDate(query: WikiSummaryTemporalQuery): WikiSearchIndexMetadata[];
|
|
56
|
+
matchingDocumentIds(kinds: IndexedWikiKind[], terms: string[]): Set<string>;
|
|
57
|
+
documents(ids: Set<string>): WikiSearchIndexDocument[];
|
|
58
|
+
}
|
|
59
|
+
export declare function resetCorruptWikiSearchIndex(path: string): void;
|
|
@@ -9,6 +9,7 @@ export interface WikiTopicBrief {
|
|
|
9
9
|
}
|
|
10
10
|
export interface WikiMcpHost {
|
|
11
11
|
wikiRoot: string;
|
|
12
|
+
canReadTopicMemory?(selection: string, userId: string): boolean;
|
|
12
13
|
getTopicBrief?(topicId: string): WikiTopicBrief | null;
|
|
13
14
|
resolveTopicBrief?(selection: string, userId: string): WikiTopicBrief | null;
|
|
14
15
|
setTopicBrief?(topicId: string, fields: {
|
|
@@ -16,9 +17,12 @@ export interface WikiMcpHost {
|
|
|
16
17
|
latestSummaryMd?: string;
|
|
17
18
|
summaryDate?: string;
|
|
18
19
|
}): void;
|
|
20
|
+
adoptTopicMemory?(topicId: string, userId: string, memoryKey: string): boolean;
|
|
19
21
|
}
|
|
20
22
|
export interface WikiMcpContext {
|
|
21
23
|
userId: string;
|
|
24
|
+
/** The room executing the tool, even when topicId points at inherited memory. */
|
|
25
|
+
currentTopicId?: string;
|
|
22
26
|
topicId?: string;
|
|
23
27
|
surface?: WikiSurface;
|
|
24
28
|
}
|
|
@@ -69,10 +69,8 @@ export declare const buildTopicSystemPrompt: (opts: SessionSystemPromptOpts) =>
|
|
|
69
69
|
export declare const buildChannelSystemPrompt: (opts: SessionSystemPromptOpts) => string;
|
|
70
70
|
export declare const buildManagerSystemPrompt: (opts: SessionSystemPromptOpts) => string;
|
|
71
71
|
export declare function buildMemoryPromptSection(opts: {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
hasFiles: boolean;
|
|
75
|
-
latestSummaryFile?: string | null;
|
|
72
|
+
topicTitle: string;
|
|
73
|
+
memoryKey?: string;
|
|
76
74
|
hasArchive?: boolean;
|
|
77
75
|
isManager: boolean;
|
|
78
76
|
}): string;
|
|
@@ -99,6 +99,12 @@ export interface TopicDto {
|
|
|
99
99
|
* When omitted, derived topics inherit memory through their parent chain.
|
|
100
100
|
*/
|
|
101
101
|
memoryTopicId?: string;
|
|
102
|
+
/**
|
|
103
|
+
* Canonical title-keyed wiki memory namespace for this topic.
|
|
104
|
+
* Unlike memoryTopicId this survives room deletion/recreation and does not
|
|
105
|
+
* identify another live topic.
|
|
106
|
+
*/
|
|
107
|
+
memoryKey?: string;
|
|
102
108
|
/** True when the topic was created via fork (copies history). */
|
|
103
109
|
isFork?: boolean;
|
|
104
110
|
/** True when this topic was spawned by an agent as a subagent worker room. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const NEGOTIUM_VERSION = "0.2.
|
|
1
|
+
export declare const NEGOTIUM_VERSION = "0.2.19";
|