@talex-touch/utils 1.0.42 → 1.0.45
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 +2690 -0
- package/transport/events/meta-overlay.ts +79 -0
- package/transport/events/types/agents.ts +177 -0
- package/transport/events/types/app-index.ts +20 -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 +84 -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 +631 -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 +141 -0
- package/transport/main.ts +2 -0
- package/transport/prelude.ts +208 -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 +102 -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,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Type definitions for Clipboard domain events
|
|
3
|
+
* @module @talex-touch/utils/transport/events/types/clipboard
|
|
4
|
+
* @since v0.9.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { TuffInputType } from './core-box'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Represents a single item in the clipboard history.
|
|
11
|
+
*/
|
|
12
|
+
export interface ClipboardItem {
|
|
13
|
+
id: number
|
|
14
|
+
type: TuffInputType
|
|
15
|
+
value: string
|
|
16
|
+
html?: string
|
|
17
|
+
rtf?: string
|
|
18
|
+
source?: string
|
|
19
|
+
tags?: string[]
|
|
20
|
+
createdAt: number
|
|
21
|
+
isFavorite?: boolean
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Payload for the clipboard change event stream.
|
|
26
|
+
*/
|
|
27
|
+
export interface ClipboardChangePayload {
|
|
28
|
+
latest: ClipboardItem | null
|
|
29
|
+
history: ClipboardItem[]
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Request to query clipboard history.
|
|
34
|
+
*/
|
|
35
|
+
export interface ClipboardQueryRequest {
|
|
36
|
+
page?: number
|
|
37
|
+
limit?: number
|
|
38
|
+
type?: 'all' | 'favorite' | 'text' | 'image'
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Response for clipboard history query.
|
|
43
|
+
*/
|
|
44
|
+
export interface ClipboardQueryResponse {
|
|
45
|
+
items: ClipboardItem[]
|
|
46
|
+
total: number
|
|
47
|
+
page: number
|
|
48
|
+
limit: number
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Request to apply a clipboard item.
|
|
53
|
+
*/
|
|
54
|
+
export interface ClipboardApplyRequest {
|
|
55
|
+
id: number
|
|
56
|
+
autoPaste?: boolean
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Request to delete a clipboard item.
|
|
61
|
+
*/
|
|
62
|
+
export interface ClipboardDeleteRequest {
|
|
63
|
+
id: number
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Request to set favorite status of a clipboard item.
|
|
68
|
+
*/
|
|
69
|
+
export interface ClipboardSetFavoriteRequest {
|
|
70
|
+
id: number
|
|
71
|
+
isFavorite: boolean
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Request to write content to the clipboard.
|
|
76
|
+
*/
|
|
77
|
+
export interface ClipboardWriteRequest {
|
|
78
|
+
type: 'text' | 'html' | 'image'
|
|
79
|
+
value: string
|
|
80
|
+
}
|
|
@@ -0,0 +1,534 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Type definitions for CoreBox domain events
|
|
3
|
+
* @module @talex-touch/utils/transport/events/types/core-box
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { IProviderActivate, TuffItem, TuffQuery, TuffQueryInput } from '../../../core-box/tuff/tuff-dsl'
|
|
7
|
+
|
|
8
|
+
// ============================================================================
|
|
9
|
+
// UI Types
|
|
10
|
+
// ============================================================================
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Options for expanding CoreBox.
|
|
14
|
+
*/
|
|
15
|
+
export interface ExpandOptions {
|
|
16
|
+
/**
|
|
17
|
+
* Expansion mode.
|
|
18
|
+
* - 'collapse' - Shrink to minimum size
|
|
19
|
+
* - 'max' - Expand to maximum size
|
|
20
|
+
*/
|
|
21
|
+
mode?: 'collapse' | 'max'
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Target height/length in pixels.
|
|
25
|
+
* Only used if mode is not specified.
|
|
26
|
+
*/
|
|
27
|
+
length?: number
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Layout update payload from renderer to main process.
|
|
32
|
+
*
|
|
33
|
+
* @remarks
|
|
34
|
+
* This is designed to be high-frequency (e.g. ResizeObserver). The main process
|
|
35
|
+
* should coalesce updates and decide the final window bounds.
|
|
36
|
+
*/
|
|
37
|
+
export interface CoreBoxLayoutUpdateRequest {
|
|
38
|
+
/**
|
|
39
|
+
* Desired CoreBox window height (px).
|
|
40
|
+
*/
|
|
41
|
+
height: number
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Current rendered item count.
|
|
45
|
+
*/
|
|
46
|
+
resultCount: number
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Whether CoreBox is currently loading results.
|
|
50
|
+
*/
|
|
51
|
+
loading: boolean
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Whether recommendation query is pending (empty input state).
|
|
55
|
+
*/
|
|
56
|
+
recommendationPending: boolean
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Current provider activation count (plugin UI / activation mode).
|
|
60
|
+
*/
|
|
61
|
+
activationCount: number
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Force CoreBox to expand to maximum height (e.g. widget loading).
|
|
65
|
+
*/
|
|
66
|
+
forceMax?: boolean
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Optional debug source tag.
|
|
70
|
+
*/
|
|
71
|
+
source?: string
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Response from focus window operation.
|
|
76
|
+
*/
|
|
77
|
+
export interface FocusWindowResponse {
|
|
78
|
+
/**
|
|
79
|
+
* Whether the window was successfully focused.
|
|
80
|
+
*/
|
|
81
|
+
focused: boolean
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Request to set input visibility.
|
|
86
|
+
*/
|
|
87
|
+
export interface SetInputVisibilityRequest {
|
|
88
|
+
/**
|
|
89
|
+
* Whether input should be visible.
|
|
90
|
+
*/
|
|
91
|
+
visible: boolean
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* UI view state for CoreBox.
|
|
96
|
+
*/
|
|
97
|
+
export interface CoreBoxUIViewStateResponse {
|
|
98
|
+
/**
|
|
99
|
+
* Whether a UI view is currently attached.
|
|
100
|
+
*/
|
|
101
|
+
isActive: boolean
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Whether the UI view has focus.
|
|
105
|
+
*/
|
|
106
|
+
isFocused: boolean
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Whether CoreBox is in UI mode.
|
|
110
|
+
*/
|
|
111
|
+
isUIMode: boolean
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Payload for CoreBox UI mode exit.
|
|
116
|
+
*/
|
|
117
|
+
export interface CoreBoxUIModeExitedPayload {
|
|
118
|
+
/**
|
|
119
|
+
* Whether renderer should reset input state.
|
|
120
|
+
*/
|
|
121
|
+
resetInput?: boolean
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// ============================================================================
|
|
125
|
+
// Search Types
|
|
126
|
+
// ============================================================================
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Input type for Tuff queries.
|
|
130
|
+
*/
|
|
131
|
+
export { TuffInputType } from '../../../core-box/tuff/tuff-dsl'
|
|
132
|
+
|
|
133
|
+
export type {
|
|
134
|
+
IProviderActivate,
|
|
135
|
+
TuffQueryInput as TuffInput,
|
|
136
|
+
TuffQuery,
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export interface CoreBoxSearchUpdatePayload {
|
|
140
|
+
searchId: string
|
|
141
|
+
items: TuffItem[]
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export interface CoreBoxSearchEndPayload {
|
|
145
|
+
searchId: string
|
|
146
|
+
cancelled?: boolean
|
|
147
|
+
activate?: unknown
|
|
148
|
+
sources?: unknown[]
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export interface CoreBoxNoResultsPayload {
|
|
152
|
+
shouldShrink?: boolean
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export interface CoreBoxClearItemsPayload {
|
|
156
|
+
pluginName?: string
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export interface CoreBoxExecuteRequest {
|
|
160
|
+
item: unknown
|
|
161
|
+
searchResult?: unknown
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export interface CoreBoxTogglePinRequest {
|
|
165
|
+
sourceId: string
|
|
166
|
+
itemId: string
|
|
167
|
+
sourceType: string
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export interface CoreBoxTogglePinResponse {
|
|
171
|
+
success: boolean
|
|
172
|
+
isPinned?: boolean
|
|
173
|
+
error?: string
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Single search result item.
|
|
178
|
+
*/
|
|
179
|
+
export interface TuffSearchResultItem {
|
|
180
|
+
/**
|
|
181
|
+
* Unique item ID.
|
|
182
|
+
*/
|
|
183
|
+
id: string
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Display title.
|
|
187
|
+
*/
|
|
188
|
+
title: string
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Optional subtitle/description.
|
|
192
|
+
*/
|
|
193
|
+
subtitle?: string
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Icon URL or data.
|
|
197
|
+
*/
|
|
198
|
+
icon?: string | TuffIcon
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Provider that generated this result.
|
|
202
|
+
*/
|
|
203
|
+
provider: string
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Relevance score (0-1).
|
|
207
|
+
*/
|
|
208
|
+
score?: number
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Additional metadata.
|
|
212
|
+
*/
|
|
213
|
+
meta?: TuffMeta
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Actions available for this item.
|
|
217
|
+
*/
|
|
218
|
+
actions?: TuffAction[]
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Icon definition for search results.
|
|
223
|
+
*/
|
|
224
|
+
export interface TuffIcon {
|
|
225
|
+
/**
|
|
226
|
+
* Icon type.
|
|
227
|
+
*/
|
|
228
|
+
type: 'url' | 'file' | 'emoji' | 'svg' | 'component' | 'class' | 'builtin'
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Icon value (URL, path, emoji, etc.).
|
|
232
|
+
*/
|
|
233
|
+
value: string
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Background color.
|
|
237
|
+
*/
|
|
238
|
+
background?: string
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* Action definition for search results.
|
|
243
|
+
*/
|
|
244
|
+
export interface TuffAction {
|
|
245
|
+
/**
|
|
246
|
+
* Action ID.
|
|
247
|
+
*/
|
|
248
|
+
id: string
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Display label.
|
|
252
|
+
*/
|
|
253
|
+
label: string
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Keyboard shortcut.
|
|
257
|
+
*/
|
|
258
|
+
shortcut?: string
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* Whether this is the default action.
|
|
262
|
+
*/
|
|
263
|
+
isDefault?: boolean
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* Metadata for search results.
|
|
268
|
+
*/
|
|
269
|
+
export interface TuffMeta {
|
|
270
|
+
/**
|
|
271
|
+
* Whether item is pinned.
|
|
272
|
+
*/
|
|
273
|
+
pinned?: {
|
|
274
|
+
isPinned: boolean
|
|
275
|
+
pinnedAt?: number
|
|
276
|
+
order?: number
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* Recommendation source.
|
|
281
|
+
*/
|
|
282
|
+
recommendation?: {
|
|
283
|
+
source: 'frequent' | 'recent' | 'time-based' | 'trending' | 'pinned' | 'context'
|
|
284
|
+
score?: number
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* Additional metadata.
|
|
289
|
+
*/
|
|
290
|
+
[key: string]: unknown
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* Container layout configuration.
|
|
295
|
+
*/
|
|
296
|
+
export interface TuffContainerLayout {
|
|
297
|
+
/**
|
|
298
|
+
* Layout mode.
|
|
299
|
+
*/
|
|
300
|
+
mode: 'list' | 'grid'
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* Grid configuration (only for grid mode).
|
|
304
|
+
*/
|
|
305
|
+
grid?: {
|
|
306
|
+
columns: number
|
|
307
|
+
gap?: number
|
|
308
|
+
itemSize?: 'small' | 'medium' | 'large'
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* Section grouping.
|
|
313
|
+
*/
|
|
314
|
+
sections?: TuffSection[]
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* Section definition for grouped results.
|
|
319
|
+
*/
|
|
320
|
+
export interface TuffSection {
|
|
321
|
+
/**
|
|
322
|
+
* Section ID.
|
|
323
|
+
*/
|
|
324
|
+
id: string
|
|
325
|
+
|
|
326
|
+
/**
|
|
327
|
+
* Section title.
|
|
328
|
+
*/
|
|
329
|
+
title: string
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* Whether section is collapsed.
|
|
333
|
+
*/
|
|
334
|
+
collapsed?: boolean
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
export type { TuffSearchResult } from '../../../core-box/tuff/tuff-dsl'
|
|
338
|
+
|
|
339
|
+
/**
|
|
340
|
+
* Request to cancel a search.
|
|
341
|
+
*/
|
|
342
|
+
export interface CancelSearchRequest {
|
|
343
|
+
/**
|
|
344
|
+
* ID of the search to cancel.
|
|
345
|
+
*/
|
|
346
|
+
searchId: string
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* Response from cancel search.
|
|
351
|
+
*/
|
|
352
|
+
export interface CancelSearchResponse {
|
|
353
|
+
/**
|
|
354
|
+
* Whether cancellation succeeded.
|
|
355
|
+
*/
|
|
356
|
+
cancelled: boolean
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
// ============================================================================
|
|
360
|
+
// Input Types
|
|
361
|
+
// ============================================================================
|
|
362
|
+
|
|
363
|
+
/**
|
|
364
|
+
* Response from get input operation.
|
|
365
|
+
*/
|
|
366
|
+
export interface GetInputResponse {
|
|
367
|
+
/**
|
|
368
|
+
* Current input value.
|
|
369
|
+
*/
|
|
370
|
+
input: string
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* Request to set input value.
|
|
375
|
+
*/
|
|
376
|
+
export interface SetInputRequest {
|
|
377
|
+
/**
|
|
378
|
+
* Value to set.
|
|
379
|
+
*/
|
|
380
|
+
value: string
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
/**
|
|
384
|
+
* Response from set input operation.
|
|
385
|
+
*/
|
|
386
|
+
export interface SetInputResponse {
|
|
387
|
+
/**
|
|
388
|
+
* Value that was set.
|
|
389
|
+
*/
|
|
390
|
+
value: string
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
/**
|
|
394
|
+
* Response from clear input operation.
|
|
395
|
+
*/
|
|
396
|
+
export interface ClearInputResponse {
|
|
397
|
+
/**
|
|
398
|
+
* Whether input was cleared.
|
|
399
|
+
*/
|
|
400
|
+
cleared: boolean
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
/**
|
|
404
|
+
* Input change payload from renderer.
|
|
405
|
+
*/
|
|
406
|
+
export interface CoreBoxInputChangeRequest {
|
|
407
|
+
input?: string
|
|
408
|
+
query?: TuffQuery
|
|
409
|
+
source?: 'renderer' | 'initial' | 'ui-monitor'
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
/**
|
|
413
|
+
* Serialized keyboard event data for IPC transport.
|
|
414
|
+
*/
|
|
415
|
+
export interface CoreBoxForwardKeyEvent {
|
|
416
|
+
key: string
|
|
417
|
+
code: string
|
|
418
|
+
metaKey: boolean
|
|
419
|
+
ctrlKey: boolean
|
|
420
|
+
altKey: boolean
|
|
421
|
+
shiftKey: boolean
|
|
422
|
+
repeat: boolean
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
// ============================================================================
|
|
426
|
+
// Provider Types
|
|
427
|
+
// ============================================================================
|
|
428
|
+
|
|
429
|
+
/**
|
|
430
|
+
* Request to deactivate a provider.
|
|
431
|
+
*/
|
|
432
|
+
export interface DeactivateProviderRequest {
|
|
433
|
+
/**
|
|
434
|
+
* Provider ID to deactivate.
|
|
435
|
+
*/
|
|
436
|
+
id: string
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
/**
|
|
440
|
+
* Activation state of providers.
|
|
441
|
+
*/
|
|
442
|
+
export interface ActivationState {
|
|
443
|
+
/**
|
|
444
|
+
* List of active provider IDs.
|
|
445
|
+
*/
|
|
446
|
+
activeProviders: string[]
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
/**
|
|
450
|
+
* Request to get provider details.
|
|
451
|
+
*/
|
|
452
|
+
export interface GetProviderDetailsRequest {
|
|
453
|
+
/**
|
|
454
|
+
* Provider IDs to query.
|
|
455
|
+
*/
|
|
456
|
+
providerIds: string[]
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
/**
|
|
460
|
+
* Provider detail information.
|
|
461
|
+
*/
|
|
462
|
+
export interface ProviderDetail {
|
|
463
|
+
/**
|
|
464
|
+
* Provider ID.
|
|
465
|
+
*/
|
|
466
|
+
id: string
|
|
467
|
+
|
|
468
|
+
/**
|
|
469
|
+
* Provider display name.
|
|
470
|
+
*/
|
|
471
|
+
name: string
|
|
472
|
+
|
|
473
|
+
/**
|
|
474
|
+
* Provider icon.
|
|
475
|
+
*/
|
|
476
|
+
icon?: string | TuffIcon
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
// ============================================================================
|
|
480
|
+
// UI Mode Types
|
|
481
|
+
// ============================================================================
|
|
482
|
+
|
|
483
|
+
/**
|
|
484
|
+
* Request to enter UI mode.
|
|
485
|
+
*/
|
|
486
|
+
export interface EnterUIModeRequest {
|
|
487
|
+
/**
|
|
488
|
+
* URL to load in UI mode.
|
|
489
|
+
*/
|
|
490
|
+
url: string
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
// ============================================================================
|
|
494
|
+
// Clipboard Types
|
|
495
|
+
// ============================================================================
|
|
496
|
+
|
|
497
|
+
/**
|
|
498
|
+
* Request to allow clipboard monitoring.
|
|
499
|
+
*/
|
|
500
|
+
export interface AllowClipboardRequest {
|
|
501
|
+
/**
|
|
502
|
+
* Bitmask of allowed clipboard types.
|
|
503
|
+
*/
|
|
504
|
+
types: number
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
/**
|
|
508
|
+
* Response from allow clipboard operation.
|
|
509
|
+
*/
|
|
510
|
+
export interface AllowClipboardResponse {
|
|
511
|
+
/**
|
|
512
|
+
* Whether clipboard monitoring is enabled.
|
|
513
|
+
*/
|
|
514
|
+
enabled: boolean
|
|
515
|
+
|
|
516
|
+
/**
|
|
517
|
+
* Types that are now allowed.
|
|
518
|
+
*/
|
|
519
|
+
types: number
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
// ============================================================================
|
|
523
|
+
// Input Monitoring Types
|
|
524
|
+
// ============================================================================
|
|
525
|
+
|
|
526
|
+
/**
|
|
527
|
+
* Response from allow input monitoring operation.
|
|
528
|
+
*/
|
|
529
|
+
export interface AllowInputMonitoringResponse {
|
|
530
|
+
/**
|
|
531
|
+
* Whether input monitoring is enabled.
|
|
532
|
+
*/
|
|
533
|
+
enabled: boolean
|
|
534
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
CloseOptions,
|
|
3
|
+
DivisionBoxConfig,
|
|
4
|
+
IPCResponse,
|
|
5
|
+
SessionInfo,
|
|
6
|
+
StateChangeEvent,
|
|
7
|
+
} from '../../../types/division-box'
|
|
8
|
+
import type { FlowPayload } from '../../../types/flow'
|
|
9
|
+
|
|
10
|
+
export type DivisionBoxOpenRequest = DivisionBoxConfig & {
|
|
11
|
+
_sdkapi?: number
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export type DivisionBoxOpenResponse = IPCResponse<SessionInfo>
|
|
15
|
+
|
|
16
|
+
export interface DivisionBoxCloseRequest {
|
|
17
|
+
sessionId: string
|
|
18
|
+
options?: CloseOptions
|
|
19
|
+
_sdkapi?: number
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export type DivisionBoxCloseResponse = IPCResponse<{ success: boolean }>
|
|
23
|
+
|
|
24
|
+
export interface DivisionBoxGetStateRequest {
|
|
25
|
+
sessionId: string
|
|
26
|
+
key?: string
|
|
27
|
+
_sdkapi?: number
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export type DivisionBoxGetStateResponse = IPCResponse<any>
|
|
31
|
+
|
|
32
|
+
export interface DivisionBoxUpdateStateRequest {
|
|
33
|
+
sessionId: string
|
|
34
|
+
key: string
|
|
35
|
+
value: any
|
|
36
|
+
_sdkapi?: number
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export type DivisionBoxUpdateStateResponse = IPCResponse<{ success: boolean }>
|
|
40
|
+
|
|
41
|
+
export interface DivisionBoxGetActiveSessionsRequest {
|
|
42
|
+
_sdkapi?: number
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export type DivisionBoxGetActiveSessionsResponse = IPCResponse<SessionInfo[]>
|
|
46
|
+
|
|
47
|
+
export type DivisionBoxStateChangedPayload = StateChangeEvent
|
|
48
|
+
|
|
49
|
+
export interface DivisionBoxSessionDestroyedPayload { sessionId: string }
|
|
50
|
+
|
|
51
|
+
export interface DivisionBoxTogglePinRequest {
|
|
52
|
+
sessionId: string
|
|
53
|
+
_sdkapi?: number
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export type DivisionBoxTogglePinResponse = IPCResponse<{ isPinned: boolean }>
|
|
57
|
+
|
|
58
|
+
export interface DivisionBoxSetOpacityRequest {
|
|
59
|
+
sessionId: string
|
|
60
|
+
opacity: number
|
|
61
|
+
_sdkapi?: number
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export type DivisionBoxSetOpacityResponse = IPCResponse<{ opacity: number }>
|
|
65
|
+
|
|
66
|
+
export interface DivisionBoxToggleDevToolsRequest {
|
|
67
|
+
sessionId: string
|
|
68
|
+
_sdkapi?: number
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export type DivisionBoxToggleDevToolsResponse = IPCResponse<{ isOpen: boolean }>
|
|
72
|
+
|
|
73
|
+
export interface DivisionBoxGetWindowStateRequest {
|
|
74
|
+
sessionId: string
|
|
75
|
+
_sdkapi?: number
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export type DivisionBoxGetWindowStateResponse = IPCResponse<{
|
|
79
|
+
isPinned: boolean
|
|
80
|
+
opacity: number
|
|
81
|
+
isDevToolsOpen: boolean
|
|
82
|
+
}>
|
|
83
|
+
|
|
84
|
+
export interface DivisionBoxInputChangeRequest {
|
|
85
|
+
sessionId: string
|
|
86
|
+
input: string
|
|
87
|
+
query: any
|
|
88
|
+
_sdkapi?: number
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export type DivisionBoxInputChangeResponse = IPCResponse<{ received: boolean }>
|
|
92
|
+
|
|
93
|
+
export interface DivisionBoxFlowTriggerRequest {
|
|
94
|
+
targetId: string
|
|
95
|
+
payload: FlowPayload
|
|
96
|
+
_sdkapi?: number
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export type DivisionBoxFlowTriggerResponse = IPCResponse<{ sessionId: string }>
|