@magpie-community/opencode-zen-free-auth 0.1.10 → 0.1.11
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/README.md +8 -5
- package/package.json +1 -1
- package/tool-response.mjs +13 -9
package/README.md
CHANGED
|
@@ -56,15 +56,18 @@ The agent's tools are preserved. Zen's models often call OpenCode's own
|
|
|
56
56
|
tool names; such a call is given the agent's tool whose name differs only
|
|
57
57
|
in case (`bash` to `Bash`), or else only in case and `_`/`-` (`todowrite`
|
|
58
58
|
to `todo_write`, `webfetch` to `web_fetch`), when exactly one does. A
|
|
59
|
-
call
|
|
60
|
-
the
|
|
61
|
-
|
|
59
|
+
call of a tool the agent has no spelling of (`psh` beside `pwsh`, `bedit`)
|
|
60
|
+
reaches the agent as the model called it, as with any other provider: the
|
|
61
|
+
agent answers it with its own unknown-tool error, and the model corrects
|
|
62
|
+
the name and goes on. Only a call with no name is left out, and the
|
|
63
|
+
reply's text says so; a turn whose every call was left out ends as an
|
|
64
|
+
ordinary answer. Tools run in the agent.
|
|
62
65
|
|
|
63
66
|
Zen's free tier only answers a request that carries tools, so a request
|
|
64
67
|
is sent with the five core OpenCode tools the agent doesn't declare
|
|
65
68
|
itself (`bash`, `edit`, `glob`, `grep`, `read`), described as not
|
|
66
|
-
available. A call of one of them the agent doesn't have
|
|
67
|
-
any other.
|
|
69
|
+
available. A call of one of them the agent doesn't have reaches the agent
|
|
70
|
+
like any other.
|
|
68
71
|
|
|
69
72
|
Now and then Zen closes a streamed Chat Completions reply before its
|
|
70
73
|
`[DONE]`. When the reply has said something and no tool call of it is
|
package/package.json
CHANGED
package/tool-response.mjs
CHANGED
|
@@ -48,8 +48,13 @@ function foldsTo(declared, key) {
|
|
|
48
48
|
return folded;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
// nameGuard answers the agent's name for a call
|
|
52
|
-
//
|
|
51
|
+
// nameGuard answers the agent's name for a call: the agent's spelling when
|
|
52
|
+
// one folds to it, else the name as the model wrote it. A call of a tool
|
|
53
|
+
// the agent doesn't have (bedit, psh, mcp__netcatcatty__unused) goes to the
|
|
54
|
+
// agent as called, like any other provider's: the agent answers it with
|
|
55
|
+
// its own unknown-tool error, and the model corrects the name and goes on
|
|
56
|
+
// (#209). Leaving it out ended an agent's turn as a plain answer. Only a
|
|
57
|
+
// call with no name answers null, and is left out.
|
|
53
58
|
function nameGuard(policy) {
|
|
54
59
|
const declared = new Set(policy.declared);
|
|
55
60
|
const lower = (name) => name.toLowerCase();
|
|
@@ -61,16 +66,15 @@ function nameGuard(policy) {
|
|
|
61
66
|
if (declared.has(name)) return name;
|
|
62
67
|
const match =
|
|
63
68
|
byCase.get(lower(name)) ?? (byCase.has(lower(name)) ? null : byShape.get(bare(name)));
|
|
64
|
-
return match ||
|
|
69
|
+
return match || name;
|
|
65
70
|
};
|
|
66
71
|
}
|
|
67
72
|
|
|
68
|
-
//
|
|
69
|
-
//
|
|
70
|
-
//
|
|
71
|
-
//
|
|
72
|
-
//
|
|
73
|
-
// with no call ends as a plain stop.
|
|
73
|
+
// A call with no name can't be answered by any agent, and failing the
|
|
74
|
+
// reply for it threw away the whole turn (#76). It is left out instead,
|
|
75
|
+
// and the reply says so in its text, where the agent's user and the
|
|
76
|
+
// model's next turn both read it. A reply left with no call ends as a
|
|
77
|
+
// plain stop.
|
|
74
78
|
export function droppedNote(name) {
|
|
75
79
|
return typeof name === "string" && name
|
|
76
80
|
? `(The model called a tool this agent doesn't have: ${JSON.stringify(name.slice(0, 128))}. The call was left out.)`
|