@gajae-code/coding-agent 0.11.9 → 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 +56 -1
- 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/model-registry.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/gjc-runtime/state-writer.d.ts +1 -0
- 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/controllers/selector-controller.d.ts +16 -8
- 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/daemon-paths.d.ts +1 -0
- package/dist/types/sdk/bus/index.d.ts +11 -2
- package/dist/types/sdk/bus/operator-runtime.d.ts +1 -0
- package/dist/types/sdk/bus/rate-limit-pool.d.ts +2 -0
- package/dist/types/sdk/bus/telegram-daemon-contract.d.ts +14 -7
- package/dist/types/sdk/bus/telegram-daemon.d.ts +97 -8
- 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/session.d.ts +7 -0
- package/dist/types/sdk/startup-capability.d.ts +6 -0
- package/dist/types/session/agent-session.d.ts +11 -11
- package/dist/types/session/fallback-chain-controller.d.ts +18 -2
- package/dist/types/session/internal/managed-session-scope.d.ts +28 -1
- package/dist/types/session/session-manager.d.ts +34 -0
- package/dist/types/task/executor.d.ts +6 -0
- package/dist/types/task/provider-retry-status.d.ts +13 -0
- package/dist/types/task/types.d.ts +39 -0
- package/dist/types/task/ultragoal-redteam-activation.d.ts +33 -0
- package/dist/types/tools/index.d.ts +3 -1
- package/dist/types/tools/resource-gc.d.ts +19 -0
- package/package.json +8 -8
- package/scripts/generate-sdk-operation-inventory.ts +3 -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/notify-cli.ts +1 -0
- 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 +31 -7
- package/src/config/model-registry.ts +4 -2
- 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/eval/js/tool-bridge.ts +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-draft.ts +2 -1
- package/src/gjc-runtime/deep-interview-recorder.ts +16 -1
- 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/gjc-runtime/state-writer.ts +1 -1
- package/src/hooks/skill-state.ts +23 -1
- package/src/internal-urls/docs-index.generated.ts +7 -7
- 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/controllers/selector-controller.ts +38 -8
- package/src/modes/interactive-mode.ts +65 -26
- package/src/modes/runtime-init.ts +1 -0
- package/src/prompts/agent-fragments/restricted-bash.md +1 -1
- package/src/prompts/agents/architect.md +8 -1
- package/src/prompts/agents/critic.md +8 -1
- package/src/prompts/agents/executor.md +1 -1
- package/src/prompts/agents/planner.md +8 -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/identity.ts +22 -12
- 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/daemon-paths.ts +2 -0
- package/src/sdk/bus/index.ts +222 -27
- package/src/sdk/bus/notification-service.ts +19 -5
- package/src/sdk/bus/operator-runtime.ts +31 -5
- package/src/sdk/bus/rate-limit-pool.ts +8 -0
- package/src/sdk/bus/telegram-cli.ts +6 -13
- package/src/sdk/bus/telegram-daemon-cli.ts +8 -3
- package/src/sdk/bus/telegram-daemon-contract.ts +15 -7
- package/src/sdk/bus/telegram-daemon-control.ts +14 -5
- package/src/sdk/bus/telegram-daemon.ts +1191 -164
- 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 +58 -0
- package/src/sdk/protocol/operation-registry.ts +1 -0
- package/src/sdk/session.ts +24 -1
- package/src/sdk/startup-capability.ts +6 -0
- package/src/session/agent-session.ts +290 -132
- package/src/session/fallback-chain-controller.ts +47 -8
- package/src/session/internal/managed-session-scope.ts +173 -127
- package/src/session/internal/native-publish-outcome.ts +8 -3
- package/src/session/session-manager.ts +608 -25
- package/src/skill-state/workflow-mutation-guard.ts +41 -7
- package/src/task/executor.ts +152 -42
- package/src/task/index.ts +2 -0
- package/src/task/provider-retry-status.ts +88 -0
- package/src/task/render.ts +45 -26
- package/src/task/types.ts +25 -11
- package/src/task/ultragoal-redteam-activation.ts +75 -0
- package/src/tools/bash-allowed-prefixes.ts +45 -1
- package/src/tools/index.ts +3 -1
- package/src/tools/resource-gc.ts +496 -120
- package/src/tools/subagent-render.ts +74 -16
- package/src/tools/subagent.ts +2 -0
- package/src/workflow/workflow-intent-diff.ts +4 -1
- package/vendor/insane-search/MANIFEST.json +4 -1
- package/vendor/insane-search/engine/bias_check.py +5 -0
- package/vendor/insane-search/engine/fetch_chain.py +67 -1
- package/vendor/insane-search/engine/transport.py +13 -2
- package/vendor/insane-search/engine/validators.py +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;
|
package/src/sdk/host/host.ts
CHANGED
|
@@ -18,7 +18,7 @@ export interface SessionSdkHostOptions extends HostEndpointAdapters {
|
|
|
18
18
|
connectionCapabilities?: (connectionId: string) => ReadonlySet<string> | undefined;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
const
|
|
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(
|
|
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:
|
|
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
|
-
...
|
|
38
|
+
...sessionOptions,
|
|
27
39
|
[lifecycleStartupCapabilityOption]: capability,
|
|
28
|
-
|
|
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",
|
|
@@ -2659,6 +2677,17 @@
|
|
|
2659
2677
|
"testIds": "not_applicable"
|
|
2660
2678
|
}
|
|
2661
2679
|
},
|
|
2680
|
+
{
|
|
2681
|
+
"sourceId": "agent_session:getToolForExecution",
|
|
2682
|
+
"sourceFile": "packages/coding-agent/src/session/agent-session.ts",
|
|
2683
|
+
"sourceKind": "agent_session",
|
|
2684
|
+
"decision": "exclude",
|
|
2685
|
+
"rationale": "internal accessor/plumbing, not a user-facing control seam",
|
|
2686
|
+
"exclusionMetadata": {
|
|
2687
|
+
"adapterMappings": "not_applicable",
|
|
2688
|
+
"testIds": "not_applicable"
|
|
2689
|
+
}
|
|
2690
|
+
},
|
|
2662
2691
|
{
|
|
2663
2692
|
"sourceId": "agent_session:registerForegroundBashBackgroundRequestHandler",
|
|
2664
2693
|
"sourceFile": "packages/coding-agent/src/session/agent-session.ts",
|
|
@@ -2907,6 +2936,17 @@
|
|
|
2907
2936
|
"testIds": "not_applicable"
|
|
2908
2937
|
}
|
|
2909
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
|
+
},
|
|
2910
2950
|
{
|
|
2911
2951
|
"sourceId": "agent_session:convertMessagesToLlm",
|
|
2912
2952
|
"sourceFile": "packages/coding-agent/src/session/agent-session.ts",
|
|
@@ -3710,6 +3750,24 @@
|
|
|
3710
3750
|
"testIds": "not_applicable"
|
|
3711
3751
|
}
|
|
3712
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
|
+
},
|
|
3713
3771
|
{
|
|
3714
3772
|
"sourceId": "agent_session:getConfiguredModelChain",
|
|
3715
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 = [
|
package/src/sdk/session.ts
CHANGED
|
@@ -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";
|
|
@@ -428,6 +429,13 @@ export interface CreateAgentSessionOptions {
|
|
|
428
429
|
goalToolAllowedOps?: readonly ("create" | "get" | "complete" | "resume" | "drop" | "pause")[];
|
|
429
430
|
/** Optional per-session allowlist for tools exposed through search_tool_bm25. */
|
|
430
431
|
discoverableToolAllowedNames?: readonly string[];
|
|
432
|
+
/**
|
|
433
|
+
* Discoverable built-in tools that must stay in the initial active set even when
|
|
434
|
+
* `tools.discoveryMode === "all"` would otherwise hide them behind `search_tool_bm25`.
|
|
435
|
+
* Used for coordination tools (e.g. `irc`) that a subagent must be able to use
|
|
436
|
+
* immediately without first spending a discovery round-trip to find them.
|
|
437
|
+
*/
|
|
438
|
+
alwaysActiveToolNames?: readonly string[];
|
|
431
439
|
/** Optional shared agent registry for IRC routing. Default: AgentRegistry.global(). */
|
|
432
440
|
agentRegistry?: AgentRegistry;
|
|
433
441
|
/** Parent task ID prefix for nested artifact naming (e.g., "6-Extensions") */
|
|
@@ -1021,6 +1029,11 @@ export async function createAgentSession(options: CreateAgentSessionOptions = {}
|
|
|
1021
1029
|
const lifecycleStartupCapability = (
|
|
1022
1030
|
options as CreateAgentSessionOptions & { [lifecycleStartupCapabilityOption]?: SdkStartupCapability }
|
|
1023
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];
|
|
1024
1037
|
const isCanonicalSubSession =
|
|
1025
1038
|
(options.taskDepth ?? 0) > 0 || Boolean(options.parentTaskPrefix) || Boolean(options.currentAgentType);
|
|
1026
1039
|
if (isCanonicalSubSession && options.mcpConfigPath !== undefined) {
|
|
@@ -1542,6 +1555,7 @@ export async function createAgentSession(options: CreateAgentSessionOptions = {}
|
|
|
1542
1555
|
goalToolAllowedOps: options.goalToolAllowedOps,
|
|
1543
1556
|
discoverableToolAllowedNames: options.discoverableToolAllowedNames,
|
|
1544
1557
|
getToolByName: name => session?.getToolByName(name),
|
|
1558
|
+
getToolForExecution: name => session?.getToolForExecution(name),
|
|
1545
1559
|
agentRegistry,
|
|
1546
1560
|
getSessionSpawns: () => options.spawns ?? "*",
|
|
1547
1561
|
getModelString: () => (hasExplicitModel && model ? formatModelString(model) : undefined),
|
|
@@ -1712,7 +1726,12 @@ export async function createAgentSession(options: CreateAgentSessionOptions = {}
|
|
|
1712
1726
|
|
|
1713
1727
|
const preExactCustomToolNames = customTools.map(tool => tool.name);
|
|
1714
1728
|
if (explicitMcpConfigPath !== undefined) {
|
|
1715
|
-
const owned = new MCPManager(cwd, null, {
|
|
1729
|
+
const owned = new MCPManager(cwd, null, {
|
|
1730
|
+
toolsOnly: true,
|
|
1731
|
+
...(lifecycleMcpStartupTimeoutMs !== undefined
|
|
1732
|
+
? { maxStartupTimeoutMs: lifecycleMcpStartupTimeoutMs }
|
|
1733
|
+
: {}),
|
|
1734
|
+
});
|
|
1716
1735
|
owned.setAuthStorage(authStorage);
|
|
1717
1736
|
mcpManager = owned;
|
|
1718
1737
|
ownsMcpManager = true;
|
|
@@ -2329,6 +2348,9 @@ export async function createAgentSession(options: CreateAgentSessionOptions = {}
|
|
|
2329
2348
|
// from the initial set unless they were explicitly requested or restored from persistence.
|
|
2330
2349
|
// The model finds them via search_tool_bm25 and activates them on demand.
|
|
2331
2350
|
if (effectiveDiscoveryMode === "all") {
|
|
2351
|
+
const alwaysActiveDiscoveredBuiltinNames = new Set(
|
|
2352
|
+
(options.alwaysActiveToolNames ?? []).map(name => name.toLowerCase()),
|
|
2353
|
+
);
|
|
2332
2354
|
const essentialBuiltinNames = new Set(computeEssentialBuiltinNames(settings));
|
|
2333
2355
|
const allowedDiscoveredBuiltinNames = options.discoverableToolAllowedNames
|
|
2334
2356
|
? new Set(options.discoverableToolAllowedNames.map(name => name.toLowerCase()))
|
|
@@ -2337,6 +2359,7 @@ export async function createAgentSession(options: CreateAgentSessionOptions = {}
|
|
|
2337
2359
|
const tool = toolRegistry.get(name);
|
|
2338
2360
|
if (!tool?.loadMode) return true; // not a built-in — leave MCP/custom/extension to existing logic
|
|
2339
2361
|
if (tool.loadMode === "essential") return true;
|
|
2362
|
+
if (alwaysActiveDiscoveredBuiltinNames.has(name)) return true;
|
|
2340
2363
|
return essentialBuiltinNames.has(name);
|
|
2341
2364
|
});
|
|
2342
2365
|
explicitlyRequestedDiscoveredBuiltinToolNames = selectRestorableDiscoveredBuiltinToolNames(
|
|
@@ -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 {
|