qlogicagent 2.20.1 → 2.20.3
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/dist/agent-contract.js +1 -1
- package/dist/agent.js +39 -35
- package/dist/cli.js +1 -1
- package/dist/host-contract.js +1 -1
- package/dist/host-session-collection-contract.js +1 -1
- package/dist/index.js +624 -549
- package/dist/memory-category-contract.js +1 -0
- package/dist/orchestration.js +1 -1
- package/dist/project-memory-host.js +21 -21
- package/dist/protocol.js +1 -1
- package/dist/skill-category-contract.js +1 -0
- package/dist/skills/builtin/web-research/SKILL.md +37 -0
- package/dist/skills/mcp/astraclaw-native-mcp-server.js +1 -1
- package/dist/tunables.js +1 -1
- package/dist/types/agent/memory-recall-context.d.ts +6 -9
- package/dist/types/agent/memory-recall-injection.d.ts +1 -6
- package/dist/types/agent/tool-loop/agent-argument-normalizer.d.ts +12 -0
- package/dist/types/agent/tool-loop/artifact-final-contract.d.ts +8 -0
- package/dist/types/agent/tool-loop.d.ts +5 -0
- package/dist/types/agent/types.d.ts +5 -0
- package/dist/types/cli/acp-extended-handlers.d.ts +11 -9
- package/dist/types/cli/acp-session-handlers.d.ts +1 -1
- package/dist/types/cli/acp-session-host.d.ts +8 -0
- package/dist/types/cli/agent-runtime-bootstrap.d.ts +7 -1
- package/dist/types/cli/agent-runtime-session-state.d.ts +23 -6
- package/dist/types/cli/atomic-text-file.d.ts +31 -0
- package/dist/types/cli/background-context-capsule.d.ts +12 -0
- package/dist/types/cli/base-tool-bootstrap.d.ts +1 -0
- package/dist/types/cli/cli-acp-request-handler.d.ts +3 -1
- package/dist/types/cli/community-workflow-installer.d.ts +1 -1
- package/dist/types/cli/core-tool-coordinator.d.ts +1 -0
- package/dist/types/cli/core-tools/agent-tool-service.d.ts +17 -1
- package/dist/types/cli/dev-tool-bootstrap.d.ts +3 -2
- package/dist/types/cli/dev-tools/dev-tool-bootstrap-service.d.ts +1 -0
- package/dist/types/cli/dev-tools/dev-tool-registry.d.ts +3 -1
- package/dist/types/cli/dev-tools/incremental-repo-map.d.ts +81 -0
- package/dist/types/cli/dev-tools/lsp-supervisor.d.ts +59 -0
- package/dist/types/cli/dev-tools/lsp-tool-service.d.ts +2 -0
- package/dist/types/cli/handlers/dream-handler.d.ts +1 -1
- package/dist/types/cli/handlers/memory-handler.d.ts +2 -14
- package/dist/types/cli/handlers/product-handler.d.ts +6 -24
- package/dist/types/cli/handlers/turn-handler.d.ts +1 -0
- package/dist/types/cli/idle-dream-coordinator.d.ts +9 -5
- package/dist/types/cli/memory-background-coordinator.d.ts +26 -0
- package/dist/types/cli/memory-candidate-service.d.ts +2 -3
- package/dist/types/cli/memory-coordinator.d.ts +12 -8
- package/dist/types/cli/permission-bootstrap.d.ts +10 -1
- package/dist/types/cli/product-acp-params.d.ts +29 -0
- package/dist/types/cli/resolved-agent-cache.d.ts +18 -7
- package/dist/types/cli/rpc-registry.d.ts +2 -1
- package/dist/types/cli/runtime-hook-bootstrap.d.ts +2 -0
- package/dist/types/cli/stdio-acp-request-host.d.ts +7 -4
- package/dist/types/cli/stdio-agent-session-bootstrap.d.ts +8 -2
- package/dist/types/cli/stdio-rpc-handler-hosts.d.ts +4 -2
- package/dist/types/cli/stdio-runtime-bootstrap.d.ts +1 -0
- package/dist/types/cli/stdio-server.d.ts +49 -16
- package/dist/types/cli/stdio-session-runtime-coordinator.d.ts +0 -2
- package/dist/types/cli/task-distillation-coordinator.d.ts +42 -14
- package/dist/types/cli/tool-bootstrap-core-registration.d.ts +14 -4
- package/dist/types/cli/tool-bootstrap.d.ts +2 -1
- package/dist/types/cli/turn-core.d.ts +4 -0
- package/dist/types/cli/turn-lifecycle.d.ts +1 -0
- package/dist/types/contracts/hooks.d.ts +3 -2
- package/dist/types/contracts/turn-event.d.ts +7 -0
- package/dist/types/host-contract/index.d.ts +111 -12
- package/dist/types/host-contract/memory-category.d.ts +8 -0
- package/dist/types/host-contract/skill-category.d.ts +5 -0
- package/dist/types/host-session-collection-contract.d.ts +1 -0
- package/dist/types/orchestration/agent-instance.d.ts +15 -0
- package/dist/types/orchestration/dag-scheduler.d.ts +18 -0
- package/dist/types/orchestration/delegate-approval-policy.d.ts +8 -0
- package/dist/types/orchestration/goal-acceptance.d.ts +2 -5
- package/dist/types/orchestration/goal-loop-coordinator.d.ts +4 -2
- package/dist/types/orchestration/goal-mode-adapters.d.ts +16 -0
- package/dist/types/orchestration/goal-run-types.d.ts +6 -1
- package/dist/types/orchestration/product-budget.d.ts +35 -16
- package/dist/types/orchestration/product-persistence.d.ts +5 -14
- package/dist/types/orchestration/product-planner.d.ts +38 -0
- package/dist/types/orchestration/product-worktree.d.ts +4 -2
- package/dist/types/orchestration/solo-evaluator.d.ts +42 -2
- package/dist/types/orchestration/solo-spec-builder.d.ts +3 -0
- package/dist/types/orchestration/testing/delegate-test-bridge.d.ts +6 -0
- package/dist/types/orchestration/testing/run-state-client-double.d.ts +13 -0
- package/dist/types/orchestration/workflow/builtin-capabilities.d.ts +3 -0
- package/dist/types/orchestration/workflow/capability-catalog.d.ts +31 -0
- package/dist/types/orchestration/workflow/cron-schedule.d.ts +3 -4
- package/dist/types/orchestration/workflow/expression.d.ts +2 -1
- package/dist/types/orchestration/workflow/n8n-import.d.ts +3 -0
- package/dist/types/orchestration/workflow/node-registry.d.ts +2 -2
- package/dist/types/orchestration/workflow/node-schema.d.ts +20 -4
- package/dist/types/orchestration/workflow/params-schema.d.ts +7 -6
- package/dist/types/orchestration/workflow/qla-executor-host.d.ts +4 -1
- package/dist/types/orchestration/workflow/run-history-store.d.ts +33 -3
- package/dist/types/orchestration/workflow/semantic-acceptance.d.ts +65 -0
- package/dist/types/orchestration/workflow/workflow-authoring.d.ts +74 -0
- package/dist/types/orchestration/workflow/workflow-bundle.d.ts +4 -0
- package/dist/types/orchestration/workflow/workflow-controller.d.ts +16 -4
- package/dist/types/orchestration/workflow/workflow-edit-context.d.ts +46 -0
- package/dist/types/orchestration/workflow/workflow-intent-contract.d.ts +56 -0
- package/dist/types/orchestration/workflow/workflow-patch.d.ts +7 -0
- package/dist/types/orchestration/workflow/workflow-runtime.d.ts +5 -0
- package/dist/types/orchestration/workflow/workflow-scheduler.d.ts +11 -0
- package/dist/types/orchestration/workflow/workflow-store.d.ts +5 -0
- package/dist/types/orchestration/workflow/workflow-template-setup.d.ts +65 -0
- package/dist/types/orchestration/workflow/workflow-trigger.d.ts +4 -0
- package/dist/types/orchestration/workflow-chat-builder.d.ts +105 -20
- package/dist/types/orchestration/worktree-task-prompt.d.ts +1 -0
- package/dist/types/protocol/agent-contract.d.ts +49 -8
- package/dist/types/protocol/notifications.d.ts +1 -1
- package/dist/types/protocol/wire/acp-agent-management.d.ts +97 -9
- package/dist/types/protocol/wire/acp-protocol.d.ts +7 -1
- package/dist/types/protocol/wire/agent-methods.d.ts +15 -1
- package/dist/types/protocol/wire/index.d.ts +2 -4
- package/dist/types/protocol/wire/memory-provider-lifecycle.d.ts +1 -39
- package/dist/types/protocol/wire/notification-payloads.d.ts +96 -1
- package/dist/types/protocol/wire/web-capability.d.ts +2 -2
- package/dist/types/runtime/config/tunable-defaults.d.ts +0 -6
- package/dist/types/runtime/execution/bounded-output-tail.d.ts +7 -0
- package/dist/types/runtime/execution/dream-agent.d.ts +8 -5
- package/dist/types/runtime/execution/dream-category-context.d.ts +3 -3
- package/dist/types/runtime/execution/structured-tool-progress.d.ts +21 -0
- package/dist/types/runtime/hooks/memory-hooks.d.ts +20 -8
- package/dist/types/runtime/infra/background-tasks.d.ts +5 -1
- package/dist/types/runtime/infra/subagent-turn-snapshot.d.ts +32 -0
- package/dist/types/runtime/infra/turn-telemetry-store.d.ts +22 -0
- package/dist/types/runtime/memory/implicit-extraction.d.ts +23 -7
- package/dist/types/runtime/ports/agent-runtime-ports.d.ts +0 -5
- package/dist/types/runtime/ports/index.d.ts +2 -3
- package/dist/types/runtime/ports/memory-provider.d.ts +31 -16
- package/dist/types/runtime/ports/memory-writer.d.ts +55 -6
- package/dist/types/runtime/ports/permission-contracts.d.ts +2 -0
- package/dist/types/runtime/ports/tool-contracts.d.ts +3 -1
- package/dist/types/runtime/prompt/identity-section.d.ts +2 -0
- package/dist/types/runtime/session/session-permission-store.d.ts +6 -0
- package/dist/types/runtime/tasks/task-types.d.ts +2 -0
- package/dist/types/skills/memory/host-memory-provider.d.ts +59 -9
- package/dist/types/skills/memory/memory-tool.d.ts +3 -1
- package/dist/types/skills/memory/task-distillation.d.ts +22 -3
- package/dist/types/skills/permissions/hook-runner.d.ts +8 -0
- package/dist/types/skills/permissions/operation-classifier.d.ts +7 -0
- package/dist/types/skills/skill-system/skill-category.d.ts +10 -0
- package/dist/types/skills/tools/agent-tool.d.ts +13 -21
- package/dist/types/skills/tools/edit-tool.d.ts +10 -2
- package/dist/types/skills/tools/exec-tool.d.ts +2 -2
- package/dist/types/skills/tools/file-text-snapshot.d.ts +24 -0
- package/dist/types/skills/tools/lsp-tool.d.ts +1 -1
- package/dist/types/skills/tools/patch-tool.d.ts +10 -3
- package/dist/types/skills/tools/read-tool.d.ts +23 -1
- package/dist/types/skills/tools/repo-map-tool.d.ts +52 -0
- package/dist/types/skills/tools/search-tool.d.ts +10 -1
- package/dist/types/skills/tools/shell/index.d.ts +1 -2
- package/dist/types/skills/tools/shell/shell-command.d.ts +1 -1
- package/dist/types/skills/tools/shell/shell-exec.d.ts +2 -2
- package/dist/types/skills/tools/shell/task-output.d.ts +12 -3
- package/dist/types/skills/tools/subagent-decision-tool.d.ts +15 -0
- package/dist/types/skills/tools/task-tool.d.ts +16 -2
- package/dist/types/skills/tools/write-tool.d.ts +2 -1
- package/dist/types/transport/acp-server.d.ts +1 -0
- package/dist/types/transport/host-run-state-client.d.ts +6 -0
- package/dist/types/workflow-host.d.ts +8 -1
- package/dist/workflow-host.js +9 -9
- package/package.json +25 -6
- package/dist/types/cli/tool-bootstrap-web-registration.d.ts +0 -14
- package/dist/types/orchestration/tool-cascade.d.ts +0 -49
- package/dist/types/protocol/wire/channel-ingress.d.ts +0 -29
- package/dist/types/protocol/wire/channel.d.ts +0 -89
- package/dist/types/runtime/infra/native-mcp-config-sync.d.ts +0 -16
- package/dist/types/runtime/memory/categories.d.ts +0 -5
- package/dist/types/runtime/memory/recall-category-filter.d.ts +0 -42
- package/dist/types/runtime/ports/source-provider.d.ts +0 -39
- package/dist/types/runtime/ports/web-search-contracts.d.ts +0 -21
- package/dist/types/server/search-svc.d.ts +0 -1
- package/dist/types/skills/memory/local-embedding.d.ts +0 -80
- package/dist/types/skills/memory/memory-config-resolver.d.ts +0 -4
- package/dist/types/skills/memory/memory-embedding-config.d.ts +0 -31
- package/dist/types/skills/tools/web-answer-tool.d.ts +0 -27
- package/dist/types/skills/tools/web-fetch-tool.d.ts +0 -80
- package/dist/types/skills/tools/web-research-tool.d.ts +0 -48
- package/dist/types/skills/tools/web-search-tool.d.ts +0 -46
- package/dist/types/skills/web-search/brave-source.d.ts +0 -3
- package/dist/types/skills/web-search/crawl4ai-extractor.d.ts +0 -16
- package/dist/types/skills/web-search/embedding-rerank.d.ts +0 -13
- package/dist/types/skills/web-search/exa-source.d.ts +0 -3
- package/dist/types/skills/web-search/multi-source-backend.d.ts +0 -23
- package/dist/types/skills/web-search/redis-source-cache.d.ts +0 -6
- package/dist/types/skills/web-search/search-svc-source.d.ts +0 -5
- package/dist/types/skills/web-search/searxng-source.d.ts +0 -4
- package/dist/types/skills/web-search/serper-source.d.ts +0 -3
- package/dist/types/skills/web-search/source-factory.d.ts +0 -6
- package/dist/types/skills/web-search/stability.d.ts +0 -26
- package/dist/types/skills/web-search/web-tunable-resolver.d.ts +0 -16
|
@@ -17,23 +17,23 @@ export interface IdleDreamCoordinatorOptions {
|
|
|
17
17
|
randomId?: () => string;
|
|
18
18
|
timers?: IdleDreamTimers;
|
|
19
19
|
log(message: string): void;
|
|
20
|
-
sendNotification(method: string, params: Record<string, unknown>): void;
|
|
21
20
|
getCurrentSessionId(): string;
|
|
22
21
|
getCurrentTurnCount(): number;
|
|
23
|
-
|
|
22
|
+
hasForegroundTurn(): boolean;
|
|
24
23
|
resolveDreamClient(): IdleDreamClient | null;
|
|
25
24
|
resolveMemoryRoot(): string;
|
|
26
25
|
resolveTranscriptDir(): string;
|
|
27
26
|
listRecentSessions(): Promise<Array<{
|
|
28
27
|
sessionId: string;
|
|
29
28
|
}>>;
|
|
30
|
-
runDream(message: AgentRpcRequest): Promise<void>;
|
|
29
|
+
runDream(message: AgentRpcRequest, signal: AbortSignal): Promise<void>;
|
|
30
|
+
runBackgroundWork(label: string, work: (signal: AbortSignal) => Promise<void>): Promise<boolean>;
|
|
31
31
|
/**
|
|
32
32
|
* Optional idle-time hook run on every idle fire BEFORE the dream gates (so it is not blocked by
|
|
33
33
|
* dream cooldown / missing LLM transport). Used for the feedback redaction+upload sweep
|
|
34
34
|
* (design §9 item 5). Errors are swallowed so a sweep failure never breaks dream.
|
|
35
35
|
*/
|
|
36
|
-
onIdle?(): Promise<void>;
|
|
36
|
+
onIdle?(signal: AbortSignal): Promise<void>;
|
|
37
37
|
}
|
|
38
38
|
export declare class IdleDreamCoordinator {
|
|
39
39
|
private readonly options;
|
|
@@ -42,12 +42,16 @@ export declare class IdleDreamCoordinator {
|
|
|
42
42
|
private readonly randomId;
|
|
43
43
|
private readonly timers;
|
|
44
44
|
private idleTimer;
|
|
45
|
+
private idleCycle;
|
|
46
|
+
private idleDreamTurnId;
|
|
45
47
|
constructor(options: IdleDreamCoordinatorOptions);
|
|
46
48
|
applyEnvOverrides(env: Record<string, string | undefined>): void;
|
|
47
49
|
enable(minutes?: number): void;
|
|
48
|
-
handleTurnNotification(method: string): void;
|
|
50
|
+
handleTurnNotification(method: string, params?: Record<string, unknown>): void;
|
|
51
|
+
yieldToForegroundTurn(): void;
|
|
49
52
|
cancelTimer(): void;
|
|
50
53
|
resetTimer(): void;
|
|
51
54
|
triggerIdleDream(): Promise<void>;
|
|
55
|
+
private runIdleDreamCycle;
|
|
52
56
|
}
|
|
53
57
|
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export type MemoryBackgroundWork = (signal: AbortSignal) => Promise<void>;
|
|
2
|
+
export interface MemoryBackgroundCoordinatorOptions {
|
|
3
|
+
defaultTimeoutMs?: number;
|
|
4
|
+
idleCycleTimeoutMs?: number;
|
|
5
|
+
maxTimeoutRetries?: number;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* One process-wide lane for memory learning work. Foreground turns have strict
|
|
9
|
+
* priority: they abort active work and queued jobs resume serially afterwards.
|
|
10
|
+
*/
|
|
11
|
+
export declare class MemoryBackgroundCoordinator {
|
|
12
|
+
private readonly log;
|
|
13
|
+
private foregroundReservations;
|
|
14
|
+
private active;
|
|
15
|
+
private readonly queue;
|
|
16
|
+
private nextSequence;
|
|
17
|
+
private readonly defaultTimeoutMs;
|
|
18
|
+
private readonly idleCycleTimeoutMs;
|
|
19
|
+
private readonly maxTimeoutRetries;
|
|
20
|
+
constructor(log?: (message: string) => void, options?: MemoryBackgroundCoordinatorOptions);
|
|
21
|
+
beginForegroundTurn(): void;
|
|
22
|
+
endForegroundTurn(): void;
|
|
23
|
+
schedule(label: string, work: MemoryBackgroundWork): Promise<boolean>;
|
|
24
|
+
private enqueue;
|
|
25
|
+
private drain;
|
|
26
|
+
}
|
|
@@ -14,10 +14,9 @@ export interface MemoryCandidateHost {
|
|
|
14
14
|
memoryProvider?: {
|
|
15
15
|
search?(query: string, userId: string, options?: {
|
|
16
16
|
limit?: number;
|
|
17
|
-
minScore?: number;
|
|
18
17
|
}): Promise<Array<{
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
id: string;
|
|
19
|
+
content: string;
|
|
21
20
|
score?: number;
|
|
22
21
|
metadata?: Record<string, unknown>;
|
|
23
22
|
}>>;
|
|
@@ -2,15 +2,16 @@ import { type HostRequestRequester } from "../skills/memory/host-memory-provider
|
|
|
2
2
|
import { type MemoryPrefetchState } from "../runtime/hooks/memory-hooks.js";
|
|
3
3
|
import type { HookRegistry } from "../contracts/hooks.js";
|
|
4
4
|
import type { RuntimeLogger } from "../runtime/hooks/hook-registry.js";
|
|
5
|
-
import type { MemoryDreamRuntimeProvider, MemoryHandlerProvider, MemoryLearningSink, MemoryProvider, MemoryRuntimeHookProvider, MemoryToolProvider, ProjectMemoryStore, ToolCatalog } from "../runtime/ports/index.js";
|
|
5
|
+
import type { MemoryDreamRuntimeProvider, MemoryExtractionQueue, MemoryHandlerProvider, MemoryLearningSink, MemoryProvider, MemoryRuntimeHookProvider, MemoryToolProvider, ProjectMemoryStore, ToolCatalog } from "../runtime/ports/index.js";
|
|
6
6
|
import type { LLMTransport } from "./provider-core-facade.js";
|
|
7
7
|
export interface MemoryProviderState {
|
|
8
|
-
recallProvider: MemoryProvider
|
|
9
|
-
runtimeHookProvider: MemoryRuntimeHookProvider
|
|
10
|
-
learningSink: MemoryLearningSink
|
|
11
|
-
toolProvider: MemoryToolProvider
|
|
12
|
-
handlerProvider: MemoryHandlerProvider
|
|
13
|
-
dreamProvider: MemoryDreamRuntimeProvider
|
|
8
|
+
recallProvider: MemoryProvider;
|
|
9
|
+
runtimeHookProvider: MemoryRuntimeHookProvider;
|
|
10
|
+
learningSink: MemoryLearningSink;
|
|
11
|
+
toolProvider: MemoryToolProvider;
|
|
12
|
+
handlerProvider: MemoryHandlerProvider;
|
|
13
|
+
dreamProvider: MemoryDreamRuntimeProvider;
|
|
14
|
+
extractionQueue: MemoryExtractionQueue;
|
|
14
15
|
userId: string;
|
|
15
16
|
}
|
|
16
17
|
/** Host-request access exposed by the ACP protocol coordinator. */
|
|
@@ -18,7 +19,7 @@ export interface MemoryHostRequestAccess {
|
|
|
18
19
|
supportsHostRequestService(service: "memory"): boolean;
|
|
19
20
|
readonly hostRequest: HostRequestRequester;
|
|
20
21
|
}
|
|
21
|
-
/** 装配期绑定(stdio-runtime-services 注入;lazy resolver——gate 在创建时刻现读)
|
|
22
|
+
/** 装配期绑定(stdio-runtime-services 注入;lazy resolver——gate 在创建时刻现读)。 */
|
|
22
23
|
export declare function bindMemoryHostRequestAccess(resolve: () => MemoryHostRequestAccess | null): void;
|
|
23
24
|
export declare function ensureHostMemoryProvider(currentUserId: string): MemoryProviderState;
|
|
24
25
|
export interface RegisterMemoryRuntimeHooksDeps {
|
|
@@ -33,6 +34,7 @@ export interface RegisterMemoryRuntimeHooksDeps {
|
|
|
33
34
|
apiKey: string;
|
|
34
35
|
model: string;
|
|
35
36
|
} | null;
|
|
37
|
+
scheduleBackgroundMemoryWork(label: string, work: (signal: AbortSignal) => Promise<void>): Promise<boolean>;
|
|
36
38
|
/** Part B recall visibility: forwards turn.memory_recall to the client. */
|
|
37
39
|
sendNotification?: (method: string, params: Record<string, unknown>) => void;
|
|
38
40
|
}
|
|
@@ -42,6 +44,8 @@ export interface RegisterMemoryToolDeps {
|
|
|
42
44
|
getMemdir?: () => ProjectMemoryStore;
|
|
43
45
|
memoryProvider: MemoryToolProvider | null;
|
|
44
46
|
memoryUserId: string;
|
|
47
|
+
sessionId?: string;
|
|
48
|
+
getTurnId?: () => string;
|
|
45
49
|
toolCatalog: ToolCatalog;
|
|
46
50
|
sendNotification?: (method: string, params: Record<string, unknown>) => void;
|
|
47
51
|
}
|
|
@@ -2,6 +2,7 @@ import type { HookRegistry } from "../contracts/hooks.js";
|
|
|
2
2
|
import type { NotificationMethod, NotificationMethodMap } from "../protocol/notifications.js";
|
|
3
3
|
import type { AcpPermissionRequestParams } from "../protocol/wire/index.js";
|
|
4
4
|
import type { ToolCatalog } from "../runtime/ports/index.js";
|
|
5
|
+
import { type SandboxPermissionSnapshot } from "./tool-bootstrap.js";
|
|
5
6
|
import type { HostProfileClient } from "../transport/host-profile-client.js";
|
|
6
7
|
import { type RuntimePermissionChecker, type RuntimePermissionRuleEngine } from "./permission-runtime-service.js";
|
|
7
8
|
export { createApprovalResponseFromAcpOption } from "./permission-approval-bridge.js";
|
|
@@ -31,11 +32,19 @@ export interface PermissionBootstrapDeps {
|
|
|
31
32
|
} | undefined;
|
|
32
33
|
sendNotification<M extends NotificationMethod>(method: M, params: NotificationMethodMap[M]): void;
|
|
33
34
|
resolveHostProfileClient?: () => HostProfileClient | undefined;
|
|
34
|
-
|
|
35
|
+
sessionPermissionStore?: {
|
|
36
|
+
loadAllowedDirectories(sessionId: string, projectRoot: string): string[];
|
|
37
|
+
appendAllowedDirectory(sessionId: string, projectRoot: string, pathPrefix: string): Promise<void>;
|
|
38
|
+
};
|
|
39
|
+
/** Existing session engine reused when an Agent is rebuilt for the same session. */
|
|
40
|
+
existingRuleEngine?: RuntimePermissionRuleEngine;
|
|
41
|
+
/** AsyncLocal-aware resolver supplied by the pooled stdio host. */
|
|
42
|
+
resolveSandboxPermissionSnapshot?: () => SandboxPermissionSnapshot | undefined;
|
|
35
43
|
}
|
|
36
44
|
export interface PermissionBootstrapResult {
|
|
37
45
|
permissionChecker: RuntimePermissionChecker;
|
|
38
46
|
permissionUnregister: () => void;
|
|
39
47
|
ruleEngine: RuntimePermissionRuleEngine;
|
|
48
|
+
groupSecurityActive: boolean;
|
|
40
49
|
}
|
|
41
50
|
export declare function configurePermissionBootstrap(deps: PermissionBootstrapDeps): PermissionBootstrapResult;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime validation for the `x/product.*` ACP write surface.
|
|
3
|
+
*
|
|
4
|
+
* Every product entry point casts with `params as unknown as XParams`, and the only fields anything
|
|
5
|
+
* actually checked were projectId / canonicalSessionId / cwd (via requireGatewayProjectContext).
|
|
6
|
+
* `instances`, `tasks`, `budget`, `productId` and `taskId` reached the orchestrator unvalidated, so a
|
|
7
|
+
* malformed frame surfaced far downstream — an empty assignee died at dispatch with
|
|
8
|
+
* `No instance found for assignee ""`, a missing prompt produced a task that could only fail, and a
|
|
9
|
+
* non-array `tasks` threw somewhere inside DagScheduler construction.
|
|
10
|
+
*
|
|
11
|
+
* Validate at the boundary and fail with an actionable message naming the offending field.
|
|
12
|
+
*/
|
|
13
|
+
/** `instances[]` — each needs a name (assignees reference it) and an agentId (the provider to spawn). */
|
|
14
|
+
export declare function assertProductInstances(value: unknown, field?: string): void;
|
|
15
|
+
/** `tasks[]` — taskId/assignee/prompt are all load-bearing at dispatch time. */
|
|
16
|
+
export declare function assertProductTasks(value: unknown, field?: string): void;
|
|
17
|
+
/** `budget` is optional, but a present one must carry usable numbers rather than silently doing nothing. */
|
|
18
|
+
export declare function assertProductBudget(value: unknown, field?: string): void;
|
|
19
|
+
export declare function assertProductId(params: Record<string, unknown>): string;
|
|
20
|
+
export declare function assertProductTaskId(params: Record<string, unknown>): string;
|
|
21
|
+
/**
|
|
22
|
+
* `x/product.create` — the orchestrator builds the DAG straight from these.
|
|
23
|
+
*
|
|
24
|
+
* `name` is deliberately NOT required here: existing callers omit it and the orchestrator derives a
|
|
25
|
+
* display name. Only the fields that cause a downstream failure are enforced.
|
|
26
|
+
*/
|
|
27
|
+
export declare function assertProductCreateParams(params: Record<string, unknown>): void;
|
|
28
|
+
/** `x/product.confirm` — the user-edited final payload; same shape requirements as create. */
|
|
29
|
+
export declare function assertProductConfirmParams(params: Record<string, unknown>): void;
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
*/
|
|
20
20
|
import type { Agent } from "../agent/agent.js";
|
|
21
21
|
import type { LLMTransport } from "./provider-core-facade.js";
|
|
22
|
+
import type { SessionRuntimeState } from "./agent-runtime-session-state.js";
|
|
22
23
|
export interface ResolvedAgentSnapshot {
|
|
23
24
|
agent: Agent;
|
|
24
25
|
transport: LLMTransport;
|
|
@@ -27,6 +28,10 @@ export interface ResolvedAgentSnapshot {
|
|
|
27
28
|
provider: string;
|
|
28
29
|
baseUrl: string;
|
|
29
30
|
configKey: string;
|
|
31
|
+
runtimeGeneration?: SessionRuntimeState;
|
|
32
|
+
}
|
|
33
|
+
export interface ResolvedAgentView extends Omit<ResolvedAgentSnapshot, "agent"> {
|
|
34
|
+
agent: Agent | null;
|
|
30
35
|
}
|
|
31
36
|
/**
|
|
32
37
|
* ToolInvoker captures a session overlay at Agent construction, so equal provider/model settings
|
|
@@ -34,15 +39,21 @@ export interface ResolvedAgentSnapshot {
|
|
|
34
39
|
*/
|
|
35
40
|
export declare function buildSessionAgentConfigKey(sessionId: string, resolvedConfigKey: string, mcpConfigKey?: string): string;
|
|
36
41
|
export declare class ResolvedAgentCache {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
private readonly snapshotsByConfigKey;
|
|
43
|
+
private readonly latestConfigKeyBySession;
|
|
44
|
+
private lastConfigKey;
|
|
45
|
+
private get lastSnapshot();
|
|
46
|
+
get agent(): Agent | null;
|
|
47
|
+
get transport(): LLMTransport | null;
|
|
48
|
+
get apiKey(): string;
|
|
49
|
+
get model(): string;
|
|
50
|
+
get provider(): string;
|
|
51
|
+
get baseUrl(): string;
|
|
44
52
|
/** True when a cached Agent matches the given resolved config key. */
|
|
45
53
|
matches(configKey: string): boolean;
|
|
54
|
+
getRuntimeGeneration(configKey: string): SessionRuntimeState | undefined;
|
|
55
|
+
getForSession(sessionId: string): ResolvedAgentView | undefined;
|
|
56
|
+
get(configKey: string): ResolvedAgentView | undefined;
|
|
46
57
|
/** Store the freshly resolved Agent + LLM client snapshot. */
|
|
47
58
|
store(snapshot: ResolvedAgentSnapshot): void;
|
|
48
59
|
/** Drop only the Agent + config key — force re-resolve, keep the last snapshot. */
|
|
@@ -30,7 +30,7 @@ export type RpcMethodHandler = (msg: AgentRpcRequest) => void | Promise<void>;
|
|
|
30
30
|
* adapters, just applied uniformly across every RPC domain.
|
|
31
31
|
*/
|
|
32
32
|
export interface TaskDistillationRpcSurface {
|
|
33
|
-
runPass(reason: "manual"): Promise<object>;
|
|
33
|
+
runPass(reason: "manual", signal?: AbortSignal): Promise<object>;
|
|
34
34
|
listProposals(): Promise<unknown[]>;
|
|
35
35
|
dismissProposal(id: string): Promise<boolean>;
|
|
36
36
|
acknowledgeProposal(id: string): Promise<boolean>;
|
|
@@ -41,6 +41,7 @@ export interface TaskDistillationRpcSurface {
|
|
|
41
41
|
export interface RpcHandlerHosts {
|
|
42
42
|
/** R3/V3 蒸馏晋升面(惰性:首调时构造 coordinator)。 */
|
|
43
43
|
getTaskDistillation?: () => TaskDistillationRpcSurface;
|
|
44
|
+
scheduleBackgroundMemoryWork(label: string, work: (signal: AbortSignal) => Promise<void>): Promise<boolean>;
|
|
44
45
|
config: ConfigHandlerHost;
|
|
45
46
|
control: ControlHandlerHost;
|
|
46
47
|
session: SessionHandlerHost;
|
|
@@ -10,6 +10,7 @@ export interface RuntimeHookBootstrapDeps {
|
|
|
10
10
|
taskStore: TaskStore;
|
|
11
11
|
backgroundTasks: BackgroundTaskManager;
|
|
12
12
|
sessionId: string;
|
|
13
|
+
getTurnId(): string;
|
|
13
14
|
projectRoot: string;
|
|
14
15
|
memdir: ProjectMemoryStore;
|
|
15
16
|
getMemdir?: () => ProjectMemoryStore | null;
|
|
@@ -23,6 +24,7 @@ export interface RuntimeHookBootstrapDeps {
|
|
|
23
24
|
apiKey: string;
|
|
24
25
|
model: string;
|
|
25
26
|
} | null;
|
|
27
|
+
scheduleBackgroundMemoryWork(label: string, work: (signal: AbortSignal) => Promise<void>): Promise<boolean>;
|
|
26
28
|
compressionClient: {
|
|
27
29
|
transport: LLMTransport;
|
|
28
30
|
apiKey: string;
|
|
@@ -8,7 +8,7 @@ import type { CliAcpRequestHandlerHost } from "./cli-acp-request-handler.js";
|
|
|
8
8
|
* (`this: any`), so members it touches must be forwarded here explicitly;
|
|
9
9
|
* see TURN_PIPELINE_HOST_MEMBERS for the regression-tested list.
|
|
10
10
|
*/
|
|
11
|
-
export type StdioAcpRequestHostSource = Pick<CliAcpRequestHandlerHost, "activeTurn" | "acpSessionMeta" | "acpSessionMetaBySession" | "currentHooks" | "currentSessionId" | "currentTurnId" | "memoryPrefetchState" | "permissionChecker" | "sessionHistory" | "sessionLlmConfigBySession" | "materializedSessionProfiles" | "sessionState" | "cancelIdleDreamTimer" | "disposeSessionRuntime" | "disposeSessionMcp" | "runInSessionScope" | "enableIdleDream" | "ensureDefaultProject" | "initializeHostProjectAuthority" | "ensureModelRegistryHydrated" | "getActiveProjectRoot" | "log" | "sendNotification" | "setActiveWorkdir"> & {
|
|
11
|
+
export type StdioAcpRequestHostSource = Pick<CliAcpRequestHandlerHost, "activeTurn" | "turnDone" | "acpSessionMeta" | "acpSessionMetaBySession" | "currentHooks" | "currentSessionId" | "currentTurnId" | "memoryPrefetchState" | "permissionChecker" | "sessionHistory" | "sessionLlmConfigBySession" | "materializedSessionProfiles" | "sessionState" | "cancelIdleDreamTimer" | "disposeSessionRuntime" | "disposeSessionPermissions" | "disposeSessionMcp" | "runInSessionScope" | "runInExistingSessionScope" | "beginForegroundTurn" | "endForegroundTurn" | "enableIdleDream" | "ensureDefaultProject" | "initializeHostProjectAuthority" | "ensureModelRegistryHydrated" | "getActiveProjectRoot" | "log" | "sendNotification" | "setActiveWorkdir"> & {
|
|
12
12
|
currentModel: string | undefined;
|
|
13
13
|
lastAssistantMessageForExtract: string | undefined;
|
|
14
14
|
lastUserMessageForAutoExtract: string | undefined;
|
|
@@ -18,7 +18,9 @@ export type StdioAcpRequestHostSource = Pick<CliAcpRequestHandlerHost, "activeTu
|
|
|
18
18
|
projectMemoryStoreFactory: unknown;
|
|
19
19
|
toolCatalog: unknown;
|
|
20
20
|
taskDistillation: unknown;
|
|
21
|
-
cancelBackgroundTasksForSession(sessionId?: string): void;
|
|
21
|
+
cancelBackgroundTasksForSession(sessionId?: string, parentTurnId?: string): void;
|
|
22
|
+
beginTurnRequest(): number;
|
|
23
|
+
isTurnRequestCurrent(generation: number): boolean;
|
|
22
24
|
configureTurnMedia(config: Record<string, unknown> | undefined, turnId: string): void;
|
|
23
25
|
getAcpPermissionSession(): {
|
|
24
26
|
sessionId: string;
|
|
@@ -27,12 +29,13 @@ export type StdioAcpRequestHostSource = Pick<CliAcpRequestHandlerHost, "activeTu
|
|
|
27
29
|
}>;
|
|
28
30
|
} | undefined;
|
|
29
31
|
getHostRequestClient(): Pick<HostRequestClient, "request"> | undefined;
|
|
30
|
-
drainPendingTaskNotifications(): string[];
|
|
32
|
+
drainPendingTaskNotifications(sessionId: string): string[];
|
|
31
33
|
resolveAgent(config: unknown, projectRoot?: string): unknown;
|
|
32
34
|
resolveClientForPurpose(purpose: unknown): unknown;
|
|
35
|
+
scheduleBackgroundMemoryWork(label: string, work: (signal: AbortSignal) => Promise<void>): Promise<boolean>;
|
|
33
36
|
sendResponse(id: string | number, result?: unknown, error?: unknown): void;
|
|
34
37
|
};
|
|
35
38
|
/** Host members the shared turn pipeline reads/writes — keep in sync with
|
|
36
39
|
* `grep -oE "this\.[a-zA-Z]+" src/cli/handlers/turn-handler.ts | sort -u`. */
|
|
37
|
-
export declare const TURN_PIPELINE_HOST_MEMBERS: readonly ["activeTurn", "configureTurnMedia", "currentHooks", "currentModel", "currentTurnId", "drainPendingTaskNotifications", "getAcpPermissionSession", "getHostRequestClient", "getActiveProjectRoot", "lastAssistantMessageForExtract", "lastUserMessageForAutoExtract", "log", "mcpReady", "memdir", "pendingAskUser", "permissionChecker", "projectMemoryStoreFactory", "resolveAgent", "resolveClientForPurpose", "sendNotification", "sendResponse", "sessionHistory", "sessionState", "setActiveWorkdir", "taskDistillation", "toolCatalog"];
|
|
40
|
+
export declare const TURN_PIPELINE_HOST_MEMBERS: readonly ["activeTurn", "turnDone", "beginForegroundTurn", "beginTurnRequest", "configureTurnMedia", "currentHooks", "currentModel", "currentTurnId", "isTurnRequestCurrent", "drainPendingTaskNotifications", "endForegroundTurn", "getAcpPermissionSession", "getHostRequestClient", "getActiveProjectRoot", "lastAssistantMessageForExtract", "lastUserMessageForAutoExtract", "log", "mcpReady", "memdir", "pendingAskUser", "permissionChecker", "projectMemoryStoreFactory", "resolveAgent", "resolveClientForPurpose", "scheduleBackgroundMemoryWork", "sendNotification", "sendResponse", "sessionHistory", "sessionState", "setActiveWorkdir", "taskDistillation", "toolCatalog"];
|
|
38
41
|
export declare function createStdioAcpRequestHandlerHost(host: StdioAcpRequestHostSource): CliAcpRequestHandlerHost;
|
|
@@ -15,6 +15,7 @@ import type { ResolvedTextGenerationConfig } from "./model-client-resolver.js";
|
|
|
15
15
|
import type { LLMTransport, ProviderRegistry } from "./provider-core-facade.js";
|
|
16
16
|
import type { MediaPersistence } from "../runtime/infra/media-persistence.js";
|
|
17
17
|
import type { FileWatcher } from "./agent-runtime-bootstrap.js";
|
|
18
|
+
import type { SandboxPermissionSnapshot } from "./tool-bootstrap.js";
|
|
18
19
|
export interface StdioAgentSessionBootstrapDeps {
|
|
19
20
|
config: Record<string, unknown> & {
|
|
20
21
|
maxRounds?: number;
|
|
@@ -27,6 +28,7 @@ export interface StdioAgentSessionBootstrapDeps {
|
|
|
27
28
|
getTurnId(): string;
|
|
28
29
|
projectRoot: string;
|
|
29
30
|
pathService: PathService;
|
|
31
|
+
getActiveWorkdir?: () => string;
|
|
30
32
|
memdir: ProjectMemoryStore;
|
|
31
33
|
getMemdir?: () => ProjectMemoryStore | null;
|
|
32
34
|
currentUserId: string;
|
|
@@ -38,14 +40,17 @@ export interface StdioAgentSessionBootstrapDeps {
|
|
|
38
40
|
apiKey: string;
|
|
39
41
|
model: string;
|
|
40
42
|
} | null;
|
|
43
|
+
scheduleBackgroundMemoryWork(label: string, work: (signal: AbortSignal) => Promise<void>): Promise<boolean>;
|
|
41
44
|
providerRegistry: ProviderRegistry;
|
|
42
45
|
mediaPersistence: MediaPersistence;
|
|
43
46
|
toolCatalog: ToolCatalog;
|
|
44
47
|
runtimeSession: {
|
|
45
|
-
permissionUnregister: (() => void) | null;
|
|
46
48
|
fileWatcher: FileWatcher | null;
|
|
47
49
|
getPluginSkills(): ReturnType<PluginLoader["getPluginSkills"]>;
|
|
48
|
-
|
|
50
|
+
getPermissionState(sessionId: string): {
|
|
51
|
+
ruleEngine: PermissionRuleEnginePort;
|
|
52
|
+
} | undefined;
|
|
53
|
+
applyBootstrap(sessionId: string, result: {
|
|
49
54
|
hooks: HookRegistry;
|
|
50
55
|
memoryHandlerProvider: MemoryHandlerProvider | null;
|
|
51
56
|
memoryDreamProvider: MemoryDreamRuntimeProvider | null;
|
|
@@ -63,6 +68,7 @@ export interface StdioAgentSessionBootstrapDeps {
|
|
|
63
68
|
setMcpConfigKey(configKey: string): void;
|
|
64
69
|
setPluginLoader(loader: PluginLoader): void;
|
|
65
70
|
setFileWatcher(watcher: FileWatcher | null): void;
|
|
71
|
+
resolveSandboxPermissionSnapshot?(): SandboxPermissionSnapshot | undefined;
|
|
66
72
|
getAcpPermissionSession(): {
|
|
67
73
|
sessionId: string;
|
|
68
74
|
requestPermission(params: AcpPermissionRequestParams): Promise<{
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import type { LLMRequest } from "../agent/types.js";
|
|
2
2
|
import type { ModelPurpose } from "../runtime/infra/model-registry.js";
|
|
3
|
+
import type { ProjectMemoryStore, ProjectMemoryStoreFactory } from "../runtime/ports/index.js";
|
|
3
4
|
import type { MultiAgentHandlerHost } from "./multi-agent-handler-host.js";
|
|
4
5
|
import type { RpcHandlerHosts } from "./rpc-registry.js";
|
|
5
6
|
type DirectStdioRpcHost = RpcHandlerHosts["config"] & RpcHandlerHosts["control"] & RpcHandlerHosts["files"] & RpcHandlerHosts["skills"] & RpcHandlerHosts["community"] & {
|
|
6
7
|
currentTurnId?: string;
|
|
7
8
|
/** Mid-turn guidance queue (运行中引导) — shared between handleTurnGuide and the tool loop's drain. */
|
|
8
9
|
pendingTurnGuidance?: string[];
|
|
9
|
-
memdir:
|
|
10
|
-
projectMemoryStoreFactory:
|
|
10
|
+
memdir: ProjectMemoryStore | null;
|
|
11
|
+
projectMemoryStoreFactory: ProjectMemoryStoreFactory;
|
|
11
12
|
setActiveWorkdir(dir: string): void;
|
|
12
13
|
getActiveProjectRoot(): string;
|
|
13
14
|
readonly multiAgentHandlerHost: MultiAgentHandlerHost;
|
|
14
15
|
};
|
|
15
16
|
type StdioRpcAdapterSource = DirectStdioRpcHost & {
|
|
16
17
|
ensureTaskDistillation(): import("./rpc-registry.js").TaskDistillationRpcSurface;
|
|
18
|
+
scheduleBackgroundMemoryWork(label: string, work: (signal: AbortSignal) => Promise<void>): Promise<boolean>;
|
|
17
19
|
activeTurn: RpcHandlerHosts["turn"]["activeTurn"];
|
|
18
20
|
currentSessionId: NonNullable<RpcHandlerHosts["session"]["currentSessionId"]>;
|
|
19
21
|
currentModel: NonNullable<RpcHandlerHosts["session"]["currentModel"]>;
|
|
@@ -9,6 +9,7 @@ export interface StdioRuntimeBootstrapDeps {
|
|
|
9
9
|
getActiveProjectRoot(): string;
|
|
10
10
|
getCurrentSessionId?(): string | undefined;
|
|
11
11
|
getCurrentTurnId?(): string | undefined;
|
|
12
|
+
isGroupSecurityMode?(): boolean;
|
|
12
13
|
resolveClientForPurpose(purpose: ModelPurpose): {
|
|
13
14
|
transport: LLMTransport;
|
|
14
15
|
apiKey: string;
|
|
@@ -20,7 +20,6 @@ import { BackgroundTaskManager } from "../runtime/infra/background-tasks.js";
|
|
|
20
20
|
import { type AgentRpcError } from "../protocol/wire/index.js";
|
|
21
21
|
import type { AcpServer } from "../transport/acp-server.js";
|
|
22
22
|
import type { NotificationMethod, NotificationMethodMap } from "../protocol/notifications.js";
|
|
23
|
-
import { AgentRuntimeSessionState } from "./agent-runtime-session-state.js";
|
|
24
23
|
import { type MultiAgentHandlerHost } from "./multi-agent-handler-host.js";
|
|
25
24
|
import { SessionHistoryCoordinator } from "./session-history-coordinator.js";
|
|
26
25
|
import type { MemoryDreamRuntimeProvider, MemoryHandlerProvider, PermissionMode, ProjectMemoryStore } from "../runtime/ports/index.js";
|
|
@@ -41,15 +40,16 @@ export declare class StdioServer {
|
|
|
41
40
|
private rpc;
|
|
42
41
|
/** Gateway contract — exposed for control-handler metrics/cancel. */
|
|
43
42
|
get rpcContract(): import("../protocol/wire/gateway-contract.js").GatewayRpcContract;
|
|
44
|
-
|
|
43
|
+
private connectionActiveTurn;
|
|
45
44
|
/** Resolves when the active turn fully completes (including post-abort flush). */
|
|
46
|
-
private
|
|
45
|
+
private connectionTurnDone;
|
|
47
46
|
verbose: boolean;
|
|
48
47
|
private transport;
|
|
49
48
|
private readonly runtimeServices;
|
|
50
49
|
private readonly runtimeSession;
|
|
51
50
|
/** Canonical ACP session captured for the full async turn; never inferred from a mutable pointer. */
|
|
52
51
|
private readonly sessionScope;
|
|
52
|
+
private readonly executionBySession;
|
|
53
53
|
/**
|
|
54
54
|
* DERIVED resolved-agent cache (Agent + LLM client snapshot). The invalidation
|
|
55
55
|
* invariant (full wipe on registry change vs forget-agent on session dispose)
|
|
@@ -63,18 +63,23 @@ export declare class StdioServer {
|
|
|
63
63
|
taskStore: TaskStore;
|
|
64
64
|
/** Unified background execution registry (agent forks + backgrounded shell commands). */
|
|
65
65
|
backgroundTasks: BackgroundTaskManager;
|
|
66
|
-
/** Settled-task notifications
|
|
67
|
-
private
|
|
66
|
+
/** Settled-task notifications isolated by their launching session. */
|
|
67
|
+
private readonly pendingTaskNotificationsBySession;
|
|
68
68
|
/** Session-scoped memory prefetch state (LRU dedup + byte limit). */
|
|
69
|
-
|
|
69
|
+
private connectionMemoryPrefetchState;
|
|
70
70
|
/** Last user message text for auto-extract hook (set at turn start, cleared at turn end).
|
|
71
71
|
* Public: the turn pipeline writes it through the ACP host adapter. */
|
|
72
|
-
|
|
72
|
+
private connectionLastUserMessageForAutoExtract;
|
|
73
73
|
/** Last assistant message text for implicit extraction hook (set at turn end).
|
|
74
74
|
* Public: the turn pipeline writes it through the ACP host adapter. */
|
|
75
|
-
|
|
75
|
+
private connectionLastAssistantMessageForExtract;
|
|
76
|
+
private connectionPendingTurnGuidance;
|
|
77
|
+
private connectionRequestGeneration;
|
|
78
|
+
/** Foreground reservations begin before async routing, closing the idle-timer race. */
|
|
79
|
+
private foregroundTurnCount;
|
|
80
|
+
private readonly memoryBackground;
|
|
76
81
|
/** MEMDIR file-based memory (CC memdir parity). */
|
|
77
|
-
|
|
82
|
+
private connectionMemdir;
|
|
78
83
|
readonly projectMemoryStoreFactory: import("../runtime/ports/project-memory-store.js").ProjectMemoryStoreFactory;
|
|
79
84
|
/** Memory write gate state (P2+P3: category gate + supersedes). */
|
|
80
85
|
/** Pending ask_user requests waiting for host response */
|
|
@@ -96,6 +101,7 @@ export declare class StdioServer {
|
|
|
96
101
|
get toolCatalog(): import("../runtime/ports/tool-contracts.js").ToolCatalog;
|
|
97
102
|
/** Turn pipeline awaits this before tool dispatch (MCP servers connected). */
|
|
98
103
|
get mcpReady(): Promise<void>;
|
|
104
|
+
private get activeResolvedAgent();
|
|
99
105
|
private get agent();
|
|
100
106
|
/** Cached LLM transport for sub-agent forks (dream). */
|
|
101
107
|
get currentTransport(): LLMTransport | null;
|
|
@@ -106,9 +112,33 @@ export declare class StdioServer {
|
|
|
106
112
|
get currentSessionId(): string;
|
|
107
113
|
set currentSessionId(v: string);
|
|
108
114
|
private activeScopedSessionId;
|
|
115
|
+
private activeScopedWorkdir;
|
|
116
|
+
private activeScopedRuntimeState;
|
|
117
|
+
private isActiveGroupSecurityMode;
|
|
118
|
+
private bindCachedRuntimeGeneration;
|
|
119
|
+
private createSessionExecutionState;
|
|
120
|
+
private getOrCreateSessionExecutionState;
|
|
121
|
+
private runWithSessionExecutionScope;
|
|
109
122
|
runInSessionScope<T>(sessionId: string, action: () => Promise<T>): Promise<T>;
|
|
123
|
+
runInExistingSessionScope<T>(sessionId: string, action: () => Promise<T>): Promise<T | undefined>;
|
|
124
|
+
get activeTurn(): AbortController | null;
|
|
125
|
+
set activeTurn(value: AbortController | null);
|
|
126
|
+
get turnDone(): Promise<void>;
|
|
127
|
+
set turnDone(value: Promise<void>);
|
|
110
128
|
get currentTurnId(): string;
|
|
111
129
|
set currentTurnId(v: string);
|
|
130
|
+
beginTurnRequest(): number;
|
|
131
|
+
isTurnRequestCurrent(generation: number): boolean;
|
|
132
|
+
get sessionState(): SessionState | null;
|
|
133
|
+
set sessionState(v: SessionState | null);
|
|
134
|
+
get memoryPrefetchState(): MemoryPrefetchState;
|
|
135
|
+
set memoryPrefetchState(v: MemoryPrefetchState);
|
|
136
|
+
get memdir(): ProjectMemoryStore | null;
|
|
137
|
+
set memdir(v: ProjectMemoryStore | null);
|
|
138
|
+
get lastUserMessageForAutoExtract(): string | undefined;
|
|
139
|
+
set lastUserMessageForAutoExtract(v: string | undefined);
|
|
140
|
+
get lastAssistantMessageForExtract(): string | undefined;
|
|
141
|
+
set lastAssistantMessageForExtract(v: string | undefined);
|
|
112
142
|
/**
|
|
113
143
|
* The active ACP permission session for the current turn, or undefined when no host is connected.
|
|
114
144
|
*/
|
|
@@ -135,22 +165,21 @@ export declare class StdioServer {
|
|
|
135
165
|
* Declared as a real field so the proxy in createTurnHost has a shared backing store
|
|
136
166
|
* (turn pipeline and handleTurnGuide must see the SAME array).
|
|
137
167
|
*/
|
|
138
|
-
pendingTurnGuidance: string[];
|
|
168
|
+
get pendingTurnGuidance(): string[];
|
|
169
|
+
set pendingTurnGuidance(v: string[]);
|
|
139
170
|
/** LH-10: an explicit cancel of a session stops the background tasks that
|
|
140
171
|
* session launched — the forked agent + the exec processes it spawned —
|
|
141
172
|
* instead of leaving them running as zombies. Keyed by session id, which is
|
|
142
173
|
* shared across the client/agent boundary (turn ids are not). */
|
|
143
|
-
cancelBackgroundTasksForSession(sessionId?: string): void;
|
|
144
|
-
get sessionState(): SessionState | null;
|
|
145
|
-
set sessionState(v: SessionState | null);
|
|
174
|
+
cancelBackgroundTasksForSession(sessionId?: string, parentTurnId?: string): void;
|
|
146
175
|
get sessionLlmConfigBySession(): Map<string, import("./acp-session-host.js").SessionLlmConfig>;
|
|
147
176
|
get materializedSessionProfiles(): Map<string, import("./acp-session-host.js").MaterializedSessionProfile>;
|
|
148
177
|
get acpSessionMeta(): Record<string, unknown> | null;
|
|
149
178
|
set acpSessionMeta(v: Record<string, unknown> | null);
|
|
150
179
|
get acpSessionMetaBySession(): Map<string, Record<string, unknown>>;
|
|
151
180
|
get currentHooks(): import("../contracts/hooks.js").HookRegistry | null;
|
|
152
|
-
get permissionChecker():
|
|
153
|
-
private
|
|
181
|
+
get permissionChecker(): import("../runtime/ports/permission-contracts.js").PermissionMetadataResolver | null;
|
|
182
|
+
private resolveSandboxPermissionSnapshot;
|
|
154
183
|
/**
|
|
155
184
|
* config.update 权限热应用:写盘的同时立即更新活的 rule engine,
|
|
156
185
|
* 当前会话(乃至运行中 turn)的下一次工具调用就按新模式判定——
|
|
@@ -177,7 +206,7 @@ export declare class StdioServer {
|
|
|
177
206
|
* Called by the turn pipeline at turn start — settled tasks are injected
|
|
178
207
|
* into the model's context as <task_notification> blocks.
|
|
179
208
|
*/
|
|
180
|
-
drainPendingTaskNotifications(): string[];
|
|
209
|
+
drainPendingTaskNotifications(sessionId: string): string[];
|
|
181
210
|
ensureModelRegistryHydrated(): Promise<void>;
|
|
182
211
|
syncToolListMediaConfig(): void;
|
|
183
212
|
configureTurnMedia(config: Record<string, unknown> | undefined, turnId: string): void;
|
|
@@ -250,8 +279,12 @@ export declare class StdioServer {
|
|
|
250
279
|
* Enable idle dream scheduling. Called after session setup when LLM config is available.
|
|
251
280
|
*/
|
|
252
281
|
enableIdleDream(minutes?: number): void;
|
|
282
|
+
beginForegroundTurn(): void;
|
|
283
|
+
endForegroundTurn(): void;
|
|
284
|
+
scheduleBackgroundMemoryWork(label: string, work: (signal: AbortSignal) => Promise<void>): Promise<boolean>;
|
|
253
285
|
cancelIdleDreamTimer(): void;
|
|
254
286
|
disposeSessionRuntime(): void;
|
|
287
|
+
disposeSessionPermissions(sessionId: string): void;
|
|
255
288
|
disposeSessionMcp(sessionId: string): Promise<void>;
|
|
256
289
|
/**
|
|
257
290
|
* Initialize the ACP server alongside the legacy protocol.
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { type MemoryPrefetchState } from "../runtime/hooks/memory-hooks.js";
|
|
2
2
|
import type { MemoryDreamRuntimeProvider, MemoryHandlerProvider } from "../runtime/ports/index.js";
|
|
3
3
|
import type { AgentRuntimeSessionState } from "./agent-runtime-session-state.js";
|
|
4
|
-
import type { ResolvedAgentCache } from "./resolved-agent-cache.js";
|
|
5
4
|
import type { StdioRuntimeServices } from "./stdio-runtime-services.js";
|
|
6
5
|
export interface StdioSessionRuntimeCoordinatorDeps {
|
|
7
6
|
runtimeSession: AgentRuntimeSessionState;
|
|
8
7
|
runtimeServices: Pick<StdioRuntimeServices, "closeMemoryProviders">;
|
|
9
|
-
resolvedAgent: Pick<ResolvedAgentCache, "forgetAgent">;
|
|
10
8
|
getMemoryProvider(): MemoryHandlerProvider | null;
|
|
11
9
|
getMemoryDreamProvider(): MemoryDreamRuntimeProvider | null;
|
|
12
10
|
setMemoryPrefetchState(state: MemoryPrefetchState): void;
|