Skip to content

feat: add Agent Teams support and token usage fuel gauges#79

Open
ErickGross-19 wants to merge 1 commit intopablodelucca:mainfrom
ErickGross-19:feature/agent-teams-support
Open

feat: add Agent Teams support and token usage fuel gauges#79
ErickGross-19 wants to merge 1 commit intopablodelucca:mainfrom
ErickGross-19:feature/agent-teams-support

Conversation

@ErickGross-19
Copy link

Backend (extension):

  • src/constants.ts: add Agent/TeamCreate/TeamDelete/SendMessage tool name constants and TEAMMATE_MATCH_WINDOW_MS
  • src/types.ts: make terminalRef optional for teammates; add inputTokens, outputTokens, and team fields to AgentState and PersistedAgent
  • src/teamManager.ts: new module — registerPendingTeammate, tryClaimJsonlForTeammate, markAgentAsLead, getTeammatesForLead, handleSendMessage, clearExpiredPending
  • src/transcriptParser.ts: detect Agent/TeamCreate/SendMessage tool events; extract token usage; expand PERMISSION_EXEMPT_TOOLS
  • src/fileWatcher.ts: call tryClaimJsonlForTeammate before /clear logic
  • src/agentManager.ts: persist/restore teammates; re-send token/lead on reconnect
  • src/PixelAgentsViewProvider.ts: despawn all teammates on lead terminal close

Webview:

  • webview-ui/src/constants.ts: team label, fuel gauge, token threshold constants
  • webview-ui/src/office/types.ts: add team + token fields to Character; add 'message' bubble type
  • webview-ui/src/office/engine/characters.ts: init inputTokens/outputTokens
  • webview-ui/src/office/engine/officeState.ts: addAgent teamFields param; markAsLead, setAgentTokens, showSendMessageBubble; tick 'message' bubbles
  • webview-ui/src/hooks/useExtensionMessages.ts: handle agentIsLead, teammateCreated, teammateRemoved, agentSendMessage, agentTokenUsage
  • webview-ui/src/office/engine/renderer.ts: renderCharacterLabels — LEAD/role badge and color-coded fuel gauge per character

Backend (extension):
- src/constants.ts: add Agent/TeamCreate/TeamDelete/SendMessage tool name
  constants and TEAMMATE_MATCH_WINDOW_MS
- src/types.ts: make terminalRef optional for teammates; add inputTokens,
  outputTokens, and team fields to AgentState and PersistedAgent
- src/teamManager.ts: new module — registerPendingTeammate, tryClaimJsonlForTeammate,
  markAgentAsLead, getTeammatesForLead, handleSendMessage, clearExpiredPending
- src/transcriptParser.ts: detect Agent/TeamCreate/SendMessage tool events;
  extract token usage; expand PERMISSION_EXEMPT_TOOLS
- src/fileWatcher.ts: call tryClaimJsonlForTeammate before /clear logic
- src/agentManager.ts: persist/restore teammates; re-send token/lead on reconnect
- src/PixelAgentsViewProvider.ts: despawn all teammates on lead terminal close

Webview:
- webview-ui/src/constants.ts: team label, fuel gauge, token threshold constants
- webview-ui/src/office/types.ts: add team + token fields to Character;
  add 'message' bubble type
- webview-ui/src/office/engine/characters.ts: init inputTokens/outputTokens
- webview-ui/src/office/engine/officeState.ts: addAgent teamFields param;
  markAsLead, setAgentTokens, showSendMessageBubble; tick 'message' bubbles
- webview-ui/src/hooks/useExtensionMessages.ts: handle agentIsLead,
  teammateCreated, teammateRemoved, agentSendMessage, agentTokenUsage
- webview-ui/src/office/engine/renderer.ts: renderCharacterLabels — LEAD/role
  badge and color-coded fuel gauge per character
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant