Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit063b27e

Browse files
committed
statuses updates
1 parentc31cb7c commit063b27e

File tree

4 files changed

+75
-41
lines changed

4 files changed

+75
-41
lines changed

‎src/commands.ts

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -407,21 +407,22 @@ export class Commands {
407407
}
408408
}
409409

410-
publicasyncopenAISession():Promise<void>{
411-
// Then launch an integrated terminal with screen session
412-
constterminal=vscode.window.createTerminal({
413-
name:"Claude Code Session",
414-
location:vscode.TerminalLocation.Panel
415-
})
410+
publicasyncopenAppStatus(app:{
411+
name?:string
412+
status?:string
413+
url?:string
414+
agent_name?:string
415+
}):Promise<void>{
416+
// Check if app has a URL to open
417+
if(app.url){
418+
awaitvscode.env.openExternal(vscode.Uri.parse(app.url))
419+
return
420+
}
416421

417-
// Show the terminal and run the screen command
418-
terminal.show(true)
419-
420-
// Hide sidebar and maximize terminal panel
421-
// await vscode.commands.executeCommand("workbench.action.toggleSidebarVisibility")
422-
awaitvscode.commands.executeCommand("workbench.action.toggleMaximizedPanel")
423-
424-
terminal.sendText("screen -xRR claude-code")
422+
// If no URL, show information about the app status
423+
vscode.window.showInformationMessage(`${app.name||"Application"}:${app.status||"Running"}`,{
424+
detail:`Agent:${app.agent_name||"Unknown"}`,
425+
})
425426
}
426427

427428
/**

‎src/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export async function activate(ctx: vscode.ExtensionContext): Promise<void> {
124124
vscode.commands.registerCommand("coder.logout",commands.logout.bind(commands))
125125
vscode.commands.registerCommand("coder.open",commands.open.bind(commands))
126126
vscode.commands.registerCommand("coder.openFromSidebar",commands.openFromSidebar.bind(commands))
127-
vscode.commands.registerCommand("coder.openAITask",commands.openAISession.bind(commands))
127+
vscode.commands.registerCommand("coder.openAppStatus",commands.openAppStatus.bind(commands))
128128
vscode.commands.registerCommand("coder.workspace.update",commands.updateWorkspace.bind(commands))
129129
vscode.commands.registerCommand("coder.createWorkspace",commands.createWorkspace.bind(commands))
130130
vscode.commands.registerCommand("coder.navigateToWorkspace",commands.navigateToWorkspace.bind(commands))

‎src/workspacesProvider.ts

Lines changed: 58 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import{Api}from"coder/site/src/api/api"
2-
import{Workspace,WorkspaceAgent,WorkspaceAgentTask}from"coder/site/src/api/typesGenerated"
2+
import{Workspace,WorkspaceAgent}from"coder/site/src/api/typesGenerated"
33
import{EventSource}from"eventsource"
44
import*aspathfrom"path"
55
import*asvscodefrom"vscode"
@@ -155,14 +155,26 @@ export class WorkspaceProvider implements vscode.TreeDataProvider<vscode.TreeIte
155155
showMetadata,
156156
)
157157

158-
//Fetch AI tasks for the workspace
158+
//Get app status from the workspace agents
159159
try{
160-
// Create a dummy emitter for logs
161-
const_emitter=newvscode.EventEmitter<string>()
160+
constagents=extractAgents(workspace)
161+
agents.forEach((agent)=>{
162+
// Check if agent has apps property with status reporting
163+
if(agent.apps&&Array.isArray(agent.apps)){
164+
workspaceTreeItem.appStatus=agent.apps.map((app)=>({
165+
name:app.display_name||app.name||"App",
166+
status:app.status||"Running",
167+
icon:app.icon||"$(pulse)",
168+
url:app.url,
169+
agent_id:agent.id,
170+
agent_name:agent.name,
171+
}))
172+
}
173+
})
162174
}catch(error){
163-
// Log the error but continue - we don't want to fail the whole tree ifAI tasks fail
175+
// Log the error but continue - we don't want to fail the whole tree ifapp status fails
164176
this.storage.writeToCoderOutputChannel(
165-
`Failed tofetch AI tasks for workspace${workspace.name}:${errToStr(error,"unknown error")}`,
177+
`Failed toget app status for workspace${workspace.name}:${errToStr(error,"unknown error")}`,
166178
)
167179
}
168180

@@ -239,13 +251,24 @@ export class WorkspaceProvider implements vscode.TreeDataProvider<vscode.TreeIte
239251

240252
constitems:vscode.TreeItem[]=[]
241253

242-
// Add AI tasks section with collapsible header
243-
if(element.agent.tasks.length>0){
244-
constaiTasksSection=newSectionTreeItem(
245-
"AI Tasks",
246-
element.agent.tasks.map((task)=>newAITaskTreeItem(task)),
254+
// Add app status section with collapsible header
255+
if(element.agent.apps&&element.agent.apps.length>0){
256+
letneedsAttention=[]
257+
for(constappofelement.agent.apps){
258+
if(app.statuses&&app.statuses.length>0){
259+
for(conststatusofapp.statuses){
260+
if(status.needs_user_attention){
261+
needsAttention.push(newAppStatusTreeItem(status))
262+
}
263+
}
264+
}
265+
}
266+
267+
constappStatusSection=newSectionTreeItem(
268+
"Applications in need of attention",
269+
needsAttention,
247270
)
248-
items.push(aiTasksSection)
271+
items.push(appStatusSection)
249272
}
250273

251274
constsavedMetadata=watcher?.metadata||[]
@@ -346,18 +369,27 @@ class AgentMetadataTreeItem extends vscode.TreeItem {
346369
}
347370
}
348371

349-
classAITaskTreeItemextendsvscode.TreeItem{
350-
constructor(publicreadonlytask:WorkspaceAgentTask){
351-
// Add a hand raise emoji (✋) to indicate tasks awaiting user input
352-
super(task.icon,vscode.TreeItemCollapsibleState.None)
353-
this.description=task.summary
354-
this.contextValue="coderAITask"
372+
classAppStatusTreeItemextendsvscode.TreeItem{
373+
constructor(
374+
publicreadonlyapp:{
375+
name?:string
376+
display_name?:string
377+
status?:string
378+
icon?:string
379+
url?:string
380+
agent_id?:string
381+
agent_name?:string
382+
},
383+
){
384+
super(app.icon||"$(pulse)",vscode.TreeItemCollapsibleState.None)
385+
this.description=app.status||"Running"
386+
this.contextValue="coderAppStatus"
355387

356-
// Add command to handle clicking on thetask
388+
// Add command to handle clicking on theapp
357389
this.command={
358-
command:"coder.openAITask",
359-
title:"OpenAI Task",
360-
arguments:[task],
390+
command:"coder.openAppStatus",
391+
title:"OpenApp Status",
392+
arguments:[app],
361393
}
362394
}
363395
}
@@ -409,14 +441,15 @@ class AgentTreeItem extends OpenableTreeItem {
409441
"coderAgent",
410442
)
411443

412-
if(agent.task_waiting_for_user_input){
413-
this.label="🙋 "+this.label
444+
if(agent.apps&&agent.apps.length>0){
445+
// Add an icon to indicate this agent has running apps
446+
this.label="🖐️ "+this.label
414447
}
415448
}
416449
}
417450

418451
exportclassWorkspaceTreeItemextendsOpenableTreeItem{
419-
publicaiTasks:{waiting:boolean;tasks:WorkspaceAgentTask[]}[]=[]
452+
publicappStatus:{name:string;status:string;icon?:string}[]=[]
420453

421454
constructor(
422455
publicreadonlyworkspace:Workspace,

‎yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1594,7 +1594,7 @@ co@3.1.0:
15941594

15951595
"coder@https://github.com/coder/coder#main":
15961596
version "0.0.0"
1597-
resolved "https://github.com/coder/coder#8ea956fc115c221f198dd2c54538c93fc03c91cf"
1597+
resolved "https://github.com/coder/coder#3a243c111b9abb5c38328169ff70064025bbe2fe"
15981598

15991599
collapse-white-space@^1.0.2:
16001600
version "1.0.6"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp