oh-my-opencode-kikokikok 2.15.6 → 2.15.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/dist/cli/index.js
CHANGED
|
@@ -2253,7 +2253,7 @@ var require_picocolors = __commonJS((exports, module) => {
|
|
|
2253
2253
|
var require_package = __commonJS((exports, module) => {
|
|
2254
2254
|
module.exports = {
|
|
2255
2255
|
name: "oh-my-opencode-kikokikok",
|
|
2256
|
-
version: "2.15.
|
|
2256
|
+
version: "2.15.8",
|
|
2257
2257
|
description: "OpenCode plugin - custom agents (oracle, librarian) and enhanced features",
|
|
2258
2258
|
main: "dist/index.js",
|
|
2259
2259
|
types: "dist/index.d.ts",
|
|
@@ -7,6 +7,7 @@ export declare class LettaAdapter {
|
|
|
7
7
|
private modelDetectionPromise;
|
|
8
8
|
constructor(config: LettaConfig);
|
|
9
9
|
private detectEmbeddingModel;
|
|
10
|
+
private normalizeModelHandle;
|
|
10
11
|
add(input: AddMemoryInput): Promise<Memory>;
|
|
11
12
|
search(input: SearchMemoryInput): Promise<MemorySearchResult[]>;
|
|
12
13
|
get(id: string): Promise<Memory | null>;
|
package/dist/index.js
CHANGED
|
@@ -43796,7 +43796,7 @@ class LettaAdapter {
|
|
|
43796
43796
|
}
|
|
43797
43797
|
async detectEmbeddingModel() {
|
|
43798
43798
|
if (this.config.embeddingModel) {
|
|
43799
|
-
return this.config.embeddingModel;
|
|
43799
|
+
return this.normalizeModelHandle(this.config.embeddingModel);
|
|
43800
43800
|
}
|
|
43801
43801
|
if (this.detectedEmbeddingModel) {
|
|
43802
43802
|
return this.detectedEmbeddingModel;
|
|
@@ -43821,13 +43821,19 @@ class LettaAdapter {
|
|
|
43821
43821
|
const preferredName = this.config.preferredEmbeddingModel ?? "text-embedding-3-small";
|
|
43822
43822
|
const preferred = proxyEmbeddingModels.find((m) => m.name.includes(preferredName));
|
|
43823
43823
|
const model = preferred ?? proxyEmbeddingModels[0];
|
|
43824
|
-
this.detectedEmbeddingModel =
|
|
43824
|
+
this.detectedEmbeddingModel = model.handle;
|
|
43825
43825
|
}
|
|
43826
43826
|
} catch {}
|
|
43827
43827
|
})();
|
|
43828
43828
|
await this.modelDetectionPromise;
|
|
43829
43829
|
return this.detectedEmbeddingModel ?? DEFAULT_EMBEDDING_MODEL;
|
|
43830
43830
|
}
|
|
43831
|
+
normalizeModelHandle(model) {
|
|
43832
|
+
if (model.startsWith("openai/") && !model.startsWith("openai-proxy/")) {
|
|
43833
|
+
return model.replace("openai/", "openai-proxy/");
|
|
43834
|
+
}
|
|
43835
|
+
return model;
|
|
43836
|
+
}
|
|
43831
43837
|
async add(input) {
|
|
43832
43838
|
if (!this.config.enabled) {
|
|
43833
43839
|
throw new Error("Letta is not enabled");
|
|
@@ -44010,12 +44016,13 @@ class LettaAdapter {
|
|
|
44010
44016
|
return existing;
|
|
44011
44017
|
}
|
|
44012
44018
|
const embeddingModel = await this.detectEmbeddingModel();
|
|
44019
|
+
const llmModel = this.normalizeModelHandle(this.config.llmModel ?? DEFAULT_LLM_MODEL);
|
|
44013
44020
|
const agentName = this.getAgentName(layer);
|
|
44014
44021
|
const response2 = await this.request("/v1/agents", {
|
|
44015
44022
|
method: "POST",
|
|
44016
44023
|
body: JSON.stringify({
|
|
44017
44024
|
name: agentName,
|
|
44018
|
-
model:
|
|
44025
|
+
model: llmModel,
|
|
44019
44026
|
embedding: embeddingModel,
|
|
44020
44027
|
memory_blocks: [
|
|
44021
44028
|
{ label: "persona", value: `OpenCode memory agent for ${layer} layer` },
|
|
@@ -44049,12 +44056,13 @@ class LettaAdapter {
|
|
|
44049
44056
|
await this.request(`/v1/agents/${existingAgent.id}`, { method: "DELETE" }).catch(() => {});
|
|
44050
44057
|
this.agentCache.delete(layer);
|
|
44051
44058
|
const embeddingModel = await this.detectEmbeddingModel();
|
|
44059
|
+
const llmModel = this.normalizeModelHandle(this.config.llmModel ?? DEFAULT_LLM_MODEL);
|
|
44052
44060
|
const agentName = this.getAgentName(layer);
|
|
44053
44061
|
const response2 = await this.request("/v1/agents", {
|
|
44054
44062
|
method: "POST",
|
|
44055
44063
|
body: JSON.stringify({
|
|
44056
44064
|
name: agentName,
|
|
44057
|
-
model:
|
|
44065
|
+
model: llmModel,
|
|
44058
44066
|
embedding: embeddingModel,
|
|
44059
44067
|
memory_blocks: [
|
|
44060
44068
|
{ label: "persona", value: `OpenCode memory agent for ${layer} layer` },
|
|
@@ -44095,7 +44103,8 @@ class LettaAdapter {
|
|
|
44095
44103
|
async request(path7, options) {
|
|
44096
44104
|
const basePath = path7.split("?")[0];
|
|
44097
44105
|
const queryString = path7.includes("?") ? path7.slice(path7.indexOf("?")) : "";
|
|
44098
|
-
const
|
|
44106
|
+
const isSearchEndpoint = basePath.endsWith("/search");
|
|
44107
|
+
const normalizedBase = isSearchEndpoint ? basePath : basePath.endsWith("/") ? basePath : `${basePath}/`;
|
|
44099
44108
|
const normalizedPath = `${normalizedBase}${queryString}`;
|
|
44100
44109
|
const headers = {
|
|
44101
44110
|
"Content-Type": "application/json"
|