Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(grok): add /compact slash command and compaction feedback #5412

Closedahmed-besic(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/5412/headopened View on GitHub

Showing 7 changed files with 141 additions and 0 deletions (loading 4).

x
0 of 7 viewed, 7 left
34 additions and 0 deletionsapps/server/scripts/acp-mock-agent.tsModified
View file
@@ -68,6 +68,25 @@
return typeof promptId === "string" && promptId.length > 0 ? promptId : undefined;
​
+function promptTextFromRequest(request: AcpSchema.PromptRequest): string {
+ const blocks = request.prompt;
+ if (!Array.isArray(blocks)) {
+ return "";
+ }
+ return blocks
+ .flatMap((block) =>
+ typeof block === "object" &&
+ block !== null &&
+ "type" in block &&
+ block.type === "text" &&
+ "text" in block &&
+ typeof block.text === "string"
+ ? [block.text]
+ : [],
+ )
+ .join("");
+}
+​
function logExit(reason: string): void {
if (!exitLogPath) {
return;
@@ -522,6 +541,21 @@
return yield* Effect.never;