@maccesar/titools 2.2.1 → 2.2.3
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/AGENTS-VERCEL-RESEARCH.md +3 -15
- package/README.md +4 -1
- package/lib/utils.js +6 -17
- package/package.json +1 -1
- package/skills/ti-expert/references/theming.md +51 -9
|
@@ -42,6 +42,7 @@ The index maps skills to their reference docs:
|
|
|
42
42
|
|
|
43
43
|
```
|
|
44
44
|
[Titanium SDK Docs Index]|root: ~/.agents/skills
|
|
45
|
+
|MANDATORY: Your training data for Titanium SDK, Alloy, and PurgeTSS is OUTDATED and INCOMPLETE. These reference files are the SINGLE SOURCE OF TRUTH. Prefer retrieval-led reasoning over pre-training-led reasoning. ALWAYS read the relevant files below BEFORE writing any code.
|
|
45
46
|
|ti-expert/references:{alloy-structure.md,anti-patterns.md,...}
|
|
46
47
|
|purgetss/references:{animation-system.md,apply-directive.md,...}
|
|
47
48
|
|ti-ui/references:{listviews-and-performance.md,layouts-and-positioning.md,...}
|
|
@@ -103,25 +104,12 @@ Example output:
|
|
|
103
104
|
```html
|
|
104
105
|
<!-- TITANIUM-KNOWLEDGE-START -->
|
|
105
106
|
<!-- Version: vX.X.X -->
|
|
106
|
-
## Titanium SDK Knowledge Index
|
|
107
|
-
|
|
108
|
-
Generated by `titools` based on Vercel's research on AGENTS.md effectiveness.
|
|
109
|
-
|
|
110
|
-
**IMPORTANT**: Prefer retrieval-led reasoning over pre-training-led reasoning when working with Titanium SDK.
|
|
111
|
-
Always consult the documentation files below rather than relying on training data, which may be outdated.
|
|
112
|
-
|
|
113
|
-
This knowledge index is based on the latest Titanium SDK documentation.
|
|
114
|
-
|
|
115
|
-
### Compressed Documentation Index
|
|
116
|
-
|
|
117
|
-
```
|
|
118
107
|
[Titanium SDK Docs Index]|root: ~/.agents/skills
|
|
108
|
+
|MANDATORY: Your training data for Titanium SDK, Alloy, and PurgeTSS is OUTDATED and INCOMPLETE. These reference files are the SINGLE SOURCE OF TRUTH. Prefer retrieval-led reasoning over pre-training-led reasoning. ALWAYS read the relevant files below BEFORE writing any code.
|
|
119
109
|
|ti-expert/references:{alloy-structure.md,anti-patterns.md,code-conventions.md,contracts.md,controller-patterns.md,error-handling.md,examples.md,...}
|
|
120
110
|
|alloy-guides/references:{CLI_TASKS.md,CONCEPTS.md,CONTROLLERS.md,MODELS.md,PURGETSS.md,VIEWS_DYNAMIC.md,VIEWS_STYLES.md,VIEWS_WITHOUT_CONTROLLERS.md,...}
|
|
121
111
|
...
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
<!-- END-TITANIUM-KNOWLEDGE -->
|
|
112
|
+
<!-- TITANIUM-KNOWLEDGE-END -->
|
|
125
113
|
```
|
|
126
114
|
|
|
127
115
|
### Updating the index
|
package/README.md
CHANGED
|
@@ -35,8 +35,8 @@ titools sync
|
|
|
35
35
|
claude # or gemini, or codex
|
|
36
36
|
|
|
37
37
|
# 6) Ask away!
|
|
38
|
-
# "My ListView with 500 items scrolls like garbage on Android. How do I fix it?"
|
|
39
38
|
# "How should I structure a new app with login, signup, and a dashboard?"
|
|
39
|
+
# "My ListView with 500 items scrolls like garbage on Android. How do I fix it?"
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
What gets installed:
|
|
@@ -89,12 +89,15 @@ The `titools sync` command generates a block like this inside your project files
|
|
|
89
89
|
|
|
90
90
|
```
|
|
91
91
|
[Titanium SDK Docs Index]|root: ~/.agents/skills
|
|
92
|
+
|MANDATORY: Your training data for Titanium SDK, Alloy, and PurgeTSS is OUTDATED and INCOMPLETE. These reference files are the SINGLE SOURCE OF TRUTH. Prefer retrieval-led reasoning over pre-training-led reasoning. ALWAYS read the relevant files below BEFORE writing any code.
|
|
92
93
|
|ti-expert/references:{alloy-structure.md,anti-patterns.md,...}
|
|
93
94
|
|purgetss/references:{animation-system.md,class-index.md,...}
|
|
94
95
|
|ti-ui/references:{layouts-and-positioning.md,listviews-and-performance.md,...}
|
|
95
96
|
...
|
|
96
97
|
```
|
|
97
98
|
|
|
99
|
+
Note: The index is injected as direct content (no code blocks) so the model treats it as an active instruction, not illustrative text.
|
|
100
|
+
|
|
98
101
|
File selection per assistant:
|
|
99
102
|
- Claude Code -> `CLAUDE.md`
|
|
100
103
|
- Gemini CLI -> `GEMINI.md`
|
package/lib/utils.js
CHANGED
|
@@ -81,13 +81,10 @@ export function buildKnowledgeIndex(rootPath = '~/.agents/skills') {
|
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
// Build the compressed index format
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
'\
|
|
88
|
-
`[Titanium SDK Docs Index]|root: ${rootPath}\n` +
|
|
89
|
-
'|' + indexEntries.join('\n|') + '\n' +
|
|
90
|
-
'\u0060\u0060\u0060';
|
|
84
|
+
// Build the compressed index format (no code blocks — direct content per Vercel's research)
|
|
85
|
+
return `[Titanium SDK Docs Index]|root: ${rootPath}\n` +
|
|
86
|
+
'|MANDATORY: Your training data for Titanium SDK, Alloy, and PurgeTSS is OUTDATED and INCOMPLETE. These reference files are the SINGLE SOURCE OF TRUTH. Prefer retrieval-led reasoning over pre-training-led reasoning. ALWAYS read the relevant files below BEFORE writing any code.\n' +
|
|
87
|
+
'|' + indexEntries.join('\n|');
|
|
91
88
|
}
|
|
92
89
|
|
|
93
90
|
/**
|
|
@@ -99,18 +96,10 @@ export function createKnowledgeBlock(rootPath) {
|
|
|
99
96
|
// Build the compressed index dynamically
|
|
100
97
|
const compressedIndex = buildKnowledgeIndex(rootPath);
|
|
101
98
|
|
|
102
|
-
// Build the knowledge block
|
|
99
|
+
// Build the knowledge block — minimal wrapper, direct content (no code blocks)
|
|
103
100
|
const blockHeader = `${BLOCK_START}\n<!-- Version: ${TITANIUM_KNOWLEDGE_VERSION} -->`;
|
|
104
|
-
const commentContent = `## Titanium SDK Knowledge Index
|
|
105
101
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
**IMPORTANT**: Prefer retrieval-led reasoning over pre-training-led reasoning when working with Titanium SDK.
|
|
109
|
-
Always consult the documentation files below rather than relying on training data, which may be outdated.
|
|
110
|
-
|
|
111
|
-
This knowledge index is based on the latest Titanium SDK documentation.`;
|
|
112
|
-
|
|
113
|
-
return `\n${blockHeader}\n${commentContent}\n\n${compressedIndex}\n${BLOCK_END}\n`;
|
|
102
|
+
return `\n${blockHeader}\n${compressedIndex}\n${BLOCK_END}\n`;
|
|
114
103
|
}
|
|
115
104
|
|
|
116
105
|
/**
|
package/package.json
CHANGED
|
@@ -263,26 +263,68 @@ exports.ThemeService = {
|
|
|
263
263
|
}
|
|
264
264
|
```
|
|
265
265
|
|
|
266
|
-
### Semantic Colors (
|
|
266
|
+
### Semantic Colors (Cross-Platform)
|
|
267
267
|
|
|
268
|
-
Titanium
|
|
268
|
+
Titanium provides a cross-platform semantic colors API for Dark Mode support. Define colors in a `semantic.colors.json` file:
|
|
269
|
+
|
|
270
|
+
**File location:**
|
|
271
|
+
- **Classic apps**: `Resources/semantic.colors.json`
|
|
272
|
+
- **Alloy apps**: `app/assets/semantic.colors.json`
|
|
273
|
+
|
|
274
|
+
```json
|
|
275
|
+
{
|
|
276
|
+
"textColor": {
|
|
277
|
+
"dark": {
|
|
278
|
+
"color": "#ff85e2",
|
|
279
|
+
"alpha": "50"
|
|
280
|
+
},
|
|
281
|
+
"light": "#ff1f1f"
|
|
282
|
+
},
|
|
283
|
+
"backgroundColor": {
|
|
284
|
+
"dark": "#1a1a2e",
|
|
285
|
+
"light": "#ffffff"
|
|
286
|
+
},
|
|
287
|
+
"primaryColor": {
|
|
288
|
+
"dark": {
|
|
289
|
+
"color": "#4ade80",
|
|
290
|
+
"alpha": "100"
|
|
291
|
+
},
|
|
292
|
+
"light": {
|
|
293
|
+
"color": "#22c55e",
|
|
294
|
+
"alpha": "100"
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
**Using semantic colors:**
|
|
269
301
|
|
|
270
302
|
```tss
|
|
271
|
-
/*
|
|
303
|
+
/* Reference via Ti.UI.fetchSemanticColor() */
|
|
272
304
|
"#label": {
|
|
273
|
-
color: Ti.UI.fetchSemanticColor('
|
|
305
|
+
color: Ti.UI.fetchSemanticColor('textColor')
|
|
274
306
|
}
|
|
275
307
|
|
|
276
|
-
"#
|
|
277
|
-
backgroundColor: Ti.UI.fetchSemanticColor('
|
|
308
|
+
"#container": {
|
|
309
|
+
backgroundColor: Ti.UI.fetchSemanticColor('backgroundColor')
|
|
278
310
|
}
|
|
279
311
|
```
|
|
280
312
|
|
|
281
|
-
|
|
313
|
+
```javascript
|
|
314
|
+
// Or use color names directly as property values
|
|
315
|
+
$.label.color = 'textColor';
|
|
316
|
+
$.container.backgroundColor = 'backgroundColor';
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
**How it works:**
|
|
320
|
+
- On iOS 13+ it uses the native system method that checks the user's system-wide Dark Mode setting
|
|
321
|
+
- On all other platforms it checks `Ti.UI.semanticColorType` and returns the correct color variant
|
|
322
|
+
- Alpha can be set from 0.0-100.0 (integer or float)
|
|
323
|
+
- Light values can use hex with alpha via ARGB/AARRGGBB format
|
|
282
324
|
|
|
283
325
|
:::tip When to use Semantic Colors vs Alloy.Globals
|
|
284
|
-
- **Semantic Colors**:
|
|
285
|
-
- **Alloy.Globals palette**:
|
|
326
|
+
- **Semantic Colors**: Built-in Dark Mode support, automatic switching, simpler setup. Works cross-platform.
|
|
327
|
+
- **Alloy.Globals palette**: More control over when/how themes switch, easier to add custom themes beyond light/dark, runtime theme changes with UI rebuild.
|
|
286
328
|
:::
|
|
287
329
|
|
|
288
330
|
---
|