@bike4mind/cli 0.2.57-feat-cli-tavern-integration.21481 → 0.2.57-feat-cli-tavern-integration.21486

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.
@@ -3,7 +3,7 @@
3
3
  // package.json
4
4
  var package_default = {
5
5
  name: "@bike4mind/cli",
6
- version: "0.2.57-feat-cli-tavern-integration.21481+e8cc92a39",
6
+ version: "0.2.57-feat-cli-tavern-integration.21486+6d714e8cb",
7
7
  type: "module",
8
8
  description: "Interactive CLI tool for Bike4Mind with ReAct agents",
9
9
  license: "UNLICENSED",
@@ -118,11 +118,11 @@ var package_default = {
118
118
  zustand: "^4.5.4"
119
119
  },
120
120
  devDependencies: {
121
- "@bike4mind/agents": "0.2.2-feat-cli-tavern-integration.21481+e8cc92a39",
122
- "@bike4mind/common": "2.70.2-feat-cli-tavern-integration.21481+e8cc92a39",
123
- "@bike4mind/mcp": "1.33.16-feat-cli-tavern-integration.21481+e8cc92a39",
124
- "@bike4mind/services": "2.64.4-feat-cli-tavern-integration.21481+e8cc92a39",
125
- "@bike4mind/utils": "2.15.10-feat-cli-tavern-integration.21481+e8cc92a39",
121
+ "@bike4mind/agents": "0.2.2-feat-cli-tavern-integration.21486+6d714e8cb",
122
+ "@bike4mind/common": "2.70.2-feat-cli-tavern-integration.21486+6d714e8cb",
123
+ "@bike4mind/mcp": "1.33.16-feat-cli-tavern-integration.21486+6d714e8cb",
124
+ "@bike4mind/services": "2.64.4-feat-cli-tavern-integration.21486+6d714e8cb",
125
+ "@bike4mind/utils": "2.15.10-feat-cli-tavern-integration.21486+6d714e8cb",
126
126
  "@types/better-sqlite3": "^7.6.13",
127
127
  "@types/jsonwebtoken": "^9.0.4",
128
128
  "@types/node": "^22.9.0",
@@ -139,7 +139,7 @@ var package_default = {
139
139
  optionalDependencies: {
140
140
  "@vscode/ripgrep": "^1.17.1"
141
141
  },
142
- gitHead: "e8cc92a39955c85d92df49e5eb1bde33cb182f5a"
142
+ gitHead: "6d714e8cbc82d118ce37d8339fe6916ac5e209c3"
143
143
  };
144
144
 
145
145
  // src/utils/updateChecker.ts
@@ -467,6 +467,11 @@ var COMMANDS = [
467
467
  description: "Compact conversation into new session",
468
468
  args: "[instructions]"
469
469
  },
470
+ // Tavern commands
471
+ {
472
+ name: "tavern",
473
+ description: "Show recent Tavern agent activity stream"
474
+ },
470
475
  // Sandbox commands
471
476
  {
472
477
  name: "sandbox",
@@ -3,7 +3,7 @@ import {
3
3
  fetchLatestVersion,
4
4
  forceCheckForUpdate,
5
5
  package_default
6
- } from "../chunk-TIXFJHXS.js";
6
+ } from "../chunk-4O2FO5KZ.js";
7
7
 
8
8
  // src/commands/doctorCommand.ts
9
9
  import { execSync } from "child_process";
@@ -36,7 +36,7 @@ import {
36
36
  isReadOnlyTool,
37
37
  loadContextFiles,
38
38
  setWebSocketToolExecutor
39
- } from "../chunk-PJ3VATSD.js";
39
+ } from "../chunk-N4LOBIJ6.js";
40
40
  import "../chunk-BDQBOLYG.js";
41
41
  import "../chunk-XACIOJZ7.js";
42
42
  import "../chunk-GQGOWACU.js";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  forceCheckForUpdate,
4
4
  package_default
5
- } from "../chunk-TIXFJHXS.js";
5
+ } from "../chunk-4O2FO5KZ.js";
6
6
 
7
7
  // src/commands/updateCommand.ts
8
8
  import { execSync } from "child_process";
