@gajae-code/coding-agent 0.7.9 → 0.7.11
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 +47 -0
- package/README.md +2 -0
- package/dist/types/config/keybindings.d.ts +11 -5
- package/dist/types/config/settings-schema.d.ts +10 -1
- package/dist/types/defaults/gjc-defaults.d.ts +7 -0
- package/dist/types/extensibility/extensions/types.d.ts +11 -0
- package/dist/types/gjc-runtime/launch-tmux.d.ts +10 -0
- package/dist/types/gjc-runtime/ralplan-runtime.d.ts +3 -2
- package/dist/types/gjc-runtime/restricted-role-agent-bash.d.ts +1 -0
- package/dist/types/gjc-runtime/state-writer.d.ts +1 -0
- package/dist/types/gjc-runtime/ultragoal-guard.d.ts +4 -0
- package/dist/types/gjc-runtime/ultragoal-runtime.d.ts +0 -4
- package/dist/types/modes/components/custom-editor.d.ts +2 -1
- package/dist/types/modes/components/hook-selector.d.ts +5 -0
- package/dist/types/modes/components/skill-message.d.ts +1 -0
- package/dist/types/modes/controllers/command-controller.d.ts +1 -0
- package/dist/types/modes/controllers/input-controller.d.ts +4 -0
- package/dist/types/modes/interactive-mode.d.ts +1 -0
- package/dist/types/modes/prompt-action-autocomplete.d.ts +2 -0
- package/dist/types/modes/shared/agent-wire/deep-interview-gate.d.ts +20 -6
- package/dist/types/modes/slash-command-visibility.d.ts +1 -0
- package/dist/types/modes/types.d.ts +1 -0
- package/dist/types/notifications/html-format.d.ts +2 -0
- package/dist/types/notifications/recent-activity.d.ts +5 -1
- package/dist/types/notifications/telegram-daemon-control.d.ts +8 -0
- package/dist/types/notifications/telegram-reference.d.ts +4 -0
- package/dist/types/notifications/threaded-render.d.ts +1 -0
- package/dist/types/sdk.d.ts +1 -1
- package/dist/types/session/agent-session.d.ts +8 -5
- package/dist/types/slash-commands/types.d.ts +2 -0
- package/dist/types/tools/ask.d.ts +2 -0
- package/dist/types/utils/cmux-workspace.d.ts +52 -0
- package/dist/types/web/search/index.d.ts +4 -2
- package/dist/types/web/search/provider.d.ts +14 -0
- package/dist/types/web/search/providers/utils.d.ts +42 -13
- package/dist/types/web/search/render.d.ts +1 -0
- package/package.json +7 -7
- package/src/cli/update-cli.ts +24 -0
- package/src/cli/web-search-cli.ts +5 -7
- package/src/cli.ts +1 -1
- package/src/commands/launch.ts +1 -1
- package/src/commands/ralplan.ts +1 -0
- package/src/config/keybindings.ts +14 -5
- package/src/config/model-profiles.ts +16 -0
- package/src/config/settings-schema.ts +11 -1
- package/src/coordinator-mcp/server.ts +9 -3
- package/src/defaults/gjc/skills/deep-interview/SKILL.md +26 -2
- package/src/defaults/gjc/skills/ralplan/SKILL.md +16 -14
- package/src/defaults/gjc/skills/ultragoal/SKILL.md +37 -112
- package/src/defaults/gjc-defaults.ts +16 -0
- package/src/extensibility/extensions/runner.ts +2 -1
- package/src/extensibility/extensions/types.ts +11 -0
- package/src/gjc-runtime/launch-tmux.ts +209 -26
- package/src/gjc-runtime/ralplan-runtime.ts +22 -6
- package/src/gjc-runtime/restricted-role-agent-bash.ts +1 -0
- package/src/gjc-runtime/state-runtime.ts +8 -5
- package/src/gjc-runtime/state-writer.ts +5 -5
- package/src/gjc-runtime/ultragoal-guard.ts +139 -19
- package/src/gjc-runtime/ultragoal-runtime.ts +16 -124
- package/src/gjc-runtime/workflow-manifest.generated.json +0 -8
- package/src/gjc-runtime/workflow-manifest.ts +0 -1
- package/src/hooks/skill-state.ts +33 -73
- package/src/internal-urls/docs-index.generated.ts +6 -4
- package/src/main.ts +2 -2
- package/src/migrate/executor.ts +23 -6
- package/src/modes/components/custom-editor.ts +8 -0
- package/src/modes/components/hook-selector.ts +21 -3
- package/src/modes/components/model-selector.ts +6 -2
- package/src/modes/components/settings-selector.ts +47 -5
- package/src/modes/components/skill-message.ts +18 -10
- package/src/modes/components/status-line/presets.ts +11 -0
- package/src/modes/controllers/command-controller.ts +23 -0
- package/src/modes/controllers/extension-ui-controller.ts +18 -2
- package/src/modes/controllers/input-controller.ts +41 -9
- package/src/modes/interactive-mode.ts +16 -7
- package/src/modes/prompt-action-autocomplete.ts +23 -1
- package/src/modes/shared/agent-wire/deep-interview-gate.ts +53 -9
- package/src/modes/slash-command-visibility.ts +9 -0
- package/src/modes/types.ts +1 -0
- package/src/modes/utils/hotkeys-markdown.ts +5 -2
- package/src/modes/utils/ui-helpers.ts +76 -3
- package/src/notifications/html-format.ts +75 -1
- package/src/notifications/index.ts +12 -1
- package/src/notifications/recent-activity.ts +32 -8
- package/src/notifications/telegram-daemon-control.ts +9 -0
- package/src/notifications/telegram-daemon.ts +68 -25
- package/src/notifications/telegram-reference.ts +36 -14
- package/src/notifications/threaded-render.ts +14 -6
- package/src/prompts/agents/architect.md +7 -4
- package/src/prompts/agents/critic.md +15 -6
- package/src/prompts/agents/planner.md +8 -3
- package/src/prompts/system/system-prompt.md +5 -1
- package/src/prompts/tools/bash.md +1 -1
- package/src/sdk.ts +6 -11
- package/src/session/agent-session.ts +60 -17
- package/src/slash-commands/builtin-registry.ts +30 -10
- package/src/slash-commands/types.ts +2 -0
- package/src/tools/ask.ts +136 -16
- package/src/tools/bash.ts +24 -8
- package/src/utils/cmux-workspace.ts +233 -0
- package/src/utils/title-generator.ts +2 -0
- package/src/web/kagi.ts +1 -1
- package/src/web/parallel.ts +2 -2
- package/src/web/search/index.ts +137 -52
- package/src/web/search/provider.ts +80 -0
- package/src/web/search/providers/anthropic.ts +1 -1
- package/src/web/search/providers/brave.ts +1 -1
- package/src/web/search/providers/codex.ts +1 -1
- package/src/web/search/providers/duckduckgo.ts +1 -1
- package/src/web/search/providers/exa.ts +1 -1
- package/src/web/search/providers/gemini.ts +7 -3
- package/src/web/search/providers/jina.ts +1 -1
- package/src/web/search/providers/kimi.ts +6 -1
- package/src/web/search/providers/openai-compatible.ts +1 -1
- package/src/web/search/providers/parallel.ts +1 -1
- package/src/web/search/providers/perplexity.ts +2 -2
- package/src/web/search/providers/searxng.ts +1 -1
- package/src/web/search/providers/synthetic.ts +1 -1
- package/src/web/search/providers/tavily.ts +1 -1
- package/src/web/search/providers/utils.ts +67 -17
- package/src/web/search/providers/xai.ts +1 -1
- package/src/web/search/providers/zai.ts +1 -1
- package/src/web/search/render.ts +3 -0
package/src/hooks/skill-state.ts
CHANGED
|
@@ -11,8 +11,7 @@ import {
|
|
|
11
11
|
writeGuardedJsonAtomic,
|
|
12
12
|
writeGuardedWorkflowEnvelopeAtomic,
|
|
13
13
|
} from "../gjc-runtime/state-writer";
|
|
14
|
-
import { isUltragoalBypassPrompt,
|
|
15
|
-
import { getUltragoalRunCompletionState, readUltragoalPlan } from "../gjc-runtime/ultragoal-runtime";
|
|
14
|
+
import { isUltragoalBypassPrompt, verifyUltragoalDurableCompletionState } from "../gjc-runtime/ultragoal-guard";
|
|
16
15
|
import { buildSessionContext, loadEntriesFromFile, type SessionEntry } from "../session/session-manager";
|
|
17
16
|
import {
|
|
18
17
|
readVisibleSkillActiveState as readCanonicalVisibleSkillActiveState,
|
|
@@ -565,6 +564,10 @@ function modeStateReleasesStop(state: ModeState | null, handoffRequired: boolean
|
|
|
565
564
|
return false;
|
|
566
565
|
}
|
|
567
566
|
|
|
567
|
+
function ultragoalDurableCompletionReleasesStop(state: string): boolean {
|
|
568
|
+
return state === "inactive" || state === "active_verified_complete";
|
|
569
|
+
}
|
|
570
|
+
|
|
568
571
|
/**
|
|
569
572
|
* Cross-file coherence guard for a mode-state that claims it releases the Stop
|
|
570
573
|
* block. `modeStateReleasesStop` trusts a single mode-state file; if any writer
|
|
@@ -577,18 +580,15 @@ function modeStateReleasesStop(state: ModeState | null, handoffRequired: boolean
|
|
|
577
580
|
* cheap and read-only — ultragoal reads the durable plan; skills without an
|
|
578
581
|
* independent durable source release as before.
|
|
579
582
|
*/
|
|
580
|
-
async function detectStaleModeStateRelease(
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
}
|
|
590
|
-
}
|
|
591
|
-
return null;
|
|
583
|
+
async function detectStaleModeStateRelease(
|
|
584
|
+
skill: GjcWorkflowSkill,
|
|
585
|
+
cwd: string,
|
|
586
|
+
sessionId?: string | null,
|
|
587
|
+
): Promise<string | null> {
|
|
588
|
+
if (skill !== "ultragoal") return null;
|
|
589
|
+
const diagnostic = await verifyUltragoalDurableCompletionState({ cwd, sessionId });
|
|
590
|
+
if (ultragoalDurableCompletionReleasesStop(diagnostic.state)) return null;
|
|
591
|
+
return `${diagnostic.message} Run \`gjc ultragoal complete-goals\` to continue, or checkpoint a finished story with \`gjc ultragoal checkpoint --status complete --quality-gate-json <file>\`, before stopping`;
|
|
592
592
|
}
|
|
593
593
|
|
|
594
594
|
/**
|
|
@@ -663,19 +663,6 @@ function stateMatchesContext(state: ModeState, sessionId?: string, threadId?: st
|
|
|
663
663
|
return true;
|
|
664
664
|
}
|
|
665
665
|
|
|
666
|
-
async function readCurrentGoalObjectiveFromSessionFile(sessionFile: string | undefined): Promise<string | null> {
|
|
667
|
-
const trimmed = sessionFile?.trim();
|
|
668
|
-
if (!trimmed) return null;
|
|
669
|
-
const entries = (await loadEntriesFromFile(trimmed)).filter(
|
|
670
|
-
(entry): entry is SessionEntry => entry.type !== "session",
|
|
671
|
-
);
|
|
672
|
-
const context = buildSessionContext(entries);
|
|
673
|
-
const goal = context.modeData?.goal;
|
|
674
|
-
if (typeof goal !== "object" || goal === null) return null;
|
|
675
|
-
const objective = (goal as { objective?: unknown }).objective;
|
|
676
|
-
return typeof objective === "string" && objective.trim().length > 0 ? objective.trim() : null;
|
|
677
|
-
}
|
|
678
|
-
|
|
679
666
|
async function readLatestAssistantTextFromSessionFile(sessionFile: string | undefined): Promise<string | null> {
|
|
680
667
|
const trimmed = sessionFile?.trim();
|
|
681
668
|
if (!trimmed) return null;
|
|
@@ -730,34 +717,18 @@ export async function buildActiveUltragoalPromptContext(input: UserPromptSubmitS
|
|
|
730
717
|
if (!stateMatchesContext(visibleModeState.state, resolvedSessionId, input.threadId)) return null;
|
|
731
718
|
|
|
732
719
|
const phase = String(visibleModeState.state.current_phase ?? "active");
|
|
733
|
-
const stateObjective =
|
|
734
|
-
typeof visibleModeState.state.objective === "string"
|
|
735
|
-
? visibleModeState.state.objective
|
|
736
|
-
: typeof visibleModeState.state.gjcObjective === "string"
|
|
737
|
-
? visibleModeState.state.gjcObjective
|
|
738
|
-
: "";
|
|
739
|
-
const sessionObjective = await readCurrentGoalObjectiveFromSessionFile(input.sessionFile);
|
|
740
720
|
const normalizedPrompt = input.prompt?.replace(/\\?"/g, '"');
|
|
741
721
|
const isBypassPrompt = Boolean(
|
|
742
722
|
(normalizedPrompt && isUltragoalBypassPrompt(normalizedPrompt)) ||
|
|
743
723
|
(input.prompt && /goal[\s\S]{0,80}complete/i.test(input.prompt)),
|
|
744
724
|
);
|
|
745
725
|
if (isBypassPrompt) {
|
|
746
|
-
const
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
for (const objective of objectives) {
|
|
753
|
-
const diagnostic = await readUltragoalVerificationState({
|
|
754
|
-
cwd: input.cwd,
|
|
755
|
-
currentGoal: { objective },
|
|
756
|
-
});
|
|
757
|
-
if (diagnostic.state === "unrelated_goal") continue;
|
|
758
|
-
if (!["inactive", "active_verified_complete"].includes(diagnostic.state)) {
|
|
759
|
-
return `BLOCK_ULTRAGOAL_COMPLETION: ${diagnostic.message} Use durable blocker work or run strict \`gjc ultragoal checkpoint --status complete --quality-gate-json <file> --gjc-goal-json <file>\` before completion.`;
|
|
760
|
-
}
|
|
726
|
+
const diagnostic = await verifyUltragoalDurableCompletionState({
|
|
727
|
+
cwd: input.cwd,
|
|
728
|
+
sessionId: resolvedSessionId,
|
|
729
|
+
});
|
|
730
|
+
if (!ultragoalDurableCompletionReleasesStop(diagnostic.state)) {
|
|
731
|
+
return `BLOCK_ULTRAGOAL_COMPLETION: ${diagnostic.message} Use durable blocker work or run strict \`gjc ultragoal checkpoint --status complete --quality-gate-json <file>\` before completion.`;
|
|
761
732
|
}
|
|
762
733
|
}
|
|
763
734
|
return `Ultragoal is active (phase: ${phase}; state: ${visibleModeState.statePath}). If the user prompt is a steering request, use \`gjc ultragoal steer\` to add or steer subgoals. Normal prose should not mutate Ultragoal state.`;
|
|
@@ -818,7 +789,7 @@ export async function buildSkillStopOutput(input: StopHookInput): Promise<Record
|
|
|
818
789
|
// authoritative durable state. If a stale/incoherent mode-state would
|
|
819
790
|
// release while the plan/ledger still shows pending work, block instead
|
|
820
791
|
// of trusting the single file (see #659).
|
|
821
|
-
const staleRelease = await detectStaleModeStateRelease(entry.skill, input.cwd);
|
|
792
|
+
const staleRelease = await detectStaleModeStateRelease(entry.skill, input.cwd, resolvedSessionId);
|
|
822
793
|
if (staleRelease) {
|
|
823
794
|
const coherenceMessage = `GJC skill "${entry.skill}" mode-state reports it released the Stop block (${modeStatePath(input.cwd, entry.skill, resolvedSessionId)}), but ${staleRelease}. The mode-state is incoherent with authoritative durable state; finish or explicitly clear the pending work before stopping.`;
|
|
824
795
|
return {
|
|
@@ -847,29 +818,18 @@ export async function buildSkillStopOutput(input: StopHookInput): Promise<Record
|
|
|
847
818
|
const phase = String(modeState?.current_phase ?? entry.phase ?? skillState.phase ?? "active");
|
|
848
819
|
const statePath = modeStatePath(input.cwd, entry.skill, resolvedSessionId);
|
|
849
820
|
if (entry.skill === "ultragoal") {
|
|
850
|
-
const
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
if (diagnostic.state === "active_verified_complete") continue;
|
|
863
|
-
if (!["inactive", "unrelated_goal"].includes(diagnostic.state)) {
|
|
864
|
-
const ultragoalMessage = `GJC ultragoal verification is blocking stop: ${diagnostic.message} Run strict checkpoint verification or record review blockers before stopping.`;
|
|
865
|
-
return {
|
|
866
|
-
decision: "block",
|
|
867
|
-
reason: ultragoalMessage,
|
|
868
|
-
stopReason: `gjc_ultragoal_verification_${diagnostic.state}`,
|
|
869
|
-
systemMessage: ultragoalMessage,
|
|
870
|
-
};
|
|
871
|
-
}
|
|
872
|
-
}
|
|
821
|
+
const diagnostic = await verifyUltragoalDurableCompletionState({
|
|
822
|
+
cwd: input.cwd,
|
|
823
|
+
sessionId: resolvedSessionId,
|
|
824
|
+
});
|
|
825
|
+
if (ultragoalDurableCompletionReleasesStop(diagnostic.state)) continue;
|
|
826
|
+
const ultragoalMessage = `GJC ultragoal verification is blocking stop: ${diagnostic.message} Run \`gjc ultragoal checkpoint --status complete --quality-gate-json <file>\` or record review blockers before stopping.`;
|
|
827
|
+
return {
|
|
828
|
+
decision: "block",
|
|
829
|
+
reason: ultragoalMessage,
|
|
830
|
+
stopReason: `gjc_ultragoal_verification_${diagnostic.state}`,
|
|
831
|
+
systemMessage: ultragoalMessage,
|
|
832
|
+
};
|
|
873
833
|
}
|
|
874
834
|
const systemMessage = handoffRequired
|
|
875
835
|
? buildHandoffForceAskMessage(entry.skill, phase, statePath)
|