MCPcopy Create free account
hub / github.com/Noumena-Network/code / ThinkbackFlow

Function ThinkbackFlow

src/commands/thinkback/thinkback.tsx:388–548  ·  view source on GitHub ↗
(t0)

Source from the content-addressed store, hash-verified

386const FIX_PROMPT = 'Use the Skill tool to invoke the "thinkback" skill with mode=fix to fix validation or rendering errors in my existing Code year in review animation. Run the validator, identify errors, and fix them. When the animation is ready, tell the user to run /think-back again to play it.';
387const REGENERATE_PROMPT = 'Use the Skill tool to invoke the "thinkback" skill with mode=regenerate to create a completely new Code year in review animation from scratch. Delete the existing animation and start fresh. When the animation is ready, tell the user to run /think-back again to play it.';
388function ThinkbackFlow(t0) {
389 const $ = _c(27);
390 const {
391 onDone
392 } = t0;
393 const [installComplete, setInstallComplete] = useState(false);
394 const [installError, setInstallError] = useState(null);
395 const [skillDir, setSkillDir] = useState(null);
396 const [hasGenerated, setHasGenerated] = useState(null);
397 let t1;
398 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
399 t1 = function handleReady() {
400 setInstallComplete(true);
401 };
402 $[0] = t1;
403 } else {
404 t1 = $[0];
405 }
406 const handleReady = t1;
407 let t2;
408 if ($[1] !== onDone) {
409 t2 = message => {
410 setInstallError(message);
411 onDone(`Error with thinkback: ${message}. Try running /plugin to manually install the think-back plugin.`, {
412 display: "system"
413 });
414 };
415 $[1] = onDone;
416 $[2] = t2;
417 } else {
418 t2 = $[2];
419 }
420 const handleError = t2;
421 let t3;
422 let t4;
423 if ($[3] !== handleError || $[4] !== installComplete || $[5] !== installError || $[6] !== skillDir) {
424 t3 = () => {
425 if (installComplete && !skillDir && !installError) {
426 getThinkbackSkillDir().then(dir => {
427 if (dir) {
428 logForDebugging(`Thinkback skill directory: ${dir}`);
429 setSkillDir(dir);
430 } else {
431 handleError("Could not find thinkback skill directory");
432 }
433 });
434 }
435 };
436 t4 = [installComplete, skillDir, installError, handleError];
437 $[3] = handleError;
438 $[4] = installComplete;
439 $[5] = installError;
440 $[6] = skillDir;
441 $[7] = t3;
442 $[8] = t4;
443 } else {
444 t3 = $[7];
445 t4 = $[8];

Callers

nothing calls this directly

Calls 4

getThinkbackSkillDirFunction · 0.85
pathExistsFunction · 0.85
onDoneFunction · 0.50
logForDebuggingFunction · 0.50

Tested by

no test coverage detected