package/dist/index.js CHANGED
@@ -48,7 +48,7 @@ import {
48
48
  setWebSocketToolExecutor,
49
49
  substituteArguments,
50
50
  warmFileCache
51
- } from "./chunk-PJ3VATSD.js";
51
+ } from "./chunk-N4LOBIJ6.js";
52
52
  import "./chunk-BDQBOLYG.js";
53
53
  import "./chunk-XACIOJZ7.js";
54
54
  import "./chunk-GQGOWACU.js";
@@ -66,7 +66,7 @@ import {
66
66
  import {
67
67
  checkForUpdate,
68
68
  package_default
69
- } from "./chunk-TIXFJHXS.js";
69
+ } from "./chunk-4O2FO5KZ.js";
70
70
  import {
71
71
  selectActiveBackgroundAgents,
72
72
  useCliStore
@@ -2761,6 +2761,12 @@ var TavernService = class {
2761
2761
  async createAgent(request) {
2762
2762
  return this.apiClient.post("/api/agents", request);
2763
2763
  }
2764
+ async updateAgent(agentId, request) {
2765
+ return this.apiClient.put(`/api/agents/${agentId}`, request);
2766
+ }
2767
+ async deleteAgent(agentId) {
2768
+ await this.apiClient.delete(`/api/agents/${agentId}`);
2769
+ }
2764
2770
  async mentionAgent(agentName, message, config) {
2765
2771
  return this.apiClient.post("/api/tavern/mention", {
2766
2772
  agentName,
@@ -2863,6 +2869,12 @@ var CreateAgentResponseSchema = z.object({
2863
2869
  name: z.string(),
2864
2870
  description: z.string().optional()
2865
2871
  });
2872
+ var UpdateAgentRequestSchema = CreateAgentRequestSchema.partial().extend({
2873
+ heartbeatConfig: z.object({
2874
+ enabled: z.boolean().optional(),
2875
+ intervalMinutes: z.number().optional()
2876
+ }).optional()
2877
+ });
2866
2878
  var AgentSummarySchema = z.object({
2867
2879
  _id: z.string(),
2868
2880
  name: z.string(),
@@ -3008,6 +3020,8 @@ function createTavernTools(service) {
3008
3020
  return [
3009
3021
  createListAgentsTool(service),
3010
3022
  createCreateAgentTool(service),
3023
+ createEditAgentTool(service),
3024
+ createDeleteAgentTool(service),
3011
3025
  createMentionTool(service),
3012
3026
  createListQuestsTool(service),
3013
3027
  createPostQuestTool(service),
@@ -3017,7 +3031,8 @@ function createTavernTools(service) {
3017
3031
  createResolveGateTool(service),
3018
3032
  createToggleHeartbeatsTool(service),
3019
3033
  createTriggerHeartbeatTool(service),
3020
- createAbortHeartbeatsTool(service)
3034
+ createAbortHeartbeatsTool(service),
3035
+ createStatusTool(service)
3021
3036
  ];
3022
3037
  }
3023
3038
  function createListAgentsTool(service) {
@@ -3134,6 +3149,93 @@ function createCreateAgentTool(service) {
3134
3149
  }
3135
3150
  };
3136
3151
  }
3152
+ function createEditAgentTool(service) {
3153
+ return {
3154
+ toolSchema: {
3155
+ name: "tavern_edit_agent",
3156
+ description: "Update an existing Tavern agent. Can change personality, system prompt, heartbeat config, or any other field. Use this to enable/disable heartbeats for a SINGLE agent (set heartbeat_enabled), or to update personality traits. Only provide fields you want to change \u2014 unspecified fields remain unchanged.",
3157
+ parameters: {
3158
+ type: "object",
3159
+ properties: {
3160
+ agent_id: {
3161
+ type: "string",
3162
+ description: "The MongoDB ObjectId of the agent (get from tavern_list_agents)"
3163
+ },
3164
+ name: { type: "string", description: "New agent name" },
3165
+ description: { type: "string", description: "New description" },
3166
+ system_prompt: { type: "string", description: "New system prompt" },
3167
+ heartbeat_enabled: {
3168
+ type: "boolean",
3169
+ description: "Enable or disable heartbeats for THIS specific agent"
3170
+ },
3171
+ heartbeat_interval_minutes: {
3172
+ type: "number",
3173
+ description: "Heartbeat interval in minutes (default: 3)"
3174
+ },
3175
+ major_motivation: { type: "string", description: "What primarily drives this agent" },
3176
+ minor_motivation: { type: "string", description: "Secondary drive" },
3177
+ flaw: { type: "string", description: "Character flaw" },
3178
+ quirk: { type: "string", description: "Distinctive quirk" },
3179
+ personal_mission: { type: "string", description: "Agent's purpose in the tavern" },
3180
+ active_project: { type: "string", description: "What the agent is currently working on" },
3181
+ communication_pattern: { type: "string", description: "How the agent communicates" },
3182
+ humor_style: { type: "string", description: "Agent's sense of humor" }
3183
+ },
3184
+ required: ["agent_id"]
3185
+ }
3186
+ },
3187
+ toolFn: async (params) => {
3188
+ const raw = params;
3189
+ const agentId = raw.agent_id;
3190
+ const payload = {};
3191
+ if (raw.name) payload.name = raw.name;
3192
+ if (raw.description) payload.description = raw.description;
3193
+ if (raw.system_prompt) payload.systemPrompt = raw.system_prompt;
3194
+ if (raw.heartbeat_enabled !== void 0 || raw.heartbeat_interval_minutes !== void 0) {
3195
+ const hb = {};
3196
+ if (raw.heartbeat_enabled !== void 0) hb.enabled = raw.heartbeat_enabled;
3197
+ if (raw.heartbeat_interval_minutes !== void 0) hb.intervalMinutes = raw.heartbeat_interval_minutes;
3198
+ payload.heartbeatConfig = hb;
3199
+ }
3200
+ const personality = {};
3201
+ if (raw.major_motivation) personality.majorMotivation = raw.major_motivation;
3202
+ if (raw.minor_motivation) personality.minorMotivation = raw.minor_motivation;
3203
+ if (raw.flaw) personality.flaw = raw.flaw;
3204
+ if (raw.quirk) personality.quirk = raw.quirk;
3205
+ if (raw.personal_mission) personality.personalMission = raw.personal_mission;
3206
+ if (raw.active_project) personality.activeProject = raw.active_project;
3207
+ if (raw.communication_pattern) personality.communicationPattern = raw.communication_pattern;
3208
+ if (raw.humor_style) personality.humorStyle = raw.humor_style;
3209
+ if (Object.keys(personality).length > 0) payload.personality = personality;
3210
+ const request = UpdateAgentRequestSchema.parse(payload);
3211
+ const result = await service.updateAgent(agentId, request);
3212
+ return JSON.stringify(result);
3213
+ }
3214
+ };
3215
+ }
3216
+ function createDeleteAgentTool(service) {
3217
+ return {
3218
+ toolSchema: {
3219
+ name: "tavern_delete_agent",
3220
+ description: "Permanently delete a Tavern agent. This is irreversible. IMPORTANT: agent_id must be a MongoDB ObjectId from tavern_list_agents.",
3221
+ parameters: {
3222
+ type: "object",
3223
+ properties: {
3224
+ agent_id: {
3225
+ type: "string",
3226
+ description: "The MongoDB ObjectId of the agent to delete"
3227
+ }
3228
+ },
3229
+ required: ["agent_id"]
3230
+ }
3231
+ },
3232
+ toolFn: async (params) => {
3233
+ const { agent_id } = params;
3234
+ await service.deleteAgent(agent_id);
3235
+ return JSON.stringify({ success: true, message: `Agent ${agent_id} deleted` });
3236
+ }
3237
+ };
3238
+ }
3137
3239
  function createMentionTool(service) {
3138
3240
  return {
3139
3241
  toolSchema: {
@@ -3380,6 +3482,47 @@ function createAbortHeartbeatsTool(service) {
3380
3482
  }
3381
3483
  };
3382
3484
  }
3485
+ function createStatusTool(service) {
3486
+ return {
3487
+ toolSchema: {
3488
+ name: "tavern_status",
3489
+ description: "Get a quick overview of the Tavern: agent count, heartbeat status, active quests, and pending gates. Use this for situational awareness before taking action.",
3490
+ parameters: {
3491
+ type: "object",
3492
+ properties: {}
3493
+ }
3494
+ },
3495
+ toolFn: async () => {
3496
+ const [agents, quests, gates] = await Promise.all([
3497
+ service.listAgents(),
3498
+ service.listQuests(),
3499
+ service.listGates()
3500
+ ]);
3501
+ const agentList = agents.data ?? [];
3502
+ const heartbeatEnabled = agentList.filter((a) => a.heartbeatConfig?.enabled);
3503
+ return JSON.stringify({
3504
+ agents: {
3505
+ total: agentList.length,
3506
+ withHeartbeats: heartbeatEnabled.length,
3507
+ names: agentList.map((a) => ({ name: a.name, heartbeat: a.heartbeatConfig?.enabled ?? false }))
3508
+ },
3509
+ quests: {
3510
+ total: quests.quests.length,
3511
+ byStatus: quests.quests.reduce(
3512
+ (acc, q) => {
3513
+ acc[q.status] = (acc[q.status] ?? 0) + 1;
3514
+ return acc;
3515
+ },
3516
+ {}
3517
+ )
3518
+ },
3519
+ gates: {
3520
+ pending: gates.gates.length
3521
+ }
3522
+ });
3523
+ }
3524
+ };
3525
+ }
3383
3526
 
3384
3527
  // src/features/tavern/TavernModule.ts
3385
3528
  var TavernModule = class {
@@ -3401,6 +3544,8 @@ IMPORTANT: Many tools require agent IDs (MongoDB ObjectIds like "6540b58d1f703ad
3401
3544
  Available actions:
3402
3545
  - **tavern_list_agents**: List all agents with their IDs, names, and status \u2014 USE THIS FIRST
3403
3546
  - **tavern_create_agent**: Create a new agent with a personality (heartbeats disabled by default)
3547
+ - **tavern_edit_agent**: Update an agent's personality, system prompt, or heartbeat config (per-agent toggle)
3548
+ - **tavern_delete_agent**: Permanently delete an agent
3404
3549
  - **tavern_mention**: Talk to a specific agent by name or broadcast to all agents
3405
3550
  - **tavern_list_quests**: View the quest board
3406
3551
  - **tavern_post_quest**: Post a new quest for agents to claim
@@ -3411,6 +3556,7 @@ Available actions:
3411
3556
  - **tavern_toggle_heartbeats**: Enable/disable agent background heartbeats
3412
3557
  - **tavern_trigger_heartbeat**: Manually trigger a heartbeat cycle
3413
3558
  - **tavern_abort_heartbeats**: Emergency stop all in-flight heartbeats
3559
+ - **tavern_status**: Quick overview of agents, quests, and gates \u2014 good for situational awareness
3414
3560
 
3415
3561
  When the user mentions talking to agents, checking the quest board, or managing the tavern, use these tools.
3416
3562
  Agents have personalities, moods, quests, and memories \u2014 they are autonomous entities, not chatbots.`;
@@ -3431,6 +3577,25 @@ process.on("warning", (warning) => {
3431
3577
  }
3432
3578
  console.warn(warning);
3433
3579
  });
3580
+ var TAVERN_ACTION_ICONS = {
3581
+ speech: "\u{1F4AC}",
3582
+ thought: "\u{1F4AD}",
3583
+ memory: "\u{1F9E0}",
3584
+ move: "\u{1F6B6}",
3585
+ reply: "\u{1F4E9}",
3586
+ post_quest: "\u{1F4DC}",
3587
+ claim_quest: "\u2694\uFE0F",
3588
+ complete_quest: "\u2705",
3589
+ tool_use: "\u{1F527}",
3590
+ email: "\u{1F4E7}",
3591
+ gate_paused: "\u23F8\uFE0F",
3592
+ gate_timed: "\u23F3",
3593
+ gate_proceed: "\u25B6\uFE0F",
3594
+ idle: "\u{1F4A4}",
3595
+ intent: "\u{1F3AF}",
3596
+ report: "\u{1F4CB}",
3597
+ credits: "\u{1FA99}"
3598
+ };
3434
3599
  var exitTimestamp = null;
3435
3600
  var EXIT_TIMEOUT_MS = 2e3;
3436
3601
  var usageCache = null;
@@ -4817,6 +4982,9 @@ Tool Permissions:
4817
4982
  Project Configuration:
4818
4983
  /project-config - Show merged project configuration
4819
4984
 
4985
+ Tavern:
4986
+ /tavern - Show recent agent activity stream
4987
+
4820
4988
  Custom Commands:
4821
4989
  /commands - List all custom commands
4822
4990
  /commands:new <name> - Create a new custom command
@@ -5975,6 +6143,32 @@ Allowed domains (${domains.length}):`);
5975
6143
  console.log("Violation log cleared.");
5976
6144
  break;
5977
6145
  }
6146
+ case "tavern": {
6147
+ if (!state.featureRegistry || !state.config?.features?.tavern) {
6148
+ console.log("\nTavern is not enabled. Toggle it on in /config.");
6149
+ break;
6150
+ }
6151
+ const activityLog = useCliStore.getState().tavernActivityLog;
6152
+ if (activityLog.length === 0) {
6153
+ console.log("\nTavern Activity: No activity yet.");
6154
+ console.log(" Agents broadcast activity during heartbeats.");
6155
+ console.log(' Try: "trigger a heartbeat cycle" to generate activity.\n');
6156
+ break;
6157
+ }
6158
+ const recentEntries = activityLog.slice(-20);
6159
+ console.log(`
6160
+ Tavern Activity (last ${recentEntries.length} of ${activityLog.length} entries):
6161
+ `);
6162
+ for (const entry of recentEntries) {
6163
+ const time = new Date(entry.timestamp).toLocaleTimeString();
6164
+ const icon = TAVERN_ACTION_ICONS[entry.action] ?? "\xB7";
6165
+ const target = entry.targetAgentName ? ` \u2192 ${entry.targetAgentName}` : "";
6166
+ const text = entry.text ? `: ${entry.text.slice(0, 120)}${entry.text.length > 120 ? "..." : ""}` : "";
6167
+ console.log(` ${time} ${icon} ${entry.agentName}${target} [${entry.action}]${text}`);
6168
+ }
6169
+ console.log("");
6170
+ break;
6171
+ }
5978
6172
  default:
5979
6173
  console.log(`Unknown command: /${command}`);
5980
6174
  console.log("Type /help for available commands");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bike4mind/cli",
3
- "version": "0.2.57-feat-cli-tavern-integration.21481+e8cc92a39",
3
+ "version": "0.2.57-feat-cli-tavern-integration.21486+6d714e8cb",
4
4
  "type": "module",
5
5
  "description": "Interactive CLI tool for Bike4Mind with ReAct agents",
6
6
  "license": "UNLICENSED",
@@ -115,11 +115,11 @@
115
115
  "zustand": "^4.5.4"
116
116
  },
117
117
  "devDependencies": {
118
- "@bike4mind/agents": "0.2.2-feat-cli-tavern-integration.21481+e8cc92a39",
119
- "@bike4mind/common": "2.70.2-feat-cli-tavern-integration.21481+e8cc92a39",
120
- "@bike4mind/mcp": "1.33.16-feat-cli-tavern-integration.21481+e8cc92a39",
121
- "@bike4mind/services": "2.64.4-feat-cli-tavern-integration.21481+e8cc92a39",
122
- "@bike4mind/utils": "2.15.10-feat-cli-tavern-integration.21481+e8cc92a39",
118
+ "@bike4mind/agents": "0.2.2-feat-cli-tavern-integration.21486+6d714e8cb",
119
+ "@bike4mind/common": "2.70.2-feat-cli-tavern-integration.21486+6d714e8cb",
120
+ "@bike4mind/mcp": "1.33.16-feat-cli-tavern-integration.21486+6d714e8cb",
121
+ "@bike4mind/services": "2.64.4-feat-cli-tavern-integration.21486+6d714e8cb",
122
+ "@bike4mind/utils": "2.15.10-feat-cli-tavern-integration.21486+6d714e8cb",
123
123
  "@types/better-sqlite3": "^7.6.13",
124
124
  "@types/jsonwebtoken": "^9.0.4",
125
125
  "@types/node": "^22.9.0",
@@ -136,5 +136,5 @@
136
136
  "optionalDependencies": {
137
137
  "@vscode/ripgrep": "^1.17.1"
138
138
  },
139
- "gitHead": "e8cc92a39955c85d92df49e5eb1bde33cb182f5a"
139
+ "gitHead": "6d714e8cbc82d118ce37d8339fe6916ac5e209c3"
140
140
  }