@maccesar/titools 2.0.0

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.
Files changed (120) hide show
  1. package/AGENTS-TEMPLATE.md +173 -0
  2. package/README.md +867 -0
  3. package/agents/ti-researcher.md +108 -0
  4. package/bin/titools.js +53 -0
  5. package/lib/commands/agents.js +126 -0
  6. package/lib/commands/install.js +188 -0
  7. package/lib/commands/uninstall.js +215 -0
  8. package/lib/commands/update.js +159 -0
  9. package/lib/config.js +119 -0
  10. package/lib/downloader.js +153 -0
  11. package/lib/installer.js +253 -0
  12. package/lib/platform.js +108 -0
  13. package/lib/symlink.js +142 -0
  14. package/lib/utils.js +270 -0
  15. package/package.json +67 -0
  16. package/skills/alloy-expert/SKILL.md +247 -0
  17. package/skills/alloy-expert/assets/ControllerAutoCleanup.js +182 -0
  18. package/skills/alloy-expert/references/alloy-structure.md +381 -0
  19. package/skills/alloy-expert/references/anti-patterns.md +133 -0
  20. package/skills/alloy-expert/references/code-conventions.md +469 -0
  21. package/skills/alloy-expert/references/contracts.md +280 -0
  22. package/skills/alloy-expert/references/controller-patterns.md +520 -0
  23. package/skills/alloy-expert/references/error-handling.md +484 -0
  24. package/skills/alloy-expert/references/examples.md +735 -0
  25. package/skills/alloy-expert/references/migration-patterns.md +298 -0
  26. package/skills/alloy-expert/references/patterns.md +448 -0
  27. package/skills/alloy-expert/references/performance-patterns.md +855 -0
  28. package/skills/alloy-expert/references/security-patterns.md +847 -0
  29. package/skills/alloy-expert/references/state-management.md +779 -0
  30. package/skills/alloy-expert/references/testing.md +872 -0
  31. package/skills/alloy-guides/SKILL.md +214 -0
  32. package/skills/alloy-guides/references/CLI_TASKS.md +243 -0
  33. package/skills/alloy-guides/references/CONCEPTS.md +191 -0
  34. package/skills/alloy-guides/references/CONTROLLERS.md +298 -0
  35. package/skills/alloy-guides/references/MODELS.md +1028 -0
  36. package/skills/alloy-guides/references/PURGETSS.md +56 -0
  37. package/skills/alloy-guides/references/VIEWS_DYNAMIC.md +242 -0
  38. package/skills/alloy-guides/references/VIEWS_STYLES.md +388 -0
  39. package/skills/alloy-guides/references/VIEWS_WITHOUT_CONTROLLERS.md +109 -0
  40. package/skills/alloy-guides/references/VIEWS_XML.md +558 -0
  41. package/skills/alloy-guides/references/WIDGETS.md +176 -0
  42. package/skills/alloy-howtos/SKILL.md +203 -0
  43. package/skills/alloy-howtos/references/best_practices.md +138 -0
  44. package/skills/alloy-howtos/references/cli_reference.md +253 -0
  45. package/skills/alloy-howtos/references/config_files.md +87 -0
  46. package/skills/alloy-howtos/references/custom_tags.md +147 -0
  47. package/skills/alloy-howtos/references/debugging_troubleshooting.md +101 -0
  48. package/skills/alloy-howtos/references/samples.md +167 -0
  49. package/skills/purgetss/SKILL.md +442 -0
  50. package/skills/purgetss/assets/purgetss.config.cjs +17 -0
  51. package/skills/purgetss/references/EXAMPLES.md +247 -0
  52. package/skills/purgetss/references/animation-system.md +1294 -0
  53. package/skills/purgetss/references/apply-directive.md +375 -0
  54. package/skills/purgetss/references/arbitrary-values.md +612 -0
  55. package/skills/purgetss/references/class-index.md +1350 -0
  56. package/skills/purgetss/references/cli-commands.md +948 -0
  57. package/skills/purgetss/references/configurable-properties.md +654 -0
  58. package/skills/purgetss/references/custom-rules.md +161 -0
  59. package/skills/purgetss/references/customization-deep-dive.md +722 -0
  60. package/skills/purgetss/references/dynamic-component-creation.md +489 -0
  61. package/skills/purgetss/references/grid-layout.md +455 -0
  62. package/skills/purgetss/references/icon-fonts.md +609 -0
  63. package/skills/purgetss/references/installation-setup.md +366 -0
  64. package/skills/purgetss/references/opacity-modifier.md +291 -0
  65. package/skills/purgetss/references/platform-modifiers.md +479 -0
  66. package/skills/purgetss/references/smart-mappings.md +42 -0
  67. package/skills/purgetss/references/titanium-resets.md +359 -0
  68. package/skills/purgetss/references/ui-ux-design.md +1526 -0
  69. package/skills/ti-guides/SKILL.md +94 -0
  70. package/skills/ti-guides/references/advanced-data-and-images.md +19 -0
  71. package/skills/ti-guides/references/alloy-cli-advanced.md +84 -0
  72. package/skills/ti-guides/references/alloy-data-mastery.md +29 -0
  73. package/skills/ti-guides/references/alloy-widgets-and-themes.md +19 -0
  74. package/skills/ti-guides/references/android-manifest.md +97 -0
  75. package/skills/ti-guides/references/app-distribution.md +258 -0
  76. package/skills/ti-guides/references/application-frameworks.md +377 -0
  77. package/skills/ti-guides/references/cli-reference.md +402 -0
  78. package/skills/ti-guides/references/coding-best-practices.md +102 -0
  79. package/skills/ti-guides/references/commonjs-advanced.md +134 -0
  80. package/skills/ti-guides/references/hello-world.md +100 -0
  81. package/skills/ti-guides/references/hyperloop-native-access.md +62 -0
  82. package/skills/ti-guides/references/javascript-primer.md +411 -0
  83. package/skills/ti-guides/references/reserved-words.md +36 -0
  84. package/skills/ti-guides/references/resources.md +183 -0
  85. package/skills/ti-guides/references/style-and-conventions.md +48 -0
  86. package/skills/ti-guides/references/tiapp-config.md +609 -0
  87. package/skills/ti-howtos/SKILL.md +174 -0
  88. package/skills/ti-howtos/references/android-platform-deep-dives.md +658 -0
  89. package/skills/ti-howtos/references/automation-fastlane-appium.md +95 -0
  90. package/skills/ti-howtos/references/buffer-codec-streams.md +140 -0
  91. package/skills/ti-howtos/references/cross-platform-development.md +348 -0
  92. package/skills/ti-howtos/references/debugging-profiling.md +543 -0
  93. package/skills/ti-howtos/references/extending-titanium.md +723 -0
  94. package/skills/ti-howtos/references/google-maps-v2.md +169 -0
  95. package/skills/ti-howtos/references/ios-map-kit.md +143 -0
  96. package/skills/ti-howtos/references/ios-platform-deep-dives.md +783 -0
  97. package/skills/ti-howtos/references/local-data-sources.md +301 -0
  98. package/skills/ti-howtos/references/location-and-maps.md +252 -0
  99. package/skills/ti-howtos/references/media-apis.md +210 -0
  100. package/skills/ti-howtos/references/notification-services.md +599 -0
  101. package/skills/ti-howtos/references/remote-data-sources.md +349 -0
  102. package/skills/ti-howtos/references/tutorials.md +502 -0
  103. package/skills/ti-howtos/references/using-modules.md +237 -0
  104. package/skills/ti-howtos/references/web-content-integration.md +307 -0
  105. package/skills/ti-howtos/references/webpack-build-pipeline.md +78 -0
  106. package/skills/ti-ui/SKILL.md +179 -0
  107. package/skills/ti-ui/references/accessibility-deep-dive.md +242 -0
  108. package/skills/ti-ui/references/animation-and-matrices.md +599 -0
  109. package/skills/ti-ui/references/application-structures.md +655 -0
  110. package/skills/ti-ui/references/custom-fonts-styling.md +579 -0
  111. package/skills/ti-ui/references/event-handling.md +393 -0
  112. package/skills/ti-ui/references/gestures.md +473 -0
  113. package/skills/ti-ui/references/icons-and-splash-screens.md +409 -0
  114. package/skills/ti-ui/references/layouts-and-positioning.md +462 -0
  115. package/skills/ti-ui/references/listviews-and-performance.md +619 -0
  116. package/skills/ti-ui/references/orientation.md +362 -0
  117. package/skills/ti-ui/references/platform-ui-android.md +635 -0
  118. package/skills/ti-ui/references/platform-ui-ios.md +469 -0
  119. package/skills/ti-ui/references/scrolling-views.md +252 -0
  120. package/skills/ti-ui/references/tableviews.md +568 -0
