qlogicagent 2.14.5 → 2.14.7

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;
@@ -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 {
@@ -88,9 +88,23 @@ export declare class ModelRegistry {
88
88
  private injectedKeyStates;
89
89
  private settingsPath;
90
90
  private changeListeners;
91
+ private hydratedFromUpstream;
91
92
  constructor(config?: ModelRegistryConfig);
93
+ /** Whether the registry has been freshly hydrated from upstream this lifetime (lazy-init guard). */
94
+ isHydratedFromUpstream(): boolean;
95
+ /** Mark the registry as freshly hydrated; reads stay pure until an explicit re-sync. */
96
+ markHydratedFromUpstream(): void;
92
97
  getActiveModel(purpose: ModelPurpose): ResolvedModel | null;
93
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;
94
108
  isAvailable(purpose: ModelPurpose): boolean;
95
109
  resolveModelForPurpose(purpose: ModelPurpose): string | null;
96
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.5",
3
+ "version": "2.14.7",
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.16",
94
94
  "better-sqlite3": "^12.10.0",
95
95
  "dotenv": "^17.3.1",
96
96
  "ioredis": "^5.11.1",