killeros 3.0.7 → 3.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +755 -734
- package/Killeros.ts +56 -55
- package/LICENSE +21 -21
- package/README.md +381 -364
- package/killeros/activity.ts +111 -111
- package/killeros/auto-compaction.ts +384 -384
- package/killeros/bounded-text.ts +25 -25
- package/killeros/change-receipt.ts +676 -676
- package/killeros/codex-fast-state.ts +55 -55
- package/killeros/codex-fast.ts +37 -37
- package/killeros/commands.ts +259 -259
- package/killeros/display.ts +60 -60
- package/killeros/errors.ts +19 -19
- package/killeros/footer.ts +540 -540
- package/killeros/goal-command.ts +37 -26
- package/killeros/goal-interface.ts +666 -585
- package/killeros/goal-runtime.ts +519 -516
- package/killeros/goal-settlement.ts +368 -368
- package/killeros/goal-state.ts +753 -724
- package/killeros/handoff.ts +327 -327
- package/killeros/hooks.ts +443 -470
- package/killeros/notifications.ts +135 -135
- package/killeros/passive-git-status.ts +391 -408
- package/killeros/personal-instructions.ts +122 -122
- package/killeros/question-ui.ts +269 -269
- package/killeros/question.ts +242 -242
- package/killeros/runtime.ts +156 -155
- package/killeros/safe-terminal-text.ts +6 -6
- package/killeros/secret-detector.ts +19 -19
- package/killeros/settings.ts +145 -145
- package/killeros/shell-ui.ts +418 -418
- package/killeros/variants.ts +13 -13
- package/killeros/worked-for.ts +502 -502
- package/package.json +71 -68
- package/themes/killeros.json +87 -87
package/killeros/goal-command.ts
CHANGED
|
@@ -1,26 +1,37 @@
|
|
|
1
|
-
import { validateGoalObjective } from "./goal-state.ts";
|
|
2
|
-
import { safeTerminalText } from "./safe-terminal-text.ts";
|
|
3
|
-
|
|
4
|
-
export type GoalCommand =
|
|
5
|
-
| { kind: "status" }
|
|
6
|
-
| { kind: "objective"; objective: string }
|
|
7
|
-
| { kind: "
|
|
8
|
-
| { kind: "
|
|
9
|
-
| { kind: "
|
|
10
|
-
| { kind: "
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
if (
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
1
|
+
import { validateGoalObjective } from "./goal-state.ts";
|
|
2
|
+
import { safeTerminalText } from "./safe-terminal-text.ts";
|
|
3
|
+
|
|
4
|
+
export type GoalCommand =
|
|
5
|
+
| { kind: "status" }
|
|
6
|
+
| { kind: "objective"; objective: string }
|
|
7
|
+
| { kind: "edit"; objective: string }
|
|
8
|
+
| { kind: "pause" }
|
|
9
|
+
| { kind: "resume" }
|
|
10
|
+
| { kind: "clear" }
|
|
11
|
+
| { kind: "invalid"; message: string };
|
|
12
|
+
|
|
13
|
+
/** Parses raw text as a plain objective, or reports why it cannot be one. */
|
|
14
|
+
export function parseGoalObjectiveText(input: string): Extract<GoalCommand, { kind: "objective" } | { kind: "invalid" }> {
|
|
15
|
+
const objective = validateGoalObjective(input);
|
|
16
|
+
if (objective) return { kind: "objective", objective };
|
|
17
|
+
if (safeTerminalText(input) !== input) {
|
|
18
|
+
return { kind: "invalid", message: "A goal objective contains unsupported content" };
|
|
19
|
+
}
|
|
20
|
+
return { kind: "invalid", message: "A goal objective may not exceed 4,000 characters" };
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** Parses one raw /goal argument string into a closed command variant; the handler decides whether "edit" applies to the current goal. */
|
|
24
|
+
export function parseGoalCommand(args: string): GoalCommand {
|
|
25
|
+
const input = args.trim();
|
|
26
|
+
if (!input) return { kind: "status" };
|
|
27
|
+
const lowered = input.toLowerCase();
|
|
28
|
+
if (lowered === "pause") return { kind: "pause" };
|
|
29
|
+
if (lowered === "resume") return { kind: "resume" };
|
|
30
|
+
if (lowered === "clear") return { kind: "clear" };
|
|
31
|
+
if (lowered === "edit") return { kind: "invalid", message: "Provide the new objective: /goal edit <objective>" };
|
|
32
|
+
if (/^edit\s/ui.test(input)) {
|
|
33
|
+
const objective = validateGoalObjective(input.replace(/^edit\s+/ui, ""));
|
|
34
|
+
if (objective) return { kind: "edit", objective };
|
|
35
|
+
}
|
|
36
|
+
return parseGoalObjectiveText(input);
|
|
37
|
+
}
|