qlogicagent 2.19.1 → 2.19.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/dist/agent-contract.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/host-contract.js +1 -1
- package/dist/host-session-collection-contract.js +1 -0
- package/dist/index.js +478 -505
- package/dist/pet-host.js +8 -8
- package/dist/project-memory-host.js +23 -23
- package/dist/protocol.js +1 -1
- package/dist/types/cli/acp-commands.d.ts +1 -1
- package/dist/types/cli/acp-extended-handlers.d.ts +2 -8
- package/dist/types/cli/acp-extended-host-adapter.d.ts +0 -11
- package/dist/types/cli/acp-session-host.d.ts +2 -0
- package/dist/types/cli/core-tool-coordinator.d.ts +0 -9
- package/dist/types/cli/default-project-bootstrap.d.ts +2 -32
- package/dist/types/cli/handlers/session-handler.d.ts +0 -43
- package/dist/types/cli/handlers/solo-handler.d.ts +3 -14
- package/dist/types/cli/multi-agent-handler-host.d.ts +3 -16
- package/dist/types/cli/product-coordinator.d.ts +3 -14
- package/dist/types/cli/rpc-registry.d.ts +0 -2
- package/dist/types/cli/stdio-rpc-handler-hosts.d.ts +4 -1
- package/dist/types/cli/stdio-server.d.ts +1 -2
- package/dist/types/host-contract/index.d.ts +110 -18
- package/dist/types/host-session-collection-contract.d.ts +61 -0
- package/dist/types/orchestration/agent-instance.d.ts +4 -11
- package/dist/types/orchestration/agent-roster.d.ts +4 -4
- package/dist/types/orchestration/delegate-bridge.d.ts +8 -0
- package/dist/types/orchestration/goal-mode-adapters.d.ts +3 -3
- package/dist/types/orchestration/product-persistence.d.ts +0 -4
- package/dist/types/orchestration/product-planner.d.ts +4 -6
- package/dist/types/orchestration/solo-evaluator.d.ts +2 -5
- package/dist/types/orchestration/testing/delegate-test-bridge.d.ts +2 -1
- package/dist/types/orchestration/testing/host-agent-provider-directory-fixture.d.ts +7 -0
- package/dist/types/orchestration/workflow/qla-executor-host.d.ts +1 -1
- package/dist/types/protocol/agent-contract.d.ts +9 -3
- package/dist/types/protocol/methods.d.ts +20 -38
- package/dist/types/protocol/notifications.d.ts +1 -1
- package/dist/types/protocol/wire/acp-agent-management.d.ts +2 -190
- package/dist/types/protocol/wire/acp-protocol.d.ts +0 -4
- package/dist/types/protocol/wire/agent-methods.d.ts +1 -243
- package/dist/types/protocol/wire/gateway-rpc.d.ts +343 -15
- package/dist/types/protocol/wire/index.d.ts +3 -3
- package/dist/types/protocol/wire/notification-payloads.d.ts +48 -134
- package/dist/types/runtime/infra/host-agent-provider-directory.d.ts +17 -0
- package/dist/types/runtime/infra/project-authority-facade.d.ts +1 -1
- package/dist/types/runtime/infra/project-data-paths.d.ts +2 -1
- package/dist/types/runtime/infra/project-host-authority.d.ts +3 -2
- package/dist/types/runtime/infra/project-store.d.ts +4 -39
- package/dist/types/runtime/session/session-catalog.d.ts +0 -12
- package/dist/types/runtime/session/session-persistence.d.ts +1 -1
- package/dist/types/runtime/session/session-resource-key.d.ts +1 -1
- package/dist/types/runtime/session/session-types.d.ts +0 -23
- package/dist/types/transport/acp-server.d.ts +2 -10
- package/dist/workflow-host.js +10 -10
- package/package.json +8 -1
- package/dist/types/cli/agent-config-coordinator.d.ts +0 -27
- package/dist/types/cli/agent-config-runtime.d.ts +0 -11
- package/dist/types/cli/agent-status-notifier.d.ts +0 -11
- package/dist/types/cli/handlers/agents-handler.d.ts +0 -126
- package/dist/types/cli/handlers/project-handler.d.ts +0 -36
- package/dist/types/cli/project-command-service.d.ts +0 -28
- package/dist/types/orchestration/delegation-coordinator.d.ts +0 -100
- package/dist/types/runtime/infra/acp-detector.d.ts +0 -273
- package/dist/types/runtime/infra/agent-config-store.d.ts +0 -30
- package/dist/types/runtime/infra/agent-install-runner.d.ts +0 -80
- package/dist/types/runtime/infra/external-agent-approvals.d.ts +0 -59
- package/dist/types/runtime/infra/migrate-device-scope.d.ts +0 -49
- package/dist/types/runtime/infra/project-data-gc.d.ts +0 -15
- package/dist/types/runtime/session/native/claude-session-source.d.ts +0 -23
- package/dist/types/runtime/session/native/codex-index.d.ts +0 -21
- package/dist/types/runtime/session/native/codex-session-source.d.ts +0 -31
- package/dist/types/runtime/session/native/cwd-normalize.d.ts +0 -53
- package/dist/types/runtime/session/native/ephemeral-rollout-sweep.d.ts +0 -13
- package/dist/types/runtime/session/native/native-cwd-agents.d.ts +0 -17
- package/dist/types/runtime/session/native/native-session-source.d.ts +0 -89
- package/dist/types/runtime/session/native/native-title.d.ts +0 -1
- package/dist/types/runtime/session/native/register-builtin-sources.d.ts +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "qlogicagent",
|
|
3
|
-
"version": "2.19.
|
|
3
|
+
"version": "2.19.2",
|
|
4
4
|
"description": "XiaozhiClaw Agent CLI — subprocess architecture (JSON-RPC over stdio)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -60,6 +60,10 @@
|
|
|
60
60
|
"types": "./dist/types/host-contract/index.d.ts",
|
|
61
61
|
"default": "./dist/host-contract.js"
|
|
62
62
|
},
|
|
63
|
+
"./host-session-collection-contract": {
|
|
64
|
+
"types": "./dist/types/host-session-collection-contract.d.ts",
|
|
65
|
+
"default": "./dist/host-session-collection-contract.js"
|
|
66
|
+
},
|
|
63
67
|
"./plugin-marketplace-compute": {
|
|
64
68
|
"types": "./dist/types/skills/plugins/plugin-marketplace.d.ts",
|
|
65
69
|
"default": "./dist/plugin-marketplace-compute.js"
|
|
@@ -106,6 +110,9 @@
|
|
|
106
110
|
"host-contract": [
|
|
107
111
|
"./dist/types/host-contract/index.d.ts"
|
|
108
112
|
],
|
|
113
|
+
"host-session-collection-contract": [
|
|
114
|
+
"./dist/types/host-session-collection-contract.d.ts"
|
|
115
|
+
],
|
|
109
116
|
"plugin-marketplace-compute": [
|
|
110
117
|
"./dist/types/skills/plugins/plugin-marketplace.d.ts"
|
|
111
118
|
]
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { AgentConfigStore } from "../runtime/infra/agent-config-store.js";
|
|
2
|
-
import type { AcpDetector } from "../runtime/infra/acp-detector.js";
|
|
3
|
-
export interface AgentConfigCoordinatorDeps {
|
|
4
|
-
acpDetector: AcpDetector;
|
|
5
|
-
getActiveProjectRoot(): string;
|
|
6
|
-
}
|
|
7
|
-
export declare function resolveLlmrouterPublicOrigin(rawBaseUrl?: string): string | undefined;
|
|
8
|
-
export declare function resolveLlmrouterProtocolBaseUrl(agentId: string, rawBaseUrl?: string): string | undefined;
|
|
9
|
-
export declare class AgentConfigCoordinator {
|
|
10
|
-
private readonly deps;
|
|
11
|
-
private store;
|
|
12
|
-
/** Last resolved managed text model (llmrouterModel), to detect primary-model switches. */
|
|
13
|
-
private lastLlmrouterModel;
|
|
14
|
-
constructor(deps: AgentConfigCoordinatorDeps);
|
|
15
|
-
get currentStore(): AgentConfigStore | null;
|
|
16
|
-
ensureStore(): Promise<AgentConfigStore>;
|
|
17
|
-
private syncKeySources;
|
|
18
|
-
/**
|
|
19
|
-
* When the managed text model (llmrouterModel) actually changes, pooled OpenAI-compat agents
|
|
20
|
-
* (codex/qwen/opencode) still hold the OLD OPENAI_MODEL baked at spawn. Evict the platform-model
|
|
21
|
-
* followers — managed (explicit「平台额度」) or auto, NOT explicit account/userKey BYO — so the next
|
|
22
|
-
* turn respawns on the new model. The model-switch analogue of the credential-switch eviction (Cut 6);
|
|
23
|
-
* busy turns settle first (handled inside evictPooledAgentsByAgentId). Runs per agents operation via
|
|
24
|
-
* syncKeySources, so a primary-model switch takes effect on the next message.
|
|
25
|
-
*/
|
|
26
|
-
private evictModelFollowersIfChanged;
|
|
27
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { AgentConfigStore } from "../runtime/infra/agent-config-store.js";
|
|
2
|
-
import type { AcpDetector } from "../runtime/infra/acp-detector.js";
|
|
3
|
-
export interface AgentConfigRuntime {
|
|
4
|
-
readonly currentStore: AgentConfigStore | null;
|
|
5
|
-
ensureStore(): Promise<AgentConfigStore>;
|
|
6
|
-
}
|
|
7
|
-
export interface AgentConfigRuntimeDeps {
|
|
8
|
-
acpDetector: AcpDetector;
|
|
9
|
-
getActiveProjectRoot(): string;
|
|
10
|
-
}
|
|
11
|
-
export declare function createAgentConfigRuntime(deps: AgentConfigRuntimeDeps): AgentConfigRuntime;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { AgentsStatusNotification } from "../protocol/notifications.js";
|
|
2
|
-
export interface AgentStatusExtra {
|
|
3
|
-
missedBeats?: number;
|
|
4
|
-
lastActivityAt?: number;
|
|
5
|
-
usage?: {
|
|
6
|
-
inputTokens: number;
|
|
7
|
-
outputTokens: number;
|
|
8
|
-
totalTokens: number;
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
export declare function createAgentStatusNotification(agentId: string, state: string, extra?: AgentStatusExtra): AgentsStatusNotification;
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Agents scan/config/gateway/processes/kill handlers — extracted from StdioServer.
|
|
3
|
-
* Handles: agents.scan, agents.list, agents.config, agents.setConfig, agents.getConfig,
|
|
4
|
-
* agents.removeConfig, agents.setGateway, agents.getGateway, agents.processes,
|
|
5
|
-
* agents.kill, agents.listConfigured, agents.getLog, agents.testConnection
|
|
6
|
-
*/
|
|
7
|
-
import { type AgentRpcError, type AgentRpcRequest } from "../../protocol/wire/index.js";
|
|
8
|
-
import type { AgentConfigStore } from "../../runtime/infra/agent-config-store.js";
|
|
9
|
-
import { type AcpDetector } from "../../runtime/infra/acp-detector.js";
|
|
10
|
-
import type { DelegateBridge } from "../../orchestration/delegation-coordinator.js";
|
|
11
|
-
import type { AgentDescriptor } from "../../protocol/wire/acp-agent-management.js";
|
|
12
|
-
export declare function refreshInstalledAgentDetection(detector: AcpDetector, agentId: string): Promise<{
|
|
13
|
-
descriptor: AgentDescriptor;
|
|
14
|
-
ready: boolean;
|
|
15
|
-
}>;
|
|
16
|
-
export interface AgentsHandlerHost {
|
|
17
|
-
acpDetector: AcpDetector;
|
|
18
|
-
ensureAgentConfigStore(): Promise<AgentConfigStore>;
|
|
19
|
-
getActiveProjectRoot?(): string;
|
|
20
|
-
handleMcpToolCall?(memberId: string, tool: string, args: Record<string, unknown>): Promise<unknown>;
|
|
21
|
-
log?(message: string): void;
|
|
22
|
-
sendResponse(id: string | number, result?: unknown, error?: AgentRpcError): void;
|
|
23
|
-
sendNotification?(method: string, params: Record<string, unknown>): void;
|
|
24
|
-
/** 激活层(S3c §1.1):gateway-routed delegate 桥(懒读;未挂/gate 关 = undefined → 旧进程池路径)。 */
|
|
25
|
-
getDelegateBridge?(): DelegateBridge | undefined;
|
|
26
|
-
}
|
|
27
|
-
interface PooledTurnCtx {
|
|
28
|
-
sessionId?: string;
|
|
29
|
-
turnId?: string;
|
|
30
|
-
requestId?: string;
|
|
31
|
-
deltas: string[];
|
|
32
|
-
streamedAny: boolean;
|
|
33
|
-
}
|
|
34
|
-
export declare function relayPooledTurnNotification(input: {
|
|
35
|
-
agentId: string;
|
|
36
|
-
turn: PooledTurnCtx | null;
|
|
37
|
-
method: string;
|
|
38
|
-
payload: unknown;
|
|
39
|
-
sendNotification?: (method: string, params: Record<string, unknown>) => void;
|
|
40
|
-
}): void;
|
|
41
|
-
/** Resolve a pending external-agent approval with the user's decision (delivered by the gateway). */
|
|
42
|
-
export declare function handleAgentsApprovalResponse(this: AgentsHandlerHost, msg: AgentRpcRequest): Promise<void>;
|
|
43
|
-
export declare function handleAgentsScan(this: AgentsHandlerHost, msg: AgentRpcRequest): Promise<void>;
|
|
44
|
-
export declare function handleAgentsList(this: AgentsHandlerHost, msg: AgentRpcRequest): Promise<void>;
|
|
45
|
-
/**
|
|
46
|
-
* Curated Discover-Agent catalog (12 agents) merged with live install status, for the
|
|
47
|
-
* discover grid. Status comes from the detector; install carries the official command
|
|
48
|
-
* summary + source for the confirm dialog (no secrets).
|
|
49
|
-
*/
|
|
50
|
-
export declare function handleAgentsCatalog(this: AgentsHandlerHost, msg: AgentRpcRequest): Promise<void>;
|
|
51
|
-
export declare function handleAgentsCheckUpdates(this: AgentsHandlerHost, msg: AgentRpcRequest): Promise<void>;
|
|
52
|
-
/**
|
|
53
|
-
* One-click install a catalog agent by id. Runs ONLY the official command from the
|
|
54
|
-
* catalog manifest (never a free-form command), streaming progress via the
|
|
55
|
-
* agent.install.progress notification, then refreshes detection. Returns the outcome.
|
|
56
|
-
*/
|
|
57
|
-
export declare function handleAgentsInstall(this: AgentsHandlerHost, msg: AgentRpcRequest): Promise<void>;
|
|
58
|
-
/**
|
|
59
|
-
* Open an OS terminal running an agent's interactive login/setup command (e.g. `kimi login`,
|
|
60
|
-
* `hermes acp --setup`). Lowers the barrier for own-store/oauth agents that can't be driven via
|
|
61
|
-
* injected credentials — the user completes the CLI's native login without leaving the app. The
|
|
62
|
-
* command is resolved server-side from the catalog (fixed string, no user input → no injection).
|
|
63
|
-
*/
|
|
64
|
-
export declare function handleAgentsRunSetup(this: AgentsHandlerHost, msg: AgentRpcRequest): Promise<void>;
|
|
65
|
-
export declare function handleAgentsConfig(this: AgentsHandlerHost, msg: AgentRpcRequest): Promise<void>;
|
|
66
|
-
export declare function handleAgentsSetConfig(this: AgentsHandlerHost, msg: AgentRpcRequest): Promise<void>;
|
|
67
|
-
export declare function handleAgentsGetConfig(this: AgentsHandlerHost, msg: AgentRpcRequest): Promise<void>;
|
|
68
|
-
export declare function handleAgentsRemoveConfig(this: AgentsHandlerHost, msg: AgentRpcRequest): Promise<void>;
|
|
69
|
-
/**
|
|
70
|
-
* Log out / switch account for an `account`-mode agent: clear the CLI's own native credential store
|
|
71
|
-
* (where we know it — e.g. codex's ~/.codex/auth.json) and invalidate the resident pool so the next
|
|
72
|
-
* turn re-evaluates auth (and re-prompts login). For agents whose store we don't manage, returns a
|
|
73
|
-
* hint to run the CLI's own `logout`. "Switch account" = logout, then log in again.
|
|
74
|
-
*/
|
|
75
|
-
export declare function handleAgentsLogout(this: AgentsHandlerHost, msg: AgentRpcRequest): Promise<void>;
|
|
76
|
-
export declare function handleAgentsSetGateway(this: AgentsHandlerHost, msg: AgentRpcRequest): Promise<void>;
|
|
77
|
-
export declare function handleAgentsGetGateway(this: AgentsHandlerHost, msg: AgentRpcRequest): Promise<void>;
|
|
78
|
-
export declare function handleAgentsListConfigured(this: AgentsHandlerHost, msg: AgentRpcRequest): Promise<void>;
|
|
79
|
-
export declare function handleAgentsGetLog(this: AgentsHandlerHost, msg: AgentRpcRequest): Promise<void>;
|
|
80
|
-
export declare function handleAgentsTestConnection(this: AgentsHandlerHost, msg: AgentRpcRequest): Promise<void>;
|
|
81
|
-
/** Formats a session persisted transcript into a compact prior-conversation block for an external
|
|
82
|
-
* ACP agent that was cold-spawned (fresh process, empty session). Mirrors the built-in agent
|
|
83
|
-
* withResumedHistory: the engine on-disk history is authoritative, so we re-supply it and the agent
|
|
84
|
-
* regains full context after a restart/eviction. Only user/assistant text turns are included;
|
|
85
|
-
* returns "" when there is no prior history (e.g. the first turn of a new session). */
|
|
86
|
-
export declare function buildExternalHistoryPreamble(messages: Array<{
|
|
87
|
-
role: string;
|
|
88
|
-
content: unknown;
|
|
89
|
-
}>): string;
|
|
90
|
-
/** Wraps the owner-level global memory cheat sheet (preferences/boundaries) for an external
|
|
91
|
-
* agent's cold open. Third-party agents (codex/claude/...) run their own brains and never see
|
|
92
|
-
* our per-turn memory channel — without this, a user's standing preferences vanish the moment
|
|
93
|
-
* they switch agents. Injection frequency is ONCE PER PROCESS CONTEXT: it rides the same
|
|
94
|
-
* cold-spawn moment that (re)builds the agent's context (first turn of a session, or a respawn
|
|
95
|
-
* after restart/eviction — where the full history is re-sent anyway), and never on warm turns.
|
|
96
|
-
* That is the floor for a stateless external process, not a per-message tax. Size is capped by
|
|
97
|
-
* readUserIndexForPrompt itself (2048 chars / 40 lines, visible truncation marker). */
|
|
98
|
-
export declare function buildExternalMemoryPreamble(globalIndex: string | null): string;
|
|
99
|
-
/**
|
|
100
|
-
* Decide how a native-cwd session resumes on a COLD spawn, and whether that resume already carries
|
|
101
|
-
* our injected global memory sheet (so the caller can skip re-injecting it). Pure given its inputs.
|
|
102
|
-
*
|
|
103
|
-
* - BINDING resume (a `nativeBinding.nativeSessionId` persisted by a prior app turn): that prior
|
|
104
|
-
* turn injected the sheet into the prompt codex/claude recorded in its OWN rollout, so the
|
|
105
|
-
* restored context carries it → resumedFromBinding=true (skip re-inject).
|
|
106
|
-
* - LAZY-MIGRATION resume (no binding yet, but the canonical id exists in the native store — a
|
|
107
|
-
* session the user may have started in codex/claude directly): its rollout has NEVER seen our
|
|
108
|
-
* sheet → resumedFromBinding=false (inject once; after this turn the binding persists and
|
|
109
|
-
* subsequent resumes take the binding branch, injecting exactly once total).
|
|
110
|
-
* - Neither (brand-new session): no resume → inject as a normal cold open.
|
|
111
|
-
*
|
|
112
|
-
* Conflating binding with lazy-migration (resume===bound) silently starves migrated sessions of the
|
|
113
|
-
* user's preferences — the whole point of the injection is that they follow the user across agents.
|
|
114
|
-
*/
|
|
115
|
-
export declare function resolveNativeColdResume(input: {
|
|
116
|
-
sessionId: string;
|
|
117
|
-
boundNativeSessionId: string | undefined;
|
|
118
|
-
nativeSessionExists: () => Promise<boolean>;
|
|
119
|
-
}): Promise<{
|
|
120
|
-
effectiveResume: string | undefined;
|
|
121
|
-
resumedFromBinding: boolean;
|
|
122
|
-
}>;
|
|
123
|
-
/** Pre-warm an external agent's process (on agent-select) so the first message skips the cold start. */
|
|
124
|
-
export declare function handleAgentsWarm(this: AgentsHandlerHost, msg: AgentRpcRequest): Promise<void>;
|
|
125
|
-
export declare function handleAgentsPrompt(this: AgentsHandlerHost, msg: AgentRpcRequest): Promise<void>;
|
|
126
|
-
export {};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Project CRUD handlers extracted from StdioServer.
|
|
3
|
-
* Handles: project.create, project.list, project.delete, project.rename,
|
|
4
|
-
* project.archive, project.unarchive
|
|
5
|
-
*/
|
|
6
|
-
import { type AgentRpcError, type AgentRpcRequest } from "../../protocol/wire/index.js";
|
|
7
|
-
import type { ProjectMemoryStore, ProjectMemoryStoreFactory } from "../../runtime/ports/index.js";
|
|
8
|
-
export interface ProjectHandlerHost {
|
|
9
|
-
memdir: ProjectMemoryStore | null;
|
|
10
|
-
projectMemoryStoreFactory: ProjectMemoryStoreFactory;
|
|
11
|
-
mediaPersistence: {
|
|
12
|
-
setProjectDir(projectDir: string): void;
|
|
13
|
-
releaseProjectDir?(projectDir: string): void;
|
|
14
|
-
};
|
|
15
|
-
getActiveProjectRoot(): string;
|
|
16
|
-
setActiveWorkdir(dir: string): void;
|
|
17
|
-
sendNotification(method: string, params: Record<string, unknown>): void;
|
|
18
|
-
sendResponse(id: string | number, result?: unknown, error?: AgentRpcError): void;
|
|
19
|
-
}
|
|
20
|
-
export declare function handleProjectCreate(this: ProjectHandlerHost, msg: AgentRpcRequest): Promise<void>;
|
|
21
|
-
export declare function handleProjectList(this: ProjectHandlerHost, msg: AgentRpcRequest): void;
|
|
22
|
-
export declare function handleProjectSwitch(this: ProjectHandlerHost, msg: AgentRpcRequest): Promise<void>;
|
|
23
|
-
/**
|
|
24
|
-
* Reliable recursive directory removal for Windows. fs.rmSync({recursive,force}) cannot be trusted
|
|
25
|
-
* here: on git repos it silently leaves read-only object/pack files (and whole subtrees) behind
|
|
26
|
-
* without throwing. This walks bottom-up, clearing the read-only attribute (chmod) on the EPERM
|
|
27
|
-
* retry, which deletes git worktrees/repos cleanly. Per-entry failures (e.g. a live EBUSY lock) are
|
|
28
|
-
* swallowed; the caller verifies via existsSync and decides success/retry.
|
|
29
|
-
*/
|
|
30
|
-
export declare function rmDirRobustSync(target: string): void;
|
|
31
|
-
export declare function handleProjectDelete(this: ProjectHandlerHost, msg: AgentRpcRequest): void;
|
|
32
|
-
export declare function handleProjectPurgeAll(this: ProjectHandlerHost, msg: AgentRpcRequest): void;
|
|
33
|
-
export declare function handleProjectRename(this: ProjectHandlerHost, msg: AgentRpcRequest): void;
|
|
34
|
-
export declare function handleProjectArchive(this: ProjectHandlerHost, msg: AgentRpcRequest): void;
|
|
35
|
-
export declare function handleProjectUnarchive(this: ProjectHandlerHost, msg: AgentRpcRequest): void;
|
|
36
|
-
export declare function handleProjectUpdate(this: ProjectHandlerHost, msg: AgentRpcRequest): void;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { ProjectInfo } from "../protocol/methods.js";
|
|
2
|
-
import type { ProjectMemoryStore, ProjectMemoryStoreFactory } from "../runtime/ports/index.js";
|
|
3
|
-
export interface ProjectCommandHost {
|
|
4
|
-
memdir: ProjectMemoryStore | null;
|
|
5
|
-
projectMemoryStoreFactory: ProjectMemoryStoreFactory;
|
|
6
|
-
mediaPersistence: {
|
|
7
|
-
setProjectDir(projectDir: string): void;
|
|
8
|
-
};
|
|
9
|
-
setActiveWorkdir(dir: string): void;
|
|
10
|
-
}
|
|
11
|
-
export interface ProjectCreateCommand {
|
|
12
|
-
name: string;
|
|
13
|
-
workspaceDir?: string;
|
|
14
|
-
type?: string;
|
|
15
|
-
groupId?: string;
|
|
16
|
-
}
|
|
17
|
-
export interface ProjectCreateResult {
|
|
18
|
-
project: ProjectInfo;
|
|
19
|
-
nameDuplicate?: ProjectInfo;
|
|
20
|
-
isAgentTeamProject: boolean;
|
|
21
|
-
/** True when creation switched the active project (container types never switch). */
|
|
22
|
-
autoSwitched: boolean;
|
|
23
|
-
deduplicated?: boolean;
|
|
24
|
-
}
|
|
25
|
-
type ProjectPlanStatus = NonNullable<ProjectInfo["planStatus"]>;
|
|
26
|
-
export declare function isProjectPlanStatus(value: unknown): value is ProjectPlanStatus;
|
|
27
|
-
export declare function createProject(host: ProjectCommandHost, command: ProjectCreateCommand): Promise<ProjectCreateResult>;
|
|
28
|
-
export {};
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import type { ProductOrchestrator } from "./agent-instance.js";
|
|
2
|
-
import type { DelegateRequestParams, SupervisorEventSink, TurnResult } from "../host-contract/index.js";
|
|
3
|
-
/**
|
|
4
|
-
* 激活层(S3c):gateway-routed delegate 传输桥(解耦接口;wire 从 AcpServer.delegate/supportsDelegate 供)。
|
|
5
|
-
* hostSupportsDelegate(=gateway 在 initialize 声明 delegate 能力位)时,run() 改走此桥:leader 请网关代派
|
|
6
|
-
* worker 回合(x/delegate),事件回流经 sink,resolve 统一 TurnResult —— 不再 ProductOrchestrator.create
|
|
7
|
-
* 本地 spawn。gate 关(gateway 未声明)= isSupported()=false = 旧路径保留(单轨,zero-regression)。
|
|
8
|
-
*/
|
|
9
|
-
export interface DelegateBridge {
|
|
10
|
-
/** T9:gateway 声明 delegate 能力才放行(否则旧 ProcessManager/Orchestrator 路径)。 */
|
|
11
|
-
isSupported(): boolean;
|
|
12
|
-
/** 上行 x/delegate(resolve TurnResult;回流事件经 sink)。 */
|
|
13
|
-
send(params: DelegateRequestParams, sink: SupervisorEventSink): Promise<TurnResult>;
|
|
14
|
-
/** x/delegate.cancel(取消回合,不杀进程;rec.abort 触发时调)。 */
|
|
15
|
-
cancel(delegationId: string): void;
|
|
16
|
-
/**
|
|
17
|
-
* x/delegate.respond(leader 来源审批应答,通知 fire-and-forget;optionId 不透明透传 E2)。
|
|
18
|
-
* 站点收到 sink.onApprovalRequest 后按用户/策略决议经此应答(chat 站 §1.1 审批往返;
|
|
19
|
-
* gateway 侧 delegate-server → supervisor.respondApproval,freeze §11 补遗#3 唯一应答口)。
|
|
20
|
-
*/
|
|
21
|
-
respond(delegationId: string, approvalId: string, optionId: string): void;
|
|
22
|
-
}
|
|
23
|
-
export interface DelegationNotify {
|
|
24
|
-
(method: string, payload: Record<string, unknown>): void;
|
|
25
|
-
}
|
|
26
|
-
export interface DelegationDeps {
|
|
27
|
-
orchestrator: ProductOrchestrator;
|
|
28
|
-
cwd: string;
|
|
29
|
-
notify: DelegationNotify;
|
|
30
|
-
log?: {
|
|
31
|
-
info(m: string): void;
|
|
32
|
-
warn(m: string): void;
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* 激活层(S3c):gateway-routed delegate 传输 + 会话上下文(可选;缺省 = 旧 ProductOrchestrator 路径)。
|
|
36
|
-
* bridge.isSupported()=true(gateway 声明 delegate 能力位)时,run() 改走 gateway 代派 worker;否则旧路径。
|
|
37
|
-
* projectId = deriveProjectId(cwd)(wire 供,避免 coordinator import agent-paths;单轨解析权威在会话面)。
|
|
38
|
-
*/
|
|
39
|
-
delegate?: {
|
|
40
|
-
bridge: DelegateBridge;
|
|
41
|
-
projectId: string;
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
type DelegationStatus = "running" | "completed" | "failed" | "cancelled" | "timed_out";
|
|
45
|
-
export declare class DelegationCoordinator {
|
|
46
|
-
private readonly deps;
|
|
47
|
-
private readonly active;
|
|
48
|
-
/** Per-(chat×agent) tail promise — the next same-conversation delegation chains after it so they run
|
|
49
|
-
* strictly sequentially (single writer to the shared reused worktree + native session). One entry per
|
|
50
|
-
* active (chat×agent) pair (keyed, overwritten — not per-delegation), so it stays bounded. */
|
|
51
|
-
private readonly convChains;
|
|
52
|
-
/** Per-(chat×agent) native (codex/claude) session id — the background analogue of the foreground U5
|
|
53
|
-
* convergence. Seeded from the first delegation's captured session id; passed as resumeNativeSessionId on
|
|
54
|
-
* every subsequent same-conversation delegation so context accumulates (git AND non-git projects).
|
|
55
|
-
* In-memory (one entry per active pair); an engine restart resets it → the next delegation starts fresh,
|
|
56
|
-
* same as a cold foreground turn whose pool was evicted. */
|
|
57
|
-
private readonly nativeSessions;
|
|
58
|
-
constructor(deps: DelegationDeps);
|
|
59
|
-
/** Active + recent delegations for this project (x/mention.list). */
|
|
60
|
-
list(): {
|
|
61
|
-
delegationId: string;
|
|
62
|
-
agentId: string;
|
|
63
|
-
brief: string;
|
|
64
|
-
status: DelegationStatus;
|
|
65
|
-
}[];
|
|
66
|
-
/** Cancel a running delegation — aborts the poll loop, which drains+kills the worker. */
|
|
67
|
-
cancel(delegationId: string): {
|
|
68
|
-
ok: boolean;
|
|
69
|
-
};
|
|
70
|
-
/**
|
|
71
|
-
* Dispatch ONE ad-hoc task to `agentId` in the background. Returns immediately with the delegationId;
|
|
72
|
-
* the lifecycle (started / settled) is reported via notify(mention.*). An unready/uninstalled agent
|
|
73
|
-
* surfaces as a `failed` settle (never a thrown RPC).
|
|
74
|
-
*/
|
|
75
|
-
delegate(agentId: string, brief: string, opts: {
|
|
76
|
-
canonicalSessionId: string;
|
|
77
|
-
acceptanceCriteria?: string;
|
|
78
|
-
delegationId?: string;
|
|
79
|
-
}): {
|
|
80
|
-
delegationId: string;
|
|
81
|
-
};
|
|
82
|
-
private run;
|
|
83
|
-
/**
|
|
84
|
-
* 激活层(S3c):gateway-routed delegate 路径 —— 不本地 spawn,请网关代派一个 worker 回合。
|
|
85
|
-
* leader 铸 delegationId(rec.delegationId 已是 `del-*`,承 Q4「leader 铸 + gateway 校验唯一」);
|
|
86
|
-
* 回流 sink 把 worker 工具活动转 mention.delegate_activity(live 进度),final 由 TurnResult 承。
|
|
87
|
-
* 与旧路径行为对齐:started/settled 通知、cancel 语义(rec.abort → x/delegate.cancel)、convChain 串行不变。
|
|
88
|
-
*
|
|
89
|
-
* native session 累积(跨同会话委派的 resume)在此路径由 gateway SessionProjectService.recordNativeSessionId
|
|
90
|
-
* 于 relay 观察点回填(freeze §11 补遗#2)—— coordinator 不再本地捕获 getDelegationNativeSessionId(单轨,权威上移)。
|
|
91
|
-
*/
|
|
92
|
-
private runViaDelegate;
|
|
93
|
-
/** Collect a delegation's produced artifacts: the union of the worktree diff (tasks[].changedFiles,
|
|
94
|
-
* omitted by the wire type but carried at runtime) and the mtime-isolated capture of project-root files
|
|
95
|
-
* (for workers that write straight to the workspace), plus the worker task + terminal phase. Shared by
|
|
96
|
-
* the normal terminal path AND the timeout path, so a timed-out run still hands back its partial output. */
|
|
97
|
-
private collectProducts;
|
|
98
|
-
private settle;
|
|
99
|
-
}
|
|
100
|
-
export {};
|
|
@@ -1,273 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ACP Agent Detector — scans PATH for installed ACP-compatible CLI agents.
|
|
3
|
-
*
|
|
4
|
-
* Uses `which` (Unix) / `where` (Windows) to locate CLI binaries,
|
|
5
|
-
* then optionally probes version. Results are cached with TTL.
|
|
6
|
-
*
|
|
7
|
-
* Reference: AionUI AcpDetector + ACP_BACKENDS_ALL registry.
|
|
8
|
-
*/
|
|
9
|
-
import type { AcpBackendConfig, AgentDescriptor, CustomAgentDef, AgentConfigStoreData, AuthPreference } from "../../protocol/wire/acp-agent-management.js";
|
|
10
|
-
export declare const ACP_BACKENDS: Record<string, AcpBackendConfig>;
|
|
11
|
-
export declare const AGENT_CATALOG_IDS: readonly ["claude", "codex", "gemini", "copilot", "cursor", "qwen", "kimi", "glm", "opencode", "kiro", "qoder", "openclaw", "hermes"];
|
|
12
|
-
/** Merged catalog entry (base ACP config + grid/install metadata) for one id. */
|
|
13
|
-
export declare function getCatalogEntry(id: string): AcpBackendConfig | undefined;
|
|
14
|
-
/** Ordered curated catalog: base ACP config merged with grid/install metadata. */
|
|
15
|
-
export declare function getAgentCatalog(): AcpBackendConfig[];
|
|
16
|
-
export declare function buildInternalAgentDescriptors(): AgentDescriptor[];
|
|
17
|
-
export declare function resolveWindowsCopilotLoader(): string | null;
|
|
18
|
-
export declare function getNpmInstallPackageName(command: string | undefined): string | null;
|
|
19
|
-
export declare function compareSemverVersions(a: string, b: string): number;
|
|
20
|
-
export declare function isVersionNewer(latest: string | null | undefined, current: string | null | undefined): boolean;
|
|
21
|
-
export declare function readGlobalNpmPackageVersion(packageName: string | null | undefined): string | null;
|
|
22
|
-
export declare function resolveInstalledNpmPackageVersionFromInstall(install: AcpBackendConfig["install"] | undefined): string | null;
|
|
23
|
-
export declare function getCatalogInstalledVersion(entry: AcpBackendConfig, detectedVersion?: string): string | undefined;
|
|
24
|
-
/** Resolve a package's latest published version via `npm view` (async + cached). Used by the background
|
|
25
|
-
* update check so N agents resolve concurrently (one `npm view` each) instead of blocking sequentially. */
|
|
26
|
-
export declare function fetchNpmLatestPackageVersionAsync(packageName: string | null | undefined, registry?: string): Promise<string | null>;
|
|
27
|
-
export interface CatalogUpdateInfo {
|
|
28
|
-
id: string;
|
|
29
|
-
packageName?: string;
|
|
30
|
-
installedVersion?: string;
|
|
31
|
-
latestVersion?: string;
|
|
32
|
-
updateAvailable: boolean;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Resolve latest-version / update-available info for the catalog's INSTALLED agents, all in PARALLEL
|
|
36
|
-
* (one concurrent `npm view` per package). Non-installed agents are skipped (nothing to update).
|
|
37
|
-
* Returns only entries where a latest version was resolved. Safe to call off the catalog hot path.
|
|
38
|
-
*/
|
|
39
|
-
export declare function getCatalogUpdateInfoAsync(entries: ReadonlyArray<{
|
|
40
|
-
id: string;
|
|
41
|
-
entry: AcpBackendConfig;
|
|
42
|
-
detectedVersion?: string;
|
|
43
|
-
}>, registry?: string): Promise<CatalogUpdateInfo[]>;
|
|
44
|
-
/**
|
|
45
|
-
* Synchronous, NETWORK-FREE update info read straight from the persisted cache (disk-seeded on first
|
|
46
|
-
* use). Returns immediately so the panel lights up last-known badges INSTANTLY — VS Code's gallery
|
|
47
|
-
* pattern — without waiting on `npm view`. `stale` is true when any installed package's cached "latest"
|
|
48
|
-
* is missing, errored, or older than the TTL; the caller then refreshes via getCatalogUpdateInfoAsync
|
|
49
|
-
* in the background, and the next call serves the fresh value.
|
|
50
|
-
*/
|
|
51
|
-
export declare function getCatalogUpdateInfoCached(entries: ReadonlyArray<{
|
|
52
|
-
id: string;
|
|
53
|
-
entry: AcpBackendConfig;
|
|
54
|
-
detectedVersion?: string;
|
|
55
|
-
}>, registry?: string): {
|
|
56
|
-
updates: CatalogUpdateInfo[];
|
|
57
|
-
stale: boolean;
|
|
58
|
-
};
|
|
59
|
-
export declare function normalizeWindowsAcpCommand(cliPath: string, args: string[]): {
|
|
60
|
-
cliPath: string;
|
|
61
|
-
acpArgs: string[];
|
|
62
|
-
};
|
|
63
|
-
/**
|
|
64
|
-
* Build the spawn env for an external ACP backend.
|
|
65
|
-
*
|
|
66
|
-
* Maps the agent-config's portable `apiKey`/`baseUrl` onto the backend-declared
|
|
67
|
-
* environment-variable names (`apiKeyEnvVar`/`baseUrlEnvVar`) so a user who only
|
|
68
|
-
* configures an API key + base URL (e.g. via agents.setConfig) actually drives the
|
|
69
|
-
* underlying CLI with a third-party OpenAI/Anthropic-compatible gateway — no official
|
|
70
|
-
* account login required. Without this mapping the backends declared the env-var names
|
|
71
|
-
* but nothing ever populated them.
|
|
72
|
-
*
|
|
73
|
-
* Precedence (lowest → highest), so explicit user input always wins:
|
|
74
|
-
* 1. backend.env (static backend defaults)
|
|
75
|
-
* 2. mapped apiKey/baseUrl (config.apiKey → backend.apiKeyEnvVar, etc.)
|
|
76
|
-
* 3. customConfig.env (raw env the user hand-entered)
|
|
77
|
-
*
|
|
78
|
-
* Injection is conditional: the apiKey/baseUrl mapping only fires when the backend
|
|
79
|
-
* actually declares the corresponding envVar name (so we never invent a var the CLI
|
|
80
|
-
* does not read). Returns undefined when there is nothing to inject, preserving the
|
|
81
|
-
* prior `env?: undefined` behavior for un-configured backends.
|
|
82
|
-
*/
|
|
83
|
-
export declare function buildBackendEnv(backend: AcpBackendConfig | undefined, customConfig: import("../../protocol/wire/acp-agent-management.js").AgentConfig | undefined, autoEnv?: Record<string, string>): Record<string, string> | undefined;
|
|
84
|
-
/** Unified key sources for login-free catalog injection (wired by the runtime). */
|
|
85
|
-
export interface CatalogKeySources {
|
|
86
|
-
/** Gateway-issued inference key (sk-qllm) for keySource:"llmrouter". */
|
|
87
|
-
llmrouterKey?: string;
|
|
88
|
-
/** Base URL an llmrouter-routed agent should call (our gateway endpoint). */
|
|
89
|
-
llmrouterBaseUrl?: string;
|
|
90
|
-
/** Resolve an agent/protocol-specific LLMRouter base URL. */
|
|
91
|
-
getLlmrouterBaseUrl?: (agentId: string, entry: AcpBackendConfig) => string | null | undefined;
|
|
92
|
-
/** Default LLMRouter model for agent CLIs that require an explicit model pin. */
|
|
93
|
-
llmrouterModel?: string;
|
|
94
|
-
/** Resolve a provider's direct third-party key for keySource:"direct". */
|
|
95
|
-
getDirectKey?: (providerId: string) => string | null | undefined;
|
|
96
|
-
/** The host's active text-generation model (deepseek / volcengine / …) to "pass through" to
|
|
97
|
-
* OpenAI-compatible spawned agents (codex/qwen/opencode) that resolve no key of their own — so
|
|
98
|
-
* they run on the configured key+baseUrl+model with zero per-agent credentials. */
|
|
99
|
-
passthroughModel?: {
|
|
100
|
-
apiKey: string;
|
|
101
|
-
baseUrl?: string;
|
|
102
|
-
model?: string;
|
|
103
|
-
};
|
|
104
|
-
/** Probe: does this agent have a usable native account/subscription login (e.g. ~/.codex/auth.json,
|
|
105
|
-
* present + not expired)? Drives `account`-mode readiness and `auto`'s account-first preference.
|
|
106
|
-
* Tri-state: true = detected login, false = probeable but not logged in (blocks readiness), undefined
|
|
107
|
-
* = no probe for this agent (treated as ready-if-installed; auto does NOT pick account). Wired in Cut 4. */
|
|
108
|
-
hasSubscription?: (agentId: string) => boolean | undefined;
|
|
109
|
-
}
|
|
110
|
-
/** Resolve the effective mode, coercing unsupported combinations (claude.account → auto). */
|
|
111
|
-
export declare function effectiveAuthPreference(entry: AcpBackendConfig, mode: AuthPreference): AuthPreference;
|
|
112
|
-
/**
|
|
113
|
-
* The credential-source modes the UI should offer for an agent (derived from catalog metadata, the
|
|
114
|
-
* single source of truth — spec §4.2/§8.2/§15). Never includes a permanently-dead option:
|
|
115
|
-
* - oauth / keyless (copilot/cursor/kimi/…): ["account"] only (no gateway endpoint to repoint)
|
|
116
|
-
* - claude (Anthropic bans subscription): ["managed","userKey"] — no account
|
|
117
|
-
* - codex (llmrouter + account-capable): ["account","userKey","managed"]
|
|
118
|
-
* - other llmrouter agents: ["userKey","managed"]
|
|
119
|
-
* - direct agents (qwen/glm/…): ["userKey"] (managed wiring for qwen/opencode is Cut 7)
|
|
120
|
-
*/
|
|
121
|
-
export declare function getAvailableAuthModes(entry: AcpBackendConfig): AuthPreference[];
|
|
122
|
-
/**
|
|
123
|
-
* Resolve the login-free key env for a catalog agent, honoring the per-agent `authPreference`.
|
|
124
|
-
* - "account" → {} (inject nothing; the spawn layer also deletes the forwarded key, see resolveSuppressEnvKeys)
|
|
125
|
-
* - "userKey" → the user's own provider key against the official endpoint (no gateway baseUrl/model)
|
|
126
|
-
* - "managed" → force the gateway sk-qllm + baseUrl (ignores any user key) — guarantees a first conversation
|
|
127
|
-
* - "auto" → ladder: user's own key (if present) → managed gateway → host-model passthrough
|
|
128
|
-
* oauth / keyless agents never get a key injected. Only emits env vars the backend declares.
|
|
129
|
-
*/
|
|
130
|
-
export declare function resolveCatalogKeyEnv(entry: AcpBackendConfig | undefined, sources: CatalogKeySources, mode?: AuthPreference): Record<string, string>;
|
|
131
|
-
/**
|
|
132
|
-
* Env var names the spawn layer must DELETE from the merged child env (account mode), so a
|
|
133
|
-
* forwarded/stale shell key cannot override the CLI's own native login. This is the load-bearing
|
|
134
|
-
* half of the §1.3 override-bug fix: buildBackendEnv alone cannot unset a whitelist-forwarded key.
|
|
135
|
-
* Returns [] when not in account mode (or the agent has no account path — claude is coerced to auto).
|
|
136
|
-
*/
|
|
137
|
-
export declare function resolveSuppressEnvKeys(entry: AcpBackendConfig | undefined, mode: AuthPreference, sources?: CatalogKeySources): string[];
|
|
138
|
-
/**
|
|
139
|
-
* Build a backend's descriptor from already-resolved cliPath/version (+ the caller-resolved
|
|
140
|
-
* hasConfig flag). Shared by AcpDetector's sync and async detection paths so they can never drift
|
|
141
|
-
* (status rules, copilot's version-required gate, etc.) — extracted to a standalone, IO-free, pure
|
|
142
|
-
* function (not a class method) so it is directly unit-testable without spawning a real CLI.
|
|
143
|
-
*
|
|
144
|
-
* sessionHistory (Task 1.2, third-party native session discovery): "native-cwd" only for an
|
|
145
|
-
* INSTALLED (status "available") codex or claude backend — the two agents whose native CWD-scoped
|
|
146
|
-
* session stores we've actually adapted to. Every other case — not-installed codex/claude, any other
|
|
147
|
-
* backend regardless of install state — falls back to "own". Unadapted agents ALWAYS get "own"; this
|
|
148
|
-
* is a hard invariant, not a default that later widens implicitly.
|
|
149
|
-
*/
|
|
150
|
-
export declare function assembleBackendDescriptor(backend: AcpBackendConfig, cliPath: string | null, version: string | null, hasConfig: boolean): AgentDescriptor;
|
|
151
|
-
/** Build a user-registered custom agent's descriptor. Extracted to a standalone, IO-free, pure
|
|
152
|
-
* function for the same testability reason as {@link assembleBackendDescriptor}. Custom agents are
|
|
153
|
-
* never adapted for native session discovery — regardless of what id/name the user gives them —
|
|
154
|
-
* so sessionHistory is always "own" (the hard own-by-default invariant). */
|
|
155
|
-
export declare function assembleCustomAgentDescriptor(custom: CustomAgentDef, cliPath: string | null, hasConfig: boolean): AgentDescriptor;
|
|
156
|
-
export declare class AcpDetector {
|
|
157
|
-
private cache;
|
|
158
|
-
/** Last scan that COMPLETED, surviving clearCache() and failed rescans. list() prefers this
|
|
159
|
-
* over an empty [] so a transient probe failure never reads as "no agents installed". */
|
|
160
|
-
private lastGoodScan;
|
|
161
|
-
private configStore;
|
|
162
|
-
private keySources;
|
|
163
|
-
/** Shared in-flight async scan so concurrent scanAsync() callers (startup warm + a racing RPC)
|
|
164
|
-
* collapse onto ONE scan instead of each spawning its own probe storm. Cleared when it settles. */
|
|
165
|
-
private scanInFlight;
|
|
166
|
-
private scanInFlightGeneration;
|
|
167
|
-
private cacheGeneration;
|
|
168
|
-
/**
|
|
169
|
-
* Provide the config store data so detector can populate `hasConfig` field
|
|
170
|
-
* and include user-registered custom agents.
|
|
171
|
-
*/
|
|
172
|
-
setConfigStore(data: AgentConfigStoreData): void;
|
|
173
|
-
/** Wire the unified key sources for login-free catalog injection. */
|
|
174
|
-
setKeySources(sources: CatalogKeySources): void;
|
|
175
|
-
/**
|
|
176
|
-
* Scan for installed ACP agent CLIs.
|
|
177
|
-
* @param force - Clear cache and re-scan.
|
|
178
|
-
*/
|
|
179
|
-
scan(force?: boolean): AgentDescriptor[];
|
|
180
|
-
/**
|
|
181
|
-
* Async, NON-BLOCKING twin of {@link scan}. Probes every backend CONCURRENTLY off the event loop
|
|
182
|
-
* (async `where`/`which` + version probes), so the engine's single-threaded loop keeps servicing
|
|
183
|
-
* ACP requests while detection runs — fixing the bug where a cold synchronous scan (11–18s here,
|
|
184
|
-
* 60s+ with more/slower CLIs) starved an already-dispatched `x/product.confirm` until it tripped
|
|
185
|
-
* the UI's 60s timeout. Populates the SAME cache as scan(), so a later sync list()/scan(false)
|
|
186
|
-
* returns instantly. Concurrent callers share one in-flight scan ({@link scanInFlight}).
|
|
187
|
-
*
|
|
188
|
-
* @param force - Bypass the fresh-cache short-circuit and re-probe.
|
|
189
|
-
*/
|
|
190
|
-
scanAsync(force?: boolean): Promise<AgentDescriptor[]>;
|
|
191
|
-
private runScanAsync;
|
|
192
|
-
/**
|
|
193
|
-
* Return cached results without IO. 冷缓存时后台预热(scanAsync)并返回 [],
|
|
194
|
-
* 绝不在 RPC 路径上同步 scan —— 同步探测(11-18s+)会饿死单线程引擎循环
|
|
195
|
-
* (x/product.confirm 60s 超时的根因)。调用方按"稍后再查"处理空列表。
|
|
196
|
-
*
|
|
197
|
-
* A background-scan failure is reported (console.error), never swallowed: a swallowed
|
|
198
|
-
* failure made list() return [] forever and downstream (product planning) treated
|
|
199
|
-
* "scan failed" as "no agents installed". When the fresh cache is gone but an older
|
|
200
|
-
* scan succeeded, that stale-but-real result is returned instead of [].
|
|
201
|
-
*/
|
|
202
|
-
list(): AgentDescriptor[];
|
|
203
|
-
/** Clear the detection cache. */
|
|
204
|
-
clearCache(): void;
|
|
205
|
-
private detectBackend;
|
|
206
|
-
/** Async, NON-BLOCKING twin of {@link detectBackend} — identical detection, async probes. */
|
|
207
|
-
private detectBackendAsync;
|
|
208
|
-
private detectCustomAgent;
|
|
209
|
-
/** Async, NON-BLOCKING twin of {@link detectCustomAgent}. */
|
|
210
|
-
private detectCustomAgentAsync;
|
|
211
|
-
private hasAgentConfig;
|
|
212
|
-
/**
|
|
213
|
-
* Descriptor for qlogicagent participating in Solo/Product as a self-hosted ACP agent.
|
|
214
|
-
*
|
|
215
|
-
* qlogicagent's own CLI speaks ACP by default (cli/main.ts: ACP server unless --no-acp), so a
|
|
216
|
-
* participant is just another `node <cli.js>` process. The child reads the SAME owner-profile
|
|
217
|
-
* settings.json (model-registry), so it runs with the configured provider (deepseek / volcengine /
|
|
218
|
-
* llmrouter) — that is how the configured model "passes through" to every qlogicagent instance,
|
|
219
|
-
* with no per-agent key. We forward the owner-profile + llmrouter env so the child resolves its
|
|
220
|
-
* model identically to this (host) process. This lets Solo run N independent qlogicagent sessions
|
|
221
|
-
* in parallel (each its own worktree) — the core "多个 qlogicagent = 多会话并行" use case.
|
|
222
|
-
*/
|
|
223
|
-
private buildSelfDescriptor;
|
|
224
|
-
/**
|
|
225
|
-
* Build an ExternalAgentDescriptor suitable for Gateway Supervisor resolution.
|
|
226
|
-
* Returns null if the agent is not available.
|
|
227
|
-
*/
|
|
228
|
-
buildExternalDescriptor(agentId: string): import("../../protocol/wire/acp-agent-management.js").ExternalAgentDescriptor | null;
|
|
229
|
-
/**
|
|
230
|
-
* Async, NON-BLOCKING twin of {@link buildExternalDescriptor} — identical output for the same
|
|
231
|
-
* detector state, but resolves the agent list via {@link scanAsync} (a real probe, awaited, when
|
|
232
|
-
* the cache is cold) instead of the sync {@link list}'s cache-or-empty shortcut. Load-bearing for
|
|
233
|
-
* `agents.warm` (agents-handler.ts): the sync path's detect calls are cache-fronted today, but
|
|
234
|
-
* that non-blocking guarantee is an implementation detail of `list()` — routing the RPC path
|
|
235
|
-
* through this method instead makes "never synchronously probe on this path" an explicit
|
|
236
|
-
* contract that can't silently regress if `list()`'s internals change later.
|
|
237
|
-
*/
|
|
238
|
-
buildExternalDescriptorAsync(agentId: string): Promise<import("../../protocol/wire/acp-agent-management.js").ExternalAgentDescriptor | null>;
|
|
239
|
-
/** Shared descriptor-assembly logic for {@link buildExternalDescriptor} and
|
|
240
|
-
* {@link buildExternalDescriptorAsync} — everything AFTER "locate this agentId's AgentDescriptor
|
|
241
|
-
* in an already-resolved list", so the sync/async twins can never drift on behavior, only on how
|
|
242
|
-
* they obtain `agents`. */
|
|
243
|
-
private assembleExternalDescriptorFromAgents;
|
|
244
|
-
/**
|
|
245
|
-
* Whether an agent is ready to compete in Solo/Product: installed/available AND configured.
|
|
246
|
-
* qlogicagent self-resolves from the owner profile (always ready). External agents need a usable
|
|
247
|
-
* ACP descriptor (installed) and, for key-auth backends, the key env resolved (configured by the
|
|
248
|
-
* user on the welcome page). Used by the 启动 pre-check so a race never starts with an agent that
|
|
249
|
-
* would fail its turn ("No LLM provider"/auth). Does NOT verify the key is *valid* — that's only
|
|
250
|
-
* known at runtime.
|
|
251
|
-
*/
|
|
252
|
-
/**
|
|
253
|
-
* Tri-state native-login state for the credential UI's account label — distinct from isAgentReady.
|
|
254
|
-
* `true` = a native login/subscription was actually detected (e.g. codex ~/.codex/auth.json); `false`
|
|
255
|
-
* = probeable but not logged in; `undefined` = no probe for this agent (e.g. hermes' own `acp --setup`
|
|
256
|
-
* store, which we can't read). isAgentReady treats undefined as ready-if-installed so the CLI gets a
|
|
257
|
-
* chance to run, but the UI must NOT claim "已登录" on undefined — it just doesn't know.
|
|
258
|
-
*/
|
|
259
|
-
getNativeLoginState(agentId: string): boolean | undefined;
|
|
260
|
-
isAgentReady(agentId: string): boolean;
|
|
261
|
-
/**
|
|
262
|
-
* Fast-fail guard for the turn path: returns a user-facing error when an agent is in a key-required
|
|
263
|
-
* credential mode (managed / userKey / auto-resolving-to-key) but NO usable key got injected — so the
|
|
264
|
-
* caller can reject the turn cleanly instead of spawning a CLI that would silently stall on auth (the
|
|
265
|
-
* host then goes quiet → the gateway's hang-watchdog kills it → the user sees a cryptic "Agent process
|
|
266
|
-
* stdio closed"). Returns null when credentialed, or when the mode owns its own native login
|
|
267
|
-
* (account / oauth / keyless), or when we can't be sure a key is needed.
|
|
268
|
-
*/
|
|
269
|
-
resolveCredentialError(agentId: string): string | null;
|
|
270
|
-
}
|
|
271
|
-
/** Best-effort resolve the backing model id for an agent (for the planning roster).
|
|
272
|
-
* Returns the configured/auto model or undefined. No spawn — reads config + auto env only. */
|
|
273
|
-
export declare function resolveAgentModel(detector: AcpDetector, id: string): string | undefined;
|