qlogicagent 2.13.10 → 2.14.1
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 +10 -6
- package/dist/cli.js +362 -347
- package/dist/index.js +361 -346
- package/dist/orchestration.js +14 -14
- package/dist/protocol.js +1 -1
- package/dist/types/agent/agent.d.ts +1 -0
- package/dist/types/agent/tool-loop/completion-action-policy.d.ts +28 -1
- package/dist/types/agent/tool-loop/loop-helpers.d.ts +3 -1
- package/dist/types/agent/types.d.ts +7 -0
- package/dist/types/cli/acp-extended-handlers.d.ts +1 -0
- package/dist/types/cli/base-tool-bootstrap.d.ts +3 -0
- package/dist/types/cli/handlers/turn-handler.d.ts +8 -1
- package/dist/types/cli/product-coordinator.d.ts +2 -2
- package/dist/types/cli/session-query-service.d.ts +3 -0
- package/dist/types/cli/stdio-runtime-bootstrap.d.ts +1 -0
- package/dist/types/cli/stdio-runtime-services.d.ts +1 -0
- package/dist/types/cli/tool-bootstrap-community-registration.d.ts +6 -0
- package/dist/types/cli/tool-bootstrap-core-registration.d.ts +3 -0
- package/dist/types/cli/tool-bootstrap-media-registration.d.ts +2 -0
- package/dist/types/cli/tool-bootstrap.d.ts +3 -0
- package/dist/types/orchestration/agent-instance.d.ts +3 -2
- package/dist/types/orchestration/product-worktree.d.ts +2 -0
- package/dist/types/protocol/wire/agent-events.d.ts +2 -2
- package/dist/types/protocol/wire/gateway-rpc.d.ts +4 -2
- package/dist/types/runtime/community/activity-event-emitter.d.ts +7 -0
- package/dist/types/runtime/community/activity-event.d.ts +3 -1
- package/dist/types/runtime/community/community-consent-client.d.ts +14 -0
- package/dist/types/runtime/community/pet-activity-sink.d.ts +36 -0
- package/dist/types/runtime/config/tunable-defaults.d.ts +3 -0
- package/dist/types/runtime/execution/streaming-tool-executor.d.ts +3 -0
- package/dist/types/runtime/infra/agent-process.d.ts +16 -0
- package/dist/types/runtime/infra/codex-llmrouter-compat-proxy.d.ts +4 -0
- package/dist/types/runtime/infra/media-persistence.d.ts +17 -0
- package/dist/types/runtime/ports/agent-runtime-ports.d.ts +1 -0
- package/dist/types/runtime/ports/tool-contracts.d.ts +3 -0
- package/dist/types/runtime/prompt/fresh-workspace-evidence.d.ts +1 -0
- package/dist/types/runtime/session/session-deletion-guard.d.ts +4 -0
- package/dist/types/runtime/session/session-transcript-store.d.ts +1 -0
- package/dist/types/runtime/session/session-write-queue.d.ts +1 -0
- package/dist/types/skills/tools/community-seek-tool.d.ts +9 -0
- package/dist/types/skills/tools/file-tool-arguments.d.ts +5 -0
- package/dist/types/skills/tools/image-generate-tool.d.ts +24 -0
- package/dist/types/skills/tools/read-tool.d.ts +2 -0
- package/dist/types/skills/tools/shell/host-paths.d.ts +2 -0
- package/dist/types/skills/tools/task-tool.d.ts +2 -0
- package/dist/types/skills/tools/team-tool.d.ts +0 -4
- package/dist/vendor/hatch-pet/scripts/prepare_pet_run.py +8 -4
- package/package.json +2 -2
|
@@ -7,6 +7,7 @@ import { type PetRuntime } from "./pet-runtime.js";
|
|
|
7
7
|
import { type TurnMediaSetupHost } from "./turn-media-setup.js";
|
|
8
8
|
export interface StdioRuntimeServicesDeps {
|
|
9
9
|
getActiveProjectRoot(): string;
|
|
10
|
+
getCurrentSessionId?(): string | undefined;
|
|
10
11
|
resolveClientForPurpose(purpose: import("../runtime/infra/model-registry.js").ModelPurpose): {
|
|
11
12
|
transport: LLMTransport;
|
|
12
13
|
apiKey: string;
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import type { PortableTool } from "../skills/portable-tool.js";
|
|
2
|
+
import { type CommunitySeekAnswerCandidate } from "../skills/tools/community-seek-tool.js";
|
|
2
3
|
import { type CommunityDiscoveryResult } from "../runtime/community/community-discovery-coordinator.js";
|
|
4
|
+
import { type PetActivitySink } from "../runtime/community/pet-activity-sink.js";
|
|
3
5
|
export interface LocalCommunityToolRegistrationContext {
|
|
4
6
|
tools: PortableTool<any>[];
|
|
5
7
|
/** 测试可注入的发现实现;默认从 env consent client 构造协调器。 */
|
|
6
8
|
discover?: (intent: string) => Promise<CommunityDiscoveryResult>;
|
|
9
|
+
/** 测试可注入的经验答案源;默认经 consent client 调 hub /reviews/search(bge-m3 语义检索)。 */
|
|
10
|
+
findAnswers?: (intent: string, topK: number) => Promise<CommunitySeekAnswerCandidate[]>;
|
|
11
|
+
/** 测试可注入的活动发射 sink;默认从 env 解析 actorPetId 构造(无身份→null,不发)。 */
|
|
12
|
+
petActivitySink?: PetActivitySink | null;
|
|
7
13
|
}
|
|
8
14
|
export declare const localCommunityToolRegistrationModule: import("../runtime/ports/tool-contracts.js").ToolRegistrationModule<LocalCommunityToolRegistrationContext>;
|
|
9
15
|
export declare function registerLocalCommunityTools(context: LocalCommunityToolRegistrationContext): void;
|
|
@@ -9,7 +9,10 @@ export interface LocalCoreToolRegistrationContext {
|
|
|
9
9
|
tools: PortableTool<any>[];
|
|
10
10
|
taskToolHooks?: TaskToolHooks;
|
|
11
11
|
backgroundTaskRuntime: BackgroundTaskManager | null;
|
|
12
|
+
getBackgroundTaskRuntime?: () => BackgroundTaskManager | null;
|
|
13
|
+
getTaskScopeKey?: () => string | undefined;
|
|
12
14
|
askUserCallback: ((questions: AskUserQuestion[]) => Promise<Record<string, string> | null>) | null;
|
|
15
|
+
getAskUserCallback?: () => ((questions: AskUserQuestion[]) => Promise<Record<string, string> | null>) | null;
|
|
13
16
|
onExecProgress?: (progress: ExecProgress) => void;
|
|
14
17
|
getCwd(): string;
|
|
15
18
|
activeProjectRoot(): string;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { PortableTool } from "../skills/portable-tool.js";
|
|
2
|
+
import type { MediaPersistence } from "../runtime/infra/media-persistence.js";
|
|
2
3
|
export interface LocalMediaToolRegistrationContext {
|
|
3
4
|
tools: PortableTool<any>[];
|
|
4
5
|
getCwd(): string;
|
|
5
6
|
activeProjectRoot(): string;
|
|
7
|
+
mediaPersistence?: MediaPersistence;
|
|
6
8
|
}
|
|
7
9
|
export declare const localMediaToolRegistrationModule: import("../runtime/ports/tool-contracts.js").ToolRegistrationModule<LocalMediaToolRegistrationContext>;
|
|
8
10
|
export declare function registerLocalMediaTools(context: LocalMediaToolRegistrationContext): void;
|
|
@@ -4,6 +4,7 @@ import type { TaskToolHooks } from "../skills/tools/task-tool.js";
|
|
|
4
4
|
import type { ExecProgress } from "../skills/tools/exec-tool.js";
|
|
5
5
|
import type { BackgroundTaskManager } from "../runtime/infra/background-tasks.js";
|
|
6
6
|
import type { ModelPurpose } from "../runtime/infra/model-registry.js";
|
|
7
|
+
import type { MediaPersistence } from "../runtime/infra/media-persistence.js";
|
|
7
8
|
import type { LLMTransport } from "./provider-core-facade.js";
|
|
8
9
|
import type { AgentLogger } from "../agent/types.js";
|
|
9
10
|
import type { AskUserQuestion } from "../skills/tools/ask-user-tool.js";
|
|
@@ -42,6 +43,7 @@ export interface BootstrapConfig {
|
|
|
42
43
|
workdir?: string;
|
|
43
44
|
toolCatalog?: ToolCatalog;
|
|
44
45
|
pathService?: PathService;
|
|
46
|
+
mediaPersistence?: MediaPersistence;
|
|
45
47
|
log?: AgentLogger;
|
|
46
48
|
/** Called during foreground shell execution with incremental progress. */
|
|
47
49
|
onExecProgress?(progress: ExecProgress): void;
|
|
@@ -51,6 +53,7 @@ export interface BootstrapConfig {
|
|
|
51
53
|
apiKey: string;
|
|
52
54
|
model: string;
|
|
53
55
|
} | null;
|
|
56
|
+
getTaskScopeKey?(): string | undefined;
|
|
54
57
|
}
|
|
55
58
|
/**
|
|
56
59
|
* Create all locally-executable tools and install into centralized tool pool.
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
import type { AgentProcessManager } from "../runtime/infra/agent-process.js";
|
|
15
15
|
import type { AcpDetector } from "../runtime/infra/acp-detector.js";
|
|
16
16
|
import type { AgentConfigStore } from "../runtime/infra/agent-config-store.js";
|
|
17
|
-
import type { ProductCreateParams, ProductStatus, ProductSummary } from "../protocol/wire/acp-agent-management.js";
|
|
17
|
+
import type { ProductPhase, ProductCreateParams, ProductStatus, ProductSummary } from "../protocol/wire/acp-agent-management.js";
|
|
18
18
|
import type { DagMutation } from "./product-planner.js";
|
|
19
19
|
import type { ProductLeaderCoordinator } from "./product-run-coordinator.js";
|
|
20
20
|
export type { ProductLeaderCoordinator } from "./product-run-coordinator.js";
|
|
@@ -28,7 +28,7 @@ export interface ProductCallbacks {
|
|
|
28
28
|
onTaskFailed?: (productId: string, taskId: string, error: string) => void;
|
|
29
29
|
onCheckpointed?: (productId: string, timestamp: string) => void;
|
|
30
30
|
onBudgetWarning?: (productId: string, usedTokens: number, maxTotalTokens: number, percentage: number) => void;
|
|
31
|
-
onCompleted?: (productId: string, summary: string) => void;
|
|
31
|
+
onCompleted?: (productId: string, summary: string, phase: Extract<ProductPhase, "completed" | "failed">) => void;
|
|
32
32
|
/** DAG topology resolved and sent to client for visualization. */
|
|
33
33
|
onDagTopology?: (productId: string, nodes: {
|
|
34
34
|
id: string;
|
|
@@ -69,6 +69,7 @@ export declare class ProductOrchestrator {
|
|
|
69
69
|
rollback(productId: string, _checkpoint: string): Promise<void>;
|
|
70
70
|
/** Get product status. */
|
|
71
71
|
getStatus(productId: string): ProductStatus | null;
|
|
72
|
+
getPersistedStatus(productId: string, cwd?: string): Promise<ProductStatus | null>;
|
|
72
73
|
/** List all products (in-memory + on-disk). */
|
|
73
74
|
list(cwd?: string): Promise<ProductSummary[]>;
|
|
74
75
|
private scheduleNext;
|
|
@@ -6,6 +6,8 @@ export declare function findGitRoot(cwd: string): Promise<string | null>;
|
|
|
6
6
|
/** Create an isolated git worktree. Returns the worktree path. */
|
|
7
7
|
export declare function createWorktree(gitRoot: string, name: string, baseBranch?: string): Promise<string>;
|
|
8
8
|
export declare function getWorktreeDiff(worktreePath: string): Promise<string>;
|
|
9
|
+
/** Copy the changed files from a task worktree back into the product workspace. */
|
|
10
|
+
export declare function materializeWorktreeChanges(worktreePath: string, targetRoot: string): Promise<void>;
|
|
9
11
|
/** Remove a git worktree. */
|
|
10
12
|
export declare function removeWorktree(gitRoot: string, path: string): Promise<void>;
|
|
11
13
|
/** Merge a worktree branch into the current branch. */
|
|
@@ -18,12 +18,12 @@ export declare const AGENT_WS_EVENT_NAMES: readonly ["turn.start", "turn.delta",
|
|
|
18
18
|
* Agent Team events (Solo Mode, Product Mode, Plan lifecycle).
|
|
19
19
|
* Relayed to the UI's team/orchestration panel.
|
|
20
20
|
*/
|
|
21
|
-
export declare const AGENT_TEAM_WS_EVENT_NAMES: readonly ["solo.progress", "solo.agentDelta", "solo.agentUsage", "solo.agentDiff", "solo.evaluation", "product.taskStarted", "product.taskOutput", "product.taskCompleted", "product.taskFailed", "product.budgetUpdate", "product.checkpointed", "product.dagTopology", "plan.interrupted"];
|
|
21
|
+
export declare const AGENT_TEAM_WS_EVENT_NAMES: readonly ["solo.progress", "solo.agentDelta", "solo.agentUsage", "solo.agentDiff", "solo.evaluation", "product.taskStarted", "product.taskOutput", "product.taskCompleted", "product.taskFailed", "product.budgetUpdate", "product.budgetWarning", "product.checkpointed", "product.completed", "product.dagTopology", "plan.interrupted"];
|
|
22
22
|
/**
|
|
23
23
|
* All agent notifications that Gateway should relay to WS clients.
|
|
24
24
|
* Union of session events + team events.
|
|
25
25
|
*/
|
|
26
|
-
export declare const ALL_AGENT_WS_EVENT_NAMES: readonly ["turn.start", "turn.delta", "turn.end", "turn.error", "turn.recovery", "turn.tool_call", "turn.tool_result", "turn.tool_blocked", "turn.reasoning_delta", "turn.approval_request", "turn.skill_instruction", "turn.ask_user", "turn.media_result", "turn.media_progress", "turn.media_usage", "turn.media_capability_check", "turn.plan_update", "turn.suggestions", "turn.sidechain_started", "turn.subagent_delta", "turn.sidechain_completed", "turn.task_updated", "turn.todos_updated", "turn.exec_progress", "turn.usage_update", "team.member.notification", "session.info", "memory.updated", "skills.updated", "pet.soul_ready", "pet.reaction", "pet.growth", "pet.state", "pet.confirm", "pet.asset.updated", "system.activity", "workflow.created", "workflow.updated", "workflow.deleted", "workflow.runStarted", "workflow.runCompleted", "workflow.runFailed", "workflow.nodeStatus", "workflow.triggerDropped", "workflow.alert", "workflow.approvalRequested", "solo.progress", "solo.agentDelta", "solo.agentUsage", "solo.agentDiff", "solo.evaluation", "product.taskStarted", "product.taskOutput", "product.taskCompleted", "product.taskFailed", "product.budgetUpdate", "product.checkpointed", "product.dagTopology", "plan.interrupted"];
|
|
26
|
+
export declare const ALL_AGENT_WS_EVENT_NAMES: readonly ["turn.start", "turn.delta", "turn.end", "turn.error", "turn.recovery", "turn.tool_call", "turn.tool_result", "turn.tool_blocked", "turn.reasoning_delta", "turn.approval_request", "turn.skill_instruction", "turn.ask_user", "turn.media_result", "turn.media_progress", "turn.media_usage", "turn.media_capability_check", "turn.plan_update", "turn.suggestions", "turn.sidechain_started", "turn.subagent_delta", "turn.sidechain_completed", "turn.task_updated", "turn.todos_updated", "turn.exec_progress", "turn.usage_update", "team.member.notification", "session.info", "memory.updated", "skills.updated", "pet.soul_ready", "pet.reaction", "pet.growth", "pet.state", "pet.confirm", "pet.asset.updated", "system.activity", "workflow.created", "workflow.updated", "workflow.deleted", "workflow.runStarted", "workflow.runCompleted", "workflow.runFailed", "workflow.nodeStatus", "workflow.triggerDropped", "workflow.alert", "workflow.approvalRequested", "solo.progress", "solo.agentDelta", "solo.agentUsage", "solo.agentDiff", "solo.evaluation", "product.taskStarted", "product.taskOutput", "product.taskCompleted", "product.taskFailed", "product.budgetUpdate", "product.budgetWarning", "product.checkpointed", "product.completed", "product.dagTopology", "plan.interrupted"];
|
|
27
27
|
/** Type-level event name for session events. */
|
|
28
28
|
export type AgentWsEventName = (typeof AGENT_WS_EVENT_NAMES)[number];
|
|
29
29
|
/** Type-level event name for team events. */
|
|
@@ -27,7 +27,7 @@ export interface ProjectInfo {
|
|
|
27
27
|
groupId?: string;
|
|
28
28
|
createdAt: string;
|
|
29
29
|
updatedAt: string;
|
|
30
|
-
planStatus?: "creating" | "running" | "completed" | "cancelled";
|
|
30
|
+
planStatus?: "creating" | "running" | "completed" | "failed" | "cancelled";
|
|
31
31
|
planAgents?: string[];
|
|
32
32
|
planWinnerId?: string;
|
|
33
33
|
leaderSessionId?: string;
|
|
@@ -124,6 +124,7 @@ export interface GatewayRpcMethodMap {
|
|
|
124
124
|
groupKey?: string;
|
|
125
125
|
groupPlatform?: string;
|
|
126
126
|
lastActiveAt?: string;
|
|
127
|
+
messageCount: number;
|
|
127
128
|
pinnedAt?: string | null;
|
|
128
129
|
archivedAt?: string | null;
|
|
129
130
|
projectId: string;
|
|
@@ -142,6 +143,7 @@ export interface GatewayRpcMethodMap {
|
|
|
142
143
|
groupKey?: string;
|
|
143
144
|
groupPlatform?: string;
|
|
144
145
|
lastActiveAt?: string;
|
|
146
|
+
messageCount?: number;
|
|
145
147
|
pinnedAt?: string | null;
|
|
146
148
|
archivedAt?: string | null;
|
|
147
149
|
} | null;
|
|
@@ -299,7 +301,7 @@ export interface GatewayRpcMethodMap {
|
|
|
299
301
|
"project.update": {
|
|
300
302
|
params: {
|
|
301
303
|
projectId: string;
|
|
302
|
-
planStatus?: "creating" | "running" | "completed" | "cancelled";
|
|
304
|
+
planStatus?: "creating" | "running" | "completed" | "failed" | "cancelled";
|
|
303
305
|
planAgents?: string[];
|
|
304
306
|
planWinnerId?: string;
|
|
305
307
|
leaderSessionId?: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type ActivityEvent, type CreateActivityEventInput } from "./activity-event.js";
|
|
2
2
|
import { type CommunityConsentClient } from "./community-consent-client.js";
|
|
3
|
+
import type { ConfigPort } from "../ports/index.js";
|
|
3
4
|
export type ActivityEmitStatus = "emitted" | "disabled" | "consent-blocked" | "failed";
|
|
4
5
|
/** 活动事件出口:真实实现把事件写入 community-service(社交通道,非权威)。 */
|
|
5
6
|
export interface ActivityEventTransport {
|
|
@@ -22,3 +23,9 @@ export declare function createHubActivityTransport(client: Pick<CommunityConsent
|
|
|
22
23
|
* 无 token(dev)→ client null → transport null(emit 返回 "disabled",fail-safe)。
|
|
23
24
|
*/
|
|
24
25
|
export declare function createDefaultActivityEventEmitter(): ActivityEventEmitter;
|
|
26
|
+
/**
|
|
27
|
+
* 解析本 agent 自己的 actorPetId = derivePetKey(owner, device)(Cut7/#1)。
|
|
28
|
+
* owner=QLOGIC_LLMROUTER_USER_ID、device=QLOGIC_LLMROUTER_DEVICE_ID(gateway 经 buildQlogicagentLlmrouterEnv 注入)。
|
|
29
|
+
* 缺料(未登录/dev)→ null:调用方应跳过发射(fail-soft,绝不因社交写挂任务)。
|
|
30
|
+
*/
|
|
31
|
+
export declare function resolveSelfActorPetId(configPort?: ConfigPort): string | null;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export type TrustSignalEventType = "installed" | "success" | "fail" | "error" | "kept" | "uninstalled" | "endorse";
|
|
2
2
|
export type ExperientialEventType = "acquire" | "ask" | "answer" | "encounter" | "review";
|
|
3
3
|
export type FlauntEventType = "unlock" | "flaunt";
|
|
4
|
-
|
|
4
|
+
/** 浏览/搜索族(Cut7/M5:agent 搜资源 → 宠物到该区"逛")。非 trust-signal;community 可见走 encounter 闸。 */
|
|
5
|
+
export type BrowseEventType = "search";
|
|
6
|
+
export type ActivityEventType = TrustSignalEventType | ExperientialEventType | FlauntEventType | BrowseEventType;
|
|
5
7
|
/**
|
|
6
8
|
* 空间锚点:agent 发射时本就持有 resourceId 与其 category,事件自带锚点让集市
|
|
7
9
|
* 端零反查地把微动画钉到正确街区 / 店铺。**只允许 districtId / shopId。**
|
|
@@ -42,6 +42,8 @@ export interface CommunityConsentClient {
|
|
|
42
42
|
emitActivity?(event: ActivityEvent): Promise<void>;
|
|
43
43
|
/** Cut4: author an agent review for a resource (social channel). Optional for mocks. */
|
|
44
44
|
recordCommunityReview?(input: CommunityReviewInput): Promise<void>;
|
|
45
|
+
/** Cut4: semantic-search peer agent experiences (bge-m3 over community_review) → community_seek answer family. Optional for mocks. */
|
|
46
|
+
findReviewAnswers?(query: string, topK?: number): Promise<CommunityReviewAnswer[]>;
|
|
45
47
|
/** Cut4: post a help request to the community (social channel). Optional for mocks. */
|
|
46
48
|
recordCommunityAsk?(input: CommunityAskInput): Promise<void>;
|
|
47
49
|
/** Cut4: answer a peer's help request (social channel). Optional for mocks. */
|
|
@@ -89,6 +91,8 @@ export interface CommunityRegistryMatchResult {
|
|
|
89
91
|
type: string;
|
|
90
92
|
title: string;
|
|
91
93
|
summary: string;
|
|
94
|
+
/** RESOURCE_CATEGORIES key(search 表演锚点;hub match 返回 ResourceView.category)。 */
|
|
95
|
+
category: string | null;
|
|
92
96
|
capabilityTags: string[];
|
|
93
97
|
sourceTier: CommunityInstallSourceTier;
|
|
94
98
|
trustStage: CommunityInstallTrustStage;
|
|
@@ -134,6 +138,16 @@ export interface CommunityReviewInput {
|
|
|
134
138
|
contextCategory?: string;
|
|
135
139
|
ts: number;
|
|
136
140
|
}
|
|
141
|
+
/** Cut4 经验答案(community_seek 答案族源):hub /reviews/search 的 bge-m3 语义检索结果。 */
|
|
142
|
+
export interface CommunityReviewAnswer {
|
|
143
|
+
id: string;
|
|
144
|
+
resourceId: string;
|
|
145
|
+
actorPetId: string;
|
|
146
|
+
experience: string;
|
|
147
|
+
outcome: "success" | "fail" | "neutral";
|
|
148
|
+
contextCategory: string | null;
|
|
149
|
+
ts: number;
|
|
150
|
+
}
|
|
137
151
|
/** Cut4 求助频道:agent 发求助帖。question 须已脱敏(R24)。 */
|
|
138
152
|
export interface CommunityAskInput {
|
|
139
153
|
id: string;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type ActivityEventType, type ActivitySpatialAnchor } from "./activity-event.js";
|
|
2
|
+
import { type ActivityEmitStatus, type ActivityEventEmitter } from "./activity-event-emitter.js";
|
|
3
|
+
import { type CommunityConsentClient } from "./community-consent-client.js";
|
|
4
|
+
import type { ConfigPort } from "../ports/config-port.js";
|
|
5
|
+
/** 一条要发射的活动:类型 + 空间锚点(街区/店铺)+ 可选对端 + 敏感度。actorPetId/ts/id 由 sink 注入。 */
|
|
6
|
+
export interface PetActivityInput {
|
|
7
|
+
type: ActivityEventType;
|
|
8
|
+
anchor?: ActivitySpatialAnchor;
|
|
9
|
+
peerRef?: string;
|
|
10
|
+
/** 高敏感内容 → 升级问人,不自动外发(DR3);默认 false。 */
|
|
11
|
+
highSensitivity?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export type PetActivityEmitStatus = ActivityEmitStatus | "escalate";
|
|
14
|
+
export interface PetActivitySink {
|
|
15
|
+
/** 发一条活动事件。绝不抛(任何失败都 best-effort 吞掉)。 */
|
|
16
|
+
emit(input: PetActivityInput): Promise<PetActivityEmitStatus>;
|
|
17
|
+
}
|
|
18
|
+
export interface PetActivitySinkDeps {
|
|
19
|
+
actorPetId: string;
|
|
20
|
+
consent: Pick<CommunityConsentClient, "getConsent">;
|
|
21
|
+
emitter: ActivityEventEmitter;
|
|
22
|
+
now: () => number;
|
|
23
|
+
newId: () => string;
|
|
24
|
+
}
|
|
25
|
+
/** 纯逻辑 sink(可注入,供测试)。游历闸定 visibility,emitter 落库。 */
|
|
26
|
+
export declare function createPetActivitySink(deps: PetActivitySinkDeps): PetActivitySink;
|
|
27
|
+
/**
|
|
28
|
+
* 由 (owner,device) 派生本 agent 自家宠物的 actorPetId。env 由 gateway 注入。
|
|
29
|
+
* 缺 owner/device(dev / 未登录)→ null(无身份不发,fail-safe)。
|
|
30
|
+
*/
|
|
31
|
+
export declare function resolveActorPetId(configPort?: ConfigPort): string | null;
|
|
32
|
+
/**
|
|
33
|
+
* 默认 sink:从 env 解析 actorPetId + 构造 consent/transport。
|
|
34
|
+
* 无身份 / 无 token(dev)→ null(调用方 ?.emit 即 no-op,fail-safe 不发)。
|
|
35
|
+
*/
|
|
36
|
+
export declare function createDefaultPetActivitySink(configPort?: ConfigPort): PetActivitySink | null;
|
|
@@ -23,6 +23,8 @@ export declare const DEFAULT_TEMPERATURE = 0;
|
|
|
23
23
|
export declare const MAX_TOOL_BUDGET_CAP = 100;
|
|
24
24
|
/** Default tool budget per round. Overridable via TOOL_LOOP_DEFAULT_BUDGET env. */
|
|
25
25
|
export declare const DEFAULT_TOOL_BUDGET: number;
|
|
26
|
+
/** Foreground tool execution deadline in ms. Long jobs should use background tasks. */
|
|
27
|
+
export declare const DEFAULT_TOOL_EXECUTION_TIMEOUT_MS: number;
|
|
26
28
|
/** Max consecutive tool call failures before early exit. */
|
|
27
29
|
export declare const MAX_CONSECUTIVE_FAILURES = 3;
|
|
28
30
|
/** Max times the exact same (tool_name, arguments) pair can repeat. */
|
|
@@ -179,6 +181,7 @@ export interface TunableDefaults {
|
|
|
179
181
|
defaultTemperature: number;
|
|
180
182
|
maxToolBudgetCap: number;
|
|
181
183
|
defaultToolBudget: number;
|
|
184
|
+
defaultToolExecutionTimeoutMs: number;
|
|
182
185
|
maxConsecutiveFailures: number;
|
|
183
186
|
maxIdenticalCallRepeats: number;
|
|
184
187
|
defaultContextWindowTokens: number;
|
|
@@ -35,6 +35,8 @@ export interface StreamingToolExecutorConfig {
|
|
|
35
35
|
concurrencySafeTools?: Set<string>;
|
|
36
36
|
/** Hard ceiling on simultaneous tool executions (0 = unlimited). CC parity. */
|
|
37
37
|
maxConcurrentTools?: number;
|
|
38
|
+
/** Per foreground tool deadline. 0 or undefined means no executor deadline. */
|
|
39
|
+
maxExecutionMs?: number;
|
|
38
40
|
}
|
|
39
41
|
/**
|
|
40
42
|
* Executes tools with concurrency control and streaming progress.
|
|
@@ -99,4 +101,5 @@ export declare class StreamingToolExecutor {
|
|
|
99
101
|
private hasCompletedResults;
|
|
100
102
|
private hasExecutingTools;
|
|
101
103
|
private hasUnfinishedTools;
|
|
104
|
+
private invokeToolWithDeadline;
|
|
102
105
|
}
|
|
@@ -99,6 +99,19 @@ export interface AgentProcessHandle {
|
|
|
99
99
|
lastActivityAt?: number;
|
|
100
100
|
/** Whether the ACP agent supports session/resume (D-1). */
|
|
101
101
|
supportsResume?: boolean;
|
|
102
|
+
/** ACP session/update types observed during the current external-agent prompt. */
|
|
103
|
+
acpUpdateTypes?: string[];
|
|
104
|
+
/** Stderr log path for this agent process, when diagnostics logging is enabled. */
|
|
105
|
+
stderrLogPath?: string;
|
|
106
|
+
/** Sanitized external ACP launch details for empty-output diagnostics. */
|
|
107
|
+
acpLaunchDiagnostics?: {
|
|
108
|
+
cliPath: string;
|
|
109
|
+
acpArgs: string[];
|
|
110
|
+
cwd: string;
|
|
111
|
+
env: string;
|
|
112
|
+
};
|
|
113
|
+
/** Last external ACP prompt elapsed time in milliseconds. */
|
|
114
|
+
acpLastPromptElapsedMs?: number;
|
|
102
115
|
}
|
|
103
116
|
/** Callbacks for process lifecycle events. */
|
|
104
117
|
export interface AgentProcessCallbacks {
|
|
@@ -127,6 +140,7 @@ export interface AgentProcessCallbacks {
|
|
|
127
140
|
/** Session directory for stderr logs. If set, ACP agent stderr is written to {sessionDir}/{agentId}.stderr.log. */
|
|
128
141
|
sessionDir?: string;
|
|
129
142
|
}
|
|
143
|
+
export declare function ensureLoopbackNoProxy(env: Record<string, string>): Record<string, string>;
|
|
130
144
|
/**
|
|
131
145
|
* Build LLM-related environment variables for an external ACP teammate.
|
|
132
146
|
*
|
|
@@ -149,6 +163,7 @@ export declare const ACP_FAULT_LEVEL: {
|
|
|
149
163
|
readonly WARN: "warn";
|
|
150
164
|
};
|
|
151
165
|
export type AcpFaultLevel = (typeof ACP_FAULT_LEVEL)[keyof typeof ACP_FAULT_LEVEL];
|
|
166
|
+
export declare function sanitizeAgentLogFileName(memberId: string): string;
|
|
152
167
|
/**
|
|
153
168
|
* Manages a pool of child agent processes.
|
|
154
169
|
* Each child is a `qlogicagent` subprocess using JSON-RPC over stdio.
|
|
@@ -171,6 +186,7 @@ export declare class AgentProcessManager {
|
|
|
171
186
|
sessionId?: string;
|
|
172
187
|
timeout?: number;
|
|
173
188
|
}): Promise<unknown>;
|
|
189
|
+
private buildExternalPromptDiagnostics;
|
|
174
190
|
/** Send a raw JSON-RPC request to a child. */
|
|
175
191
|
sendRpc(memberId: string, method: string, params?: unknown, timeoutMs?: number): Promise<unknown>;
|
|
176
192
|
/**
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function filterCodexResponsesTools(body: unknown): unknown;
|
|
2
|
+
export declare function ensureCodexLlmrouterCompatProxy(upstreamBaseUrl: string): Promise<string>;
|
|
3
|
+
export declare function resetCodexLlmrouterCompatProxyForTests(): Promise<void>;
|
|
4
|
+
export declare function setCodexLlmrouterCompatProxyDiagnosticPathForTests(path: string): void;
|
|
@@ -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,12 +59,14 @@ 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;
|
|
64
66
|
error(message: string): void;
|
|
65
67
|
debug(message: string): void;
|
|
66
68
|
};
|
|
69
|
+
getTaskScopeKey?(): string | undefined;
|
|
67
70
|
onExecProgress?(progress: ToolBootstrapProgress): void;
|
|
68
71
|
}
|
|
69
72
|
export interface ToolBootstrap {
|
|
@@ -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;
|
|
@@ -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[]>;
|
|
@@ -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>;
|
|
@@ -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[];
|
|
@@ -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
|
|
141
|
-
"
|
|
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="
|
|
677
|
+
default="painterly",
|
|
675
678
|
choices=sorted(STYLE_PRESETS),
|
|
676
|
-
help="Pet-safe style preset
|
|
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.
|
|
3
|
+
"version": "2.14.1",
|
|
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.
|
|
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",
|