@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.
Files changed (111) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/dist/types/cli.d.ts +8 -1
  3. package/dist/types/config/model-profile-activation.d.ts +1 -0
  4. package/dist/types/config/model-profile-contract.d.ts +2 -0
  5. package/dist/types/config/settings-schema.d.ts +57 -2
  6. package/dist/types/config/settings.d.ts +1 -0
  7. package/dist/types/extensibility/extensions/types.d.ts +21 -0
  8. package/dist/types/gjc-runtime/linux-proc.d.ts +22 -14
  9. package/dist/types/gjc-runtime/ralplan-runtime.d.ts +60 -0
  10. package/dist/types/gjc-runtime/state-runtime.d.ts +3 -1
  11. package/dist/types/modes/acp/acp-agent.d.ts +14 -9
  12. package/dist/types/modes/components/queue-pane.d.ts +8 -0
  13. package/dist/types/modes/components/queued-message-selector.d.ts +6 -0
  14. package/dist/types/modes/components/welcome.d.ts +1 -0
  15. package/dist/types/modes/interactive-mode.d.ts +5 -1
  16. package/dist/types/runtime/memory-domain.d.ts +9 -0
  17. package/dist/types/runtime/memory-guard-contract.d.ts +71 -0
  18. package/dist/types/runtime/memory-guard.d.ts +39 -0
  19. package/dist/types/runtime/memory-limit.d.ts +11 -0
  20. package/dist/types/runtime-mcp/manager.d.ts +8 -0
  21. package/dist/types/sdk/acp/final-text.d.ts +19 -0
  22. package/dist/types/sdk/acp/mcp.d.ts +23 -0
  23. package/dist/types/sdk/broker/lifecycle.d.ts +2 -0
  24. package/dist/types/sdk/bus/chat-daemon-control.d.ts +2 -1
  25. package/dist/types/sdk/bus/index.d.ts +3 -1
  26. package/dist/types/sdk/bus/rate-limit-pool.d.ts +2 -0
  27. package/dist/types/sdk/bus/telegram-daemon-contract.d.ts +6 -4
  28. package/dist/types/sdk/bus/telegram-daemon.d.ts +23 -3
  29. package/dist/types/sdk/host/control/operations.d.ts +1 -0
  30. package/dist/types/sdk/lifecycle-session.d.ts +10 -1
  31. package/dist/types/sdk/startup-capability.d.ts +6 -0
  32. package/dist/types/session/agent-session.d.ts +9 -11
  33. package/dist/types/session/fallback-chain-controller.d.ts +18 -2
  34. package/dist/types/session/internal/managed-session-scope.d.ts +27 -0
  35. package/dist/types/session/session-manager.d.ts +34 -0
  36. package/dist/types/task/executor.d.ts +6 -0
  37. package/dist/types/task/types.d.ts +36 -0
  38. package/dist/types/task/ultragoal-redteam-activation.d.ts +33 -0
  39. package/dist/types/tools/resource-gc.d.ts +19 -0
  40. package/package.json +8 -8
  41. package/scripts/generate-sdk-operation-inventory.ts +2 -0
  42. package/scripts/run-test-manifest.ts +6 -4
  43. package/src/cli/args.ts +14 -8
  44. package/src/cli/fast-help.ts +1 -1
  45. package/src/cli.ts +48 -2
  46. package/src/commands/sdk.ts +91 -7
  47. package/src/config/model-profile-activation.ts +1 -0
  48. package/src/config/model-profile-contract.ts +13 -0
  49. package/src/config/model-profiles.ts +24 -0
  50. package/src/config/settings-schema.ts +61 -2
  51. package/src/config/settings.ts +8 -0
  52. package/src/defaults/gjc/skills/ralplan/SKILL.md +21 -2
  53. package/src/defaults/gjc/skills/ultragoal/SKILL.md +1 -1
  54. package/src/extensibility/extensions/runner.ts +4 -0
  55. package/src/extensibility/extensions/types.ts +14 -0
  56. package/src/gjc-runtime/deep-interview-ambiguity.ts +16 -2
  57. package/src/gjc-runtime/deep-interview-state.ts +25 -3
  58. package/src/gjc-runtime/linux-proc.ts +70 -36
  59. package/src/gjc-runtime/ralplan-runtime.ts +252 -1
  60. package/src/gjc-runtime/state-runtime.ts +48 -11
  61. package/src/internal-urls/docs-index.generated.ts +4 -4
  62. package/src/internal-urls/local-protocol.ts +23 -4
  63. package/src/modes/acp/acp-agent.ts +554 -60
  64. package/src/modes/acp/acp-event-mapper.ts +93 -6
  65. package/src/modes/components/model-selector.ts +15 -1
  66. package/src/modes/components/notifications-settings-editor.ts +1 -1
  67. package/src/modes/components/queue-pane.ts +55 -9
  68. package/src/modes/components/queued-message-selector.ts +53 -10
  69. package/src/modes/components/tool-status-header.ts +1 -4
  70. package/src/modes/components/welcome.ts +18 -3
  71. package/src/modes/controllers/command-controller.ts +4 -0
  72. package/src/modes/controllers/extension-ui-controller.ts +4 -10
  73. package/src/modes/controllers/input-controller.ts +44 -3
  74. package/src/modes/interactive-mode.ts +65 -26
  75. package/src/modes/runtime-init.ts +1 -0
  76. package/src/prompts/agents/executor.md +1 -1
  77. package/src/runtime/memory-domain.ts +66 -0
  78. package/src/runtime/memory-guard-contract.ts +73 -0
  79. package/src/runtime/memory-guard.ts +292 -0
  80. package/src/runtime/memory-limit.ts +50 -0
  81. package/src/runtime-mcp/manager.ts +26 -6
  82. package/src/sdk/acp/adapter.ts +8 -1
  83. package/src/sdk/acp/final-text.ts +40 -0
  84. package/src/sdk/acp/mcp.ts +26 -0
  85. package/src/sdk/broker/lifecycle.ts +82 -1
  86. package/src/sdk/bus/chat-daemon-cli.ts +2 -2
  87. package/src/sdk/bus/chat-daemon-control.ts +4 -3
  88. package/src/sdk/bus/config.ts +1 -1
  89. package/src/sdk/bus/index.ts +162 -22
  90. package/src/sdk/bus/rate-limit-pool.ts +8 -0
  91. package/src/sdk/bus/telegram-daemon-contract.ts +6 -4
  92. package/src/sdk/bus/telegram-daemon.ts +531 -53
  93. package/src/sdk/host/control/dispatch.ts +2 -0
  94. package/src/sdk/host/control/operations.ts +1 -0
  95. package/src/sdk/host/host.ts +2 -2
  96. package/src/sdk/lifecycle-session.ts +19 -3
  97. package/src/sdk/protocol/operation-inventory.generated.json +47 -0
  98. package/src/sdk/protocol/operation-registry.ts +1 -0
  99. package/src/sdk/session.ts +12 -1
  100. package/src/sdk/startup-capability.ts +6 -0
  101. package/src/session/agent-session.ts +256 -142
  102. package/src/session/fallback-chain-controller.ts +47 -8
  103. package/src/session/internal/managed-session-scope.ts +40 -10
  104. package/src/session/internal/native-publish-outcome.ts +8 -3
  105. package/src/session/session-manager.ts +608 -25
  106. package/src/task/executor.ts +11 -3
  107. package/src/task/index.ts +2 -0
  108. package/src/task/types.ts +22 -11
  109. package/src/task/ultragoal-redteam-activation.ts +75 -0
  110. package/src/tools/resource-gc.ts +496 -120
  111. package/src/workflow/workflow-intent-diff.ts +4 -1
