mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-18 22:35:51 +00:00
This reverts commit d66a6f6124.
This commit is contained in:
@@ -1,66 +0,0 @@
|
||||
import type { LocalCommandCall } from '../../types/command.js'
|
||||
import {
|
||||
clearGoal,
|
||||
completeGoal,
|
||||
formatGoalStatus,
|
||||
getGoal,
|
||||
pauseGoal,
|
||||
resumeGoal,
|
||||
setGoal,
|
||||
} from '../../services/goal/goalState.js'
|
||||
|
||||
export const call: LocalCommandCall = async args => {
|
||||
const trimmed = args.trim()
|
||||
|
||||
// No arguments — show current goal status
|
||||
if (!trimmed) {
|
||||
return { type: 'text', value: formatGoalStatus() }
|
||||
}
|
||||
|
||||
const lower = trimmed.toLowerCase()
|
||||
|
||||
// Control subcommands
|
||||
if (lower === 'clear') {
|
||||
const goal = getGoal()
|
||||
if (!goal) {
|
||||
return { type: 'text', value: 'No active goal to clear.' }
|
||||
}
|
||||
clearGoal()
|
||||
return { type: 'text', value: 'Goal cleared.' }
|
||||
}
|
||||
|
||||
if (lower === 'pause') {
|
||||
if (pauseGoal()) {
|
||||
return { type: 'text', value: 'Goal paused.' }
|
||||
}
|
||||
return { type: 'text', value: 'No active goal to pause.' }
|
||||
}
|
||||
|
||||
if (lower === 'resume') {
|
||||
if (resumeGoal()) {
|
||||
return { type: 'text', value: 'Goal resumed.' }
|
||||
}
|
||||
return { type: 'text', value: 'No paused goal to resume.' }
|
||||
}
|
||||
|
||||
if (lower === 'complete') {
|
||||
if (completeGoal()) {
|
||||
return { type: 'text', value: 'Goal marked as complete.' }
|
||||
}
|
||||
return { type: 'text', value: 'No active goal to complete.' }
|
||||
}
|
||||
|
||||
// Set a new goal
|
||||
const existing = getGoal()
|
||||
if (existing && existing.status === 'active') {
|
||||
// Replace existing active goal
|
||||
setGoal(trimmed)
|
||||
return {
|
||||
type: 'text',
|
||||
value: `Goal replaced.\n\n${formatGoalStatus()}`,
|
||||
}
|
||||
}
|
||||
|
||||
setGoal(trimmed)
|
||||
return { type: 'text', value: `Goal set.\n\n${formatGoalStatus()}` }
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
import type { Command } from '../../commands.js'
|
||||
|
||||
const goal = {
|
||||
type: 'local',
|
||||
name: 'goal',
|
||||
description: 'Set or view the goal for a long-running task',
|
||||
supportsNonInteractive: true,
|
||||
argumentHint: '<objective> | clear | pause | resume',
|
||||
load: () => import('./goal.js'),
|
||||
} satisfies Command
|
||||
|
||||
export default goal
|
||||
Reference in New Issue
Block a user