oc-solomemory-dev 1.0.8
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/LICENSE +661 -0
- package/README.md +72 -0
- package/dist/cli/auth.d.ts +2 -0
- package/dist/cli/auth.d.ts.map +1 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/install.d.ts +2 -0
- package/dist/cli/install.d.ts.map +1 -0
- package/dist/cli/prompt.d.ts +5 -0
- package/dist/cli/prompt.d.ts.map +1 -0
- package/dist/cli/templates.d.ts +3 -0
- package/dist/cli/templates.d.ts.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +553 -0
- package/dist/config.d.ts +16 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14088 -0
- package/dist/services/auth.d.ts +10 -0
- package/dist/services/auth.d.ts.map +1 -0
- package/dist/services/client-types.d.ts +164 -0
- package/dist/services/client-types.d.ts.map +1 -0
- package/dist/services/client.d.ts +32 -0
- package/dist/services/client.d.ts.map +1 -0
- package/dist/services/compaction.d.ts +71 -0
- package/dist/services/compaction.d.ts.map +1 -0
- package/dist/services/context.d.ts +28 -0
- package/dist/services/context.d.ts.map +1 -0
- package/dist/services/error-reporter.d.ts +8 -0
- package/dist/services/error-reporter.d.ts.map +1 -0
- package/dist/services/jsonc.d.ts +7 -0
- package/dist/services/jsonc.d.ts.map +1 -0
- package/dist/services/logger.d.ts +2 -0
- package/dist/services/logger.d.ts.map +1 -0
- package/dist/services/messages.d.ts +33 -0
- package/dist/services/messages.d.ts.map +1 -0
- package/dist/services/privacy.d.ts +4 -0
- package/dist/services/privacy.d.ts.map +1 -0
- package/dist/services/tags.d.ts +51 -0
- package/dist/services/tags.d.ts.map +1 -0
- package/dist/services/workspace.d.ts +7 -0
- package/dist/services/workspace.d.ts.map +1 -0
- package/dist/state.d.ts +2 -0
- package/dist/state.d.ts.map +1 -0
- package/dist/sync.d.ts +16 -0
- package/dist/sync.d.ts.map +1 -0
- package/dist/tools.d.ts +12 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/types/index.d.ts +52 -0
- package/dist/types/index.d.ts.map +1 -0
- package/package.json +76 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface Credentials {
|
|
2
|
+
apiKey: string;
|
|
3
|
+
createdAt: string;
|
|
4
|
+
}
|
|
5
|
+
export declare function loadCredentials(): Credentials | null;
|
|
6
|
+
export declare function saveCredentials(apiKey: string): void;
|
|
7
|
+
export declare function clearCredentials(): boolean;
|
|
8
|
+
export declare function getCredentialsDir(): string;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=auth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/services/auth.ts"],"names":[],"mappings":"AAOA,UAAU,WAAW;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB;AAaD,wBAAgB,eAAe,IAAI,WAAW,GAAG,IAAI,CAUpD;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAOpD;AAED,wBAAgB,gBAAgB,IAAI,OAAO,CAI1C;AAED,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C"}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import type { ConversationIngestResponse, ConversationMessage, JobStatus, Memory, MetadataFilter } from "../types/index.js";
|
|
2
|
+
export interface SearchResult {
|
|
3
|
+
id: string;
|
|
4
|
+
memory?: string;
|
|
5
|
+
chunk?: string;
|
|
6
|
+
similarity: number;
|
|
7
|
+
metadata?: Record<string, unknown>;
|
|
8
|
+
validAt?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface SearchResponse {
|
|
11
|
+
results: SearchResult[];
|
|
12
|
+
total: number;
|
|
13
|
+
timing: number;
|
|
14
|
+
}
|
|
15
|
+
export interface ProfileFact {
|
|
16
|
+
fact: string;
|
|
17
|
+
validAt?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface ProfileResponse {
|
|
20
|
+
profile: {
|
|
21
|
+
static: ProfileFact[];
|
|
22
|
+
dynamic: ProfileFact[];
|
|
23
|
+
} | null;
|
|
24
|
+
}
|
|
25
|
+
interface AddMemoryResponse {
|
|
26
|
+
id: string;
|
|
27
|
+
status: string;
|
|
28
|
+
}
|
|
29
|
+
export interface ListMemoriesResponse {
|
|
30
|
+
memories: Memory[];
|
|
31
|
+
pagination: {
|
|
32
|
+
currentPage: number;
|
|
33
|
+
totalItems: number;
|
|
34
|
+
totalPages: number;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export interface IngestPayload {
|
|
38
|
+
readonly conversationId: string;
|
|
39
|
+
readonly messages: ConversationMessage[];
|
|
40
|
+
readonly containerTags: string[];
|
|
41
|
+
readonly metadata?: Record<string, string | number | boolean>;
|
|
42
|
+
}
|
|
43
|
+
export interface MetadataSearchOptions {
|
|
44
|
+
readonly query: string;
|
|
45
|
+
readonly containerTags: string[];
|
|
46
|
+
readonly metadataFilters: MetadataFilter[];
|
|
47
|
+
readonly limit?: number;
|
|
48
|
+
}
|
|
49
|
+
export type SearchMemoriesResult = {
|
|
50
|
+
success: true;
|
|
51
|
+
results: SearchResult[];
|
|
52
|
+
total: number;
|
|
53
|
+
timing: number;
|
|
54
|
+
} | {
|
|
55
|
+
success: false;
|
|
56
|
+
error: string;
|
|
57
|
+
results: [];
|
|
58
|
+
total: 0;
|
|
59
|
+
timing: 0;
|
|
60
|
+
};
|
|
61
|
+
export type ProfileResult = {
|
|
62
|
+
success: true;
|
|
63
|
+
profile: ProfileResponse["profile"];
|
|
64
|
+
} | {
|
|
65
|
+
success: false;
|
|
66
|
+
error: string;
|
|
67
|
+
profile: null;
|
|
68
|
+
};
|
|
69
|
+
export type AddMemoryResult = {
|
|
70
|
+
success: true;
|
|
71
|
+
id: string;
|
|
72
|
+
status: string;
|
|
73
|
+
} | {
|
|
74
|
+
success: false;
|
|
75
|
+
error: string;
|
|
76
|
+
};
|
|
77
|
+
export type DeleteMemoryResult = {
|
|
78
|
+
success: true;
|
|
79
|
+
} | {
|
|
80
|
+
success: false;
|
|
81
|
+
error: string;
|
|
82
|
+
};
|
|
83
|
+
export type ListMemoriesResult = {
|
|
84
|
+
success: true;
|
|
85
|
+
memories: Memory[];
|
|
86
|
+
pagination: ListMemoriesResponse["pagination"];
|
|
87
|
+
} | {
|
|
88
|
+
success: false;
|
|
89
|
+
error: string;
|
|
90
|
+
memories: [];
|
|
91
|
+
pagination: {
|
|
92
|
+
currentPage: 1;
|
|
93
|
+
totalItems: 0;
|
|
94
|
+
totalPages: 0;
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
export type IngestConversationResult = {
|
|
98
|
+
success: true;
|
|
99
|
+
id: string;
|
|
100
|
+
conversationId: string;
|
|
101
|
+
status: string;
|
|
102
|
+
} | {
|
|
103
|
+
success: false;
|
|
104
|
+
error: string;
|
|
105
|
+
};
|
|
106
|
+
export type GetJobStatusResult = {
|
|
107
|
+
success: true;
|
|
108
|
+
job: JobStatus;
|
|
109
|
+
} | {
|
|
110
|
+
success: false;
|
|
111
|
+
error: string;
|
|
112
|
+
};
|
|
113
|
+
export interface ProjectInfo {
|
|
114
|
+
containerTag: string;
|
|
115
|
+
projectId: string;
|
|
116
|
+
repository?: string;
|
|
117
|
+
workspace?: string;
|
|
118
|
+
}
|
|
119
|
+
export interface ProjectsResponse {
|
|
120
|
+
projects: ProjectInfo[];
|
|
121
|
+
count: number;
|
|
122
|
+
}
|
|
123
|
+
export type ListProjectsResult = {
|
|
124
|
+
success: true;
|
|
125
|
+
projects: ProjectInfo[];
|
|
126
|
+
} | {
|
|
127
|
+
success: false;
|
|
128
|
+
error: string;
|
|
129
|
+
projects: [];
|
|
130
|
+
};
|
|
131
|
+
export interface TopicEntry {
|
|
132
|
+
id: string;
|
|
133
|
+
topic: string;
|
|
134
|
+
keywords?: string[];
|
|
135
|
+
createdAt?: string;
|
|
136
|
+
}
|
|
137
|
+
export interface TopicsResponse {
|
|
138
|
+
topics: TopicEntry[];
|
|
139
|
+
total: number;
|
|
140
|
+
}
|
|
141
|
+
export type GetTopicsResult = {
|
|
142
|
+
success: true;
|
|
143
|
+
topics: TopicEntry[];
|
|
144
|
+
total: number;
|
|
145
|
+
} | {
|
|
146
|
+
success: false;
|
|
147
|
+
error: string;
|
|
148
|
+
topics: [];
|
|
149
|
+
total: 0;
|
|
150
|
+
};
|
|
151
|
+
export declare function isSearchResponse(data: unknown): data is SearchResponse;
|
|
152
|
+
export declare function isProfileResponse(data: unknown): data is ProfileResponse;
|
|
153
|
+
export declare function isAddMemoryResponse(data: unknown): data is AddMemoryResponse;
|
|
154
|
+
export declare function isListMemoriesResponse(data: unknown): data is ListMemoriesResponse;
|
|
155
|
+
export declare function isIngestResponse(data: unknown): data is ConversationIngestResponse;
|
|
156
|
+
export declare function isJobStatusResponse(data: unknown): data is JobStatus;
|
|
157
|
+
export declare function isProjectsResponse(data: unknown): data is ProjectsResponse;
|
|
158
|
+
export declare function isTopicsResponse(data: unknown): data is TopicsResponse;
|
|
159
|
+
export declare function toErrorMessage(error: unknown): string;
|
|
160
|
+
export declare function searchFailure(error: string): SearchMemoriesResult;
|
|
161
|
+
export declare function listFailure(error: string): ListMemoriesResult;
|
|
162
|
+
export declare function topicsFailure(error: string): GetTopicsResult;
|
|
163
|
+
export {};
|
|
164
|
+
//# sourceMappingURL=client-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client-types.d.ts","sourceRoot":"","sources":["../../src/services/client-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,0BAA0B,EAC1B,mBAAmB,EACnB,SAAS,EACT,MAAM,EACN,cAAc,EACf,MAAM,mBAAmB,CAAC;AAI3B,MAAM,WAAW,YAAY;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gB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,eAAe,CAE5D"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { MemoryType, MetadataFilter } from "../types/index.js";
|
|
2
|
+
import type { AddMemoryResult, DeleteMemoryResult, GetJobStatusResult, GetTopicsResult, IngestConversationResult, IngestPayload, ListMemoriesResult, ListProjectsResult, MetadataSearchOptions, ProfileResult, SearchMemoriesResult } from "./client-types.js";
|
|
3
|
+
export declare class SolomemoryClient {
|
|
4
|
+
searchMemories(query: string, containerTag: string, options?: {
|
|
5
|
+
metadataFilters?: MetadataFilter[];
|
|
6
|
+
limit?: number;
|
|
7
|
+
}): Promise<SearchMemoriesResult>;
|
|
8
|
+
getProfile(query?: string): Promise<ProfileResult>;
|
|
9
|
+
searchUserMemories(query: string, options?: {
|
|
10
|
+
limit?: number;
|
|
11
|
+
}): Promise<SearchMemoriesResult>;
|
|
12
|
+
listUserMemories(limit?: number): Promise<ListMemoriesResult>;
|
|
13
|
+
addMemory(content: string, containerTag: string, metadata?: {
|
|
14
|
+
type?: MemoryType;
|
|
15
|
+
tool?: string;
|
|
16
|
+
[key: string]: unknown;
|
|
17
|
+
}): Promise<AddMemoryResult>;
|
|
18
|
+
deleteMemory(memoryId: string): Promise<DeleteMemoryResult>;
|
|
19
|
+
listMemories(containerTag: string, limit?: number): Promise<ListMemoriesResult>;
|
|
20
|
+
ingestConversation(payload: IngestPayload): Promise<IngestConversationResult>;
|
|
21
|
+
getJobStatus(jobId: string): Promise<GetJobStatusResult>;
|
|
22
|
+
searchByMetadata(options: MetadataSearchOptions): Promise<SearchMemoriesResult>;
|
|
23
|
+
listGlobalMemories(limit?: number): Promise<ListMemoriesResult>;
|
|
24
|
+
listProjects(): Promise<ListProjectsResult>;
|
|
25
|
+
searchGlobal(query: string, options?: {
|
|
26
|
+
metadataFilters?: MetadataFilter[];
|
|
27
|
+
limit?: number;
|
|
28
|
+
}): Promise<SearchMemoriesResult>;
|
|
29
|
+
getTopics(containerTag: string, limit?: number): Promise<GetTopicsResult>;
|
|
30
|
+
}
|
|
31
|
+
export declare const solomemoryClient: SolomemoryClient;
|
|
32
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/services/client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,KAAK,EACV,eAAe,EACf,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,wBAAwB,EACxB,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,EACrB,aAAa,EACb,oBAAoB,EACrB,MAAM,mBAAmB,CAAC;AAqE3B,qBAAa,gBAAgB;IACrB,cAAc,CAClB,KAAK,EAAE,MAAM,EACb,YAAY,EAAE,MAAM,EACpB,OAAO,CAAC,EAAE;QAAE,eAAe,CAAC,EAAE,cAAc,EAAE,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAC/D,OAAO,CAAC,oBAAoB,CAAC;IAiB1B,UAAU,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAgBlD,kBAAkB,CACtB,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAC3B,OAAO,CAAC,oBAAoB,CAAC;IAkB1B,gBAAgB,CAAC,KAAK,SAAoB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAexE,SAAS,CACb,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,EACpB,QAAQ,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,UAAU,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,GACtE,OAAO,CAAC,eAAe,CAAC;IAerB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAc3D,YAAY,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,SAAoB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAgB1F,kBAAkB,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAe7E,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAWxD,gBAAgB,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAoB/E,kBAAkB,CAAC,KAAK,SAAoB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAgB1E,YAAY,IAAI,OAAO,CAAC,kBAAkB,CAAC;IAe3C,YAAY,CAChB,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE;QAAE,eAAe,CAAC,EAAE,cAAc,EAAE,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAC/D,OAAO,CAAC,oBAAoB,CAAC;IAgB1B,SAAS,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,SAAoB,GAAG,OAAO,CAAC,eAAe,CAAC;CAe3F;AAED,eAAO,MAAM,gBAAgB,kBAAyB,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { type SessionMessage } from "./messages.js";
|
|
2
|
+
export interface CompactionOptions {
|
|
3
|
+
threshold?: number;
|
|
4
|
+
getModelLimit?: (providerID: string, modelID: string) => number | undefined;
|
|
5
|
+
}
|
|
6
|
+
export interface CompactionContext {
|
|
7
|
+
directory: string;
|
|
8
|
+
client: {
|
|
9
|
+
session: {
|
|
10
|
+
summarize: (params: {
|
|
11
|
+
path: {
|
|
12
|
+
id: string;
|
|
13
|
+
};
|
|
14
|
+
body: {
|
|
15
|
+
providerID: string;
|
|
16
|
+
modelID: string;
|
|
17
|
+
};
|
|
18
|
+
query: {
|
|
19
|
+
directory: string;
|
|
20
|
+
};
|
|
21
|
+
}) => Promise<unknown>;
|
|
22
|
+
messages: (params: {
|
|
23
|
+
path: {
|
|
24
|
+
id: string;
|
|
25
|
+
};
|
|
26
|
+
query: {
|
|
27
|
+
directory: string;
|
|
28
|
+
};
|
|
29
|
+
}) => Promise<{
|
|
30
|
+
data?: SessionMessage[];
|
|
31
|
+
}>;
|
|
32
|
+
promptAsync: (params: {
|
|
33
|
+
path: {
|
|
34
|
+
id: string;
|
|
35
|
+
};
|
|
36
|
+
body: {
|
|
37
|
+
agent?: string;
|
|
38
|
+
parts: Array<{
|
|
39
|
+
type: string;
|
|
40
|
+
text: string;
|
|
41
|
+
}>;
|
|
42
|
+
};
|
|
43
|
+
query: {
|
|
44
|
+
directory: string;
|
|
45
|
+
};
|
|
46
|
+
}) => Promise<unknown>;
|
|
47
|
+
};
|
|
48
|
+
tui: {
|
|
49
|
+
showToast: (params: {
|
|
50
|
+
body: {
|
|
51
|
+
title: string;
|
|
52
|
+
message: string;
|
|
53
|
+
variant: string;
|
|
54
|
+
duration: number;
|
|
55
|
+
};
|
|
56
|
+
}) => Promise<unknown>;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
export declare function createCompactionHook(ctx: CompactionContext, tags: {
|
|
61
|
+
user: string;
|
|
62
|
+
project: string;
|
|
63
|
+
}, options?: CompactionOptions): {
|
|
64
|
+
event({ event }: {
|
|
65
|
+
event: {
|
|
66
|
+
type: string;
|
|
67
|
+
properties?: unknown;
|
|
68
|
+
};
|
|
69
|
+
}): Promise<void>;
|
|
70
|
+
};
|
|
71
|
+
//# sourceMappingURL=compaction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compaction.d.ts","sourceRoot":"","sources":["../../src/services/compaction.ts"],"names":[],"mappings":"AAOA,OAAO,EAA0C,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAuC5F,MAAM,WAAW,iBAAiB;IAChC,SAAS,CAAC,EA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AI,EAAE;oBAAE,KAAK,EAAE,MAAM,CAAC;oBAAC,OAAO,EAAE,MAAM,CAAC;oBAAC,OAAO,EAAE,MAAM,CAAC;oBAAC,QAAQ,EAAE,MAAM,CAAA;iBAAE,CAAA;aAAE,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;SAC1H,CAAC;KACH,CAAC;CACH;AAED,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,iBAAiB,EACtB,IAAI,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,EACvC,OAAO,CAAC,EAAE,iBAAiB;qBA6NF;QAAE,KAAK,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,UAAU,CAAC,EAAE,OAAO,CAAA;SAAE,CAAA;KAAE;EAgE3E"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
interface ProfileFact {
|
|
2
|
+
fact: string;
|
|
3
|
+
validAt?: string;
|
|
4
|
+
}
|
|
5
|
+
interface ProfileResponse {
|
|
6
|
+
profile: {
|
|
7
|
+
static: ProfileFact[];
|
|
8
|
+
dynamic: ProfileFact[];
|
|
9
|
+
} | null;
|
|
10
|
+
}
|
|
11
|
+
interface MemoryResultMinimal {
|
|
12
|
+
similarity: number;
|
|
13
|
+
memory?: string;
|
|
14
|
+
chunk?: string;
|
|
15
|
+
validAt?: string;
|
|
16
|
+
createdAt?: string;
|
|
17
|
+
}
|
|
18
|
+
interface MemoriesResponseMinimal {
|
|
19
|
+
results?: MemoryResultMinimal[];
|
|
20
|
+
}
|
|
21
|
+
interface TopicItem {
|
|
22
|
+
topic: string;
|
|
23
|
+
keywords?: string[];
|
|
24
|
+
createdAt?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare function formatContextForPrompt(profile: ProfileResponse | null, userMemories: MemoriesResponseMinimal, projectTopics: TopicItem[]): string;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/services/context.ts"],"names":[],"mappings":"AAYA,UAAU,WAAW;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,UAAU,eAAe;IACvB,OAAO,EAAE;QACP,MAAM,EAAE,WAAW,EAAE,CAAC;QACtB,OAAO,EAAE,WAAW,EAAE,CAAC;KACxB,GAAG,IAAI,CAAC;CACV;AAED,UAAU,mBAAmB;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,UAAU,uBAAuB;IAC/B,OAAO,CAAC,EAAE,mBAAmB,EAAE,CAAC;CACjC;AAED,UAAU,SAAS;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA+FD,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,eAAe,GAAG,IAAI,EAC/B,YAAY,EAAE,uBAAuB,EACrC,aAAa,EAAE,SAAS,EAAE,GACzB,MAAM,CA0BR"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Send a structured error report to the solomemory API.
|
|
3
|
+
*
|
|
4
|
+
* The API forwards it to Sentry server-side — DSN never leaves the server.
|
|
5
|
+
* This is fire-and-forget: errors in reporting are logged but never thrown.
|
|
6
|
+
*/
|
|
7
|
+
export declare function reportError(error: unknown, extra?: Record<string, unknown>): void;
|
|
8
|
+
//# sourceMappingURL=error-reporter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-reporter.d.ts","sourceRoot":"","sources":["../../src/services/error-reporter.ts"],"names":[],"mappings":"AAoCA;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAKjF"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Strips comments from JSONC content while respecting string boundaries.
|
|
3
|
+
* Handles // and /* comments, URLs in strings, and escaped quotes.
|
|
4
|
+
* Also removes trailing commas to support more relaxed JSONC format.
|
|
5
|
+
*/
|
|
6
|
+
export declare function stripJsoncComments(content: string): string;
|
|
7
|
+
//# sourceMappingURL=jsonc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsonc.d.ts","sourceRoot":"","sources":["../../src/services/jsonc.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AA8HH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAc1D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/services/logger.ts"],"names":[],"mappings":"AA6CA,wBAAgB,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI,CASzD"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Part } from "@opencode-ai/sdk";
|
|
2
|
+
export interface MessageInfo {
|
|
3
|
+
id: string;
|
|
4
|
+
role: string;
|
|
5
|
+
sessionID: string;
|
|
6
|
+
providerID?: string;
|
|
7
|
+
modelID?: string;
|
|
8
|
+
tokens?: {
|
|
9
|
+
input: number;
|
|
10
|
+
output: number;
|
|
11
|
+
cache: {
|
|
12
|
+
read: number;
|
|
13
|
+
write: number;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
summary?: boolean;
|
|
17
|
+
finish?: boolean | string;
|
|
18
|
+
time?: {
|
|
19
|
+
created: number;
|
|
20
|
+
completed?: number;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export interface SessionMessage {
|
|
24
|
+
info: MessageInfo;
|
|
25
|
+
parts: Part[];
|
|
26
|
+
}
|
|
27
|
+
export declare function extractTextFromParts(parts: Part[]): string;
|
|
28
|
+
export declare function extractToolInfoFromParts(parts: Part[]): {
|
|
29
|
+
tool: string;
|
|
30
|
+
state: string;
|
|
31
|
+
}[];
|
|
32
|
+
export declare function extractContentFromParts(parts: Part[]): string;
|
|
33
|
+
//# sourceMappingURL=messages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/services/messages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAE7C,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE;QACP,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,CAAC;KACxC,CAAC;IACF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC1B,IAAI,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAChD;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,WAAW,CAAC;IAClB,KAAK,EAAE,IAAI,EAAE,CAAC;CACf;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,MAAM,CAQ1D;AAgBD,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAAE,CAOzF;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,MAAM,CAS7D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"privacy.d.ts","sourceRoot":"","sources":["../../src/services/privacy.ts"],"names":[],"mappings":"AAAA,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAE3D;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAGvD"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export declare function getGitEmail(): string | null;
|
|
2
|
+
export declare function getGitRemoteOrigin(directory?: string): string | null;
|
|
3
|
+
export declare function getGitBranch(directory?: string): string | null;
|
|
4
|
+
export declare function getGitRepoRoot(directory?: string): string | null;
|
|
5
|
+
export declare function getGitAuthor(directory?: string): string | null;
|
|
6
|
+
export declare function getGitStatus(directory?: string): string | null;
|
|
7
|
+
export declare function parseRepoOwnerAndName(gitRemoteOrigin: string | null): {
|
|
8
|
+
owner: string | null;
|
|
9
|
+
name: string | null;
|
|
10
|
+
};
|
|
11
|
+
export declare function getOS(): string;
|
|
12
|
+
export declare function getNodeVersion(): string;
|
|
13
|
+
export declare function getTimezone(): string;
|
|
14
|
+
export declare function isMonorepo(directory: string): boolean;
|
|
15
|
+
export declare function detectLanguage(directory: string): string | null;
|
|
16
|
+
export declare function detectPackageManager(directory: string): string | null;
|
|
17
|
+
export declare function getParentDirName(directory: string): string;
|
|
18
|
+
export declare function getDirName(directory: string): string;
|
|
19
|
+
export declare function getMachineId(): string;
|
|
20
|
+
export declare function getRepositoryTag(directory: string): string | null;
|
|
21
|
+
export declare function getProjectTag(directory: string): string;
|
|
22
|
+
export declare function getBranchTag(directory: string): string | null;
|
|
23
|
+
export declare function getMachineTag(): string;
|
|
24
|
+
export declare function getWorkspaceTag(directory: string): string | null;
|
|
25
|
+
export declare function getPlatformTag(): string;
|
|
26
|
+
export declare function getSessionTag(sessionId: string): string;
|
|
27
|
+
export interface Tags {
|
|
28
|
+
project: string;
|
|
29
|
+
repository: string | null;
|
|
30
|
+
workspace: string | null;
|
|
31
|
+
branch: string | null;
|
|
32
|
+
machine: string;
|
|
33
|
+
platform: string;
|
|
34
|
+
}
|
|
35
|
+
export interface TagMetadata extends Tags {
|
|
36
|
+
gitRemoteOrigin: string | null;
|
|
37
|
+
gitBranch: string | null;
|
|
38
|
+
workspaceName: string | null;
|
|
39
|
+
workspaceType: string | null;
|
|
40
|
+
machineHostname: string;
|
|
41
|
+
}
|
|
42
|
+
export declare function getTags(directory: string): Tags;
|
|
43
|
+
export declare function getTagMetadata(directory: string): TagMetadata;
|
|
44
|
+
export interface ConversationTagsResult {
|
|
45
|
+
containerTags: string[];
|
|
46
|
+
metadata: TagMetadata & {
|
|
47
|
+
sessionTag: string;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
export declare function getConversationTags(tags: Tags, sessionId: string, directory: string): ConversationTagsResult;
|
|
51
|
+
//# sourceMappingURL=tags.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tags.d.ts","sourceRoot":"","sources":["../../src/services/tags.ts"],"names":[],"mappings":"AAwCA,wBAAgB,WAAW,IAAI,MAAM,GAAG,IAAI,CAE3C;AAED,wBAAgB,kBAAkB,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAiBpE;AAED,wBAAgB,YAAY,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAE9D;AAED,wBAAgB,cAAc,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAEhE;AA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AG,MAAM,CAEvD;AAMD,MAAM,WAAW,IAAI;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,WAAY,SAAQ,IAAI;IACvC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,wBAAgB,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAS/C;AAED,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,WAAW,CAa7D;AAMD,MAAM,WAAW,sBAAsB;IAErC,aAAa,EAAE,MAAM,EAAE,CAAC;IAGxB,QAAQ,EAAE,WAAW,GAAG;QACtB,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;CACH;AAED,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAChB,sBAAsB,CA6BxB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface WorkspaceInfo {
|
|
2
|
+
name: string;
|
|
3
|
+
root: string;
|
|
4
|
+
type: "npm" | "pnpm" | "bun" | "yarn" | "cargo" | "go" | "unknown";
|
|
5
|
+
}
|
|
6
|
+
export declare function getWorkspaceInfo(directory: string, gitRoot: string | null): WorkspaceInfo | null;
|
|
7
|
+
//# sourceMappingURL=workspace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../../src/services/workspace.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC;CACpE;AA0ID,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,aAAa,GAAG,IAAI,CAWhG"}
|
package/dist/state.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../src/state.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,aAAoB,CAAC"}
|
package/dist/sync.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
|
+
import type { Tags } from "./services/tags.js";
|
|
3
|
+
export interface ConversationSyncState {
|
|
4
|
+
lastSyncedMessageIndex: number;
|
|
5
|
+
conversationId: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const sessionSyncState: Map<string, ConversationSyncState>;
|
|
8
|
+
export interface SessionIdleInput {
|
|
9
|
+
sessionID: string;
|
|
10
|
+
ctx: PluginInput;
|
|
11
|
+
directory: string;
|
|
12
|
+
tags: Tags;
|
|
13
|
+
}
|
|
14
|
+
export declare function handleSessionCompacted(ctx: PluginInput, sessionID: string): Promise<void>;
|
|
15
|
+
export declare function handleSessionIdle(input: SessionIdleInput): Promise<void>;
|
|
16
|
+
//# sourceMappingURL=sync.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../src/sync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAOvD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAmB/C,MAAM,WAAW,qBAAqB;IACpC,sBAAsB,EAAE,MAAM,CAAC;IAC/B,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,gBAAgB,oCAA2C,CAAC;AA+FzE,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,WAAW,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,IAAI,CAAC;CACZ;AAwDD,wBAAsB,sBAAsB,CAAC,GAAG,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAO/F;AAED,wBAAsB,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAgC9E"}
|
package/dist/tools.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { MemoryScope } from "./types/index.js";
|
|
2
|
+
export interface ToolArgs {
|
|
3
|
+
mode?: string;
|
|
4
|
+
query?: string;
|
|
5
|
+
scope?: MemoryScope;
|
|
6
|
+
limit?: number;
|
|
7
|
+
path?: string;
|
|
8
|
+
containerTag?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function executeTool(args: ToolArgs, projectScopeTag: string): Promise<string>;
|
|
11
|
+
export declare const TOOL_DESCRIPTION = "Long-term memory system for user preferences, project knowledge, and past context. Memories are auto-saved from conversations.\n\nUSE THIS TOOL WHEN:\n- User asks \"what do you know about X\" or \"do you remember Y\"\n- You need context not in current conversation (past decisions, preferences, patterns)\n- Looking up project-specific conventions, build commands, or architecture decisions\n- Checking user's coding style, preferences, or expertise areas\n\nMODES:\n- search: Semantic search for relevant memories. Requires: query. Optional: scope, limit.\n- profile: User identity and preferences (static facts + recent context).\n- list: Browse all memories in scope (no search, just listing).\n- projects: List all known projects with their container tags and metadata.\n\nSCOPES:\n- project (default): This directory's knowledge - build commands, architecture, conventions.\n- user: Cross-project knowledge - coding style, preferences, expertise.\n- global: Search across ALL projects for the tenant - find knowledge from any project.\n\nCROSS-PROJECT:\n- Use path to search/list memories from a different local project directory.\n- Use containerTag to target a project by its tag (from projects mode output).\n- Use projects mode to discover available projects and their container tags.\n\nEXAMPLE: {mode: \"search\", query: \"how to run tests\", scope: \"project\"}\nEXAMPLE: {mode: \"search\", query: \"auth patterns\", scope: \"project\", path: \"/home/user/other-repo\"}\nEXAMPLE: {mode: \"projects\"}\nEXAMPLE: {mode: \"search\", query: \"db schema\", scope: \"project\", containerTag: \"opencode_repo_a1b2c3d4\"}";
|
|
12
|
+
//# sourceMappingURL=tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAMpD,MAAM,WAAW,QAAQ;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AA4ND,wBAAsB,WAAW,CAAC,IAAI,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAkC1F;AAED,eAAO,MAAM,gBAAgB,8lDA2B2E,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export type Result<T, E = string> = {
|
|
2
|
+
success: true;
|
|
3
|
+
data: T;
|
|
4
|
+
} | {
|
|
5
|
+
success: false;
|
|
6
|
+
error: E;
|
|
7
|
+
};
|
|
8
|
+
export type MemoryScope = "user" | "project" | "global";
|
|
9
|
+
export type MemoryType = "project-config" | "architecture" | "error-solution" | "preference" | "learned-pattern" | "conversation";
|
|
10
|
+
export interface Memory {
|
|
11
|
+
id: string;
|
|
12
|
+
summary: string;
|
|
13
|
+
title?: string;
|
|
14
|
+
content?: string;
|
|
15
|
+
metadata?: Record<string, unknown>;
|
|
16
|
+
createdAt?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface ConversationMessage {
|
|
19
|
+
role: string;
|
|
20
|
+
content: string;
|
|
21
|
+
}
|
|
22
|
+
export interface ConversationMetadata {
|
|
23
|
+
platform: string;
|
|
24
|
+
sessionId: string;
|
|
25
|
+
agent?: string;
|
|
26
|
+
model?: string;
|
|
27
|
+
directory?: string;
|
|
28
|
+
timestamp?: number;
|
|
29
|
+
[key: string]: string | number | boolean | undefined;
|
|
30
|
+
}
|
|
31
|
+
export interface ConversationIngestResponse {
|
|
32
|
+
id: string;
|
|
33
|
+
conversationId: string;
|
|
34
|
+
status: string;
|
|
35
|
+
message?: string;
|
|
36
|
+
}
|
|
37
|
+
export interface JobStatus {
|
|
38
|
+
id: string;
|
|
39
|
+
status: "pending" | "processing" | "completed" | "failed";
|
|
40
|
+
progress: number;
|
|
41
|
+
total: number;
|
|
42
|
+
message: string;
|
|
43
|
+
error: string | null;
|
|
44
|
+
createdAt: string;
|
|
45
|
+
updatedAt: string;
|
|
46
|
+
}
|
|
47
|
+
export interface MetadataFilter {
|
|
48
|
+
field: string;
|
|
49
|
+
value: string | number | boolean;
|
|
50
|
+
operator?: "eq" | "ne" | "contains";
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,MAAM,CAAC,CAAC,EAAE,CAAC,GAAG,MAAM,IAAI;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,CAAC,CAAA;CAAE,GAAG;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,CAAC,CAAA;CA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