teapot-coding-agent 0.15.4 → 0.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/agent/agent.js +18 -1
- package/dist/agent/tools.js +24 -2
- package/dist/server/api.js +3 -2
- package/package.json +1 -1
- package/public/assets/{index-BtzQpvLr.js → index-19jhnt7X.js} +7 -7
- package/public/assets/index-19jhnt7X.js.map +1 -0
- package/public/assets/index-mKmKGRRj.css +1 -0
- package/public/assets/{shiki-B7A2MCj6.js → shiki-BxccsPX4.js} +2 -2
- package/public/assets/{shiki-B7A2MCj6.js.map → shiki-BxccsPX4.js.map} +1 -1
- package/public/index.html +2 -2
- package/public/assets/index-BtzQpvLr.js.map +0 -1
- package/public/assets/index-eI4YBc_o.css +0 -1
package/dist/agent/agent.js
CHANGED
|
@@ -996,7 +996,24 @@ export class Agent {
|
|
|
996
996
|
if (call.function.name === "ask_user") {
|
|
997
997
|
const a = safeParse(call.function.arguments);
|
|
998
998
|
const question = String(a.question ?? "").slice(0, 2000);
|
|
999
|
-
|
|
999
|
+
// models sometimes pass objects ({label}, {option}, {value}) —
|
|
1000
|
+
// extract the label instead of rendering "[object Object]" buttons
|
|
1001
|
+
const options = Array.isArray(a.options)
|
|
1002
|
+
? a.options
|
|
1003
|
+
.slice(0, 6)
|
|
1004
|
+
.map((o) => {
|
|
1005
|
+
if (typeof o === "string")
|
|
1006
|
+
return o;
|
|
1007
|
+
if (o && typeof o === "object") {
|
|
1008
|
+
const obj = o;
|
|
1009
|
+
for (const k of ["label", "option", "choice", "value", "text"])
|
|
1010
|
+
if (typeof obj[k] === "string" && obj[k])
|
|
1011
|
+
return obj[k];
|
|
1012
|
+
}
|
|
1013
|
+
return "";
|
|
1014
|
+
})
|
|
1015
|
+
.filter((o) => o.trim())
|
|
1016
|
+
: [];
|
|
1000
1017
|
// the callId lets the UI tell "still open" from "already answered"
|
|
1001
1018
|
// (a settled tool_result for this id exists) and disable re-answering
|
|
1002
1019
|
await this.log.append("question", this.currentSession, this.currentBranch, {
|
package/dist/agent/tools.js
CHANGED
|
@@ -951,7 +951,26 @@ export const TOOLS = [
|
|
|
951
951
|
const content = str(args.content);
|
|
952
952
|
if (!content.trim())
|
|
953
953
|
return { ok: false, result: "content required" };
|
|
954
|
-
|
|
954
|
+
// save GLOBALLY (config dir) so skills survive workspace switches and
|
|
955
|
+
// are shared by every agent. Same-name handling is safe:
|
|
956
|
+
// · overwriting the global copy replaces it atomically (writeFile)
|
|
957
|
+
// · a same-name skill in a HIGHER-priority root (workspace) still
|
|
958
|
+
// shadows this one at load time — that's the intended override,
|
|
959
|
+
// so tell the model when its save would be invisible
|
|
960
|
+
const globalRoot = roots.find((r) => r.source === "global") ?? roots[0];
|
|
961
|
+
const filePath = await saveSkill(globalRoot.dir, name, description, content.slice(0, 64_000));
|
|
962
|
+
let note = "";
|
|
963
|
+
for (const r of roots) {
|
|
964
|
+
if (r === globalRoot || r.source === "bundled")
|
|
965
|
+
continue;
|
|
966
|
+
if (r.source !== "global" && roots.indexOf(r) < roots.indexOf(globalRoot)) {
|
|
967
|
+
try {
|
|
968
|
+
await fs.access(path.join(r.dir, name, SKILL_FILE));
|
|
969
|
+
note = ` (note: a workspace skill with the same name "${name}" takes precedence at load time)`;
|
|
970
|
+
}
|
|
971
|
+
catch { /* no clash in this root */ }
|
|
972
|
+
}
|
|
973
|
+
}
|
|
955
974
|
// bundled scripts/files next to SKILL.md
|
|
956
975
|
const written = [];
|
|
957
976
|
const rawFiles = Array.isArray(args.files) ? args.files : [];
|
|
@@ -969,7 +988,10 @@ export const TOOLS = [
|
|
|
969
988
|
written.push(fname);
|
|
970
989
|
}
|
|
971
990
|
const extra = written.length ? `\nbundled files: ${written.join(", ")}` : "";
|
|
972
|
-
return {
|
|
991
|
+
return {
|
|
992
|
+
ok: true,
|
|
993
|
+
result: `saved skill "${name}" globally to ${filePath}${extra}${note} (listed from next turn; overwrite-safe)`,
|
|
994
|
+
};
|
|
973
995
|
},
|
|
974
996
|
},
|
|
975
997
|
];
|
package/dist/server/api.js
CHANGED
|
@@ -177,8 +177,9 @@ export function buildApp(master) {
|
|
|
177
177
|
}
|
|
178
178
|
};
|
|
179
179
|
const cur = termCounts.get(agentId) ?? 0;
|
|
180
|
-
if (cur >=
|
|
181
|
-
|
|
180
|
+
if (cur >= 10) {
|
|
181
|
+
// soft safeguard only — the UI allows up to 10 tabs per agent
|
|
182
|
+
send({ kind: "exit", error: "too many terminals for this agent (max 10)" });
|
|
182
183
|
return;
|
|
183
184
|
}
|
|
184
185
|
termCounts.set(agentId, cur + 1);
|