@@ -0,0 +1,174 @@
1
+ ---
2
+ name: ti-howtos
3
+ description: "Titanium SDK native feature integration guide. Use when implementing, reviewing, analyzing, or examining Titanium location services, maps (Google Maps v2, Map Kit), push notifications (APNs, FCM), camera/gallery, media APIs, SQLite databases, HTTPClient networking, WKWebView, Android Intents, background services, iOS Keychain/iCloud, WatchKit/Siri integration, or CI/CD with Fastlane and Appium."
4
+ argument-hint: "[feature]"
5
+ allowed-tools: Read, Grep, Glob, Edit, Write, Bash, Bash(node *)
6
+ ---
7
+
8
+ # Titanium SDK How-tos Expert
9
+
10
+ Comprehensive expert covering all official Titanium SDK how-to guides. Provides step-by-step instructions for integrating native features, handling data, working with media, and implementing platform-specific APIs.
11
+
12
+ ## Project Detection
13
+
14
+ :::info AUTO-DETECTS TITANIUM PROJECTS
15
+ This skill automatically detects Titanium projects when invoked and provides native feature integration guides.
16
+
17
+ **Detection occurs automatically** - no manual command needed.
18
+
19
+ **Titanium project indicator:**
20
+ - `tiapp.xml` file (definitive indicator)
21
+
22
+ **Applicable to BOTH:**
23
+ - **Alloy projects** (app/ folder)
24
+ - **Classic projects** (Resources/ folder)
25
+
26
+ **Behavior based on detection:**
27
+ - **Titanium detected** → Provides native feature integration guides, platform-specific API usage, permissions/modules/CI/CD help
28
+ - **Not detected** → Indicates this is for Titanium projects only
29
+ :::
30
+
31
+ ## Table of Contents
32
+
33
+ - [Titanium SDK How-tos Expert](#titanium-sdk-how-tos-expert)
34
+ - [Project Detection](#project-detection)
35
+ - [Table of Contents](#table-of-contents)
36
+ - [Integration Workflow](#integration-workflow)
37
+ - [Native Integration Rules (Low Freedom)](#native-integration-rules-low-freedom)
38
+ - [iOS Permissions](#ios-permissions)
39
+ - [Android Resource Management](#android-resource-management)
40
+ - [Data \& Networking](#data--networking)
41
+ - [Media \& Memory](#media--memory)
42
+ - [Platform-Specific Properties](#platform-specific-properties)
43
+ - [Reference Guides (Progressive Disclosure)](#reference-guides-progressive-disclosure)
44
+ - [Core Features](#core-features)
45
+ - [Data Handling](#data-handling)
46
+ - [Media \& Content](#media--content)
47
+ - [Web Integration](#web-integration)
48
+ - [Platform-Specific (Android)](#platform-specific-android)
49
+ - [Platform-Specific (iOS)](#platform-specific-ios)
50
+ - [Advanced \& DevOps](#advanced--devops)
51
+ - [Related Skills](#related-skills)
52
+ - [Response Format](#response-format)
53
+
54
+ ---
55
+
56
+ ## Integration Workflow
57
+
58
+ 1. **Requirement Check**: Identify needed permissions, `tiapp.xml` configurations, and module dependencies.
59
+ 2. **Service Setup**: Register listeners or services (Location, Push, Core Motion, etc.).
60
+ 3. **Lifecycle Sync**: Coordinate service listeners with Android/iOS lifecycle events.
61
+ 4. **Error Handling**: Implement robust error callbacks for asynchronous native calls.
62
+ 5. **Platform Optimization**: Apply platform-specific deep-dive logic (e.g., Intent Filters, Spotlight, Core Motion).
63
+
64
+ ## Native Integration Rules (Low Freedom)
65
+
66
+ ### iOS Permissions
67
+ - **Location**: `NSLocationWhenInUseUsageDescription` or `NSLocationAlwaysAndWhenInUseUsageDescription` in `tiapp.xml`
68
+ - **Motion Activity**: Required for Core Motion Activity API
69
+ - **Camera/Photo**: `NSCameraUsageDescription` and `NSPhotoLibraryUsageDescription`
70
+ - **Background Modes**: Required for background audio, location, or VOIP
71
+ - **iOS 17+ Privacy**: Mandatory `PrivacyInfo.xcprivacy` manifest for UserDefaults and FileTimestamps.
72
+
73
+ ### Android Resource Management
74
+ - **Services**: Always stop background services when no longer needed
75
+ - **Location**: Use `distanceFilter` and FusedLocationProvider (requires `ti.playservices`)
76
+ - **Intents**: Specify proper action, data type, and category. Copy root activity to `tiapp.xml` for Intent Filters.
77
+
78
+ ### Data & Networking
79
+ - **HTTPClient**: Always handle both `onload` and `onerror` callbacks
80
+ - **SQLite**: Always `db.close()` and `resultSet.close()` to prevent locks
81
+ - **Filesystem**: Check `isExternalStoragePresent()` before accessing SD card
82
+ - **Binary Data**: Use `Ti.Buffer` and `Ti.Codec` for low-level byte manipulation
83
+ - **Streams**: Use `BufferStream`, `FileStream` or `BlobStream` for efficient chunk-based I/O.
84
+
85
+ ### Media & Memory
86
+ - **Camera/Gallery**: Use `imageAsResized` to avoid memory exhaustion
87
+ - **Audio**: Handle `pause`/`resume` events for streaming interruption
88
+ - **WebView**: Avoid embedding in TableViews; set `touchEnabled=false` if needed
89
+ - **Video**: Android requires fullscreen; iOS supports embedded players
90
+
91
+ ### Platform-Specific Properties
92
+
93
+ :::danger CRITICAL: Platform-Specific Properties Require Modifiers
94
+ Using `Ti.UI.iOS.*` or `Ti.UI.Android.*` properties WITHOUT platform modifiers causes cross-platform compilation failures.
95
+
96
+ **Example of the damage:**
97
+ ```javascript
98
+ // ❌ WRONG - Adds Ti.UI.iOS to Android project
99
+ const win = Ti.UI.createWindow({
100
+ statusBarStyle: Ti.UI.iOS.StatusBar.LIGHT_CONTENT // FAILS on Android!
101
+ })
102
+ ```
103
+
104
+ **CORRECT approaches:**
105
+
106
+ **Option 1 - TSS modifier (Alloy projects):**
107
+ ```tss
108
+ "#mainWindow[platform=ios]": {
109
+ statusBarStyle: Ti.UI.iOS.StatusBar.LIGHT_CONTENT
110
+ }
111
+ ```
112
+
113
+ **Option 2 - Conditional code:**
114
+ ```javascript
115
+ if (OS_IOS) {
116
+ $.mainWindow.statusBarStyle = Ti.UI.iOS.StatusBar.LIGHT_CONTENT
117
+ }
118
+ ```
119
+
120
+ **Properties that ALWAYS require platform modifiers:**
121
+ - iOS: `statusBarStyle`, `modalStyle`, `modalTransitionStyle`, any `Ti.UI.iOS.*`
122
+ - Android: `actionBar` config, any `Ti.UI.Android.*` constant
123
+
124
+ **For platform-specific modifier syntax, see** [Platform Modifiers (purgetss)](skills/purgetss/references/platform-modifiers.md) or [Platform UI guides](references/ios-platform-deep-dives.md).
125
+ :::
126
+
127
+ ## Reference Guides (Progressive Disclosure)
128
+
129
+ ### Core Features
130
+ - **[Location & Maps](references/location-and-maps.md)**: GPS tracking and battery-efficient location rules.
131
+ - **[Google Maps v2 (Android)](references/google-maps-v2.md)**: API Keys, Google Play Services, and v2 features.
132
+ - **[iOS Map Kit](references/ios-map-kit.md)**: 3D Camera, system buttons, and iOS-specific callouts.
133
+ - **[Notification Services](references/notification-services.md)**: Push notifications (APNs/FCM), local alerts, interactive notifications.
134
+
135
+ ### Data Handling
136
+ - **[Remote Data Sources](references/remote-data-sources.md)**: HTTPClient lifecycle, JSON/XML parsing, file uploads/downloads, sockets, SOAP, SSL security.
137
+ - **[Local Data Sources](references/local-data-sources.md)**: Filesystem operations, SQLite databases, Properties API, persistence strategies.
138
+ - **[Buffer, Codec, and Streams](references/buffer-codec-streams.md)**: Advanced binary data manipulation and serial data flows.
139
+
140
+ ### Media & Content
141
+ - **[Media APIs](references/media-apis.md)**: Audio playback/recording, Video streaming, Camera/Gallery, Images and ImageViews, density-specific assets.
142
+
143
+ ### Web Integration
144
+ - **[Web Content Integration](references/web-content-integration.md)**: WebView component (WKWebView), local/remote content, bidirectional communication.
145
+ - **[Webpack Build Pipeline](references/webpack-build-pipeline.md)**: Modern build pipeline (Ti 9.1.0+), NPM integration, and the `@` source alias.
146
+
147
+ ### Platform-Specific (Android)
148
+ - **[Android Platform Deep Dives](references/android-platform-deep-dives.md)**: Intents, advanced Intent Filters, Broadcast with permissions, Background Services.
149
+
150
+ ### Platform-Specific (iOS)
151
+ - **[iOS Platform Deep Dives](references/ios-platform-deep-dives.md)**: iOS 17 Privacy, Silent Push, Spotlight, Handoff, iCloud, Core Motion, WatchKit/Siri integration.
152
+
153
+ ### Advanced & DevOps
154
+ - **[Extending Titanium](references/extending-titanium.md)**: Hyperloop, native module architecture (Proxy/View), Xcode debugging, SDK 9.0 (AndroidX) migration.
155
+ - **[Debugging & Profiling](references/debugging-profiling.md)**: Memory management, leak detection, native tools.
156
+ - **[Automation (Fastlane & Appium)](references/automation-fastlane-appium.md)**: CI/CD pipelines, UI testing, and automated store deployment.
157
+
158
+ ## Related Skills
159
+
160
+ For tasks beyond native feature integration, use these complementary skills:
161
+
162
+ | Task | Use This Skill |
163
+ | ---------------------------------------------- | -------------- |
164
+ | Project architecture, services, memory cleanup | `alloy-expert` |
165
+ | UI layouts, ListViews, gestures, animations | `ti-ui` |
166
+ | Hyperloop, app distribution, tiapp.xml config | `ti-guides` |
167
+ | Alloy MVC, models, data binding | `alloy-guides` |
168
+
169
+ ## Response Format
170
+
171
+ 1. **Prerequisites**: List required permissions, `tiapp.xml` configurations, or module dependencies.
172
+ 2. **Step-by-Step Implementation**: Task-focused code guide with error handling.
173
+ 3. **Platform Caveats**: Mention specific behavior differences between iOS and Android.
174
+ 4. **Best Practices**: Include memory management, lifecycle considerations, and performance tips.