qlogicagent 2.14.6 → 2.14.8

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.
@@ -5,6 +5,7 @@ export declare function isEmptyToolResult(r: {
5
5
  }): boolean;
6
6
  export declare function findLastToolError(messages: unknown[], _toolName: string): string | undefined;
7
7
  export declare function looksLikeBuildRequest(messages?: readonly ChatMessage[]): boolean;
8
+ export declare function isBareIntentPreamble(text: string): boolean;
8
9
  export declare function resolveToolLoopBudget(requested?: number, messages?: readonly ChatMessage[]): number;
9
10
  export declare function countExplicitOutputArtifacts(messages?: readonly ChatMessage[]): number;
10
11
  export declare function resolveTotalToolCallBudget(requested?: number, messages?: readonly ChatMessage[]): number;
@@ -29,6 +29,13 @@ export declare function handleAgentsList(this: AgentsHandlerHost, msg: AgentRpcR
29
29
  * summary + source for the confirm dialog (no secrets).
30
30
  */
31
31
  export declare function handleAgentsCatalog(this: AgentsHandlerHost, msg: AgentRpcRequest): Promise<void>;
32
+ /**
33
+ * Background update check (VS Code pattern): resolve latest npm versions for installed catalog agents
34
+ * in PARALLEL, off the catalog hot path. The frontend calls this AFTER the (instant) catalog render
35
+ * and merges the results to light up "update available" badges — never blocking the panel from
36
+ * opening. Returns `{ updates: CatalogUpdateInfo[] }` (only agents with a resolved latest version).
37
+ */
38
+ export declare function handleAgentsCheckUpdates(this: AgentsHandlerHost, msg: AgentRpcRequest): Promise<void>;
32
39
  /**
33
40
  * One-click install a catalog agent by id. Runs ONLY the official command from the
34
41
  * catalog manifest (never a free-form command), streaming progress via the
@@ -23,6 +23,14 @@ export declare function activateAttachmentToolsForTurn(toolCatalog: ToolCatalog,
23
23
  export declare function getFocusedAttachmentToolNamesForTurn(messages: ChatMessage[]): Set<string> | null;
24
24
  type FocusedAttachmentModelPurpose = "imageUnderstanding" | "videoUnderstanding";
25
25
  export declare function getFocusedAttachmentUnsupportedContentForTurn(messages: ChatMessage[], purpose: FocusedAttachmentModelPurpose): string | null;
26
+ /**
27
+ * Return a shallow-cloned message array whose LAST user message has the model-facing attachment
28
+ * context (numbered manifest / reference URLs / picked-element selector+styles) appended to its
29
+ * content. Used for (a) model routing — so the manifest's "图片N" still triggers imageUnderstanding
30
+ * the way the old baked content did — and (b) the LLM request, while the PERSISTED message keeps the
31
+ * clean prompt text (VS Code two-line model). The original array/objects are never mutated.
32
+ */
33
+ export declare function augmentLastUserMessageContent(messages: ChatMessage[], modelContext: string): ChatMessage[];
26
34
  export declare function getFocusedAttachmentModelPurposeForTurn(messages: ChatMessage[]): FocusedAttachmentModelPurpose | null;
27
35
  export declare function refreshPermissionCheckerToolMeta(permissionChecker: PermissionMetadataResolver | null | undefined, tools: ToolDefinition[]): void;
28
36
  export declare function handleUserResponse(this: TurnControlHandlerHost, msg: AgentRpcRequest): void;
@@ -63,6 +63,13 @@ export interface ChatMessage {
63
63
  }>;
64
64
  /** UI-facing structured blocks persisted with transcripts; ignored by model transports. */
65
65
  blocks?: Array<Record<string, unknown>>;
66
+ /**
67
+ * Structured attachment entries (VS Code two-line model: element/browserView/file/image/…),
68
+ * persisted with the transcript and surfaced to the UI as chips. Opaque to the agent and ignored
69
+ * by model transports — the model-facing context is derived gateway-side and appended transiently
70
+ * to the LLM message, never stored here.
71
+ */
72
+ attachmentEntries?: Array<Record<string, unknown>>;
66
73
  }
67
74
  export type ToolCapabilityCategory = "orchestration" | "filesystem" | "web" | "search" | "memory" | "media" | "developer" | "mcp" | "automation" | "system" | "other";
