qlogicagent 2.24.1 → 2.24.2
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/README.md +52 -324
- package/dist/agent.js +38 -43
- package/dist/cli.js +7 -7
- package/dist/default-project-knowledge/INSTRUCTIONS.md +7 -7
- package/dist/default-project-knowledge/rules/project-workflow.md +6 -6
- package/dist/index.js +265 -1018
- package/dist/orchestration.js +10 -10
- package/dist/types/agent/runtime-vars.d.ts +1 -16
- package/dist/types/agent/tool-loop/compression-pipeline.d.ts +0 -2
- package/dist/types/agent/tool-loop.d.ts +0 -6
- package/dist/types/agent/types.d.ts +3 -22
- package/dist/types/cli/acp-commands.d.ts +4 -5
- package/dist/types/cli/acp-message-router.d.ts +1 -2
- package/dist/types/cli/acp-session-handlers.d.ts +6 -12
- package/dist/types/cli/acp-session-host.d.ts +5 -48
- package/dist/types/cli/adapter-launch-config.d.ts +14 -0
- package/dist/types/cli/agent-runtime-bootstrap.d.ts +2 -23
- package/dist/types/cli/agent-runtime-session-state.d.ts +1 -6
- package/dist/types/cli/base-tool-bootstrap.d.ts +0 -2
- package/dist/types/cli/cli-acp-request-handler.d.ts +3 -5
- package/dist/types/cli/core-tool-coordinator.d.ts +0 -4
- package/dist/types/cli/core-tools/agent-tool-service.d.ts +0 -3
- package/dist/types/cli/core-tools/fork-system-prompt.d.ts +1 -5
- package/dist/types/cli/handlers/files-handler.d.ts +0 -6
- package/dist/types/cli/handlers/turn-handler.d.ts +7 -83
- package/dist/types/cli/main.d.ts +2 -4
- package/dist/types/cli/permission-approval-bridge.d.ts +2 -6
- package/dist/types/cli/permission-bootstrap.d.ts +2 -12
- package/dist/types/cli/plugin-bootstrap.d.ts +2 -4
- package/dist/types/cli/runtime-hook-bootstrap.d.ts +0 -21
- package/dist/types/cli/session-context.d.ts +4 -14
- package/dist/types/cli/session-coordinator.d.ts +1 -9
- package/dist/types/cli/stdio-acp-protocol-coordinator.d.ts +2 -9
- package/dist/types/cli/stdio-acp-request-host.d.ts +3 -15
- package/dist/types/cli/stdio-agent-session-bootstrap.d.ts +3 -23
- package/dist/types/cli/stdio-runtime-bootstrap.d.ts +0 -8
- package/dist/types/cli/stdio-runtime-services.d.ts +2 -13
- package/dist/types/cli/stdio-server.d.ts +6 -128
- package/dist/types/cli/tool-bootstrap.d.ts +4 -8
- package/dist/types/cli/tool-catalog.d.ts +2 -2
- package/dist/types/cli/tool-invoker-factory.d.ts +0 -2
- package/dist/types/cli/tool-registry-adapter.d.ts +3 -7
- package/dist/types/cli/tool-result-processor.d.ts +0 -1
- package/dist/types/cli/turn-core.d.ts +6 -10
- package/dist/types/cli/turn-event-forwarder.d.ts +6 -3
- package/dist/types/cli/turn-lifecycle.d.ts +0 -3
- package/dist/types/cli/turn-project-router.d.ts +0 -7
- package/dist/types/contracts/hooks.d.ts +1 -20
- package/dist/types/contracts/tool-execution-evidence.d.ts +20 -1
- package/dist/types/contracts/turn-event.d.ts +2 -2
- package/dist/types/orchestration/index.d.ts +1 -1
- package/dist/types/protocol/notifications.d.ts +2 -9
- package/dist/types/protocol/wire/acp-protocol.d.ts +12 -186
- package/dist/types/protocol/wire/capability-transport.d.ts +0 -2
- package/dist/types/protocol/wire/index.d.ts +2 -10
- package/dist/types/protocol/wire/notification-payloads.d.ts +4 -989
- package/dist/types/protocol/wire/thread-protocol.d.ts +24 -3
- package/dist/types/runtime/config/tunable-defaults.d.ts +3 -75
- package/dist/types/runtime/execution/forked-agent.d.ts +2 -5
- package/dist/types/runtime/execution/streaming-tool-executor.d.ts +0 -2
- package/dist/types/runtime/execution/tool-result-storage.d.ts +13 -4
- package/dist/types/runtime/infra/agent-paths.d.ts +4 -54
- package/dist/types/runtime/infra/agent-project-projection.d.ts +20 -0
- package/dist/types/runtime/infra/background-tasks.d.ts +3 -3
- package/dist/types/runtime/infra/default-path-service.d.ts +0 -7
- package/dist/types/runtime/infra/llmrouter-catalog.d.ts +1 -1
- package/dist/types/runtime/infra/model-registry.d.ts +6 -9
- package/dist/types/runtime/infra/project-store.d.ts +3 -3
- package/dist/types/runtime/infra/subagent-turn-snapshot.d.ts +54 -7
- package/dist/types/runtime/infra/task-runtime.d.ts +1 -1
- package/dist/types/runtime/ports/agent-runtime-ports.d.ts +1 -3
- package/dist/types/runtime/ports/index.d.ts +0 -4
- package/dist/types/runtime/ports/path-service.d.ts +1 -9
- package/dist/types/runtime/ports/tool-contracts.d.ts +0 -1
- package/dist/types/runtime/session/agent-session-projection.d.ts +37 -0
- package/dist/types/runtime/tasks/task-types.d.ts +2 -25
- package/dist/types/skills/mcp/mcp-manager.d.ts +2 -2
- package/dist/types/skills/plugins/plugin-loader.d.ts +1 -1
- package/dist/types/skills/skill-system/skill-category.d.ts +4 -2
- package/dist/types/skills/tools.d.ts +1 -18
- package/dist/types/test-support/project-store-fixture.d.ts +4 -4
- package/dist/types/transport/acp-event-emitter.d.ts +1 -20
- package/dist/types/transport/acp-server.d.ts +8 -88
- package/package.json +4 -96
- package/dist/agent-contract.js +0 -1
- package/dist/host-contract.js +0 -1
- package/dist/host-session-collection-contract.js +0 -1
- package/dist/memory-category-contract.js +0 -1
- package/dist/permissions.js +0 -1
- package/dist/plugin-marketplace-compute.js +0 -1
- package/dist/project-memory-host.js +0 -38
- package/dist/protocol.js +0 -1
- package/dist/skill-category-contract.js +0 -1
- package/dist/tunables.js +0 -1
- package/dist/types/agent/memory-recall-context.d.ts +0 -22
- package/dist/types/agent/memory-recall-injection.d.ts +0 -32
- package/dist/types/cli/acp-extended-handlers.d.ts +0 -110
- package/dist/types/cli/acp-extended-host-adapter.d.ts +0 -20
- package/dist/types/cli/community-resource-installer.d.ts +0 -39
- package/dist/types/cli/community-skill-installer.d.ts +0 -18
- package/dist/types/cli/community-workflow-installer.d.ts +0 -29
- package/dist/types/cli/default-project-bootstrap.d.ts +0 -12
- package/dist/types/cli/dream-host-adapter.d.ts +0 -24
- package/dist/types/cli/gateway-rpc-connection.d.ts +0 -50
- package/dist/types/cli/handlers/community-handler.d.ts +0 -14
- package/dist/types/cli/handlers/config-handler.d.ts +0 -19
- package/dist/types/cli/handlers/control-handler.d.ts +0 -29
- package/dist/types/cli/handlers/dream-handler.d.ts +0 -41
- package/dist/types/cli/handlers/goal-handler.d.ts +0 -66
- package/dist/types/cli/handlers/memory-handler.d.ts +0 -23
- package/dist/types/cli/handlers/product-handler.d.ts +0 -35
- package/dist/types/cli/handlers/session-handler.d.ts +0 -29
- package/dist/types/cli/handlers/skill-curator-handler.d.ts +0 -8
- package/dist/types/cli/handlers/solo-handler.d.ts +0 -25
- package/dist/types/cli/handlers/turn-baseline-handler.d.ts +0 -8
- package/dist/types/cli/handlers/workflow-compute-handler.d.ts +0 -8
- package/dist/types/cli/handlers/working-materials-handler.d.ts +0 -9
- package/dist/types/cli/idle-dream-coordinator.d.ts +0 -57
- package/dist/types/cli/memory-background-coordinator.d.ts +0 -26
- package/dist/types/cli/memory-candidate-service.d.ts +0 -75
- package/dist/types/cli/memory-coordinator.d.ts +0 -40
- package/dist/types/cli/multi-agent-handler-host.d.ts +0 -16
- package/dist/types/cli/multi-agent-state-coordinator.d.ts +0 -8
- package/dist/types/cli/orchestration-memory-context.d.ts +0 -23
- package/dist/types/cli/product-acp-params.d.ts +0 -30
- package/dist/types/cli/product-coordinator.d.ts +0 -21
- package/dist/types/cli/project-memory-store-factory.d.ts +0 -12
- package/dist/types/cli/project-template-seeder.d.ts +0 -5
- package/dist/types/cli/rpc-registry.d.ts +0 -56
- package/dist/types/cli/session-history-coordinator.d.ts +0 -8
- package/dist/types/cli/session-query-service.d.ts +0 -27
- package/dist/types/cli/stdio-rpc-handler-hosts.d.ts +0 -56
- package/dist/types/cli/stdio-session-runtime-coordinator.d.ts +0 -17
- package/dist/types/cli/task-distillation-coordinator.d.ts +0 -146
- package/dist/types/cli/turn-ask-user-setup.d.ts +0 -24
- package/dist/types/cli/turn-suggestion-generator.d.ts +0 -15
- package/dist/types/contracts/memory-recall-packet.d.ts +0 -31
- package/dist/types/contracts/memory-response-contract.d.ts +0 -2
- package/dist/types/host-contract/fts-segment.d.ts +0 -20
- package/dist/types/host-contract/index.d.ts +0 -1819
- package/dist/types/host-contract/memory-category.d.ts +0 -8
- package/dist/types/host-contract/skill-category.d.ts +0 -5
- package/dist/types/host-session-collection-contract.d.ts +0 -65
- package/dist/types/orchestration/agent-instance.d.ts +0 -215
- package/dist/types/orchestration/agent-roster.d.ts +0 -32
- package/dist/types/orchestration/dag-scheduler.d.ts +0 -219
- package/dist/types/orchestration/delegate-approval-policy.d.ts +0 -8
- package/dist/types/orchestration/delegate-bridge.d.ts +0 -8
- package/dist/types/orchestration/goal-acceptance.d.ts +0 -17
- package/dist/types/orchestration/goal-context-envelope.d.ts +0 -7
- package/dist/types/orchestration/goal-loop-coordinator.d.ts +0 -151
- package/dist/types/orchestration/goal-mode-adapters.d.ts +0 -152
- package/dist/types/orchestration/goal-run-persistence.d.ts +0 -21
- package/dist/types/orchestration/goal-run-types.d.ts +0 -225
- package/dist/types/orchestration/planner-memory-brief.d.ts +0 -39
- package/dist/types/orchestration/product-budget.d.ts +0 -94
- package/dist/types/orchestration/product-checkpoint.d.ts +0 -50
- package/dist/types/orchestration/product-dag-mutation-applier.d.ts +0 -10
- package/dist/types/orchestration/product-persistence.d.ts +0 -90
- package/dist/types/orchestration/product-planner.d.ts +0 -332
- package/dist/types/orchestration/product-run-coordinator.d.ts +0 -49
- package/dist/types/orchestration/product-worktree.d.ts +0 -19
- package/dist/types/orchestration/run-state-host-authority.d.ts +0 -7
- package/dist/types/orchestration/solo-evaluator.d.ts +0 -179
- package/dist/types/orchestration/solo-persistence.d.ts +0 -47
- package/dist/types/orchestration/solo-spec-builder.d.ts +0 -58
- package/dist/types/orchestration/testing/delegate-test-bridge.d.ts +0 -23
- package/dist/types/orchestration/testing/host-agent-provider-directory-fixture.d.ts +0 -7
- package/dist/types/orchestration/testing/run-state-client-double.d.ts +0 -13
- package/dist/types/orchestration/workflow/budget-permission-gate.d.ts +0 -94
- package/dist/types/orchestration/workflow/builtin-capabilities.d.ts +0 -3
- package/dist/types/orchestration/workflow/builtin-executors.d.ts +0 -18
- package/dist/types/orchestration/workflow/capability-catalog.d.ts +0 -72
- package/dist/types/orchestration/workflow/cron-schedule.d.ts +0 -36
- package/dist/types/orchestration/workflow/data-item.d.ts +0 -39
- package/dist/types/orchestration/workflow/expression.d.ts +0 -60
- package/dist/types/orchestration/workflow/host-executors.d.ts +0 -15
- package/dist/types/orchestration/workflow/n8n-expression.d.ts +0 -48
- package/dist/types/orchestration/workflow/n8n-import.d.ts +0 -64
- package/dist/types/orchestration/workflow/n8n-template-compat.d.ts +0 -5
- package/dist/types/orchestration/workflow/node-registry.d.ts +0 -32
- package/dist/types/orchestration/workflow/node-schema.d.ts +0 -249
- package/dist/types/orchestration/workflow/params-schema.d.ts +0 -69
- package/dist/types/orchestration/workflow/qla-executor-host.d.ts +0 -63
- package/dist/types/orchestration/workflow/run-checkpoint-store.d.ts +0 -53
- package/dist/types/orchestration/workflow/run-history-store.d.ts +0 -103
- package/dist/types/orchestration/workflow/semantic-acceptance.d.ts +0 -65
- package/dist/types/orchestration/workflow/trigger-validation.d.ts +0 -22
- package/dist/types/orchestration/workflow/workflow-audit-store.d.ts +0 -31
- package/dist/types/orchestration/workflow/workflow-authoring.d.ts +0 -74
- package/dist/types/orchestration/workflow/workflow-bundle.d.ts +0 -51
- package/dist/types/orchestration/workflow/workflow-controller.d.ts +0 -237
- package/dist/types/orchestration/workflow/workflow-edit-context.d.ts +0 -46
- package/dist/types/orchestration/workflow/workflow-error.d.ts +0 -28
- package/dist/types/orchestration/workflow/workflow-intent-contract.d.ts +0 -56
- package/dist/types/orchestration/workflow/workflow-patch.d.ts +0 -122
- package/dist/types/orchestration/workflow/workflow-render.d.ts +0 -40
- package/dist/types/orchestration/workflow/workflow-runtime.d.ts +0 -184
- package/dist/types/orchestration/workflow/workflow-scheduler.d.ts +0 -122
- package/dist/types/orchestration/workflow/workflow-store.d.ts +0 -85
- package/dist/types/orchestration/workflow/workflow-template-setup.d.ts +0 -65
- package/dist/types/orchestration/workflow/workflow-trigger.d.ts +0 -43
- package/dist/types/orchestration/workflow-chat-builder.d.ts +0 -152
- package/dist/types/orchestration/worktree-task-prompt.d.ts +0 -1
- package/dist/types/permissions.d.ts +0 -4
- package/dist/types/project-memory-host.d.ts +0 -4
- package/dist/types/protocol/agent-contract.d.ts +0 -93
- package/dist/types/protocol/methods.d.ts +0 -645
- package/dist/types/protocol/wire/acp-agent-management.d.ts +0 -533
- package/dist/types/protocol/wire/agent-events.d.ts +0 -1
- package/dist/types/protocol/wire/agent-methods.d.ts +0 -500
- package/dist/types/protocol/wire/agent-rpc.d.ts +0 -100
- package/dist/types/protocol/wire/gateway-contract.d.ts +0 -61
- package/dist/types/protocol/wire/gateway-rpc.d.ts +0 -1177
- package/dist/types/protocol/wire/memory-provider-lifecycle.d.ts +0 -31
- package/dist/types/protocol/wire/turn.d.ts +0 -208
- package/dist/types/runtime/community/autonomy-budget.d.ts +0 -26
- package/dist/types/runtime/community/community-consent-client.d.ts +0 -55
- package/dist/types/runtime/community/package-materialize.d.ts +0 -19
- package/dist/types/runtime/community/ranged-download.d.ts +0 -21
- package/dist/types/runtime/community/registry-signature.d.ts +0 -48
- package/dist/types/runtime/execution/dream-agent.d.ts +0 -273
- package/dist/types/runtime/execution/dream-category-context.d.ts +0 -47
- package/dist/types/runtime/execution/memory-decay.d.ts +0 -73
- package/dist/types/runtime/execution/turn-progress-notifier.d.ts +0 -16
- package/dist/types/runtime/hooks/memory-hooks.d.ts +0 -111
- package/dist/types/runtime/infra/acp-host-handler.d.ts +0 -31
- package/dist/types/runtime/infra/acp-protocol-adapter.d.ts +0 -209
- package/dist/types/runtime/infra/acp-usage-tracker.d.ts +0 -46
- package/dist/types/runtime/infra/cloud-auth-host-authority.d.ts +0 -4
- package/dist/types/runtime/infra/feedback-distillation-worker.d.ts +0 -20
- package/dist/types/runtime/infra/feedback-distillation.d.ts +0 -32
- package/dist/types/runtime/infra/feedback-event-store.d.ts +0 -179
- package/dist/types/runtime/infra/feedback-host-authority.d.ts +0 -4
- package/dist/types/runtime/infra/feedback-outbox.d.ts +0 -26
- package/dist/types/runtime/infra/feedback-redaction.d.ts +0 -71
- package/dist/types/runtime/infra/feedback-upload-client.d.ts +0 -39
- package/dist/types/runtime/infra/feedback-upload-worker.d.ts +0 -11
- package/dist/types/runtime/infra/host-agent-provider-directory.d.ts +0 -17
- package/dist/types/runtime/infra/project-authority-facade.d.ts +0 -11
- package/dist/types/runtime/infra/project-data-paths.d.ts +0 -24
- package/dist/types/runtime/infra/project-host-authority.d.ts +0 -11
- package/dist/types/runtime/infra/project-instructions-store.d.ts +0 -30
- package/dist/types/runtime/infra/turn-baseline-store.d.ts +0 -102
- package/dist/types/runtime/infra/turn-telemetry-store.d.ts +0 -100
- package/dist/types/runtime/infra/working-materials-store.d.ts +0 -29
- package/dist/types/runtime/memory/find-relevant-memories.d.ts +0 -26
- package/dist/types/runtime/memory/implicit-extraction.d.ts +0 -69
- package/dist/types/runtime/memory/memory-recall-attribution.d.ts +0 -24
- package/dist/types/runtime/ports/memory-provider.d.ts +0 -219
- package/dist/types/runtime/ports/memory-recall-source.d.ts +0 -14
- package/dist/types/runtime/ports/memory-writer.d.ts +0 -70
- package/dist/types/runtime/ports/project-memory-store.d.ts +0 -49
- package/dist/types/runtime/prompt/host-skill-directory.d.ts +0 -16
- package/dist/types/runtime/session/group-session-split.d.ts +0 -38
- package/dist/types/runtime/session/inbound-upload-persistence.d.ts +0 -47
- package/dist/types/runtime/session/session-catalog.d.ts +0 -12
- package/dist/types/runtime/session/session-deletion-guard.d.ts +0 -4
- package/dist/types/runtime/session/session-locator.d.ts +0 -26
- package/dist/types/runtime/session/session-metadata-store.d.ts +0 -8
- package/dist/types/runtime/session/session-paths.d.ts +0 -8
- package/dist/types/runtime/session/session-permission-store.d.ts +0 -6
- package/dist/types/runtime/session/session-persistence.d.ts +0 -37
- package/dist/types/runtime/session/session-recovery.d.ts +0 -62
- package/dist/types/runtime/session/session-resource-key.d.ts +0 -28
- package/dist/types/runtime/session/session-resume.d.ts +0 -9
- package/dist/types/runtime/session/session-schema.d.ts +0 -10
- package/dist/types/runtime/session/session-summary.d.ts +0 -7
- package/dist/types/runtime/session/session-title.d.ts +0 -9
- package/dist/types/runtime/session/session-transcript-store.d.ts +0 -30
- package/dist/types/runtime/session/session-types.d.ts +0 -113
- package/dist/types/runtime/session/session-write-queue.d.ts +0 -3
- package/dist/types/skills/memory/host-memory-provider.d.ts +0 -235
- package/dist/types/skills/memory/memdir.d.ts +0 -111
- package/dist/types/skills/memory/memory-content-safety.d.ts +0 -1
- package/dist/types/skills/memory/memory-vector-utils.d.ts +0 -2
- package/dist/types/skills/memory/task-distillation.d.ts +0 -183
- package/dist/types/skills/plugins/plugin-marketplace.d.ts +0 -43
- package/dist/types/skills/skill-system/skill-bundles.d.ts +0 -8
- package/dist/types/skills/skill-system/skill-lifecycle.d.ts +0 -89
- package/dist/types/test-support/run-state-authority-setup.d.ts +0 -1
- package/dist/types/transport/delegate-client.d.ts +0 -82
- package/dist/types/transport/host-capability-client.d.ts +0 -21
- package/dist/types/transport/host-cloud-auth-client.d.ts +0 -10
- package/dist/types/transport/host-community-client.d.ts +0 -7
- package/dist/types/transport/host-feedback-client.d.ts +0 -25
- package/dist/types/transport/host-profile-client.d.ts +0 -19
- package/dist/types/transport/host-project-client.d.ts +0 -16
- package/dist/types/transport/host-request-client.d.ts +0 -42
- package/dist/types/transport/host-run-state-client.d.ts +0 -23
- package/dist/types/transport/host-session-client.d.ts +0 -30
- package/dist/types/tunables.d.ts +0 -2
- package/dist/types/workflow-host.d.ts +0 -38
- package/dist/workflow-host.js +0 -11
- /package/dist/types/{host-contract → protocol/wire}/acp-content.d.ts +0 -0
- /package/dist/types/{host-contract → runtime/infra}/project-id.d.ts +0 -0
- /package/dist/types/{host-contract → runtime/infra}/provider-profile.d.ts +0 -0
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PathService, ToolBootstrap, ToolCatalog } from "../runtime/ports/index.js";
|
|
2
2
|
import { MediaPersistence } from "../runtime/infra/media-persistence.js";
|
|
3
3
|
import { ProviderRegistry } from "./provider-core-facade.js";
|
|
4
|
-
import { type MemoryHostRequestAccess, type MemoryProviderState } from "./memory-coordinator.js";
|
|
5
4
|
export interface StdioRuntimeServicesDeps {
|
|
6
5
|
getActiveProjectRoot(): string;
|
|
7
|
-
/**
|
|
8
|
-
* B3(X7)host-state 接入面(AcpServer;initialize 前/非 ACP 宿主 = null)。
|
|
9
|
-
* memory provider 工厂据此在创建时刻按 memory service 一次性选型 HostMemoryProvider。
|
|
10
|
-
*/
|
|
11
|
-
resolveMemoryHostRequestAccess?(): MemoryHostRequestAccess | null;
|
|
12
6
|
}
|
|
13
7
|
export interface StdioRuntimeServices {
|
|
14
8
|
providerRegistry: ProviderRegistry;
|
|
@@ -16,10 +10,5 @@ export interface StdioRuntimeServices {
|
|
|
16
10
|
pathService: PathService;
|
|
17
11
|
toolCatalog: ToolCatalog;
|
|
18
12
|
toolBootstrap: ToolBootstrap;
|
|
19
|
-
ensureMemoryProvider(currentUserId: string): MemoryProviderState;
|
|
20
|
-
closeMemoryProviders(state: {
|
|
21
|
-
memoryProvider: MemoryHandlerProvider | null;
|
|
22
|
-
memoryDreamProvider: MemoryDreamRuntimeProvider | null;
|
|
23
|
-
}): void;
|
|
24
13
|
}
|
|
25
|
-
export declare function createStdioRuntimeServices(
|
|
14
|
+
export declare function createStdioRuntimeServices(_deps: StdioRuntimeServicesDeps): StdioRuntimeServices;
|
|
@@ -8,28 +8,16 @@
|
|
|
8
8
|
* Protocol: each message is a single JSON-RPC 2.0 object.
|
|
9
9
|
* The physical I/O layer is abstracted via the Transport interface.
|
|
10
10
|
*/
|
|
11
|
-
import { TaskDistillationCoordinator } from "./task-distillation-coordinator.js";
|
|
12
11
|
import type { Transport } from "./transport.js";
|
|
13
12
|
import type { Agent } from "../agent/agent.js";
|
|
14
13
|
import type { TurnConfig } from "../agent/types.js";
|
|
15
14
|
import type { LLMTransport } from "./provider-core-facade.js";
|
|
16
|
-
import { type MemoryPrefetchState } from "../runtime/hooks/memory-hooks.js";
|
|
17
15
|
import { SessionState } from "../runtime/session/session-state.js";
|
|
18
16
|
import { TaskStore } from "../runtime/infra/task-runtime.js";
|
|
19
17
|
import { BackgroundTaskManager } from "../runtime/infra/background-tasks.js";
|
|
20
|
-
import { type AgentRpcError } from "../protocol/wire/index.js";
|
|
21
18
|
import type { AcpServer } from "../transport/acp-server.js";
|
|
22
19
|
import type { NotificationMethod, NotificationMethodMap } from "../protocol/notifications.js";
|
|
23
|
-
import {
|
|
24
|
-
import { SessionHistoryCoordinator } from "./session-history-coordinator.js";
|
|
25
|
-
import type { MemoryDreamRuntimeProvider, MemoryHandlerProvider, PermissionMode, ProjectMemoryStore } from "../runtime/ports/index.js";
|
|
26
|
-
import { HostProfileClient } from "../transport/host-profile-client.js";
|
|
27
|
-
import { HostCapabilityClient } from "../transport/host-capability-client.js";
|
|
28
|
-
import { HostSessionClient } from "../transport/host-session-client.js";
|
|
29
|
-
import { HostProjectClient } from "../transport/host-project-client.js";
|
|
30
|
-
import { HostFeedbackClient } from "../transport/host-feedback-client.js";
|
|
31
|
-
import { HostCommunityClient } from "../transport/host-community-client.js";
|
|
32
|
-
import { HostCloudAuthClient } from "../transport/host-cloud-auth-client.js";
|
|
20
|
+
import type { PermissionMode } from "../runtime/ports/index.js";
|
|
33
21
|
export interface StdioServerConfig {
|
|
34
22
|
verbose: boolean;
|
|
35
23
|
transport?: Transport;
|
|
@@ -38,10 +26,7 @@ export declare class StdioServer {
|
|
|
38
26
|
running: boolean;
|
|
39
27
|
readonly startedAt: number;
|
|
40
28
|
readonly packageVersion: string;
|
|
41
|
-
/**
|
|
42
|
-
private rpc;
|
|
43
|
-
/** Gateway contract — exposed for control-handler metrics/cancel. */
|
|
44
|
-
get rpcContract(): import("../protocol/wire/gateway-contract.js").GatewayRpcContract;
|
|
29
|
+
/** Active ACP turn lifecycle for cancellation and orderly shutdown. */
|
|
45
30
|
private connectionActiveTurn;
|
|
46
31
|
/** Resolves when the active turn fully completes (including post-abort flush). */
|
|
47
32
|
private connectionTurnDone;
|
|
@@ -66,36 +51,13 @@ export declare class StdioServer {
|
|
|
66
51
|
backgroundTasks: BackgroundTaskManager;
|
|
67
52
|
/** Settled-task notifications isolated by their launching session. */
|
|
68
53
|
private readonly pendingTaskNotificationsBySession;
|
|
69
|
-
/** Session-scoped memory prefetch state (LRU dedup + byte limit). */
|
|
70
|
-
private connectionMemoryPrefetchState;
|
|
71
|
-
/** Last user message text for auto-extract hook (set at turn start, cleared at turn end).
|
|
72
|
-
* Public: the turn pipeline writes it through the ACP host adapter. */
|
|
73
|
-
private connectionLastUserMessageForAutoExtract;
|
|
74
|
-
/** Last assistant message text for implicit extraction hook (set at turn end).
|
|
75
|
-
* Public: the turn pipeline writes it through the ACP host adapter. */
|
|
76
|
-
private connectionLastAssistantMessageForExtract;
|
|
77
|
-
private connectionPendingTurnGuidance;
|
|
78
54
|
private readonly connectionLoadedDeferredToolNames;
|
|
79
55
|
private connectionRequestGeneration;
|
|
80
56
|
/** Foreground reservations begin before async routing, closing the idle-timer race. */
|
|
81
57
|
private foregroundTurnCount;
|
|
82
|
-
private readonly memoryBackground;
|
|
83
|
-
/** MEMDIR file-based memory (CC memdir parity). */
|
|
84
|
-
private connectionMemdir;
|
|
85
|
-
readonly projectMemoryStoreFactory: import("../runtime/ports/project-memory-store.js").ProjectMemoryStoreFactory;
|
|
86
|
-
/** Memory write gate state (P2+P3: category gate + supersedes). */
|
|
87
|
-
/** Pending ask_user requests waiting for host response */
|
|
88
|
-
pendingAskUser: Map<string, {
|
|
89
|
-
resolve: (answers: Record<string, string> | null) => void;
|
|
90
|
-
}>;
|
|
91
58
|
/** Agents/solo/product handler facade. */
|
|
92
|
-
readonly multiAgentHandlerHost: MultiAgentHandlerHost;
|
|
93
59
|
/** ACP protocol coordinator — owns AcpServer lifecycle and ACP event mapping. */
|
|
94
60
|
private readonly acp;
|
|
95
|
-
sessionHistory: SessionHistoryCoordinator;
|
|
96
|
-
private idleDreamCoordinator;
|
|
97
|
-
private readonly sessionRuntime;
|
|
98
|
-
private modelRegistryHydration;
|
|
99
61
|
private get registry();
|
|
100
62
|
get mediaPersistence(): import("../runtime/infra/media-persistence.js").MediaPersistence;
|
|
101
63
|
private get pathService();
|
|
@@ -104,7 +66,7 @@ export declare class StdioServer {
|
|
|
104
66
|
get mcpReady(): Promise<void>;
|
|
105
67
|
private get activeResolvedAgent();
|
|
106
68
|
private get agent();
|
|
107
|
-
/** Cached LLM transport for sub-agent forks
|
|
69
|
+
/** Cached LLM transport for sub-agent forks. */
|
|
108
70
|
get currentTransport(): LLMTransport | null;
|
|
109
71
|
get currentApiKey(): string;
|
|
110
72
|
get currentModel(): string;
|
|
@@ -132,14 +94,6 @@ export declare class StdioServer {
|
|
|
132
94
|
isTurnRequestCurrent(generation: number): boolean;
|
|
133
95
|
get sessionState(): SessionState | null;
|
|
134
96
|
set sessionState(v: SessionState | null);
|
|
135
|
-
get memoryPrefetchState(): MemoryPrefetchState;
|
|
136
|
-
set memoryPrefetchState(v: MemoryPrefetchState);
|
|
137
|
-
get memdir(): ProjectMemoryStore | null;
|
|
138
|
-
set memdir(v: ProjectMemoryStore | null);
|
|
139
|
-
get lastUserMessageForAutoExtract(): string | undefined;
|
|
140
|
-
set lastUserMessageForAutoExtract(v: string | undefined);
|
|
141
|
-
get lastAssistantMessageForExtract(): string | undefined;
|
|
142
|
-
set lastAssistantMessageForExtract(v: string | undefined);
|
|
143
97
|
/**
|
|
144
98
|
* The active ACP permission session for the current turn, or undefined when no host is connected.
|
|
145
99
|
*/
|
|
@@ -147,29 +101,6 @@ export declare class StdioServer {
|
|
|
147
101
|
sessionId: string;
|
|
148
102
|
requestPermission: AcpServer["requestPermission"];
|
|
149
103
|
} | undefined;
|
|
150
|
-
/** The coordinator-owned host-request client is available only for an active ACP session. */
|
|
151
|
-
getHostRequestClient(): import("../transport/host-request-client.js").HostRequestClient | undefined;
|
|
152
|
-
/** Thin facade over the coordinator-owned HostRequestClient; owns no second pending table. */
|
|
153
|
-
getHostProfileClient(): HostProfileClient | undefined;
|
|
154
|
-
/** Thin read-only facade; consumers fail loudly when the host did not advertise capability. */
|
|
155
|
-
getHostCapabilityClient(): HostCapabilityClient | undefined;
|
|
156
|
-
getHostCommunityClient(): HostCommunityClient | undefined;
|
|
157
|
-
getHostCloudAuthClient(): HostCloudAuthClient | undefined;
|
|
158
|
-
getHostAgentProviderDirectory(): import("../runtime/infra/host-agent-provider-directory.js").HostAgentProviderDirectory;
|
|
159
|
-
/** Session durable-state facade; absent under gate-off/standalone so compatibility stays inert. */
|
|
160
|
-
getHostSessionClient(): HostSessionClient | undefined;
|
|
161
|
-
/** D2 telemetry/feedback business facade; durable storage remains gateway-only. */
|
|
162
|
-
getHostFeedbackClient(): HostFeedbackClient | undefined;
|
|
163
|
-
getHostProjectClient(): HostProjectClient | undefined;
|
|
164
|
-
initializeHostProjectAuthority(): Promise<void>;
|
|
165
|
-
/**
|
|
166
|
-
* Mid-turn guidance queue (运行中引导). Reset per turn by runTurnPipeline, pushed by
|
|
167
|
-
* handleTurnGuide (via the turn host proxy), drained each round by the tool loop.
|
|
168
|
-
* Declared as a real field so the proxy in createTurnHost has a shared backing store
|
|
169
|
-
* (turn pipeline and handleTurnGuide must see the SAME array).
|
|
170
|
-
*/
|
|
171
|
-
get pendingTurnGuidance(): string[];
|
|
172
|
-
set pendingTurnGuidance(v: string[]);
|
|
173
104
|
get loadedDeferredToolNames(): Set<string>;
|
|
174
105
|
/** LH-10: an explicit cancel of a session stops the background tasks that
|
|
175
106
|
* session launched — the forked agent + the exec processes it spawned —
|
|
@@ -177,9 +108,6 @@ export declare class StdioServer {
|
|
|
177
108
|
* shared across the client/agent boundary (turn ids are not). */
|
|
178
109
|
cancelBackgroundTasksForSession(sessionId?: string, parentTurnId?: string): void;
|
|
179
110
|
get sessionLlmConfigBySession(): Map<string, import("./acp-session-host.js").SessionLlmConfig>;
|
|
180
|
-
get materializedSessionProfiles(): Map<string, import("./acp-session-host.js").MaterializedSessionProfile>;
|
|
181
|
-
get acpSessionMeta(): Record<string, unknown> | null;
|
|
182
|
-
set acpSessionMeta(v: Record<string, unknown> | null);
|
|
183
111
|
get acpSessionMetaBySession(): Map<string, Record<string, unknown>>;
|
|
184
112
|
get currentHooks(): import("../contracts/hooks.js").HookRegistry | null;
|
|
185
113
|
get permissionChecker(): import("../runtime/ports/permission-contracts.js").PermissionMetadataResolver | null;
|
|
@@ -193,16 +121,10 @@ export declare class StdioServer {
|
|
|
193
121
|
mode: PermissionMode;
|
|
194
122
|
}): void;
|
|
195
123
|
private set mcpManager(value);
|
|
196
|
-
get memoryProvider(): MemoryHandlerProvider | null;
|
|
197
|
-
set memoryProvider(value: MemoryHandlerProvider | null);
|
|
198
|
-
get memoryDreamProvider(): MemoryDreamRuntimeProvider | null;
|
|
199
|
-
set memoryDreamProvider(value: MemoryDreamRuntimeProvider | null);
|
|
200
|
-
get memoryUserId(): string;
|
|
201
|
-
set memoryUserId(value: string);
|
|
202
124
|
constructor(config: StdioServerConfig);
|
|
203
125
|
/**
|
|
204
126
|
* Get the active project workspace directory.
|
|
205
|
-
* Reads from
|
|
127
|
+
* Reads from the current ACP session's in-process project projection.
|
|
206
128
|
*/
|
|
207
129
|
getActiveProjectRoot(): string;
|
|
208
130
|
/**
|
|
@@ -211,26 +133,14 @@ export declare class StdioServer {
|
|
|
211
133
|
* into the model's context as <task_notification> blocks.
|
|
212
134
|
*/
|
|
213
135
|
drainPendingTaskNotifications(sessionId: string): string[];
|
|
214
|
-
ensureModelRegistryHydrated(): Promise<void>;
|
|
215
136
|
/**
|
|
216
137
|
* Single entry point for updating the active workdir.
|
|
217
138
|
* Centralizes all side-effects (bootstrap workdir, media persistence, etc.).
|
|
218
|
-
*
|
|
139
|
+
* Updates the current ACP session's in-process project projection.
|
|
219
140
|
*/
|
|
220
141
|
setActiveWorkdir(dir: string): void;
|
|
221
142
|
start(): void;
|
|
222
143
|
stop(): Promise<void>;
|
|
223
|
-
private readonly methodHandlers;
|
|
224
|
-
/** Live registry method names — the single source of truth for the initialize capability
|
|
225
|
-
* declaration, so it never drifts from what's actually registered (replaces the
|
|
226
|
-
* previous hand-maintained method list, which had fallen ~100 methods behind). */
|
|
227
|
-
getRegisteredMethods(): string[];
|
|
228
|
-
private handleMessage;
|
|
229
|
-
/**
|
|
230
|
-
* Ensure a default project exists on first start.
|
|
231
|
-
* Called from both legacy handleInitialize and ACP acpHandleInitialize.
|
|
232
|
-
*/
|
|
233
|
-
ensureDefaultProject(): Promise<void>;
|
|
234
144
|
/**
|
|
235
145
|
* Atomically resolve transport + model + apiKey for a given ModelPurpose.
|
|
236
146
|
* If the resolved provider matches `this.currentProvider`, reuses cached transport.
|
|
@@ -242,54 +152,22 @@ export declare class StdioServer {
|
|
|
242
152
|
apiKey: string;
|
|
243
153
|
model: string;
|
|
244
154
|
} | null;
|
|
245
|
-
/**
|
|
246
|
-
* Ensure the L2 SQLite memory provider exists for read-only RPCs
|
|
247
|
-
* (memory.atlas / memory.activity). These can be called before any turn has
|
|
248
|
-
* run, so they cannot rely on resolveAgent() having initialized the provider.
|
|
249
|
-
* Opening the DB is cheap and side-effect-free (list() does not embed).
|
|
250
|
-
*/
|
|
251
|
-
ensureMemoryProvider(): void;
|
|
252
|
-
private _taskDistillation;
|
|
253
|
-
get taskDistillation(): TaskDistillationCoordinator;
|
|
254
|
-
ensureTaskDistillation(): TaskDistillationCoordinator;
|
|
255
155
|
resolveAgent(config: TurnConfig, routedProjectRoot?: string): Agent | null;
|
|
256
156
|
private invalidateResolvedLlmCache;
|
|
257
|
-
createDreamHandlerHost(): import("./handlers/dream-handler.js").DreamHandlerHost;
|
|
258
|
-
private createAcpExtendedHandlerHost;
|
|
259
|
-
/**
|
|
260
|
-
* Lazily resolve the AcpServer delegate because the server is initialized during handshake.
|
|
261
|
-
* Orchestration callers fail loud when the Host does not advertise delegate support.
|
|
262
|
-
*/
|
|
263
|
-
private buildDelegateBridge;
|
|
264
157
|
/**
|
|
265
158
|
* Handle an MCP tool call proxied from an external ACP agent via the
|
|
266
159
|
* named-pipe bridge. Dispatches the tool through the host's own tool
|
|
267
160
|
* system and returns the text result.
|
|
268
161
|
*/
|
|
269
162
|
private handleMcpToolCall;
|
|
270
|
-
sendResponse(id: string | number, result?: unknown, error?: AgentRpcError): void;
|
|
271
|
-
/**
|
|
272
|
-
* Send a JSON-RPC error response by (code, message, data) — convenience over
|
|
273
|
-
* sendResponse for handlers that build the error inline (e.g. session.moveToProject
|
|
274
|
-
* error paths call `this.sendError`).
|
|
275
|
-
*/
|
|
276
|
-
sendError(id: string | number, code: AgentRpcError["code"], message: string, data?: unknown): void;
|
|
277
163
|
sendNotification<M extends NotificationMethod>(method: M, params: NotificationMethodMap[M]): void;
|
|
278
|
-
private writeStdout;
|
|
279
164
|
log(message: string): void;
|
|
280
|
-
/**
|
|
281
|
-
* Enable idle dream scheduling. Called after session setup when LLM config is available.
|
|
282
|
-
*/
|
|
283
|
-
enableIdleDream(minutes?: number): void;
|
|
284
165
|
beginForegroundTurn(): void;
|
|
285
166
|
endForegroundTurn(): void;
|
|
286
|
-
scheduleBackgroundMemoryWork(label: string, work: (signal: AbortSignal) => Promise<void>): Promise<boolean>;
|
|
287
|
-
cancelIdleDreamTimer(): void;
|
|
288
|
-
disposeSessionRuntime(): void;
|
|
289
167
|
disposeSessionPermissions(sessionId: string): void;
|
|
290
168
|
disposeSessionMcp(sessionId: string): Promise<void>;
|
|
291
169
|
/**
|
|
292
|
-
* Initialize the ACP server
|
|
170
|
+
* Initialize the ACP server as the process's only protocol surface.
|
|
293
171
|
* Called once when the host is an ACP-compliant client.
|
|
294
172
|
*/
|
|
295
173
|
initAcpServer(): void;
|
|
@@ -36,7 +36,7 @@ export declare function setAskUserCallback(callback: ((questions: AskUserQuestio
|
|
|
36
36
|
export declare function setBootstrapWorkdir(newWorkdir: string): void;
|
|
37
37
|
export interface BootstrapConfig {
|
|
38
38
|
workdir?: string;
|
|
39
|
-
toolCatalog
|
|
39
|
+
toolCatalog: ToolCatalog;
|
|
40
40
|
pathService?: PathService;
|
|
41
41
|
mediaPersistence?: MediaPersistence;
|
|
42
42
|
log?: AgentLogger;
|
|
@@ -49,11 +49,7 @@ export interface BootstrapConfig {
|
|
|
49
49
|
loadTunableOverrides?(): Promise<Record<string, unknown>>;
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
52
|
-
* Create all locally
|
|
53
|
-
*
|
|
54
|
-
* CC parity: getAllBaseTools() returns flat array, installed via setToolPool().
|
|
55
|
-
* Tools execute IN-PROCESS (zero IPC).
|
|
56
|
-
*
|
|
57
|
-
* @alias initToolDeps -kept for backward compat with existing call sites.
|
|
52
|
+
* Create all locally executable tools and install them into the Runtime catalog.
|
|
53
|
+
* Tools execute in-process.
|
|
58
54
|
*/
|
|
59
|
-
export declare function getAllBaseTools(config
|
|
55
|
+
export declare function getAllBaseTools(config: BootstrapConfig): PortableTool[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ToolBootstrap, ToolCatalog } from "../runtime/ports/index.js";
|
|
2
|
-
import {
|
|
2
|
+
import { ToolRegistry } from "./tool-registry-adapter.js";
|
|
3
3
|
export declare function createCliToolCatalog(registry?: ToolRegistry): ToolCatalog;
|
|
4
|
-
export declare function createCliToolBootstrap(toolCatalog
|
|
4
|
+
export declare function createCliToolBootstrap(toolCatalog: ToolCatalog): ToolBootstrap;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { ToolInvoker } from "../agent/types.js";
|
|
2
|
-
import type { NotificationMethod, NotificationMethodMap } from "../protocol/notifications.js";
|
|
3
2
|
import type { MediaPersistence } from "../runtime/infra/media-persistence.js";
|
|
4
3
|
import type { ToolCatalog } from "../runtime/ports/index.js";
|
|
5
4
|
export interface LocalToolInvokerDeps {
|
|
@@ -7,6 +6,5 @@ export interface LocalToolInvokerDeps {
|
|
|
7
6
|
toolCatalog: ToolCatalog;
|
|
8
7
|
getSessionId(): string;
|
|
9
8
|
log(message: string): void;
|
|
10
|
-
sendNotification<M extends NotificationMethod>(method: M, params: NotificationMethodMap[M]): void;
|
|
11
9
|
}
|
|
12
10
|
export declare function createLocalToolInvoker(deps: LocalToolInvokerDeps): ToolInvoker;
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import { ToolRegistry } from "../skills/tools.js";
|
|
2
2
|
import type { ToolCatalog } from "../runtime/ports/index.js";
|
|
3
|
-
export
|
|
4
|
-
export declare function createToolCatalogFromRegistry(registry
|
|
3
|
+
export { ToolRegistry };
|
|
4
|
+
export declare function createToolCatalogFromRegistry(registry: ToolRegistry): ToolCatalog;
|
|
5
5
|
/**
|
|
6
|
-
* Creates an empty catalog
|
|
7
|
-
*
|
|
8
|
-
* Runtime/session owners must not depend on the legacy registry implementation merely to obtain
|
|
9
|
-
* isolated storage. Keeping construction here makes ToolCatalog the only contract visible above
|
|
10
|
-
* this adapter and leaves the registry removable in a later cleanup.
|
|
6
|
+
* Creates an empty registry-backed catalog for one isolated session overlay.
|
|
11
7
|
*/
|
|
12
8
|
export declare function createIsolatedToolCatalog(): ToolCatalog;
|
|
@@ -8,7 +8,6 @@ export interface ToolResultProcessorDeps {
|
|
|
8
8
|
result: PortableToolResult;
|
|
9
9
|
mediaPersistence: MediaPersistence;
|
|
10
10
|
log(message: string): void;
|
|
11
|
-
sendNotification(method: string, params: unknown): void;
|
|
12
11
|
}
|
|
13
12
|
export declare function processToolResult(deps: ToolResultProcessorDeps): Promise<ToolInvokeResult>;
|
|
14
13
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shared turn-execution core for the turn pipeline (`runTurnPipeline` -> `executeTurnCore`).
|
|
3
|
-
* Owns the `agent.run()` event loop
|
|
4
|
-
*
|
|
5
|
-
* Path-specific behaviour (
|
|
3
|
+
* Owns the `agent.run()` event loop, standard ACP side-event forwarding, terminal content,
|
|
4
|
+
* and usage collection.
|
|
5
|
+
* Path-specific behaviour (usage tracking, literal-response
|
|
6
6
|
* transforms, skill auto-persist) is supplied via optional hooks.
|
|
7
7
|
*/
|
|
8
8
|
import type { ChatMessage, TokenUsage, ToolDefinition, TurnConfig, TurnEvent } from "../agent/types.js";
|
|
@@ -26,8 +26,6 @@ export interface TurnCoreRequest {
|
|
|
26
26
|
drainPendingTaskNotifications?: () => string[];
|
|
27
27
|
/** Sanitize tool-result media the main model can't consume — forwarded to the tool loop. */
|
|
28
28
|
sanitizeToolResultMedia?: (message: Record<string, unknown>) => Promise<void>;
|
|
29
|
-
/** Persist each model-visible tool-stream message to the transcript — forwarded to the tool loop. */
|
|
30
|
-
persistTurnMessage?: (message: ChatMessage) => void;
|
|
31
29
|
systemPrompt: string;
|
|
32
30
|
config: TurnConfig;
|
|
33
31
|
/** Epoch/identity guard supplied by the session lifecycle owner. */
|
|
@@ -39,11 +37,11 @@ export interface TurnCoreAgent {
|
|
|
39
37
|
export interface TurnCoreHooks {
|
|
40
38
|
/** Invoked for every side event handled by `forwardTurnSideEvent` (e.g. tool-call accounting). */
|
|
41
39
|
onSideEvent?: (event: TurnEvent) => void;
|
|
42
|
-
/** Extra work after
|
|
40
|
+
/** Extra work after terminal content is committed. */
|
|
43
41
|
onEnd?: (event: Extract<TurnEvent, {
|
|
44
42
|
type: "end";
|
|
45
43
|
}>, finalContent: string) => void;
|
|
46
|
-
/** Extra work after
|
|
44
|
+
/** Extra work after a terminal Agent error. */
|
|
47
45
|
onError?: (event: Extract<TurnEvent, {
|
|
48
46
|
type: "error";
|
|
49
47
|
}>) => void;
|
|
@@ -62,8 +60,6 @@ export interface TurnCoreResult {
|
|
|
62
60
|
provider?: string;
|
|
63
61
|
}
|
|
64
62
|
/**
|
|
65
|
-
* Drive a single agent turn to completion
|
|
66
|
-
* The caller is responsible for emitting `turn.start` (for the early-lifecycle
|
|
67
|
-
* contract) before invoking this, and for all pre/post-turn pipeline work.
|
|
63
|
+
* Drive a single agent turn to completion and emit only standard ACP updates.
|
|
68
64
|
*/
|
|
69
65
|
export declare function executeTurnCore(host: TurnEventForwardHost, agent: TurnCoreAgent, request: TurnCoreRequest, signal: AbortSignal, hooks?: TurnCoreHooks): Promise<TurnCoreResult>;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import type { TurnEvent } from "../agent/types.js";
|
|
2
|
+
import type { NotificationMethod, NotificationMethodMap } from "../protocol/notifications.js";
|
|
2
3
|
export interface TurnEventForwardHost {
|
|
3
|
-
sendNotification(method:
|
|
4
|
+
sendNotification<M extends NotificationMethod>(method: M, params: NotificationMethodMap[M]): void;
|
|
4
5
|
}
|
|
6
|
+
/**
|
|
7
|
+
* Forward only internal events that have a standard ACP session/update representation.
|
|
8
|
+
* Adapter-only lifecycle, recovery, planning, and telemetry events remain internal.
|
|
9
|
+
*/
|
|
5
10
|
export declare function forwardTurnSideEvent(params: {
|
|
6
11
|
event: TurnEvent;
|
|
7
|
-
turnId: string;
|
|
8
|
-
now: string;
|
|
9
12
|
host: TurnEventForwardHost;
|
|
10
13
|
}): boolean;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { HookRegistry } from "../contracts/hooks.js";
|
|
2
|
-
import { type MemoryPrefetchState } from "../runtime/hooks/memory-hooks.js";
|
|
3
2
|
import { SessionState } from "../runtime/session/session-state.js";
|
|
4
3
|
export interface TurnLifecycleHost {
|
|
5
4
|
activeTurn: AbortController | null;
|
|
@@ -7,8 +6,6 @@ export interface TurnLifecycleHost {
|
|
|
7
6
|
currentSessionId: string;
|
|
8
7
|
currentHooks: HookRegistry | null;
|
|
9
8
|
sessionState: SessionState | null;
|
|
10
|
-
memoryPrefetchState: MemoryPrefetchState;
|
|
11
|
-
enableIdleDream(): void;
|
|
12
9
|
log?(message: string): void;
|
|
13
10
|
}
|
|
14
11
|
export interface PreparedTurnLifecycle {
|
|
@@ -2,17 +2,10 @@ export interface TurnProjectRoutingHost {
|
|
|
2
2
|
getActiveProjectRoot(): string;
|
|
3
3
|
setActiveWorkdir(workdir: string): void;
|
|
4
4
|
log(message: string): void;
|
|
5
|
-
sendNotification(method: string, params: Record<string, unknown>): void;
|
|
6
|
-
}
|
|
7
|
-
export interface StaleProjectHintContext {
|
|
8
|
-
activeProjectName?: string;
|
|
9
|
-
projectNames: string[];
|
|
10
5
|
}
|
|
11
6
|
export interface TurnProjectRoutingResult {
|
|
12
7
|
sessionProjectRoot: string;
|
|
13
8
|
sessionProjectId?: string;
|
|
14
|
-
projectHintStale: boolean;
|
|
15
|
-
staleProjectHintContext?: StaleProjectHintContext;
|
|
16
9
|
/**
|
|
17
10
|
* Set when the turn's config CARRIES a projectId that could not be resolved to a registered
|
|
18
11
|
* project. The caller must treat this as fatal for the turn (reject it) — silently falling back
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
/**
|
|
8
8
|
* All supported hook points in the Agent Runtime lifecycle.
|
|
9
9
|
*/
|
|
10
|
-
export type HookPoint = "session.created" | "session.ended" | "turn.submitted" | "turn.before_inference" | "turn.after_inference" | "turn.completed" | "turn.failed" | "tool.before_invoke" | "tool.after_invoke" | "tool.invoke_failed" | "approval.requested" | "approval.responded" | "permission.denied" | "context.before_compact" | "context.after_compact" | "
|
|
10
|
+
export type HookPoint = "session.created" | "session.ended" | "turn.submitted" | "turn.before_inference" | "turn.after_inference" | "turn.completed" | "turn.failed" | "tool.before_invoke" | "tool.after_invoke" | "tool.invoke_failed" | "approval.requested" | "approval.responded" | "permission.denied" | "context.before_compact" | "context.after_compact" | "subagent.started" | "subagent.stopped" | "stop" | "stop.failed" | "stop.failure" | "task.created" | "task.completed" | "file.changed" | "cwd.changed" | "config.changed" | "instructions.loaded";
|
|
11
11
|
export interface HookSessionContext {
|
|
12
12
|
sessionId: string;
|
|
13
13
|
gatewayId?: string;
|
|
@@ -111,25 +111,6 @@ export interface HookContextMap {
|
|
|
111
111
|
tokenCount?: number;
|
|
112
112
|
removedCount?: number;
|
|
113
113
|
};
|
|
114
|
-
"memory.before_recall": HookTurnContext & {
|
|
115
|
-
query?: string;
|
|
116
|
-
recalledMemories?: Array<{
|
|
117
|
-
text: string;
|
|
118
|
-
id?: string;
|
|
119
|
-
score?: number;
|
|
120
|
-
category?: string | null;
|
|
121
|
-
source?: string;
|
|
122
|
-
label?: string;
|
|
123
|
-
metadata?: Record<string, unknown>;
|
|
124
|
-
}>;
|
|
125
|
-
};
|
|
126
|
-
"memory.after_recall": HookTurnContext & {
|
|
127
|
-
blockCount?: number;
|
|
128
|
-
recalledSummaries?: string[];
|
|
129
|
-
injectedCount?: number;
|
|
130
|
-
droppedCount?: number;
|
|
131
|
-
injectedMemoryIds?: string[];
|
|
132
|
-
};
|
|
133
114
|
"subagent.started": HookSubagentContext;
|
|
134
115
|
"subagent.stopped": HookSubagentContext;
|
|
135
116
|
"stop": HookStopContext;
|
|
@@ -1,4 +1,23 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ToolIdentity } from "../protocol/wire/chat-types.js";
|
|
2
|
+
export interface ToolCallExecutionEvidence {
|
|
3
|
+
sequence: number;
|
|
4
|
+
callId: string;
|
|
5
|
+
name: string;
|
|
6
|
+
identity: ToolIdentity;
|
|
7
|
+
status: "running" | "succeeded" | "failed" | "blocked";
|
|
8
|
+
arguments?: string;
|
|
9
|
+
error?: string;
|
|
10
|
+
failureKind?: "policy_blocked" | "semantic_quality_failed" | "timeout" | "mcp_start_failed" | "mcp_unavailable" | "tool_execution_failed";
|
|
11
|
+
}
|
|
12
|
+
export interface FinalAnswerEvidence {
|
|
13
|
+
schemaVersion: 1;
|
|
14
|
+
requirement: "not-required" | "fresh-tool-evidence";
|
|
15
|
+
disposition: "not-required" | "grounded" | "blocked-no-tool-evidence" | "blocked-no-successful-evidence";
|
|
16
|
+
successfulCallIds: string[];
|
|
17
|
+
failedCallIds: string[];
|
|
18
|
+
blockedCallIds: string[];
|
|
19
|
+
reason: string;
|
|
20
|
+
}
|
|
2
21
|
export declare function isFreshEvidenceToolCall(call: Pick<ToolCallExecutionEvidence, "identity">): boolean;
|
|
3
22
|
export declare function hasSuccessfulFreshToolEvidence(toolCalls: readonly ToolCallExecutionEvidence[]): boolean;
|
|
4
23
|
export declare function classifyToolFailureKind(result: {
|
|
@@ -130,8 +130,8 @@ export type TurnEvent = {
|
|
|
130
130
|
telemetrySource?: "agent";
|
|
131
131
|
/** Versioned terminal ledger for per-call execution and final-answer evidence. */
|
|
132
132
|
ledgerSchemaVersion: 4;
|
|
133
|
-
toolCalls: import("
|
|
134
|
-
finalAnswerEvidence: import("
|
|
133
|
+
toolCalls: import("./tool-execution-evidence.js").ToolCallExecutionEvidence[];
|
|
134
|
+
finalAnswerEvidence: import("./tool-execution-evidence.js").FinalAnswerEvidence;
|
|
135
135
|
availableToolNames: string[];
|
|
136
136
|
enabledToolNames: string[];
|
|
137
137
|
toolCallNames: string[];
|
|
@@ -9,6 +9,6 @@ export { advanceToolLoopState, recoverToolLoopStateFromChatConversation, recover
|
|
|
9
9
|
export { isForegroundSource, isTransientCapacityError, computeRetryBackoff, isPersistentRetryEnabled, FallbackTriggeredError, type PersistentRetryConfig, } from "./error-handling/retry-loop.js";
|
|
10
10
|
export { canForkAtDepth, buildForkedMessages, buildForkPlaceholderResults, FORK_PLACEHOLDER_RESULT, FORK_SENTINEL_TAG, generateForkChildAgentId, isInForkChild, MAX_FORK_DEPTH, resolveForkChildTools, type ForkChildConfig, type ForkChildMessage, type ForkContext, type ForkResult, } from "./subagent/fork-subagent.js";
|
|
11
11
|
export { getBuiltInAgent, getBuiltInAgents, isBuiltInAgent, resolveAgentToolSet, type AgentDefinition, } from "./subagent/agent-registry.js";
|
|
12
|
-
export { createTaskState, type IsolationMode, type PermissionRole, type TaskType, type TaskLifecycle, type TaskState, type TaskStateBase, type LocalBashTaskState, type LocalAgentTaskState, type RemoteAgentTaskState,
|
|
12
|
+
export { createTaskState, type IsolationMode, type PermissionRole, type TaskType, type TaskLifecycle, type TaskState, type TaskStateBase, type LocalBashTaskState, type LocalAgentTaskState, type RemoteAgentTaskState, } from "./subagent/task-types.js";
|
|
13
13
|
export { calculateTokenWarningState, createTurnLoopGuardState, resolveApiErrorRecovery, resolveOutputTokenEscalation, shouldAbortTurn, type ApiErrorRecovery, type TokenWarningState, type TurnLoopGuardConfig, type TurnLoopGuardState, } from "./context/turn-loop-guard.js";
|
|
14
14
|
export { buildPostCompactRestorationMessage, createReactiveCompactState, shouldAttemptReactiveCompact, type ReactiveCompactConfig, type ReactiveCompactState, } from "./context/reactive-compact.js";
|
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
* that qlogicagent emits to external apps.
|
|
4
|
-
*
|
|
5
|
-
* CANONICAL SOURCE: protocol/wire/notification-payloads.ts
|
|
6
|
-
* This file re-exports the wire types.
|
|
7
|
-
* Internal consumers import from this file — zero churn.
|
|
8
|
-
*/
|
|
9
|
-
export type { AgentSource, ArtifactType, MediaResultType, MemoryDecayCompletedNotification, MemoryUpdatedNotification, NotificationMethod, NotificationMethodMap, NotificationThreadItem, ThreadItemNotification, PermissionRuleUpdatedNotification, PlanInterruptedNotification, PongNotification, ProductAgentActivityNotification, ProductBudgetUpdateNotification, ProductBudgetWarningNotification, ProductCheckpointedNotification, ProductCompletedNotification, ProductDagTopologyNotification, ProductMembersNotification, ProductPlanFailedNotification, ProductPlanningDeltaNotification, ProductPlanReadyNotification, ProductLeaderMessageNotification, ProductPlanningAskNotification, ProductTaskCompletedNotification, ProductTaskFailedNotification, ProductTaskOutputDeltaNotification, ProductTaskStartedNotification, ProjectArchivedNotification, ProjectCreatedNotification, ProjectDeletedNotification, ProjectRenamedNotification, ProjectSwitchedNotification, ProjectUnarchivedNotification, SessionInfoNotification, SessionRecoveryPendingNotification, SoloAgentDeltaNotification, SoloAgentUsageNotification, SoloEvaluationNotification, SoloProgressNotification, TeamMemberNotification, ToolApprovalRequestNotification, TurnAnnotationsNotification, TurnArtifactNotification, TurnAskUserNotification, TurnDeltaNotification, TurnEndNotification, TurnErrorNotification, TurnExecProgressNotification, TurnHeartbeatNotification, TurnMediaResultNotification, TurnPlanUpdateNotification, TurnProgressNotification, TurnReasoningDeltaNotification, TurnRecoveryNotification, TurnSidechainCompletedNotification, TurnSidechainStartedNotification, TurnStartNotification, TurnSubagentActivityNotification, TurnSubagentActivityStatus, TurnSubagentCompletedNotification, TurnSubagentDecisionNotification, TurnSubagentDeltaNotification, TurnSubagentEvidenceItem, TurnSubagentStartedNotification, TurnSubagentTokenUsage, TurnSuggestionsNotification, TurnTaskUpdatedNotification, TurnTodosUpdatedNotification, TurnToolBlockedNotification, TurnToolCallNotification, TurnToolResultNotification, TurnToolUseSummaryNotification, TurnUsageUpdateNotification, WireTokenUsage, MentionDelegateStartedNotification, MentionDelegateActivityNotification, MentionDelegateSettledNotification, } from "./wire/index.js";
|
|
1
|
+
/** Adapter-internal events with a direct standard ACP projection. */
|
|
2
|
+
export type { MediaResultType, NotificationMethod, NotificationMethodMap, TurnDeltaNotification, TurnEndNotification, TurnMediaResultNotification, TurnReasoningDeltaNotification, TurnToolBlockedNotification, TurnToolCallNotification, TurnToolResultNotification, WireTokenUsage, } from "./wire/notification-payloads.js";
|