MCPcopy Index your code
hub / github.com/anomalyco/opencode / reply

Function reply

packages/opencode/test/tool/task.test.ts:111–139  ·  view source on GitHub ↗
(input: SessionPrompt.PromptInput, text: string)

Source from the content-addressed store, hash-verified

109}
110
111function reply(input: SessionPrompt.PromptInput, text: string): SessionV1.WithParts {
112 const id = MessageID.ascending()
113 return {
114 info: {
115 id,
116 role: "assistant",
117 parentID: input.messageID ?? MessageID.ascending(),
118 sessionID: input.sessionID,
119 mode: input.agent ?? "general",
120 agent: input.agent ?? "general",
121 cost: 0,
122 path: { cwd: "/tmp", root: "/tmp" },
123 tokens: { input: 0, output: 0, reasoning: 0, cache: { read: 0, write: 0 } },
124 modelID: input.model?.modelID ?? ref.modelID,
125 providerID: input.model?.providerID ?? ref.providerID,
126 time: { created: Date.now() },
127 finish: "stop",
128 },
129 parts: [
130 {
131 id: PartID.ascending(),
132 messageID: id,
133 sessionID: input.sessionID,
134 type: "text",
135 text,
136 },
137 ],
138 }
139}
140
141describe("tool.task", () => {
142 it.instance(

Callers 2

stubOpsFunction · 0.70
task.test.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected