qlogicagent 2.13.9 → 2.13.11

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 (36) hide show
  1. package/dist/agent.js +9 -6
  2. package/dist/cli.js +350 -344
  3. package/dist/index.js +349 -343
  4. package/dist/orchestration.js +14 -14
  5. package/dist/types/agent/agent.d.ts +1 -0
  6. package/dist/types/agent/tool-loop/completion-action-policy.d.ts +24 -1
  7. package/dist/types/agent/tool-loop/loop-helpers.d.ts +2 -1
  8. package/dist/types/agent/types.d.ts +7 -0
  9. package/dist/types/cli/base-tool-bootstrap.d.ts +2 -0
  10. package/dist/types/cli/handlers/turn-handler.d.ts +6 -0
  11. package/dist/types/cli/session-query-service.d.ts +3 -0
  12. package/dist/types/cli/tool-bootstrap-community-registration.d.ts +6 -0
  13. package/dist/types/cli/tool-bootstrap-core-registration.d.ts +2 -0
  14. package/dist/types/cli/tool-bootstrap-media-registration.d.ts +2 -0
  15. package/dist/types/cli/tool-bootstrap.d.ts +2 -0
  16. package/dist/types/protocol/wire/gateway-rpc.d.ts +2 -0
  17. package/dist/types/runtime/community/activity-event-emitter.d.ts +7 -0
  18. package/dist/types/runtime/community/activity-event.d.ts +3 -1
  19. package/dist/types/runtime/community/community-consent-client.d.ts +14 -0
  20. package/dist/types/runtime/community/pet-activity-sink.d.ts +36 -0
  21. package/dist/types/runtime/config/tunable-defaults.d.ts +3 -0
  22. package/dist/types/runtime/execution/streaming-tool-executor.d.ts +3 -0
  23. package/dist/types/runtime/infra/media-persistence.d.ts +17 -0
  24. package/dist/types/runtime/ports/agent-runtime-ports.d.ts +1 -0
  25. package/dist/types/runtime/ports/tool-contracts.d.ts +2 -0
  26. package/dist/types/runtime/prompt/fresh-workspace-evidence.d.ts +1 -0
  27. package/dist/types/runtime/session/session-transcript-store.d.ts +1 -0
  28. package/dist/types/runtime/session/session-write-queue.d.ts +1 -0
  29. package/dist/types/skills/tools/community-seek-tool.d.ts +9 -0
  30. package/dist/types/skills/tools/file-tool-arguments.d.ts +5 -0
  31. package/dist/types/skills/tools/image-generate-tool.d.ts +24 -0
  32. package/dist/types/skills/tools/read-tool.d.ts +2 -0
  33. package/dist/types/skills/tools/shell/host-paths.d.ts +2 -0
  34. package/dist/types/skills/tools/team-tool.d.ts +0 -4
  35. package/dist/vendor/hatch-pet/scripts/prepare_pet_run.py +8 -4
  36. package/package.json +4 -3
@@ -28,6 +28,10 @@ export interface MediaDownloadResult {
28
28
  bytes: number;
29
29
  /** MIME type (from Content-Type header). */
30
30
  mimeType: string;
31
+ /** First bytes of the saved file as uppercase hex pairs. */
32
+ headerHex?: string;
33
+ }
34
+ export interface MediaSaveResult extends MediaDownloadResult {
31
35
  }
32
36
  export interface MediaPersistenceConfig {
33
37
  /**
@@ -79,6 +83,19 @@ export declare class MediaPersistence {
79
83
  }, log?: {
80
84
  warn: (msg: string) => void;
81
85
  }): Promise<MediaDownloadResult[]>;
86
+ /**
87
+ * Persist generated media to caller-requested artifact paths.
88
+ *
89
+ * This complements project-level archival downloads: generated assets remain
90
+ * previewable in assets/images, while explicit user deliverables are also
91
+ * written to their requested paths.
92
+ */
93
+ saveAllToPaths(urls: string[], outputPaths: string[], hint?: {
94
+ type?: string;
95
+ sessionId?: string;
96
+ }, log?: {
97
+ warn: (msg: string) => void;
98
+ }): Promise<MediaSaveResult[]>;
82
99
  /** Get the project-level assets root (<project>/assets). */
83
100
  getMediaDir(): string;
84
101
  /** Get the project directory (for testing/inspection). */
@@ -38,6 +38,7 @@ export interface StreamingToolExecutorPortConfig {
38
38
  log: AgentLogger;
39
39
  signal?: AbortSignal;
40
40
  maxConcurrentTools?: number;
41
+ maxExecutionMs?: number;
41
42
  }
42
43
  export interface ContextCompressionEnginePort {
43
44
  compressAsync(messages: RuntimeCompressibleMessage[], budget: number, context: {
@@ -1,4 +1,5 @@
1
1
  import type { ToolDefinition } from "../../protocol/wire/index.js";
2
+ import type { MediaPersistence } from "../infra/media-persistence.js";
2
3
  import type { PathService } from "./path-service.js";
3
4
  import type { PermissionRiskLevel } from "./permission-contracts.js";
4
5
  export interface RuntimeToolContract {
@@ -58,6 +59,7 @@ export interface ToolBootstrapConfig {
58
59
  workdir?: string;
59
60
  toolCatalog?: ToolCatalog;
60
61
  pathService?: PathService;
62
+ mediaPersistence?: MediaPersistence;
61
63
  log?: {
62
64
  info(message: string): void;
63
65
  warn(message: string): void;
@@ -17,5 +17,6 @@ export interface FreshWorkspaceEvidencePolicy {
17
17
  }
18
18
  export declare function getFreshWorkspaceEvidencePolicy(messages: readonly PromptMessageLike[] | string): FreshWorkspaceEvidencePolicy;
19
19
  export declare function isLightweightChatTurn(messages: readonly PromptMessageLike[] | string): boolean;
20
+ export declare function isExplicitNoToolTurn(messages: readonly PromptMessageLike[] | string): boolean;
20
21
  export declare function selectFreshWorkspaceEvidenceTools<TTool extends ToolNameLike>(tools: readonly TTool[], policy: FreshWorkspaceEvidencePolicy): TTool[];
21
22
  export declare function createFreshWorkspaceEvidenceSection(policy: FreshWorkspaceEvidencePolicy): SystemPromptSection | null;
@@ -8,6 +8,7 @@ export declare function appendMessage(sessionId: string, message: ChatMessage, p
8
8
  usage?: TokenUsage;
9
9
  displayMetadata?: MessageDisplayMetadata;
10
10
  }): Promise<boolean>;
11
+ export declare function countTranscriptMessages(sessionId: string, projectRoot: string): Promise<number | null>;
11
12
  export declare function loadTranscript(sessionId: string, projectRoot: string, options?: {
12
13
  includeDisplayMetadata?: boolean;
13
14
  }): Promise<TranscriptLoadResult | null>;
@@ -1,2 +1,3 @@
1
1
  export declare function withSessionWriteLimit<T>(fn: () => Promise<T>): Promise<T>;
2
2
  export declare function withTranscriptAppendOrder<T>(sessionKey: string, fn: () => Promise<T>): Promise<T>;
3
+ export declare function waitForTranscriptAppends(sessionKey: string): Promise<void>;
@@ -49,6 +49,15 @@ export interface CommunitySeekDeps {
49
49
  findAnswers?(intent: string, topK: number): Promise<CommunitySeekAnswerCandidate[]>;
50
50
  /** 轻回执 sink(对话侧渲染);best-effort,抛错不影响工具结果。 */
51
51
  onReceipt?(receipt: CommunitySeekReceipt): void;
52
+ /**
53
+ * 「去社区张罗到了」→ 发一条 acquire ActivityEvent(父总纲 Cut1「落…一条 ActivityEvent」):
54
+ * 自家宠物现身于命中资源的店铺/街区。anchor 只给 shopId(店铺=canonical resourceId);
55
+ * 街区由集市端按 layout 反解。best-effort fire-and-forget,抛错/未配置都不影响工具结果。
56
+ */
57
+ onAcquire?(anchor: {
58
+ shopId?: string;
59
+ districtId?: string;
60
+ }): void;
52
61
  }
53
62
  export declare function toPackageCandidate(match: CommunityRegistryMatchResult): CommunitySeekPackageCandidate;
54
63
  export declare function runCommunitySeek(deps: CommunitySeekDeps, params: CommunitySeekParams): Promise<CommunitySeekResult>;
@@ -0,0 +1,5 @@
1
+ import type { PortableToolResult } from "../portable-tool.js";
2
+ export declare function missingRequiredStringParam(params: Record<string, unknown>, field: string, options?: {
3
+ allowEmpty?: boolean;
4
+ }): string | null;
5
+ export declare function invalidFileToolArguments(type: "read" | "write" | "edit", message: string): PortableToolResult;
@@ -6,6 +6,8 @@ export interface ImageGenerateToolParams {
6
6
  style?: string;
7
7
  size?: string;
8
8
  image_url?: string;
9
+ output_path?: string;
10
+ output_paths?: string[];
9
11
  n?: number;
10
12
  quality?: string;
11
13
  seed?: number;
@@ -33,6 +35,17 @@ export declare const IMAGE_GENERATE_TOOL_SCHEMA: {
33
35
  readonly type: "string";
34
36
  readonly description: string;
35
37
  };
38
+ readonly output_path: {
39
+ readonly type: "string";
40
+ readonly description: "Optional absolute or workspace-relative path where the generated image should be saved. Use only for a single generated image.";
41
+ };
42
+ readonly output_paths: {
43
+ readonly type: "array";
44
+ readonly items: {
45
+ readonly type: "string";
46
+ };
47
+ readonly description: "Optional absolute or workspace-relative paths where generated images should be saved. Must match the number of generated images.";
48
+ };
36
49
  readonly n: {
37
50
  readonly type: "number";
38
51
  readonly description: "Number of images to generate (1-4). Default: 1.";
@@ -54,6 +67,13 @@ export interface ImageGenerateResult {
54
67
  size?: string;
55
68
  durationMs?: number;
56
69
  }
70
+ export interface SavedGeneratedImage {
71
+ remoteUrl: string;
72
+ localPath: string;
73
+ bytes: number;
74
+ mimeType: string;
75
+ headerHex?: string;
76
+ }
57
77
  /** Deps injected by the host runtime for image generation. */
58
78
  export interface ImageGenerateToolDeps {
59
79
  /**
@@ -70,5 +90,9 @@ export interface ImageGenerateToolDeps {
70
90
  quality?: string;
71
91
  seed?: number;
72
92
  }): Promise<ImageGenerateResult>;
93
+ saveGeneratedImages?(params: {
94
+ mediaUrls: string[];
95
+ outputPaths: string[];
96
+ }): Promise<SavedGeneratedImage[]>;
73
97
  }
74
98
  export declare function createImageGenerateTool(deps: ImageGenerateToolDeps): PortableTool<ImageGenerateToolParams>;
@@ -34,6 +34,8 @@ export interface ReadToolDeps {
34
34
  type: "image";
35
35
  localPath: string;
36
36
  mimeType: string;
37
+ sizeBytes?: number;
38
+ headerHex?: string;
37
39
  } | {
38
40
  type: "binary";
39
41
  mimeType: string;
@@ -0,0 +1,2 @@
1
+ export declare function normalizeHostPath(input: string): string;
2
+ export declare function isWindowsHostPath(input: string): boolean;
@@ -114,10 +114,6 @@ export interface TeamSendResult {
114
114
  reply: string;
115
115
  }>;
116
116
  }
117
- /**
118
- * Host-provided team management backend.
119
- * Creates agent teams whose members are messaged via the send action.
120
- */
121
117
  export interface TeamToolDeps {
122
118
  createTeam(params: {
123
119
  teamName: string;
@@ -137,8 +137,11 @@ STYLE_PRESETS = {
137
137
  "clear silhouette, and no photoreal complexity."
138
138
  ),
139
139
  "painterly": (
140
- "Painterly mascot with simplified brush texture, readable forms, stable "
141
- "palette, and enough edge clarity for clean extraction."
140
+ "Painterly anime/JRPG fantasy mascot: soft cel-and-brush shading with "
141
+ "smooth gradients (NOT pixel art, no visible pixels or dithering), warm "
142
+ "bright storybook palette, gentle rim light, rounded readable forms, clear "
143
+ "silhouette, and enough edge clarity for clean chroma-key extraction. "
144
+ "Matches a lush daytime fantasy town-market art style."
142
145
  ),
143
146
  "brand-inspired": (
144
147
  "Brand-inspired mascot using approved public or user-provided brand cues "
@@ -671,9 +674,10 @@ def main() -> None:
671
674
  )
672
675
  parser.add_argument(
673
676
  "--style-preset",
674
- default="auto",
677
+ default="painterly",
675
678
  choices=sorted(STYLE_PRESETS),
676
- help="Pet-safe style preset to use across the base and all animation rows.",
679
+ help="Pet-safe style preset across base + all rows. Default 'painterly' (厚涂,和集市城镇同框协调);"
680
+ " 'auto' 由请求/参考图推断,其余见 STYLE_PRESETS。",
677
681
  )
678
682
  parser.add_argument("--style-notes", default="")
679
683
  parser.add_argument(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qlogicagent",
3
- "version": "2.13.9",
3
+ "version": "2.13.11",
4
4
  "description": "XiaozhiClaw Agent CLI — subprocess architecture (JSON-RPC over stdio)",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -68,11 +68,12 @@
68
68
  "build:tsc": "tsc --noCheck",
69
69
  "start": "node dist/cli.js",
70
70
  "test": "vitest run",
71
- "check": "tsc --noEmit && pnpm test && pnpm run check:architecture-boundaries && pnpm run check:provider-core-boundary && pnpm run check:pet-core-boundary && pnpm run check:workspace-hygiene && pnpm run check:package-artifact",
71
+ "check": "tsc --noEmit && pnpm test && pnpm run check:architecture-boundaries && pnpm run check:provider-core-boundary && pnpm run check:provider-core-release-sync && pnpm run check:pet-core-boundary && pnpm run check:workspace-hygiene && pnpm run check:package-artifact",
72
72
  "test:watch": "vitest",
73
73
  "lint": "oxlint .",
74
74
  "check:architecture-boundaries": "node scripts/check-architecture-boundaries.mjs",
75
75
  "check:provider-core-boundary": "node scripts/check-provider-core-boundary.mjs",
76
+ "check:provider-core-release-sync": "node scripts/check-provider-core-release-sync.mjs",
76
77
  "check:pet-core-boundary": "node scripts/check-pet-core-boundary.mjs",
77
78
  "check:workspace-hygiene": "node scripts/check-workspace-hygiene.mjs",
78
79
  "check:workspace-hygiene:strict": "node scripts/check-workspace-hygiene.mjs --strict",
@@ -89,7 +90,7 @@
89
90
  "@agentclientprotocol/sdk": "^0.25.0",
90
91
  "@napi-rs/canvas": "0.1.100",
91
92
  "@xiaozhiclaw/pet-core": "0.1.1",
92
- "@xiaozhiclaw/provider-core": "^0.1.12",
93
+ "@xiaozhiclaw/provider-core": "^0.1.14",
93
94
  "better-sqlite3": "^12.10.0",
94
95
  "dotenv": "^17.3.1",
95
96
  "ioredis": "^5.11.1",