@chatpanel/events 0.78.1 → 0.78.3
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/package.json +1 -1
- package/team-tool.js +7 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chatpanel/events",
|
|
3
|
-
"version": "0.78.
|
|
3
|
+
"version": "0.78.3",
|
|
4
4
|
"description": "The canonical ChatPanel event-log and capability contracts \u2014 typed durable facts, clock-free deterministic linearization, schema upcasting, and the invariants the replay harness asserts. Pure, dependency-free ESM shared by the ChatPanel extension, gateway and bridge.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
package/team-tool.js
CHANGED
|
@@ -66,12 +66,17 @@ const json = (v) => JSON.stringify(v);
|
|
|
66
66
|
* @param saveTeam `async (team) => void`
|
|
67
67
|
*/
|
|
68
68
|
export function teamToolProvider({ teams = [], run = null, appoint = null, confirmSave = null, saveTeam = null } = {}) {
|
|
69
|
-
|
|
69
|
+
// A record another client half-wrote (a name and nothing else) is not a team: it is
|
|
70
|
+
// neither offered to the model nor runnable, and Settings shows it for deleting.
|
|
71
|
+
const byName = new Map((teams || []).filter((t) => t?.name && t.enabled !== false && validateTeam(t).ok).map((t) => [t.name, t]));
|
|
70
72
|
let bound = null;
|
|
71
73
|
return {
|
|
72
74
|
id: 'team',
|
|
73
75
|
specs: [teamToolSpec(teams)],
|
|
74
|
-
system:
|
|
76
|
+
system: [
|
|
77
|
+
byName.size ? 'Saved agent teams exist (see the `team` tool). When a request is broad enough that several roles would do it better — research plus writing, several sources to reconcile — run the matching team rather than doing it all in one turn.' : '',
|
|
78
|
+
(confirmSave && saveTeam) ? 'When the user asks to create, make, set up or save a team (of agents / roles), do not run one: call the `team` tool with {"action":"save","team":{…}} — pick roles, prompts, grants and a budget from what they said, and ask only for what you cannot infer. The user approves it on a card.' : '',
|
|
79
|
+
].filter(Boolean).join(' '),
|
|
75
80
|
bind(toolset) { bound = toolset; },
|
|
76
81
|
async execute(name, input) {
|
|
77
82
|
if (name !== TEAM_TOOL_NAME) return json({ error: `Unknown tool: ${name}` });
|