qlogicagent 2.13.11 → 2.14.3

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.
Files changed (37) hide show
  1. package/dist/agent.js +9 -8
  2. package/dist/cli.js +351 -348
  3. package/dist/index.js +350 -347
  4. package/dist/protocol.js +1 -1
  5. package/dist/types/agent/tool-loop/completion-action-policy.d.ts +5 -1
  6. package/dist/types/agent/tool-loop/loop-helpers.d.ts +2 -0
  7. package/dist/types/agent/tool-loop/tool-budget-continuation-policy.d.ts +45 -0
  8. package/dist/types/cli/acp-extended-handlers.d.ts +1 -0
  9. package/dist/types/cli/acp-session-host.d.ts +0 -1
  10. package/dist/types/cli/base-tool-bootstrap.d.ts +1 -0
  11. package/dist/types/cli/handlers/session-handler.d.ts +0 -2
  12. package/dist/types/cli/handlers/turn-handler.d.ts +2 -1
  13. package/dist/types/cli/product-coordinator.d.ts +2 -2
  14. package/dist/types/cli/session-context.d.ts +0 -3
  15. package/dist/types/cli/stdio-acp-request-host.d.ts +2 -2
  16. package/dist/types/cli/stdio-rpc-handler-hosts.d.ts +0 -1
  17. package/dist/types/cli/stdio-runtime-bootstrap.d.ts +1 -0
  18. package/dist/types/cli/stdio-runtime-services.d.ts +1 -0
  19. package/dist/types/cli/stdio-server.d.ts +0 -3
  20. package/dist/types/cli/tool-bootstrap-core-registration.d.ts +1 -0
  21. package/dist/types/cli/tool-bootstrap.d.ts +1 -0
  22. package/dist/types/cli/turn-lifecycle.d.ts +0 -1
  23. package/dist/types/orchestration/agent-instance.d.ts +3 -2
  24. package/dist/types/orchestration/product-worktree.d.ts +2 -0
  25. package/dist/types/protocol/wire/agent-events.d.ts +2 -2
  26. package/dist/types/protocol/wire/chat-types.d.ts +2 -0
  27. package/dist/types/protocol/wire/gateway-rpc.d.ts +2 -2
  28. package/dist/types/runtime/infra/agent-process.d.ts +16 -0
  29. package/dist/types/runtime/infra/codex-llmrouter-compat-proxy.d.ts +4 -0
  30. package/dist/types/runtime/ports/tool-contracts.d.ts +1 -0
  31. package/dist/types/runtime/prompt/fresh-workspace-evidence.d.ts +1 -0
  32. package/dist/types/runtime/prompt/index.d.ts +1 -1
  33. package/dist/types/runtime/prompt/task-domain.d.ts +16 -55
  34. package/dist/types/runtime/session/session-deletion-guard.d.ts +4 -0
  35. package/dist/types/runtime/session/session-title.d.ts +9 -0
  36. package/dist/types/skills/tools/task-tool.d.ts +2 -0
  37. package/package.json +2 -2
@@ -1,21 +1,17 @@
1
1
  /**
2
- * Task Domain Detection — three-tier domain resolution for system prompt routing.
2
+ * Task Domain Detection — selects which system prompt guidance is injected.
3
3
  *
4
- * qlogicagent handles coding, office, AND creative tasks.
5
- * A coding-only system prompt hurts non-coding performance.
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
6
  *
7
- * Resolution priority (highest lowest):
8
- * 1. Project file: `.qlogicagent/settings.yaml` `taskDomain: coding`
9
- * Persisted, user-editable, checked into repo. Strongest signal.
10
- * 2. Host override: `config.taskDomain` in thread.turn params.
11
- * Set by Electron/Hub per-request.
12
- * 3. Session sticky: once a domain is established in a session,
13
- * keep it unless a new turn has a STRONG signal for a different domain.
14
- * 4. Auto-detect: regex keyword matching on the current user message.
15
- * Falls back to "general" if ambiguous.
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.
16
11
  *
17
- * The `resolveTaskDomain()` function implements this full chain.
18
- * The `detectTaskDomain()` function is the low-level keyword matcher (tier 4).
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.
19
15
  */
20
16
  /**
21
17
  * Task domain determines which system prompt sections are injected.
@@ -27,56 +23,21 @@
27
23
  */
28
24
  export type TaskDomain = "coding" | "office" | "creative" | "general";
29
25
  /**
30
- * Load task domain from project-level `.qlogicagent/settings.yaml`.
31
- * Returns undefined if file doesn't exist or doesn't contain a valid domain.
32
- *
33
- * Uses sync I/O — called once per turn, file is tiny (<1KB).
34
- * Simple key:value parser (no YAML dependency needed for this).
35
- */
36
- export declare function loadProjectTaskDomain(cwd: string): TaskDomain | undefined;
37
- /**
38
- * Detect task domain from user message text (tier 4 — lowest priority).
39
- * Uses keyword matching — fast, no LLM call.
26
+ * Detect task domain from user message text. Keyword matching — fast, no LLM call.
40
27
  */
