@onetype/framework 2.0.41 → 2.0.42
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/addons/ai/agents/addon.js +23 -0
- package/addons/ai/agents/functions/parse.js +129 -0
- package/addons/ai/agents/item/functions/run.js +218 -0
- package/addons/ai/agents/load.js +8 -0
- package/addons/ai/orchestrator/addon.js +25 -0
- package/addons/ai/orchestrator/item/functions/run.js +277 -0
- package/addons/ai/orchestrator/item/functions/state/agent.js +41 -0
- package/addons/ai/orchestrator/item/functions/state/conclusion.js +27 -0
- package/addons/ai/orchestrator/item/functions/state/done.js +40 -0
- package/addons/ai/orchestrator/item/functions/state/execute.js +16 -0
- package/addons/ai/orchestrator/item/functions/state/goal.js +34 -0
- package/addons/ai/orchestrator/item/functions/state/input.js +55 -0
- package/addons/ai/orchestrator/item/functions/state/summary.js +26 -0
- package/addons/ai/orchestrator/items/agents/achievable.js +37 -0
- package/addons/ai/orchestrator/items/agents/agent.js +46 -0
- package/addons/ai/orchestrator/items/agents/conclusion.js +41 -0
- package/addons/ai/orchestrator/items/agents/done.js +40 -0
- package/addons/ai/orchestrator/items/agents/goal.js +58 -0
- package/addons/ai/orchestrator/items/agents/input.js +34 -0
- package/addons/ai/orchestrator/items/agents/planner.js +30 -0
- package/addons/ai/orchestrator/items/agents/summary.js +29 -0
- package/addons/ai/orchestrator/items/chat.js +10 -0
- package/addons/ai/orchestrator/load.js +25 -0
- package/addons/ai/providers/addon.js +16 -0
- package/addons/ai/providers/functions/default.js +14 -0
- package/addons/ai/providers/item/functions/request.js +62 -0
- package/addons/ai/providers/items/nue.js +98 -0
- package/addons/ai/providers/load.js +10 -0
- package/addons/render/elements/front/functions/runtime.js +25 -0
- package/lib/browser.js +1 -24
- package/lib/items/directives/160-slot.js +1 -1
- package/lib/items/directives/500-click-outside.js +43 -43
- package/lib/items/elements/ai/chat/chat.css +710 -0
- package/lib/items/elements/ai/chat/chat.js +429 -0
- package/lib/items/elements/cards/pricing/pricing.css +174 -0
- package/lib/items/elements/{sections → cards}/pricing/pricing.js +30 -11
- package/lib/items/elements/form/button/button.css +250 -0
- package/lib/items/elements/form/button/button.js +15 -20
- package/lib/items/elements/form/checkbox/checkbox.css +109 -0
- package/lib/items/elements/form/checkbox/checkbox.js +58 -54
- package/lib/items/elements/form/color/color.css +128 -0
- package/lib/items/elements/form/color/color.js +100 -0
- package/lib/items/elements/form/date/date.css +84 -0
- package/lib/items/elements/form/date/date.js +69 -0
- package/lib/items/elements/form/field/field.css +33 -57
- package/lib/items/elements/form/field/field.js +4 -4
- package/lib/items/elements/form/input/input.css +59 -84
- package/lib/items/elements/form/input/input.js +84 -75
- package/lib/items/elements/form/radio/radio.css +118 -0
- package/lib/items/elements/form/radio/radio.js +58 -54
- package/lib/items/elements/form/rating/rating.css +28 -66
- package/lib/items/elements/form/rating/rating.js +17 -21
- package/lib/items/elements/form/section/section.css +30 -73
- package/lib/items/elements/form/section/section.js +5 -5
- package/lib/items/elements/form/select/select.css +186 -0
- package/lib/items/elements/form/select/select.js +165 -0
- package/lib/items/elements/form/slider/slider.css +55 -176
- package/lib/items/elements/form/slider/slider.js +14 -10
- package/lib/items/elements/form/tags/tags.css +152 -0
- package/lib/items/elements/form/tags/tags.js +166 -0
- package/lib/items/elements/form/textarea/textarea.css +55 -92
- package/lib/items/elements/form/textarea/textarea.js +74 -66
- package/lib/items/elements/form/toggle/toggle.css +101 -0
- package/lib/items/elements/form/toggle/toggle.js +67 -0
- package/lib/items/elements/global/code/code.css +39 -8
- package/lib/items/elements/global/code/code.js +7 -2
- package/lib/items/elements/global/faq/faq.css +38 -16
- package/lib/items/elements/global/faq/faq.js +14 -2
- package/lib/items/elements/global/heading/heading.css +37 -14
- package/lib/items/elements/global/heading/heading.js +9 -4
- package/lib/items/elements/global/markdown/markdown.css +22 -15
- package/lib/items/elements/global/markdown/markdown.js +4 -4
- package/lib/items/elements/global/menu/menu.css +173 -0
- package/lib/items/elements/global/menu/menu.js +103 -0
- package/lib/items/elements/global/notice/notice.css +27 -61
- package/lib/items/elements/global/notice/notice.js +4 -4
- package/lib/items/elements/global/parameters/parameters.css +33 -14
- package/lib/items/elements/global/parameters/parameters.js +15 -6
- package/lib/items/elements/global/tags/tags.css +18 -5
- package/lib/items/elements/global/tags/tags.js +10 -2
- package/lib/items/elements/navigation/navbar/navbar.css +39 -17
- package/lib/items/elements/navigation/navbar/navbar.js +19 -9
- package/lib/items/elements/navigation/sidebar/sidebar.css +25 -39
- package/lib/items/elements/navigation/sidebar/sidebar.js +28 -6
- package/lib/items/elements/navigation/tabs/tabs.css +35 -16
- package/lib/items/elements/navigation/tabs/tabs.js +16 -2
- package/lib/items/elements/status/code/code.css +21 -12
- package/lib/items/elements/status/empty/empty.css +22 -17
- package/lib/items/elements/status/empty/empty.js +1 -1
- package/lib/items/elements/status/error/error.css +22 -12
- package/lib/items/elements/status/error/error.js +1 -1
- package/lib/items/elements/status/loading/loading.css +24 -14
- package/lib/items/elements/status/loading/loading.js +4 -4
- package/lib/load.js +14 -6
- package/lib/styles/reset.css +1 -1
- package/lists.md +586 -0
- package/orchestrator.md +288 -0
- package/package.json +9 -3
- package/lib/items/elements/form/button/styles/base.css +0 -176
- package/lib/items/elements/form/button/styles/sizes.css +0 -78
- package/lib/items/elements/form/button/styles/variants.css +0 -421
- package/lib/items/elements/form/checkbox/styles/base.css +0 -52
- package/lib/items/elements/form/checkbox/styles/sizes.css +0 -39
- package/lib/items/elements/form/checkbox/styles/variants.css +0 -121
- package/lib/items/elements/form/input/styles/base.css +0 -26
- package/lib/items/elements/form/input/styles/sizes.css +0 -15
- package/lib/items/elements/form/input/styles/variants.css +0 -98
- package/lib/items/elements/form/radio/styles/base.css +0 -48
- package/lib/items/elements/form/radio/styles/sizes.css +0 -36
- package/lib/items/elements/form/radio/styles/variants.css +0 -121
- package/lib/items/elements/global/card/card.css +0 -57
- package/lib/items/elements/global/card/card.js +0 -48
- package/lib/items/elements/sections/footer/footer.css +0 -205
- package/lib/items/elements/sections/footer/footer.js +0 -109
- package/lib/items/elements/sections/hero/hero.css +0 -100
- package/lib/items/elements/sections/hero/hero.js +0 -54
- package/lib/items/elements/sections/pricing/pricing.css +0 -148
- package/lib/items/elements/sections/stats/stats.css +0 -34
- package/lib/items/elements/sections/stats/stats.js +0 -74
package/orchestrator.md
ADDED
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
# Orchestrator Research & Analysis
|
|
2
|
+
|
|
3
|
+
Research and implementation notes. Updated March 5, 2026.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Architecture
|
|
8
|
+
|
|
9
|
+
### Pre-Execution Pipeline (NEW — March 5, 2026)
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
1. planner → splits user prompt into logical steps with ordering
|
|
13
|
+
2. achievable → checks if available agents can handle all planned tasks
|
|
14
|
+
→ if not achievable: log rejected tasks, stop
|
|
15
|
+
→ if achievable: proceed to execution loop
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
**Planner** (`orchestrator-planner`) — takes user prompt, outputs `[{task, order}]`. Logical steps, no duplication for unknown quantities. Same order = parallel batch, higher order = depends on earlier results.
|
|
19
|
+
|
|
20
|
+
**Achievable** (`orchestrator-achievable`) — takes planned tasks + available agents, outputs `{achievable, rejected[{task, reason}]}`. Understands agent chaining — only rejects when the action type itself has no matching agent. Orchestrator handles filtering, looping, conditionals.
|
|
21
|
+
|
|
22
|
+
### Execution Loop
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
while steps < max:
|
|
26
|
+
1. done → skip on empty history, checks if task is complete
|
|
27
|
+
2. agent+goal → merged: selects next agent + writes goal (1 LLM call)
|
|
28
|
+
3. input → extracts literal values from goal
|
|
29
|
+
4. execute → runs the actual agent
|
|
30
|
+
5. conclusion → summarizes what happened
|
|
31
|
+
→ push to history, loop
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Each step = 4 LLM calls (was 6). First iteration = 3 calls (done skipped).
|
|
35
|
+
|
|
36
|
+
### Files
|
|
37
|
+
|
|
38
|
+
| File | Purpose |
|
|
39
|
+
|------|---------|
|
|
40
|
+
| `orchestrator/addon.js` | Addon: id, data, task, steps, agents, status, state, hooks |
|
|
41
|
+
| `orchestrator/item/functions/run.js` | Main loop with always-on colored logging, per-call token tracking, elapsed time |
|
|
42
|
+
| `orchestrator/item/functions/state/done.js` | Calls orchestrator-done, derives total/confirmed from actions array |
|
|
43
|
+
| `orchestrator/item/functions/state/agent.js` | Calls orchestrator-agent, sets state.agent + state.goal + agent ID validation |
|
|
44
|
+
| `orchestrator/item/functions/state/goal.js` | UNUSED — merged into agent.js |
|
|
45
|
+
| `orchestrator/item/functions/state/input.js` | Calls orchestrator-input, extracts values, DataDefine |
|
|
46
|
+
| `orchestrator/item/functions/state/execute.js` | Runs agent via agents.ItemGet(state.agent).Fn('run') |
|
|
47
|
+
| `orchestrator/item/functions/state/conclusion.js` | Calls orchestrator-conclusion, reads result.conclusion |
|
|
48
|
+
| `orchestrator/item/functions/state/summary.js` | Calls orchestrator-summary after task complete |
|
|
49
|
+
| `orchestrator/items/agents/done.js` | Agent: actions array [{action, confirmed}], done boolean |
|
|
50
|
+
| `orchestrator/items/agents/agent.js` | Agent: selects next agent + writes goal + reason field |
|
|
51
|
+
| `orchestrator/items/agents/goal.js` | UNUSED — merged into agent.js |
|
|
52
|
+
| `orchestrator/items/agents/input.js` | Agent: extracts literal values from goal text |
|
|
53
|
+
| `orchestrator/items/agents/conclusion.js` | Agent: dense paragraph, all fields/values from output, task-aware |
|
|
54
|
+
| `orchestrator/items/agents/summary.js` | Agent: final user-facing summary, max 40 words |
|
|
55
|
+
| `orchestrator/items/agents/planner.js` | Agent: splits prompt into logical steps [{task, order}] |
|
|
56
|
+
| `orchestrator/items/agents/achievable.js` | Agent: checks if tasks are achievable by available agents |
|
|
57
|
+
|
|
58
|
+
### Agents & Providers
|
|
59
|
+
|
|
60
|
+
| File | Purpose |
|
|
61
|
+
|------|---------|
|
|
62
|
+
| `agents/addon.js` | Agent addon: id, name, description, instructions, tokens, provider, model, input, output, callback, hooks |
|
|
63
|
+
| `agents/item/functions/run.js` | Build payload, call provider, parse JSON, validate, return |
|
|
64
|
+
| `agents/functions/parse.js` | Balanced-brace JSON extraction, smart quote cleaning |
|
|
65
|
+
| `providers/addon.js` | Provider: id, endpoint, key, model, models, hooks |
|
|
66
|
+
| `providers/item/functions/request.js` | HTTP fetch with retry, timeout, think tag handling |
|
|
67
|
+
| `providers/items/nue.js` | Provider definitions |
|
|
68
|
+
| `providers/functions/default.js` | Default provider selection |
|
|
69
|
+
|
|
70
|
+
### Current Provider
|
|
71
|
+
|
|
72
|
+
**llama-server** serving Qwen3.5-27B Q4_K_M (bartowski GGUF) on RTX 3090.
|
|
73
|
+
- Endpoint: `http://localhost:8000/v1/chat/completions`
|
|
74
|
+
- Model: `Qwen_Qwen3.5-27B-Q4_K_M`
|
|
75
|
+
- Thinking: disabled (`--chat-template-kwargs '{"enable_thinking": false}'`)
|
|
76
|
+
- Config: `-ngl 99 -c 65536 -np 4 -fa on`
|
|
77
|
+
- Speed: ~35 t/s single request, ~15 t/s per slot with 4 parallel
|
|
78
|
+
- `response_format: { type: 'json_object' }`, `presence_penalty: 1.5`
|
|
79
|
+
|
|
80
|
+
### How Agent Execution Works
|
|
81
|
+
|
|
82
|
+
1. Input validated via `onetype.DataDefine`
|
|
83
|
+
2. Payload: system prompt + synthetic conversation + output schema
|
|
84
|
+
3. `response_format: { type: 'json_object' }` — NOT tool calling
|
|
85
|
+
4. Provider HTTP call with single retry
|
|
86
|
+
5. JSON extracted via balanced-brace parser
|
|
87
|
+
6. Callback mutates output if defined, then validate
|
|
88
|
+
7. `_meta` attached with tokens/time/tps
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Implemented Fixes (March 3, 2026)
|
|
93
|
+
|
|
94
|
+
### Round 1 — Core Optimizations
|
|
95
|
+
|
|
96
|
+
| Fix | File | Impact |
|
|
97
|
+
|-----|------|--------|
|
|
98
|
+
| Skip done on empty history | run.js | 1 LLM call saved per run |
|
|
99
|
+
| Merge agent+goal into one call | agent.js (state + prompt) | 1 LLM call saved per step (~25%) |
|
|
100
|
+
| Agent ID validation | agent.js (state) | Prevents crash on hallucinated IDs |
|
|
101
|
+
| Added `reason` field | agent.js (prompt) | Forces justification, reduces mistakes |
|
|
102
|
+
| Explicit remaining counts in conclusion | conclusion.js (prompt) | Prevents unnecessary recheck steps |
|
|
103
|
+
| Compact instructions (~50% shorter) | All orchestrator agent prompts | Less instruction tokens, faster prefill |
|
|
104
|
+
| Fixed debug log | run.js | Was logging same object twice |
|
|
105
|
+
|
|
106
|
+
### Round 2 — Logging, Instructions, Done Stability
|
|
107
|
+
|
|
108
|
+
| Fix | File | Impact |
|
|
109
|
+
|-----|------|--------|
|
|
110
|
+
| Always-on colored logging | run.js | Replaced _debug flag with always-on per-step logging (agent/input/exec/concl/done) with ANSI colors, per-call token tracking, elapsed time |
|
|
111
|
+
| Conclusion output field renamed | conclusion.js (prompt + state) | `summary` → `conclusion` — fixes naming mismatch (bug #8) |
|
|
112
|
+
| Conclusion instructions genericized | conclusion.js (prompt) | No examples, no specific field names. Dense paragraph, all fields/values, task-aware. Max 60 words |
|
|
113
|
+
| Done agent: actions array | done.js (prompt + state) | Output changed from `total/confirmed/done` to `actions[{action,confirmed}]/done`. Stable counting — total no longer fluctuates |
|
|
114
|
+
| Done agent: listings excluded | done.js (prompt) | Only mutating actions counted (create/update/delete/add/remove). Listings are not actions |
|
|
115
|
+
| Done logging: pending actions | run.js | Shows `3/6 pending: add font, create site` instead of raw total/confirmed |
|
|
116
|
+
| All instructions genericized | All orchestrator agents | No examples, no numbered lists, no specific field names. Pure generic rules |
|
|
117
|
+
| Agent reason description tightened | agent.js (prompt) | "One sentence: why this agent now" |
|
|
118
|
+
| Summary compacted | summary.js (prompt) | Max 40 words, 200 tokens |
|
|
119
|
+
| Input instructions compacted | input.js (prompt) | Removed examples, 300 tokens |
|
|
120
|
+
|
|
121
|
+
**Results:**
|
|
122
|
+
- 6-step test: 66s → 54s (18% faster), 24.5K → 22K input tokens (10% less)
|
|
123
|
+
- 11-step test: 11 steps correct, 42K input / 2.7K output, 137s
|
|
124
|
+
- Done agent total stable at 6/6 throughout entire 11-step run (was fluctuating 6→12→7)
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## Bugs — Remaining
|
|
129
|
+
|
|
130
|
+
| # | Bug | Severity | Status |
|
|
131
|
+
|---|-----|----------|--------|
|
|
132
|
+
| 1 | No per-step error recovery | High | TODO |
|
|
133
|
+
| 2 | `request.js` — onBefore/onAfter no null check | Low | Dormant |
|
|
134
|
+
| 3 | `request.js` — timeout field not in schema | Low | Dormant |
|
|
135
|
+
| 4 | `default.js` — random provider selection | Low | Dormant |
|
|
136
|
+
| 5 | `test.js` — font ID uses length+1 | Low | Test only |
|
|
137
|
+
| 6 | No agent oscillation prevention | Medium | TODO |
|
|
138
|
+
| 7 | No `onSummary` hook | Low | TODO |
|
|
139
|
+
| 8 | ~~Conclusion output `summary` stored as `state.conclusion`~~ | ~~Low~~ | ✅ FIXED |
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## Prompt Design Principles
|
|
144
|
+
|
|
145
|
+
- **All instructions must be generic** — no examples, no specific field names, no numbered lists
|
|
146
|
+
- **Description = contract** — output field descriptions guide the LLM more than instructions
|
|
147
|
+
- **Conclusion is memory** — must preserve every field/value from output, task-aware for relevance
|
|
148
|
+
- **Done counts only mutations** — listings/reads are not actions, prevents inflated totals
|
|
149
|
+
- **Actions array > total/confirmed** — forces LLM to enumerate before deciding, stabilizes counting
|
|
150
|
+
- **Agent description = API docs for LLM** — invest in precise descriptions
|
|
151
|
+
- **`reason` field** forces justification, reduces hallucinations
|
|
152
|
+
- **ONE ACTION, ONE TARGET** per goal
|
|
153
|
+
- **json_object > tool calling** for deterministic orchestrator
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## Model Research
|
|
158
|
+
|
|
159
|
+
### Engine Support for Qwen3.5-27B (March 3, 2026)
|
|
160
|
+
|
|
161
|
+
| Engine | Status | Verdict |
|
|
162
|
+
|--------|--------|---------|
|
|
163
|
+
| **llama.cpp** | Stable (b8192+), ~35 t/s, OpenAI API, GBNF grammar | ✅ IN USE |
|
|
164
|
+
| **Ollama** | Works, Q4_K_M default, ~15-25 t/s, no parallel requests | Backup |
|
|
165
|
+
| **SGLang** | AWQ broken (#19406 Marlin bug), GGUF broken | Wait 2-4 weeks |
|
|
166
|
+
| **vLLM** | v0.17 not released, nightly hangs | Wait |
|
|
167
|
+
|
|
168
|
+
### Quantization
|
|
169
|
+
|
|
170
|
+
| Format | VRAM (27B) | Quality | Speed |
|
|
171
|
+
|--------|-----------|---------|-------|
|
|
172
|
+
| Q4_K_M | 17GB | ~92-95% | ~35 t/s |
|
|
173
|
+
| Q5_K_M | 19.6GB | ~95-99% | ~33 t/s |
|
|
174
|
+
| AWQ 4-bit | 14GB | ~92-95% (worse on Qwen3) | Needs vLLM/SGLang |
|
|
175
|
+
|
|
176
|
+
Hybrid architecture (Gated DeltaNet) is more quantization-friendly — no attention sinks in 75% of layers.
|
|
177
|
+
|
|
178
|
+
### VRAM Budget (24GB, Q4_K_M)
|
|
179
|
+
|
|
180
|
+
| Context | VRAM | Free |
|
|
181
|
+
|---------|------|------|
|
|
182
|
+
| 8K | ~17GB | ~7GB |
|
|
183
|
+
| 32K | ~18GB | ~6GB |
|
|
184
|
+
| 65K | ~20GB | ~4GB |
|
|
185
|
+
| 131K | ~24GB | 0 (limit) |
|
|
186
|
+
|
|
187
|
+
### Key Model Settings
|
|
188
|
+
|
|
189
|
+
- `presence_penalty: 1.5` — prevents repetition loops
|
|
190
|
+
- `enable_thinking: false` — disabled on server, saves ~6.5x tokens
|
|
191
|
+
- `temperature: 0.15` — low for deterministic agent selection
|
|
192
|
+
|
|
193
|
+
### Thinking Mode
|
|
194
|
+
|
|
195
|
+
ON by default. Generates `<think>` tags. Disabled via `--chat-template-kwargs '{"enable_thinking": false}'` on llama-server. Thinking + json_object are mutually exclusive on some APIs. For orchestrator sub-agents: always disable.
|
|
196
|
+
|
|
197
|
+
### Future: SGLang Migration
|
|
198
|
+
|
|
199
|
+
When SGLang fixes AWQ (#19406), switch for:
|
|
200
|
+
- **RadixAttention** — 2-5x prefill speedup for shared prompt prefixes (75-90% cache hit)
|
|
201
|
+
- **XGrammar** — constrained JSON decoding, 10x faster than alternatives
|
|
202
|
+
- Migration = change endpoint URL only (both are OpenAI-compatible)
|
|
203
|
+
|
|
204
|
+
### Future: 2x RTX 3090
|
|
205
|
+
|
|
206
|
+
Q5_K_M (19.6GB) + 48GB total = 64K+ context with headroom. Tensor split automatic in llama.cpp.
|
|
207
|
+
Estimated 11-step performance: ~65s (vs 137s on 1x 3090). With SGLang prefix caching: ~40s.
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
## Test Results
|
|
212
|
+
|
|
213
|
+
### Qwen3.5-27B Q4_K_M on llama-server (March 3, 2026)
|
|
214
|
+
|
|
215
|
+
**Curl tests — 9/9 correct:**
|
|
216
|
+
|
|
217
|
+
| Test | Tokens | Time | Result |
|
|
218
|
+
|------|--------|------|--------|
|
|
219
|
+
| Agent selection (simple) | 45 | 1.3s | ✅ |
|
|
220
|
+
| Agent selection (history) | 33 | 0.9s | ✅ |
|
|
221
|
+
| Done check | 18 | 0.5s | ✅ |
|
|
222
|
+
| Input extraction | 15 | 0.4s | ✅ |
|
|
223
|
+
| Conclusion (ID preservation) | 125 | 3.6s | ✅ All IDs preserved |
|
|
224
|
+
| Agent selection (step 10, 3 Roboto) | 39 | 1.1s | ✅ |
|
|
225
|
+
| Sub-task prioritization | 67 | 1.9s | ✅ |
|
|
226
|
+
| Done check (complete) | 33 | 0.9s | ✅ done:true |
|
|
227
|
+
| Hallucination (impossible task) | 15 | 0.4s | ✅ null, no hallucination |
|
|
228
|
+
|
|
229
|
+
**Mega test (30-step history, 1400 token prompt):** Correctly identified missing service cards in 3-col grid layout.
|
|
230
|
+
|
|
231
|
+
### 6-step chat test (post-optimization)
|
|
232
|
+
|
|
233
|
+
Task: Publish Portfolio, rename to Creative Portfolio, add Inter 300, delete Archive page from Blog.
|
|
234
|
+
|
|
235
|
+
| Run | Steps | Time | Input | Output | Result |
|
|
236
|
+
|-----|-------|------|-------|--------|--------|
|
|
237
|
+
| 1 (pre-compact) | 6 | 66.0s | 24,615 | 1,112 | ✅ |
|
|
238
|
+
| 2 (pre-compact) | 6 | 64.7s | 24,495 | 1,095 | ✅ |
|
|
239
|
+
| 3 (post-compact) | 6 | 53.9s | 22,054 | 797 | ✅ |
|
|
240
|
+
|
|
241
|
+
### 11-step chat test (post-optimization)
|
|
242
|
+
|
|
243
|
+
Task: Rename Blog to Tech Blog, remove Merriweather, delete Shop drafts, remove Roboto fonts, add Open Sans 400, create Docs site.
|
|
244
|
+
|
|
245
|
+
| Version | Steps | Time | Input | Output | Done stability | Result |
|
|
246
|
+
|---------|-------|------|-------|--------|----------------|--------|
|
|
247
|
+
| Pre-optimization (5 runs) | 11 | ~90s | ~45K | ~1.2K | Fluctuating (6→12→7) | 2/5 strict, 5/5 correct |
|
|
248
|
+
| Post-compact (no actions) | 11 | 94s | 41K | 1.2K | Fluctuating | ✅ correct |
|
|
249
|
+
| Post-actions array | 11 | 137s | 42K | 2.7K | Stable 6/6 | ✅ correct |
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
253
|
+
## Deferred Ideas
|
|
254
|
+
|
|
255
|
+
- ~~**Task Splitting** — top-level LLM splits into independent sub-tasks, each gets own run~~ ✅ IMPLEMENTED as planner
|
|
256
|
+
- **Refs System** — conclusion tags data with `@key`, input resolves `@`-prefixed values
|
|
257
|
+
- **Agent Type Field** — `list`, `get`, `create`, `update`, `remove` types for ordering hints
|
|
258
|
+
- **History Pruning** — summarize old entries at 20+ steps, keep last 5 in full
|
|
259
|
+
|
|
260
|
+
---
|
|
261
|
+
|
|
262
|
+
## Implemented — March 5, 2026
|
|
263
|
+
|
|
264
|
+
### Planner + Achievable Pipeline
|
|
265
|
+
|
|
266
|
+
Added pre-execution pipeline: planner splits prompt into ordered tasks, achievable validates against available agents before execution starts.
|
|
267
|
+
|
|
268
|
+
**Key design decisions:**
|
|
269
|
+
- Planner outputs logical steps, not duplicated atomic tasks — orchestrator handles iteration
|
|
270
|
+
- Order number implies parallelism: same order = parallel batch
|
|
271
|
+
- Achievable understands agent chaining — filtering/looping/conditionals handled by orchestrator
|
|
272
|
+
- Achievable only rejects when action type has no matching agent
|
|
273
|
+
- Instructions kept minimal — shorter prompts = better model compliance (especially on smaller models)
|
|
274
|
+
|
|
275
|
+
**Test results (Qwen3 via Nue Tools):**
|
|
276
|
+
- Simple: "create site + 6 pages" → 7 tasks, correct ordering ✅
|
|
277
|
+
- Medium: "duplicate site, rename, add pages" → 5 tasks ✅
|
|
278
|
+
- Hard: "list sites, delete test pages, add 404, add fonts, conditional publish, open editor" → 6 tasks, achievable ✅
|
|
279
|
+
- Not achievable: "delete pages" without site context → correctly rejected ✅
|
|
280
|
+
|
|
281
|
+
## Next Steps
|
|
282
|
+
|
|
283
|
+
1. **Wire planner into execution loop** — remove early return, execute tasks by order batch
|
|
284
|
+
2. **Parallel execution** — Promise.all for tasks in same order group
|
|
285
|
+
3. **Per-step retry** — try/catch around execute, 1 retry on parse failure
|
|
286
|
+
4. **Stuck detection** — same actions 3x = force escalation
|
|
287
|
+
5. **Monitor SGLang** — #19406 fix for AWQ migration
|
|
288
|
+
6. **2x RTX 3090** — Q5_K_M for quality + speed boost
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onetype/framework",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.42",
|
|
4
4
|
"description": "OneType Framework — Full-stack isomorphic JavaScript framework built from scratch. One addon abstraction powers databases, servers, commands, pages, directives, queues, and more.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/load.js",
|
|
@@ -20,7 +20,10 @@
|
|
|
20
20
|
"./html": "./addons/render/html/load.js",
|
|
21
21
|
"./tags": "./addons/render/tags/load.js",
|
|
22
22
|
"./sources": "./addons/modules/sources/back/load.js",
|
|
23
|
-
"./variables": "./addons/modules/variables/core/load.js"
|
|
23
|
+
"./variables": "./addons/modules/variables/core/load.js",
|
|
24
|
+
"./agents": "./addons/ai/agents/load.js",
|
|
25
|
+
"./orchestrator": "./addons/ai/orchestrator/load.js",
|
|
26
|
+
"./providers": "./addons/ai/providers/load.js"
|
|
24
27
|
},
|
|
25
28
|
"imports": {
|
|
26
29
|
"#framework/*": "./lib/*",
|
|
@@ -36,7 +39,10 @@
|
|
|
36
39
|
"#elements/*": "./addons/render/elements/*",
|
|
37
40
|
"#tags/*": "./addons/render/tags/*",
|
|
38
41
|
"#sources/*": "./addons/modules/sources/*",
|
|
39
|
-
"#variables/*": "./addons/modules/variables/*"
|
|
42
|
+
"#variables/*": "./addons/modules/variables/*",
|
|
43
|
+
"#agents/*": "./addons/ai/agents/*",
|
|
44
|
+
"#orchestrator/*": "./addons/ai/orchestrator/*",
|
|
45
|
+
"#providers/*": "./addons/ai/providers/*"
|
|
40
46
|
},
|
|
41
47
|
"dependencies": {
|
|
42
48
|
"@grpc/grpc-js": "^1.13.3",
|
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
.e-64e877b
|
|
2
|
-
{
|
|
3
|
-
display: flex;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
/* Button Base */
|
|
7
|
-
.e-64e877b > .holder
|
|
8
|
-
{
|
|
9
|
-
position: relative;
|
|
10
|
-
border: 1px solid transparent;
|
|
11
|
-
border-radius: var(--ot-radius-m);
|
|
12
|
-
padding: 4px var(--ot-spacing-m);
|
|
13
|
-
cursor: pointer;
|
|
14
|
-
outline: none;
|
|
15
|
-
display: inline-flex;
|
|
16
|
-
align-items: center;
|
|
17
|
-
justify-content: center;
|
|
18
|
-
gap: var(--ot-spacing-s);
|
|
19
|
-
background: transparent;
|
|
20
|
-
color: var(--ot-text-1);
|
|
21
|
-
font-size: var(--ot-size-m);
|
|
22
|
-
font-weight: 500;
|
|
23
|
-
text-decoration: none;
|
|
24
|
-
white-space: nowrap;
|
|
25
|
-
overflow: hidden;
|
|
26
|
-
user-select: none;
|
|
27
|
-
|
|
28
|
-
-webkit-tap-highlight-color: transparent;
|
|
29
|
-
transition:
|
|
30
|
-
background 0.2s ease,
|
|
31
|
-
border-color 0.2s ease,
|
|
32
|
-
color 0.2s ease,
|
|
33
|
-
box-shadow 0.2s ease,
|
|
34
|
-
transform 0.15s ease;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/* Content wrapper */
|
|
38
|
-
.e-64e877b > .holder > .content
|
|
39
|
-
{
|
|
40
|
-
display: inline-flex;
|
|
41
|
-
align-items: center;
|
|
42
|
-
justify-content: center;
|
|
43
|
-
gap: var(--ot-spacing-s);
|
|
44
|
-
transition: transform 0.2s ease;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/* Text */
|
|
48
|
-
.e-64e877b > .holder > .content > .text
|
|
49
|
-
{
|
|
50
|
-
line-height: 1;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/* Icons */
|
|
54
|
-
.e-64e877b > .holder > .content > i
|
|
55
|
-
{
|
|
56
|
-
font-size: 18px;
|
|
57
|
-
transition: transform 0.2s ease;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.e-64e877b > .holder > .content > .icon-left
|
|
61
|
-
{
|
|
62
|
-
margin-right: -2px;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
.e-64e877b > .holder > .content > .icon-right
|
|
66
|
-
{
|
|
67
|
-
margin-left: -2px;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/* Hover - subtle lift */
|
|
71
|
-
.e-64e877b > .holder:hover
|
|
72
|
-
{
|
|
73
|
-
transform: translateY(-1px);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.e-64e877b > .holder:hover > .content > .icon-right
|
|
77
|
-
{
|
|
78
|
-
transform: translateX(2px);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/* Active - press down */
|
|
82
|
-
.e-64e877b > .holder:active
|
|
83
|
-
{
|
|
84
|
-
transform: translateY(0) scale(0.98);
|
|
85
|
-
transition-duration: 0.1s;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
/* Focus visible - premium glow ring */
|
|
89
|
-
.e-64e877b > .holder:focus-visible
|
|
90
|
-
{
|
|
91
|
-
outline: none;
|
|
92
|
-
box-shadow:
|
|
93
|
-
0 0 0 2px var(--ot-bg-1),
|
|
94
|
-
0 0 0 4px var(--ot-brand);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
/* Disabled */
|
|
98
|
-
.e-64e877b > .holder[disabled="true"]
|
|
99
|
-
{
|
|
100
|
-
opacity: 0.5;
|
|
101
|
-
cursor: not-allowed;
|
|
102
|
-
pointer-events: none;
|
|
103
|
-
transform: none;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
/* Loading */
|
|
107
|
-
.e-64e877b > .holder[loading="true"]
|
|
108
|
-
{
|
|
109
|
-
cursor: wait;
|
|
110
|
-
pointer-events: none;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
/* Spinner */
|
|
114
|
-
.e-64e877b > .holder > .spinner
|
|
115
|
-
{
|
|
116
|
-
display: inline-flex;
|
|
117
|
-
align-items: center;
|
|
118
|
-
justify-content: center;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
.e-64e877b > .holder > .spinner > i
|
|
122
|
-
{
|
|
123
|
-
font-size: 18px;
|
|
124
|
-
animation: e-button-spin 0.8s linear infinite;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
@keyframes e-button-spin
|
|
128
|
-
{
|
|
129
|
-
from { transform: rotate(0deg); }
|
|
130
|
-
to { transform: rotate(360deg); }
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
/* Ripple effect */
|
|
134
|
-
.e-64e877b > .holder > .ripple
|
|
135
|
-
{
|
|
136
|
-
position: absolute;
|
|
137
|
-
border-radius: 50%;
|
|
138
|
-
background: currentColor;
|
|
139
|
-
opacity: 0.15;
|
|
140
|
-
transform: scale(0);
|
|
141
|
-
animation: e-button-ripple 0.6s ease-out forwards;
|
|
142
|
-
pointer-events: none;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
@keyframes e-button-ripple
|
|
146
|
-
{
|
|
147
|
-
to
|
|
148
|
-
{
|
|
149
|
-
transform: scale(2.5);
|
|
150
|
-
opacity: 0;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
/* Full width */
|
|
155
|
-
.e-64e877b > .holder[variant*="full"]
|
|
156
|
-
{
|
|
157
|
-
width: 100%;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
/* Rounded (pill) */
|
|
161
|
-
.e-64e877b > .holder[variant*="rounded"]
|
|
162
|
-
{
|
|
163
|
-
border-radius: 100px;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
/* Icon only - square aspect */
|
|
167
|
-
.e-64e877b > .holder[variant*="icon-only"]
|
|
168
|
-
{
|
|
169
|
-
padding: 0;
|
|
170
|
-
aspect-ratio: 1;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
.e-64e877b > .holder[variant*="icon-only"] > .content > i
|
|
174
|
-
{
|
|
175
|
-
margin: 0;
|
|
176
|
-
}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
/* Small */
|
|
2
|
-
.e-64e877b > .holder[variant*="size-s"]
|
|
3
|
-
{
|
|
4
|
-
height: var(--ot-height-s);
|
|
5
|
-
padding: 0 var(--ot-spacing-s);
|
|
6
|
-
font-size: var(--ot-size-s);
|
|
7
|
-
gap: var(--ot-spacing-x);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.e-64e877b > .holder[variant*="size-s"] > .content
|
|
11
|
-
{
|
|
12
|
-
gap: var(--ot-spacing-x);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.e-64e877b > .holder[variant*="size-s"] > .content > i,
|
|
16
|
-
.e-64e877b > .holder[variant*="size-s"] > .spinner > i
|
|
17
|
-
{
|
|
18
|
-
font-size: 14px;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/* Medium (default) */
|
|
22
|
-
.e-64e877b > .holder[variant*="size-m"]
|
|
23
|
-
{
|
|
24
|
-
height: var(--ot-height-m);
|
|
25
|
-
padding: 0 var(--ot-spacing-m);
|
|
26
|
-
font-size: var(--ot-size-m);
|
|
27
|
-
gap: var(--ot-spacing-s);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.e-64e877b > .holder[variant*="size-m"] > .content
|
|
31
|
-
{
|
|
32
|
-
gap: var(--ot-spacing-s);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.e-64e877b > .holder[variant*="size-m"] > .content > i,
|
|
36
|
-
.e-64e877b > .holder[variant*="size-m"] > .spinner > i
|
|
37
|
-
{
|
|
38
|
-
font-size: 18px;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/* Large */
|
|
42
|
-
.e-64e877b > .holder[variant*="size-l"]
|
|
43
|
-
{
|
|
44
|
-
height: var(--ot-height-l);
|
|
45
|
-
padding: 0 var(--ot-spacing-l);
|
|
46
|
-
font-size: var(--ot-size-l);
|
|
47
|
-
gap: var(--ot-spacing-m);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.e-64e877b > .holder[variant*="size-l"] > .content
|
|
51
|
-
{
|
|
52
|
-
gap: var(--ot-spacing-m);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.e-64e877b > .holder[variant*="size-l"] > .content > i,
|
|
56
|
-
.e-64e877b > .holder[variant*="size-l"] > .spinner > i
|
|
57
|
-
{
|
|
58
|
-
font-size: 22px;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
/* Icon-only size adjustments */
|
|
62
|
-
.e-64e877b > .holder[variant*="icon-only"][variant*="size-s"]
|
|
63
|
-
{
|
|
64
|
-
width: var(--ot-height-s);
|
|
65
|
-
padding: 0;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.e-64e877b > .holder[variant*="icon-only"][variant*="size-m"]
|
|
69
|
-
{
|
|
70
|
-
width: var(--ot-height-m);
|
|
71
|
-
padding: 0;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.e-64e877b > .holder[variant*="icon-only"][variant*="size-l"]
|
|
75
|
-
{
|
|
76
|
-
width: var(--ot-height-l);
|
|
77
|
-
padding: 0;
|
|
78
|
-
}
|