qlogicagent 2.23.14 → 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 +2 -6
- package/dist/types/agent/types.d.ts +9 -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 +4 -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 +8 -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 +8 -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,18 +1,15 @@
|
|
|
1
1
|
import type { AgentLogger, ToolInvoker } from "../agent/types.js";
|
|
2
2
|
import type { HookRegistry } from "../contracts/hooks.js";
|
|
3
|
-
import type { NotificationMethod, NotificationMethodMap } from "../protocol/notifications.js";
|
|
4
3
|
import type { AcpPermissionRequestParams } from "../protocol/wire/index.js";
|
|
5
|
-
import type { MemoryPrefetchState } from "../runtime/hooks/memory-hooks.js";
|
|
6
4
|
import type { BackgroundTaskManager } from "../runtime/infra/background-tasks.js";
|
|
7
5
|
import type { TaskStore } from "../runtime/infra/task-runtime.js";
|
|
8
|
-
import type {
|
|
6
|
+
import type { PermissionMetadataResolver, PermissionRuleEnginePort, PathService, ToolCatalog } from "../runtime/ports/index.js";
|
|
9
7
|
import type { McpManager } from "../skills/mcp/mcp-manager.js";
|
|
10
8
|
import type { PluginLoader } from "../skills/plugins/plugin-loader.js";
|
|
11
9
|
import type { CliAgentClient } from "./cli-agent-builder.js";
|
|
12
10
|
import { type CliCoreToolHostDeps } from "./core-tool-coordinator.js";
|
|
13
11
|
import { type PermissionBootstrapDeps } from "./permission-bootstrap.js";
|
|
14
12
|
import type { RuntimePermissionRuleEngine } from "./permission-runtime-service.js";
|
|
15
|
-
import type { LLMTransport } from "./provider-core-facade.js";
|
|
16
13
|
import { type FileWatcher } from "./runtime-watcher-bootstrap.js";
|
|
17
14
|
export type { FileWatcher };
|
|
18
15
|
export interface AgentRuntimeBootstrapDeps {
|
|
@@ -25,18 +22,6 @@ export interface AgentRuntimeBootstrapDeps {
|
|
|
25
22
|
projectRoot: string;
|
|
26
23
|
pathService: PathService;
|
|
27
24
|
getActiveWorkdir?: () => string;
|
|
28
|
-
memdir: ProjectMemoryStore;
|
|
29
|
-
getMemdir?: () => ProjectMemoryStore | null;
|
|
30
|
-
currentUserId: string;
|
|
31
|
-
memoryPrefetchState: MemoryPrefetchState;
|
|
32
|
-
getLastUserMessage(): string | undefined;
|
|
33
|
-
getLastAssistantMessage(): string | undefined;
|
|
34
|
-
resolveSmallModelClient(): {
|
|
35
|
-
transport: LLMTransport;
|
|
36
|
-
apiKey: string;
|
|
37
|
-
model: string;
|
|
38
|
-
} | null;
|
|
39
|
-
scheduleBackgroundMemoryWork(label: string, work: (signal: AbortSignal) => Promise<void>): Promise<boolean>;
|
|
40
25
|
agentClient: CliAgentClient;
|
|
41
26
|
toolCatalog: ToolCatalog;
|
|
42
27
|
currentMcpManager: McpManager | null;
|
|
@@ -49,11 +34,8 @@ export interface AgentRuntimeBootstrapDeps {
|
|
|
49
34
|
getPluginSkills(): ReturnType<PluginLoader["getPluginSkills"]>;
|
|
50
35
|
getAcpPermissionSession(): {
|
|
51
36
|
sessionId: string;
|
|
52
|
-
requestPermission(params: AcpPermissionRequestParams): Promise<
|
|
53
|
-
optionId?: string;
|
|
54
|
-
}>;
|
|
37
|
+
requestPermission(params: AcpPermissionRequestParams): Promise<import("../protocol/wire/index.js").AcpPermissionRequestResult>;
|
|
55
38
|
} | undefined;
|
|
56
|
-
sendNotification<M extends NotificationMethod>(method: M, params: NotificationMethodMap[M]): void;
|
|
57
39
|
existingPermissionRuleEngine?: RuntimePermissionRuleEngine;
|
|
58
40
|
resolveSandboxPermissionSnapshot?: PermissionBootstrapDeps["resolveSandboxPermissionSnapshot"];
|
|
59
41
|
coreToolHost: CliCoreToolHostDeps;
|
|
@@ -63,9 +45,6 @@ export interface AgentRuntimeBootstrapDeps {
|
|
|
63
45
|
}
|
|
64
46
|
export interface AgentRuntimeBootstrapResult {
|
|
65
47
|
hooks: HookRegistry;
|
|
66
|
-
memoryHandlerProvider: MemoryHandlerProvider | null;
|
|
67
|
-
memoryDreamProvider: MemoryDreamRuntimeProvider | null;
|
|
68
|
-
memoryUserId: string;
|
|
69
48
|
permissionChecker: PermissionMetadataResolver;
|
|
70
49
|
permissionUnregister: () => void;
|
|
71
50
|
ruleEngine: PermissionRuleEnginePort;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { HookRegistry } from "../contracts/hooks.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { PermissionMetadataResolver, PermissionRuleEnginePort, ToolCatalog } from "../runtime/ports/index.js";
|
|
3
3
|
import type { McpManager } from "../skills/mcp/mcp-manager.js";
|
|
4
4
|
import type { PluginLoader } from "../skills/plugins/plugin-loader.js";
|
|
5
5
|
import type { AgentRuntimeBootstrapResult, FileWatcher } from "./agent-runtime-bootstrap.js";
|
|
@@ -21,9 +21,6 @@ export declare class AgentRuntimeSessionState {
|
|
|
21
21
|
private readonly mcpBySession;
|
|
22
22
|
pluginLoader: PluginLoader | null;
|
|
23
23
|
fileWatcher: FileWatcher | null;
|
|
24
|
-
memoryProvider: MemoryHandlerProvider | null;
|
|
25
|
-
memoryDreamProvider: MemoryDreamRuntimeProvider | null;
|
|
26
|
-
memoryUserId: string;
|
|
27
24
|
constructor(now?: () => number);
|
|
28
25
|
getPluginSkills(): ReturnType<PluginLoader["getPluginSkills"]>;
|
|
29
26
|
applyBootstrap(sessionId: string, result: AgentRuntimeBootstrapResult): void;
|
|
@@ -32,7 +29,6 @@ export declare class AgentRuntimeSessionState {
|
|
|
32
29
|
getPermissionState(sessionId: string): PermissionState | undefined;
|
|
33
30
|
getRuntimeState(sessionId: string): SessionRuntimeState | undefined;
|
|
34
31
|
getPermissionUnregister(sessionId: string): (() => void) | null;
|
|
35
|
-
resetAfterSessionDispose(): void;
|
|
36
32
|
stopFileWatcher(): void;
|
|
37
33
|
getMcpToolCatalog(sessionId: string, baseCatalog: ToolCatalog): ToolCatalog;
|
|
38
34
|
getMcpManager(sessionId: string): McpManager | null;
|
|
@@ -45,7 +41,6 @@ export declare class AgentRuntimeSessionState {
|
|
|
45
41
|
disconnectMcp(sessionId: string): Promise<void>;
|
|
46
42
|
disconnectAllMcp(): Promise<void>;
|
|
47
43
|
unregisterPermissions(sessionId?: string): void;
|
|
48
|
-
resetMemoryProviders(): void;
|
|
49
44
|
private ensureMcpSession;
|
|
50
45
|
private retirePermissionUnregister;
|
|
51
46
|
private flushRetiredPermissionUnregisters;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { NotificationMethod, NotificationMethodMap } from "../protocol/notifications.js";
|
|
2
1
|
import type { ToolBootstrap } from "../runtime/ports/index.js";
|
|
3
2
|
import type { PathService } from "../runtime/ports/index.js";
|
|
4
3
|
import type { MediaPersistence } from "../runtime/infra/media-persistence.js";
|
|
@@ -8,7 +7,6 @@ export interface BaseToolBootstrapDeps {
|
|
|
8
7
|
pathService: PathService;
|
|
9
8
|
mediaPersistence?: MediaPersistence;
|
|
10
9
|
log(message: string): void;
|
|
11
|
-
sendNotification<M extends NotificationMethod>(method: M, params: NotificationMethodMap[M]): void;
|
|
12
10
|
getTaskScopeKey?(): string | undefined;
|
|
13
11
|
getCurrentTurnId?(): string | undefined;
|
|
14
12
|
isGroupSecurityMode?(): boolean;
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import type { AcpRequestHandler } from "../transport/acp-server.js";
|
|
2
|
-
import type {
|
|
3
|
-
import * as acpExtended from "./acp-extended-handlers.js";
|
|
2
|
+
import type { PermissionMetadataResolver } from "../runtime/ports/index.js";
|
|
4
3
|
import * as acpSession from "./acp-session-handlers.js";
|
|
5
4
|
export interface CliAcpRequestHandlerHost extends acpSession.AcpSessionHost {
|
|
6
5
|
activeTurn: AbortController | null;
|
|
7
6
|
turnDone?: Promise<void>;
|
|
8
7
|
/** Id of the turn currently running; used to key cancel requests. */
|
|
9
8
|
currentTurnId?: string;
|
|
10
|
-
permissionChecker?:
|
|
9
|
+
permissionChecker?: PermissionMetadataResolver | null;
|
|
11
10
|
/** LH-10: propagate an explicit cancel to the background tasks the given (or
|
|
12
11
|
* current) session launched. No-op if the host has no task registry. */
|
|
13
12
|
cancelBackgroundTasksForSession?(sessionId?: string, parentTurnId?: string): void;
|
|
14
|
-
scheduleBackgroundMemoryWork(label: string, work: (signal: AbortSignal) => Promise<void>): Promise<boolean>;
|
|
15
13
|
}
|
|
16
|
-
export declare function createCliAcpRequestHandler(host: CliAcpRequestHandlerHost, packageVersion: string
|
|
14
|
+
export declare function createCliAcpRequestHandler(host: CliAcpRequestHandlerHost, packageVersion: string): AcpRequestHandler;
|
|
@@ -3,7 +3,6 @@ import type { HookRegistry } from "../contracts/hooks.js";
|
|
|
3
3
|
import type { BackgroundTaskManager } from "../runtime/infra/background-tasks.js";
|
|
4
4
|
import type { ToolCatalog } from "../runtime/ports/index.js";
|
|
5
5
|
import type { LLMTransport } from "./provider-core-facade.js";
|
|
6
|
-
import type { HostProfileClient } from "../transport/host-profile-client.js";
|
|
7
6
|
export interface CliCoreToolHostDeps {
|
|
8
7
|
getAgent(): unknown | null;
|
|
9
8
|
getCurrentTransport(): LLMTransport | null;
|
|
@@ -18,10 +17,7 @@ export interface CliCoreToolHostDeps {
|
|
|
18
17
|
getBackgroundTasks(): BackgroundTaskManager | null;
|
|
19
18
|
getConversationHistory(): readonly ChatMessage[] | null;
|
|
20
19
|
isGroupContext(): boolean;
|
|
21
|
-
getMemoryIndex(): string | null;
|
|
22
|
-
sendNotification(method: string, params: Record<string, unknown>): void;
|
|
23
20
|
handleMcpToolCall(memberId: string, toolName: string, args: Record<string, unknown>): Promise<unknown>;
|
|
24
|
-
getHostProfileClient?(): HostProfileClient | undefined;
|
|
25
21
|
}
|
|
26
22
|
export interface CliCoreToolCoordinatorDeps {
|
|
27
23
|
host: CliCoreToolHostDeps;
|
|
@@ -15,7 +15,6 @@ export interface AgentToolServiceHost {
|
|
|
15
15
|
/** Session id of the launching turn — stamped on background tasks so an
|
|
16
16
|
* explicit cancel can reach the work this session spawned (LH-10). */
|
|
17
17
|
readonly currentSessionId?: string;
|
|
18
|
-
sendNotification(method: string, params: Record<string, unknown>): void;
|
|
19
18
|
/** Unified background execution registry. Required for background=true forks. */
|
|
20
19
|
getBackgroundTasks(): BackgroundTaskManager | null;
|
|
21
20
|
/**
|
|
@@ -28,8 +27,6 @@ export interface AgentToolServiceHost {
|
|
|
28
27
|
isGroupContext(): boolean;
|
|
29
28
|
/** Active project root — for loading the subagent's project rules / AGENTS. */
|
|
30
29
|
getActiveProjectRoot(): string;
|
|
31
|
-
/** Lightweight memory INDEX block injected into the subagent system prompt. */
|
|
32
|
-
getMemoryIndex(): string | null;
|
|
33
30
|
}
|
|
34
31
|
export interface AgentToolServiceOptions {
|
|
35
32
|
host: AgentToolServiceHost;
|
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
* Subagent system-prompt assembly.
|
|
3
3
|
*
|
|
4
4
|
* A forked subagent starts FRESH (no parent conversation by default), but it
|
|
5
|
-
* still needs
|
|
5
|
+
* still needs two things the parent has, injected by policy:
|
|
6
6
|
* 1. Persona — who it is and how it should behave (agent definition).
|
|
7
7
|
* 2. Project rules — the same .qlogicagent/rules + AGENTS.md the parent loads.
|
|
8
|
-
* 3. Memory — the lightweight memory INDEX (user preferences / project facts).
|
|
9
8
|
*
|
|
10
9
|
* Without these the subagent produces off-convention work and ignores standing
|
|
11
10
|
* user/project context. This mirrors Claude Code's "compose a delegation
|
|
@@ -20,8 +19,6 @@ export interface SubagentSystemPromptInput {
|
|
|
20
19
|
cwd?: string;
|
|
21
20
|
/** Hook registry (instruction loader uses it). */
|
|
22
21
|
hooks?: HookRegistry;
|
|
23
|
-
/** Lightweight memory INDEX block (memdir.getIndexForPrompt()), or null. */
|
|
24
|
-
memoryIndex: string | null;
|
|
25
22
|
/**
|
|
26
23
|
* Inject project rules / AGENTS. True for the in-process fork (it has no turn
|
|
27
24
|
* pipeline of its own). False for a subprocess team member, which assembles its
|
|
@@ -36,7 +33,6 @@ export declare function personaForAgentDefinition(agentDef: AgentDefinition): st
|
|
|
36
33
|
* and the subprocess team member, so their standing context is identical:
|
|
37
34
|
* 1. persona — who the subagent is / how it behaves (caller-supplied)
|
|
38
35
|
* 2. project rules / AGENTS — the same getInstructions the parent loads
|
|
39
|
-
* 3. memory — the lightweight memdir INDEX (preferences / project facts)
|
|
40
36
|
*
|
|
41
37
|
* Returns undefined when there is genuinely nothing to inject.
|
|
42
38
|
*/
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
import type { AgentRpcError, AgentRpcRequest } from "../../protocol/wire/index.js";
|
|
2
|
-
export interface FilesHandlerHost {
|
|
3
|
-
getActiveProjectRoot(): string;
|
|
4
|
-
sendResponse(id: string | number, result?: unknown, error?: AgentRpcError): void;
|
|
5
|
-
}
|
|
6
1
|
export declare function resolveProjectDir(projectId: string): string | undefined;
|
|
7
|
-
export declare function handlePlansList(this: FilesHandlerHost, msg: AgentRpcRequest): void;
|
|
@@ -1,99 +1,40 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Turn execution handlers — extracted from StdioServer.
|
|
3
|
-
* Handles
|
|
3
|
+
* Handles the shared ACP turn pipeline.
|
|
4
4
|
*/
|
|
5
5
|
import { type ModelPurpose } from "../../runtime/infra/model-registry.js";
|
|
6
6
|
import { type InstructionFileInfo } from "../../runtime/prompt/instruction-loader.js";
|
|
7
7
|
import type { HookRegistry } from "../../contracts/hooks.js";
|
|
8
8
|
export { isStructuredPlannerSystemPrompt } from "../../contracts/structured-planner.js";
|
|
9
|
-
import type { AppendMessageOutcome } from "../../runtime/session/session-transcript-store.js";
|
|
10
9
|
import type { PermissionMetadataResolver, ToolCatalog } from "../../runtime/ports/index.js";
|
|
11
10
|
import type { ChatMessage, TokenUsage, ToolDefinition, TurnConfig } from "../../agent/types.js";
|
|
12
|
-
import type { AgentRpcRequest } from "../../protocol/wire/agent-rpc.js";
|
|
13
11
|
type UnderstandMediaKind = "image" | "video" | "audio";
|
|
14
|
-
interface PendingAskUserRequest {
|
|
15
|
-
resolve(answers: Record<string, string> | null): void;
|
|
16
|
-
}
|
|
17
12
|
export interface TurnControlHandlerHost {
|
|
18
13
|
activeTurn: AbortController | null;
|
|
19
14
|
permissionChecker?: PermissionMetadataResolver | null;
|
|
20
15
|
toolCatalog?: ToolCatalog;
|
|
21
|
-
pendingAskUser: Map<string, PendingAskUserRequest>;
|
|
22
16
|
log(message: string): void;
|
|
23
|
-
sendResponse(id: string | number, result?: unknown, error?: unknown): void;
|
|
24
|
-
/** Mid-turn guidance queue (运行中引导) — drained by the tool loop each round. */
|
|
25
|
-
pendingTurnGuidance?: string[];
|
|
26
17
|
currentSessionId?: string;
|
|
27
18
|
currentTurnId?: string;
|
|
28
19
|
getActiveProjectRoot?(): string;
|
|
29
20
|
}
|
|
30
|
-
/**
|
|
31
|
-
* turn.guide — queue user guidance INTO the running turn (队列"运行中引导").
|
|
32
|
-
* The text lands in the tool loop's next round as a user message, and is
|
|
33
|
-
* persisted to the session transcript so later turns keep it in history.
|
|
34
|
-
* Fails when no turn is active (caller falls back to the plain queue).
|
|
35
|
-
*/
|
|
36
|
-
export declare function handleTurnGuide(this: TurnControlHandlerHost, msg: AgentRpcRequest): void;
|
|
37
|
-
/**
|
|
38
|
-
* First-turn session-title generation, extracted so the caller can run it
|
|
39
|
-
* fire-and-forget (see run()). Behavior is identical to the previous inline
|
|
40
|
-
* block; the only change is that the LLM round-trip inside `generateTitle`
|
|
41
|
-
* no longer sits on the critical path before executeTurnCore.
|
|
42
|
-
*
|
|
43
|
-
* Dependencies are injected so this is a pure, testable unit:
|
|
44
|
-
* - `generateTitle` wraps generateSessionTitle (which keeps the deterministic
|
|
45
|
-
* fast-path internally — it is NOT bypassed here).
|
|
46
|
-
* - `fallbackTitle` wraps titleFromPromptFallback (applied when generation
|
|
47
|
-
* yields nothing).
|
|
48
|
-
* - `persistTitle` wraps updateSessionMetadata (swallowing its own errors).
|
|
49
|
-
*
|
|
50
|
-
* Returns a promise for the async work; callers that want fire-and-forget
|
|
51
|
-
* should `void` it (with a `.catch(() => {})` guard).
|
|
52
|
-
*/
|
|
53
|
-
export interface FirstTurnTitleGenerationDeps {
|
|
54
|
-
existingTitle: string | undefined;
|
|
55
|
-
firstUserText: string;
|
|
56
|
-
sessionId: string;
|
|
57
|
-
projectId: string | undefined;
|
|
58
|
-
generateTitle(firstUserText: string): Promise<string | null>;
|
|
59
|
-
fallbackTitle(firstUserText: string): string;
|
|
60
|
-
persistTitle(title: string): Promise<void>;
|
|
61
|
-
sendNotification(method: string, params: Record<string, unknown>): void;
|
|
62
|
-
log(message: string): void;
|
|
63
|
-
}
|
|
64
|
-
export declare function runFirstTurnTitleGeneration(deps: FirstTurnTitleGenerationDeps): Promise<void>;
|
|
65
21
|
/**
|
|
66
22
|
* Loud trace for fire-and-forget background persistence work inside the turn pipeline.
|
|
67
23
|
* Replaces the old silent `.catch(() => {})` pattern (judgment-over-mechanism: a failed write
|
|
68
24
|
* must at least be diagnosable in the engine log, never swallowed).
|
|
69
25
|
*/
|
|
70
26
|
export declare function logTurnBackgroundFailure(context: string, err: unknown): void;
|
|
71
|
-
/**
|
|
72
|
-
* Per-turn transcript-persist failure reporter. A lost transcript write means the conversation is
|
|
73
|
-
* missing messages after a reload — that must be VISIBLE: console.error every failure with turn
|
|
74
|
-
* context, and emit ONE `turn.recovery` notification per turn (first failure only) so the user is
|
|
75
|
-
* told without flooding the stream when several writes of the same turn fail.
|
|
76
|
-
* "skipped-deleted" is the legal late-write no-op on a deleted session — not a failure, no trace.
|
|
77
|
-
*/
|
|
78
|
-
export declare function createTranscriptPersistFailureReporter(deps: {
|
|
79
|
-
turnId: string;
|
|
80
|
-
sessionId: string;
|
|
81
|
-
sendNotification(method: string, params: Record<string, unknown>): void;
|
|
82
|
-
}): (which: string, outcome: AppendMessageOutcome | {
|
|
83
|
-
rejected: unknown;
|
|
84
|
-
}) => void;
|
|
85
27
|
/**
|
|
86
28
|
* Load the INSTRUCTIONS.md / project-rules block for a turn. A load failure means the WHOLE turn
|
|
87
29
|
* runs without the user's standing rules — the old inline catch called that "non-fatal" and left
|
|
88
|
-
* zero trace. Degrading is still the right call (the turn can proceed), but it must be visible
|
|
89
|
-
*
|
|
30
|
+
* zero trace. Degrading is still the right call (the turn can proceed), but it must be visible
|
|
31
|
+
* in the adapter diagnostic log.
|
|
90
32
|
* `loadInstructions` is injectable so tests can force a failure; defaults to getInstructions.
|
|
91
33
|
*/
|
|
92
34
|
export declare function loadInstructionBlockForTurn(deps: {
|
|
93
35
|
cwd: string;
|
|
94
36
|
turnId: string;
|
|
95
37
|
hooks?: HookRegistry;
|
|
96
|
-
sendNotification(method: string, params: Record<string, unknown>): void;
|
|
97
38
|
loadInstructions?(cwd: string, hooks?: HookRegistry): Promise<InstructionFileInfo[]>;
|
|
98
39
|
}): Promise<string | undefined>;
|
|
99
40
|
export declare function hydrateTurnConfigFromModelMetadata(config: TurnConfig): TurnConfig;
|
|
@@ -107,20 +48,7 @@ export declare function hydrateAttachmentReferenceUrlsForTurn(messages: ChatMess
|
|
|
107
48
|
*/
|
|
108
49
|
export declare function augmentLastUserMessageContent(messages: ChatMessage[], modelContext: string): ChatMessage[];
|
|
109
50
|
export declare function getLatestUserTextForTurn(messages: readonly ChatMessage[]): string;
|
|
110
|
-
/**
|
|
111
|
-
* Two-layer memory INDEX block for the per-turn conversation channel (global
|
|
112
|
-
* owner cheat-sheet first, then project notes; injected before the last user
|
|
113
|
-
* message). Living here instead of the system prompt
|
|
114
|
-
* is deliberate: INDEX content changes whenever Host project memory is updated,
|
|
115
|
-
* and as a volatile system-prompt section every update re-encoded the byte-stable
|
|
116
|
-
* prefix plus the whole conversation history on the next turn. In the per-turn
|
|
117
|
-
* channel only the tail changes — the cached prefix survives.
|
|
118
|
-
*/
|
|
119
|
-
export declare function buildMemoryIndexBlock(globalBlock: string | null, projectBlock: string | null): string | null;
|
|
120
|
-
export declare function buildMemoryIndexAdmissionReceipt(globalBlock: string | null, projectBlock: string | null, sessionId: string, turnId: string): Record<string, unknown> | null;
|
|
121
|
-
export declare function injectContextBeforeLastUser(messages: ChatMessage[], context: string): ChatMessage[];
|
|
122
51
|
export declare function refreshPermissionCheckerToolMeta(permissionChecker: PermissionMetadataResolver | null | undefined, tools: ToolDefinition[]): void;
|
|
123
|
-
export declare function handleUserResponse(this: TurnControlHandlerHost, msg: AgentRpcRequest): void;
|
|
124
52
|
interface ModalityRegistryView {
|
|
125
53
|
acceptsInputModality(modality: string, purpose: ModelPurpose): boolean;
|
|
126
54
|
isToolProjected(purpose: ModelPurpose): boolean;
|
|
@@ -152,12 +80,9 @@ export interface MediaUnderstandingPlan {
|
|
|
152
80
|
*
|
|
153
81
|
* Reliability note: unlike the eager path, this DEPENDS on the model calling the tool — the medium is not
|
|
154
82
|
* transcribed anywhere, so if the model ignores the notice the understanding does not happen this turn
|
|
155
|
-
* Cross-turn
|
|
156
|
-
*
|
|
157
|
-
*
|
|
158
|
-
* transcript stores just the user text (media stripped) + the assistant's text, not the tool calls/results
|
|
159
|
-
* (see appendMessage), so re-opening the session in a fresh process rebuilds history without the ref —
|
|
160
|
-
* the model then has only its earlier answer text, not a way to look again.
|
|
83
|
+
* Cross-turn behavior depends on the exact Host-owned history snapshot projected
|
|
84
|
+
* on the next prompt. The adapter keeps no separate transcript or media reference
|
|
85
|
+
* store, so it cannot silently diverge from Host state.
|
|
161
86
|
*
|
|
162
87
|
* Attachments were saved to disk + rewritten to short gateway local-media URLs by persistInboundUploadsForTurn
|
|
163
88
|
* upstream, so a proxy ref is compact; isToolAddressableRef guards the residual raw-data: case. Mutates
|
|
@@ -186,8 +111,7 @@ export interface TurnPipelineInput {
|
|
|
186
111
|
export interface TurnPipelineResult {
|
|
187
112
|
content: string;
|
|
188
113
|
usage?: TokenUsage;
|
|
189
|
-
/** Turn error (if any), surfaced in-band for the ACP session/prompt response.
|
|
190
|
-
* turn.error notification is still emitted for streaming UIs. */
|
|
114
|
+
/** Turn error (if any), surfaced in-band for the ACP session/prompt response. */
|
|
191
115
|
error?: {
|
|
192
116
|
message: string;
|
|
193
117
|
code?: string;
|
package/dist/types/cli/main.d.ts
CHANGED
|
@@ -6,10 +6,8 @@
|
|
|
6
6
|
* All log/debug output goes to stderr (never pollutes the protocol).
|
|
7
7
|
*
|
|
8
8
|
* Usage:
|
|
9
|
-
* qlogicagent [--verbose]
|
|
9
|
+
* qlogicagent [--verbose]
|
|
10
10
|
*
|
|
11
|
-
*
|
|
12
|
-
* verbose Enable debug logging to stderr
|
|
13
|
-
* acp Enable ACP (Agent-Client Protocol) server alongside legacy protocol
|
|
11
|
+
* Flag: `--verbose` enables debug logging to stderr.
|
|
14
12
|
*/
|
|
15
13
|
export {};
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { type AcpPermissionRequestParams } from "../protocol/wire/index.js";
|
|
1
|
+
import { type AcpPermissionRequestParams, type AcpPermissionRequestResult } from "../protocol/wire/index.js";
|
|
3
2
|
import type { ApprovalRequest, ApprovalResponse } from "../runtime/ports/index.js";
|
|
4
3
|
export interface PermissionApprovalBridgeDeps {
|
|
5
4
|
getAcpPermissionSession(): {
|
|
6
5
|
sessionId: string;
|
|
7
|
-
requestPermission(params: AcpPermissionRequestParams): Promise<
|
|
8
|
-
optionId?: string;
|
|
9
|
-
}>;
|
|
6
|
+
requestPermission(params: AcpPermissionRequestParams): Promise<AcpPermissionRequestResult>;
|
|
10
7
|
} | undefined;
|
|
11
|
-
sendNotification<M extends NotificationMethod>(method: M, params: NotificationMethodMap[M]): void;
|
|
12
8
|
}
|
|
13
9
|
export declare function requestPermissionApproval(request: ApprovalRequest, deps: PermissionApprovalBridgeDeps): Promise<ApprovalResponse>;
|
|
14
10
|
export declare function createApprovalResponseFromAcpOption(request: ApprovalRequest, optionId: string | undefined): ApprovalResponse;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import type { HookRegistry } from "../contracts/hooks.js";
|
|
2
|
-
import type { NotificationMethod, NotificationMethodMap } from "../protocol/notifications.js";
|
|
3
2
|
import type { AcpPermissionRequestParams } from "../protocol/wire/index.js";
|
|
4
3
|
import type { ToolCatalog } from "../runtime/ports/index.js";
|
|
5
4
|
import { type SandboxPermissionSnapshot } from "./tool-bootstrap.js";
|
|
6
|
-
import type { HostProfileClient } from "../transport/host-profile-client.js";
|
|
7
5
|
import { type RuntimePermissionChecker, type RuntimePermissionRuleEngine } from "./permission-runtime-service.js";
|
|
8
6
|
export { createApprovalResponseFromAcpOption } from "./permission-approval-bridge.js";
|
|
9
7
|
export interface PermissionBootstrapDeps {
|
|
@@ -21,21 +19,13 @@ export interface PermissionBootstrapDeps {
|
|
|
21
19
|
* The live active tool workdir (where file/exec relative paths resolve). The
|
|
22
20
|
* cross-workspace classifier compares tool target paths against THIS, not
|
|
23
21
|
* getActiveProjectRoot — the latter is a (possibly snapshotted) project root
|
|
24
|
-
*
|
|
22
|
+
* does not track the per-turn tool workdir.
|
|
25
23
|
*/
|
|
26
24
|
getActiveWorkdir(): string;
|
|
27
25
|
getAcpPermissionSession(): {
|
|
28
26
|
sessionId: string;
|
|
29
|
-
requestPermission(params: AcpPermissionRequestParams): Promise<
|
|
30
|
-
optionId?: string;
|
|
31
|
-
}>;
|
|
27
|
+
requestPermission(params: AcpPermissionRequestParams): Promise<import("../protocol/wire/index.js").AcpPermissionRequestResult>;
|
|
32
28
|
} | undefined;
|
|
33
|
-
sendNotification<M extends NotificationMethod>(method: M, params: NotificationMethodMap[M]): void;
|
|
34
|
-
resolveHostProfileClient?: () => HostProfileClient | undefined;
|
|
35
|
-
sessionPermissionStore?: {
|
|
36
|
-
loadAllowedDirectories(sessionId: string, projectRoot: string): string[];
|
|
37
|
-
appendAllowedDirectory(sessionId: string, projectRoot: string, pathPrefix: string): Promise<void>;
|
|
38
|
-
};
|
|
39
29
|
/** Existing session engine reused when an Agent is rebuilt for the same session. */
|
|
40
30
|
existingRuleEngine?: RuntimePermissionRuleEngine;
|
|
41
31
|
/** AsyncLocal-aware resolver supplied by the pooled stdio host. */
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import type { HookRegistry } from "../contracts/hooks.js";
|
|
2
2
|
import type { RuntimeLogger } from "../runtime/hooks/hook-registry.js";
|
|
3
|
-
import type {
|
|
3
|
+
import type { ToolCatalog } from "../runtime/ports/index.js";
|
|
4
4
|
import { PluginLoader } from "../skills/plugins/plugin-loader.js";
|
|
5
|
-
export declare const HOST_PLUGIN_REFS_FILE_ENV = "QLOGICAGENT_HOST_PLUGIN_REFS_FILE";
|
|
6
5
|
export interface PluginBootstrapDeps {
|
|
7
6
|
config: Record<string, unknown>;
|
|
8
7
|
hooks: HookRegistry;
|
|
9
8
|
log: RuntimeLogger;
|
|
10
|
-
pathService: PathService;
|
|
11
9
|
toolCatalog: ToolCatalog;
|
|
12
10
|
setPluginLoader(loader: PluginLoader): void;
|
|
13
11
|
}
|
|
14
12
|
export declare const pluginToolRegistrationModule: import("../runtime/ports/tool-contracts.js").ToolRegistrationModule<PluginBootstrapDeps>;
|
|
15
13
|
export declare function configurePluginBootstrap(deps: PluginBootstrapDeps): void;
|
|
16
|
-
export declare function resolvePluginDirsFromConfig(config: Record<string, unknown
|
|
14
|
+
export declare function resolvePluginDirsFromConfig(config: Record<string, unknown>): string[];
|
|
@@ -1,40 +1,19 @@
|
|
|
1
1
|
import type { AgentLogger } from "../agent/types.js";
|
|
2
2
|
import type { HookRegistry } from "../contracts/hooks.js";
|
|
3
|
-
import { type MemoryPrefetchState } from "../runtime/hooks/memory-hooks.js";
|
|
4
3
|
import type { BackgroundTaskManager } from "../runtime/infra/background-tasks.js";
|
|
5
4
|
import type { TaskStore } from "../runtime/infra/task-runtime.js";
|
|
6
|
-
import type { MemoryDreamRuntimeProvider, MemoryHandlerProvider, MemoryLearningSink, ProjectMemoryStore } from "../runtime/ports/index.js";
|
|
7
5
|
import type { LLMTransport } from "./provider-core-facade.js";
|
|
8
6
|
export interface RuntimeHookBootstrapDeps {
|
|
9
7
|
log: AgentLogger;
|
|
10
8
|
taskStore: TaskStore;
|
|
11
9
|
backgroundTasks: BackgroundTaskManager;
|
|
12
10
|
sessionId: string;
|
|
13
|
-
getTurnId(): string;
|
|
14
|
-
projectRoot: string;
|
|
15
|
-
memdir: ProjectMemoryStore;
|
|
16
|
-
getMemdir?: () => ProjectMemoryStore | null;
|
|
17
|
-
currentUserId: string;
|
|
18
|
-
prefetchState: MemoryPrefetchState;
|
|
19
|
-
getLastUserMessage(): string | undefined;
|
|
20
|
-
getLastAssistantMessage(): string | undefined;
|
|
21
|
-
resolveSmallModelClient(): {
|
|
22
|
-
transport: LLMTransport;
|
|
23
|
-
apiKey: string;
|
|
24
|
-
model: string;
|
|
25
|
-
} | null;
|
|
26
|
-
scheduleBackgroundMemoryWork(label: string, work: (signal: AbortSignal) => Promise<void>): Promise<boolean>;
|
|
27
11
|
compressionClient: {
|
|
28
12
|
transport: LLMTransport;
|
|
29
13
|
apiKey: string;
|
|
30
14
|
};
|
|
31
|
-
sendNotification?(method: string, params: Record<string, unknown>): void;
|
|
32
15
|
}
|
|
33
16
|
export interface RuntimeHookBootstrapResult {
|
|
34
17
|
hooks: HookRegistry;
|
|
35
|
-
memoryHandlerProvider: MemoryHandlerProvider | null;
|
|
36
|
-
memoryDreamProvider: MemoryDreamRuntimeProvider | null;
|
|
37
|
-
memoryLearningSink: MemoryLearningSink | null;
|
|
38
|
-
memoryUserId: string;
|
|
39
18
|
}
|
|
40
19
|
export declare function configureRuntimeHookBootstrap(deps: RuntimeHookBootstrapDeps): RuntimeHookBootstrapResult;
|
|
@@ -6,30 +6,20 @@
|
|
|
6
6
|
* sticky task domain, host-pinned LLM config, and the ACP session _meta supplement.
|
|
7
7
|
*
|
|
8
8
|
* Extracted from StdioServer so its runtime-state-container concern is one named
|
|
9
|
-
* holder rather than six loose fields on the
|
|
10
|
-
* holder (no invariant beyond field cohesion); the server exposes same-named
|
|
11
|
-
* get/set accessors that delegate here, so every existing reader AND writer —
|
|
12
|
-
* including handlers bound via the RPC host cast (session.create, thread.turn,
|
|
13
|
-
* set_config) — keeps working unchanged.
|
|
9
|
+
* holder rather than six loose fields on the server. It is a plain mutable holder used by the standard ACP adapter.
|
|
14
10
|
*/
|
|
15
11
|
import type { SessionState } from "../runtime/session/session-state.js";
|
|
16
|
-
import type {
|
|
12
|
+
import type { SessionLlmConfig } from "./acp-session-host.js";
|
|
17
13
|
export declare class SessionContext {
|
|
18
|
-
/** Active session id
|
|
14
|
+
/** Active adapter-native ACP session id. */
|
|
19
15
|
sessionId: string;
|
|
20
16
|
/** In-flight turn id. */
|
|
21
17
|
turnId: string;
|
|
22
18
|
/** Session cost/state snapshot (null until a session is resolved). */
|
|
23
19
|
state: SessionState | null;
|
|
24
|
-
/**
|
|
20
|
+
/** Per-session LLM config selected through standard ACP config or the native /model command.
|
|
25
21
|
* NEVER wiped by ModelRegistry churn — distinct from the DERIVED ResolvedAgentCache. */
|
|
26
22
|
llmConfigBySession: Map<string, SessionLlmConfig>;
|
|
27
|
-
/** Gateway-materialized profiles are private to their ACP session. */
|
|
28
|
-
materializedProfiles: Map<string, MaterializedSessionProfile>;
|
|
29
|
-
/** ACP session-level context supplement (_meta from session/new), inherited by every prompt.
|
|
30
|
-
* LEGACY per-connection singleton — kept for old-gateway fallback; multiplexed prompts read
|
|
31
|
-
* acpMetaBySession by sessionId instead. */
|
|
32
|
-
acpMeta: Record<string, unknown> | null;
|
|
33
23
|
/** Per-session gateway _meta(按 sessionId 存,消除跨会话串扰)。 */
|
|
34
24
|
acpMetaBySession: Map<string, Record<string, unknown>>;
|
|
35
25
|
}
|
|
@@ -8,15 +8,7 @@ export declare class CliPathService extends DefaultPathService implements PathSe
|
|
|
8
8
|
constructor(mediaPersistence: MediaPersistence, toolBootstrap: ToolBootstrap);
|
|
9
9
|
getActiveProjectRoot(): string;
|
|
10
10
|
setActiveWorkdir(dir: string): void;
|
|
11
|
-
/**
|
|
12
|
-
* The directory seeded as the file/exec tools' initial CWD: setActiveWorkdir
|
|
13
|
-
* pushes this value into toolBootstrap.setWorkdir → initCwd (the single CWD
|
|
14
|
-
* source read via getCwd()). Note this is the SEED, not the live value — an
|
|
15
|
-
* in-turn `exec("cd sub")` moves getCwd() without touching this. The permission
|
|
16
|
-
* pipeline classifies cross-workspace ops against THIS project-level dir, not
|
|
17
|
-
* getActiveProjectRoot() (also used for memory/sessions, may be a stale
|
|
18
|
-
* projectStore dir). Falls back to getActiveProjectRoot() before first set.
|
|
19
|
-
*/
|
|
11
|
+
/** Project root used to seed file/exec tools and permission classification. */
|
|
20
12
|
getActiveWorkdir(): string;
|
|
21
13
|
resolveProjectDir(projectId?: string): string | undefined;
|
|
22
14
|
}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import type { NotificationMethod, NotificationMethodMap } from "../protocol/notifications.js";
|
|
2
|
-
import type { HostRequestService } from "../host-contract/index.js";
|
|
3
2
|
import { AcpServer, type AcpRequestHandler } from "../transport/acp-server.js";
|
|
4
|
-
import { HostRequestClient } from "../transport/host-request-client.js";
|
|
5
3
|
import type { Transport } from "./transport.js";
|
|
4
|
+
/** Owns one ordinary ACP server connection. */
|
|
6
5
|
export declare class StdioAcpProtocolCoordinator {
|
|
7
6
|
private server;
|
|
8
|
-
private hostRequestClient;
|
|
9
7
|
get active(): boolean;
|
|
10
8
|
init(transport: Transport, handler: AcpRequestHandler, options: {
|
|
11
9
|
verbose: boolean;
|
|
@@ -17,11 +15,6 @@ export declare class StdioAcpProtocolCoordinator {
|
|
|
17
15
|
sessionId: string;
|
|
18
16
|
requestPermission: AcpServer["requestPermission"];
|
|
19
17
|
} | undefined;
|
|
20
|
-
|
|
21
|
-
getHostRequestAccess(): {
|
|
22
|
-
hostRequest: HostRequestClient;
|
|
23
|
-
supportsHostRequestService(service: HostRequestService): boolean;
|
|
24
|
-
} | null;
|
|
25
|
-
dispose(reason?: string): void;
|
|
18
|
+
dispose(_reason?: string): void;
|
|
26
19
|
emitUpdate<M extends NotificationMethod>(sessionId: string, method: M, params: NotificationMethodMap[M]): boolean;
|
|
27
20
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { HostRequestClient } from "../transport/host-request-client.js";
|
|
2
1
|
import type { AcpPermissionRequestParams } from "../protocol/wire/index.js";
|
|
3
2
|
import type { CliAcpRequestHandlerHost } from "./cli-acp-request-handler.js";
|
|
4
3
|
/**
|
|
@@ -8,33 +7,23 @@ import type { CliAcpRequestHandlerHost } from "./cli-acp-request-handler.js";
|
|
|
8
7
|
* (`this: any`), so members it touches must be forwarded here explicitly;
|
|
9
8
|
* see TURN_PIPELINE_HOST_MEMBERS for the regression-tested list.
|
|
10
9
|
*/
|
|
11
|
-
export type StdioAcpRequestHostSource = Pick<CliAcpRequestHandlerHost, "activeTurn" | "turnDone" | "
|
|
10
|
+
export type StdioAcpRequestHostSource = Pick<CliAcpRequestHandlerHost, "activeTurn" | "turnDone" | "acpSessionMetaBySession" | "currentHooks" | "currentSessionId" | "currentTurnId" | "permissionChecker" | "sessionLlmConfigBySession" | "sessionState" | "disposeSessionPermissions" | "disposeSessionMcp" | "runInSessionScope" | "runInExistingSessionScope" | "beginForegroundTurn" | "endForegroundTurn" | "getActiveProjectRoot" | "log" | "sendNotification" | "setActiveWorkdir"> & {
|
|
12
11
|
currentModel: string | undefined;
|
|
13
|
-
|
|
14
|
-
lastUserMessageForAutoExtract: string | undefined;
|
|
12
|
+
loadedDeferredToolNames: Set<string>;
|
|
15
13
|
mcpReady: Promise<void>;
|
|
16
|
-
memdir: unknown;
|
|
17
|
-
pendingAskUser: unknown;
|
|
18
|
-
projectMemoryStoreFactory: unknown;
|
|
19
14
|
toolCatalog: unknown;
|
|
20
|
-
taskDistillation: unknown;
|
|
21
15
|
cancelBackgroundTasksForSession(sessionId?: string, parentTurnId?: string): void;
|
|
22
16
|
beginTurnRequest(): number;
|
|
23
17
|
isTurnRequestCurrent(generation: number): boolean;
|
|
24
18
|
getAcpPermissionSession(): {
|
|
25
19
|
sessionId: string;
|
|
26
|
-
requestPermission(params: AcpPermissionRequestParams): Promise<
|
|
27
|
-
optionId?: string;
|
|
28
|
-
}>;
|
|
20
|
+
requestPermission(params: AcpPermissionRequestParams): Promise<import("../protocol/wire/index.js").AcpPermissionRequestResult>;
|
|
29
21
|
} | undefined;
|
|
30
|
-
getHostRequestClient(): Pick<HostRequestClient, "request"> | undefined;
|
|
31
22
|
drainPendingTaskNotifications(sessionId: string): string[];
|
|
32
23
|
resolveAgent(config: unknown, projectRoot?: string): unknown;
|
|
33
24
|
resolveClientForPurpose(purpose: unknown): unknown;
|
|
34
|
-
scheduleBackgroundMemoryWork(label: string, work: (signal: AbortSignal) => Promise<void>): Promise<boolean>;
|
|
35
|
-
sendResponse(id: string | number, result?: unknown, error?: unknown): void;
|
|
36
25
|
};
|
|
37
26
|
/** Host members the shared turn pipeline reads/writes — keep in sync with
|
|
38
27
|
* `grep -oE "this\.[a-zA-Z]+" src/cli/handlers/turn-handler.ts | sort -u`. */
|
|
39
|
-
export declare const TURN_PIPELINE_HOST_MEMBERS: readonly ["activeTurn", "turnDone", "beginForegroundTurn", "beginTurnRequest", "currentHooks", "currentModel", "currentTurnId", "isTurnRequestCurrent", "drainPendingTaskNotifications", "endForegroundTurn", "getAcpPermissionSession", "
|
|
28
|
+
export declare const TURN_PIPELINE_HOST_MEMBERS: readonly ["activeTurn", "turnDone", "beginForegroundTurn", "beginTurnRequest", "currentHooks", "currentModel", "currentTurnId", "isTurnRequestCurrent", "drainPendingTaskNotifications", "endForegroundTurn", "getAcpPermissionSession", "getActiveProjectRoot", "loadedDeferredToolNames", "log", "mcpReady", "permissionChecker", "resolveAgent", "resolveClientForPurpose", "sendNotification", "sessionState", "setActiveWorkdir", "toolCatalog"];
|
|
40
29
|
export declare function createStdioAcpRequestHandlerHost(host: StdioAcpRequestHostSource): CliAcpRequestHandlerHost;
|