(item WorkspaceRecord)
| 345 | } |
| 346 | |
| 347 | func workspaceRecordBundle(item WorkspaceRecord) outputBundle { |
| 348 | return outputBundle{ |
| 349 | jsonValue: item, |
| 350 | human: func() (string, error) { |
| 351 | return renderHumanSection(authoredContextWorkspaceValue, []keyValue{ |
| 352 | {Label: "ID", Value: stringOrDash(item.ID)}, |
| 353 | {Label: workspaceNameValue, Value: stringOrDash(item.Name)}, |
| 354 | {Label: workspaceRootValue, Value: stringOrDash(item.RootDir)}, |
| 355 | {Label: "Additional Dirs", Value: stringOrDash(strings.Join(item.AddDirs, ", "))}, |
| 356 | {Label: "Default Agent", Value: stringOrDash(item.DefaultAgent)}, |
| 357 | {Label: workspaceSandboxValue, Value: stringOrDash(item.SandboxRef)}, |
| 358 | {Label: workspaceCreatedValue, Value: stringOrDash(formatTime(item.CreatedAt))}, |
| 359 | {Label: workspaceUpdatedValue, Value: stringOrDash(formatTime(item.UpdatedAt))}, |
| 360 | }), nil |
| 361 | }, |
| 362 | toon: func() (string, error) { |
| 363 | return renderToonObject(workspaceSkillSource, []string{ |
| 364 | "id", |
| 365 | automationNameKey, |
| 366 | "root_dir", |
| 367 | "add_dirs", |
| 368 | "default_agent", |
| 369 | "sandbox_ref", |
| 370 | workspaceCreatedAtKey, |
| 371 | automationUpdatedAtKey, |
| 372 | }, []string{ |
| 373 | item.ID, |
| 374 | item.Name, |
| 375 | item.RootDir, |
| 376 | strings.Join(item.AddDirs, "|"), |
| 377 | item.DefaultAgent, |
| 378 | item.SandboxRef, |
| 379 | formatTime(item.CreatedAt), |
| 380 | formatTime(item.UpdatedAt), |
| 381 | }), nil |
| 382 | }, |
| 383 | } |
| 384 | } |
| 385 | |
| 386 | func workspaceListBundle(items []WorkspaceRecord) outputBundle { |
| 387 | return listBundle( |
no test coverage detected