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,40 +0,0 @@
|
|
|
1
|
-
import { type HostRequestRequester } from "../skills/memory/host-memory-provider.js";
|
|
2
|
-
import { type MemoryPrefetchState } from "../runtime/hooks/memory-hooks.js";
|
|
3
|
-
import type { HookRegistry } from "../contracts/hooks.js";
|
|
4
|
-
import type { RuntimeLogger } from "../runtime/hooks/hook-registry.js";
|
|
5
|
-
import type { MemoryDreamRuntimeProvider, MemoryExtractionQueue, MemoryHandlerProvider, MemoryLearningSink, MemoryProvider, MemoryRuntimeHookProvider } from "../runtime/ports/index.js";
|
|
6
|
-
import type { LLMTransport } from "./provider-core-facade.js";
|
|
7
|
-
export interface MemoryProviderState {
|
|
8
|
-
recallProvider: MemoryProvider;
|
|
9
|
-
runtimeHookProvider: MemoryRuntimeHookProvider;
|
|
10
|
-
learningSink: MemoryLearningSink;
|
|
11
|
-
handlerProvider: MemoryHandlerProvider;
|
|
12
|
-
dreamProvider: MemoryDreamRuntimeProvider;
|
|
13
|
-
extractionQueue: MemoryExtractionQueue;
|
|
14
|
-
userId: string;
|
|
15
|
-
}
|
|
16
|
-
/** Host-request access exposed by the ACP protocol coordinator. */
|
|
17
|
-
export interface MemoryHostRequestAccess {
|
|
18
|
-
supportsHostRequestService(service: "memory"): boolean;
|
|
19
|
-
readonly hostRequest: HostRequestRequester;
|
|
20
|
-
}
|
|
21
|
-
/** 装配期绑定(stdio-runtime-services 注入;lazy resolver——gate 在创建时刻现读)。 */
|
|
22
|
-
export declare function bindMemoryHostRequestAccess(resolve: () => MemoryHostRequestAccess | null): void;
|
|
23
|
-
export declare function ensureHostMemoryProvider(currentUserId: string): MemoryProviderState;
|
|
24
|
-
export interface RegisterMemoryRuntimeHooksDeps {
|
|
25
|
-
hooks: HookRegistry;
|
|
26
|
-
currentUserId: string;
|
|
27
|
-
log: RuntimeLogger;
|
|
28
|
-
prefetchState: MemoryPrefetchState;
|
|
29
|
-
getLastUserMessage: () => string | undefined;
|
|
30
|
-
getLastAssistantMessage: () => string | undefined;
|
|
31
|
-
resolveSmallModelClient: () => {
|
|
32
|
-
transport: LLMTransport;
|
|
33
|
-
apiKey: string;
|
|
34
|
-
model: string;
|
|
35
|
-
} | null;
|
|
36
|
-
scheduleBackgroundMemoryWork(label: string, work: (signal: AbortSignal) => Promise<void>): Promise<boolean>;
|
|
37
|
-
/** Part B recall visibility: forwards turn.memory_recall to the client. */
|
|
38
|
-
sendNotification?: (method: string, params: Record<string, unknown>) => void;
|
|
39
|
-
}
|
|
40
|
-
export declare function registerMemoryRuntimeHooks(deps: RegisterMemoryRuntimeHooksDeps): MemoryProviderState;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { AgentRpcError } from "../protocol/wire/index.js";
|
|
2
|
-
import type { HostProviderRequestParams } from "../host-contract/index.js";
|
|
3
|
-
import type { ProductHandlerHost } from "./handlers/product-handler.js";
|
|
4
|
-
import type { SoloHandlerHost } from "./handlers/solo-handler.js";
|
|
5
|
-
export type MultiAgentHandlerHost = SoloHandlerHost & ProductHandlerHost;
|
|
6
|
-
export interface MultiAgentHandlerHostDeps {
|
|
7
|
-
requestProvider(params: HostProviderRequestParams): Promise<unknown>;
|
|
8
|
-
getActiveProjectRoot(): string;
|
|
9
|
-
handleMcpToolCall(memberId: string, toolName: string, args: Record<string, unknown>): Promise<unknown>;
|
|
10
|
-
log(message: string): void;
|
|
11
|
-
sendNotification(method: string, params: Record<string, unknown>): void;
|
|
12
|
-
sendResponse(id: string | number, result?: unknown, error?: AgentRpcError): void;
|
|
13
|
-
/** Lazily resolves the required Gateway delegate rail. */
|
|
14
|
-
getDelegateBridge?: ProductHandlerHost["getDelegateBridge"];
|
|
15
|
-
}
|
|
16
|
-
export declare function createMultiAgentHandlerHost(deps: MultiAgentHandlerHostDeps): MultiAgentHandlerHost;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { ProductOrchestrator } from "../orchestration/agent-instance.js";
|
|
2
|
-
import type { ProductPlanner } from "../orchestration/product-planner.js";
|
|
3
|
-
import type { SoloEvaluator } from "../orchestration/solo-evaluator.js";
|
|
4
|
-
export declare class MultiAgentStateCoordinator {
|
|
5
|
-
soloEvaluator: SoloEvaluator | null;
|
|
6
|
-
productOrchestrator: ProductOrchestrator | null;
|
|
7
|
-
productPlanner: ProductPlanner | null;
|
|
8
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* cli-side wiring of PlannerMemoryContext (orchestration must not import
|
|
3
|
-
* skills/memory directly — same boundary as memory-hooks' procedureTag).
|
|
4
|
-
*
|
|
5
|
-
* globalIndex reads the owner cheat-sheet fresh每次 (reflects mid-run edits);
|
|
6
|
-
* search resolves the provider lazily and returns [] when long-term memory is
|
|
7
|
-
* unavailable — "no provider" is an empty brief, not an error (the brief
|
|
8
|
-
* builder traces real search failures separately).
|
|
9
|
-
*/
|
|
10
|
-
import type { PlannerMemoryContext } from "../orchestration/planner-memory-brief.js";
|
|
11
|
-
export interface OrchestrationMemoryHost {
|
|
12
|
-
memoryProvider?: {
|
|
13
|
-
search(query: string, userId: string, options?: {
|
|
14
|
-
limit?: number;
|
|
15
|
-
excludeTagGroups?: string[][];
|
|
16
|
-
}): Promise<Array<{
|
|
17
|
-
text: string;
|
|
18
|
-
}>>;
|
|
19
|
-
} | null;
|
|
20
|
-
memoryUserId?: string;
|
|
21
|
-
ensureMemoryProvider?(): void;
|
|
22
|
-
}
|
|
23
|
-
export declare function buildOrchestrationMemoryContext(host: OrchestrationMemoryHost): PlannerMemoryContext;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Runtime validation for the `x/product.*` ACP write surface.
|
|
3
|
-
*
|
|
4
|
-
* Every product entry point casts with `params as unknown as XParams`, and the only fields anything
|
|
5
|
-
* actually checked were projectId / canonicalSessionId / cwd (via requireGatewayProjectContext).
|
|
6
|
-
* `instances`, `tasks`, `budget`, `productId` and `taskId` reached the orchestrator unvalidated, so a
|
|
7
|
-
* malformed frame surfaced far downstream — an empty assignee died at dispatch with
|
|
8
|
-
* `No instance found for assignee ""`, a missing prompt produced a task that could only fail, and a
|
|
9
|
-
* non-array `tasks` threw somewhere inside DagScheduler construction.
|
|
10
|
-
*
|
|
11
|
-
* Validate at the boundary and fail with an actionable message naming the offending field.
|
|
12
|
-
*/
|
|
13
|
-
/** `instances[]` — each needs a name (assignees reference it) and an agentId (the provider to spawn). */
|
|
14
|
-
export declare function assertProductInstances(value: unknown, field?: string): void;
|
|
15
|
-
/** `tasks[]` — taskId/assignee/prompt are all load-bearing at dispatch time. */
|
|
16
|
-
export declare function assertProductTasks(value: unknown, field?: string): void;
|
|
17
|
-
/** `budget` is optional, but a present one must carry usable numbers rather than silently doing nothing. */
|
|
18
|
-
export declare function assertProductBudget(value: unknown, field?: string): void;
|
|
19
|
-
export declare function assertProductId(params: Record<string, unknown>): string;
|
|
20
|
-
export declare function assertProductTaskId(params: Record<string, unknown>): string;
|
|
21
|
-
export declare function assertProductDagMutation(params: Record<string, unknown>): void;
|
|
22
|
-
/**
|
|
23
|
-
* `x/product.create` — the orchestrator builds the DAG straight from these.
|
|
24
|
-
*
|
|
25
|
-
* `name` is deliberately NOT required here: existing callers omit it and the orchestrator derives a
|
|
26
|
-
* display name. Only the fields that cause a downstream failure are enforced.
|
|
27
|
-
*/
|
|
28
|
-
export declare function assertProductCreateParams(params: Record<string, unknown>): void;
|
|
29
|
-
/** `x/product.confirm` — the user-edited final payload; same shape requirements as create. */
|
|
30
|
-
export declare function assertProductConfirmParams(params: Record<string, unknown>): void;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ProductOrchestrator } from "../orchestration/agent-instance.js";
|
|
2
|
-
import { ProductPlanner } from "../orchestration/product-planner.js";
|
|
3
|
-
import type { DelegateBridge } from "../orchestration/delegate-bridge.js";
|
|
4
|
-
import type { HostAgentProviderDirectory } from "../runtime/infra/host-agent-provider-directory.js";
|
|
5
|
-
export interface ProductCoordinatorHost {
|
|
6
|
-
providerDirectory: HostAgentProviderDirectory;
|
|
7
|
-
productOrchestrator: ProductOrchestrator | null;
|
|
8
|
-
productPlanner: ProductPlanner | null;
|
|
9
|
-
handleMcpToolCall(memberId: string, tool: string, args: Record<string, unknown>): Promise<unknown>;
|
|
10
|
-
sendNotification(method: string, params: Record<string, unknown>): void;
|
|
11
|
-
/** Lazily resolves the required Gateway delegate rail. */
|
|
12
|
-
getDelegateBridge?(): DelegateBridge | undefined;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* 终态回写 product 容器项目的 planStatus(比照 R1 solo onTerminal),并 re-push 项目使 历史方案
|
|
16
|
-
* 刷新后留存。**仅当项目仍 "running" 时迁移**——避免"完成晚到覆盖取消"或反向覆盖(R1 cancel-clobber
|
|
17
|
-
* 教训)。成功 → "completed";失败 → "failed";取消 → "cancelled"。
|
|
18
|
-
*/
|
|
19
|
-
export declare function writeProductProjectPlanStatus(host: ProductCoordinatorHost, projectId: string, status: "completed" | "failed" | "cancelled"): Promise<void>;
|
|
20
|
-
export declare function ensureProductOrchestrator(host: ProductCoordinatorHost): ProductOrchestrator;
|
|
21
|
-
export declare function ensureProductPlanner(host: ProductCoordinatorHost): ProductPlanner;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { HostRequestParams, HostRequestService } from "../host-contract/index.js";
|
|
2
|
-
import type { ProjectMemoryStoreFactory } from "../runtime/ports/index.js";
|
|
3
|
-
export interface ProjectMemoryHostRequestAccess {
|
|
4
|
-
supportsHostRequestService(service: HostRequestService): boolean;
|
|
5
|
-
readonly hostRequest: {
|
|
6
|
-
request(params: HostRequestParams, opts?: {
|
|
7
|
-
timeoutMs?: number;
|
|
8
|
-
signal?: AbortSignal;
|
|
9
|
-
}): Promise<unknown>;
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
export declare function createCliProjectMemoryStoreFactory(resolveAccess?: () => ProjectMemoryHostRequestAccess | null, resolveSessionId?: () => string | undefined): ProjectMemoryStoreFactory;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import type { AgentRpcRequest } from "../protocol/wire/index.js";
|
|
2
|
-
import { type CommunityHandlerHost } from "./handlers/community-handler.js";
|
|
3
|
-
import { type ConfigHandlerHost } from "./handlers/config-handler.js";
|
|
4
|
-
import { type ControlHandlerHost } from "./handlers/control-handler.js";
|
|
5
|
-
import { type FilesHandlerHost } from "./handlers/files-handler.js";
|
|
6
|
-
import { type MemoryHandlerHost } from "./handlers/memory-handler.js";
|
|
7
|
-
import { type SessionHandlerHost } from "./handlers/session-handler.js";
|
|
8
|
-
import { type SkillCuratorHandlerHost } from "./handlers/skill-curator-handler.js";
|
|
9
|
-
import { type TurnBaselineHandlerHost } from "./handlers/turn-baseline-handler.js";
|
|
10
|
-
import { type TurnControlHandlerHost } from "./handlers/turn-handler.js";
|
|
11
|
-
import { type WorkingMaterialsHandlerHost } from "./handlers/working-materials-handler.js";
|
|
12
|
-
import { type DreamHandlerHost } from "./handlers/dream-handler.js";
|
|
13
|
-
export type RpcMethodHandler = (msg: AgentRpcRequest) => void | Promise<void>;
|
|
14
|
-
/**
|
|
15
|
-
* Per-domain host adapters the RPC registry binds handlers to. Each field is
|
|
16
|
-
* typed to exactly ONE handler's narrow contract, so the host (StdioServer)
|
|
17
|
-
* builds the bundle under COMPILER CHECK: for every domain it passes `this`
|
|
18
|
-
* directly, tsc verifies StdioServer satisfies that interface — if a member a
|
|
19
|
-
* handler needs ever disappears, the build breaks at the bundle literal instead
|
|
20
|
-
* of failing at runtime.
|
|
21
|
-
*
|
|
22
|
-
* A few domains' contracts are deliberately divergent views of shared state
|
|
23
|
-
* (e.g. `memoryProvider` is `MemoryHandlerProvider` for memory but
|
|
24
|
-
* `PetMemoryProviderLike` for pet; `sessionState` differs likewise). Those can't
|
|
25
|
-
* be one structural type, so the host supplies them via a localized cast at the
|
|
26
|
-
* bundle literal — the cast surface is one member-domain, not the whole host.
|
|
27
|
-
*
|
|
28
|
-
* The pattern mirrors the existing createDreamHandlerHost / createMultiAgentHandlerHost
|
|
29
|
-
* adapters, just applied uniformly across every RPC domain.
|
|
30
|
-
*/
|
|
31
|
-
export interface TaskDistillationRpcSurface {
|
|
32
|
-
runPass(reason: "manual", signal?: AbortSignal): Promise<object>;
|
|
33
|
-
listProposals(): Promise<unknown[]>;
|
|
34
|
-
dismissProposal(id: string): Promise<boolean>;
|
|
35
|
-
acknowledgeProposal(id: string): Promise<boolean>;
|
|
36
|
-
getMetrics(): Promise<object>;
|
|
37
|
-
promote(id: string): Promise<object>;
|
|
38
|
-
demote(id: string): Promise<object>;
|
|
39
|
-
}
|
|
40
|
-
export interface RpcHandlerHosts {
|
|
41
|
-
/** R3/V3 蒸馏晋升面(惰性:首调时构造 coordinator)。 */
|
|
42
|
-
getTaskDistillation?: () => TaskDistillationRpcSurface;
|
|
43
|
-
scheduleBackgroundMemoryWork(label: string, work: (signal: AbortSignal) => Promise<void>): Promise<boolean>;
|
|
44
|
-
config: ConfigHandlerHost;
|
|
45
|
-
control: ControlHandlerHost;
|
|
46
|
-
session: SessionHandlerHost;
|
|
47
|
-
memory: MemoryHandlerHost;
|
|
48
|
-
files: FilesHandlerHost;
|
|
49
|
-
skills: SkillCuratorHandlerHost;
|
|
50
|
-
community: CommunityHandlerHost;
|
|
51
|
-
dream: DreamHandlerHost;
|
|
52
|
-
turn: TurnControlHandlerHost;
|
|
53
|
-
turnBaseline: TurnBaselineHandlerHost;
|
|
54
|
-
workingMaterials: WorkingMaterialsHandlerHost;
|
|
55
|
-
}
|
|
56
|
-
export declare function createRpcMethodRegistry(host: RpcHandlerHosts): ReadonlyMap<string, RpcMethodHandler>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { ChatMessage } from "../agent/types.js";
|
|
2
|
-
export declare class SessionHistoryCoordinator {
|
|
3
|
-
private readonly resumedSessionHistories;
|
|
4
|
-
saveResumedSession(sessionId: string, messages: readonly unknown[]): void;
|
|
5
|
-
/** Raw resumed history for a session (prior persisted turns), or [] if none. */
|
|
6
|
-
getResumedHistory(sessionId: string): ChatMessage[];
|
|
7
|
-
withResumedHistory(sessionId: string, messages: ChatMessage[]): ChatMessage[];
|
|
8
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { SessionLocator } from "../runtime/session/session-locator.js";
|
|
2
|
-
import type { SessionListEntry } from "../runtime/session/session-types.js";
|
|
3
|
-
export interface SessionWorkspaceHost {
|
|
4
|
-
getActiveProjectRoot(): string;
|
|
5
|
-
}
|
|
6
|
-
export interface ThreadListItem {
|
|
7
|
-
id: string;
|
|
8
|
-
title?: string;
|
|
9
|
-
status: "active";
|
|
10
|
-
turnCount: number;
|
|
11
|
-
createdAt?: string;
|
|
12
|
-
lastActiveAt?: string;
|
|
13
|
-
}
|
|
14
|
-
export declare class SessionQueryService {
|
|
15
|
-
private readonly locator;
|
|
16
|
-
private readonly pathService;
|
|
17
|
-
constructor(locator?: SessionLocator, pathService?: import("../runtime/ports/path-service.js").PathService);
|
|
18
|
-
getActiveProjectId(): string;
|
|
19
|
-
getDefaultProjectId(): string;
|
|
20
|
-
getProjectWorkspaceDir(projectId: string): string;
|
|
21
|
-
resolveWorkspaceDir(sessionId: string, projectId?: string): string;
|
|
22
|
-
listThreads(limit: number, projectId?: string): Promise<ThreadListItem[]>;
|
|
23
|
-
getHostSessionWorkspaceDirs(host: SessionWorkspaceHost, excludedDirs?: string[]): string[];
|
|
24
|
-
listHostWorkspaceSessions(host: SessionWorkspaceHost, limit: number, excludedDirs?: string[]): Promise<SessionListEntry[]>;
|
|
25
|
-
resolveSessionWorkspaceDir(host: SessionWorkspaceHost, sessionId: string, projectId?: string): string;
|
|
26
|
-
}
|
|
27
|
-
export declare function safeSessionId(sessionId: string): string;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import type { LLMRequest } from "../agent/types.js";
|
|
2
|
-
import type { ModelPurpose } from "../runtime/infra/model-registry.js";
|
|
3
|
-
import type { ProjectMemoryStore, ProjectMemoryStoreFactory } from "../runtime/ports/index.js";
|
|
4
|
-
import type { MultiAgentHandlerHost } from "./multi-agent-handler-host.js";
|
|
5
|
-
import type { RpcHandlerHosts } from "./rpc-registry.js";
|
|
6
|
-
type DirectStdioRpcHost = RpcHandlerHosts["config"] & RpcHandlerHosts["control"] & RpcHandlerHosts["files"] & RpcHandlerHosts["skills"] & RpcHandlerHosts["community"] & {
|
|
7
|
-
currentTurnId?: string;
|
|
8
|
-
/** Mid-turn guidance queue (运行中引导) — shared between handleTurnGuide and the tool loop's drain. */
|
|
9
|
-
pendingTurnGuidance?: string[];
|
|
10
|
-
memdir: ProjectMemoryStore | null;
|
|
11
|
-
projectMemoryStoreFactory: ProjectMemoryStoreFactory;
|
|
12
|
-
setActiveWorkdir(dir: string): void;
|
|
13
|
-
getActiveProjectRoot(): string;
|
|
14
|
-
readonly multiAgentHandlerHost: MultiAgentHandlerHost;
|
|
15
|
-
};
|
|
16
|
-
type StdioRpcAdapterSource = DirectStdioRpcHost & {
|
|
17
|
-
ensureTaskDistillation(): import("./rpc-registry.js").TaskDistillationRpcSurface;
|
|
18
|
-
scheduleBackgroundMemoryWork(label: string, work: (signal: AbortSignal) => Promise<void>): Promise<boolean>;
|
|
19
|
-
activeTurn: RpcHandlerHosts["turn"]["activeTurn"];
|
|
20
|
-
currentSessionId: NonNullable<RpcHandlerHosts["session"]["currentSessionId"]>;
|
|
21
|
-
currentModel: NonNullable<RpcHandlerHosts["session"]["currentModel"]>;
|
|
22
|
-
sessionState: RpcHandlerHosts["session"]["sessionState"];
|
|
23
|
-
memoryPrefetchState: NonNullable<RpcHandlerHosts["session"]["memoryPrefetchState"]>;
|
|
24
|
-
sessionHistory: RpcHandlerHosts["session"]["sessionHistory"];
|
|
25
|
-
currentHooks: RpcHandlerHosts["dream"]["currentHooks"];
|
|
26
|
-
permissionChecker: RpcHandlerHosts["turn"]["permissionChecker"];
|
|
27
|
-
memoryProvider: RpcHandlerHosts["memory"]["memoryProvider"];
|
|
28
|
-
memoryDreamProvider: RpcHandlerHosts["dream"]["memoryProvider"];
|
|
29
|
-
memoryUserId: NonNullable<RpcHandlerHosts["memory"]["memoryUserId"]>;
|
|
30
|
-
pendingAskUser: RpcHandlerHosts["turn"]["pendingAskUser"];
|
|
31
|
-
verbose: NonNullable<RpcHandlerHosts["dream"]["verbose"]>;
|
|
32
|
-
resolveClientForPurpose(purpose: ModelPurpose): {
|
|
33
|
-
transport: {
|
|
34
|
-
stream(request: LLMRequest, apiKey: string): AsyncIterable<{
|
|
35
|
-
type: string;
|
|
36
|
-
text?: string;
|
|
37
|
-
}>;
|
|
38
|
-
};
|
|
39
|
-
apiKey: string;
|
|
40
|
-
model: string;
|
|
41
|
-
} | null;
|
|
42
|
-
ensureMemoryProvider: NonNullable<RpcHandlerHosts["memory"]["ensureMemoryProvider"]>;
|
|
43
|
-
enableIdleDream: NonNullable<RpcHandlerHosts["session"]["enableIdleDream"]>;
|
|
44
|
-
sendError: NonNullable<RpcHandlerHosts["session"]["sendError"]>;
|
|
45
|
-
createDreamHandlerHost(): RpcHandlerHosts["dream"];
|
|
46
|
-
};
|
|
47
|
-
export declare function createTurnHost(host: StdioRpcAdapterSource): RpcHandlerHosts["turn"];
|
|
48
|
-
/**
|
|
49
|
-
* Build the per-domain handler-host bundle the RPC registry binds to.
|
|
50
|
-
*
|
|
51
|
-
* Domains whose contracts StdioServer satisfies directly stay compiler-checked
|
|
52
|
-
* through DirectStdioRpcHost. Stateful domains receive explicit adapters so
|
|
53
|
-
* handler contracts stay narrow without domain-level casts.
|
|
54
|
-
*/
|
|
55
|
-
export declare function createStdioRpcHandlerHosts<Host extends StdioRpcAdapterSource>(host: Host): RpcHandlerHosts;
|
|
56
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { type MemoryPrefetchState } from "../runtime/hooks/memory-hooks.js";
|
|
2
|
-
import type { MemoryDreamRuntimeProvider, MemoryHandlerProvider } from "../runtime/ports/index.js";
|
|
3
|
-
import type { AgentRuntimeSessionState } from "./agent-runtime-session-state.js";
|
|
4
|
-
import type { StdioRuntimeServices } from "./stdio-runtime-services.js";
|
|
5
|
-
export interface StdioSessionRuntimeCoordinatorDeps {
|
|
6
|
-
runtimeSession: AgentRuntimeSessionState;
|
|
7
|
-
runtimeServices: Pick<StdioRuntimeServices, "closeMemoryProviders">;
|
|
8
|
-
getMemoryProvider(): MemoryHandlerProvider | null;
|
|
9
|
-
getMemoryDreamProvider(): MemoryDreamRuntimeProvider | null;
|
|
10
|
-
setMemoryPrefetchState(state: MemoryPrefetchState): void;
|
|
11
|
-
}
|
|
12
|
-
export declare class StdioSessionRuntimeCoordinator {
|
|
13
|
-
private readonly deps;
|
|
14
|
-
constructor(deps: StdioSessionRuntimeCoordinatorDeps);
|
|
15
|
-
dispose(): void;
|
|
16
|
-
closeMemoryProviders(): void;
|
|
17
|
-
}
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Task distillation coordinator (R3 wiring) — 候选采集/空闲窗蒸馏/晋升通知。
|
|
3
|
-
* 纯逻辑在 skills/memory/task-distillation.ts;本模块只做依赖装配与生命周期:
|
|
4
|
-
* · captureTurn: 回合完成屏障内只持久化候选;embedding 留给可抢占后台
|
|
5
|
-
* · enrichCandidate: 后台补充 embedding;被前台抢占也不影响已持久化候选
|
|
6
|
-
* · runPass: idle 空闲窗(stdio-server onIdle 并联)与 memory.distill RPC 共用入口
|
|
7
|
-
* · 蒸馏产物: category=procedure 进长期记忆(tag distilled@v1+sig),召回自然带出;
|
|
8
|
-
* LLM 摘要(dream 同款小模型)失败时降级确定性模板 —— 蒸馏永不因模型不可用而丢样本。
|
|
9
|
-
* · 晋升(spec:唯一技能入口):复用量只用于发现候选;Host 的来源证据与跨会话前台结果验证是硬门槛。
|
|
10
|
-
*/
|
|
11
|
-
import { type PromotionMetrics, type CandidateStoreFile, type PromotionProposal, type ProcedureUsageStoreFile, type PromotionStoreFile } from "../skills/memory/task-distillation.js";
|
|
12
|
-
import type { HostCapabilityClient } from "../transport/host-capability-client.js";
|
|
13
|
-
import type { ProcedureVerificationEvidence } from "../host-contract/index.js";
|
|
14
|
-
/** [A4] addProcedure 落库回执分类(见 TaskDistillationDeps.addProcedure)。 */
|
|
15
|
-
export type AddProcedureOutcome = "created" | "merged" | "rejected" | "retryable-failure";
|
|
16
|
-
export interface TaskDistillationDeps {
|
|
17
|
-
/** Gateway-owned skill authority. Missing service is fatal; local skill-store fallback is forbidden. */
|
|
18
|
-
hostCapabilityClient: () => HostCapabilityClient | undefined;
|
|
19
|
-
/** 签名 embedding;null=不可用(候选照存但不参与聚类,宁严勿松)。
|
|
20
|
-
* B3(X7):number[](非 Float32Array)——host 模式下 embedText 结果跨 x/host.request JSON wire。 */
|
|
21
|
-
embed: (text: string, signal?: AbortSignal) => Promise<number[] | null>;
|
|
22
|
-
/** [A4] 落库回执四分类(由 ingestExtracted 的结构化 items 归并):
|
|
23
|
-
* created = 真实新落库 → 标 distilled + 发通知(只有它发);
|
|
24
|
-
* merged = 近重复合并/已入提案管道 —— 合法成功,标 distilled 不通知;
|
|
25
|
-
* rejected = 安全闸拒/冲突 —— 终态,候选标 rejected 不再重试;
|
|
26
|
-
* retryable-failure = RPC 抛错/环境未就绪 —— 候选保持 pending 等下轮。 */
|
|
27
|
-
addProcedure: (text: string, tags: string[], evidence: {
|
|
28
|
-
candidateIds: string[];
|
|
29
|
-
idempotencyKey: string;
|
|
30
|
-
}) => Promise<AddProcedureOutcome>;
|
|
31
|
-
/** 小模型摘要(dream 同款);null/失败 → 降级模板 */
|
|
32
|
-
llmExtract?: (prompt: string, signal?: AbortSignal) => Promise<string | null>;
|
|
33
|
-
/** 晋升扫描数据源:全部 distilled 条目 {id,text,accessCount,importance} */
|
|
34
|
-
listDistilled: () => Promise<Array<{
|
|
35
|
-
id: string;
|
|
36
|
-
text: string;
|
|
37
|
-
accessCount: number;
|
|
38
|
-
importance: number;
|
|
39
|
-
verification: ProcedureVerificationEvidence;
|
|
40
|
-
}>>;
|
|
41
|
-
/** Exact archived-aware recovery probe; unlike listDistilled this does not hide retired rows. */
|
|
42
|
-
readDistilledProcedure: (procedureId: string) => Promise<{
|
|
43
|
-
id: string;
|
|
44
|
-
text: string;
|
|
45
|
-
accessCount: number;
|
|
46
|
-
importance: number;
|
|
47
|
-
isArchived: boolean;
|
|
48
|
-
verification: ProcedureVerificationEvidence;
|
|
49
|
-
} | null>;
|
|
50
|
-
/** [A10] 升格窄 Saga(Host 协调,memory proxy promoteDistilledProcedure):
|
|
51
|
-
* create+verify → archive → proposal accepted,幂等/补偿/续跑在 Host;
|
|
52
|
-
* 大脑传入推理产物(渲染并校验过的 SKILL.md 全文、确定性 skillName、标题/计数/auto)。 */
|
|
53
|
-
promoteProcedure: (input: {
|
|
54
|
-
procedureId: string;
|
|
55
|
-
skillName: string;
|
|
56
|
-
content: string;
|
|
57
|
-
title: string;
|
|
58
|
-
accessCount: number;
|
|
59
|
-
auto: boolean;
|
|
60
|
-
}) => Promise<{
|
|
61
|
-
outcome: "completed" | "already-completed";
|
|
62
|
-
skillName: string;
|
|
63
|
-
steps: {
|
|
64
|
-
skillCreated: boolean;
|
|
65
|
-
memoryArchived: boolean;
|
|
66
|
-
proposalAccepted: boolean;
|
|
67
|
-
};
|
|
68
|
-
}>;
|
|
69
|
-
demoteProcedure: (input: {
|
|
70
|
-
procedureId: string;
|
|
71
|
-
}) => Promise<{
|
|
72
|
-
outcome: "completed" | "already-completed";
|
|
73
|
-
skillName: string;
|
|
74
|
-
steps: {
|
|
75
|
-
skillDeleted: boolean;
|
|
76
|
-
memoryUnarchived: boolean;
|
|
77
|
-
proposalReverted: boolean;
|
|
78
|
-
};
|
|
79
|
-
}>;
|
|
80
|
-
/** [X7] procedure-usage.json 读:store-owner 归 gateway,经 x/host proxy(自动档跨-session 数据源)。 */
|
|
81
|
-
readProcedureUsage: () => Promise<ProcedureUsageStoreFile>;
|
|
82
|
-
/** [X7] task-distill-candidates.json 读/写:store-owner 归 gateway;大脑侧裁剪(capCandidateStore)后经 proxy 写。 */
|
|
83
|
-
readCandidates: () => Promise<CandidateStoreFile>;
|
|
84
|
-
writeCandidates: (store: CandidateStoreFile) => Promise<void>;
|
|
85
|
-
/** [X7] promotion-proposals.json 读/写:晋升生命周期大脑逻辑留 qla,store-owner 归 gateway
|
|
86
|
-
* (gateway ActionSurface 也读同一文件;写者唯一=gateway 经此 proxy)。 */
|
|
87
|
-
readProposals: () => Promise<PromotionStoreFile>;
|
|
88
|
-
writeProposals: (store: PromotionStoreFile) => Promise<void>;
|
|
89
|
-
sendNotification: (method: string, params: Record<string, unknown>) => void;
|
|
90
|
-
log: (message: string) => void;
|
|
91
|
-
}
|
|
92
|
-
export interface RecordTurnInput {
|
|
93
|
-
sessionId: string;
|
|
94
|
-
promptHead: string;
|
|
95
|
-
toolSequence: string[];
|
|
96
|
-
durationMs: number;
|
|
97
|
-
ok: boolean;
|
|
98
|
-
}
|
|
99
|
-
export interface DistillPassResult {
|
|
100
|
-
distilled: number;
|
|
101
|
-
promotionsNotified: number;
|
|
102
|
-
pendingCandidates: number;
|
|
103
|
-
}
|
|
104
|
-
export declare function resolveCandidateEmbedding(embed: (text: string, signal?: AbortSignal) => Promise<number[] | null>, text: string, timeoutMs?: number, signal?: AbortSignal): Promise<number[] | null>;
|
|
105
|
-
export declare class TaskDistillationCoordinator {
|
|
106
|
-
private readonly deps;
|
|
107
|
-
private readonly turnIndexBySession;
|
|
108
|
-
private candidateMutationTail;
|
|
109
|
-
constructor(deps: TaskDistillationDeps);
|
|
110
|
-
private requireCapability;
|
|
111
|
-
private withCandidateMutation;
|
|
112
|
-
/** 回合完成屏障内的轻量持久化。Host 写成功后进程回收也不会丢候选。 */
|
|
113
|
-
captureTurn(input: RecordTurnInput): Promise<string | null>;
|
|
114
|
-
/** Cancellable embedding enhancement for a candidate already owned by Host. */
|
|
115
|
-
enrichCandidate(candidateId: string, promptHead: string, signal?: AbortSignal): Promise<void>;
|
|
116
|
-
/** 空闲窗/手动共用的蒸馏 pass。 */
|
|
117
|
-
runPass(reason: "idle" | "manual", signal?: AbortSignal): Promise<DistillPassResult>;
|
|
118
|
-
private renderProcedure;
|
|
119
|
-
/** 晋升扫描(spec:技能的唯一产生入口):候选先过发现阈值,再以 Host 能力验证作为硬门槛。
|
|
120
|
-
* V3.1:提议是持久待办(promotion-proposals.json),UI 双入口消费;activity 仅作日志。 */
|
|
121
|
-
private scanPromotions;
|
|
122
|
-
listProposals(): Promise<PromotionProposal[]>;
|
|
123
|
-
/** V3.2 仪表(接受率/降格率/自动档解锁态);技能激活计数由 skill-lifecycle useCount 承载。 */
|
|
124
|
-
getMetrics(): Promise<PromotionMetrics>;
|
|
125
|
-
/** 自动升格开场确认卡「知道了」。 */
|
|
126
|
-
acknowledgeProposal(procedureId: string): Promise<boolean>;
|
|
127
|
-
dismissProposal(procedureId: string): Promise<boolean>;
|
|
128
|
-
/** 升格:大脑只做推理半程(找配方→渲染 SKILL.md→写盘前校验→确定性命名),
|
|
129
|
-
* [A10] 三步执行(create+verify→archive→proposal accepted)收归 Host 窄 Saga ——
|
|
130
|
-
* 它横跨 Capability/Memory 两个 Host 存储,幂等(procedureId+确定性 skillName)、
|
|
131
|
-
* 逐步补偿、崩溃续跑都在 Host;旧实现 create 之后的两步无 catch 无补偿,
|
|
132
|
-
* 该窗口失败即双向死角(重跑撞 already exists,demote 缺 skillName 找不到目标)。 */
|
|
133
|
-
promote(procedureId: string, opts?: {
|
|
134
|
-
auto?: boolean;
|
|
135
|
-
}, signal?: AbortSignal): Promise<{
|
|
136
|
-
ok: boolean;
|
|
137
|
-
skillName?: string;
|
|
138
|
-
error?: string;
|
|
139
|
-
}>;
|
|
140
|
-
/** 降格的跨存储事务、补偿与崩溃续跑全部由 Host saga 持有。 */
|
|
141
|
-
demote(procedureId: string): Promise<{
|
|
142
|
-
ok: boolean;
|
|
143
|
-
error?: string;
|
|
144
|
-
}>;
|
|
145
|
-
private renderSkillMarkdown;
|
|
146
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { AskUserQuestion } from "../skills/tools/ask-user-tool.js";
|
|
2
|
-
interface PendingAskUserRequest {
|
|
3
|
-
resolve(answers: Record<string, string> | null): void;
|
|
4
|
-
}
|
|
5
|
-
export interface TurnAskUserSetupHost {
|
|
6
|
-
pendingAskUser: Map<string, PendingAskUserRequest>;
|
|
7
|
-
sendNotification(method: string, params: Record<string, unknown>): void;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Build the ask_user backend closure: mint a requestId, park its resolver in
|
|
11
|
-
* `host.pendingAskUser`, and emit `turn.ask_user`. The answer is delivered later via
|
|
12
|
-
* `thread.user_response` (handleUserResponse), which resolves the same map entry by requestId.
|
|
13
|
-
*
|
|
14
|
-
* Shared by the turn pipeline (configureTurnAskUser) and the Solo Spec phase
|
|
15
|
-
* (handleAcpSoloSpecChat) so both drive the SAME UI channel. requestId isolation (full UUID) lets a
|
|
16
|
-
* concurrent chat-turn ask and a spec-phase ask coexist in the one shared map without collision.
|
|
17
|
-
*
|
|
18
|
-
* The optional `signal` makes an unanswered ask abortable + self-cleaning: on abort we drop the
|
|
19
|
-
* parked resolver from the map and resolve to null (caller degrades to a best-effort result), so a
|
|
20
|
-
* cancelled/abandoned turn can't leak a map entry or hang the awaiting fork forever.
|
|
21
|
-
*/
|
|
22
|
-
export declare function makeAskUserBackend(host: TurnAskUserSetupHost): (questions: AskUserQuestion[], signal?: AbortSignal) => Promise<Record<string, string> | null>;
|
|
23
|
-
export declare function configureTurnAskUser(host: TurnAskUserSetupHost): void;
|
|
24
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { ChatMessage } from "../agent/types.js";
|
|
2
|
-
import type { NotificationMethodMap } from "../protocol/notifications.js";
|
|
3
|
-
import type { LLMTransport } from "./provider-core-facade.js";
|
|
4
|
-
export interface TurnSuggestionClient {
|
|
5
|
-
transport: LLMTransport;
|
|
6
|
-
apiKey: string;
|
|
7
|
-
model: string;
|
|
8
|
-
}
|
|
9
|
-
export interface TurnSuggestionGeneratorDeps {
|
|
10
|
-
turnId: string;
|
|
11
|
-
messages: ChatMessage[];
|
|
12
|
-
client: TurnSuggestionClient | null;
|
|
13
|
-
sendNotification<M extends keyof NotificationMethodMap>(method: M, params: NotificationMethodMap[M]): void;
|
|
14
|
-
}
|
|
15
|
-
export declare function generateTurnSuggestions({ turnId, messages, client, sendNotification, }: TurnSuggestionGeneratorDeps): Promise<void>;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
export interface RecallClaimPacket {
|
|
2
|
-
version: 1;
|
|
3
|
-
memoryId: string;
|
|
4
|
-
category: string;
|
|
5
|
-
fact: string;
|
|
6
|
-
claim: {
|
|
7
|
-
scope: string;
|
|
8
|
-
scopeKey: string;
|
|
9
|
-
entity: string;
|
|
10
|
-
predicate: string;
|
|
11
|
-
relation: string;
|
|
12
|
-
value: Record<string, unknown>;
|
|
13
|
-
status: string;
|
|
14
|
-
validFrom: string;
|
|
15
|
-
validTo: string;
|
|
16
|
-
};
|
|
17
|
-
evidence: {
|
|
18
|
-
refs: string[];
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
export interface L2RecallPacketEnvelope {
|
|
22
|
-
id?: unknown;
|
|
23
|
-
source?: unknown;
|
|
24
|
-
metadata?: Record<string, unknown>;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Agent-side verification of the Host recall envelope. This mirrors the
|
|
28
|
-
* Host's canonical claim serialization so altered ids, facts, or packet
|
|
29
|
-
* shapes fail closed before any prompt or accounting path consumes them.
|
|
30
|
-
*/
|
|
31
|
-
export declare function readCanonicalL2RecallPacket(memory: L2RecallPacketEnvelope): RecallClaimPacket | null;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export declare const MEMORY_RESPONSE_CONTRACT_LINES: readonly ["Answer only the requested slots with the shortest complete answer, then stop. Helpful elaboration is lower priority than this contract.", "For a scalar or short rule, start directly with the answer and use one sentence. Do not add a preamble.", "For ordered steps, output only a terse ordered list. Do not explain each step or repeat that the order is fixed.", "If no memory fact answers a requested slot, say only that it is unknown in one short sentence. Do not list nearby known facts, ask follow-up questions, or offer to store information.", "Do not contrast alternate entities, scenes, historical values, calculations, nearby context, repeated summaries, or unsolicited next steps unless the user explicitly asks for them."];
|
|
2
|
-
export declare function renderMemoryResponseContract(heading: string): string;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* FTS pre-segmentation for CJK-aware keyword search.
|
|
3
|
-
*
|
|
4
|
-
* SQLite FTS5's unicode61 tokenizer does not segment CJK: a run of Chinese
|
|
5
|
-
* characters indexes as ONE token, so a query like 咖啡 can never match a
|
|
6
|
-
* memory containing 用户喜欢喝美式咖啡. Instead of switching tokenizers
|
|
7
|
-
* (trigram misses 2-char Chinese words, ICU is not bundled), we index a
|
|
8
|
-
* pre-segmented shadow column (`memories.text_seg`) and segment queries with
|
|
9
|
-
* the SAME function:
|
|
10
|
-
* - Latin/digit runs stay whole words ("docker", "v2")
|
|
11
|
-
* - CJK runs become character bigrams (咖啡, 啡因) + the single char for
|
|
12
|
-
* 1-char runs — the same scheme the near-duplicate gate already uses.
|
|
13
|
-
*
|
|
14
|
-
* Index side and query side MUST share this function; drift between them
|
|
15
|
-
* silently zeroes recall.
|
|
16
|
-
*/
|
|
17
|
-
/** Segment text into FTS-friendly tokens (lowercased). */
|
|
18
|
-
export declare function segmentForFts(text: string): string[];
|
|
19
|
-
/** Render the segmented shadow text stored in memories.text_seg. */
|
|
20
|
-
export declare function segmentTextForFts(text: string): string;
|