Publish Claude Code Binaries / Stage and publish binaries (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-arm64 (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build linux-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build windows-amd64 (push) Canceled after 0s
Sync Tutti Agent Skills / sync (push) Canceled after 0s
Windows Agent Adapters / Test Windows agent adapters (push) Canceled after 0s
Windows Daemon Adapters / Test Windows daemon adapters (push) Canceled after 0s
Publish Tutti App Runtime / Publish runtime catalog (push) Canceled after 0s
22 lines
674 B
TypeScript
22 lines
674 B
TypeScript
const GOAL_MODE_SLASH_COMMAND = "/goal";
|
|
|
|
export const AGENT_COMPOSER_PASTED_TEXT_FILE_PREFIX = "pasted-text";
|
|
|
|
export function agentComposerTextByteLength(text: string): number {
|
|
if (typeof TextEncoder !== "undefined") {
|
|
return new TextEncoder().encode(text).byteLength;
|
|
}
|
|
return text.length;
|
|
}
|
|
|
|
export function goalDraftObjectiveFromPrompt(prompt: string): string | null {
|
|
const match = /^\s*\/goal(?:\s+([\s\S]*))?\s*$/u.exec(prompt);
|
|
return match ? (match[1] ?? "") : null;
|
|
}
|
|
|
|
export function buildGoalModePrompt(objective: string): string {
|
|
return objective.trim() === ""
|
|
? GOAL_MODE_SLASH_COMMAND
|
|
: `${GOAL_MODE_SLASH_COMMAND} ${objective}`;
|
|
}
|