@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,115 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
DownloadConfig,
|
|
3
|
+
DownloadHistory,
|
|
4
|
+
DownloadRequest,
|
|
5
|
+
DownloadStats,
|
|
6
|
+
DownloadStatus,
|
|
7
|
+
DownloadTask,
|
|
8
|
+
} from '../../../types/download'
|
|
9
|
+
|
|
10
|
+
export type DownloadAddTaskRequest = DownloadRequest
|
|
11
|
+
|
|
12
|
+
export type DownloadTaskPayload = DownloadTask
|
|
13
|
+
|
|
14
|
+
export interface DownloadOpResponse {
|
|
15
|
+
success: boolean
|
|
16
|
+
error?: string
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export type DownloadAddTaskResponse = DownloadOpResponse & {
|
|
20
|
+
taskId?: string
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface DownloadTaskIdRequest {
|
|
24
|
+
taskId: string
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export type DownloadGetTasksResponse = DownloadOpResponse & {
|
|
28
|
+
tasks?: DownloadTask[]
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export type DownloadGetTaskStatusResponse = DownloadOpResponse & {
|
|
32
|
+
task?: DownloadTask | null
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export type DownloadGetConfigResponse = DownloadOpResponse & {
|
|
36
|
+
config?: DownloadConfig
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export type DownloadGetNotificationConfigResponse = DownloadOpResponse & {
|
|
40
|
+
config?: unknown
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export type DownloadGetHistoryResponse = DownloadOpResponse & {
|
|
44
|
+
history?: DownloadHistory[]
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export type DownloadGetLogsResponse = DownloadOpResponse & {
|
|
48
|
+
logs?: unknown
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export type DownloadGetErrorStatsResponse = DownloadOpResponse & {
|
|
52
|
+
stats?: unknown
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export type DownloadGetTempStatsResponse = DownloadOpResponse & {
|
|
56
|
+
stats?: unknown
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface DownloadGetTasksByStatusRequest {
|
|
60
|
+
status: DownloadStatus
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface DownloadUpdatePriorityRequest {
|
|
64
|
+
taskId: string
|
|
65
|
+
priority: number
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface DownloadGetHistoryRequest {
|
|
69
|
+
limit?: number
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export interface DownloadClearHistoryItemRequest {
|
|
73
|
+
historyId: string
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface DownloadUpdateConfigRequest {
|
|
77
|
+
config: DownloadConfig
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export interface DownloadUpdateNotificationConfigRequest {
|
|
81
|
+
config: unknown
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface DownloadTaskRetryingPayload {
|
|
85
|
+
taskId: string
|
|
86
|
+
attempt: number
|
|
87
|
+
error: string
|
|
88
|
+
delay: number
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export interface DownloadNotificationClickedPayload {
|
|
92
|
+
taskId: string
|
|
93
|
+
action: string
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export type DownloadMigrationStatusResponse = DownloadOpResponse & {
|
|
97
|
+
currentVersion?: number
|
|
98
|
+
appliedMigrations?: unknown[]
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export type DownloadMigrationNeededResponse = DownloadOpResponse & {
|
|
102
|
+
needed?: boolean
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export type DownloadMigrationStartResponse = DownloadOpResponse & {
|
|
106
|
+
result?: { migrated: boolean }
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export type DownloadMigrationRetryResponse = DownloadOpResponse & {
|
|
110
|
+
result?: { migrated: boolean }
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export type DownloadGetStatsResponse = DownloadOpResponse & {
|
|
114
|
+
stats?: DownloadStats
|
|
115
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Type definitions for File Index events
|
|
3
|
+
* @module @talex-touch/utils/transport/events/types/file-index
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export type FileIndexStage
|
|
7
|
+
= | 'idle'
|
|
8
|
+
| 'cleanup'
|
|
9
|
+
| 'scanning'
|
|
10
|
+
| 'indexing'
|
|
11
|
+
| 'reconciliation'
|
|
12
|
+
| 'completed'
|
|
13
|
+
| string
|
|
14
|
+
|
|
15
|
+
export interface FileIndexProgress {
|
|
16
|
+
stage: FileIndexStage
|
|
17
|
+
current: number
|
|
18
|
+
total: number
|
|
19
|
+
progress: number
|
|
20
|
+
startTime: number | null
|
|
21
|
+
estimatedRemainingMs: number | null
|
|
22
|
+
averageItemsPerSecond: number
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface FileIndexStatus {
|
|
26
|
+
isInitializing: boolean
|
|
27
|
+
initializationFailed: boolean
|
|
28
|
+
error: string | null
|
|
29
|
+
progress: {
|
|
30
|
+
stage: FileIndexStage | null
|
|
31
|
+
current: number
|
|
32
|
+
total: number
|
|
33
|
+
}
|
|
34
|
+
startTime: number | null
|
|
35
|
+
estimatedCompletion: number | null
|
|
36
|
+
estimatedRemainingMs: number | null
|
|
37
|
+
averageItemsPerSecond: number
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface FileIndexStats {
|
|
41
|
+
totalFiles: number
|
|
42
|
+
failedFiles: number
|
|
43
|
+
skippedFiles: number
|
|
44
|
+
completedFiles: number
|
|
45
|
+
embeddingCompletedFiles: number
|
|
46
|
+
embeddingRows: number
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface FileIndexAddPathRequest {
|
|
50
|
+
path: string
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface FileIndexAddPathResult {
|
|
54
|
+
success: boolean
|
|
55
|
+
status: 'added' | 'exists' | 'invalid' | 'error'
|
|
56
|
+
path?: string
|
|
57
|
+
reason?: string
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface FileIndexRebuildRequest {
|
|
61
|
+
force?: boolean
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface FileIndexRebuildResult {
|
|
65
|
+
success: boolean
|
|
66
|
+
message?: string
|
|
67
|
+
error?: string
|
|
68
|
+
requiresConfirm?: boolean
|
|
69
|
+
reason?: 'battery-low' | 'initializing' | 'missing-context' | 'policy-blocked'
|
|
70
|
+
battery?: FileIndexBatteryStatus | null
|
|
71
|
+
threshold?: number
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export interface FileIndexFailedFile {
|
|
75
|
+
fileId: number
|
|
76
|
+
path: string
|
|
77
|
+
lastError: string | null
|
|
78
|
+
updatedAt: string | null
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export interface FileIndexBatteryStatus {
|
|
82
|
+
level: number
|
|
83
|
+
charging: boolean
|
|
84
|
+
}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
FlowDispatchOptions,
|
|
3
|
+
FlowDispatchResult,
|
|
4
|
+
FlowPayload,
|
|
5
|
+
FlowPayloadType,
|
|
6
|
+
FlowSessionUpdate,
|
|
7
|
+
FlowTargetInfo,
|
|
8
|
+
NativeShareResult,
|
|
9
|
+
} from '../../../types/flow'
|
|
10
|
+
|
|
11
|
+
export interface FlowDispatchRequest {
|
|
12
|
+
senderId?: string
|
|
13
|
+
actorPluginId?: string
|
|
14
|
+
payload: FlowPayload
|
|
15
|
+
options?: FlowDispatchOptions
|
|
16
|
+
_sdkapi?: number
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface FlowDispatchResponse {
|
|
20
|
+
success: boolean
|
|
21
|
+
data?: FlowDispatchResult
|
|
22
|
+
error?: { message: string }
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface FlowGetTargetsRequest {
|
|
26
|
+
payloadType?: FlowPayloadType
|
|
27
|
+
_sdkapi?: number
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface FlowGetTargetsResponse {
|
|
31
|
+
success: boolean
|
|
32
|
+
data?: FlowTargetInfo[]
|
|
33
|
+
error?: { message: string }
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface FlowSessionActionRequest {
|
|
37
|
+
sessionId: string
|
|
38
|
+
_sdkapi?: number
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface FlowCancelResponse {
|
|
42
|
+
success: boolean
|
|
43
|
+
data?: { cancelled: boolean }
|
|
44
|
+
error?: { message: string }
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface FlowAcknowledgeRequest {
|
|
48
|
+
sessionId: string
|
|
49
|
+
ackPayload?: any
|
|
50
|
+
_sdkapi?: number
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface FlowAcknowledgeResponse {
|
|
54
|
+
success: boolean
|
|
55
|
+
data?: { acknowledged: boolean }
|
|
56
|
+
error?: { message: string }
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface FlowReportErrorRequest {
|
|
60
|
+
sessionId: string
|
|
61
|
+
message: string
|
|
62
|
+
_sdkapi?: number
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface FlowReportErrorResponse {
|
|
66
|
+
success: boolean
|
|
67
|
+
data?: { reported: boolean }
|
|
68
|
+
error?: { message: string }
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface FlowSetPluginHandlerRequest {
|
|
72
|
+
pluginId: string
|
|
73
|
+
hasHandler: boolean
|
|
74
|
+
_sdkapi?: number
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface FlowRegisterTargetsRequest {
|
|
78
|
+
pluginId: string
|
|
79
|
+
targets: any[]
|
|
80
|
+
pluginName?: string
|
|
81
|
+
pluginIcon?: string
|
|
82
|
+
isEnabled?: boolean
|
|
83
|
+
_sdkapi?: number
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface FlowUnregisterTargetsRequest {
|
|
87
|
+
pluginId: string
|
|
88
|
+
_sdkapi?: number
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export interface FlowSetPluginEnabledRequest {
|
|
92
|
+
pluginId: string
|
|
93
|
+
enabled: boolean
|
|
94
|
+
_sdkapi?: number
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export interface FlowNativeShareRequest {
|
|
98
|
+
payload: FlowPayload
|
|
99
|
+
target?: string
|
|
100
|
+
_sdkapi?: number
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export type FlowNativeShareResponse = NativeShareResult
|
|
104
|
+
|
|
105
|
+
export interface FlowSelectTargetRequest {
|
|
106
|
+
sessionId: string
|
|
107
|
+
targetId: string | null
|
|
108
|
+
_sdkapi?: number
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export interface FlowSelectTargetResponse {
|
|
112
|
+
success: boolean
|
|
113
|
+
data?: { resolved: boolean }
|
|
114
|
+
error?: { message: string }
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export interface FlowConsentCheckRequest {
|
|
118
|
+
senderId: string
|
|
119
|
+
targetId: string
|
|
120
|
+
_sdkapi?: number
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export interface FlowConsentCheckResponse {
|
|
124
|
+
success: boolean
|
|
125
|
+
data?: { allowed: boolean }
|
|
126
|
+
error?: { message: string }
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export interface FlowConsentGrantRequest {
|
|
130
|
+
senderId: string
|
|
131
|
+
targetId: string
|
|
132
|
+
mode: 'once' | 'always'
|
|
133
|
+
_sdkapi?: number
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export interface FlowConsentGrantResponse {
|
|
137
|
+
success: boolean
|
|
138
|
+
data?: { token?: string }
|
|
139
|
+
error?: { message: string }
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export interface FlowDeliverPayload {
|
|
143
|
+
sessionId: string
|
|
144
|
+
payload: FlowPayload
|
|
145
|
+
senderId: string
|
|
146
|
+
senderName?: string
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export type FlowSessionUpdatePayload = FlowSessionUpdate
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Type exports for all TuffTransport event domains
|
|
3
|
+
* @module @talex-touch/utils/transport/events/types
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
// Agents domain types
|
|
7
|
+
export * from './agents'
|
|
8
|
+
|
|
9
|
+
// App domain types
|
|
10
|
+
export * from './app'
|
|
11
|
+
|
|
12
|
+
// App index domain types
|
|
13
|
+
export * from './app-index'
|
|
14
|
+
|
|
15
|
+
// BoxItem domain types
|
|
16
|
+
export * from './box-item'
|
|
17
|
+
|
|
18
|
+
// Clipboard domain types
|
|
19
|
+
export * from './clipboard'
|
|
20
|
+
|
|
21
|
+
// CoreBox domain types
|
|
22
|
+
export * from './core-box'
|
|
23
|
+
|
|
24
|
+
// Device idle domain types
|
|
25
|
+
export * from './device-idle'
|
|
26
|
+
|
|
27
|
+
// DivisionBox domain types
|
|
28
|
+
export * from './division-box'
|
|
29
|
+
|
|
30
|
+
// Download domain types
|
|
31
|
+
export * from './download'
|
|
32
|
+
|
|
33
|
+
// File index domain types
|
|
34
|
+
export * from './file-index'
|
|
35
|
+
|
|
36
|
+
// Flow domain types
|
|
37
|
+
export * from './flow'
|
|
38
|
+
|
|
39
|
+
// Market domain types
|
|
40
|
+
export * from './market'
|
|
41
|
+
|
|
42
|
+
// MetaOverlay domain types
|
|
43
|
+
export * from './meta-overlay'
|
|
44
|
+
|
|
45
|
+
// Notification domain types
|
|
46
|
+
export * from './notification'
|
|
47
|
+
|
|
48
|
+
// Permission domain types
|
|
49
|
+
export * from './permission'
|
|
50
|
+
|
|
51
|
+
// Platform domain types
|
|
52
|
+
export * from './platform'
|
|
53
|
+
|
|
54
|
+
// Plugin domain types
|
|
55
|
+
export * from './plugin'
|
|
56
|
+
|
|
57
|
+
// Sentry domain types
|
|
58
|
+
export * from './sentry'
|
|
59
|
+
|
|
60
|
+
// Storage domain types
|
|
61
|
+
export * from './storage'
|
|
62
|
+
|
|
63
|
+
// Transport domain types
|
|
64
|
+
export * from './transport'
|
|
65
|
+
|
|
66
|
+
// Tray domain types
|
|
67
|
+
export * from './tray'
|
|
68
|
+
|
|
69
|
+
// Update domain types
|
|
70
|
+
export * from './update'
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Type definitions for Market domain events
|
|
3
|
+
* @module @talex-touch/utils/transport/events/types/market
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { MarketHttpRequestOptions, MarketHttpResponse } from '../../../market/types'
|
|
7
|
+
import type { MarketPluginInfo, MarketSearchOptions, MarketSearchResult } from '../../../plugin/providers'
|
|
8
|
+
|
|
9
|
+
export interface MarketPluginUpdateInfo {
|
|
10
|
+
slug: string
|
|
11
|
+
currentVersion: string
|
|
12
|
+
latestVersion: string
|
|
13
|
+
hasUpdate: boolean
|
|
14
|
+
downloadUrl?: string
|
|
15
|
+
changelog?: string
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface MarketCheckUpdatesResponse {
|
|
19
|
+
updates: MarketPluginUpdateInfo[]
|
|
20
|
+
checkedAt: string
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export type MarketSearchRequest = MarketSearchOptions
|
|
24
|
+
|
|
25
|
+
export type MarketSearchResponse = MarketSearchResult
|
|
26
|
+
|
|
27
|
+
export interface MarketGetPluginRequest {
|
|
28
|
+
identifier?: string
|
|
29
|
+
source?: 'tpex' | 'npm'
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export type MarketGetPluginResponse = MarketPluginInfo | null
|
|
33
|
+
|
|
34
|
+
export type MarketHttpRequest = MarketHttpRequestOptions
|
|
35
|
+
export type MarketHttpRequestResponse<T = unknown> = MarketHttpResponse<T>
|
|
36
|
+
|
|
37
|
+
export interface MarketUpdatesAvailablePayload {
|
|
38
|
+
updates: MarketPluginUpdateInfo[]
|
|
39
|
+
}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Type definitions for MetaOverlay domain events
|
|
3
|
+
* @module @talex-touch/utils/transport/events/types/meta-overlay
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { TuffItem } from '../../../core-box/tuff/tuff-dsl'
|
|
7
|
+
import type { ITuffIcon } from '../../../types/icon'
|
|
8
|
+
|
|
9
|
+
// ============================================================================
|
|
10
|
+
// MetaAction Types
|
|
11
|
+
// ============================================================================
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Simplified TuffRenderDSL for MetaOverlay actions.
|
|
15
|
+
* Does not support widgets, only basic rendering.
|
|
16
|
+
*/
|
|
17
|
+
export interface MetaActionRender {
|
|
18
|
+
/**
|
|
19
|
+
* Basic information
|
|
20
|
+
*/
|
|
21
|
+
basic: {
|
|
22
|
+
/**
|
|
23
|
+
* Action title
|
|
24
|
+
*/
|
|
25
|
+
title: string
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Optional subtitle/description
|
|
29
|
+
*/
|
|
30
|
+
subtitle?: string
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Optional icon
|
|
34
|
+
*/
|
|
35
|
+
icon?: ITuffIcon
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Keyboard shortcut (optional)
|
|
40
|
+
* e.g., '⌘C', '⌘⇧F', '⌘⇧D'
|
|
41
|
+
*/
|
|
42
|
+
shortcut?: string
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Group title (optional)
|
|
46
|
+
* e.g., '列表', '操作'
|
|
47
|
+
*/
|
|
48
|
+
group?: string
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Whether action is disabled
|
|
52
|
+
*/
|
|
53
|
+
disabled?: boolean
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Whether this is a dangerous action (red color)
|
|
57
|
+
*/
|
|
58
|
+
danger?: boolean
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Meta action definition
|
|
63
|
+
*/
|
|
64
|
+
export interface MetaAction {
|
|
65
|
+
/**
|
|
66
|
+
* Unique action ID
|
|
67
|
+
*/
|
|
68
|
+
id: string
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Render configuration
|
|
72
|
+
*/
|
|
73
|
+
render: MetaActionRender
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Handler identifier
|
|
77
|
+
* - 'builtin': Built-in action (handled by main process)
|
|
78
|
+
* - 'item': Item-specific action (from item.actions)
|
|
79
|
+
* - plugin ID: Plugin-registered action
|
|
80
|
+
*/
|
|
81
|
+
handler?: string
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Priority for sorting (higher = top)
|
|
85
|
+
* - Built-in actions: 0
|
|
86
|
+
* - Item actions: 50
|
|
87
|
+
* - Plugin actions: 100
|
|
88
|
+
*/
|
|
89
|
+
priority?: number
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// ============================================================================
|
|
93
|
+
// Request/Response Types
|
|
94
|
+
// ============================================================================
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Request to show MetaOverlay
|
|
98
|
+
*/
|
|
99
|
+
export interface MetaShowRequest {
|
|
100
|
+
/**
|
|
101
|
+
* Current selected item
|
|
102
|
+
*/
|
|
103
|
+
item: TuffItem
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Built-in actions (fixed/copy/display/transfer)
|
|
107
|
+
*/
|
|
108
|
+
builtinActions: MetaAction[]
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Item-specific actions (from item.actions)
|
|
112
|
+
*/
|
|
113
|
+
itemActions?: MetaAction[]
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Plugin-registered global actions
|
|
117
|
+
*/
|
|
118
|
+
pluginActions?: MetaAction[]
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Request to execute an action
|
|
123
|
+
*/
|
|
124
|
+
export interface MetaActionExecuteRequest {
|
|
125
|
+
/**
|
|
126
|
+
* Action ID to execute
|
|
127
|
+
*/
|
|
128
|
+
actionId: string
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Item ID context
|
|
132
|
+
*/
|
|
133
|
+
itemId: string
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Response from action execution
|
|
138
|
+
*/
|
|
139
|
+
export interface MetaActionExecuteResponse {
|
|
140
|
+
/**
|
|
141
|
+
* Whether execution succeeded
|
|
142
|
+
*/
|
|
143
|
+
success: boolean
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Error message if failed
|
|
147
|
+
*/
|
|
148
|
+
error?: string
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Request to register a plugin action
|
|
153
|
+
*/
|
|
154
|
+
export interface MetaRegisterActionRequest {
|
|
155
|
+
/**
|
|
156
|
+
* Plugin ID
|
|
157
|
+
*/
|
|
158
|
+
pluginId: string
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Action to register
|
|
162
|
+
*/
|
|
163
|
+
action: MetaAction
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Request to unregister plugin actions
|
|
168
|
+
*/
|
|
169
|
+
export interface MetaUnregisterActionsRequest {
|
|
170
|
+
/**
|
|
171
|
+
* Plugin ID
|
|
172
|
+
*/
|
|
173
|
+
pluginId: string
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Response from visibility check
|
|
178
|
+
*/
|
|
179
|
+
export interface MetaVisibilityResponse {
|
|
180
|
+
/**
|
|
181
|
+
* Whether MetaOverlay is visible
|
|
182
|
+
*/
|
|
183
|
+
visible: boolean
|
|
184
|
+
}
|