68
75
  export interface LocalizedToolText {
@@ -26,6 +26,26 @@ export declare function getCatalogPackageVersionInfo(entry: AcpBackendConfig, de
26
26
  latestVersion?: string;
27
27
  updateAvailable: boolean;
28
28
  };
29
+ /** Async, parallel-safe variant of fetchNpmLatestPackageVersion — used by the background update check
30
+ * so N agents resolve concurrently (one `npm view` each) instead of blocking sequentially. */
31
+ export declare function fetchNpmLatestPackageVersionAsync(packageName: string | null | undefined): Promise<string | null>;
32
+ export interface CatalogUpdateInfo {
33
+ id: string;
34
+ packageName?: string;
35
+ installedVersion?: string;
36
+ latestVersion?: string;
37
+ updateAvailable: boolean;
38
+ }
39
+ /**
40
+ * Resolve latest-version / update-available info for the catalog's INSTALLED agents, all in PARALLEL
41
+ * (one concurrent `npm view` per package). Non-installed agents are skipped (nothing to update).
42
+ * Returns only entries where a latest version was resolved. Safe to call off the catalog hot path.
43
+ */
44
+ export declare function getCatalogUpdateInfoAsync(entries: ReadonlyArray<{
45
+ id: string;
46
+ entry: AcpBackendConfig;
47
+ detectedVersion?: string;
48
+ }>): Promise<CatalogUpdateInfo[]>;
29
49
  export declare function normalizeWindowsAcpCommand(cliPath: string, args: string[]): {
30
50
  cliPath: string;
31
51
  acpArgs: string[];
@@ -96,6 +96,15 @@ export declare class ModelRegistry {
96
96
  markHydratedFromUpstream(): void;
97
97
  getActiveModel(purpose: ModelPurpose): ResolvedModel | null;
98
98
  peekActiveModel(purpose: ModelPurpose): ModelEntry | null;
99
+ /**
100
+ * Whether the model bound to `purpose` (default "chat") accepts the given input modality
101
+ * (e.g. "image"). Blocks ONLY when the catalog EXPLICITLY lists modalities without this one;
102
+ * absent/empty metadata → true (don't strip), so vision models with sparse profiles (and the
103
+ * imageUnderstanding route) are never wrongly stripped. The well-formedness of multimodal content
104
+ * is handled in provider-core's transport; this is just a guard against feeding media to a model
105
+ * the catalog says is text-only.
106
+ */
107
+ acceptsInputModality(modality: string, purpose?: ModelPurpose): boolean;
99
108
  isAvailable(purpose: ModelPurpose): boolean;
100
109
  resolveModelForPurpose(purpose: ModelPurpose): string | null;
101
110
  addProvider(providerId: string, opts?: {
@@ -41,6 +41,13 @@ export declare function archiveProject(projectId: string): {
41
41
  };
42
42
  export declare function unarchiveProject(projectId: string): ProjectInfo | null;
43
43
  export declare function findByGroupId(groupId: string): ProjectInfo | null;
44
+ /**
45
+ * Find the active project whose workspaceDir resolves to `dir` (case-insensitive, path-resolved).
46
+ * Used to gate adoption of externally-supplied working directories (ACP session cwd, turn
47
+ * config.workdir): the active tool workdir must always be a registered project's workspaceDir, so
48
+ * a cwd that maps to no project is ignored rather than silently leaking files outside any project.
49
+ */
50
+ export declare function findByWorkspaceDir(dir: string): ProjectInfo | null;
44
51
  export declare function archiveByGroupId(groupId: string): {
45
52
  archived: boolean;
46
53
  projectId?: string;
@@ -58,3 +58,14 @@ export declare function createDeferredToolIndexSection(listDeferredTools: () =>
58
58
  * (e.g., Chinese INDEX.md + English tool guidance).
59
59
  */
60
60
  export declare function createLanguageSection(language?: string): SystemPromptSection;
61
+ /**
62
+ * Detect the response language from the user's current-turn text so the strong
63
+ * explicit-language branch of createLanguageSection actually fires.
64
+ *
65
+ * The soft "mirror the user" fallback is not enough for weaker models: buried
66
+ * under a wall of English guidance, they drift to English even for a Chinese
67
+ * prompt. Naming the language ("Always respond in 简体中文") is the load-bearing
68
+ * signal. Han characters present -> Chinese; otherwise undefined (let the soft
69
+ * fallback handle English/other, which weak models already mirror fine).
70
+ */
71
+ export declare function detectResponseLanguage(userText: string): string | undefined;
@@ -17,6 +17,8 @@ export interface FreshWorkspaceEvidencePolicy {
17
17
  allowedToolNames: string[];
18
18
  }
19
19
  export declare function getFreshWorkspaceEvidencePolicy(messages: readonly PromptMessageLike[] | string): FreshWorkspaceEvidencePolicy;
20
+ /** 显式构建/创建类请求(做个游戏/网站/app…)。命中 → 第一回合就强制工具调用。 */
21
+ export declare function looksLikeBuildIntent(messages: readonly PromptMessageLike[] | string): boolean;
20
22
  export declare function isLightweightChatTurn(messages: readonly PromptMessageLike[] | string): boolean;
21
23
  export declare function isExplicitNoToolTurn(messages: readonly PromptMessageLike[] | string): boolean;
22
24
  export declare function selectFreshWorkspaceEvidenceTools<TTool extends ToolNameLike>(tools: readonly TTool[], policy: FreshWorkspaceEvidencePolicy): TTool[];
@@ -1,4 +1,12 @@
1
1
  import type { PortableToolResult } from "../portable-tool.js";
2
+ /**
3
+ * Map common parameter-name aliases that prompt-tool-calling models emit (e.g. Seed/Doubao send
4
+ * `file_path`/`old_str`/`new_str` instead of the schema's `path`/`oldText`/`newText`) onto the
5
+ * canonical schema keys, in place. Only fills a canonical key when it's absent, so well-behaved
6
+ * native tool calls are untouched. Keeps file edits working across models that don't echo the exact
7
+ * schema names.
8
+ */
9
+ export declare function normalizeFileToolParamAliases(raw: Record<string, unknown>): void;
2
10
  export declare function missingRequiredStringParam(params: Record<string, unknown>, field: string, options?: {
3
11
  allowEmpty?: boolean;
4
12
  }): string | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qlogicagent",
3
- "version": "2.14.6",
3
+ "version": "2.14.8",
4
4
  "description": "XiaozhiClaw Agent CLI — subprocess architecture (JSON-RPC over stdio)",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -89,8 +89,8 @@
89
89
  "dependencies": {
90
90
  "@agentclientprotocol/sdk": "^0.25.0",
91
91
  "@napi-rs/canvas": "0.1.100",
92
- "@xiaozhiclaw/pet-core": "0.1.1",
93
- "@xiaozhiclaw/provider-core": "^0.1.15",
92
+ "@xiaozhiclaw/pet-core": "0.1.2",
93
+ "@xiaozhiclaw/provider-core": "^0.1.17",
94
94
  "better-sqlite3": "^12.10.0",
95
95
  "dotenv": "^17.3.1",
96
96
  "ioredis": "^5.11.1",