MCPcopy Create free account
hub / github.com/compozy/agh / workspaceRecordBundle

Function workspaceRecordBundle

internal/cli/workspace.go:347–384  ·  view source on GitHub ↗
(item WorkspaceRecord)

Source from the content-addressed store, hash-verified

345}
346
347func 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
386func workspaceListBundle(items []WorkspaceRecord) outputBundle {
387 return listBundle(

Callers 5

newWorkspaceAddCommandFunction · 0.85
newWorkspaceEditCommandFunction · 0.85

Calls 4

renderHumanSectionFunction · 0.85
stringOrDashFunction · 0.85
formatTimeFunction · 0.85
renderToonObjectFunction · 0.85

Tested by

no test coverage detected