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,6 +1,27 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
export type
|
|
1
|
+
/** Agent-local normalized turn items emitted through standard ACP session updates. */
|
|
2
|
+
export declare const THREAD_ITEM_PROTOCOL_VERSION: 1;
|
|
3
|
+
export type ThreadItemDomain = "chat" | "solo" | "product" | "goal" | "workflow" | "system";
|
|
4
|
+
export type ThreadItemType = "message" | "state" | "plan" | "task" | "checklist" | "budget" | "input_request" | "summary" | "tool_call" | "tool_result" | "artifact" | "receipt";
|
|
5
|
+
export type ThreadItemRole = "user" | "assistant" | "system" | "tool";
|
|
6
|
+
export type ThreadItemState = "pending" | "in_progress" | "completed" | "failed" | "blocked" | "cancelled";
|
|
7
|
+
export interface ThreadItem {
|
|
8
|
+
id: string;
|
|
9
|
+
type: ThreadItemType;
|
|
10
|
+
kind: string;
|
|
11
|
+
domain: ThreadItemDomain;
|
|
12
|
+
role: ThreadItemRole;
|
|
13
|
+
state: ThreadItemState;
|
|
14
|
+
text?: string;
|
|
15
|
+
data: Record<string, unknown>;
|
|
16
|
+
}
|
|
17
|
+
export interface ThreadItemEvent {
|
|
18
|
+
schemaVersion: typeof THREAD_ITEM_PROTOCOL_VERSION;
|
|
19
|
+
at: string;
|
|
20
|
+
sequence?: number;
|
|
21
|
+
threadId: string;
|
|
22
|
+
turnId: string;
|
|
23
|
+
item: ThreadItem;
|
|
24
|
+
}
|
|
4
25
|
export type TurnStatus = "pending" | "in_progress" | "completed" | "failed" | "aborted";
|
|
5
26
|
/** Represents one user request → agent response cycle. */
|
|
6
27
|
export interface ThreadTurn {
|
|
@@ -4,25 +4,15 @@
|
|
|
4
4
|
* ALL configurable constants that external apps (Electron UI, CLI config)
|
|
5
5
|
* may want to read or override are defined here. This enables:
|
|
6
6
|
*
|
|
7
|
-
* 1.
|
|
7
|
+
* 1. Local runtime consumers
|
|
8
8
|
* 2. Serialization to JSON for persistence (settings.json)
|
|
9
9
|
* 3. Environment variable overrides via QLOGICAGENT_* prefix
|
|
10
10
|
*
|
|
11
11
|
* Consumers import individual constants from this module.
|
|
12
|
-
* The full shape is exported as `TunableDefaults` for
|
|
12
|
+
* The full shape is exported as `TunableDefaults` for public introspection.
|
|
13
13
|
*
|
|
14
14
|
* Grouping follows subsystem boundaries.
|
|
15
15
|
*/
|
|
16
|
-
/**
|
|
17
|
-
* @deprecated Compatibility value exposed through the legacy tunables profile.
|
|
18
|
-
* Turn execution is unbounded unless the caller explicitly supplies maxRounds.
|
|
19
|
-
*/
|
|
20
|
-
export declare const MAX_ROUNDS_LIMIT = 100;
|
|
21
|
-
/**
|
|
22
|
-
* @deprecated Compatibility value exposed through the legacy tunables profile.
|
|
23
|
-
* It is not applied as an implicit top-level turn limit.
|
|
24
|
-
*/
|
|
25
|
-
export declare const DEFAULT_MAX_ROUNDS = 25;
|
|
26
16
|
/** Default temperature for LLM calls (0 = deterministic). */
|
|
27
17
|
export declare const DEFAULT_TEMPERATURE = 0;
|
|
28
18
|
/** Hard cap on tool calls per round (prevents runaway). */
|
|
@@ -84,36 +74,10 @@ export declare const REACTIVE_COMPACT_MAX_FAILURES = 3;
|
|
|
84
74
|
export declare const REACTIVE_COMPACT_MIN_MESSAGES = 4;
|
|
85
75
|
/** Target usage percentage for reactive compaction. */
|
|
86
76
|
export declare const REACTIVE_COMPACT_TARGET_PERCENT = 50;
|
|
87
|
-
/** Min tool calls to consider a turn "complex enough" for skill creation. */
|
|
88
|
-
export declare const MIN_TOOL_CALLS_FOR_SKILL = 3;
|
|
89
|
-
/** Min distinct tools to suggest a new skill. */
|
|
90
|
-
export declare const MIN_DISTINCT_TOOLS_FOR_SKILL = 2;
|
|
91
|
-
/**
|
|
92
|
-
* Project-level pattern repetition threshold.
|
|
93
|
-
* The same workflow signature must appear this many times across turns/sessions
|
|
94
|
-
* before a skill creation is triggered. Prevents one-off complex turns from
|
|
95
|
-
* immediately producing skills.
|
|
96
|
-
*/
|
|
97
|
-
export declare const SKILL_PATTERN_REPETITION_THRESHOLD = 3;
|
|
98
|
-
/**
|
|
99
|
-
* Max age (ms) for pattern entries. Patterns older than this are pruned.
|
|
100
|
-
* Default: 30 days.
|
|
101
|
-
*/
|
|
102
|
-
export declare const SKILL_PATTERN_MAX_AGE_MS: number;
|
|
103
77
|
/** Max nested fork depth for sub-agents. */
|
|
104
78
|
export declare const MAX_FORK_DEPTH = 4;
|
|
105
79
|
/** Team aggregate budget (total tokens across all forked sub-agents). 0 = unlimited. */
|
|
106
80
|
export declare const TEAM_BUDGET_TOKENS = 0;
|
|
107
|
-
/** Max historical sessions retained on disk. */
|
|
108
|
-
export declare const MAX_SESSIONS = 50;
|
|
109
|
-
/** Turn count threshold for triggering task summary. */
|
|
110
|
-
export declare const TASK_SUMMARY_TURN_THRESHOLD = 50;
|
|
111
|
-
/** Interval (turns) between summary regeneration. */
|
|
112
|
-
export declare const TASK_SUMMARY_REGEN_INTERVAL = 30;
|
|
113
|
-
/** Idle duration (ms) before a group session is auto-split into a new session. Default: 1 hour. */
|
|
114
|
-
export declare const GROUP_SESSION_IDLE_THRESHOLD_MS: number;
|
|
115
|
-
/** Hard limit: max turns in a single group session before soft-split. Default: 200 turns. */
|
|
116
|
-
export declare const GROUP_SESSION_MAX_TURNS = 200;
|
|
117
81
|
/** Max include nesting depth in instruction files. */
|
|
118
82
|
export declare const MAX_INCLUDE_DEPTH = 5;
|
|
119
83
|
/** Max total chars loaded from instruction files. */
|
|
@@ -143,33 +107,11 @@ export declare const TASK_POLL_INTERVAL_MS = 1000;
|
|
|
143
107
|
export declare const TASK_STOPPED_DISPLAY_MS = 3000;
|
|
144
108
|
/** Terminal task cleanup grace period (ms). */
|
|
145
109
|
export declare const TASK_PANEL_GRACE_MS = 30000;
|
|
146
|
-
/** Max bytes injected for session memory prefetch. */
|
|
147
|
-
export declare const MEMORY_PREFETCH_MAX_SESSION_BYTES: number;
|
|
148
|
-
/** Max results per memory recall query. */
|
|
149
|
-
export declare const MEMORY_PREFETCH_LIMIT_PER_RECALL = 10;
|
|
150
|
-
/** LRU dedup set size for surfaced memory entries. */
|
|
151
|
-
export declare const MEMORY_MAX_SURFACED_ENTRIES = 100;
|
|
152
|
-
/** Min hours between dream consolidation runs. */
|
|
153
|
-
export declare const DREAM_MIN_INTERVAL_HOURS = 24;
|
|
154
|
-
/** Min sessions before dream triggers. */
|
|
155
|
-
export declare const DREAM_MIN_SESSIONS = 5;
|
|
156
|
-
/** Dream scan throttle interval (ms). */
|
|
157
|
-
export declare const DREAM_SCAN_INTERVAL_MS = 600000;
|
|
158
|
-
/** Idle dream timer (minutes). */
|
|
159
|
-
export declare const IDLE_DREAM_MINUTES = 30;
|
|
160
|
-
/** Dream cooldown between runs (ms, 4 hours). */
|
|
161
|
-
export declare const DREAM_COOLDOWN_MS = 14400000;
|
|
162
|
-
/** Max dream run duration (ms). */
|
|
163
|
-
export declare const DREAM_MAX_DURATION_MS = 300000;
|
|
164
110
|
/**
|
|
165
111
|
* Full typed shape of all tunable defaults.
|
|
166
|
-
* Used by
|
|
112
|
+
* Used by local runtime consumers.
|
|
167
113
|
*/
|
|
168
114
|
export interface TunableDefaults {
|
|
169
|
-
/** @deprecated Compatibility-only; not an implicit execution limit. */
|
|
170
|
-
maxRoundsLimit: number;
|
|
171
|
-
/** @deprecated Compatibility-only; callers must explicitly set maxRounds. */
|
|
172
|
-
defaultMaxRounds: number;
|
|
173
115
|
defaultTemperature: number;
|
|
174
116
|
maxToolBudgetCap: number;
|
|
175
117
|
defaultToolBudget: number;
|
|
@@ -198,12 +140,7 @@ export interface TunableDefaults {
|
|
|
198
140
|
reactiveCompactMaxFailures: number;
|
|
199
141
|
reactiveCompactMinMessages: number;
|
|
200
142
|
reactiveCompactTargetPercent: number;
|
|
201
|
-
minToolCallsForSkill: number;
|
|
202
|
-
minDistinctToolsForSkill: number;
|
|
203
143
|
maxForkDepth: number;
|
|
204
|
-
maxSessions: number;
|
|
205
|
-
taskSummaryTurnThreshold: number;
|
|
206
|
-
taskSummaryRegenInterval: number;
|
|
207
144
|
maxIncludeDepth: number;
|
|
208
145
|
maxInstructionChars: number;
|
|
209
146
|
instructionsMaxFileSize: number;
|
|
@@ -218,15 +155,6 @@ export interface TunableDefaults {
|
|
|
218
155
|
taskPollIntervalMs: number;
|
|
219
156
|
taskStoppedDisplayMs: number;
|
|
220
157
|
taskPanelGraceMs: number;
|
|
221
|
-
memoryPrefetchMaxSessionBytes: number;
|
|
222
|
-
memoryPrefetchLimitPerRecall: number;
|
|
223
|
-
memoryMaxSurfacedEntries: number;
|
|
224
|
-
dreamMinIntervalHours: number;
|
|
225
|
-
dreamMinSessions: number;
|
|
226
|
-
dreamScanIntervalMs: number;
|
|
227
|
-
idleDreamMinutes: number;
|
|
228
|
-
dreamCooldownMs: number;
|
|
229
|
-
dreamMaxDurationMs: number;
|
|
230
158
|
teamBudgetTokens: number;
|
|
231
159
|
}
|
|
232
160
|
/**
|
|
@@ -10,9 +10,7 @@
|
|
|
10
10
|
* - Optional transcript recording
|
|
11
11
|
*
|
|
12
12
|
* This is the execution engine for all sub-agent types:
|
|
13
|
-
|
|
14
|
-
* - Background memory extraction
|
|
15
|
-
* - Skill/command forking
|
|
13
|
+
* - Skill/command forking
|
|
16
14
|
* - AgentTool async agents
|
|
17
15
|
*
|
|
18
16
|
* Reference: claude-code src/utils/forkedAgent.ts
|
|
@@ -24,8 +22,7 @@ import type { AgentProgress } from "./progress-tracker.js";
|
|
|
24
22
|
* Tool permission check function — CC canUseTool parity.
|
|
25
23
|
*
|
|
26
24
|
* Returns allow/deny for each tool invocation.
|
|
27
|
-
* Used by
|
|
28
|
-
* session memory (full read, no write), etc.
|
|
25
|
+
* Used by restricted sub-agent forks.
|
|
29
26
|
*/
|
|
30
27
|
export type CanUseToolFn = (toolName: string, input: Record<string, unknown>) => {
|
|
31
28
|
allowed: true;
|
|
@@ -28,8 +28,6 @@ export interface StreamingToolExecutorConfig {
|
|
|
28
28
|
toolInvoker: ToolInvoker;
|
|
29
29
|
hooks?: HookRegistry;
|
|
30
30
|
sessionId: string;
|
|
31
|
-
/** Turn workspace/cwd - routes oversized tool-result spillover to the session data dir. */
|
|
32
|
-
projectRoot?: string;
|
|
33
31
|
/** Per-turn typed context budget and required skill-resource state. */
|
|
34
32
|
contextState?: unknown;
|
|
35
33
|
turnId: string;
|
|
@@ -77,12 +77,21 @@ export declare function restoreRequiredContextMessages(messagesBefore: MessageLi
|
|
|
77
77
|
messages: MessageLike[];
|
|
78
78
|
recoveredCount: number;
|
|
79
79
|
};
|
|
80
|
+
/**
|
|
81
|
+
* Where oversized tool output is spilled to disk.
|
|
82
|
+
*
|
|
83
|
+
* Overflow is adapter-private, process-bounded evidence. It lives under the OS temp
|
|
84
|
+
* directory and is removed when the native ACP session closes. The Host never reads
|
|
85
|
+
* this directory and qlogicagent never writes the Host's canonical session tree.
|
|
86
|
+
*/
|
|
87
|
+
export declare function getToolResultsDir(sessionId: string): string;
|
|
88
|
+
export declare function disposeToolResultStorage(sessionId: string): Promise<void>;
|
|
80
89
|
export declare function generatePreview(content: string, maxBytes: number): {
|
|
81
90
|
preview: string;
|
|
82
91
|
hasMore: boolean;
|
|
83
92
|
};
|
|
84
|
-
export declare function persistToolResult(content: string, toolCallId: string, sessionId: string
|
|
85
|
-
export declare function persistCompleteToolResultEvidence(content: string, toolCallId: string, sessionId: string
|
|
93
|
+
export declare function persistToolResult(content: string, toolCallId: string, sessionId: string): Promise<PersistedToolResult | null>;
|
|
94
|
+
export declare function persistCompleteToolResultEvidence(content: string, toolCallId: string, sessionId: string): Promise<CompleteToolResultEvidence | undefined>;
|
|
86
95
|
/**
|
|
87
96
|
* Build a reference message for large tool results (CC buildLargeToolResultMessage parity).
|
|
88
97
|
*/
|
|
@@ -92,7 +101,7 @@ export declare function buildLargeToolResultMessage(result: PersistedToolResult)
|
|
|
92
101
|
* Falls back to hard truncation if persistence fails.
|
|
93
102
|
* Called at tool execution time in streaming-tool-executor.ts.
|
|
94
103
|
*/
|
|
95
|
-
export declare function maybePersistLargeToolResult(content: string, toolCallId: string, sessionId: string,
|
|
104
|
+
export declare function maybePersistLargeToolResult(content: string, toolCallId: string, sessionId: string, threshold?: number): Promise<string>;
|
|
96
105
|
interface MessageLike {
|
|
97
106
|
role: string;
|
|
98
107
|
content?: string | unknown;
|
|
@@ -115,7 +124,7 @@ interface MessageLike {
|
|
|
115
124
|
* @returns messages with replacements applied + count of new replacements +
|
|
116
125
|
* total original bytes spilled this pass (so the caller can surface it)
|
|
117
126
|
*/
|
|
118
|
-
export declare function enforceToolResultBudget(messages: MessageLike[], state: ContentReplacementState, sessionId: string,
|
|
127
|
+
export declare function enforceToolResultBudget(messages: MessageLike[], state: ContentReplacementState, sessionId: string, limit?: number): Promise<{
|
|
119
128
|
messages: MessageLike[];
|
|
120
129
|
newlyReplacedCount: number;
|
|
121
130
|
newlyPersistedBytes: number;
|
|
@@ -1,72 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* All filesystem paths under `~/.qlogicagent/` (user-level) or
|
|
5
|
-
* `<project>/.qlogicagent/` (project-level) must go through these
|
|
6
|
-
* helpers so the dot-dir name is defined in exactly one place.
|
|
7
|
-
*/
|
|
8
|
-
export { deriveProjectId } from "../../host-contract/project-id.js";
|
|
9
|
-
/** Dot-directory name used for both user-level and project-level storage. */
|
|
1
|
+
export { deriveProjectId } from "./project-id.js";
|
|
2
|
+
/** Adapter-owned configuration directory name. */
|
|
10
3
|
export declare const AGENT_DOT_DIR = ".qlogicagent";
|
|
11
|
-
/**
|
|
12
|
-
* Derive a project's stable id from its workspaceDir — the mainstream path-derived model
|
|
13
|
-
* (VS Code / Claude Code / cc-haha): same folder → same id, deterministic, recomputable, no random
|
|
14
|
-
* UUID and no central-registry dependency. A short SHA-256 prefix of the resolved, lowercased path
|
|
15
|
-
* keeps the id length-safe on Windows (260-char path limit) while staying collision-free in
|
|
16
|
-
* practice. NOTE: deliberately NO ctime salt (VS Code salts single-folder ids so recreating a folder
|
|
17
|
-
* yields fresh state — a footgun for us; we want a recreated/rebound folder to map back to its data).
|
|
18
|
-
* The implementation is owned by host-contract/project-id.ts so the shared contract remains a leaf;
|
|
19
|
-
* this module re-exports the same function for existing path-helper consumers.
|
|
20
|
-
*/
|
|
21
|
-
/** `~/.qlogicagent/` (or QLOGICAGENT_HOME override) */
|
|
4
|
+
/** Adapter-owned device configuration root. */
|
|
22
5
|
export declare function getUserAgentHome(): string;
|
|
23
6
|
export declare function resolveActiveOwnerUserId(): string;
|
|
24
7
|
export declare function encodeOwnerProfileSegment(ownerUserId: string): string;
|
|
25
8
|
export declare function getOwnerProfileDir(ownerUserId?: string): string;
|
|
26
|
-
|
|
27
|
-
/** Dir name for our per-project companion data (sessions/checkpoints/uploads). */
|
|
28
|
-
export declare const PROJECT_DATA_DIRNAME = "projectData";
|
|
29
|
-
/** Root of the projectData tree on this device (`~/.qlogicagent/projectData/`). */
|
|
30
|
-
export declare function getProjectDataRoot(): string;
|
|
31
|
-
/** `~/.qlogicagent/projectData/<projectId>/` (projectId is the path-derived key). */
|
|
32
|
-
export declare function getProjectDataDirById(projectId: string): string;
|
|
33
|
-
/**
|
|
34
|
-
* Ensure the user agent home directory exists and is writable.
|
|
35
|
-
* Returns the path if accessible, throws with a friendly message otherwise.
|
|
36
|
-
* Call this once at startup rather than on every path resolution.
|
|
37
|
-
*/
|
|
9
|
+
/** Ensure the adapter configuration root exists and is writable. */
|
|
38
10
|
export declare function ensureUserAgentHome(): string;
|
|
39
|
-
/** `~/.qlogicagent/profiles/<owner>/.credentials.json` */
|
|
40
11
|
export declare function getUserCredentialsPath(): string;
|
|
41
|
-
/** `~/.qlogicagent/plugins/` — device-scoped. */
|
|
42
|
-
export declare function getUserPluginsDir(): string;
|
|
43
|
-
/** `~/.qlogicagent/profiles/<owner>/settings.json` */
|
|
44
12
|
export declare function getUserSettingsPath(): string;
|
|
45
|
-
/** `~/.qlogicagent/cache/` */
|
|
46
13
|
export declare function getUserCacheDir(): string;
|
|
47
|
-
/** `~/.qlogicagent/debug-logs/` */
|
|
48
14
|
export declare function getUserDebugLogsDir(): string;
|
|
49
|
-
/** `~/.qlogicagent/plugin-cache/` — device-scoped (download cache for installs). */
|
|
50
|
-
export declare function getUserPluginCacheDir(): string;
|
|
51
|
-
/** `~/.qlogicagent/marketplace.json` — device-scoped marketplace sources. */
|
|
52
|
-
export declare function getUserMarketplaceConfigPath(): string;
|
|
53
|
-
/** `~/.qlogicagent/profiles/<owner>/workflows/` */
|
|
54
15
|
export declare function getUserWorkflowsDir(): string;
|
|
55
|
-
/** `~/.qlogicagent/profiles/<owner>/INSTRUCTIONS.md` */
|
|
56
16
|
export declare function getUserInstructionsPath(): string;
|
|
57
|
-
/** `~/.qlogicagent/profiles/<owner>/rules/` */
|
|
58
17
|
export declare function getUserRulesDir(): string;
|
|
59
|
-
/** `<cwd>/.qlogicagent/` */
|
|
60
18
|
export declare function getProjectAgentDir(cwd: string): string;
|
|
61
|
-
/** `<cwd>/.qlogicagent/workflows/` */
|
|
62
19
|
export declare function getProjectWorkflowsDir(cwd: string): string;
|
|
63
|
-
/** `<cwd>/.qlogicagent/plugins/` */
|
|
64
|
-
export declare function getProjectPluginsDir(cwd: string): string;
|
|
65
|
-
/** `<cwd>/.qlogicagent/settings.json` */
|
|
66
|
-
export declare function getProjectSettingsPath(cwd: string): string;
|
|
67
|
-
/** `<cwd>/.qlogicagent/INSTRUCTIONS.md` */
|
|
68
20
|
export declare function getProjectInstructionsPath(cwd: string): string;
|
|
69
|
-
/** `<cwd>/.qlogicagent/rules/` — unified rules + instructions directory */
|
|
70
21
|
export declare function getProjectRulesDir(cwd: string): string;
|
|
71
|
-
/** `<gitRoot>/.qlogicagent/hooks/` */
|
|
72
22
|
export declare function getGitRootHooksDir(gitRoot: string): string;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** In-memory project identity projected by standard ACP session inputs. */
|
|
2
|
+
export type AgentProjectType = "default" | "personal" | "group" | "automation";
|
|
3
|
+
export interface AgentProjectInfo {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
workspaceDir: string;
|
|
7
|
+
type: AgentProjectType;
|
|
8
|
+
status: "active" | "archived";
|
|
9
|
+
groupId?: string;
|
|
10
|
+
createdAt: string;
|
|
11
|
+
updatedAt: string;
|
|
12
|
+
}
|
|
13
|
+
export type AgentProjectSnapshot = {
|
|
14
|
+
activeProjectId: string | null;
|
|
15
|
+
projects: AgentProjectInfo[];
|
|
16
|
+
};
|
|
17
|
+
export declare function materializeAgentProjectProjection(projectId: string, workspaceDir: string): void;
|
|
18
|
+
export declare function readAgentProjectProjection(): AgentProjectSnapshot;
|
|
19
|
+
export declare function resetAgentProjectProjection(): void;
|
|
20
|
+
export declare function setAgentProjectProjectionForTests(next: AgentProjectSnapshot): void;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* BackgroundTaskManager — the single registry for all background execution.
|
|
3
3
|
*
|
|
4
|
-
* Every background unit of work (forked agent
|
|
5
|
-
*
|
|
6
|
-
* 1. The TaskStore holds its lifecycle state
|
|
4
|
+
* Every background unit of work (forked agent or backgrounded shell command)
|
|
5
|
+
* registers here so that:
|
|
6
|
+
* 1. The TaskStore holds its adapter-local lifecycle state
|
|
7
7
|
* 2. The LLM can query status/output via the task tool ("output" action)
|
|
8
8
|
* 3. Completion is queued as a <task_notification> for the next turn
|
|
9
9
|
* 4. Cancellation actually kills the underlying process / aborts the agent
|
|
@@ -16,16 +16,9 @@ export declare class DefaultPathService implements PathService {
|
|
|
16
16
|
resolveActiveOwnerUserId(): string;
|
|
17
17
|
getUserAgentHome(): string;
|
|
18
18
|
getOwnerProfileDir(ownerUserId?: string): string;
|
|
19
|
-
getProfileMemoryDir(ownerUserId?: string): string;
|
|
20
19
|
getUserSettingsPath(): string;
|
|
21
|
-
getUserPluginsDir(): string;
|
|
22
|
-
getUserPluginCacheDir(): string;
|
|
23
|
-
getUserMarketplaceConfigPath(): string;
|
|
24
20
|
getProjectAgentDir(projectRoot?: string): string;
|
|
25
|
-
getProjectSettingsPath(projectRoot?: string): string;
|
|
26
21
|
getProjectInstructionsPath(projectRoot?: string): string;
|
|
27
|
-
getProjectPluginsDir(projectRoot?: string): string;
|
|
28
22
|
getProjectRulesDir(projectRoot?: string): string;
|
|
29
|
-
getProjectSessionDataRoot(projectIdOrWorkspaceDir?: string): string;
|
|
30
23
|
}
|
|
31
24
|
export declare function getDefaultPathService(): PathService;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ModelCapabilityProfile, ModelEntry, ModelPurpose, ModelRegistry, ReasoningMode } from "./model-registry.js";
|
|
2
2
|
import type { ConfigPort } from "../ports/index.js";
|
|
3
|
-
import { type ProviderCatalogDef } from "
|
|
3
|
+
import { type ProviderCatalogDef } from "./provider-profile.js";
|
|
4
4
|
export declare const LLMROUTER_CATALOG_UNAVAILABLE_MESSAGE = "\u65E0\u6CD5\u8FDE\u63A5 llmrouter \u6A21\u578B\u76EE\u5F55";
|
|
5
5
|
export declare const LLMROUTER_PROVIDER_ID = "llmrouter";
|
|
6
6
|
export declare const LLMROUTER_PROVIDER_NAME = "LLMRouter";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MODEL_PURPOSES, type ModelPurpose } from "
|
|
1
|
+
import { MODEL_PURPOSES, type ModelPurpose } from "@xiaozhiclaw/module-sdk/model-access";
|
|
2
2
|
import { type KeyConfig, type KeyHandle, type LoadBalanceStrategy, type PoolStatus, type ProviderPoolConfig } from "./key-pool.js";
|
|
3
3
|
export type RegistryChangeCallback = () => void;
|
|
4
4
|
export type ReasoningMode = "none" | "adaptive" | "collapsed" | "effort";
|
|
@@ -98,8 +98,6 @@ export interface ResolvedModel {
|
|
|
98
98
|
baseUrl?: string;
|
|
99
99
|
keyHandle: KeyHandle;
|
|
100
100
|
}
|
|
101
|
-
/** @deprecated Use MODEL_PURPOSES; retained as a compatibility alias. */
|
|
102
|
-
export declare const ALL_PURPOSES: ModelPurpose[];
|
|
103
101
|
export declare class ModelRegistry {
|
|
104
102
|
private keyPool;
|
|
105
103
|
private catalogProviders;
|
|
@@ -120,11 +118,11 @@ export declare class ModelRegistry {
|
|
|
120
118
|
peekActiveModel(purpose: ModelPurpose): ModelEntry | null;
|
|
121
119
|
/**
|
|
122
120
|
* Whether the model bound to `purpose` (default "chat") accepts the given input modality
|
|
123
|
-
* (e.g. "image").
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
*
|
|
121
|
+
* (e.g. "image"). Non-text input is forwarded natively only when the catalog explicitly declares
|
|
122
|
+
* that modality. Sparse metadata is not evidence that an arbitrary binary payload is accepted:
|
|
123
|
+
* treating it as multimodal can expand a small audio attachment into hundreds of thousands of
|
|
124
|
+
* prompt tokens before the Agent gets a chance to choose a file-processing Skill. Text remains the
|
|
125
|
+
* universal baseline; unknown media is handed to the projected media/file tools by the turn layer.
|
|
128
126
|
*/
|
|
129
127
|
acceptsInputModality(modality: string, purpose?: ModelPurpose): boolean;
|
|
130
128
|
isAvailable(purpose: ModelPurpose): boolean;
|
|
@@ -189,7 +187,6 @@ export declare class ModelRegistry {
|
|
|
189
187
|
getAllBindings(): Record<string, ModelEntry | null>;
|
|
190
188
|
getProviderStatus(providerId: string): PoolStatus | null;
|
|
191
189
|
getAllProviderStatus(): PoolStatus[];
|
|
192
|
-
save(): void;
|
|
193
190
|
load(): boolean;
|
|
194
191
|
exportConfig(): ModelRegistryConfig;
|
|
195
192
|
getTunable<T = unknown>(key: string): T | undefined;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Read-only
|
|
2
|
+
* Read-only ACP session Project projection.
|
|
3
3
|
*
|
|
4
4
|
* Gateway owns the durable registry and every lifecycle mutation. qlogicagent
|
|
5
|
-
*
|
|
5
|
+
* reads only the in-memory project identity projected by standard ACP inputs.
|
|
6
6
|
*/
|
|
7
|
-
import type
|
|
7
|
+
import { type AgentProjectInfo as ProjectInfo } from "./agent-project-projection.js";
|
|
8
8
|
export declare function listProjects(): ProjectInfo[];
|
|
9
9
|
export declare function getActiveProject(): ProjectInfo | null;
|
|
10
10
|
export declare function getDefaultProject(): ProjectInfo | null;
|
|
@@ -1,4 +1,51 @@
|
|
|
1
|
-
|
|
1
|
+
export interface SubagentStartedSnapshotInput {
|
|
2
|
+
parentTurnId: string;
|
|
3
|
+
subagentId: string;
|
|
4
|
+
agentType: string;
|
|
5
|
+
displayName?: string;
|
|
6
|
+
delegatedTask?: string;
|
|
7
|
+
mode?: "foreground" | "background";
|
|
8
|
+
startedAt?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface SubagentActivitySnapshotInput {
|
|
11
|
+
parentTurnId: string;
|
|
12
|
+
subagentId: string;
|
|
13
|
+
agentType: string;
|
|
14
|
+
displayName?: string;
|
|
15
|
+
activityId?: string;
|
|
16
|
+
toolName?: string;
|
|
17
|
+
conciseStatus: string;
|
|
18
|
+
status: "running" | "completed" | "failed" | "blocked";
|
|
19
|
+
observedAt: string;
|
|
20
|
+
}
|
|
21
|
+
export interface SubagentCompletedSnapshotInput {
|
|
22
|
+
parentTurnId: string;
|
|
23
|
+
subagentId: string;
|
|
24
|
+
agentType: string;
|
|
25
|
+
displayName?: string;
|
|
26
|
+
status: "completed" | "failed" | "cancelled";
|
|
27
|
+
toolsUsed?: string[];
|
|
28
|
+
resultSummary?: string;
|
|
29
|
+
evidence?: Array<{
|
|
30
|
+
source: "tool" | "artifact" | "verification";
|
|
31
|
+
label: string;
|
|
32
|
+
status: "passed" | "failed" | "observed";
|
|
33
|
+
}>;
|
|
34
|
+
durationMs?: number;
|
|
35
|
+
tokenUsage?: {
|
|
36
|
+
inputTokens: number;
|
|
37
|
+
outputTokens: number;
|
|
38
|
+
totalTokens: number;
|
|
39
|
+
};
|
|
40
|
+
error?: string;
|
|
41
|
+
finishedAt?: string;
|
|
42
|
+
}
|
|
43
|
+
export interface SubagentDecisionSnapshotInput {
|
|
44
|
+
parentTurnId: string;
|
|
45
|
+
subagentId: string;
|
|
46
|
+
decision: "adopted" | "partially_adopted" | "rejected";
|
|
47
|
+
summary?: string;
|
|
48
|
+
}
|
|
2
49
|
export interface PersistedSubagentSnapshot {
|
|
3
50
|
subagentId: string;
|
|
4
51
|
agentType: string;
|
|
@@ -15,18 +62,18 @@ export interface PersistedSubagentSnapshot {
|
|
|
15
62
|
}>;
|
|
16
63
|
toolsUsed?: string[];
|
|
17
64
|
resultSummary?: string;
|
|
18
|
-
evidence?:
|
|
65
|
+
evidence?: SubagentCompletedSnapshotInput["evidence"];
|
|
19
66
|
durationMs?: number;
|
|
20
|
-
tokenUsage?:
|
|
67
|
+
tokenUsage?: SubagentCompletedSnapshotInput["tokenUsage"];
|
|
21
68
|
decision?: "pending" | "adopted" | "partially_adopted" | "rejected";
|
|
22
69
|
decisionSummary?: string;
|
|
23
70
|
error?: string;
|
|
24
71
|
startedAt?: string;
|
|
25
72
|
finishedAt?: string;
|
|
26
73
|
}
|
|
27
|
-
export declare function recordSubagentStarted(payload:
|
|
28
|
-
export declare function recordSubagentActivity(payload:
|
|
29
|
-
export declare function recordSubagentCompleted(payload:
|
|
30
|
-
export declare function recordSubagentDecision(payload:
|
|
74
|
+
export declare function recordSubagentStarted(payload: SubagentStartedSnapshotInput): PersistedSubagentSnapshot;
|
|
75
|
+
export declare function recordSubagentActivity(payload: SubagentActivitySnapshotInput): PersistedSubagentSnapshot;
|
|
76
|
+
export declare function recordSubagentCompleted(payload: SubagentCompletedSnapshotInput): PersistedSubagentSnapshot;
|
|
77
|
+
export declare function recordSubagentDecision(payload: SubagentDecisionSnapshotInput): PersistedSubagentSnapshot | undefined;
|
|
31
78
|
export declare function subagentActivityBlock(snapshot: PersistedSubagentSnapshot): Record<string, unknown>;
|
|
32
79
|
export declare function clearSubagentTurnSnapshotsForTests(): void;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Task Runtime — CC framework.ts parity.
|
|
3
3
|
*
|
|
4
4
|
* Manages task lifecycle: creation, state updates, completion, cleanup.
|
|
5
|
-
* All task types
|
|
5
|
+
* All background task types use this framework.
|
|
6
6
|
*
|
|
7
7
|
* CC equivalent: src/utils/task/framework.ts + src/Task.ts
|
|
8
8
|
*
|
|
@@ -36,8 +36,6 @@ export interface StreamingToolExecutorPortConfig {
|
|
|
36
36
|
maxConcurrentTools?: number;
|
|
37
37
|
maxExecutionMs?: number;
|
|
38
38
|
executionTimeoutMsByTool?: ReadonlyMap<string, number>;
|
|
39
|
-
/** Turn workspace/cwd — routes oversized tool-result spillover to the session's reachable data dir. */
|
|
40
|
-
projectRoot?: string;
|
|
41
39
|
/** Opaque per-turn tool-result context budget state. */
|
|
42
40
|
contextState?: unknown;
|
|
43
41
|
}
|
|
@@ -53,7 +51,7 @@ export interface ToolLoopRuntimePorts {
|
|
|
53
51
|
role: string;
|
|
54
52
|
content?: string | unknown;
|
|
55
53
|
tool_call_id?: string;
|
|
56
|
-
}>, state: unknown, sessionId: string
|
|
54
|
+
}>, state: unknown, sessionId: string): Promise<{
|
|
57
55
|
messages: unknown[];
|
|
58
56
|
newlyReplacedCount: number;
|
|
59
57
|
newlyPersistedBytes?: number;
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
export type { MemoryExtractionQueue, MemoryWriter, MemoryWriteMetadata, } from "./memory-writer.js";
|
|
2
|
-
export type { MemoryRecallSource } from "./memory-recall-source.js";
|
|
3
|
-
export type { MemoryProvider, MemorySearchOptions, MemorySearchResult, MemoryIngestOptions, MemoryExtractionItem, MemoryConsolidationWriteResult, MemoryLearningSink, MemoryActivitySummary, MemoryAtlasRecord, MemoryAtlasResult, MemoryUpdatePatch, MemoryHandlerProvider, MemoryDreamProvider, MemoryDecayProvider, MemoryRuntimeHookProvider, MemoryDreamRuntimeProvider, } from "./memory-provider.js";
|
|
4
1
|
export type { PathService } from "./path-service.js";
|
|
5
2
|
export type { ConfigPort } from "./config-port.js";
|
|
6
3
|
export { createRecordConfigPort } from "./config-port.js";
|
|
7
4
|
export { PERMISSION_MODES, } from "./permission-contracts.js";
|
|
8
5
|
export type { ApprovalRequest, ApprovalResponse, PermissionApprovalResolver, PermissionBehavior, PermissionConfig, PermissionDecisionReason, PermissionEngineConfig, PermissionMetadataResolver, PermissionMode, PermissionRiskLevel, PermissionResult, PermissionRuleEnginePort, PermissionRuleEntry, ToolPermissionCheckInput, } from "./permission-contracts.js";
|
|
9
|
-
export type { ProjectMemoryFileInfo, ProjectMemoryResult, ProjectMemoryStore, ProjectMemoryStoreFactory, } from "./project-memory-store.js";
|
|
10
6
|
export type { RuntimeToolContract, ToolBootstrap, ToolBootstrapConfig, ToolBootstrapProvider, ToolBootstrapProviderContext, ToolBootstrapProgress, ToolCatalog, ToolRegistrationModule, ToolRegistrationModuleKind, } from "./tool-contracts.js";
|
|
11
7
|
export { defineToolRegistrationModule } from "./tool-contracts.js";
|
|
12
8
|
export { buildToolResultMessage, type OpenAiToolCall, type ToolResultMessageInput } from "./tool-call-contracts.js";
|
|
@@ -6,8 +6,7 @@ export interface PathService {
|
|
|
6
6
|
* paths resolve and the shell session's cwd lives). This is the value last set
|
|
7
7
|
* via setActiveWorkdir — it is the authoritative "active workdir" used by the
|
|
8
8
|
* permission pipeline to classify cross-workspace operations. It can differ
|
|
9
|
-
* from getActiveProjectRoot()
|
|
10
|
-
* getActiveProjectRoot may be a captured snapshot, while this always tracks the
|
|
9
|
+
* from getActiveProjectRoot(), which may be a captured project snapshot while this tracks the
|
|
11
10
|
* live tool workdir. Falls back to getActiveProjectRoot() if never set.
|
|
12
11
|
*/
|
|
13
12
|
getActiveWorkdir(): string;
|
|
@@ -15,15 +14,8 @@ export interface PathService {
|
|
|
15
14
|
resolveActiveOwnerUserId(): string;
|
|
16
15
|
getUserAgentHome(): string;
|
|
17
16
|
getOwnerProfileDir(ownerUserId?: string): string;
|
|
18
|
-
getProfileMemoryDir(ownerUserId?: string): string;
|
|
19
17
|
getUserSettingsPath(): string;
|
|
20
|
-
getUserPluginsDir(): string;
|
|
21
|
-
getUserPluginCacheDir(): string;
|
|
22
|
-
getUserMarketplaceConfigPath(): string;
|
|
23
18
|
getProjectAgentDir(projectRoot?: string): string;
|
|
24
|
-
getProjectSettingsPath(projectRoot?: string): string;
|
|
25
19
|
getProjectInstructionsPath(projectRoot?: string): string;
|
|
26
|
-
getProjectPluginsDir(projectRoot?: string): string;
|
|
27
20
|
getProjectRulesDir(projectRoot?: string): string;
|
|
28
|
-
getProjectSessionDataRoot(projectIdOrWorkspaceDir?: string): string;
|
|
29
21
|
}
|
|
@@ -71,7 +71,6 @@ export interface ToolBootstrapConfig {
|
|
|
71
71
|
getTaskScopeKey?(): string | undefined;
|
|
72
72
|
getCurrentTurnId?(): string | undefined;
|
|
73
73
|
isGroupSecurityMode?(): boolean;
|
|
74
|
-
sendNotification?(method: string, params: Record<string, unknown>): void;
|
|
75
74
|
onExecProgress?(progress: ToolBootstrapProgress): void;
|
|
76
75
|
/** Lazy host-owned tunable overrides; web registration must not call it until first invoke. */
|
|
77
76
|
loadTunableOverrides?(): Promise<Record<string, unknown>>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bounded Agent-local view of Host-owned session input.
|
|
3
|
+
*
|
|
4
|
+
* The Host owns canonical session identity, history and durable state. The
|
|
5
|
+
* adapter keys this ephemeral view by its own native ACP session ID so a Host
|
|
6
|
+
* restart/resume can project canonical history without creating a second
|
|
7
|
+
* session authority.
|
|
8
|
+
*/
|
|
9
|
+
import type { AgentHostTurnContextV1 } from "@xiaozhiclaw/module-sdk";
|
|
10
|
+
import type { ChatMessage } from "../../protocol/wire/index.js";
|
|
11
|
+
import type { SessionUsageSnapshot } from "./session-state.js";
|
|
12
|
+
export interface AgentSessionProjectionMetadata {
|
|
13
|
+
nativeSessionId: string;
|
|
14
|
+
projectId: string;
|
|
15
|
+
createdAt: string;
|
|
16
|
+
lastActiveAt: string;
|
|
17
|
+
turnCount: number;
|
|
18
|
+
messageCount: number;
|
|
19
|
+
model?: string;
|
|
20
|
+
cwd?: string;
|
|
21
|
+
totalInputTokens?: number;
|
|
22
|
+
totalOutputTokens?: number;
|
|
23
|
+
}
|
|
24
|
+
export interface AgentSessionProjection {
|
|
25
|
+
metadata: AgentSessionProjectionMetadata;
|
|
26
|
+
messages: ChatMessage[];
|
|
27
|
+
}
|
|
28
|
+
/** Replace one native session view with the exact Host-owned turn context. */
|
|
29
|
+
export declare function materializeAgentSessionProjection(context: AgentHostTurnContextV1, nativeSessionId: string): void;
|
|
30
|
+
export declare function disposeAgentSessionProjection(nativeSessionId: string): void;
|
|
31
|
+
/** Test/process teardown only. */
|
|
32
|
+
export declare function resetAgentSessionProjections(): void;
|
|
33
|
+
export declare function readAgentSessionProjection(nativeSessionId: string): AgentSessionProjection | null;
|
|
34
|
+
/** Merge Host-owned prior history with the current ACP prompt without creating another store. */
|
|
35
|
+
export declare function mergeAgentSessionHistory(history: readonly ChatMessage[], current: readonly ChatMessage[]): ChatMessage[];
|
|
36
|
+
/** Update usage and routing metadata in the bounded in-memory projection. */
|
|
37
|
+
export declare function recordAgentSessionSnapshot(nativeSessionId: string, usageSnapshot: SessionUsageSnapshot, metadata: Pick<AgentSessionProjectionMetadata, "model" | "cwd" | "projectId" | "messageCount">): void;
|