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

Function memoryObjectBundle

internal/cli/memory.go:1877–1898  ·  view source on GitHub ↗
(title string, value any)

Source from the content-addressed store, hash-verified

1875}
1876
1877func memoryObjectBundle(title string, value any) outputBundle {
1878 return outputBundle{
1879 jsonValue: value,
1880 jsonl: func(cmd *cobra.Command) error {
1881 return writeJSONLine(cmd, value)
1882 },
1883 human: func() (string, error) {
1884 data, err := json.MarshalIndent(value, "", " ")
1885 if err != nil {
1886 return "", fmt.Errorf("cli: render %s: %w", title, err)
1887 }
1888 return renderHumanBlocks(title, string(data)), nil
1889 },
1890 toon: func() (string, error) {
1891 data, err := json.Marshal(value)
1892 if err != nil {
1893 return "", fmt.Errorf("cli: render %s toon: %w", title, err)
1894 }
1895 return renderToonObject(memoryMemoryKey, []string{memoryPayloadKey}, []string{string(data)}), nil
1896 },
1897 }
1898}
1899
1900func memoryScopeLabel(scope memcontract.Scope, tier memcontract.AgentTier) string {
1901 normalized := scope.Normalize()

Calls 3

writeJSONLineFunction · 0.85
renderHumanBlocksFunction · 0.85
renderToonObjectFunction · 0.85

Tested by

no test coverage detected