MCPcopy Index your code
hub / github.com/coder/mux / getGoalStreamOriginKind

Function getGoalStreamOriginKind

src/node/services/agentSession.ts:184–194  ·  view source on GitHub ↗
(input: {
  isCompaction?: boolean;
  goalKind?: GoalSyntheticMessageKind;
  agentInitiated?: boolean;
})

Source from the content-addressed store, hash-verified

182}
183
184function getGoalStreamOriginKind(input: {
185 isCompaction?: boolean;
186 goalKind?: GoalSyntheticMessageKind;
187 agentInitiated?: boolean;
188}): GoalStreamOriginKind {
189 if (input.isCompaction === true) return "other";
190 if (input.goalKind === GOAL_CONTINUATION_KIND) return "goal_continuation";
191 if (input.goalKind === GOAL_BUDGET_LIMIT_KIND) return "goal_budget_limit";
192 if (input.agentInitiated === true) return "other";
193 return "user";
194}
195
196function coerceGoalSyntheticMessageKind(value: unknown): GoalSyntheticMessageKind | undefined {
197 if (value === GOAL_CONTINUATION_KIND || value === GOAL_BUDGET_LIMIT_KIND) {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected