qlogicagent 2.20.9 → 2.20.10
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.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/index.js +316 -321
- package/dist/types/runtime/prompt/capability-routing-policy.d.ts +1 -3
- package/dist/types/runtime/prompt/task-domain.d.ts +8 -31
- package/package.json +6 -6
- package/dist/types/runtime/prompt/fresh-workspace-evidence.d.ts +0 -38
- package/dist/types/runtime/prompt/tool-necessity-policy.d.ts +0 -12
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export type CapabilityRoutingOwner = "structured-planner" | "direct-response" | "mcp-capability" | "typed-builtin" | "pinned-skill" | "host-skill-discovery";
|
|
1
|
+
export type CapabilityRoutingOwner = "structured-planner" | "direct-response" | "mcp-capability" | "pinned-skill" | "host-skill-discovery";
|
|
3
2
|
/**
|
|
4
3
|
* Resolves exclusive capability ownership before any semantic Skill classification.
|
|
5
4
|
* A lower-specificity route must never steal a turn already owned by a typed policy.
|
|
@@ -8,6 +7,5 @@ export declare function resolveCapabilityRoutingOwner(input: {
|
|
|
8
7
|
structuredPlannerTurn: boolean;
|
|
9
8
|
directResponse: boolean;
|
|
10
9
|
mcpCapabilitySelection: boolean;
|
|
11
|
-
freshEvidencePolicy: FreshWorkspaceEvidencePolicy;
|
|
12
10
|
pinnedSkillCount: number;
|
|
13
11
|
}): CapabilityRoutingOwner;
|
|
@@ -1,43 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Task
|
|
3
|
-
*
|
|
4
|
-
* qlogicagent handles coding, office, AND creative tasks; a coding-only prompt
|
|
5
|
-
* hurts non-coding performance, so the per-domain CONTENT blocks are kept.
|
|
6
|
-
*
|
|
7
|
-
* Resolution is STATELESS and recomputed every turn (CC-aligned — no hidden
|
|
8
|
-
* session/disk state, no stickiness latch, no auto-persisted guesses):
|
|
9
|
-
* 1. Host override: `config.taskDomain` from thread.turn params (explicit).
|
|
10
|
-
* 2. Auto-detect: keyword match on the current user message; "general" if ambiguous.
|
|
11
|
-
*
|
|
12
|
-
* The universal BEHAVIORAL rules (answer-directly, tools-not-default, conciseness)
|
|
13
|
-
* live in universalGuidance() and apply in every domain, so misclassifying a turn
|
|
14
|
-
* as "general" degrades only the domain-tailored content, never the core behavior.
|
|
15
|
-
*/
|
|
16
|
-
/**
|
|
17
|
-
* Task domain determines which system prompt sections are injected.
|
|
18
|
-
*
|
|
19
|
-
* - "coding" — software engineering: bug fixes, refactoring, code gen, etc.
|
|
20
|
-
* - "office" — data analysis, reports, documents, spreadsheets, emails
|
|
21
|
-
* - "creative" — writing, copywriting, marketing, storytelling, brainstorming
|
|
22
|
-
* - "general" — undetectable or mixed domain, uses universal guidance
|
|
2
|
+
* Task-domain guidance is a Host-owned typed choice, not a language classifier.
|
|
3
|
+
* User text is intentionally not inspected for keywords or regular expressions.
|
|
23
4
|
*/
|
|
24
5
|
export type TaskDomain = "coding" | "office" | "creative" | "general";
|
|
25
6
|
/**
|
|
26
|
-
*
|
|
7
|
+
* Kept as a compatibility-neutral pure function for callers that only have text.
|
|
8
|
+
* Without a typed Host decision the safe domain is always general.
|
|
27
9
|
*/
|
|
28
|
-
export declare function detectTaskDomain(
|
|
10
|
+
export declare function detectTaskDomain(_userText: string): TaskDomain;
|
|
29
11
|
export interface DomainResolutionContext {
|
|
30
|
-
/** Host-provided override from
|
|
12
|
+
/** Host-provided typed override from thread.turn params. */
|
|
31
13
|
hostOverride?: TaskDomain;
|
|
32
|
-
/** Current
|
|
14
|
+
/** Current user text is accepted for API stability but never classified. */
|
|
33
15
|
userText: string;
|
|
34
16
|
}
|
|
35
|
-
/**
|
|
36
|
-
* Resolve task domain, stateless and per-turn: explicit host override, else fresh
|
|
37
|
-
* keyword auto-detect on this turn's message. No project file, no session stickiness,
|
|
38
|
-
* no disk persistence.
|
|
39
|
-
*/
|
|
40
17
|
export declare function resolveTaskDomain(ctx: DomainResolutionContext): {
|
|
41
18
|
domain: TaskDomain;
|
|
42
|
-
source: "host-override" | "
|
|
19
|
+
source: "host-override" | "default";
|
|
43
20
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "qlogicagent",
|
|
3
|
-
"version": "2.20.
|
|
3
|
+
"version": "2.20.10",
|
|
4
4
|
"packageManager": "pnpm@10.23.0",
|
|
5
5
|
"description": "XiaozhiClaw Agent CLI — subprocess architecture (JSON-RPC over stdio)",
|
|
6
6
|
"type": "module",
|
|
@@ -142,9 +142,9 @@
|
|
|
142
142
|
"benchmark:hermes-superiority": "tsx benchmarks/hermes-superiority/runner.ts",
|
|
143
143
|
"benchmark:product-blackbox": "tsx benchmarks/product-blackbox/runner.ts",
|
|
144
144
|
"benchmark:product-blind-preflight": "tsx benchmarks/product-blackbox/runner.ts blind-preflight",
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
145
|
+
"benchmark:product-blind-calibration": "tsx benchmarks/product-blackbox/runner.ts prepare-blind-calibration",
|
|
146
|
+
"benchmark:product-blind-score": "tsx benchmarks/product-blackbox/runner.ts score-blind-calibration",
|
|
147
|
+
"benchmark:capability-state-fixtures": "tsx benchmarks/product-blackbox/run-capability-state-fixtures.ts",
|
|
148
148
|
"lint": "oxlint .",
|
|
149
149
|
"check:encoding-corruption": "node scripts/check-encoding-corruption.mjs",
|
|
150
150
|
"check:mechanical-rules": "node scripts/check-mechanical-rules.mjs",
|
|
@@ -170,8 +170,8 @@
|
|
|
170
170
|
"dependencies": {
|
|
171
171
|
"@agentclientprotocol/sdk": "^0.25.0",
|
|
172
172
|
"@napi-rs/canvas": "0.1.100",
|
|
173
|
-
"@xiaozhiclaw/module-sdk": "0.2.
|
|
174
|
-
"@xiaozhiclaw/provider-core": "
|
|
173
|
+
"@xiaozhiclaw/module-sdk": "0.2.5",
|
|
174
|
+
"@xiaozhiclaw/provider-core": "0.1.31",
|
|
175
175
|
"better-sqlite3": "^12.10.0",
|
|
176
176
|
"dotenv": "^17.3.1",
|
|
177
177
|
"ioredis": "^5.11.1",
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { type SystemPromptSection } from "./system-prompt-sections.js";
|
|
2
|
-
export interface PromptMessageLike {
|
|
3
|
-
role?: string;
|
|
4
|
-
content?: unknown;
|
|
5
|
-
}
|
|
6
|
-
export interface ToolNameLike {
|
|
7
|
-
function?: {
|
|
8
|
-
name?: string;
|
|
9
|
-
};
|
|
10
|
-
name?: string;
|
|
11
|
-
}
|
|
12
|
-
export interface FreshWorkspaceEvidencePolicy {
|
|
13
|
-
requiresFreshTool: boolean;
|
|
14
|
-
reason?: "file-read" | "memory-mutation" | "media-generation" | "media-understanding" | "directory-list" | "content-search" | "shell" | "web";
|
|
15
|
-
mediaKind?: "image" | "video" | "tts" | "music";
|
|
16
|
-
allowedToolNames: string[];
|
|
17
|
-
/** When true, the typed route is an execution boundary rather than prompt guidance. */
|
|
18
|
-
enforceAllowedToolNames?: boolean;
|
|
19
|
-
}
|
|
20
|
-
export declare function getFreshWorkspaceEvidencePolicy(messages: readonly PromptMessageLike[] | string): FreshWorkspaceEvidencePolicy;
|
|
21
|
-
export declare function isLightweightChatTurn(messages: readonly PromptMessageLike[] | string): boolean;
|
|
22
|
-
export declare function isExplicitNoToolTurn(messages: readonly PromptMessageLike[] | string): boolean;
|
|
23
|
-
/**
|
|
24
|
-
* Apply a hard allowlist only for deterministic Host-owned operations such as
|
|
25
|
-
* media generation/understanding. Other evidence policies keep the complete
|
|
26
|
-
* turn surface so ordinary engineering and orchestration work is not narrowed
|
|
27
|
-
* merely because its wording resembles an evidence request. Namespaced Host
|
|
28
|
-
* tools are matched by their local MCP tool name.
|
|
29
|
-
*/
|
|
30
|
-
export declare function selectFreshWorkspaceEvidenceTools<TTool extends ToolNameLike>(tools: readonly TTool[], policy: FreshWorkspaceEvidencePolicy): TTool[];
|
|
31
|
-
/**
|
|
32
|
-
* Prompt notice for an explicit "don't use tools" instruction. This INFORMS the
|
|
33
|
-
* model and leaves the judgment to it — the engine no longer strips the tool list
|
|
34
|
-
* (toolChoice="none"), which also silently disabled the reactive guards and
|
|
35
|
-
* misfired on quoted/reported speech ("he said don't use tools").
|
|
36
|
-
*/
|
|
37
|
-
export declare function createExplicitNoToolNoticeSection(): SystemPromptSection;
|
|
38
|
-
export declare function createFreshWorkspaceEvidenceSection(policy: FreshWorkspaceEvidencePolicy, availableToolNames?: readonly string[]): SystemPromptSection | null;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { FreshWorkspaceEvidencePolicy } from "./fresh-workspace-evidence.js";
|
|
2
|
-
/**
|
|
3
|
-
* Typed, conservative pre-tool routing for requests whose complete input is already
|
|
4
|
-
* present in the latest user message. This is intentionally an operation taxonomy,
|
|
5
|
-
* not a benchmark phrase list: every admitted class is closed over supplied text or
|
|
6
|
-
* scalar values and therefore cannot gain correctness from filesystem, shell or MCP.
|
|
7
|
-
*/
|
|
8
|
-
export interface ToolNecessityPolicy {
|
|
9
|
-
mode: "model-tools" | "direct-response";
|
|
10
|
-
reason?: "scalar-computation" | "text-transformation" | "structured-data-inspection" | "inline-classification" | "url-component-extraction";
|
|
11
|
-
}
|
|
12
|
-
export declare function resolveToolNecessityPolicy(text: string, evidencePolicy: FreshWorkspaceEvidencePolicy): ToolNecessityPolicy;
|