@@ -167,6 +167,8 @@ function invoke(
167
167
  return surface.replaceTodo(input.items);
168
168
  case "model.set":
169
169
  return surface.setModel(text(input, "id"), input.thinkingLevel);
170
+ case "model.profile.set":
171
+ return surface.setModelProfile(text(input, "id"));
170
172
  case "model.cycle":
171
173
  return surface.cycleModel();
172
174
  case "thinking.set":
@@ -24,6 +24,7 @@ export interface ControlSurface {
24
24
  operateGoal(op: string, objective?: string): Promise<ControlValue> | ControlValue;
25
25
  replaceTodo(items: ControlValue): Promise<ControlValue> | ControlValue;
26
26
  setModel(id: string, thinkingLevel?: ControlValue): Promise<ControlValue> | ControlValue;
27
+ setModelProfile(id: string): Promise<ControlValue> | ControlValue;
27
28
  cycleModel(): Promise<ControlValue> | ControlValue;
28
29
  setThinking(level: ControlValue): Promise<ControlValue> | ControlValue;
29
30
  cycleThinking(): Promise<ControlValue> | ControlValue;
@@ -18,7 +18,7 @@ export interface SessionSdkHostOptions extends HostEndpointAdapters {
18
18
  connectionCapabilities?: (connectionId: string) => ReadonlySet<string> | undefined;
19
19
  }
20
20
 
21
- const TOOL_ACTIVITY_V1 = "tool_activity_v1";
21
+ const TOOL_ACTIVITY_CAPABILITY = "tool_activity_v2";
22
22
  const CAP_GATED_FRAME_KINDS = new Set(["tool_activity", "reasoning_summary"]);
23
23
  const EMPTY_CAPABILITIES: ReadonlySet<string> = new Set();
24
24
 
@@ -233,7 +233,7 @@ export class SessionSdkHost {
233
233
  const replay = this.events.replay(sinceSeq, sinceGeneration);
234
234
  const capabilities = this.#options.connectionCapabilities?.(connectionId) ?? EMPTY_CAPABILITIES;
235
235
  const events = replay.events.filter(
236
- event => !CAP_GATED_FRAME_KINDS.has(String(event.kind)) || capabilities.has(TOOL_ACTIVITY_V1),
236
+ event => !CAP_GATED_FRAME_KINDS.has(String(event.kind)) || capabilities.has(TOOL_ACTIVITY_CAPABILITY),
237
237
  );
238
238
  await this.#send(connectionId, {
239
239
  type: "event_replay_result",
@@ -1,6 +1,7 @@
1
1
  import type { AgentSession } from "../session/agent-session";
2
2
  import { type CreateAgentSessionOptions, createAgentSession } from "./session";
3
3
  import {
4
+ lifecycleMcpStartupTimeoutOption,
4
5
  lifecycleStartupCapabilityOption,
5
6
  SdkStartupCapability,
6
7
  type SdkStartupFailure,
@@ -15,17 +16,32 @@ export type CreateLifecycleAgentSessionResult =
15
16
  }
16
17
  | { capability: SdkStartupCapability; rollback: SdkStartupRollbackTracker; failure: SdkStartupFailure };
17
18
 
19
+ /** Options accepted by lifecycle-only session construction. */
20
+ export type CreateLifecycleAgentSessionOptions = CreateAgentSessionOptions & {
21
+ /**
22
+ * Startup budget for ACP lifecycle MCP launches, in milliseconds. Set only
23
+ * when the lifecycle request supplies `mcpServers`; ordinary consumers keep
24
+ * the manager's short default ceiling.
25
+ */
26
+ mcpStartupTimeoutMs?: number;
27
+ };
28
+
18
29
  /** Internal lifecycle-only session construction with an owner-bound SDK startup result. */
19
30
  export async function createLifecycleAgentSession(
20
- options: CreateAgentSessionOptions = {},
31
+ options: CreateLifecycleAgentSessionOptions = {},
21
32
  ): Promise<CreateLifecycleAgentSessionResult> {
22
33
  const rollback = new SdkStartupRollbackTracker();
23
34
  const capability = new SdkStartupCapability(rollback);
24
35
  try {
36
+ const { mcpStartupTimeoutMs, ...sessionOptions } = options;
25
37
  const internalOptions = {
26
- ...options,
38
+ ...sessionOptions,
27
39
  [lifecycleStartupCapabilityOption]: capability,
28
- } as CreateAgentSessionOptions & { [lifecycleStartupCapabilityOption]: SdkStartupCapability };
40
+ ...(mcpStartupTimeoutMs !== undefined ? { [lifecycleMcpStartupTimeoutOption]: mcpStartupTimeoutMs } : {}),
41
+ } as CreateAgentSessionOptions & {
42
+ [lifecycleStartupCapabilityOption]: SdkStartupCapability;
43
+ [lifecycleMcpStartupTimeoutOption]?: number;
44
+ };
29
45
  const result = await createAgentSession(internalOptions);
30
46
  if (!result.session.extensionRunner)
31
47
  capability.settleFailure(capability.normalizeFailure("registration", "runner_absent"));
@@ -935,6 +935,24 @@
935
935
  "packages/coding-agent/test/sdk-operation-inventory.test.ts"
936
936
  ]
937
937
  },
938
+ {
939
+ "sourceId": "registry:C53",
940
+ "sourceFile": "packages/coding-agent/src/sdk/protocol/operation-registry.ts",
941
+ "sourceKind": "registry",
942
+ "decision": "include",
943
+ "sdkId": "model.profile.set",
944
+ "adapterMappings": {
945
+ "telegram": "generic_safe",
946
+ "discord": "generic_safe",
947
+ "slack": "generic_safe",
948
+ "mcp": "generic_safe",
949
+ "acp": "generic_safe",
950
+ "daemonCli": "generic_safe"
951
+ },
952
+ "testIds": [
953
+ "packages/coding-agent/test/sdk-operation-inventory.test.ts"
954
+ ]
955
+ },
938
956
  {
939
957
  "sourceId": "registry:G01",
940
958
  "sourceFile": "packages/coding-agent/src/sdk/protocol/operation-registry.ts",
@@ -2918,6 +2936,17 @@
2918
2936
  "testIds": "not_applicable"
2919
2937
  }
2920
2938
  },
2939
+ {
2940
+ "sourceId": "agent_session:buildPreparedDisplaySessionContext",
2941
+ "sourceFile": "packages/coding-agent/src/session/agent-session.ts",
2942
+ "sourceKind": "agent_session",
2943
+ "decision": "exclude",
2944
+ "rationale": "internal accessor/plumbing, not a user-facing control seam",
2945
+ "exclusionMetadata": {
2946
+ "adapterMappings": "not_applicable",
2947
+ "testIds": "not_applicable"
2948
+ }
2949
+ },
2921
2950
  {
2922
2951
  "sourceId": "agent_session:convertMessagesToLlm",
2923
2952
  "sourceFile": "packages/coding-agent/src/session/agent-session.ts",
@@ -3721,6 +3750,24 @@
3721
3750
  "testIds": "not_applicable"
3722
3751
  }
3723
3752
  },
