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,17 +0,0 @@
|
|
|
1
|
-
import { type HostAgentProviderDiagnostic, type HostAgentProviderGetResult, type HostAgentProviderListResult, type HostProviderRequestParams } from "../../host-contract/index.js";
|
|
2
|
-
export type HostProviderDirectoryErrorCode = "HOST_PROVIDER_DIRECTORY_UNAVAILABLE" | "HOST_PROVIDER_DIRECTORY_INVALID_RESPONSE";
|
|
3
|
-
export declare class HostProviderDirectoryError extends Error {
|
|
4
|
-
readonly code: HostProviderDirectoryErrorCode;
|
|
5
|
-
constructor(code: HostProviderDirectoryErrorCode, message: string, options?: ErrorOptions);
|
|
6
|
-
}
|
|
7
|
-
export interface HostProviderDirectoryRequester {
|
|
8
|
-
request(params: HostProviderRequestParams): Promise<unknown>;
|
|
9
|
-
}
|
|
10
|
-
export declare class HostAgentProviderDirectory {
|
|
11
|
-
private readonly requester;
|
|
12
|
-
constructor(requester: HostProviderDirectoryRequester);
|
|
13
|
-
list(): Promise<Readonly<HostAgentProviderListResult>>;
|
|
14
|
-
get(providerId: string): Promise<Readonly<HostAgentProviderGetResult>>;
|
|
15
|
-
diagnose(providerId: string): Promise<Readonly<HostAgentProviderDiagnostic>>;
|
|
16
|
-
private read;
|
|
17
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/** Project mutations are requests to the Gateway-owned X7 authority. */
|
|
2
|
-
import type { ProjectInfo, ProjectType } from "../../protocol/methods.js";
|
|
3
|
-
export declare function createProjectAuthoritative(params: {
|
|
4
|
-
name: string;
|
|
5
|
-
workspaceDir?: string;
|
|
6
|
-
type?: ProjectType;
|
|
7
|
-
groupId?: string;
|
|
8
|
-
skipAutoSwitch?: boolean;
|
|
9
|
-
}): Promise<ProjectInfo>;
|
|
10
|
-
export declare function updateProjectAuthoritative(projectId: string, patch: Partial<Pick<ProjectInfo, "planStatus" | "planAgents" | "planWinnerId" | "leaderSessionId" | "primaryWorkflowId">>): Promise<ProjectInfo | null>;
|
|
11
|
-
export declare function switchProjectAuthoritative(projectIdOrQuery: string): Promise<ProjectInfo | null>;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Project Data Paths — centralized location for our per-project COMPANION data (the "account
|
|
3
|
-
* book"): session transcripts/metadata, checkpoint shadow repos, uploaded attachments, deletion
|
|
4
|
-
* tombstones. Mirrors VS Code's workspaceStorage: this data is OURS and lives in a centralized,
|
|
5
|
-
* per-project-id, physically-isolated dir at the DEVICE level — NEVER inside the user's
|
|
6
|
-
* workspace folder. The workspace folder holds only user work product (code/docs/generated media).
|
|
7
|
-
* 设备级(用户裁定,对齐 codex/VS Code):会话数据跟随机器;登录身份只属于云同步/计费层。
|
|
8
|
-
*
|
|
9
|
-
* ~/.qlogicagent/projectData/<projectId>/{sessions,checkpoints,uploads}/
|
|
10
|
-
*
|
|
11
|
-
* projectId is the PATH-DERIVED key (deriveProjectId(workspaceDir), see agent-paths) — the
|
|
12
|
-
* mainstream model (VS Code / cc-haha): same folder → same id, deterministic, recomputable, no
|
|
13
|
-
* central-registry dependency for the storage key. Only the Gateway archive-only internal-data
|
|
14
|
-
* transaction may remove projectData/<id>; qlogicagent has no lifecycle deletion authority.
|
|
15
|
-
*/
|
|
16
|
-
export { getProjectDataDirById, getProjectDataRoot } from "./agent-paths.js";
|
|
17
|
-
/** `~/.qlogicagent/projectData/<projectId>/` for a projectId or workspaceDir. */
|
|
18
|
-
export declare function getProjectDataDir(projectIdOrWorkspaceDir: string): string;
|
|
19
|
-
/** `projectData/<id>/sessions/` */
|
|
20
|
-
export declare function getProjectDataSessionsRoot(projectIdOrWorkspaceDir: string): string;
|
|
21
|
-
/** `projectData/<id>/checkpoints/` or `.../checkpoints/<sessionId>` */
|
|
22
|
-
export declare function getProjectDataCheckpointsDir(projectIdOrWorkspaceDir: string, sessionId?: string): string;
|
|
23
|
-
/** `projectData/<id>/uploads/` or `.../uploads/<sessionId>` */
|
|
24
|
-
export declare function getProjectDataUploadsDir(projectIdOrWorkspaceDir: string, sessionId?: string): string;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/** In-memory ExtHost-style project proxy. Durable registry bytes remain gateway-owned. */
|
|
2
|
-
import type { HostProjectInfo, HostProjectSnapshotResult } from "../../host-contract/index.js";
|
|
3
|
-
import type { HostProjectClient } from "../../transport/host-project-client.js";
|
|
4
|
-
export declare function configureHostProjectAuthority(resolver: () => HostProjectClient | undefined): void;
|
|
5
|
-
export declare function hydrateHostProjectSnapshot(): Promise<void>;
|
|
6
|
-
export declare function readHostProjectSnapshot(): HostProjectSnapshotResult;
|
|
7
|
-
/** Test-only snapshot injection; production must hydrate through HostProjectClient. */
|
|
8
|
-
export declare function setHostProjectSnapshotForTests(next: HostProjectSnapshotResult): void;
|
|
9
|
-
export declare function createHostProject(params: Parameters<HostProjectClient["create"]>[0]): Promise<HostProjectInfo>;
|
|
10
|
-
export declare function switchHostProject(projectIdOrQuery: string): Promise<HostProjectInfo>;
|
|
11
|
-
export declare function updateHostProject(projectId: string, patch: Parameters<HostProjectClient["update"]>[1]): Promise<HostProjectInfo>;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ProjectInstructionsStore — CRUD for project-scoped rule/instruction files.
|
|
3
|
-
*
|
|
4
|
-
* Storage location: `<workspace>/.qlogicagent/rules/*.md`
|
|
5
|
-
* Unified directory for all project instructions and rules.
|
|
6
|
-
*/
|
|
7
|
-
export interface InstructionFile {
|
|
8
|
-
filename: string;
|
|
9
|
-
content: string;
|
|
10
|
-
sizeBytes: number;
|
|
11
|
-
}
|
|
12
|
-
export declare class ProjectInstructionsStore {
|
|
13
|
-
private dir;
|
|
14
|
-
constructor(cwd: string);
|
|
15
|
-
/** List all instruction files for the project. */
|
|
16
|
-
list(): InstructionFile[];
|
|
17
|
-
/** Read a single instruction file. */
|
|
18
|
-
read(filename: string): InstructionFile | null;
|
|
19
|
-
/** Write (create or update) an instruction file. */
|
|
20
|
-
write(filename: string, content: string): InstructionFile;
|
|
21
|
-
/** Delete an instruction file. */
|
|
22
|
-
remove(filename: string): boolean;
|
|
23
|
-
/**
|
|
24
|
-
* Load all instruction files and concatenate into a single block
|
|
25
|
-
* for agent system context injection.
|
|
26
|
-
*/
|
|
27
|
-
loadAll(): string;
|
|
28
|
-
private isValidFilename;
|
|
29
|
-
private getDirSize;
|
|
30
|
-
}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
export type TurnBaselineState = "running" | "completed" | "failed" | "cancelled";
|
|
2
|
-
export type FileChangeStatus = "added" | "modified" | "deleted" | "renamed" | "moved" | "copied" | "unchanged";
|
|
3
|
-
export type SnapshotKind = "missing" | "text" | "binary" | "directory" | "too-large";
|
|
4
|
-
export interface FileSnapshot {
|
|
5
|
-
exists: boolean;
|
|
6
|
-
kind: SnapshotKind;
|
|
7
|
-
sizeBytes?: number;
|
|
8
|
-
sha256?: string;
|
|
9
|
-
inlineContent?: string;
|
|
10
|
-
contentRef?: string;
|
|
11
|
-
}
|
|
12
|
-
export interface TurnFileChange {
|
|
13
|
-
path: string;
|
|
14
|
-
previousPath?: string;
|
|
15
|
-
status: FileChangeStatus;
|
|
16
|
-
additions?: number;
|
|
17
|
-
deletions?: number;
|
|
18
|
-
before?: FileSnapshot;
|
|
19
|
-
after?: FileSnapshot;
|
|
20
|
-
}
|
|
21
|
-
export interface TurnChangeSummary {
|
|
22
|
-
turnId: string;
|
|
23
|
-
sessionId: string;
|
|
24
|
-
projectId: string;
|
|
25
|
-
state: TurnBaselineState;
|
|
26
|
-
startedAt: string;
|
|
27
|
-
completedAt?: string;
|
|
28
|
-
filesChanged: number;
|
|
29
|
-
files: TurnFileChange[];
|
|
30
|
-
truncated?: boolean;
|
|
31
|
-
}
|
|
32
|
-
export declare function resolveProjectRelativePath(projectRoot: string, input: string): string | null;
|
|
33
|
-
export declare function startTurnBaseline(input: {
|
|
34
|
-
turnId: string;
|
|
35
|
-
sessionId: string;
|
|
36
|
-
projectId?: string;
|
|
37
|
-
workspaceDir?: string;
|
|
38
|
-
seedPaths?: unknown;
|
|
39
|
-
}): Promise<void>;
|
|
40
|
-
export declare function captureFileBefore(input: {
|
|
41
|
-
turnId?: string;
|
|
42
|
-
projectId?: string;
|
|
43
|
-
workspaceDir?: string;
|
|
44
|
-
path: string;
|
|
45
|
-
entryPath?: string;
|
|
46
|
-
previousPath?: string;
|
|
47
|
-
}): Promise<void>;
|
|
48
|
-
export declare function captureFileAfter(input: {
|
|
49
|
-
turnId?: string;
|
|
50
|
-
projectId?: string;
|
|
51
|
-
workspaceDir?: string;
|
|
52
|
-
path: string;
|
|
53
|
-
entryPath?: string;
|
|
54
|
-
previousPath?: string;
|
|
55
|
-
status?: FileChangeStatus;
|
|
56
|
-
}): Promise<void>;
|
|
57
|
-
export declare function captureAbsoluteBefore(input: {
|
|
58
|
-
turnId?: string;
|
|
59
|
-
workspaceDir: string;
|
|
60
|
-
absolutePath: string;
|
|
61
|
-
}): Promise<void>;
|
|
62
|
-
export declare function captureAbsoluteAfter(input: {
|
|
63
|
-
turnId?: string;
|
|
64
|
-
workspaceDir: string;
|
|
65
|
-
absolutePath: string;
|
|
66
|
-
status?: FileChangeStatus;
|
|
67
|
-
}): Promise<void>;
|
|
68
|
-
export declare function finalizeTurnBaseline(input: {
|
|
69
|
-
turnId: string;
|
|
70
|
-
state: TurnBaselineState;
|
|
71
|
-
}): Promise<TurnChangeSummary | null>;
|
|
72
|
-
export declare function getTurnBaselineSummary(projectId: string, turnId: string): Promise<TurnChangeSummary | null>;
|
|
73
|
-
export declare function listRecentTurnBaselines(input: {
|
|
74
|
-
projectId: string;
|
|
75
|
-
sessionId?: string;
|
|
76
|
-
limit?: number;
|
|
77
|
-
}): Promise<{
|
|
78
|
-
summaries: TurnChangeSummary[];
|
|
79
|
-
}>;
|
|
80
|
-
export declare function getTurnBaselineFileBaseline(input: {
|
|
81
|
-
projectId: string;
|
|
82
|
-
turnId: string;
|
|
83
|
-
path: string;
|
|
84
|
-
}): Promise<{
|
|
85
|
-
path: string;
|
|
86
|
-
content: string | null;
|
|
87
|
-
snapshot: FileSnapshot | null;
|
|
88
|
-
}>;
|
|
89
|
-
export declare function getTurnBaselineFileDiff(input: {
|
|
90
|
-
projectId: string;
|
|
91
|
-
turnId: string;
|
|
92
|
-
path: string;
|
|
93
|
-
}): Promise<{
|
|
94
|
-
path: string;
|
|
95
|
-
previousPath?: string;
|
|
96
|
-
status: FileChangeStatus;
|
|
97
|
-
original: string;
|
|
98
|
-
modified: string;
|
|
99
|
-
language?: string;
|
|
100
|
-
additions?: number;
|
|
101
|
-
deletions?: number;
|
|
102
|
-
}>;
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import type { HostDelegationTelemetrySummary } from "../../host-contract/index.js";
|
|
2
|
-
import type { FinalAnswerEvidence, ToolCallExecutionEvidence } from "../../protocol/wire/notification-payloads.js";
|
|
3
|
-
export type AgentMode = "chat" | "solo" | "product" | "workflow" | "unknown";
|
|
4
|
-
export interface TurnTelemetryUsage {
|
|
5
|
-
inputTokens?: number;
|
|
6
|
-
outputTokens?: number;
|
|
7
|
-
totalTokens?: number;
|
|
8
|
-
}
|
|
9
|
-
export interface TurnTelemetryToolSummary {
|
|
10
|
-
calledTools: string[];
|
|
11
|
-
failedTools: string[];
|
|
12
|
-
blockedTools: string[];
|
|
13
|
-
}
|
|
14
|
-
export interface TurnTelemetryFileContext {
|
|
15
|
-
changedFileCount?: number;
|
|
16
|
-
changedPathsPreview?: string[];
|
|
17
|
-
hasTurnFileChanges?: boolean;
|
|
18
|
-
}
|
|
19
|
-
export interface TurnTelemetryCapabilityContext {
|
|
20
|
-
skillDirectoryProjected: boolean;
|
|
21
|
-
skillDirectoryRevision?: `sha256:${string}`;
|
|
22
|
-
skillDirectoryChars?: number;
|
|
23
|
-
}
|
|
24
|
-
export interface TurnTelemetryExecutionEvidence {
|
|
25
|
-
ledgerSchemaVersion: 4;
|
|
26
|
-
toolCalls: ToolCallExecutionEvidence[];
|
|
27
|
-
finalAnswerEvidence: FinalAnswerEvidence;
|
|
28
|
-
availableToolNames: string[];
|
|
29
|
-
enabledToolNames: string[];
|
|
30
|
-
blockedToolCalls: Array<{
|
|
31
|
-
name: string;
|
|
32
|
-
reason: string;
|
|
33
|
-
}>;
|
|
34
|
-
}
|
|
35
|
-
export interface TurnTelemetrySnapshot {
|
|
36
|
-
turnId: string;
|
|
37
|
-
sessionId: string;
|
|
38
|
-
projectId?: string;
|
|
39
|
-
/** Gateway-stamped alias; v1 MUST equal turnId (design §7.3). Set at finalize. */
|
|
40
|
-
assistantMessageId?: string;
|
|
41
|
-
model?: string;
|
|
42
|
-
provider?: string;
|
|
43
|
-
agentMode?: AgentMode;
|
|
44
|
-
sourceChannel?: string;
|
|
45
|
-
usage?: TurnTelemetryUsage;
|
|
46
|
-
toolSummary?: TurnTelemetryToolSummary;
|
|
47
|
-
executionEvidence?: TurnTelemetryExecutionEvidence;
|
|
48
|
-
fileContext?: TurnTelemetryFileContext;
|
|
49
|
-
delegationSummary?: HostDelegationTelemetrySummary;
|
|
50
|
-
capabilityContext?: TurnTelemetryCapabilityContext;
|
|
51
|
-
createdAt: string;
|
|
52
|
-
finalizedAt?: string;
|
|
53
|
-
}
|
|
54
|
-
/** Fields that can be merged into a turn's telemetry record as the turn progresses. */
|
|
55
|
-
export type TurnTelemetryPatch = Partial<Omit<TurnTelemetrySnapshot, "turnId" | "createdAt" | "finalizedAt" | "assistantMessageId">>;
|
|
56
|
-
/**
|
|
57
|
-
* Merge a telemetry fragment into the in-memory record for a turn. Pieces (tool summary,
|
|
58
|
-
* usage/model, file context) arrive at different points in the pipeline and upsert into the
|
|
59
|
-
* same turnId record. Safe to call before the projectId is known; the first call seeds it.
|
|
60
|
-
*/
|
|
61
|
-
export declare function recordTurnTelemetry(turnId: string, patch: TurnTelemetryPatch): void;
|
|
62
|
-
export declare function recordTurnDelegationStarted(input: {
|
|
63
|
-
turnId: string;
|
|
64
|
-
subagentId: string;
|
|
65
|
-
agentType: string;
|
|
66
|
-
mode: "foreground" | "background";
|
|
67
|
-
}): void;
|
|
68
|
-
export declare function recordTurnDelegationCompleted(input: {
|
|
69
|
-
turnId: string;
|
|
70
|
-
subagentId: string;
|
|
71
|
-
agentType: string;
|
|
72
|
-
status: "completed" | "failed" | "cancelled";
|
|
73
|
-
durationMs: number;
|
|
74
|
-
totalTokens: number;
|
|
75
|
-
}): void;
|
|
76
|
-
export declare function recordTurnDelegationDecision(input: {
|
|
77
|
-
turnId: string;
|
|
78
|
-
subagentId: string;
|
|
79
|
-
decision: "adopted" | "partially_adopted" | "rejected";
|
|
80
|
-
}): void;
|
|
81
|
-
export declare function recordTurnArgumentCorrections(turnId: string, argumentCorrections: HostDelegationTelemetrySummary["argumentCorrections"]): void;
|
|
82
|
-
/**
|
|
83
|
-
* Flush the accumulated telemetry for a turn to disk and drop it from memory. Returns null
|
|
84
|
-
* (after dropping the in-memory record) when no projectId resolved — telemetry, like the turn
|
|
85
|
-
* baseline, is only persisted for turns that belong to a registered project.
|
|
86
|
-
*/
|
|
87
|
-
export declare function finalizeTurnTelemetry(input: {
|
|
88
|
-
turnId: string;
|
|
89
|
-
projectId?: string;
|
|
90
|
-
}): Promise<TurnTelemetrySnapshot | null>;
|
|
91
|
-
export declare function getTurnTelemetryRecord(projectId: string, turnId: string): Promise<TurnTelemetrySnapshot | null>;
|
|
92
|
-
export declare function listTurnTelemetryBySession(input: {
|
|
93
|
-
projectId: string;
|
|
94
|
-
sessionId?: string;
|
|
95
|
-
limit?: number;
|
|
96
|
-
}): Promise<{
|
|
97
|
-
records: TurnTelemetrySnapshot[];
|
|
98
|
-
}>;
|
|
99
|
-
/** Test/maintenance helper: drop any in-memory telemetry not yet finalized. */
|
|
100
|
-
export declare function __resetActiveTurnTelemetryForTest(): void;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export type WorkingMaterialKind = "workspace" | "instructions" | "generated" | "url";
|
|
2
|
-
export interface WorkingMaterialItem {
|
|
3
|
-
id: string;
|
|
4
|
-
projectId: string;
|
|
5
|
-
sessionId: string;
|
|
6
|
-
sourceKind: WorkingMaterialKind;
|
|
7
|
-
path?: string;
|
|
8
|
-
title: string;
|
|
9
|
-
viewerHint?: string;
|
|
10
|
-
pinned: boolean;
|
|
11
|
-
order: number;
|
|
12
|
-
addedAt: string;
|
|
13
|
-
updatedAt: string;
|
|
14
|
-
missing?: boolean;
|
|
15
|
-
}
|
|
16
|
-
export declare function getWorkingMaterials(projectId: string, sessionId: string): Promise<{
|
|
17
|
-
items: WorkingMaterialItem[];
|
|
18
|
-
missing: WorkingMaterialItem[];
|
|
19
|
-
}>;
|
|
20
|
-
export interface WorkingMaterialsWriteResult {
|
|
21
|
-
ok: true;
|
|
22
|
-
items: WorkingMaterialItem[];
|
|
23
|
-
/** 超过上限被淘汰的项;非空时调用方/UI 必须告知用户(绝不静默丢用户 pin 的数据)。 */
|
|
24
|
-
dropped?: WorkingMaterialItem[];
|
|
25
|
-
}
|
|
26
|
-
export declare function replaceWorkingMaterials(projectId: string, sessionId: string, items: unknown[]): Promise<WorkingMaterialsWriteResult>;
|
|
27
|
-
export declare function upsertWorkingMaterial(projectId: string, sessionId: string, item: unknown): Promise<WorkingMaterialsWriteResult>;
|
|
28
|
-
export declare function removeWorkingMaterial(projectId: string, sessionId: string, id: string): Promise<WorkingMaterialsWriteResult>;
|
|
29
|
-
export declare function reorderWorkingMaterials(projectId: string, sessionId: string, ids: string[]): Promise<WorkingMaterialsWriteResult>;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export declare const RELEVANT_MEMORIES_CONFIG: {
|
|
2
|
-
/** Max files to surface per turn. */
|
|
3
|
-
readonly MAX_SELECTED: 5;
|
|
4
|
-
/** Max bytes per surfaced file (CC: 4096). */
|
|
5
|
-
readonly MAX_FILE_BYTES: 4096;
|
|
6
|
-
};
|
|
7
|
-
/** A selected relevant memory with content loaded. */
|
|
8
|
-
export interface RelevantMemory {
|
|
9
|
-
/** Filename */
|
|
10
|
-
filename: string;
|
|
11
|
-
/** Full file path */
|
|
12
|
-
filePath: string;
|
|
13
|
-
/** Last modified timestamp */
|
|
14
|
-
mtimeMs: number;
|
|
15
|
-
/** Relevance score (0.0 - 1.0) */
|
|
16
|
-
score: number;
|
|
17
|
-
/** Content (possibly truncated) */
|
|
18
|
-
content: string;
|
|
19
|
-
/** Whether content was truncated */
|
|
20
|
-
truncated: boolean;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Format relevant memories as a single block for system prompt injection.
|
|
24
|
-
* CC parity: includes freshness header per file.
|
|
25
|
-
*/
|
|
26
|
-
export declare function formatRelevantMemoriesBlock(memories: RelevantMemory[]): string;
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Implicit Memory Extraction — CC extractMemories lightweight port.
|
|
3
|
-
*
|
|
4
|
-
* Architecture:
|
|
5
|
-
* - Lightweight LLM pass (async, non-blocking) extracts structured facts
|
|
6
|
-
* - Host validates and commits atomic claims through the canonical evidence chain
|
|
7
|
-
*
|
|
8
|
-
* This runs AFTER turn.end, so the user already has their response.
|
|
9
|
-
* Every completed user turn is eligible for the bounded learned pass. If the
|
|
10
|
-
* model is unavailable or cannot produce a valid structured claim, extraction
|
|
11
|
-
* fails closed without creating an unstructured memory.
|
|
12
|
-
*
|
|
13
|
-
* Reference: claude-code src/services/extractMemories/extractMemories.ts
|
|
14
|
-
*/
|
|
15
|
-
import type { MemoryWriter } from "../ports/memory-writer.js";
|
|
16
|
-
import { type LongTermMemoryCategory, type MemoryClaimRelation } from "../../host-contract/memory-category.js";
|
|
17
|
-
export interface ExtractedFact {
|
|
18
|
-
text: string;
|
|
19
|
-
/** Exact evidence span copied from the current user message; never assistant prose. */
|
|
20
|
-
evidenceQuote: string;
|
|
21
|
-
/** True only when this atomic fact replaces or cancels prior state. */
|
|
22
|
-
correction?: boolean;
|
|
23
|
-
category: LongTermMemoryCategory;
|
|
24
|
-
importance: number;
|
|
25
|
-
confidence: number;
|
|
26
|
-
eventDate?: string;
|
|
27
|
-
evidenceKind: "direct_user_statement" | "inference";
|
|
28
|
-
scope: "global" | "project" | "session";
|
|
29
|
-
entity: string;
|
|
30
|
-
predicate: string;
|
|
31
|
-
relation: MemoryClaimRelation;
|
|
32
|
-
value: Record<string, unknown>;
|
|
33
|
-
}
|
|
34
|
-
export interface ImplicitExtractionDeps {
|
|
35
|
-
/** Local memory provider for writing extracted facts. */
|
|
36
|
-
localProvider: MemoryWriter;
|
|
37
|
-
/** User ID. */
|
|
38
|
-
userId: string;
|
|
39
|
-
/** Logger. */
|
|
40
|
-
log: {
|
|
41
|
-
debug(msg: string): void;
|
|
42
|
-
warn(msg: string): void;
|
|
43
|
-
};
|
|
44
|
-
/**
|
|
45
|
-
* LLM invocation function (uses background/cheap model).
|
|
46
|
-
* Returns structured JSON string or null if unavailable.
|
|
47
|
-
*/
|
|
48
|
-
llmExtract?: (prompt: string, signal?: AbortSignal) => Promise<string | null>;
|
|
49
|
-
signal?: AbortSignal;
|
|
50
|
-
sessionId?: string;
|
|
51
|
-
/** Durable Host extraction-job id used to make preemption/restart replay idempotent. */
|
|
52
|
-
idempotencyNamespace?: string;
|
|
53
|
-
}
|
|
54
|
-
export interface TurnPair {
|
|
55
|
-
priorUserMessage?: string;
|
|
56
|
-
userMessage: string;
|
|
57
|
-
assistantMessage: string;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Use a lightweight LLM to extract structured facts from a turn pair.
|
|
61
|
-
*/
|
|
62
|
-
export declare function extractFactsViaLlm(turn: TurnPair, llmExtract: (prompt: string) => Promise<string | null>, today: string, onDiagnostic?: (message: string) => void, existingClaims?: readonly ExtractedFact[]): Promise<ExtractedFact[]>;
|
|
63
|
-
/**
|
|
64
|
-
* Run the full implicit extraction pipeline for a completed turn.
|
|
65
|
-
* This is async and non-blocking — call it after turn.end.
|
|
66
|
-
*
|
|
67
|
-
* @returns Number of facts extracted and stored
|
|
68
|
-
*/
|
|
69
|
-
export declare function runImplicitExtraction(turn: TurnPair, deps: ImplicitExtractionDeps): Promise<number>;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export type MemoryRecallUsage = "used" | "not_used" | "uncertain";
|
|
2
|
-
export type MemoryRecallEffect = "helpful" | "neutral" | "harmful" | "uncertain";
|
|
3
|
-
export interface MemoryRecallAttribution {
|
|
4
|
-
usage: MemoryRecallUsage;
|
|
5
|
-
effect: MemoryRecallEffect;
|
|
6
|
-
usedMemoryIds: string[];
|
|
7
|
-
rationale: string;
|
|
8
|
-
}
|
|
9
|
-
export interface MemoryRecallAttributionInput {
|
|
10
|
-
query: string;
|
|
11
|
-
response: string;
|
|
12
|
-
memories: Array<{
|
|
13
|
-
id: string;
|
|
14
|
-
content: string;
|
|
15
|
-
recallPacket?: unknown;
|
|
16
|
-
}>;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Builds a background semantic-assessment task. This deliberately asks for
|
|
20
|
-
* causal use of evidence rather than lexical overlap, so paraphrases and
|
|
21
|
-
* repeated topic words do not become fabricated positive feedback.
|
|
22
|
-
*/
|
|
23
|
-
export declare function buildMemoryRecallAttributionPrompt(input: MemoryRecallAttributionInput): string;
|
|
24
|
-
export declare function parseMemoryRecallAttribution(raw: string | null | undefined): MemoryRecallAttribution | null;
|
|
@@ -1,219 +0,0 @@
|
|
|
1
|
-
import type { MemoryWriter } from "./memory-writer.js";
|
|
2
|
-
import type { MemoryClaimRelation } from "../../host-contract/memory-category.js";
|
|
3
|
-
export interface MemorySearchOptions {
|
|
4
|
-
limit?: number;
|
|
5
|
-
llmConfig?: unknown;
|
|
6
|
-
/** Foreground-turn identity. When present, Host records every considered
|
|
7
|
-
* candidate and applies the task-relevance injection decision. */
|
|
8
|
-
recallContext?: {
|
|
9
|
-
sessionId: string;
|
|
10
|
-
turnId: string;
|
|
11
|
-
};
|
|
12
|
-
/** Drop hits whose tags contain ALL strings of any group (resident-layer exclusion). */
|
|
13
|
-
excludeTagGroups?: string[][];
|
|
14
|
-
}
|
|
15
|
-
export interface MemorySearchResult {
|
|
16
|
-
id: string;
|
|
17
|
-
content: string;
|
|
18
|
-
score: number;
|
|
19
|
-
source?: string;
|
|
20
|
-
metadata?: Record<string, unknown>;
|
|
21
|
-
}
|
|
22
|
-
export interface MemoryIngestOptions {
|
|
23
|
-
llmConfig?: unknown;
|
|
24
|
-
source?: string;
|
|
25
|
-
sessionId?: string;
|
|
26
|
-
/** Transport-only cancellation; adapters must not serialize this into Host business params. */
|
|
27
|
-
requestSignal?: AbortSignal;
|
|
28
|
-
}
|
|
29
|
-
export interface MemoryExtractionItem {
|
|
30
|
-
text: string;
|
|
31
|
-
category?: string;
|
|
32
|
-
importance?: number;
|
|
33
|
-
confidence?: number;
|
|
34
|
-
source?: string;
|
|
35
|
-
event_date?: string;
|
|
36
|
-
tags?: string[];
|
|
37
|
-
/** Atomic claim identity produced by the evidence extractor and validated again by Host. */
|
|
38
|
-
claim?: {
|
|
39
|
-
scope: "global" | "project" | "session";
|
|
40
|
-
entity: string;
|
|
41
|
-
predicate: string;
|
|
42
|
-
relation: MemoryClaimRelation;
|
|
43
|
-
value: Record<string, unknown>;
|
|
44
|
-
};
|
|
45
|
-
/** Ids of already-uploaded attachments to link to this memory on commit. */
|
|
46
|
-
attachmentIds?: string[];
|
|
47
|
-
/** Evidence audit trail: source refs, optional verbatim quote, and a crash-safe dedup key. */
|
|
48
|
-
evidence?: {
|
|
49
|
-
kind: string;
|
|
50
|
-
refs: string[];
|
|
51
|
-
idempotencyKey: string;
|
|
52
|
-
quote?: string;
|
|
53
|
-
};
|
|
54
|
-
/** The source turn explicitly retracts or replaces an earlier decision. */
|
|
55
|
-
correction?: boolean;
|
|
56
|
-
}
|
|
57
|
-
export interface MemoryConsolidationWriteResult {
|
|
58
|
-
memoriesAdded?: number;
|
|
59
|
-
observationsAdded?: number;
|
|
60
|
-
proposalsAdded?: number;
|
|
61
|
-
claimsAdded?: number;
|
|
62
|
-
conflictsAdded?: number;
|
|
63
|
-
claimIds?: string[];
|
|
64
|
-
conflictIds?: string[];
|
|
65
|
-
/** [A4] ingestExtracted 结构化回执:与入参同序、含被安全闸拒的项;created 带真实落库
|
|
66
|
-
* memoryId;merged(近重复合并)是合法成功不是失败。可重试失败不在带内(RPC 抛错即
|
|
67
|
-
* 调用方的重试通道)。可选:同一类型还约束 observe/propose 返回体,消费处按缺失兜底。 */
|
|
68
|
-
items?: Array<{
|
|
69
|
-
text: string;
|
|
70
|
-
outcome: "created" | "merged" | "conflicted" | "pending" | "rejected";
|
|
71
|
-
memoryId?: string;
|
|
72
|
-
}>;
|
|
73
|
-
}
|
|
74
|
-
export interface MemoryProvider {
|
|
75
|
-
readonly providerId: string;
|
|
76
|
-
search(query: string, userId: string, options?: MemorySearchOptions): Promise<MemorySearchResult[]>;
|
|
77
|
-
remove?(memoryId: string): Promise<boolean>;
|
|
78
|
-
}
|
|
79
|
-
export interface MemoryLearningSink {
|
|
80
|
-
ingestExtracted(items: MemoryExtractionItem[], userId: string, options?: MemoryIngestOptions): Promise<MemoryConsolidationWriteResult>;
|
|
81
|
-
}
|
|
82
|
-
export interface MemoryActivitySummary {
|
|
83
|
-
dailyCounts: Array<{
|
|
84
|
-
date: string;
|
|
85
|
-
count: number;
|
|
86
|
-
}>;
|
|
87
|
-
highlights: Array<{
|
|
88
|
-
text: string;
|
|
89
|
-
category: string;
|
|
90
|
-
importance: number;
|
|
91
|
-
date: string;
|
|
92
|
-
}>;
|
|
93
|
-
}
|
|
94
|
-
/** Lightweight attachment reference carried on atlas/detail records (no bytes). */
|
|
95
|
-
export interface MemoryAtlasAttachmentRef {
|
|
96
|
-
id: string;
|
|
97
|
-
kind: string;
|
|
98
|
-
filename: string;
|
|
99
|
-
mimeType: string;
|
|
100
|
-
size: number;
|
|
101
|
-
url: string;
|
|
102
|
-
}
|
|
103
|
-
export interface MemoryAtlasRecord {
|
|
104
|
-
id: string;
|
|
105
|
-
text: string;
|
|
106
|
-
category?: string;
|
|
107
|
-
importance?: number;
|
|
108
|
-
confidence?: number;
|
|
109
|
-
source?: string;
|
|
110
|
-
sessionId?: string;
|
|
111
|
-
eventDate?: string;
|
|
112
|
-
tags?: string[];
|
|
113
|
-
createdAt?: string | number;
|
|
114
|
-
updatedAt?: string | number;
|
|
115
|
-
accessCount?: number;
|
|
116
|
-
lastAccessedAt?: string | number;
|
|
117
|
-
isArchived?: boolean;
|
|
118
|
-
attachments?: MemoryAtlasAttachmentRef[];
|
|
119
|
-
}
|
|
120
|
-
export interface MemoryAtlasResult {
|
|
121
|
-
totalCount?: number;
|
|
122
|
-
records?: MemoryAtlasRecord[];
|
|
123
|
-
buckets?: unknown[];
|
|
124
|
-
clusters?: unknown[];
|
|
125
|
-
windowCursor?: unknown;
|
|
126
|
-
timeRange?: unknown;
|
|
127
|
-
}
|
|
128
|
-
export interface MemoryUpdatePatch {
|
|
129
|
-
text?: string;
|
|
130
|
-
category?: string;
|
|
131
|
-
importance?: number;
|
|
132
|
-
source?: string;
|
|
133
|
-
eventDate?: string;
|
|
134
|
-
tags?: string[];
|
|
135
|
-
}
|
|
136
|
-
export interface MemoryHandlerProvider extends MemoryProvider {
|
|
137
|
-
/** B3(X7)异步化:Host 契约方法(host 模式经 x/host.request 跨进程)。 */
|
|
138
|
-
getAtlas?(userId: string, options?: Record<string, unknown>): Promise<MemoryAtlasResult>;
|
|
139
|
-
/** B3(X7)异步化:Host 契约方法。 */
|
|
140
|
-
getActivitySummary?(userId: string, days: number): Promise<MemoryActivitySummary>;
|
|
141
|
-
observeExtracted?(items: MemoryExtractionItem[], userId: string, options?: MemoryIngestOptions): Promise<MemoryConsolidationWriteResult>;
|
|
142
|
-
proposeExtracted?(items: MemoryExtractionItem[], userId: string, options?: MemoryIngestOptions): Promise<MemoryConsolidationWriteResult>;
|
|
143
|
-
ingestExtracted?(items: MemoryExtractionItem[], userId: string, options?: MemoryIngestOptions): Promise<MemoryConsolidationWriteResult>;
|
|
144
|
-
update?(id: string, patch: MemoryUpdatePatch): Promise<boolean>;
|
|
145
|
-
/** Persist an uploaded attachment (orphan until linked at commit). */
|
|
146
|
-
adoptAttachment?(input: {
|
|
147
|
-
data?: Buffer;
|
|
148
|
-
sourceUrl?: string;
|
|
149
|
-
filename: string;
|
|
150
|
-
mimeType: string;
|
|
151
|
-
userId: string;
|
|
152
|
-
}): Promise<MemoryAtlasAttachmentRef>;
|
|
153
|
-
/** Resolve an attachment id to its on-disk path (for serving). */
|
|
154
|
-
locateAttachment?(id: string): Promise<{
|
|
155
|
-
absPath: string;
|
|
156
|
-
mimeType: string;
|
|
157
|
-
filename: string;
|
|
158
|
-
} | null>;
|
|
159
|
-
/** Drop uploads never saved to a memory. */
|
|
160
|
-
purgeOrphanAttachments?(): Promise<void>;
|
|
161
|
-
/** Read an attachment's bytes + mime (for multimodal understanding). */
|
|
162
|
-
readAttachmentBytes?(id: string): Promise<{
|
|
163
|
-
bytes: Buffer;
|
|
164
|
-
mimeType: string;
|
|
165
|
-
} | null>;
|
|
166
|
-
/** Persist understood/extracted text on an attachment row. */
|
|
167
|
-
setAttachmentText?(id: string, text: string): void;
|
|
168
|
-
/** Factual proposals for the candidate surface: pending (default) awaiting
|
|
169
|
-
* corroboration, or expired (read-only history of what timed out). */
|
|
170
|
-
listPendingProposals?(userId: string, limit?: number, status?: "pending" | "expired"): Array<{
|
|
171
|
-
id: string;
|
|
172
|
-
text: string;
|
|
173
|
-
category: string;
|
|
174
|
-
importance: number;
|
|
175
|
-
confidence: number;
|
|
176
|
-
source: string;
|
|
177
|
-
tags: string[];
|
|
178
|
-
createdAt: number;
|
|
179
|
-
}>;
|
|
180
|
-
/** UI resolution of one pending proposal: confirm commits it with manual authority; dismiss rejects it. */
|
|
181
|
-
resolveProposal?(userId: string, proposalId: string, action: "confirm" | "dismiss"): Promise<boolean>;
|
|
182
|
-
/** Evidence-laddered backlog consumption (corroborated commit / feedback solo / TTL expiry). */
|
|
183
|
-
consumePendingProposals?(userId: string): Promise<{
|
|
184
|
-
committed: number;
|
|
185
|
-
merged: number;
|
|
186
|
-
expiredIds: string[];
|
|
187
|
-
pendingLeft: number;
|
|
188
|
-
}>;
|
|
189
|
-
}
|
|
190
|
-
export interface MemoryDreamProvider {
|
|
191
|
-
search(query: string, userId: string, options?: {
|
|
192
|
-
limit?: number;
|
|
193
|
-
}): Promise<MemorySearchResult[]>;
|
|
194
|
-
proposeExtracted?(items: MemoryExtractionItem[], userId: string, options?: {
|
|
195
|
-
sessionId?: string;
|
|
196
|
-
source?: string;
|
|
197
|
-
}): Promise<{
|
|
198
|
-
proposalsAdded?: number;
|
|
199
|
-
}>;
|
|
200
|
-
feedback?(memoryIds: string[], signal: "useful" | "irrelevant" | "outdated" | "wrong", context?: {
|
|
201
|
-
sessionId?: string;
|
|
202
|
-
silent?: boolean;
|
|
203
|
-
}): Promise<{
|
|
204
|
-
affected: number;
|
|
205
|
-
}>;
|
|
206
|
-
/** B3(X7)异步化:以下 Host 契约方法签名统一 Promise(host 模式经 x/host.request 跨进程)。 */
|
|
207
|
-
getActivitySummary?(userId: string, days?: number): Promise<MemoryActivitySummary>;
|
|
208
|
-
synthesizeTimeline?(userId: string, startMs: number, endMs: number): Promise<string>;
|
|
209
|
-
getProfile?(userId: string, key: string): string | null;
|
|
210
|
-
setProfile?(userId: string, key: string, value: string): Promise<void>;
|
|
211
|
-
getAllProfiles?(userId: string): Promise<Record<string, string>>;
|
|
212
|
-
}
|
|
213
|
-
export interface MemoryDecayProvider {
|
|
214
|
-
triggerDecay(userId: string): Promise<{
|
|
215
|
-
decayed: number;
|
|
216
|
-
}>;
|
|
217
|
-
}
|
|
218
|
-
export type MemoryRuntimeHookProvider = MemoryProvider & MemoryWriter;
|
|
219
|
-
export type MemoryDreamRuntimeProvider = MemoryDreamProvider & MemoryDecayProvider;
|