@talex-touch/utils 1.0.42 → 1.0.44
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/.eslintcache +1 -0
- package/__tests__/cloud-sync-sdk.test.ts +442 -0
- package/__tests__/icons/icons.test.ts +84 -0
- package/__tests__/plugin-sdk-lifecycle.test.ts +130 -0
- package/__tests__/power-sdk.test.ts +143 -0
- package/__tests__/preset-export-types.test.ts +108 -0
- package/__tests__/search/fuzzy-match.test.ts +137 -0
- package/__tests__/transport/port-policy.test.ts +44 -0
- package/__tests__/transport-domain-sdks.test.ts +152 -0
- package/__tests__/types/update.test.ts +67 -0
- package/account/account-sdk.ts +915 -0
- package/account/index.ts +2 -0
- package/account/types.ts +321 -0
- package/analytics/client.ts +136 -0
- package/analytics/index.ts +2 -0
- package/analytics/types.ts +156 -0
- package/animation/auto-resize.ts +322 -0
- package/animation/window-node.ts +26 -19
- package/auth/clerk-types.ts +12 -30
- package/auth/index.ts +0 -2
- package/auth/useAuthState.ts +6 -14
- package/base/index.ts +2 -0
- package/base/log-level.ts +105 -0
- package/channel/index.ts +170 -69
- package/cloud-sync/cloud-sync-sdk.ts +450 -0
- package/cloud-sync/index.ts +1 -0
- package/common/file-scan-utils.ts +17 -9
- package/common/index.ts +4 -0
- package/common/logger/index.ts +46 -0
- package/common/logger/logger-manager.ts +303 -0
- package/common/logger/module-logger.ts +270 -0
- package/common/logger/transport-logger.ts +234 -0
- package/common/logger/types.ts +93 -0
- package/common/search/gather.ts +48 -6
- package/common/search/index.ts +8 -0
- package/common/storage/constants.ts +13 -0
- package/common/storage/entity/app-settings.ts +245 -0
- package/common/storage/entity/index.ts +3 -0
- package/common/storage/entity/layout-atom-types.ts +147 -0
- package/common/storage/entity/openers.ts +1 -0
- package/common/storage/entity/preset-cloud-api.ts +132 -0
- package/common/storage/entity/preset-export-types.ts +256 -0
- package/common/storage/entity/shortcut-settings.ts +1 -0
- package/common/storage/shortcut-storage.ts +11 -0
- package/common/utils/clone-diagnostics.ts +105 -0
- package/common/utils/file.ts +16 -8
- package/common/utils/index.ts +6 -2
- package/common/utils/payload-preview.ts +173 -0
- package/common/utils/polling.ts +167 -13
- package/common/utils/safe-path.ts +103 -0
- package/common/utils/safe-shell.ts +115 -0
- package/common/utils/task-queue.ts +4 -1
- package/core-box/builder/tuff-builder.ts +0 -1
- package/core-box/index.ts +1 -1
- package/core-box/recommendation.ts +38 -1
- package/core-box/tuff/tuff-dsl.ts +32 -0
- package/electron/download-manager.ts +10 -7
- package/electron/env-tool.ts +42 -40
- package/electron/index.ts +0 -1
- package/env/index.ts +156 -0
- package/eslint.config.js +55 -0
- package/i18n/index.ts +62 -0
- package/i18n/locales/en.json +226 -0
- package/i18n/locales/zh.json +226 -0
- package/i18n/message-keys.ts +236 -0
- package/i18n/resolver.ts +181 -0
- package/icons/index.ts +257 -0
- package/icons/svg.ts +69 -0
- package/index.ts +9 -1
- package/intelligence/client.ts +72 -42
- package/market/constants.ts +9 -5
- package/market/index.ts +1 -1
- package/market/types.ts +19 -4
- package/package.json +15 -5
- package/permission/index.ts +143 -46
- package/permission/legacy.ts +26 -0
- package/permission/registry.ts +304 -0
- package/permission/types.ts +164 -0
- package/plugin/channel.ts +68 -39
- package/plugin/index.ts +80 -7
- package/plugin/install.ts +3 -0
- package/plugin/log/types.ts +22 -5
- package/plugin/node/logger-manager.ts +11 -3
- package/plugin/node/logger.ts +24 -17
- package/plugin/preload.ts +25 -2
- package/plugin/providers/index.ts +4 -4
- package/plugin/providers/market-client.ts +6 -3
- package/plugin/providers/npm-provider.ts +22 -7
- package/plugin/providers/tpex-provider.ts +22 -8
- package/plugin/sdk/box-items.ts +14 -0
- package/plugin/sdk/box-sdk.ts +64 -0
- package/plugin/sdk/channel.ts +119 -4
- package/plugin/sdk/clipboard.ts +26 -12
- package/plugin/sdk/cloud-sync.ts +113 -0
- package/plugin/sdk/common.ts +19 -11
- package/plugin/sdk/core-box.ts +6 -15
- package/plugin/sdk/division-box.ts +160 -65
- package/plugin/sdk/examples/storage-onDidChange-example.js +5 -2
- package/plugin/sdk/feature-sdk.ts +111 -76
- package/plugin/sdk/flow.ts +146 -45
- package/plugin/sdk/hooks/bridge.ts +13 -6
- package/plugin/sdk/hooks/life-cycle.ts +35 -16
- package/plugin/sdk/index.ts +14 -3
- package/plugin/sdk/intelligence.ts +87 -0
- package/plugin/sdk/meta/README.md +179 -0
- package/plugin/sdk/meta-sdk.ts +244 -0
- package/plugin/sdk/notification.ts +9 -0
- package/plugin/sdk/plugin-info.ts +64 -0
- package/plugin/sdk/power.ts +155 -0
- package/plugin/sdk/recommend.ts +21 -0
- package/plugin/sdk/service/index.ts +12 -8
- package/plugin/sdk/sqlite.ts +141 -0
- package/plugin/sdk/storage.ts +2 -6
- package/plugin/sdk/system.ts +2 -9
- package/plugin/sdk/temp-files.ts +41 -0
- package/plugin/sdk/touch-sdk.ts +18 -0
- package/plugin/sdk/types.ts +44 -4
- package/plugin/sdk/window/index.ts +12 -9
- package/plugin/sdk-version.ts +231 -0
- package/preload/renderer.ts +3 -2
- package/renderer/hooks/arg-mapper.ts +16 -2
- package/renderer/hooks/index.ts +13 -0
- package/renderer/hooks/initialize.ts +2 -1
- package/renderer/hooks/use-agent-market-sdk.ts +7 -0
- package/renderer/hooks/use-agent-market.ts +106 -0
- package/renderer/hooks/use-agents-sdk.ts +7 -0
- package/renderer/hooks/use-app-sdk.ts +7 -0
- package/renderer/hooks/use-channel.ts +33 -4
- package/renderer/hooks/use-download-sdk.ts +21 -0
- package/renderer/hooks/use-intelligence-sdk.ts +7 -0
- package/renderer/hooks/use-intelligence-stats.ts +290 -0
- package/renderer/hooks/use-intelligence.ts +55 -214
- package/renderer/hooks/use-market-sdk.ts +16 -0
- package/renderer/hooks/use-notification-sdk.ts +7 -0
- package/renderer/hooks/use-permission-sdk.ts +7 -0
- package/renderer/hooks/use-permission.ts +325 -0
- package/renderer/hooks/use-platform-sdk.ts +7 -0
- package/renderer/hooks/use-plugin-sdk.ts +16 -0
- package/renderer/hooks/use-settings-sdk.ts +7 -0
- package/renderer/hooks/use-update-sdk.ts +21 -0
- package/renderer/index.ts +1 -0
- package/renderer/ref.ts +19 -10
- package/renderer/shared/components/SharedPluginDetailContent.vue +84 -0
- package/renderer/shared/components/SharedPluginDetailHeader.vue +116 -0
- package/renderer/shared/components/SharedPluginDetailMetaList.vue +39 -0
- package/renderer/shared/components/SharedPluginDetailReadme.vue +45 -0
- package/renderer/shared/components/SharedPluginDetailVersions.vue +98 -0
- package/renderer/shared/components/index.ts +5 -0
- package/renderer/shared/components/shims-vue.d.ts +5 -0
- package/renderer/shared/index.ts +2 -0
- package/renderer/shared/plugin-detail.ts +62 -0
- package/renderer/storage/app-settings.ts +3 -1
- package/renderer/storage/base-storage.ts +508 -82
- package/renderer/storage/intelligence-storage.ts +31 -40
- package/renderer/storage/openers.ts +3 -1
- package/renderer/storage/storage-subscription.ts +126 -42
- package/renderer/touch-sdk/env.ts +10 -10
- package/renderer/touch-sdk/index.ts +114 -18
- package/renderer/touch-sdk/terminal.ts +24 -13
- package/search/feature-matcher.ts +279 -0
- package/search/fuzzy-match.ts +64 -34
- package/search/index.ts +10 -0
- package/search/levenshtein-utils.ts +17 -11
- package/transport/errors.ts +310 -0
- package/transport/event/builder.ts +378 -0
- package/transport/event/index.ts +7 -0
- package/transport/event/types.ts +292 -0
- package/transport/events/index.ts +2670 -0
- package/transport/events/meta-overlay.ts +79 -0
- package/transport/events/types/agents.ts +177 -0
- package/transport/events/types/app-index.ts +9 -0
- package/transport/events/types/app.ts +475 -0
- package/transport/events/types/box-item.ts +222 -0
- package/transport/events/types/clipboard.ts +80 -0
- package/transport/events/types/core-box.ts +534 -0
- package/transport/events/types/device-idle.ts +7 -0
- package/transport/events/types/division-box.ts +99 -0
- package/transport/events/types/download.ts +115 -0
- package/transport/events/types/file-index.ts +73 -0
- package/transport/events/types/flow.ts +149 -0
- package/transport/events/types/index.ts +70 -0
- package/transport/events/types/market.ts +39 -0
- package/transport/events/types/meta-overlay.ts +184 -0
- package/transport/events/types/notification.ts +140 -0
- package/transport/events/types/permission.ts +90 -0
- package/transport/events/types/platform.ts +8 -0
- package/transport/events/types/plugin.ts +620 -0
- package/transport/events/types/sentry.ts +20 -0
- package/transport/events/types/storage.ts +208 -0
- package/transport/events/types/transport.ts +60 -0
- package/transport/events/types/tray.ts +16 -0
- package/transport/events/types/update.ts +78 -0
- package/transport/index.ts +139 -0
- package/transport/main.ts +2 -0
- package/transport/sdk/constants.ts +29 -0
- package/transport/sdk/domains/agents-market.ts +47 -0
- package/transport/sdk/domains/agents.ts +62 -0
- package/transport/sdk/domains/app.ts +48 -0
- package/transport/sdk/domains/disposable.ts +35 -0
- package/transport/sdk/domains/download.ts +139 -0
- package/transport/sdk/domains/index.ts +13 -0
- package/transport/sdk/domains/intelligence.ts +616 -0
- package/transport/sdk/domains/market.ts +35 -0
- package/transport/sdk/domains/notification.ts +62 -0
- package/transport/sdk/domains/permission.ts +85 -0
- package/transport/sdk/domains/platform.ts +19 -0
- package/transport/sdk/domains/plugin.ts +144 -0
- package/transport/sdk/domains/settings.ts +92 -0
- package/transport/sdk/domains/update.ts +64 -0
- package/transport/sdk/index.ts +60 -0
- package/transport/sdk/main-transport.ts +710 -0
- package/transport/sdk/main.ts +9 -0
- package/transport/sdk/plugin-transport.ts +654 -0
- package/transport/sdk/port-policy.ts +38 -0
- package/transport/sdk/renderer-transport.ts +1165 -0
- package/transport/types.ts +605 -0
- package/types/agent.ts +399 -0
- package/types/cloud-sync.ts +157 -0
- package/types/division-box.ts +31 -31
- package/types/download.ts +1 -0
- package/types/flow.ts +63 -12
- package/types/icon.ts +2 -1
- package/types/index.ts +5 -0
- package/types/intelligence.ts +166 -173
- package/types/modules/base.ts +2 -0
- package/types/path-browserify.d.ts +5 -0
- package/types/platform.ts +12 -0
- package/types/startup-info.ts +32 -0
- package/types/touch-app-core.ts +8 -8
- package/types/update.ts +94 -1
- package/vitest.config.ts +25 -0
- package/auth/useClerkConfig.ts +0 -40
- package/auth/useClerkProvider.ts +0 -52
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
import type { Ref } from 'vue'
|
|
2
|
+
import { ref } from 'vue'
|
|
3
|
+
import { useIntelligenceSdk } from './use-intelligence-sdk'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Usage summary for a specific period
|
|
7
|
+
*/
|
|
8
|
+
interface IntelligenceUsageSummary {
|
|
9
|
+
period: string
|
|
10
|
+
periodType: 'minute' | 'day' | 'month'
|
|
11
|
+
requestCount: number
|
|
12
|
+
successCount: number
|
|
13
|
+
failureCount: number
|
|
14
|
+
totalTokens: number
|
|
15
|
+
promptTokens: number
|
|
16
|
+
completionTokens: number
|
|
17
|
+
totalCost: number
|
|
18
|
+
avgLatency: number
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Audit log entry
|
|
23
|
+
*/
|
|
24
|
+
interface IntelligenceAuditLogEntry {
|
|
25
|
+
traceId: string
|
|
26
|
+
timestamp: number
|
|
27
|
+
capabilityId: string
|
|
28
|
+
provider: string
|
|
29
|
+
model: string
|
|
30
|
+
promptHash?: string
|
|
31
|
+
caller?: string
|
|
32
|
+
userId?: string
|
|
33
|
+
usage: {
|
|
34
|
+
promptTokens: number
|
|
35
|
+
completionTokens: number
|
|
36
|
+
totalTokens: number
|
|
37
|
+
}
|
|
38
|
+
latency: number
|
|
39
|
+
success: boolean
|
|
40
|
+
error?: string
|
|
41
|
+
estimatedCost?: number
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Current usage for a caller
|
|
46
|
+
*/
|
|
47
|
+
interface CurrentUsage {
|
|
48
|
+
requestsThisMinute: number
|
|
49
|
+
requestsToday: number
|
|
50
|
+
requestsThisMonth: number
|
|
51
|
+
tokensThisMinute: number
|
|
52
|
+
tokensToday: number
|
|
53
|
+
tokensThisMonth: number
|
|
54
|
+
costToday: number
|
|
55
|
+
costThisMonth: number
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Quota configuration
|
|
60
|
+
*/
|
|
61
|
+
interface QuotaConfig {
|
|
62
|
+
callerId: string
|
|
63
|
+
callerType: 'plugin' | 'user' | 'system'
|
|
64
|
+
requestsPerMinute?: number
|
|
65
|
+
requestsPerDay?: number
|
|
66
|
+
requestsPerMonth?: number
|
|
67
|
+
tokensPerMinute?: number
|
|
68
|
+
tokensPerDay?: number
|
|
69
|
+
tokensPerMonth?: number
|
|
70
|
+
costLimitPerDay?: number
|
|
71
|
+
costLimitPerMonth?: number
|
|
72
|
+
enabled?: boolean
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Quota check result
|
|
77
|
+
*/
|
|
78
|
+
interface QuotaCheckResult {
|
|
79
|
+
allowed: boolean
|
|
80
|
+
reason?: string
|
|
81
|
+
remainingRequests?: number
|
|
82
|
+
remainingTokens?: number
|
|
83
|
+
remainingCost?: number
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Query options for audit logs
|
|
88
|
+
*/
|
|
89
|
+
interface AuditLogQueryOptions {
|
|
90
|
+
caller?: string
|
|
91
|
+
capabilityId?: string
|
|
92
|
+
provider?: string
|
|
93
|
+
startTime?: number
|
|
94
|
+
endTime?: number
|
|
95
|
+
success?: boolean
|
|
96
|
+
limit?: number
|
|
97
|
+
offset?: number
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
interface IntelligenceStatsComposable {
|
|
101
|
+
// Audit logs
|
|
102
|
+
getAuditLogs: (options?: AuditLogQueryOptions) => Promise<IntelligenceAuditLogEntry[]>
|
|
103
|
+
|
|
104
|
+
// Usage statistics
|
|
105
|
+
getTodayStats: (callerId?: string) => Promise<IntelligenceUsageSummary | null>
|
|
106
|
+
getMonthStats: (callerId?: string) => Promise<IntelligenceUsageSummary | null>
|
|
107
|
+
getUsageStats: (
|
|
108
|
+
callerId: string,
|
|
109
|
+
periodType: 'day' | 'month',
|
|
110
|
+
startPeriod?: string,
|
|
111
|
+
endPeriod?: string,
|
|
112
|
+
) => Promise<IntelligenceUsageSummary[]>
|
|
113
|
+
|
|
114
|
+
// Quota management
|
|
115
|
+
getQuota: (callerId: string, callerType?: 'plugin' | 'user' | 'system') => Promise<QuotaConfig | null>
|
|
116
|
+
setQuota: (config: QuotaConfig) => Promise<void>
|
|
117
|
+
deleteQuota: (callerId: string, callerType?: 'plugin' | 'user' | 'system') => Promise<void>
|
|
118
|
+
getAllQuotas: () => Promise<QuotaConfig[]>
|
|
119
|
+
checkQuota: (callerId: string, callerType?: 'plugin' | 'user' | 'system', estimatedTokens?: number) => Promise<QuotaCheckResult>
|
|
120
|
+
getCurrentUsage: (callerId: string, callerType?: 'plugin' | 'user' | 'system') => Promise<CurrentUsage>
|
|
121
|
+
|
|
122
|
+
// Export utilities
|
|
123
|
+
exportToCSV: (logs: IntelligenceAuditLogEntry[]) => string
|
|
124
|
+
exportToJSON: (logs: IntelligenceAuditLogEntry[]) => string
|
|
125
|
+
downloadAsFile: (content: string, filename: string, mimeType: string) => void
|
|
126
|
+
|
|
127
|
+
// Loading state
|
|
128
|
+
isLoading: Ref<boolean>
|
|
129
|
+
lastError: Ref<string | null>
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Intelligence Statistics Composable for Vue components
|
|
134
|
+
*
|
|
135
|
+
* Provides access to audit logs, usage statistics, and quota management
|
|
136
|
+
*
|
|
137
|
+
* @example
|
|
138
|
+
* ```ts
|
|
139
|
+
* const { getTodayStats, getAuditLogs, exportToCSV } = useIntelligenceStats()
|
|
140
|
+
*
|
|
141
|
+
* // Get today's usage
|
|
142
|
+
* const stats = await getTodayStats()
|
|
143
|
+
* console.log(`Today: ${stats.requestCount} requests, $${stats.totalCost.toFixed(4)} cost`)
|
|
144
|
+
*
|
|
145
|
+
* // Get audit logs
|
|
146
|
+
* const logs = await getAuditLogs({ limit: 100 })
|
|
147
|
+
*
|
|
148
|
+
* // Export to CSV
|
|
149
|
+
* const csv = exportToCSV(logs)
|
|
150
|
+
* downloadAsFile(csv, 'audit-logs.csv', 'text/csv')
|
|
151
|
+
* ```
|
|
152
|
+
*/
|
|
153
|
+
/**
|
|
154
|
+
* @deprecated 请优先使用 useIntelligenceSdk() 直接调用统计相关能力。
|
|
155
|
+
*/
|
|
156
|
+
export function useIntelligenceStats(): IntelligenceStatsComposable {
|
|
157
|
+
const isLoading = ref(false)
|
|
158
|
+
const lastError = ref<string | null>(null)
|
|
159
|
+
const intelligenceSdk = useIntelligenceSdk()
|
|
160
|
+
|
|
161
|
+
async function withLoadingState<T>(operation: () => Promise<T>): Promise<T> {
|
|
162
|
+
isLoading.value = true
|
|
163
|
+
lastError.value = null
|
|
164
|
+
|
|
165
|
+
try {
|
|
166
|
+
return await operation()
|
|
167
|
+
}
|
|
168
|
+
catch (error) {
|
|
169
|
+
const errorMessage = error instanceof Error ? error.message : String(error)
|
|
170
|
+
lastError.value = errorMessage
|
|
171
|
+
throw error
|
|
172
|
+
}
|
|
173
|
+
finally {
|
|
174
|
+
isLoading.value = false
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// Export to CSV
|
|
179
|
+
function exportToCSV(logs: IntelligenceAuditLogEntry[]): string {
|
|
180
|
+
const headers = [
|
|
181
|
+
'Trace ID',
|
|
182
|
+
'Timestamp',
|
|
183
|
+
'Capability',
|
|
184
|
+
'Provider',
|
|
185
|
+
'Model',
|
|
186
|
+
'Caller',
|
|
187
|
+
'Prompt Tokens',
|
|
188
|
+
'Completion Tokens',
|
|
189
|
+
'Total Tokens',
|
|
190
|
+
'Estimated Cost',
|
|
191
|
+
'Latency (ms)',
|
|
192
|
+
'Success',
|
|
193
|
+
'Error',
|
|
194
|
+
]
|
|
195
|
+
|
|
196
|
+
const rows = logs.map(log => [
|
|
197
|
+
log.traceId,
|
|
198
|
+
new Date(log.timestamp).toISOString(),
|
|
199
|
+
log.capabilityId,
|
|
200
|
+
log.provider,
|
|
201
|
+
log.model,
|
|
202
|
+
log.caller || '',
|
|
203
|
+
log.usage.promptTokens,
|
|
204
|
+
log.usage.completionTokens,
|
|
205
|
+
log.usage.totalTokens,
|
|
206
|
+
log.estimatedCost?.toFixed(6) || '',
|
|
207
|
+
log.latency,
|
|
208
|
+
log.success ? 'Yes' : 'No',
|
|
209
|
+
log.error || '',
|
|
210
|
+
])
|
|
211
|
+
|
|
212
|
+
const csvContent = [
|
|
213
|
+
headers.join(','),
|
|
214
|
+
...rows.map(row => row.map(cell => `"${String(cell).replace(/"/g, '""')}"`).join(',')),
|
|
215
|
+
].join('\n')
|
|
216
|
+
|
|
217
|
+
return csvContent
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
// Export to JSON
|
|
221
|
+
function exportToJSON(logs: IntelligenceAuditLogEntry[]): string {
|
|
222
|
+
return JSON.stringify(logs, null, 2)
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
// Download as file
|
|
226
|
+
function downloadAsFile(content: string, filename: string, mimeType: string): void {
|
|
227
|
+
const blob = new Blob([content], { type: mimeType })
|
|
228
|
+
const url = URL.createObjectURL(blob)
|
|
229
|
+
const link = document.createElement('a')
|
|
230
|
+
link.href = url
|
|
231
|
+
link.download = filename
|
|
232
|
+
document.body.appendChild(link)
|
|
233
|
+
link.click()
|
|
234
|
+
document.body.removeChild(link)
|
|
235
|
+
URL.revokeObjectURL(url)
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
return {
|
|
239
|
+
// Audit logs
|
|
240
|
+
getAuditLogs: (options?: AuditLogQueryOptions) =>
|
|
241
|
+
withLoadingState(() => intelligenceSdk.getAuditLogs(options)),
|
|
242
|
+
|
|
243
|
+
// Usage statistics
|
|
244
|
+
getTodayStats: (callerId?: string) =>
|
|
245
|
+
withLoadingState(() => intelligenceSdk.getTodayStats(callerId)),
|
|
246
|
+
|
|
247
|
+
getMonthStats: (callerId?: string) =>
|
|
248
|
+
withLoadingState(() => intelligenceSdk.getMonthStats(callerId)),
|
|
249
|
+
|
|
250
|
+
getUsageStats: (callerId: string, periodType: 'day' | 'month', startPeriod?: string, endPeriod?: string) =>
|
|
251
|
+
withLoadingState(() =>
|
|
252
|
+
intelligenceSdk.getUsageStats({
|
|
253
|
+
callerId,
|
|
254
|
+
periodType,
|
|
255
|
+
startPeriod,
|
|
256
|
+
endPeriod,
|
|
257
|
+
}),
|
|
258
|
+
),
|
|
259
|
+
|
|
260
|
+
// Quota management
|
|
261
|
+
getQuota: (callerId: string, callerType: 'plugin' | 'user' | 'system' = 'plugin') =>
|
|
262
|
+
withLoadingState(() => intelligenceSdk.getQuota({ callerId, callerType })),
|
|
263
|
+
|
|
264
|
+
setQuota: (config: QuotaConfig) =>
|
|
265
|
+
withLoadingState(() => intelligenceSdk.setQuota(config)),
|
|
266
|
+
|
|
267
|
+
deleteQuota: (callerId: string, callerType: 'plugin' | 'user' | 'system' = 'plugin') =>
|
|
268
|
+
withLoadingState(() => intelligenceSdk.deleteQuota({ callerId, callerType })),
|
|
269
|
+
|
|
270
|
+
getAllQuotas: () =>
|
|
271
|
+
withLoadingState(() => intelligenceSdk.getAllQuotas()),
|
|
272
|
+
|
|
273
|
+
checkQuota: (callerId: string, callerType: 'plugin' | 'user' | 'system' = 'plugin', estimatedTokens: number = 0) =>
|
|
274
|
+
withLoadingState(() =>
|
|
275
|
+
intelligenceSdk.checkQuota({ callerId, callerType, estimatedTokens }),
|
|
276
|
+
),
|
|
277
|
+
|
|
278
|
+
getCurrentUsage: (callerId: string, callerType: 'plugin' | 'user' | 'system' = 'plugin') =>
|
|
279
|
+
withLoadingState(() => intelligenceSdk.getCurrentUsage({ callerId, callerType })),
|
|
280
|
+
|
|
281
|
+
// Export utilities
|
|
282
|
+
exportToCSV,
|
|
283
|
+
exportToJSON,
|
|
284
|
+
downloadAsFile,
|
|
285
|
+
|
|
286
|
+
// Loading state
|
|
287
|
+
isLoading,
|
|
288
|
+
lastError,
|
|
289
|
+
}
|
|
290
|
+
}
|
|
@@ -32,6 +32,7 @@ import type {
|
|
|
32
32
|
IntelligenceInvokeResult,
|
|
33
33
|
IntelligenceKeywordsExtractPayload,
|
|
34
34
|
IntelligenceKeywordsExtractResult,
|
|
35
|
+
IntelligenceMessage,
|
|
35
36
|
IntelligenceProviderConfig,
|
|
36
37
|
IntelligenceRAGQueryPayload,
|
|
37
38
|
IntelligenceRAGQueryResult,
|
|
@@ -48,7 +49,7 @@ import type {
|
|
|
48
49
|
IntelligenceVisionOcrResult,
|
|
49
50
|
} from '../../types/intelligence'
|
|
50
51
|
import { ref } from 'vue'
|
|
51
|
-
import {
|
|
52
|
+
import { useIntelligenceSdk } from './use-intelligence-sdk'
|
|
52
53
|
|
|
53
54
|
interface UseIntelligenceOptions {
|
|
54
55
|
// Reserved for future options
|
|
@@ -92,6 +93,14 @@ interface IntelligenceComposable {
|
|
|
92
93
|
// Text methods
|
|
93
94
|
text: {
|
|
94
95
|
chat: (payload: IntelligenceChatPayload, options?: IntelligenceInvokeOptions) => Promise<IntelligenceInvokeResult<string>>
|
|
96
|
+
chatLangChain: (params: {
|
|
97
|
+
messages: IntelligenceMessage[]
|
|
98
|
+
providerId?: string
|
|
99
|
+
model?: string
|
|
100
|
+
promptTemplate?: string
|
|
101
|
+
promptVariables?: Record<string, any>
|
|
102
|
+
metadata?: Record<string, any>
|
|
103
|
+
}) => Promise<IntelligenceInvokeResult<string>>
|
|
95
104
|
translate: (payload: IntelligenceTranslatePayload, options?: IntelligenceInvokeOptions) => Promise<IntelligenceInvokeResult<string>>
|
|
96
105
|
summarize: (payload: IntelligenceSummarizePayload, options?: IntelligenceInvokeOptions) => Promise<IntelligenceInvokeResult<string>>
|
|
97
106
|
rewrite: (payload: IntelligenceRewritePayload, options?: IntelligenceInvokeOptions) => Promise<IntelligenceInvokeResult<string>>
|
|
@@ -171,39 +180,20 @@ interface IntelligenceComposable {
|
|
|
171
180
|
* })
|
|
172
181
|
* ```
|
|
173
182
|
*/
|
|
183
|
+
/**
|
|
184
|
+
* @deprecated 请优先使用 useIntelligenceSdk() 直接调用 domain SDK。
|
|
185
|
+
*/
|
|
174
186
|
export function useIntelligence(_options: UseIntelligenceOptions = {}): IntelligenceComposable {
|
|
175
187
|
const isLoading = ref(false)
|
|
176
188
|
const lastError = ref<string | null>(null)
|
|
189
|
+
const intelligenceSdk = useIntelligenceSdk()
|
|
177
190
|
|
|
178
|
-
// Get the TouchChannel instance
|
|
179
|
-
const channel = useChannel()
|
|
180
|
-
|
|
181
|
-
// Helper for consistent response handling
|
|
182
|
-
interface ChannelResponse<T> {
|
|
183
|
-
ok: boolean
|
|
184
|
-
result?: T
|
|
185
|
-
error?: string
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
async function sendChannelRequest<T>(
|
|
189
|
-
eventName: string,
|
|
190
|
-
payload: any,
|
|
191
|
-
): Promise<T> {
|
|
192
|
-
const response = await channel.send<any, ChannelResponse<T>>(eventName, payload)
|
|
193
|
-
if (!response?.ok) {
|
|
194
|
-
throw new Error(response?.error || 'Intelligence request failed')
|
|
195
|
-
}
|
|
196
|
-
return response.result as T
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
// Wrapper function that handles loading state and errors
|
|
200
191
|
async function withLoadingState<T>(operation: () => Promise<T>): Promise<T> {
|
|
201
192
|
isLoading.value = true
|
|
202
193
|
lastError.value = null
|
|
203
194
|
|
|
204
195
|
try {
|
|
205
|
-
|
|
206
|
-
return result
|
|
196
|
+
return await operation()
|
|
207
197
|
}
|
|
208
198
|
catch (error) {
|
|
209
199
|
const errorMessage = error instanceof Error ? error.message : String(error)
|
|
@@ -215,278 +205,129 @@ export function useIntelligence(_options: UseIntelligenceOptions = {}): Intellig
|
|
|
215
205
|
}
|
|
216
206
|
}
|
|
217
207
|
|
|
208
|
+
const invokeCapability = <T = unknown>(
|
|
209
|
+
capabilityId: string,
|
|
210
|
+
payload: unknown,
|
|
211
|
+
options?: IntelligenceInvokeOptions,
|
|
212
|
+
) => withLoadingState(() => intelligenceSdk.invoke<T>(capabilityId, payload, options))
|
|
213
|
+
|
|
218
214
|
return {
|
|
219
|
-
// Core invoke
|
|
220
215
|
invoke: <T = any>(capabilityId: string, payload: any, options?: IntelligenceInvokeOptions) =>
|
|
221
|
-
withLoadingState(() =>
|
|
222
|
-
sendChannelRequest<IntelligenceInvokeResult<T>>('intelligence:invoke', { capabilityId, payload, options }),
|
|
223
|
-
),
|
|
216
|
+
withLoadingState(() => intelligenceSdk.invoke<T>(capabilityId, payload, options)),
|
|
224
217
|
|
|
225
|
-
// Provider testing
|
|
226
218
|
testProvider: (config: IntelligenceProviderConfig) =>
|
|
227
219
|
withLoadingState(() =>
|
|
228
|
-
|
|
220
|
+
intelligenceSdk.testProvider(config) as Promise<{
|
|
229
221
|
success: boolean
|
|
230
222
|
message: string
|
|
231
223
|
latency?: number
|
|
232
224
|
timestamp: number
|
|
233
|
-
}
|
|
225
|
+
}>,
|
|
234
226
|
),
|
|
235
227
|
|
|
236
|
-
// Capability testing
|
|
237
228
|
testCapability: (params: { capabilityId: string, providerId?: string, userInput?: string, source?: any }) =>
|
|
238
229
|
withLoadingState(() =>
|
|
239
|
-
|
|
230
|
+
intelligenceSdk.testCapability(params) as Promise<{
|
|
240
231
|
ok: boolean
|
|
241
232
|
result: any
|
|
242
|
-
}
|
|
233
|
+
}>,
|
|
243
234
|
),
|
|
244
235
|
|
|
245
|
-
// Get capability test metadata
|
|
246
236
|
getCapabilityTestMeta: (params: { capabilityId: string }) =>
|
|
247
|
-
|
|
237
|
+
intelligenceSdk.getCapabilityTestMeta(params) as Promise<{
|
|
248
238
|
requiresUserInput: boolean
|
|
249
239
|
inputHint: string
|
|
250
|
-
}
|
|
240
|
+
}>,
|
|
251
241
|
|
|
252
|
-
// Text methods
|
|
253
242
|
text: {
|
|
254
243
|
chat: (payload: IntelligenceChatPayload, options?: IntelligenceInvokeOptions) =>
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
options,
|
|
260
|
-
}),
|
|
261
|
-
),
|
|
244
|
+
invokeCapability<string>('text.chat', payload, options),
|
|
245
|
+
|
|
246
|
+
chatLangChain: params =>
|
|
247
|
+
withLoadingState(() => intelligenceSdk.chatLangChain(params)),
|
|
262
248
|
|
|
263
249
|
translate: (payload: IntelligenceTranslatePayload, options?: IntelligenceInvokeOptions) =>
|
|
264
|
-
|
|
265
|
-
sendChannelRequest<IntelligenceInvokeResult<string>>('intelligence:invoke', {
|
|
266
|
-
capabilityId: 'text.translate',
|
|
267
|
-
payload,
|
|
268
|
-
options,
|
|
269
|
-
}),
|
|
270
|
-
),
|
|
250
|
+
invokeCapability<string>('text.translate', payload, options),
|
|
271
251
|
|
|
272
252
|
summarize: (payload: IntelligenceSummarizePayload, options?: IntelligenceInvokeOptions) =>
|
|
273
|
-
|
|
274
|
-
sendChannelRequest<IntelligenceInvokeResult<string>>('intelligence:invoke', {
|
|
275
|
-
capabilityId: 'text.summarize',
|
|
276
|
-
payload,
|
|
277
|
-
options,
|
|
278
|
-
}),
|
|
279
|
-
),
|
|
253
|
+
invokeCapability<string>('text.summarize', payload, options),
|
|
280
254
|
|
|
281
255
|
rewrite: (payload: IntelligenceRewritePayload, options?: IntelligenceInvokeOptions) =>
|
|
282
|
-
|
|
283
|
-
sendChannelRequest<IntelligenceInvokeResult<string>>('intelligence:invoke', {
|
|
284
|
-
capabilityId: 'text.rewrite',
|
|
285
|
-
payload,
|
|
286
|
-
options,
|
|
287
|
-
}),
|
|
288
|
-
),
|
|
256
|
+
invokeCapability<string>('text.rewrite', payload, options),
|
|
289
257
|
|
|
290
258
|
grammarCheck: (payload: IntelligenceGrammarCheckPayload, options?: IntelligenceInvokeOptions) =>
|
|
291
|
-
|
|
292
|
-
sendChannelRequest<IntelligenceInvokeResult<IntelligenceGrammarCheckResult>>('intelligence:invoke', {
|
|
293
|
-
capabilityId: 'text.grammar',
|
|
294
|
-
payload,
|
|
295
|
-
options,
|
|
296
|
-
}),
|
|
297
|
-
),
|
|
259
|
+
invokeCapability<IntelligenceGrammarCheckResult>('text.grammar', payload, options),
|
|
298
260
|
},
|
|
299
261
|
|
|
300
|
-
// Embedding methods
|
|
301
262
|
embedding: {
|
|
302
263
|
generate: (payload: IntelligenceEmbeddingPayload, options?: IntelligenceInvokeOptions) =>
|
|
303
|
-
|
|
304
|
-
sendChannelRequest<IntelligenceInvokeResult<number[]>>('intelligence:invoke', {
|
|
305
|
-
capabilityId: 'embedding.generate',
|
|
306
|
-
payload,
|
|
307
|
-
options,
|
|
308
|
-
}),
|
|
309
|
-
),
|
|
264
|
+
invokeCapability<number[]>('embedding.generate', payload, options),
|
|
310
265
|
},
|
|
311
266
|
|
|
312
|
-
// Code methods
|
|
313
267
|
code: {
|
|
314
268
|
generate: (payload: IntelligenceCodeGeneratePayload, options?: IntelligenceInvokeOptions) =>
|
|
315
|
-
|
|
316
|
-
sendChannelRequest<IntelligenceInvokeResult<IntelligenceCodeGenerateResult>>('intelligence:invoke', {
|
|
317
|
-
capabilityId: 'code.generate',
|
|
318
|
-
payload,
|
|
319
|
-
options,
|
|
320
|
-
}),
|
|
321
|
-
),
|
|
269
|
+
invokeCapability<IntelligenceCodeGenerateResult>('code.generate', payload, options),
|
|
322
270
|
|
|
323
271
|
explain: (payload: IntelligenceCodeExplainPayload, options?: IntelligenceInvokeOptions) =>
|
|
324
|
-
|
|
325
|
-
sendChannelRequest<IntelligenceInvokeResult<IntelligenceCodeExplainResult>>('intelligence:invoke', {
|
|
326
|
-
capabilityId: 'code.explain',
|
|
327
|
-
payload,
|
|
328
|
-
options,
|
|
329
|
-
}),
|
|
330
|
-
),
|
|
272
|
+
invokeCapability<IntelligenceCodeExplainResult>('code.explain', payload, options),
|
|
331
273
|
|
|
332
274
|
review: (payload: IntelligenceCodeReviewPayload, options?: IntelligenceInvokeOptions) =>
|
|
333
|
-
|
|
334
|
-
sendChannelRequest<IntelligenceInvokeResult<IntelligenceCodeReviewResult>>('intelligence:invoke', {
|
|
335
|
-
capabilityId: 'code.review',
|
|
336
|
-
payload,
|
|
337
|
-
options,
|
|
338
|
-
}),
|
|
339
|
-
),
|
|
275
|
+
invokeCapability<IntelligenceCodeReviewResult>('code.review', payload, options),
|
|
340
276
|
|
|
341
277
|
refactor: (payload: IntelligenceCodeRefactorPayload, options?: IntelligenceInvokeOptions) =>
|
|
342
|
-
|
|
343
|
-
sendChannelRequest<IntelligenceInvokeResult<IntelligenceCodeRefactorResult>>('intelligence:invoke', {
|
|
344
|
-
capabilityId: 'code.refactor',
|
|
345
|
-
payload,
|
|
346
|
-
options,
|
|
347
|
-
}),
|
|
348
|
-
),
|
|
278
|
+
invokeCapability<IntelligenceCodeRefactorResult>('code.refactor', payload, options),
|
|
349
279
|
|
|
350
280
|
debug: (payload: IntelligenceCodeDebugPayload, options?: IntelligenceInvokeOptions) =>
|
|
351
|
-
|
|
352
|
-
sendChannelRequest<IntelligenceInvokeResult<IntelligenceCodeDebugResult>>('intelligence:invoke', {
|
|
353
|
-
capabilityId: 'code.debug',
|
|
354
|
-
payload,
|
|
355
|
-
options,
|
|
356
|
-
}),
|
|
357
|
-
),
|
|
281
|
+
invokeCapability<IntelligenceCodeDebugResult>('code.debug', payload, options),
|
|
358
282
|
},
|
|
359
283
|
|
|
360
|
-
// Analysis methods
|
|
361
284
|
analysis: {
|
|
362
285
|
detectIntent: (payload: IntelligenceIntentDetectPayload, options?: IntelligenceInvokeOptions) =>
|
|
363
|
-
|
|
364
|
-
sendChannelRequest<IntelligenceInvokeResult<IntelligenceIntentDetectResult>>('intelligence:invoke', {
|
|
365
|
-
capabilityId: 'intent.detect',
|
|
366
|
-
payload,
|
|
367
|
-
options,
|
|
368
|
-
}),
|
|
369
|
-
),
|
|
286
|
+
invokeCapability<IntelligenceIntentDetectResult>('intent.detect', payload, options),
|
|
370
287
|
|
|
371
288
|
analyzeSentiment: (payload: IntelligenceSentimentAnalyzePayload, options?: IntelligenceInvokeOptions) =>
|
|
372
|
-
|
|
373
|
-
sendChannelRequest<IntelligenceInvokeResult<IntelligenceSentimentAnalyzeResult>>('intelligence:invoke', {
|
|
374
|
-
capabilityId: 'sentiment.analyze',
|
|
375
|
-
payload,
|
|
376
|
-
options,
|
|
377
|
-
}),
|
|
378
|
-
),
|
|
289
|
+
invokeCapability<IntelligenceSentimentAnalyzeResult>('sentiment.analyze', payload, options),
|
|
379
290
|
|
|
380
291
|
extractContent: (payload: IntelligenceContentExtractPayload, options?: IntelligenceInvokeOptions) =>
|
|
381
|
-
|
|
382
|
-
sendChannelRequest<IntelligenceInvokeResult<IntelligenceContentExtractResult>>('intelligence:invoke', {
|
|
383
|
-
capabilityId: 'content.extract',
|
|
384
|
-
payload,
|
|
385
|
-
options,
|
|
386
|
-
}),
|
|
387
|
-
),
|
|
292
|
+
invokeCapability<IntelligenceContentExtractResult>('content.extract', payload, options),
|
|
388
293
|
|
|
389
294
|
extractKeywords: (payload: IntelligenceKeywordsExtractPayload, options?: IntelligenceInvokeOptions) =>
|
|
390
|
-
|
|
391
|
-
sendChannelRequest<IntelligenceInvokeResult<IntelligenceKeywordsExtractResult>>('intelligence:invoke', {
|
|
392
|
-
capabilityId: 'keywords.extract',
|
|
393
|
-
payload,
|
|
394
|
-
options,
|
|
395
|
-
}),
|
|
396
|
-
),
|
|
295
|
+
invokeCapability<IntelligenceKeywordsExtractResult>('keywords.extract', payload, options),
|
|
397
296
|
|
|
398
297
|
classify: (payload: IntelligenceClassificationPayload, options?: IntelligenceInvokeOptions) =>
|
|
399
|
-
|
|
400
|
-
sendChannelRequest<IntelligenceInvokeResult<IntelligenceClassificationResult>>('intelligence:invoke', {
|
|
401
|
-
capabilityId: 'text.classify',
|
|
402
|
-
payload,
|
|
403
|
-
options,
|
|
404
|
-
}),
|
|
405
|
-
),
|
|
298
|
+
invokeCapability<IntelligenceClassificationResult>('text.classify', payload, options),
|
|
406
299
|
},
|
|
407
300
|
|
|
408
|
-
// Vision methods
|
|
409
301
|
vision: {
|
|
410
302
|
ocr: (payload: IntelligenceVisionOcrPayload, options?: IntelligenceInvokeOptions) =>
|
|
411
|
-
|
|
412
|
-
sendChannelRequest<IntelligenceInvokeResult<IntelligenceVisionOcrResult>>('intelligence:invoke', {
|
|
413
|
-
capabilityId: 'vision.ocr',
|
|
414
|
-
payload,
|
|
415
|
-
options,
|
|
416
|
-
}),
|
|
417
|
-
),
|
|
303
|
+
invokeCapability<IntelligenceVisionOcrResult>('vision.ocr', payload, options),
|
|
418
304
|
|
|
419
305
|
caption: (payload: IntelligenceImageCaptionPayload, options?: IntelligenceInvokeOptions) =>
|
|
420
|
-
|
|
421
|
-
sendChannelRequest<IntelligenceInvokeResult<IntelligenceImageCaptionResult>>('intelligence:invoke', {
|
|
422
|
-
capabilityId: 'image.caption',
|
|
423
|
-
payload,
|
|
424
|
-
options,
|
|
425
|
-
}),
|
|
426
|
-
),
|
|
306
|
+
invokeCapability<IntelligenceImageCaptionResult>('image.caption', payload, options),
|
|
427
307
|
|
|
428
308
|
analyze: (payload: IntelligenceImageAnalyzePayload, options?: IntelligenceInvokeOptions) =>
|
|
429
|
-
|
|
430
|
-
sendChannelRequest<IntelligenceInvokeResult<IntelligenceImageAnalyzeResult>>('intelligence:invoke', {
|
|
431
|
-
capabilityId: 'image.analyze',
|
|
432
|
-
payload,
|
|
433
|
-
options,
|
|
434
|
-
}),
|
|
435
|
-
),
|
|
309
|
+
invokeCapability<IntelligenceImageAnalyzeResult>('image.analyze', payload, options),
|
|
436
310
|
|
|
437
311
|
generate: (payload: IntelligenceImageGeneratePayload, options?: IntelligenceInvokeOptions) =>
|
|
438
|
-
|
|
439
|
-
sendChannelRequest<IntelligenceInvokeResult<IntelligenceImageGenerateResult>>('intelligence:invoke', {
|
|
440
|
-
capabilityId: 'image.generate',
|
|
441
|
-
payload,
|
|
442
|
-
options,
|
|
443
|
-
}),
|
|
444
|
-
),
|
|
312
|
+
invokeCapability<IntelligenceImageGenerateResult>('image.generate', payload, options),
|
|
445
313
|
},
|
|
446
314
|
|
|
447
|
-
// RAG methods
|
|
448
315
|
rag: {
|
|
449
316
|
query: (payload: IntelligenceRAGQueryPayload, options?: IntelligenceInvokeOptions) =>
|
|
450
|
-
|
|
451
|
-
sendChannelRequest<IntelligenceInvokeResult<IntelligenceRAGQueryResult>>('intelligence:invoke', {
|
|
452
|
-
capabilityId: 'rag.query',
|
|
453
|
-
payload,
|
|
454
|
-
options,
|
|
455
|
-
}),
|
|
456
|
-
),
|
|
317
|
+
invokeCapability<IntelligenceRAGQueryResult>('rag.query', payload, options),
|
|
457
318
|
|
|
458
319
|
semanticSearch: (payload: IntelligenceSemanticSearchPayload, options?: IntelligenceInvokeOptions) =>
|
|
459
|
-
|
|
460
|
-
sendChannelRequest<IntelligenceInvokeResult<IntelligenceSemanticSearchResult>>('intelligence:invoke', {
|
|
461
|
-
capabilityId: 'search.semantic',
|
|
462
|
-
payload,
|
|
463
|
-
options,
|
|
464
|
-
}),
|
|
465
|
-
),
|
|
320
|
+
invokeCapability<IntelligenceSemanticSearchResult>('search.semantic', payload, options),
|
|
466
321
|
|
|
467
322
|
rerank: (payload: IntelligenceRerankPayload, options?: IntelligenceInvokeOptions) =>
|
|
468
|
-
|
|
469
|
-
sendChannelRequest<IntelligenceInvokeResult<IntelligenceRerankResult>>('intelligence:invoke', {
|
|
470
|
-
capabilityId: 'search.rerank',
|
|
471
|
-
payload,
|
|
472
|
-
options,
|
|
473
|
-
}),
|
|
474
|
-
),
|
|
323
|
+
invokeCapability<IntelligenceRerankResult>('search.rerank', payload, options),
|
|
475
324
|
},
|
|
476
325
|
|
|
477
|
-
// Agent methods
|
|
478
326
|
agent: {
|
|
479
327
|
run: (payload: IntelligenceAgentPayload, options?: IntelligenceInvokeOptions) =>
|
|
480
|
-
|
|
481
|
-
sendChannelRequest<IntelligenceInvokeResult<IntelligenceAgentResult>>('intelligence:invoke', {
|
|
482
|
-
capabilityId: 'agent.run',
|
|
483
|
-
payload,
|
|
484
|
-
options,
|
|
485
|
-
}),
|
|
486
|
-
),
|
|
328
|
+
invokeCapability<IntelligenceAgentResult>('agent.run', payload, options),
|
|
487
329
|
},
|
|
488
330
|
|
|
489
|
-
// Reactive state
|
|
490
331
|
isLoading,
|
|
491
332
|
lastError,
|
|
492
333
|
}
|