MCPcopy Create free account
hub / github.com/anomalyco/opencode / entryFlags

Function entryFlags

packages/opencode/src/cli/cmd/run/entry.body.ts:81–135  ·  view source on GitHub ↗
(commit: StreamCommit)

Source from the content-addressed store, hash-verified

79}
80
81export function entryFlags(commit: StreamCommit): EntryFlags {
82 if (commit.summary) {
83 return {
84 startOnNewLine: true,
85 trailingNewline: false,
86 }
87 }
88
89 if (commit.kind === "user") {
90 return {
91 startOnNewLine: true,
92 trailingNewline: false,
93 }
94 }
95
96 if (commit.kind === "tool") {
97 if (commit.phase === "progress") {
98 return {
99 startOnNewLine: false,
100 trailingNewline: false,
101 }
102 }
103
104 return {
105 startOnNewLine: true,
106 trailingNewline: true,
107 }
108 }
109
110 if (commit.kind === "assistant" || commit.kind === "reasoning") {
111 if (commit.phase === "progress") {
112 return {
113 startOnNewLine: false,
114 trailingNewline: false,
115 }
116 }
117
118 return {
119 startOnNewLine: true,
120 trailingNewline: true,
121 }
122 }
123
124 if (commit.kind === "error") {
125 return {
126 startOnNewLine: true,
127 trailingNewline: false,
128 }
129 }
130
131 return {
132 startOnNewLine: true,
133 trailingNewline: true,
134 }
135}
136
137export function entryDone(commit: StreamCommit): boolean {
138 if (commit.kind === "assistant" || commit.kind === "reasoning") {

Callers 2

entryWriterFunction · 0.90
createEntryMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected