@gajae-code/coding-agent 0.11.10 → 0.11.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 +38 -0
- package/dist/types/cli.d.ts +8 -1
- package/dist/types/config/model-profile-activation.d.ts +1 -0
- package/dist/types/config/model-profile-contract.d.ts +2 -0
- package/dist/types/config/settings-schema.d.ts +57 -2
- package/dist/types/config/settings.d.ts +1 -0
- package/dist/types/extensibility/extensions/types.d.ts +21 -0
- package/dist/types/gjc-runtime/linux-proc.d.ts +22 -14
- package/dist/types/gjc-runtime/ralplan-runtime.d.ts +60 -0
- package/dist/types/gjc-runtime/state-runtime.d.ts +3 -1
- package/dist/types/modes/acp/acp-agent.d.ts +14 -9
- package/dist/types/modes/components/queue-pane.d.ts +8 -0
- package/dist/types/modes/components/queued-message-selector.d.ts +6 -0
- package/dist/types/modes/components/welcome.d.ts +1 -0
- package/dist/types/modes/interactive-mode.d.ts +5 -1
- package/dist/types/runtime/memory-domain.d.ts +9 -0
- package/dist/types/runtime/memory-guard-contract.d.ts +71 -0
- package/dist/types/runtime/memory-guard.d.ts +39 -0
- package/dist/types/runtime/memory-limit.d.ts +11 -0
- package/dist/types/runtime-mcp/manager.d.ts +8 -0
- package/dist/types/sdk/acp/final-text.d.ts +19 -0
- package/dist/types/sdk/acp/mcp.d.ts +23 -0
- package/dist/types/sdk/broker/lifecycle.d.ts +2 -0
- package/dist/types/sdk/bus/chat-daemon-control.d.ts +2 -1
- package/dist/types/sdk/bus/index.d.ts +3 -1
- package/dist/types/sdk/bus/rate-limit-pool.d.ts +2 -0
- package/dist/types/sdk/bus/telegram-daemon-contract.d.ts +6 -4
- package/dist/types/sdk/bus/telegram-daemon.d.ts +23 -3
- package/dist/types/sdk/host/control/operations.d.ts +1 -0
- package/dist/types/sdk/lifecycle-session.d.ts +10 -1
- package/dist/types/sdk/startup-capability.d.ts +6 -0
- package/dist/types/session/agent-session.d.ts +9 -11
- package/dist/types/session/fallback-chain-controller.d.ts +18 -2
- package/dist/types/session/internal/managed-session-scope.d.ts +27 -0
- package/dist/types/session/session-manager.d.ts +34 -0
- package/dist/types/task/executor.d.ts +6 -0
- package/dist/types/task/types.d.ts +36 -0
- package/dist/types/task/ultragoal-redteam-activation.d.ts +33 -0
- package/dist/types/tools/resource-gc.d.ts +19 -0
- package/package.json +8 -8
- package/scripts/generate-sdk-operation-inventory.ts +2 -0
- package/scripts/run-test-manifest.ts +6 -4
- package/src/cli/args.ts +14 -8
- package/src/cli/fast-help.ts +1 -1
- package/src/cli.ts +48 -2
- package/src/commands/sdk.ts +91 -7
- package/src/config/model-profile-activation.ts +1 -0
- package/src/config/model-profile-contract.ts +13 -0
- package/src/config/model-profiles.ts +24 -0
- package/src/config/settings-schema.ts +61 -2
- package/src/config/settings.ts +8 -0
- package/src/defaults/gjc/skills/ralplan/SKILL.md +21 -2
- package/src/defaults/gjc/skills/ultragoal/SKILL.md +1 -1
- package/src/extensibility/extensions/runner.ts +4 -0
- package/src/extensibility/extensions/types.ts +14 -0
- package/src/gjc-runtime/deep-interview-ambiguity.ts +16 -2
- package/src/gjc-runtime/deep-interview-state.ts +25 -3
- package/src/gjc-runtime/linux-proc.ts +70 -36
- package/src/gjc-runtime/ralplan-runtime.ts +252 -1
- package/src/gjc-runtime/state-runtime.ts +48 -11
- package/src/internal-urls/docs-index.generated.ts +4 -4
- package/src/internal-urls/local-protocol.ts +23 -4
- package/src/modes/acp/acp-agent.ts +554 -60
- package/src/modes/acp/acp-event-mapper.ts +93 -6
- package/src/modes/components/model-selector.ts +15 -1
- package/src/modes/components/notifications-settings-editor.ts +1 -1
- package/src/modes/components/queue-pane.ts +55 -9
- package/src/modes/components/queued-message-selector.ts +53 -10
- package/src/modes/components/tool-status-header.ts +1 -4
- package/src/modes/components/welcome.ts +18 -3
- package/src/modes/controllers/command-controller.ts +4 -0
- package/src/modes/controllers/extension-ui-controller.ts +4 -10
- package/src/modes/controllers/input-controller.ts +44 -3
- package/src/modes/interactive-mode.ts +65 -26
- package/src/modes/runtime-init.ts +1 -0
- package/src/prompts/agents/executor.md +1 -1
- package/src/runtime/memory-domain.ts +66 -0
- package/src/runtime/memory-guard-contract.ts +73 -0
- package/src/runtime/memory-guard.ts +292 -0
- package/src/runtime/memory-limit.ts +50 -0
- package/src/runtime-mcp/manager.ts +26 -6
- package/src/sdk/acp/adapter.ts +8 -1
- package/src/sdk/acp/final-text.ts +40 -0
- package/src/sdk/acp/mcp.ts +26 -0
- package/src/sdk/broker/lifecycle.ts +82 -1
- package/src/sdk/bus/chat-daemon-cli.ts +2 -2
- package/src/sdk/bus/chat-daemon-control.ts +4 -3
- package/src/sdk/bus/config.ts +1 -1
- package/src/sdk/bus/index.ts +162 -22
- package/src/sdk/bus/rate-limit-pool.ts +8 -0
- package/src/sdk/bus/telegram-daemon-contract.ts +6 -4
- package/src/sdk/bus/telegram-daemon.ts +531 -53
- package/src/sdk/host/control/dispatch.ts +2 -0
- package/src/sdk/host/control/operations.ts +1 -0
- package/src/sdk/host/host.ts +2 -2
- package/src/sdk/lifecycle-session.ts +19 -3
- package/src/sdk/protocol/operation-inventory.generated.json +47 -0
- package/src/sdk/protocol/operation-registry.ts +1 -0
- package/src/sdk/session.ts +12 -1
- package/src/sdk/startup-capability.ts +6 -0
- package/src/session/agent-session.ts +256 -142
- package/src/session/fallback-chain-controller.ts +47 -8
- package/src/session/internal/managed-session-scope.ts +40 -10
- package/src/session/internal/native-publish-outcome.ts +8 -3
- package/src/session/session-manager.ts +608 -25
- package/src/task/executor.ts +11 -3
- package/src/task/index.ts +2 -0
- package/src/task/types.ts +22 -11
- package/src/task/ultragoal-redteam-activation.ts +75 -0
- package/src/tools/resource-gc.ts +496 -120
- package/src/workflow/workflow-intent-diff.ts +4 -1
package/src/task/executor.ts
CHANGED
|
@@ -67,6 +67,7 @@ import {
|
|
|
67
67
|
TASK_SUBAGENT_PROGRESS_CHANNEL,
|
|
68
68
|
type TaskToolDetails,
|
|
69
69
|
} from "./types";
|
|
70
|
+
import { type ExecutorExecutionMode, resolveUltragoalRedTeamActivation } from "./ultragoal-redteam-activation";
|
|
70
71
|
|
|
71
72
|
/** Agent event types to forward for progress tracking. */
|
|
72
73
|
const agentEventTypes = new Set<AgentEvent["type"]>([
|
|
@@ -190,6 +191,11 @@ export interface ExecutorOptions {
|
|
|
190
191
|
agent: AgentDefinition;
|
|
191
192
|
task: string;
|
|
192
193
|
assignment?: string;
|
|
194
|
+
/**
|
|
195
|
+
* Typed executor execution mode. When set, overrides assignment-text heuristics
|
|
196
|
+
* for ultragoal red-team prompt injection (#2698 / #2456).
|
|
197
|
+
*/
|
|
198
|
+
executionMode?: ExecutorExecutionMode;
|
|
193
199
|
context?: string;
|
|
194
200
|
description?: string;
|
|
195
201
|
index: number;
|
|
@@ -1603,9 +1609,11 @@ export async function runSubprocess(options: ExecutorOptions): Promise<SingleRes
|
|
|
1603
1609
|
systemPrompt: defaultPrompt => {
|
|
1604
1610
|
const subagentPrompt = prompt.render(subagentSystemPromptTemplate, {
|
|
1605
1611
|
agent: prompt.render(agent.systemPrompt, {
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1612
|
+
// Typed executionMode wins; assignment text is compatibility-only (#2698 / #2456).
|
|
1613
|
+
ultragoalRedTeam: resolveUltragoalRedTeamActivation({
|
|
1614
|
+
executionMode: options.executionMode,
|
|
1615
|
+
assignment: options.assignment ?? task,
|
|
1616
|
+
}),
|
|
1609
1617
|
}),
|
|
1610
1618
|
context: options.context?.trim() ?? "",
|
|
1611
1619
|
worktree: worktree ?? "",
|
package/src/task/index.ts
CHANGED
|
@@ -1446,6 +1446,7 @@ export class TaskTool implements AgentTool<TaskToolSchemaInstance, TaskToolDetai
|
|
|
1446
1446
|
agent: effectiveAgent,
|
|
1447
1447
|
task: renderTaskAssignment(task.assignment, simpleMode),
|
|
1448
1448
|
assignment: task.assignment.trim(),
|
|
1449
|
+
executionMode: task.executionMode,
|
|
1449
1450
|
context: sharedContext,
|
|
1450
1451
|
description: task.description,
|
|
1451
1452
|
index,
|
|
@@ -1518,6 +1519,7 @@ export class TaskTool implements AgentTool<TaskToolSchemaInstance, TaskToolDetai
|
|
|
1518
1519
|
agent: effectiveAgent,
|
|
1519
1520
|
task: renderTaskAssignment(task.assignment, simpleMode),
|
|
1520
1521
|
assignment: task.assignment.trim(),
|
|
1522
|
+
executionMode: task.executionMode,
|
|
1521
1523
|
context: sharedContext,
|
|
1522
1524
|
description: task.description,
|
|
1523
1525
|
index,
|
package/src/task/types.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ThinkingLevel } from "@gajae-code/agent-core";
|
|
2
2
|
import type { Usage } from "@gajae-code/ai";
|
|
3
|
-
import { $
|
|
3
|
+
import { $env } from "@gajae-code/utils";
|
|
4
4
|
import * as z from "zod/v4";
|
|
5
5
|
import { isValidTaskId, TASK_ID_DESCRIPTION } from "./id";
|
|
6
6
|
import type { TaskResultReceipt } from "./receipt";
|
|
@@ -14,23 +14,28 @@ export type AgentSource = "bundled" | "user" | "project";
|
|
|
14
14
|
export type ForkContextPolicy = "forbidden" | "allowed";
|
|
15
15
|
export type ForkContextMode = "none" | "receipt" | "last-turn" | "bounded" | "full";
|
|
16
16
|
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
} catch {}
|
|
17
|
+
const parsePositiveIntegerEnvironment = (keys: string[], defaultValue: number): number => {
|
|
18
|
+
for (const key of keys) {
|
|
19
|
+
const value = $env[key];
|
|
20
|
+
if (!value || value.trim().length === 0) continue;
|
|
21
|
+
if (!/^\d+$/.test(value)) return defaultValue;
|
|
22
|
+
const number = Number(value);
|
|
23
|
+
return Number.isSafeInteger(number) && number > 0 ? number : defaultValue;
|
|
25
24
|
}
|
|
26
25
|
return defaultValue;
|
|
27
26
|
};
|
|
28
27
|
|
|
29
28
|
/** Maximum output bytes per agent */
|
|
30
|
-
export const MAX_OUTPUT_BYTES =
|
|
29
|
+
export const MAX_OUTPUT_BYTES = parsePositiveIntegerEnvironment(
|
|
30
|
+
["GJC_TASK_MAX_OUTPUT_BYTES", "PI_TASK_MAX_OUTPUT_BYTES"],
|
|
31
|
+
500_000,
|
|
32
|
+
);
|
|
31
33
|
|
|
32
34
|
/** Maximum output lines per agent */
|
|
33
|
-
export const MAX_OUTPUT_LINES =
|
|
35
|
+
export const MAX_OUTPUT_LINES = parsePositiveIntegerEnvironment(
|
|
36
|
+
["GJC_TASK_MAX_OUTPUT_LINES", "PI_TASK_MAX_OUTPUT_LINES"],
|
|
37
|
+
5000,
|
|
38
|
+
);
|
|
34
39
|
|
|
35
40
|
/** EventBus channel for raw subagent events */
|
|
36
41
|
export const TASK_SUBAGENT_EVENT_CHANNEL = "task:subagent:event";
|
|
@@ -92,6 +97,12 @@ const createTaskItemSchema = (_contextEnabled: boolean) =>
|
|
|
92
97
|
id: z.string().max(48).refine(isValidTaskId, TASK_ID_DESCRIPTION).describe("filesystem-safe task identifier"),
|
|
93
98
|
description: z.string().describe("ui label, not seen by subagent"),
|
|
94
99
|
assignment: z.string().describe(assignmentDescription),
|
|
100
|
+
executionMode: z
|
|
101
|
+
.enum(["default", "ultragoal-red-team"])
|
|
102
|
+
.optional()
|
|
103
|
+
.describe(
|
|
104
|
+
"typed executor mode: default keeps ordinary executor behavior; ultragoal-red-team injects the Ultragoal QA/red-team prompt fragment. Prefer this over free-form assignment text (#2698).",
|
|
105
|
+
),
|
|
95
106
|
inheritContext: z
|
|
96
107
|
.enum(["none", "receipt", "last-turn", "bounded", "full"])
|
|
97
108
|
.optional()
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Decide whether an executor assignment should inject the ultragoal red-team
|
|
3
|
+
* prompt fragment.
|
|
4
|
+
*
|
|
5
|
+
* Preference order (parse, don't re-validate later):
|
|
6
|
+
* 1. Explicit typed `executionMode` on the task / ExecutorOptions — authoritative.
|
|
7
|
+
* 2. Assignment text heuristics — only explicit Ultragoal QA/red-team phrasing.
|
|
8
|
+
*
|
|
9
|
+
* Bare mentions of `executorQa` (docs, quality-gate field names, negative
|
|
10
|
+
* instructions) must not flip the mode (#2698 / #2456).
|
|
11
|
+
*
|
|
12
|
+
* Mirrors `executor.md`:
|
|
13
|
+
* "activates only when the assignment explicitly labels Executor as Ultragoal
|
|
14
|
+
* completion QA/red-team or asks for `executorQa` red-team evidence."
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
export const EXECUTOR_EXECUTION_MODES = ["default", "ultragoal-red-team"] as const;
|
|
18
|
+
export type ExecutorExecutionMode = (typeof EXECUTOR_EXECUTION_MODES)[number];
|
|
19
|
+
|
|
20
|
+
const ULTRAGOAL_COMPLETION_QA = /\bultragoal\s+completion\s+(?:qa|red[-\s]?team)\b/i;
|
|
21
|
+
|
|
22
|
+
/** `executorQa` within a short window of red-team / matrix / evidence framing. */
|
|
23
|
+
const EXECUTOR_QA_EVIDENCE =
|
|
24
|
+
/\bexecutorQa\b[\s\S]{0,120}\b(?:red[-\s]?team|matrix|evidence)\b|\b(?:red[-\s]?team|matrix|evidence)\b[\s\S]{0,120}\bexecutorQa\b/i;
|
|
25
|
+
|
|
26
|
+
/** Common Ultragoal skill spawn phrasing: "executor QA/red-team lane". */
|
|
27
|
+
const EXECUTOR_QA_LANE = /\bexecutor\b[\s\S]{0,48}\b(?:qa|red[-\s]?team)\s+lane\b/i;
|
|
28
|
+
|
|
29
|
+
export function isExecutorExecutionMode(value: unknown): value is ExecutorExecutionMode {
|
|
30
|
+
return value === "default" || value === "ultragoal-red-team";
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Parse a caller-supplied mode. Unknown values fail closed to `undefined`
|
|
35
|
+
* so the assignment heuristic (or default off) still applies — never invent on.
|
|
36
|
+
*/
|
|
37
|
+
export function parseExecutorExecutionMode(value: unknown): ExecutorExecutionMode | undefined {
|
|
38
|
+
if (typeof value !== "string") return undefined;
|
|
39
|
+
const normalized = value.trim().toLowerCase().replaceAll("_", "-");
|
|
40
|
+
if (normalized === "default" || normalized === "ordinary" || normalized === "implement") {
|
|
41
|
+
return "default";
|
|
42
|
+
}
|
|
43
|
+
if (
|
|
44
|
+
normalized === "ultragoal-red-team" ||
|
|
45
|
+
normalized === "ultragoal-redteam" ||
|
|
46
|
+
normalized === "red-team" ||
|
|
47
|
+
normalized === "redteam" ||
|
|
48
|
+
normalized === "executor-qa"
|
|
49
|
+
) {
|
|
50
|
+
return "ultragoal-red-team";
|
|
51
|
+
}
|
|
52
|
+
return undefined;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function assignmentRequestsUltragoalRedTeam(assignment: string | undefined): boolean {
|
|
56
|
+
const text = assignment?.trim() ?? "";
|
|
57
|
+
if (text.length === 0) return false;
|
|
58
|
+
return ULTRAGOAL_COMPLETION_QA.test(text) || EXECUTOR_QA_EVIDENCE.test(text) || EXECUTOR_QA_LANE.test(text);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface ResolveUltragoalRedTeamArgs {
|
|
62
|
+
readonly executionMode?: unknown;
|
|
63
|
+
readonly assignment?: string;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Final activation decision for the executor prompt fragment.
|
|
68
|
+
* Typed mode wins; assignment text is a compatibility fallback only.
|
|
69
|
+
*/
|
|
70
|
+
export function resolveUltragoalRedTeamActivation(args: ResolveUltragoalRedTeamArgs): boolean {
|
|
71
|
+
const mode = parseExecutorExecutionMode(args.executionMode);
|
|
72
|
+
if (mode === "ultragoal-red-team") return true;
|
|
73
|
+
if (mode === "default") return false;
|
|
74
|
+
return assignmentRequestsUltragoalRedTeam(args.assignment);
|
|
75
|
+
}
|