@miller-tech/uap 1.13.6 → 1.13.8
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/README.md +20 -0
- package/config/chat_template.jinja +126 -44
- package/config/model-profiles/qwen35.json +3 -3
- package/dist/.tsbuildinfo +1 -1
- package/dist/benchmarks/token-throughput.d.ts +259 -0
- package/dist/benchmarks/token-throughput.d.ts.map +1 -0
- package/dist/benchmarks/token-throughput.js +198 -0
- package/dist/benchmarks/token-throughput.js.map +1 -0
- package/dist/bin/cli.js +12 -0
- package/dist/bin/cli.js.map +1 -1
- package/dist/bin/llama-server-optimize.js +0 -0
- package/dist/bin/policy.js +0 -0
- package/dist/cli/dashboard.d.ts.map +1 -1
- package/dist/cli/dashboard.js +10 -20
- package/dist/cli/dashboard.js.map +1 -1
- package/dist/cli/init.d.ts.map +1 -1
- package/dist/cli/init.js +5 -0
- package/dist/cli/init.js.map +1 -1
- package/dist/cli/memory.d.ts.map +1 -1
- package/dist/cli/memory.js +9 -18
- package/dist/cli/memory.js.map +1 -1
- package/dist/cli/worktree.d.ts +4 -1
- package/dist/cli/worktree.d.ts.map +1 -1
- package/dist/cli/worktree.js +73 -1
- package/dist/cli/worktree.js.map +1 -1
- package/dist/coordination/adaptive-patterns.d.ts +3 -1
- package/dist/coordination/adaptive-patterns.d.ts.map +1 -1
- package/dist/coordination/adaptive-patterns.js +31 -3
- package/dist/coordination/adaptive-patterns.js.map +1 -1
- package/dist/dashboard/data-service.d.ts +44 -0
- package/dist/dashboard/data-service.d.ts.map +1 -1
- package/dist/dashboard/data-service.js +326 -17
- package/dist/dashboard/data-service.js.map +1 -1
- package/dist/memory/embeddings.d.ts.map +1 -1
- package/dist/memory/embeddings.js +1 -1
- package/dist/memory/embeddings.js.map +1 -1
- package/dist/models/router.js +1 -1
- package/dist/models/router.js.map +1 -1
- package/dist/models/types.d.ts +12 -12
- package/dist/models/types.js +13 -13
- package/dist/models/types.js.map +1 -1
- package/dist/policies/schemas/policy.d.ts +13 -13
- package/dist/policies/schemas/policy.js +1 -1
- package/dist/policies/schemas/policy.js.map +1 -1
- package/dist/tasks/coordination.js +1 -1
- package/dist/tasks/coordination.js.map +1 -1
- package/dist/types/config.d.ts +24 -24
- package/package.json +1 -1
- package/templates/hooks/session-start.sh +49 -48
- package/tools/agents/install-opencode-local.sh.j2 +57 -7
- package/tools/agents/opencode_uap_agent.py +63 -1
- package/tools/agents/scripts/__pycache__/anthropic_proxy.cpython-313.pyc +0 -0
- package/tools/agents/scripts/__pycache__/tool_call_wrapper.cpython-313.pyc +0 -0
- package/tools/agents/scripts/anthropic_proxy.py +759 -12
- package/tools/agents/scripts/tool_call_wrapper.py +9 -5
package/README.md
CHANGED
|
@@ -13,6 +13,26 @@
|
|
|
13
13
|
|
|
14
14
|
---
|
|
15
15
|
|
|
16
|
+
## 📊 Recent Analysis & Optimizations (2026-03-20)
|
|
17
|
+
|
|
18
|
+
A comprehensive deep analysis of the UAP codebase has been completed. See the analysis documentation:
|
|
19
|
+
|
|
20
|
+
| Document | Description |
|
|
21
|
+
|----------|-------------|
|
|
22
|
+
| **[FINAL_SUMMARY.md](./FINAL_SUMMARY.md)** | TL;DR and key findings |
|
|
23
|
+
| **[ANALYSIS_INDEX.md](./ANALYSIS_INDEX.md)** | Complete navigation guide |
|
|
24
|
+
| **[DEEP_ANALYSIS_REPORT.md](./DEEP_ANALYSIS_REPORT.md)** | Full technical analysis |
|
|
25
|
+
| **[OPTIMIZATION_ROADMAP.md](./OPTIMIZATION_ROADMAP.md)** | Implementation timeline |
|
|
26
|
+
|
|
27
|
+
**New Feature:** `uap worktree prune` - Automatically clean up stale worktrees!
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
uap worktree prune --dry-run # Preview
|
|
31
|
+
uap worktree prune --force # Execute
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
16
36
|
## Quick Start
|
|
17
37
|
|
|
18
38
|
```bash
|
|
@@ -1,76 +1,158 @@
|
|
|
1
|
-
{#- Qwen3.5 Chat Template -
|
|
2
|
-
{#-
|
|
3
|
-
{#-
|
|
4
|
-
{%-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
{#- Qwen3.5 Chat Template - Official GGUF template for 35B A3B -#}
|
|
2
|
+
{#- Uses TAG_WITH_TAGGED tool call format matching model training -#}
|
|
3
|
+
{#- Supports thinking mode with reasoning_content -#}
|
|
4
|
+
{%- set image_count = namespace(value=0) %}
|
|
5
|
+
{%- set video_count = namespace(value=0) %}
|
|
6
|
+
{%- macro render_content(content, do_vision_count, is_system_content=false) %}
|
|
7
|
+
{%- if content is string %}
|
|
8
|
+
{{- content }}
|
|
9
|
+
{%- elif content is iterable and content is not mapping %}
|
|
10
|
+
{%- for item in content %}
|
|
11
|
+
{%- if 'image' in item or 'image_url' in item or item.type == 'image' %}
|
|
12
|
+
{%- if is_system_content %}
|
|
13
|
+
{{- raise_exception('System message cannot contain images.') }}
|
|
14
|
+
{%- endif %}
|
|
15
|
+
{%- if do_vision_count %}
|
|
16
|
+
{%- set image_count.value = image_count.value + 1 %}
|
|
17
|
+
{%- endif %}
|
|
18
|
+
{%- if add_vision_id %}
|
|
19
|
+
{{- 'Picture ' ~ image_count.value ~ ': ' }}
|
|
20
|
+
{%- endif %}
|
|
21
|
+
{{- '<|vision_start|><|image_pad|><|vision_end|>' }}
|
|
22
|
+
{%- elif 'video' in item or item.type == 'video' %}
|
|
23
|
+
{%- if is_system_content %}
|
|
24
|
+
{{- raise_exception('System message cannot contain videos.') }}
|
|
25
|
+
{%- endif %}
|
|
26
|
+
{%- if do_vision_count %}
|
|
27
|
+
{%- set video_count.value = video_count.value + 1 %}
|
|
28
|
+
{%- endif %}
|
|
29
|
+
{%- if add_vision_id %}
|
|
30
|
+
{{- 'Video ' ~ video_count.value ~ ': ' }}
|
|
31
|
+
{%- endif %}
|
|
32
|
+
{{- '<|vision_start|><|video_pad|><|vision_end|>' }}
|
|
33
|
+
{%- elif 'text' in item %}
|
|
34
|
+
{{- item.text }}
|
|
35
|
+
{%- else %}
|
|
36
|
+
{{- raise_exception('Unexpected item type in content.') }}
|
|
37
|
+
{%- endif %}
|
|
38
|
+
{%- endfor %}
|
|
39
|
+
{%- elif content is none or content is undefined %}
|
|
40
|
+
{{- '' }}
|
|
41
|
+
{%- else %}
|
|
42
|
+
{{- raise_exception('Unexpected content type.') }}
|
|
8
43
|
{%- endif %}
|
|
9
|
-
|
|
44
|
+
{%- endmacro %}
|
|
45
|
+
{%- if not messages %}
|
|
46
|
+
{{- raise_exception('No messages provided.') }}
|
|
47
|
+
{%- endif %}
|
|
48
|
+
{%- if tools and tools is iterable and tools is not mapping %}
|
|
49
|
+
{{- '<|im_start|>system\n' }}
|
|
50
|
+
{{- "# Tools\n\nYou have access to the following functions:\n\n<tools>" }}
|
|
10
51
|
{%- for tool in tools %}
|
|
11
52
|
{{- "\n" }}
|
|
12
53
|
{{- tool | tojson }}
|
|
13
54
|
{%- endfor %}
|
|
14
|
-
{{- "\n</tools
|
|
55
|
+
{{- "\n</tools>" }}
|
|
56
|
+
{{- '\n\nIf you choose to call a function ONLY reply in the following format with NO suffix:\n\n<tool_call>\n<function=example_function_name>\n<parameter=example_parameter_1>\nvalue_1\n</parameter>\n<parameter=example_parameter_2>\nThis is the value for the second parameter\nthat can span\nmultiple lines\n</parameter>\n</function>\n</tool_call>\n\n<IMPORTANT>\nReminder:\n- Function calls MUST follow the specified format: an inner <function=...></function> block must be nested within <tool_call></tool_call> XML tags\n- Required parameters MUST be specified\n- You may provide optional reasoning for your function call in natural language BEFORE the function call, but NOT after\n- If there is no function call available, answer the question like normal with your current knowledge and do not tell the user about function calls\n</IMPORTANT>' }}
|
|
57
|
+
{%- if messages[0].role == 'system' %}
|
|
58
|
+
{%- set content = render_content(messages[0].content, false, true)|trim %}
|
|
59
|
+
{%- if content %}
|
|
60
|
+
{{- '\n\n' + content }}
|
|
61
|
+
{%- endif %}
|
|
62
|
+
{%- endif %}
|
|
63
|
+
{{- '<|im_end|>\n' }}
|
|
15
64
|
{%- else %}
|
|
16
65
|
{%- if messages[0].role == 'system' %}
|
|
17
|
-
{
|
|
66
|
+
{%- set content = render_content(messages[0].content, false, true)|trim %}
|
|
67
|
+
{{- '<|im_start|>system\n' + content + '<|im_end|>\n' }}
|
|
68
|
+
{%- endif %}
|
|
69
|
+
{%- endif %}
|
|
70
|
+
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
|
|
71
|
+
{%- for message in messages[::-1] %}
|
|
72
|
+
{%- set index = (messages|length - 1) - loop.index0 %}
|
|
73
|
+
{%- if ns.multi_step_tool and message.role == "user" %}
|
|
74
|
+
{%- set content = render_content(message.content, false)|trim %}
|
|
75
|
+
{%- if not(content.startswith('<tool_response>') and content.endswith('</tool_response>')) %}
|
|
76
|
+
{%- set ns.multi_step_tool = false %}
|
|
77
|
+
{%- set ns.last_query_index = index %}
|
|
78
|
+
{%- endif %}
|
|
18
79
|
{%- endif %}
|
|
80
|
+
{%- endfor %}
|
|
81
|
+
{%- if ns.multi_step_tool %}
|
|
82
|
+
{{- raise_exception('No user query found in messages.') }}
|
|
19
83
|
{%- endif %}
|
|
20
|
-
|
|
21
84
|
{%- for message in messages %}
|
|
22
|
-
{
|
|
23
|
-
{%- if
|
|
24
|
-
{
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
{%- elif message.role ==
|
|
28
|
-
{{- '<|im_start|>
|
|
29
|
-
|
|
30
|
-
|
|
85
|
+
{%- set content = render_content(message.content, true)|trim %}
|
|
86
|
+
{%- if message.role == "system" %}
|
|
87
|
+
{%- if not loop.first %}
|
|
88
|
+
{{- raise_exception('System message must be at the beginning.') }}
|
|
89
|
+
{%- endif %}
|
|
90
|
+
{%- elif message.role == "user" %}
|
|
91
|
+
{{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
|
|
92
|
+
{%- elif message.role == "assistant" %}
|
|
93
|
+
{%- set reasoning_content = '' %}
|
|
94
|
+
{%- if message.reasoning_content is string %}
|
|
95
|
+
{%- set reasoning_content = message.reasoning_content %}
|
|
96
|
+
{%- else %}
|
|
97
|
+
{%- if '</think>' in content %}
|
|
98
|
+
{%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
|
|
99
|
+
{%- set content = content.split('</think>')[-1].lstrip('\n') %}
|
|
100
|
+
{%- endif %}
|
|
31
101
|
{%- endif %}
|
|
32
|
-
{%-
|
|
102
|
+
{%- set reasoning_content = reasoning_content|trim %}
|
|
103
|
+
{%- if loop.index0 > ns.last_query_index %}
|
|
104
|
+
{{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content + '\n</think>\n\n' + content }}
|
|
105
|
+
{%- else %}
|
|
106
|
+
{{- '<|im_start|>' + message.role + '\n' + content }}
|
|
107
|
+
{%- endif %}
|
|
108
|
+
{%- if message.tool_calls and message.tool_calls is iterable and message.tool_calls is not mapping %}
|
|
33
109
|
{%- for tool_call in message.tool_calls %}
|
|
34
110
|
{%- if tool_call.function is defined %}
|
|
35
|
-
{%- set
|
|
36
|
-
{%- else %}
|
|
37
|
-
{%- set tc = tool_call %}
|
|
38
|
-
{%- endif %}
|
|
39
|
-
{%- if (loop.first and message.content is defined and message.content) or (not loop.first) %}
|
|
40
|
-
{{- '\n' }}
|
|
111
|
+
{%- set tool_call = tool_call.function %}
|
|
41
112
|
{%- endif %}
|
|
42
|
-
{
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
113
|
+
{%- if loop.first %}
|
|
114
|
+
{%- if content|trim %}
|
|
115
|
+
{{- '\n\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
|
|
116
|
+
{%- else %}
|
|
117
|
+
{{- '<tool_call>\n<function=' + tool_call.name + '>\n' }}
|
|
118
|
+
{%- endif %}
|
|
47
119
|
{%- else %}
|
|
48
|
-
{{-
|
|
120
|
+
{{- '\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
|
|
49
121
|
{%- endif %}
|
|
50
|
-
{
|
|
122
|
+
{%- if tool_call.arguments is mapping %}
|
|
123
|
+
{%- for args_name in tool_call.arguments %}
|
|
124
|
+
{%- set args_value = tool_call.arguments[args_name] %}
|
|
125
|
+
{{- '<parameter=' + args_name + '>\n' }}
|
|
126
|
+
{%- set args_value = args_value | tojson | safe if args_value is mapping or (args_value is sequence and args_value is not string) else args_value | string %}
|
|
127
|
+
{{- args_value }}
|
|
128
|
+
{{- '\n</parameter>\n' }}
|
|
129
|
+
{%- endfor %}
|
|
130
|
+
{%- endif %}
|
|
131
|
+
{{- '</function>\n</tool_call>' }}
|
|
51
132
|
{%- endfor %}
|
|
52
133
|
{%- endif %}
|
|
53
134
|
{{- '<|im_end|>\n' }}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
{%- elif message.role == 'tool' %}
|
|
57
|
-
{%- if loop.first or (messages[loop.index0 - 1].role != 'tool') %}
|
|
135
|
+
{%- elif message.role == "tool" %}
|
|
136
|
+
{%- if loop.previtem and loop.previtem.role != "tool" %}
|
|
58
137
|
{{- '<|im_start|>user' }}
|
|
59
138
|
{%- endif %}
|
|
60
139
|
{{- '\n<tool_response>\n' }}
|
|
61
|
-
{{-
|
|
140
|
+
{{- content }}
|
|
62
141
|
{{- '\n</tool_response>' }}
|
|
63
|
-
{%- if loop.last
|
|
142
|
+
{%- if not loop.last and loop.nextitem.role != "tool" %}
|
|
143
|
+
{{- '<|im_end|>\n' }}
|
|
144
|
+
{%- elif loop.last %}
|
|
64
145
|
{{- '<|im_end|>\n' }}
|
|
65
146
|
{%- endif %}
|
|
66
|
-
|
|
147
|
+
{%- else %}
|
|
148
|
+
{{- raise_exception('Unexpected message role.') }}
|
|
67
149
|
{%- endif %}
|
|
68
150
|
{%- endfor %}
|
|
69
|
-
|
|
70
|
-
{#- Generation prompt for assistant turn -#}
|
|
71
|
-
{%- if add_generation_prompt is defined and add_generation_prompt %}
|
|
151
|
+
{%- if add_generation_prompt %}
|
|
72
152
|
{{- '<|im_start|>assistant\n' }}
|
|
73
153
|
{%- if enable_thinking is defined and enable_thinking is false %}
|
|
74
154
|
{{- '<think>\n\n</think>\n\n' }}
|
|
155
|
+
{%- else %}
|
|
156
|
+
{{- '<think>\n' }}
|
|
75
157
|
{%- endif %}
|
|
76
158
|
{%- endif %}
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
"context_window": 262144,
|
|
14
14
|
"optimize_for_tool_calls": true,
|
|
15
15
|
"mode_switch_buffer_tokens": 500,
|
|
16
|
-
"enable_thinking":
|
|
16
|
+
"enable_thinking": true,
|
|
17
17
|
"chat_template_kwargs": {
|
|
18
|
-
"enable_thinking":
|
|
18
|
+
"enable_thinking": true
|
|
19
19
|
},
|
|
20
20
|
|
|
21
21
|
"dynamic_temperature": {
|
|
@@ -153,7 +153,7 @@
|
|
|
153
153
|
"search_document": "search_document: ",
|
|
154
154
|
"_comment": "nomic-embed-text-v2 requires task prefixes. Queries use search_query:, documents use search_document:. The UAP embedding provider handles this automatically."
|
|
155
155
|
},
|
|
156
|
-
"env_var": "UAP_EMBEDDING_ENDPOINT=http://
|
|
156
|
+
"env_var": "UAP_EMBEDDING_ENDPOINT=http://192.168.1.165:8081",
|
|
157
157
|
"_comment": "Set UAP_EMBEDDING_ENDPOINT env var to override the default endpoint. The embedding provider auto-detects dimensions from the model response."
|
|
158
158
|
},
|
|
159
159
|
|