@talex-touch/utils 1.0.31 → 1.0.33
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/animation/window-node.ts +15 -12
- package/animation/window.ts +19 -15
- package/auth/clerk-types.ts +1 -1
- package/auth/index.ts +1 -1
- package/auth/useAuthState.ts +6 -5
- package/auth/useClerkConfig.ts +4 -4
- package/auth/useClerkProvider.ts +3 -2
- package/channel/index.ts +23 -22
- package/common/file-scan-constants.ts +137 -121
- package/common/file-scan-utils.ts +48 -27
- package/common/index.ts +3 -3
- package/common/search/gather.ts +1 -1
- package/common/search/index.ts +5 -6
- package/common/storage/constants.ts +3 -2
- package/common/storage/entity/app-settings.ts +5 -3
- package/common/storage/entity/shortcut-settings.ts +10 -10
- package/common/storage/shortcut-storage.ts +6 -4
- package/common/utils/file.ts +14 -6
- package/common/utils/index.ts +62 -52
- package/common/utils/polling.ts +88 -84
- package/common/utils/task-queue.ts +11 -10
- package/common/utils/time.ts +50 -47
- package/common/utils/timing.ts +41 -37
- package/core-box/builder/index.ts +1 -1
- package/core-box/builder/tuff-builder.ts +254 -229
- package/core-box/index.ts +4 -6
- package/core-box/preview/index.ts +1 -0
- package/core-box/preview/types.ts +43 -0
- package/core-box/recommendation.ts +77 -0
- package/core-box/tuff/index.ts +1 -1
- package/core-box/tuff/tuff-dsl.ts +328 -266
- package/electron/download-manager.ts +43 -42
- package/electron/env-tool.ts +19 -18
- package/electron/file-parsers/index.ts +2 -2
- package/electron/file-parsers/parsers/text-parser.ts +15 -14
- package/electron/file-parsers/registry.ts +9 -7
- package/electron/file-parsers/types.ts +4 -4
- package/electron/index.ts +2 -2
- package/eventbus/index.ts +11 -11
- package/index.ts +5 -4
- package/intelligence/client.ts +87 -0
- package/intelligence/index.ts +1 -0
- package/package.json +14 -14
- package/permission/index.ts +8 -8
- package/plugin/channel.ts +77 -68
- package/plugin/index.ts +96 -82
- package/plugin/install.ts +8 -8
- package/plugin/log/types.ts +5 -5
- package/plugin/node/index.ts +1 -1
- package/plugin/node/logger-manager.ts +14 -11
- package/plugin/node/logger.ts +8 -8
- package/plugin/plugin-source.ts +11 -11
- package/plugin/preload.ts +1 -1
- package/plugin/providers/registry.ts +8 -7
- package/plugin/providers/types.ts +6 -6
- package/plugin/sdk/README.md +216 -0
- package/plugin/sdk/box-sdk.ts +219 -0
- package/plugin/sdk/channel.ts +20 -20
- package/plugin/sdk/clipboard.ts +8 -6
- package/plugin/sdk/common.ts +10 -6
- package/plugin/sdk/core-box.ts +2 -3
- package/plugin/sdk/division-box.ts +266 -0
- package/plugin/sdk/enum/bridge-event.ts +1 -1
- package/plugin/sdk/examples/storage-onDidChange-example.js +1 -1
- package/plugin/sdk/feature-sdk.ts +235 -0
- package/plugin/sdk/features.ts +34 -26
- package/plugin/sdk/hooks/bridge.ts +3 -6
- package/plugin/sdk/hooks/index.ts +1 -1
- package/plugin/sdk/hooks/life-cycle.ts +4 -10
- package/plugin/sdk/index.ts +10 -7
- package/plugin/sdk/service/index.ts +3 -3
- package/plugin/sdk/storage.ts +4 -4
- package/plugin/sdk/system.ts +1 -1
- package/plugin/sdk/types.ts +165 -146
- package/plugin/sdk/window/index.ts +8 -5
- package/preload/loading.ts +6 -6
- package/preload/renderer.ts +4 -2
- package/renderer/hooks/arg-mapper.ts +1 -2
- package/renderer/hooks/index.ts +2 -0
- package/renderer/hooks/initialize.ts +10 -8
- package/renderer/hooks/performance.ts +4 -4
- package/renderer/hooks/use-channel.ts +150 -0
- package/renderer/hooks/use-intelligence.ts +236 -0
- package/renderer/index.ts +6 -2
- package/renderer/ref.ts +32 -36
- package/renderer/slots.ts +29 -26
- package/renderer/storage/app-settings.ts +16 -6
- package/renderer/storage/base-storage.ts +222 -114
- package/renderer/storage/index.ts +3 -0
- package/renderer/storage/intelligence-storage.ts +218 -0
- package/renderer/storage/openers.ts +13 -3
- package/renderer/touch-sdk/env.ts +41 -41
- package/renderer/touch-sdk/index.ts +1 -1
- package/renderer/touch-sdk/terminal.ts +5 -5
- package/renderer/touch-sdk/utils.ts +4 -3
- package/search/levenshtein-utils.ts +11 -11
- package/search/types.ts +102 -102
- package/service/index.ts +11 -11
- package/service/protocol/index.ts +217 -14
- package/types/division-box.ts +248 -0
- package/types/download.ts +72 -34
- package/types/index.ts +3 -1
- package/types/intelligence.ts +607 -0
- package/types/modules/base.ts +16 -16
- package/types/modules/index.ts +1 -1
- package/types/modules/module-lifecycle.ts +21 -21
- package/types/modules/module-manager.ts +11 -11
- package/types/modules/module.ts +16 -16
- package/types/storage.ts +0 -1
- package/types/touch-app-core.ts +32 -32
- package/types/update.ts +91 -21
- package/core-box/README.md +0 -218
- package/core-box/builder/tuff-builder.example.ts.bak +0 -258
- package/core-box/run-tests.sh +0 -7
- package/core-box/search.ts +0 -1
- package/electron/clipboard-helper.ts +0 -199
package/core-box/index.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
+
export * from './builder/index'
|
|
2
|
+
export * from './preview/index'
|
|
1
3
|
/**
|
|
2
4
|
* Core Box Package
|
|
3
5
|
* Search box core functionality package
|
|
4
6
|
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export * from './tuff/index.js';
|
|
8
|
-
|
|
9
|
-
// 导出 TUFF Builder 相关内容
|
|
10
|
-
export * from './builder/index.js';
|
|
7
|
+
export * from './tuff/index'
|
|
8
|
+
export * from './recommendation'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './types'
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export interface PreviewCardRow {
|
|
2
|
+
label: string
|
|
3
|
+
value: string
|
|
4
|
+
description?: string
|
|
5
|
+
copyable?: boolean
|
|
6
|
+
emphasize?: boolean
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface PreviewCardSection {
|
|
10
|
+
title?: string
|
|
11
|
+
rows: PreviewCardRow[]
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface PreviewCardChip {
|
|
15
|
+
label: string
|
|
16
|
+
value: string
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface PreviewCardPayload {
|
|
20
|
+
abilityId: string
|
|
21
|
+
title: string
|
|
22
|
+
subtitle?: string
|
|
23
|
+
primaryValue: string
|
|
24
|
+
primaryLabel?: string
|
|
25
|
+
primaryUnit?: string
|
|
26
|
+
secondaryValue?: string
|
|
27
|
+
secondaryLabel?: string
|
|
28
|
+
description?: string
|
|
29
|
+
accentColor?: string
|
|
30
|
+
badges?: string[]
|
|
31
|
+
chips?: PreviewCardChip[]
|
|
32
|
+
sections?: PreviewCardSection[]
|
|
33
|
+
warnings?: string[]
|
|
34
|
+
meta?: Record<string, any>
|
|
35
|
+
confidence?: number
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface PreviewAbilityResult {
|
|
39
|
+
abilityId: string
|
|
40
|
+
confidence: number
|
|
41
|
+
payload: PreviewCardPayload
|
|
42
|
+
durationMs?: number
|
|
43
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Time-based usage pattern context for recommendation matching.
|
|
3
|
+
*/
|
|
4
|
+
export interface TimePattern {
|
|
5
|
+
/** Hour of day (0-23) */
|
|
6
|
+
hourOfDay: number
|
|
7
|
+
/** Day of week (0-6, 0=Sunday) */
|
|
8
|
+
dayOfWeek: number
|
|
9
|
+
/** Whether current time falls within working hours (9-18, weekdays) */
|
|
10
|
+
isWorkingHours: boolean
|
|
11
|
+
/** Broad time categorization */
|
|
12
|
+
timeSlot: 'morning' | 'afternoon' | 'evening' | 'night'
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Complete contextual signal for recommendation matching.
|
|
17
|
+
* Gathered from system state, clipboard, and active applications.
|
|
18
|
+
*/
|
|
19
|
+
export interface ContextSignal {
|
|
20
|
+
time: TimePattern
|
|
21
|
+
clipboard?: {
|
|
22
|
+
type: string
|
|
23
|
+
/** Hashed content for privacy (not original text) */
|
|
24
|
+
content: string
|
|
25
|
+
timestamp: number
|
|
26
|
+
contentType?: 'url' | 'text' | 'code' | 'file'
|
|
27
|
+
meta?: {
|
|
28
|
+
isUrl?: boolean
|
|
29
|
+
urlDomain?: string
|
|
30
|
+
textLength?: number
|
|
31
|
+
fileExtension?: string
|
|
32
|
+
fileType?: 'code' | 'text' | 'image' | 'document' | 'other'
|
|
33
|
+
language?: string
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
foregroundApp?: {
|
|
37
|
+
bundleId: string
|
|
38
|
+
name: string
|
|
39
|
+
}
|
|
40
|
+
systemState?: {
|
|
41
|
+
isOnline: boolean
|
|
42
|
+
batteryLevel: number
|
|
43
|
+
isDNDEnabled: boolean
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Scored recommendation item from recommendation engine.
|
|
49
|
+
*/
|
|
50
|
+
export interface ScoredItem {
|
|
51
|
+
sourceId: string
|
|
52
|
+
itemId: string
|
|
53
|
+
score: number
|
|
54
|
+
source: 'frequent' | 'time-based' | 'recent' | 'trending' | 'context'
|
|
55
|
+
reason?: string
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Recommendation badge display configuration for UI rendering.
|
|
60
|
+
*/
|
|
61
|
+
export interface RecommendationBadge {
|
|
62
|
+
text: string
|
|
63
|
+
icon: string
|
|
64
|
+
variant: 'frequent' | 'intelligent' | 'recent' | 'trending'
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Enhanced item metadata for intelligent recommendations.
|
|
69
|
+
* Attached to TuffItem.meta for rendering and filtering.
|
|
70
|
+
*/
|
|
71
|
+
export interface RecommendationMetadata {
|
|
72
|
+
score: number
|
|
73
|
+
source: ScoredItem['source']
|
|
74
|
+
reason: string
|
|
75
|
+
isIntelligent: boolean
|
|
76
|
+
badge: RecommendationBadge
|
|
77
|
+
}
|
package/core-box/tuff/index.ts
CHANGED