3753
+ {
3754
+ "sourceId": "agent_session:activateModelProfileForControl",
3755
+ "sourceFile": "packages/coding-agent/src/session/agent-session.ts",
3756
+ "sourceKind": "agent_session",
3757
+ "decision": "include",
3758
+ "sdkId": "model.profile.set",
3759
+ "adapterMappings": {
3760
+ "telegram": "generic_safe",
3761
+ "discord": "generic_safe",
3762
+ "slack": "generic_safe",
3763
+ "mcp": "generic_safe",
3764
+ "acp": "generic_safe",
3765
+ "daemonCli": "generic_safe"
3766
+ },
3767
+ "testIds": [
3768
+ "packages/coding-agent/test/sdk-operation-inventory.test.ts"
3769
+ ]
3770
+ },
3724
3771
  {
3725
3772
  "sourceId": "agent_session:getConfiguredModelChain",
3726
3773
  "sourceFile": "packages/coding-agent/src/session/agent-session.ts",
@@ -116,6 +116,7 @@ const controls = [
116
116
  ["retry.last", "Retry the last interrupted or failed turn."],
117
117
  ["retry.now", "Immediately retry pending backoff."],
118
118
  ["bash.background", "Move active managed bash to the background."],
119
+ ["model.profile.set", "Activate a model profile for the current session."],
119
120
  ] as const;
120
121
 
121
122
  const globals = [
@@ -168,6 +168,7 @@ import { buildNamedToolChoice, buildNamedToolChoiceResult } from "../utils/tool-
168
168
  import { buildWorkspaceTree, type WorkspaceTree } from "../workspace-tree";
169
169
  import {
170
170
  attachLifecycleStartupCapability,
171
+ lifecycleMcpStartupTimeoutOption,
171
172
  lifecycleStartupCapabilityOption,
172
173
  type SdkStartupCapability,
173
174
  } from "./startup-capability";
@@ -1028,6 +1029,11 @@ export async function createAgentSession(options: CreateAgentSessionOptions = {}
1028
1029
  const lifecycleStartupCapability = (
1029
1030
  options as CreateAgentSessionOptions & { [lifecycleStartupCapabilityOption]?: SdkStartupCapability }
1030
1031
  )[lifecycleStartupCapabilityOption];
1032
+ // ACP lifecycle launches carry their own MCP startup budget; every other
1033
+ // consumer keeps the manager's short default ceiling.
1034
+ const lifecycleMcpStartupTimeoutMs = (
1035
+ options as CreateAgentSessionOptions & { [lifecycleMcpStartupTimeoutOption]?: number }
1036
+ )[lifecycleMcpStartupTimeoutOption];
1031
1037
  const isCanonicalSubSession =
1032
1038
  (options.taskDepth ?? 0) > 0 || Boolean(options.parentTaskPrefix) || Boolean(options.currentAgentType);
1033
1039
  if (isCanonicalSubSession && options.mcpConfigPath !== undefined) {
@@ -1720,7 +1726,12 @@ export async function createAgentSession(options: CreateAgentSessionOptions = {}
1720
1726
 
1721
1727
  const preExactCustomToolNames = customTools.map(tool => tool.name);
1722
1728
  if (explicitMcpConfigPath !== undefined) {
1723
- const owned = new MCPManager(cwd, null, { toolsOnly: true });
1729
+ const owned = new MCPManager(cwd, null, {
1730
+ toolsOnly: true,
1731
+ ...(lifecycleMcpStartupTimeoutMs !== undefined
1732
+ ? { maxStartupTimeoutMs: lifecycleMcpStartupTimeoutMs }
1733
+ : {}),
1734
+ });
1724
1735
  owned.setAuthStorage(authStorage);
1725
1736
  mcpManager = owned;
1726
1737
  ownsMcpManager = true;
@@ -22,6 +22,12 @@ const MAX_MESSAGE_BYTES = 512;
22
22
 
23
23
  /** Internal symbols for lifecycle-only SDK startup construction and bus wiring. */
24
24
  export const lifecycleStartupCapabilityOption: unique symbol = Symbol("lifecycleStartupCapability");
25
+ /**
26
+ * Internal option carrying the startup budget for ACP lifecycle MCP launches.
27
+ * Only set when the lifecycle request actually supplies `mcpServers`, so the
28
+ * longer ceiling never leaks to ordinary CLI/SDK `mcpConfigPath` consumers.
29
+ */
30
+ export const lifecycleMcpStartupTimeoutOption: unique symbol = Symbol("lifecycleMcpStartupTimeout");
25
31
  const lifecycleStartupCapabilityOnApi: unique symbol = Symbol("lifecycleStartupCapabilityOnApi");
26
32
 
27
33
  export function attachLifecycleStartupCapability(api: object, capability: SdkStartupCapability): void {