oh-my-opencode-kikokikok 2.15.5 → 2.15.6
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 +1 -1
- package/dist/index.js +5 -17
- package/package.json +1 -1
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.6",
|
|
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",
|
package/dist/index.js
CHANGED
|
@@ -43846,10 +43846,7 @@ class LettaAdapter {
|
|
|
43846
43846
|
})
|
|
43847
43847
|
});
|
|
43848
43848
|
const data = await response2.json();
|
|
43849
|
-
console.log("[LettaAdapter.add] Raw API response:", JSON.stringify(data, null, 2));
|
|
43850
43849
|
const passage = Array.isArray(data) ? data[0] : data;
|
|
43851
|
-
console.log("[LettaAdapter.add] Extracted passage:", JSON.stringify(passage, null, 2));
|
|
43852
|
-
console.log("[LettaAdapter.add] passage.id:", passage?.id);
|
|
43853
43850
|
return this.passageToMemory(passage, input.layer, agent.id);
|
|
43854
43851
|
}
|
|
43855
43852
|
async search(input) {
|
|
@@ -44004,20 +44001,16 @@ class LettaAdapter {
|
|
|
44004
44001
|
}
|
|
44005
44002
|
}
|
|
44006
44003
|
async getOrCreateAgent(layer) {
|
|
44007
|
-
console.log(`[LettaAdapter.getOrCreateAgent] Looking for agent for layer: ${layer}`);
|
|
44008
44004
|
const existing = await this.getAgent(layer);
|
|
44009
44005
|
if (existing) {
|
|
44010
|
-
console.log(`[LettaAdapter.getOrCreateAgent] Found existing agent: ${existing.id} (${existing.name})`);
|
|
44011
44006
|
const needsUpdate = await this.agentNeedsEmbeddingUpdate(existing);
|
|
44012
44007
|
if (needsUpdate) {
|
|
44013
44008
|
return this.recreateAgentWithCorrectEmbedding(existing, layer);
|
|
44014
44009
|
}
|
|
44015
44010
|
return existing;
|
|
44016
44011
|
}
|
|
44017
|
-
console.log(`[LettaAdapter.getOrCreateAgent] No existing agent, creating new one for layer: ${layer}`);
|
|
44018
44012
|
const embeddingModel = await this.detectEmbeddingModel();
|
|
44019
44013
|
const agentName = this.getAgentName(layer);
|
|
44020
|
-
console.log(`[LettaAdapter.getOrCreateAgent] Creating agent with name: ${agentName}, embedding: ${embeddingModel}`);
|
|
44021
44014
|
const response2 = await this.request("/v1/agents", {
|
|
44022
44015
|
method: "POST",
|
|
44023
44016
|
body: JSON.stringify({
|
|
@@ -44036,7 +44029,6 @@ class LettaAdapter {
|
|
|
44036
44029
|
})
|
|
44037
44030
|
});
|
|
44038
44031
|
const agent = await response2.json();
|
|
44039
|
-
console.log(`[LettaAdapter.getOrCreateAgent] Created agent: ${agent.id} (${agent.name})`);
|
|
44040
44032
|
this.agentCache.set(layer, agent);
|
|
44041
44033
|
return agent;
|
|
44042
44034
|
}
|
|
@@ -44101,17 +44093,17 @@ class LettaAdapter {
|
|
|
44101
44093
|
}
|
|
44102
44094
|
}
|
|
44103
44095
|
async request(path7, options) {
|
|
44096
|
+
const basePath = path7.split("?")[0];
|
|
44097
|
+
const queryString = path7.includes("?") ? path7.slice(path7.indexOf("?")) : "";
|
|
44098
|
+
const normalizedBase = basePath.endsWith("/") ? basePath : `${basePath}/`;
|
|
44099
|
+
const normalizedPath = `${normalizedBase}${queryString}`;
|
|
44104
44100
|
const headers = {
|
|
44105
44101
|
"Content-Type": "application/json"
|
|
44106
44102
|
};
|
|
44107
44103
|
if (this.config.apiKey) {
|
|
44108
44104
|
headers["Authorization"] = `Bearer ${this.config.apiKey}`;
|
|
44109
44105
|
}
|
|
44110
|
-
|
|
44111
|
-
if (options.body) {
|
|
44112
|
-
console.log(`[LettaAdapter.request] Body: ${options.body.slice(0, 500)}`);
|
|
44113
|
-
}
|
|
44114
|
-
const response2 = await fetch(`${this.endpoint}${path7}`, {
|
|
44106
|
+
const response2 = await fetch(`${this.endpoint}${normalizedPath}`, {
|
|
44115
44107
|
method: options.method,
|
|
44116
44108
|
headers,
|
|
44117
44109
|
body: options.body,
|
|
@@ -44119,7 +44111,6 @@ class LettaAdapter {
|
|
|
44119
44111
|
});
|
|
44120
44112
|
if (!response2.ok) {
|
|
44121
44113
|
const text = await response2.text().catch(() => "");
|
|
44122
|
-
console.log(`[LettaAdapter.request] Error ${response2.status}: ${text}`);
|
|
44123
44114
|
throw new Error(`Letta API error: ${response2.status} ${response2.statusText} - ${text}`);
|
|
44124
44115
|
}
|
|
44125
44116
|
return response2;
|
|
@@ -44156,9 +44147,6 @@ class LettaAdapter {
|
|
|
44156
44147
|
return ["user", "session", "project", "team", "org", "company", "agent"];
|
|
44157
44148
|
}
|
|
44158
44149
|
passageToMemory(passage, layer, agentId) {
|
|
44159
|
-
console.log("[LettaAdapter.passageToMemory] Input passage keys:", Object.keys(passage || {}));
|
|
44160
|
-
console.log("[LettaAdapter.passageToMemory] passage.id:", passage?.id);
|
|
44161
|
-
console.log("[LettaAdapter.passageToMemory] passage.text:", passage?.text?.slice(0, 50));
|
|
44162
44150
|
return {
|
|
44163
44151
|
id: passage.id,
|
|
44164
44152
|
content: passage.text,
|