41
28
  export declare function detectTaskDomain(userText: string): TaskDomain;
42
29
  export interface DomainResolutionContext {
43
- /** Current working directory (for project file lookup). */
44
- cwd: string;
45
- /** Host-provided override from config.taskDomain. */
30
+ /** Host-provided override from config.taskDomain (explicit, per-request). */
46
31
  hostOverride?: TaskDomain;
47
- /** Previous session domain (for stickiness). */
48
- sessionDomain?: TaskDomain;
49
32
  /** Current turn's user message text. */
50
33
  userText: string;
51
34
  }
52
35
  /**
53
- * Full domain resolution chain implements the four-tier priority:
54
- * 1. Project file (.qlogicagent/settings.yaml or INSTRUCTIONS.md frontmatter)
55
- * 2. Host override (config.taskDomain)
56
- * 3. Session stickiness (keep previous domain unless strong signal)
57
- * 4. Auto-detect from keywords
58
- *
59
- * Returns both the resolved domain and a "source" tag for debugging.
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.
60
39
  */
61
40
  export declare function resolveTaskDomain(ctx: DomainResolutionContext): {
62
41
  domain: TaskDomain;
63
- source: "project-file" | "host-override" | "session-sticky" | "auto-detect";
42
+ source: "host-override" | "auto-detect";
64
43
  };
65
- /**
66
- * Persist the detected task domain to `.qlogicagent/settings.yaml`.
67
- *
68
- * This runs once per workspace — subsequent sessions skip auto-detect
69
- * and hit Tier 1 (project file) directly.
70
- *
71
- * Conditions for writing:
72
- * - `domain` is NOT "general" (ambiguous → don't commit)
73
- * - No existing `settings.yaml` with a `taskDomain` line
74
- * - The auto-detect score was above the confidence threshold
75
- *
76
- * The written file is user-editable and meant to be checked into the repo.
77
- */
78
- export declare function persistTaskDomain(cwd: string, domain: TaskDomain): boolean;
79
- /**
80
- * Check if auto-detect scored high enough to justify persisting.
81
- */
82
- export declare function shouldPersistDomain(userText: string, domain: TaskDomain): boolean;
@@ -0,0 +1,4 @@
1
+ export declare function markSessionDeleted(sessionId: string, projectRoot: string): Promise<void>;
2
+ export declare function isSessionDeleted(sessionId: string, projectRoot: string): Promise<boolean>;
3
+ export declare function isSessionDeletedSync(sessionId: string, projectRoot: string): boolean;
4
+ export declare function listDeletedSessionIds(projectRoot: string): Promise<string[]>;
@@ -0,0 +1,9 @@
1
+ export declare function hasLikelyMojibake(text: string): boolean;
2
+ export declare function cleanSessionTitleCandidate(title: string | undefined | null, options?: {
3
+ maxLength?: number;
4
+ }): string | undefined;
5
+ export declare function titleFromPromptFallback(prompt: string, fallback: string, options?: {
6
+ maxLength?: number;
7
+ ellipsis?: string;
8
+ }): string;
9
+ export declare function deterministicSessionTitleForPrompt(prompt: string): string | null;
@@ -28,6 +28,8 @@ export interface RuntimeTaskView {
28
28
  export interface TaskToolRuntimeDeps {
29
29
  /** Live accessor — the registry is bound by the host after bootstrap. */
30
30
  getRuntime(): TaskRuntimeAccess | null;
31
+ /** Current chat/session scope. Checklist state is isolated by this key. */
32
+ getScopeKey?(): string | undefined;
31
33
  }
32
34
  export type TaskStatus = "not-started" | "in-progress" | "completed";
33
35
  export declare const TASK_STATUS_VALUES: readonly TaskStatus[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qlogicagent",
3
- "version": "2.13.11",
3
+ "version": "2.14.3",
4
4
  "description": "XiaozhiClaw Agent CLI — subprocess architecture (JSON-RPC over stdio)",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -90,7 +90,7 @@
90
90
  "@agentclientprotocol/sdk": "^0.25.0",
91
91
  "@napi-rs/canvas": "0.1.100",
92
92
  "@xiaozhiclaw/pet-core": "0.1.1",
93
- "@xiaozhiclaw/provider-core": "^0.1.14",
93
+ "@xiaozhiclaw/provider-core": "^0.1.15",
94
94
  "better-sqlite3": "^12.10.0",
95
95
  "dotenv": "^17.3.1",
96
96
  "ioredis": "^5.11.1",