@huyooo/ai-chat-frontend-vue 0.3.31 → 0.3.32

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.
@@ -1,7 +1,7 @@
1
1
  import * as VueRuntime from "vue";
2
2
  import { defineComponent, inject, ref, computed, onMounted, watch, onBeforeUnmount, createElementBlock, openBlock, normalizeStyle, createCommentVNode, createElementVNode, createVNode, unref, toDisplayString } from "vue";
3
3
  import { Icon } from "@iconify/vue";
4
- import { D, A, b, _ as _export_sfc } from "./index-BOziByOM.js";
4
+ import { D, A, b, _ as _export_sfc } from "./index-C8JDRRkn.js";
5
5
  const e = `data-huyooo-extension-theme`, t = `
6
6
  :host {
7
7
  --sx-bg: var(--chat-bg, var(--huyooo-bg, #ffffff));
@@ -49,8 +49,6 @@ declare const _default: import("vue").DefineComponent<Props, {
49
49
  focusInput: () => void;
50
50
  /** 发送消息 */
51
51
  sendMessage: (text: string) => void;
52
- /** 当前工作目录 */
53
- setCwd: (dir: string) => void;
54
52
  /** 重新加载聊天能力快照 */
55
53
  loadCapabilities: () => Promise<void>;
56
54
  /** 重新从主进程拉取聊天能力与偏好 */
@@ -1,6 +1,6 @@
1
1
  import type { ContentPart, FinishReason } from '../../types';
2
2
  import type { ChatAdapter, ImageData } from '../../adapter';
3
- import type { AtContextItem, AutoRunConfig } from '@huyooo/ai-chat-types';
3
+ import type { AtContextItem } from '@huyooo/ai-chat-types';
4
4
  type __VLS_Props = {
5
5
  role: 'user' | 'assistant' | 'system';
6
6
  /** 消息 ID(用于 retry 等操作) */
@@ -37,8 +37,7 @@ type __VLS_Props = {
37
37
  onCancelToolCall?: (toolCallId: string) => void;
38
38
  /** 重试失败的工具调用(toolError.retryable 时) */
39
39
  onRetryToolCall?: (messageId: string, toolCallId: string) => void;
40
- autoRunConfig?: AutoRunConfig;
41
- onSaveConfig?: (config: AutoRunConfig) => Promise<void>;
40
+ onAllowToolForSession?: (toolKey: string) => void;
42
41
  /** 结束原因(done 事件携带) */
43
42
  finishReason?: FinishReason;
44
43
  /** Token 使用统计 */
@@ -1,7 +1,6 @@
1
1
  import type { Component } from 'vue';
2
2
  import type { ContentPart, StepsExpandedType } from '../../types';
3
3
  import type { ChatAdapter } from '../../adapter';
4
- import type { AutoRunConfig } from '@huyooo/ai-chat-types';
5
4
  type __VLS_Props = {
6
5
  parts: ContentPart[];
7
6
  expandedType?: StepsExpandedType;
@@ -12,8 +11,7 @@ type __VLS_Props = {
12
11
  onCancelToolCall?: (toolCallId: string) => void;
13
12
  /** 重试失败的工具调用(透传给 ToolCallPart) */
14
13
  onRetryToolCall?: (toolCallId: string) => void;
15
- autoRunConfig?: AutoRunConfig;
16
- onSaveConfig?: (config: AutoRunConfig) => Promise<void>;
14
+ onAllowToolForSession?: (toolKey: string) => void;
17
15
  };
18
16
  declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
19
17
  expandedType: StepsExpandedType;
@@ -9,12 +9,19 @@ type __VLS_Props = {
9
9
  titleColor?: string;
10
10
  /** 副标题 */
11
11
  subtitle?: string;
12
- /** 是否展开 */
13
- modelValue: boolean;
14
12
  /** 图标是否旋转(加载状态) */
15
13
  spinning?: boolean;
16
14
  /** 是否可折叠(显示 chevron) */
17
15
  collapsible?: boolean;
16
+ /** 标题可点击(如打开文件) */
17
+ titleInteractive?: boolean;
18
+ /** 标题原生 title 提示 */
19
+ titleTooltip?: string;
20
+ /** 待确认等场景的视觉强调 */
21
+ attention?: 'none' | 'warning' | 'danger';
22
+ };
23
+ type __VLS_PublicProps = __VLS_Props & {
24
+ modelValue: boolean;
18
25
  };
19
26
  declare var __VLS_9: {}, __VLS_19: {};
20
27
  type __VLS_Slots = {} & {
@@ -22,14 +29,18 @@ type __VLS_Slots = {} & {
22
29
  } & {
23
30
  default?: (props: typeof __VLS_19) => any;
24
31
  };
25
- declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
32
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
33
+ "title-click": () => any;
26
34
  "update:modelValue": (value: boolean) => any;
27
- }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
35
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
36
+ "onTitle-click"?: (() => any) | undefined;
28
37
  "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
29
38
  }>, {
30
39
  iconColor: string;
31
40
  spinning: boolean;
32
41
  collapsible: boolean;
42
+ titleInteractive: boolean;
43
+ attention: "none" | "warning" | "danger";
33
44
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
34
45
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
35
46
  export default _default;
@@ -1,5 +1,10 @@
1
+ import type { CompressionStrategy } from '../../../types';
1
2
  type __VLS_Props = {
2
3
  status: 'running' | 'done' | 'failed';
4
+ model?: string;
5
+ modelLabel?: string;
6
+ strategy?: CompressionStrategy;
7
+ error?: string;
3
8
  estimatedTokens?: number;
4
9
  budget?: number;
5
10
  compressedTokens?: number;
@@ -1,9 +1,14 @@
1
+ import type { CompressionStrategy } from '../../../types';
1
2
  type __VLS_Props = {
2
3
  status: 'running' | 'done' | 'failed';
3
4
  model?: string;
5
+ modelLabel?: string;
6
+ strategy?: CompressionStrategy;
7
+ error?: string;
4
8
  summary?: string;
5
9
  originalTokens?: number;
6
10
  compressedTokens?: number;
11
+ budget?: number;
7
12
  duration?: number;
8
13
  };
9
14
  declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -1,6 +1,7 @@
1
1
  type __VLS_Props = {
2
2
  message: string;
3
3
  category?: string;
4
+ code?: string;
4
5
  retryable?: boolean;
5
6
  };
6
7
  declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -1,10 +1,12 @@
1
1
  import type { ChatAdapter } from '../../../adapter';
2
- import type { AutoRunConfig } from '@huyooo/ai-chat-types';
3
- import type { AssetApprovalPolicy, AssetHostDependency, AssetSideEffectLevel, ToolApprovalReason } from '@huyooo/ai-chat-shared';
2
+ import type { ToolConfirmationReason } from '@huyooo/ai-chat-shared';
4
3
  import type { StepsExpandedType } from '../../../types';
5
4
  type __VLS_Props = {
6
5
  id: string;
7
6
  name: string;
7
+ displayName?: string;
8
+ toolName?: string;
9
+ extensionId?: string;
8
10
  args?: Record<string, unknown>;
9
11
  status: 'pending' | 'running' | 'done' | 'error' | 'cancelled' | 'skipped';
10
12
  output?: {
@@ -19,19 +21,16 @@ type __VLS_Props = {
19
21
  suggestion?: string;
20
22
  details?: Record<string, unknown>;
21
23
  };
22
- approvalReason?: ToolApprovalReason;
23
- approvalPolicy?: AssetApprovalPolicy;
24
- sideEffectLevel?: AssetSideEffectLevel;
25
- hostDependency?: AssetHostDependency;
26
- riskSummary?: string;
27
- riskTags?: string[];
28
- riskSignals?: string[];
24
+ confirmationReason?: ToolConfirmationReason;
25
+ summary?: string;
26
+ details?: string[];
27
+ tags?: string[];
29
28
  expandedType?: StepsExpandedType;
30
29
  adapter?: ChatAdapter;
31
30
  /** 取消工具调用(优先使用上层传入,确保能同步更新 UI 状态) */
32
31
  onCancelToolCall?: (toolCallId: string) => void;
33
- autoRunConfig?: AutoRunConfig;
34
- onSaveConfig?: (config: AutoRunConfig) => Promise<void>;
32
+ /** 本会话允许该工具(由 runtime 注入) */
33
+ onAllowToolForSession?: (toolKey: string) => void;
35
34
  /** 重试工具调用(toolError.retryable 时显示按钮,参数为 toolCallId) */
36
35
  onRetryToolCall?: (toolCallId: string) => void;
37
36
  };
@@ -1,6 +1,4 @@
1
- import type { AutoRunConfig } from '@huyooo/ai-chat-types';
2
1
  import type { ChatAdapter } from '../../../adapter';
3
- import { type AssetApprovalPolicy, type AssetSideEffectLevel } from '@huyooo/ai-chat-shared';
4
2
  export interface ToolCancelActionOptions {
5
3
  id: string;
6
4
  adapter?: ChatAdapter;
@@ -11,14 +9,6 @@ export interface ToolRetryActionOptions {
11
9
  onRetryToolCall?: (toolCallId: string) => void;
12
10
  onEmitRetry?: (toolCallId: string) => void;
13
11
  }
14
- export declare function saveToolAutoRunMode(config: AutoRunConfig | undefined, mode: string, onSaveConfig?: (config: AutoRunConfig) => Promise<void>, governance?: {
15
- approvalPolicy?: AssetApprovalPolicy;
16
- sideEffectLevel?: AssetSideEffectLevel;
17
- }): Promise<void>;
18
12
  export declare function respondToolApproval(adapter: ChatAdapter | undefined, id: string, approved: boolean): Promise<void>;
19
13
  export declare function cancelToolCall(options: ToolCancelActionOptions): void;
20
14
  export declare function retryToolCall(options: ToolRetryActionOptions): void;
21
- export declare function shouldAutoRunOnModeChange(oldMode: string, newMode: string, status: 'pending' | 'running' | 'done' | 'error' | 'cancelled' | 'skipped', governance?: {
22
- approvalPolicy?: AssetApprovalPolicy;
23
- sideEffectLevel?: AssetSideEffectLevel;
24
- }): boolean;
@@ -1,25 +1,99 @@
1
1
  export type CommandHighlightTone = 'danger' | 'warning';
2
2
  export type ArgSignalTone = CommandHighlightTone | 'neutral';
3
3
  export type ToolCallStatus = 'pending' | 'running' | 'done' | 'error' | 'cancelled' | 'skipped';
4
+ /** 宿主打开本地路径时的可选定位 / 类型提示 */
5
+ export type OpenFilesystemPathOptions = {
6
+ line?: number;
7
+ column?: number;
8
+ /** 已知是目录时传 directory,避免宿主按编辑器文件打开 */
9
+ pathKind?: 'file' | 'directory';
10
+ };
11
+ /** 宿主注入:打开/定位本地文件(IDE tab / 系统打开等由宿主决定) */
12
+ export type OpenFilesystemPathFromPart = (filePath: string, options?: OpenFilesystemPathOptions) => void | Promise<void>;
4
13
  export interface ImportantArgSignal {
5
14
  label: string;
6
15
  value: string;
7
16
  tone: ArgSignalTone;
8
17
  dedupeHints: string[];
18
+ /** 该 signal 已表达的 args 键;覆盖判定以此为准,而非全局白名单 */
19
+ coveredKeys: string[];
20
+ /** 可点击打开的完整路径(path 类 signal) */
21
+ openPath?: string;
22
+ pathKind?: 'file' | 'directory';
9
23
  }
10
- export type ToolSideEffectLevel = 'read' | 'write' | 'destructive' | undefined;
11
- export declare function getRunButtonText(sideEffectLevel: ToolSideEffectLevel): "确认执行高风险命令" | "确认执行" | "运行";
24
+ /** UI 最多展示的参数 chips 数;覆盖判定仍用完整 signals */
25
+ export declare const MAX_DISPLAYED_ARG_SIGNALS = 4;
26
+ export declare function getRunButtonText(): string;
12
27
  export declare function getToolStatusIcon(status: ToolCallStatus): string;
13
28
  export declare function getToolStatusIconColor(status: ToolCallStatus): string;
14
29
  export declare function getToolStatusDisplayIcon(status: ToolCallStatus): string;
15
30
  export declare function getToolStatusText(status: ToolCallStatus): string;
16
- export declare function getToolCallTitle(name: string, status: ToolCallStatus): string;
17
- export declare function getRunButtonClass(sideEffectLevel: ToolSideEffectLevel): "btn-run-danger" | "btn-run-warning" | "btn-run-primary";
18
- export declare function getRiskSummaryClass(sideEffectLevel: ToolSideEffectLevel): "tool-risk-summary-danger" | "tool-risk-summary-warning" | "tool-risk-summary-neutral";
31
+ /** 标题优先 displayName;缺省回退 name。状态靠图标表达 */
32
+ export declare function getToolCallTitle(name: string, _status?: ToolCallStatus, displayName?: string): string;
33
+ /** 从工具参数中解析主可打开路径(用于标题文件名) */
34
+ export declare function resolvePrimaryOpenablePath(args?: Record<string, unknown>, toolName?: string): {
35
+ path: string;
36
+ basename: string;
37
+ pathKind: 'file' | 'directory';
38
+ } | null;
39
+ /** 有主路径时标题用 basename,工具名进副标题(Cursor 风);副标题只用 displayName */
40
+ export declare function buildToolCallHeader(input: {
41
+ name: string;
42
+ displayName?: string;
43
+ args?: Record<string, unknown>;
44
+ }): {
45
+ title: string;
46
+ subtitle?: string;
47
+ primaryOpenPath: string | null;
48
+ primaryPathKind?: 'file' | 'directory';
49
+ titleTooltip?: string;
50
+ };
51
+ /** 行号:优先 start_line,供打开时定位 */
52
+ export declare function resolveToolCallOpenLocation(args?: Record<string, unknown>): OpenFilesystemPathOptions | undefined;
53
+ /** path chip 图标 */
54
+ export declare function getPathSignalIcon(signal: ImportantArgSignal): string;
55
+ /** UI chips:截断展示数量(主路径升标题后仍保留,展开可见完整路径等详情) */
56
+ export declare function filterDisplayedArgSignals(signals: ImportantArgSignal[], _primaryOpenPath: string | null): ImportantArgSignal[];
57
+ /** 仅 pending / running / 可重试 error 需要底栏操作 */
58
+ export declare function shouldShowToolFooter(status: ToolCallStatus, canRetry: boolean): boolean;
59
+ /** 确认区:pending 且有 summary/details/tags/reason 时展示 */
60
+ export declare function shouldShowToolConfirmationPanel(input: {
61
+ status: ToolCallStatus;
62
+ hasReasonText: boolean;
63
+ hasSummary: boolean;
64
+ detailCount: number;
65
+ tagCount?: number;
66
+ }): boolean;
67
+ export declare function getRunButtonClass(): string;
68
+ export declare function getRiskSummaryClass(): string;
19
69
  export declare function getArgSignalClass(tone: ArgSignalTone): "tool-arg-signal-danger" | "tool-arg-signal-warning" | "tool-arg-signal-neutral";
20
- export declare function getGovernanceTagClass(tag: string): "tool-governance-tag-danger" | "tool-governance-tag-warning" | "tool-governance-tag-neutral";
21
- export declare function getToolArgsType(name: string, args?: Record<string, unknown>): "text" | "command" | "json";
70
+ export declare function getToolArgsType(name: string, args?: Record<string, unknown>): 'json' | 'command' | 'text';
22
71
  export declare function getToolArgsText(name: string, args?: Record<string, unknown>): string;
23
72
  export declare function renderHighlightedCommand(command: string): string;
24
- export declare function buildImportantArgSignals(args: Record<string, unknown> | undefined, sideEffectLevel?: 'read' | 'write' | 'destructive'): ImportantArgSignal[];
73
+ export declare function buildImportantArgSignals(args: Record<string, unknown> | undefined, toolName?: string): ImportantArgSignal[];
74
+ /** 参数是否已被 signal 完整覆盖(避免「文件 chip」和 JSON path 重复) */
75
+ export declare function areArgsCoveredBySignals(args: Record<string, unknown> | undefined, signals: ImportantArgSignal[]): boolean;
76
+ /** 是否还需要展示原始 args 块 */
77
+ export declare function shouldShowToolArgsBlock(input: {
78
+ argsType: 'json' | 'command' | 'text';
79
+ args?: Record<string, unknown>;
80
+ signals: ImportantArgSignal[];
81
+ }): boolean;
82
+ /**
83
+ * signal chips:详情统一走 args JSON/命令/文本块(与审计一致),不再用 chips 顶详情
84
+ */
85
+ export declare function shouldShowArgSignals(_input: {
86
+ argsType: 'json' | 'command' | 'text';
87
+ args?: Record<string, unknown>;
88
+ signals: ImportantArgSignal[];
89
+ }): boolean;
90
+ /** 展开区是否已有任一实质内容(用于空态兜底) */
91
+ export declare function hasToolCallExpandContent(input: {
92
+ showArgsBlock: boolean;
93
+ showArgSignals: boolean;
94
+ showRiskPanel: boolean;
95
+ hasOutput: boolean;
96
+ hasErrorPanel: boolean;
97
+ showFooter: boolean;
98
+ }): boolean;
25
99
  export declare function filterDisplayedRiskSignals(riskSignals: string[], importantArgSignals: ImportantArgSignal[]): string[];
@@ -1,10 +1,9 @@
1
- import { type Ref } from 'vue';
2
- import type { AutoRunConfig } from '@huyooo/ai-chat-types';
3
1
  import type { ChatAdapter } from '../../../adapter';
4
- import type { AssetApprovalPolicy, AssetSideEffectLevel } from '@huyooo/ai-chat-shared';
5
2
  interface ToolCallPartActionProps {
6
3
  id: string;
7
4
  name: string;
5
+ toolName?: string;
6
+ extensionId?: string;
8
7
  status: 'pending' | 'running' | 'done' | 'error' | 'cancelled' | 'skipped';
9
8
  output?: {
10
9
  stdout?: string;
@@ -12,15 +11,12 @@ interface ToolCallPartActionProps {
12
11
  };
13
12
  adapter?: ChatAdapter;
14
13
  onCancelToolCall?: (toolCallId: string) => void;
15
- autoRunConfig?: AutoRunConfig;
16
- onSaveConfig?: (config: AutoRunConfig) => Promise<void>;
17
14
  onRetryToolCall?: (toolCallId: string) => void;
18
- approvalPolicy?: AssetApprovalPolicy;
19
- sideEffectLevel?: AssetSideEffectLevel;
15
+ onAllowToolForSession?: (toolKey: string) => void;
20
16
  }
21
- export declare function useToolCallPartActions(props: ToolCallPartActionProps, currentMode: Ref<string>, emitRetry: (toolCallId: string) => void): {
17
+ export declare function useToolCallPartActions(props: ToolCallPartActionProps, emitRetry: (toolCallId: string) => void): {
18
+ handleAllowForSession: (toolKey: string) => Promise<void>;
22
19
  handleCancel: () => void;
23
- handleModeChange: (value: string) => Promise<void>;
24
20
  handleRetry: () => void;
25
21
  handleRun: () => Promise<void>;
26
22
  handleSkip: () => Promise<void>;
@@ -1,70 +1,57 @@
1
- import type { AssetApprovalPolicy, AssetHostDependency, AssetSideEffectLevel, ToolApprovalReason } from '@huyooo/ai-chat-shared';
2
- import type { AutoRunConfig } from '@huyooo/ai-chat-types';
1
+ import type { ToolConfirmationReason } from '@huyooo/ai-chat-shared';
3
2
  import type { StepsExpandedType } from '../../../types';
4
- /**
5
- * useToolCallPartState 的最小输入集。
6
- *
7
- * 这里故意只保留当前状态组合所需字段,避免 composable 反向依赖整个组件 props。
8
- */
9
3
  interface ToolCallPartStateProps {
10
4
  name: string;
5
+ displayName?: string;
11
6
  args?: Record<string, unknown>;
12
7
  status: 'pending' | 'running' | 'done' | 'error' | 'cancelled' | 'skipped';
13
8
  output?: {
14
9
  stdout?: string;
15
10
  stderr?: string;
16
11
  };
17
- approvalReason?: ToolApprovalReason;
18
- approvalPolicy?: AssetApprovalPolicy;
19
- sideEffectLevel?: AssetSideEffectLevel;
20
- hostDependency?: AssetHostDependency;
21
- riskSummary?: string;
22
- riskTags?: string[];
23
- riskSignals?: string[];
12
+ confirmationReason?: ToolConfirmationReason;
13
+ summary?: string;
14
+ details?: string[];
15
+ tags?: string[];
24
16
  expandedType?: StepsExpandedType;
25
17
  toolError?: {
26
18
  retryable?: boolean;
27
19
  };
28
- autoRunConfig?: AutoRunConfig;
29
20
  }
30
- /**
31
- * 基于 ToolCallPart 的输入 props 派生模板状态。
32
- *
33
- * 返回值按三类组织:
34
- * - governance:审批原因、风险摘要、标签、去重后的风险信号
35
- * - display:参数文本/高亮、状态图标/标题、按钮文案与样式,包含命令片段高亮与命令行参数信号
36
- * - panel state:输出面板 tab、展开状态、重试能力
37
- *
38
- * 其中命令行/终端工具相关状态包括:
39
- * - 命令文本高亮:如 `rm -rf`、`npm install`、`curl | sh`
40
- * - 关键参数信号:如文件路径、目录、source/destination、批量文件数、query、chunk
41
- * - 工具治理展示:如 destructive/write/read 对应的按钮文案、摘要颜色、风险标签
42
- * - 输出面板状态:stdout/stderr 切换、日志保存入口、运行中默认展开
43
- */
44
21
  export declare function useToolCallPartState(props: ToolCallPartStateProps): {
45
22
  activeOutputText: import("vue").ComputedRef<string>;
46
23
  activeStream: import("vue").Ref<"stdout" | "stderr", "stdout" | "stderr">;
47
- approvalReasonText: import("vue").ComputedRef<string | undefined>;
24
+ approvalPromptText: import("vue").ComputedRef<string | undefined>;
25
+ confirmationReasonText: import("vue").ComputedRef<string | undefined>;
48
26
  argsText: import("vue").ComputedRef<string>;
49
- argsType: import("vue").ComputedRef<"text" | "command" | "json">;
27
+ argsType: import("vue").ComputedRef<"command" | "text" | "json">;
50
28
  canRetry: import("vue").ComputedRef<boolean>;
51
- currentMode: import("vue").ComputedRef<import("@huyooo/ai-chat-shared").ToolRunMode>;
52
- displayedRiskSignals: import("vue").ComputedRef<string[]>;
29
+ cardAttention: import("vue").ComputedRef<"none" | "warning">;
30
+ details: import("vue").ComputedRef<string[]>;
31
+ tags: import("vue").ComputedRef<string[]>;
53
32
  expanded: import("vue").WritableComputedRef<boolean, boolean>;
54
- governanceTags: import("vue").ComputedRef<string[]>;
55
33
  hasOutput: import("vue").ComputedRef<boolean>;
56
34
  highlightedCommand: import("vue").ComputedRef<string>;
57
35
  highlightedJson: import("vue").ComputedRef<string>;
58
36
  importantArgSignals: import("vue").ComputedRef<import("./tool-call-display").ImportantArgSignal[]>;
59
- modeSelectionDisabled: import("vue").ComputedRef<boolean>;
60
- riskSummary: import("vue").ComputedRef<string | undefined>;
61
- riskSummaryClass: import("vue").ComputedRef<"tool-risk-summary-danger" | "tool-risk-summary-warning" | "tool-risk-summary-neutral">;
62
- runButtonClass: import("vue").ComputedRef<"btn-run-danger" | "btn-run-warning" | "btn-run-primary">;
63
- runButtonText: import("vue").ComputedRef<"确认执行高风险命令" | "确认执行" | "运行">;
37
+ primaryOpenPath: import("vue").ComputedRef<string | null>;
38
+ primaryPathKind: import("vue").ComputedRef<"file" | "directory" | undefined>;
39
+ riskSummaryClass: import("vue").ComputedRef<string>;
40
+ runButtonClass: import("vue").ComputedRef<string>;
41
+ runButtonText: import("vue").ComputedRef<string>;
42
+ showAllowForSession: import("vue").ComputedRef<boolean>;
43
+ showArgSignals: import("vue").ComputedRef<boolean>;
44
+ showArgsBlock: import("vue").ComputedRef<boolean>;
45
+ showConfirmationPanel: import("vue").ComputedRef<boolean>;
46
+ showEmptyDetail: import("vue").ComputedRef<boolean>;
47
+ showFooter: import("vue").ComputedRef<boolean>;
64
48
  statusDisplayIcon: import("vue").ComputedRef<string>;
65
49
  statusIcon: import("vue").ComputedRef<string>;
66
50
  statusIconColor: import("vue").ComputedRef<string>;
67
51
  statusText: import("vue").ComputedRef<string>;
52
+ subtitle: import("vue").ComputedRef<string | undefined>;
53
+ summary: import("vue").ComputedRef<string | undefined>;
68
54
  title: import("vue").ComputedRef<string>;
55
+ titleTooltip: import("vue").ComputedRef<string | undefined>;
69
56
  };
70
57
  export {};
@@ -53,6 +53,8 @@ export interface UseChatOptions {
53
53
  export interface PendingCompactData {
54
54
  summaryContent: string;
55
55
  model?: string;
56
+ modelLabel?: string;
57
+ strategy?: 'history' | 'oversized_user' | 'window_plus';
56
58
  tokensBeforeCompact: number;
57
59
  compressedTokens: number;
58
60
  originalMessageCount: number;
@@ -63,8 +65,12 @@ export interface PendingCompactData {
63
65
  export interface PendingContentCompressData {
64
66
  summary: string;
65
67
  model?: string;
68
+ modelLabel?: string;
69
+ strategy?: 'history' | 'oversized_user' | 'window_plus';
70
+ error?: string;
66
71
  originalTokens: number;
67
72
  compressedTokens: number;
73
+ budget?: number;
68
74
  duration: number;
69
75
  }
70
76
  /** streamAssistantResponse 参数 */
@@ -1,13 +1,13 @@
1
- import type { ChatAdapter, AutoRunConfig, ChatCapabilityExtensionGroup, SkillEnabledItem } from '@huyooo/ai-chat-types';
1
+ import type { ChatAdapter, ToolRunConfig, ChatCapabilityExtensionGroup, SkillEnabledItem } from '@huyooo/ai-chat-types';
2
2
  import type { AssetSource } from '@huyooo/ai-chat-core';
3
3
  export declare function useCapabilityConfig(adapter: ChatAdapter): {
4
- autoRunConfig: import("vue").Ref<{
5
- mode?: import("@huyooo/ai-chat-core").AutoRunMode | undefined;
6
- }, AutoRunConfig | {
7
- mode?: import("@huyooo/ai-chat-core").AutoRunMode | undefined;
4
+ toolRunConfig: import("vue").Ref<{
5
+ preference: import("@huyooo/ai-chat-core").ToolRunPreference;
6
+ }, ToolRunConfig | {
7
+ preference: import("@huyooo/ai-chat-core").ToolRunPreference;
8
8
  }>;
9
- loadAutoRunConfig: (force?: boolean) => Promise<void>;
10
- saveAutoRunConfig: (config: AutoRunConfig) => Promise<void>;
9
+ loadToolRunConfig: (force?: boolean) => Promise<void>;
10
+ saveToolRunConfig: (config: ToolRunConfig) => Promise<void>;
11
11
  enabledTools: import("vue").ComputedRef<string[] | undefined>;
12
12
  capabilityExtensions: import("vue").ComputedRef<ChatCapabilityExtensionGroup[]>;
13
13
  ensureCapabilitiesLoaded: () => Promise<void>;
@@ -8,5 +8,4 @@ export declare function useMessageActions(ctx: ChatContext): {
8
8
  cancelRequest: () => void;
9
9
  retryToolCall: (messageId: string, toolCallId: string) => Promise<void>;
10
10
  copyMessage: (messageId: string) => Promise<void>;
11
- setWorkingDirectory: (dir: string) => void;
12
11
  };
@@ -3,13 +3,14 @@
3
3
  * 包含消息保存、事件处理、流式消息发送、重发/分叉、队列管理
4
4
  */
5
5
  import { type Ref } from 'vue';
6
- import type { AtContextItem, AutoRunConfig } from '@huyooo/ai-chat-types';
6
+ import type { AtContextItem, ToolRunConfig } from '@huyooo/ai-chat-types';
7
7
  import type { ChatContext } from './types';
8
- export declare function useMessageSender(ctx: ChatContext, autoRunConfig: Ref<AutoRunConfig>, enabledTools: Ref<string[] | undefined>): {
8
+ export declare function useMessageSender(ctx: ChatContext, toolRunConfig: Ref<ToolRunConfig>, enabledTools: Ref<string[] | undefined>): {
9
9
  sendMessage: (text: string, images?: string[], atContextItems?: AtContextItem[]) => Promise<void>;
10
10
  resendFromIndex: (index: number, text: string, atContextItems?: AtContextItem[]) => Promise<void>;
11
11
  regenerateMessage: (messageIndex: number) => void;
12
12
  removeQueuedMessage: (messageId: string) => void;
13
13
  editQueuedMessage: (messageId: string, newText: string) => void;
14
14
  clearQueuedMessages: () => void;
15
+ allowToolForSession: (sessionId: string, toolKey: string) => void;
15
16
  };
@@ -9,7 +9,7 @@ import type { AtContextItem, MessagePartInput, MessageRecord } from '@huyooo/ai-
9
9
  import type { ChatMessage, ContentPart } from '../../types';
10
10
  export type { FrontendChatEvent as ChatEvent } from '@huyooo/ai-chat-types';
11
11
  export { shouldSaveEvent } from '@huyooo/ai-chat-types';
12
- export { hasSkipped, hasCancelled, AT_LINE_RE, stripAtContextLines, extractAtContextRefs, buildPromptWithAtContext, computeAtContextBudget, generateId, extractToolGovernance, mergeToolGovernance, } from '@huyooo/ai-chat-shared';
12
+ export { hasSkipped, hasCancelled, AT_LINE_RE, stripAtContextLines, extractAtContextRefs, buildPromptWithAtContext, computeAtContextBudget, generateId, extractToolConfirmation, mergeToolConfirmationOnto, } from '@huyooo/ai-chat-shared';
13
13
  /**
14
14
  * 把 atContextItems 从 Vue reactive Proxy 中解包为纯 POJO
15
15
  *