ummaya 0.2.3 → 0.2.4
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 +2 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/prompts/manifest.yaml +2 -2
- package/prompts/session_guidance_v1.md +3 -1
- package/prompts/system_v1.md +8 -7
- package/pyproject.toml +2 -7
- package/src/ummaya/context/builder.py +17 -11
- package/src/ummaya/engine/engine.py +27 -7
- package/src/ummaya/engine/query.py +20 -0
- package/src/ummaya/evidence/__init__.py +25 -0
- package/src/ummaya/evidence/__main__.py +7 -0
- package/src/ummaya/evidence/models.py +58 -0
- package/src/ummaya/evidence/runner.py +308 -0
- package/src/ummaya/evidence/task_registry.py +264 -0
- package/src/ummaya/ipc/frame_schema.py +47 -0
- package/src/ummaya/ipc/stdio.py +1287 -54
- package/src/ummaya/llm/client.py +132 -56
- package/src/ummaya/llm/reasoning.py +84 -0
- package/src/ummaya/tools/discovery_bridge.py +17 -1
- package/src/ummaya/tools/executor.py +32 -12
- package/src/ummaya/tools/geocoding/kakao_client.py +1 -2
- package/src/ummaya/tools/kma/apihub_catalog.py +984 -1
- package/src/ummaya/tools/kma/apihub_structured_adapter.py +86 -6
- package/src/ummaya/tools/kma/apihub_url_adapter.py +593 -0
- package/src/ummaya/tools/kma/apihub_url_catalog.py +296 -0
- package/src/ummaya/tools/location_adapters.py +8 -6
- package/src/ummaya/tools/manifest_metadata.py +16 -3
- package/src/ummaya/tools/mvp_surface.py +2 -2
- package/src/ummaya/tools/nmc/emergency_search.py +8 -6
- package/src/ummaya/tools/register_all.py +9 -0
- package/src/ummaya/tools/resolve_location.py +4 -4
- package/src/ummaya/tools/search.py +664 -18
- package/src/ummaya/tools/verified_data_go_kr/_manifest.py +115 -25
- package/src/ummaya/tools/verified_data_go_kr/airkorea_air_quality.py +109 -4
- package/src/ummaya/tools/verified_data_go_kr/nmc_aed_site.py +108 -2
- package/src/ummaya/tools/verified_data_go_kr/pps_bid_public_info.py +174 -9
- package/src/ummaya/tools/verified_data_go_kr/tago_bus_arrival.py +66 -3
- package/src/ummaya/tools/verified_data_go_kr/tago_bus_location.py +12 -2
- package/src/ummaya/tools/verified_data_go_kr/tago_bus_route.py +8 -2
- package/src/ummaya/tools/verified_data_go_kr/tago_bus_route_station.py +114 -0
- package/src/ummaya/tools/verified_data_go_kr/tago_bus_station.py +14 -3
- package/src/ummaya/tools/verify_canonical_map.py +21 -0
- package/tui/package.json +1 -2
- package/tui/src/QueryEngine.ts +4 -0
- package/tui/src/cli/handlers/auth.ts +1 -1
- package/tui/src/cli/handlers/mcp.tsx +3 -3
- package/tui/src/cli/print.ts +69 -18
- package/tui/src/cli/update.ts +13 -13
- package/tui/src/commands/copy/index.ts +1 -1
- package/tui/src/commands/cost/cost.ts +2 -2
- package/tui/src/commands/init-verifiers.ts +5 -5
- package/tui/src/commands/init.ts +30 -30
- package/tui/src/commands/insights.ts +43 -43
- package/tui/src/commands/install-github-app/install-github-app.tsx +2 -2
- package/tui/src/commands/install-github-app/setupGitHubActions.ts +3 -3
- package/tui/src/commands/install.tsx +5 -5
- package/tui/src/commands/mcp/addCommand.ts +5 -5
- package/tui/src/commands/mcp/xaaIdpCommand.ts +2 -2
- package/tui/src/commands/plugin/ManageMarketplaces.tsx +2 -2
- package/tui/src/commands/reasoning/index.ts +13 -0
- package/tui/src/commands/reasoning/reasoning.tsx +177 -0
- package/tui/src/commands/thinkback/thinkback.tsx +3 -3
- package/tui/src/commands.ts +2 -0
- package/tui/src/components/Messages.tsx +2 -1
- package/tui/src/components/Spinner.tsx +2 -2
- package/tui/src/components/design-system/LoadingState.tsx +2 -2
- package/tui/src/ipc/codec.ts +26 -0
- package/tui/src/ipc/frames.generated.ts +398 -303
- package/tui/src/ipc/llmClient.ts +130 -51
- package/tui/src/ipc/llmTypes.ts +16 -1
- package/tui/src/ipc/schema/frame.schema.json +1 -3475
- package/tui/src/main.tsx +3 -0
- package/tui/src/query.ts +467 -2
- package/tui/src/screens/REPL.tsx +3 -3
- package/tui/src/services/api/claude.ts +48 -18
- package/tui/src/services/api/client.ts +33 -12
- package/tui/src/services/api/ummaya.ts +70 -16
- package/tui/src/skills/bundled/stuck.ts +12 -12
- package/tui/src/state/AppStateStore.ts +7 -0
- package/tui/src/tools/AdapterTool/AdapterTool.ts +590 -7
- package/tui/src/tools/LookupPrimitive/LookupPrimitive.ts +43 -17
- package/tui/src/tools/LookupPrimitive/prompt.ts +7 -6
- package/tui/src/tools/ResolveLocationPrimitive/ResolveLocationPrimitive.ts +40 -19
- package/tui/src/tools/SubmitPrimitive/SubmitPrimitive.ts +25 -9
- package/tui/src/tools/VerifyPrimitive/VerifyPrimitive.ts +25 -9
- package/tui/src/tools/_shared/citizenUserText.ts +49 -0
- package/tui/src/tools/_shared/directPublicDataGuard.ts +362 -0
- package/tui/src/tools/_shared/kmaAnalysisGuard.ts +197 -0
- package/tui/src/tools/_shared/kmaAviationGuard.ts +70 -0
- package/tui/src/tools/_shared/locationInputRepair.ts +112 -0
- package/tui/src/tools/_shared/nmcAedGuard.ts +234 -0
- package/tui/src/tools/_shared/protectedCheckGuard.ts +207 -0
- package/tui/src/tools/_shared/rootPrimitiveInput.ts +67 -0
- package/tui/src/tools/_shared/textToolCallGuard.ts +91 -0
- package/tui/src/tools/_shared/toolChoiceRepair.ts +866 -0
- package/tui/src/utils/attachments.ts +1 -1
- package/tui/src/utils/kExaoneReasoning.ts +138 -0
- package/tui/src/utils/messages.ts +1 -0
- package/tui/src/utils/multiToolLayout.ts +13 -0
- package/tui/src/utils/processUserInput/processSlashCommand.tsx +2 -2
- package/tui/src/utils/processUserInput/processUserInput.ts +26 -0
- package/tui/src/utils/settings/applySettingsChange.ts +4 -0
- package/tui/src/utils/settings/types.ts +9 -3
- package/tui/src/utils/stats.ts +1 -1
- package/uv.lock +1 -15
- package/assets/copilot-gate-logo.svg +0 -58
- package/assets/govon-logo.svg +0 -40
- package/src/ummaya/eval/__init__.py +0 -5
- package/src/ummaya/eval/retrieval.py +0 -713
- package/tui/src/utils/messageStream.ts +0 -186
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
import { feature } from 'bun:bundle'
|
|
2
|
-
import type { BetaToolUseBlock } from 'src/sdk-compat.js'
|
|
3
|
-
import type { SpinnerMode } from '../components/Spinner.js'
|
|
4
|
-
import { isConnectorTextBlock } from '../types/connectorText.js'
|
|
5
|
-
import type {
|
|
6
|
-
Message,
|
|
7
|
-
RequestStartEvent,
|
|
8
|
-
StreamEvent,
|
|
9
|
-
TombstoneMessage,
|
|
10
|
-
ToolUseSummaryMessage,
|
|
11
|
-
} from '../types/message.js'
|
|
12
|
-
|
|
13
|
-
export type StreamingToolUse = {
|
|
14
|
-
index: number
|
|
15
|
-
contentBlock: BetaToolUseBlock
|
|
16
|
-
unparsedToolInput: string
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export type StreamingThinking = {
|
|
20
|
-
thinking: string
|
|
21
|
-
isStreaming: boolean
|
|
22
|
-
streamingEndedAt?: number
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export function handleMessageFromStream(
|
|
26
|
-
message:
|
|
27
|
-
| Message
|
|
28
|
-
| TombstoneMessage
|
|
29
|
-
| StreamEvent
|
|
30
|
-
| RequestStartEvent
|
|
31
|
-
| ToolUseSummaryMessage,
|
|
32
|
-
onMessage: (message: Message) => void,
|
|
33
|
-
onUpdateLength: (newContent: string) => void,
|
|
34
|
-
onSetStreamMode: (mode: SpinnerMode) => void,
|
|
35
|
-
onStreamingToolUses: (
|
|
36
|
-
f: (streamingToolUse: StreamingToolUse[]) => StreamingToolUse[],
|
|
37
|
-
) => void,
|
|
38
|
-
onTombstone?: (message: Message) => void,
|
|
39
|
-
onStreamingThinking?: (
|
|
40
|
-
f: (current: StreamingThinking | null) => StreamingThinking | null,
|
|
41
|
-
) => void,
|
|
42
|
-
onApiMetrics?: (metrics: { ttftMs: number }) => void,
|
|
43
|
-
onStreamingText?: (f: (current: string | null) => string | null) => void,
|
|
44
|
-
): void {
|
|
45
|
-
if (
|
|
46
|
-
message.type !== 'stream_event' &&
|
|
47
|
-
message.type !== 'stream_request_start'
|
|
48
|
-
) {
|
|
49
|
-
if (message.type === 'tombstone') {
|
|
50
|
-
onTombstone?.(message.message)
|
|
51
|
-
return
|
|
52
|
-
}
|
|
53
|
-
if (message.type === 'tool_use_summary') {
|
|
54
|
-
return
|
|
55
|
-
}
|
|
56
|
-
if (message.type === 'assistant') {
|
|
57
|
-
const thinkingBlock = message.message.content.find(
|
|
58
|
-
block => block.type === 'thinking',
|
|
59
|
-
)
|
|
60
|
-
if (thinkingBlock && thinkingBlock.type === 'thinking') {
|
|
61
|
-
onStreamingThinking?.(() => ({
|
|
62
|
-
thinking: thinkingBlock.thinking,
|
|
63
|
-
isStreaming: false,
|
|
64
|
-
streamingEndedAt: Date.now(),
|
|
65
|
-
}))
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
onStreamingText?.(() => null)
|
|
69
|
-
onMessage(message)
|
|
70
|
-
return
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
if (message.type === 'stream_request_start') {
|
|
74
|
-
onSetStreamMode('requesting')
|
|
75
|
-
return
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
if (message.event.type === 'message_start' && message.ttftMs != null) {
|
|
79
|
-
onApiMetrics?.({ ttftMs: message.ttftMs })
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
if (message.event.type === 'message_stop') {
|
|
83
|
-
onSetStreamMode('tool-use')
|
|
84
|
-
onStreamingToolUses(() => [])
|
|
85
|
-
return
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
switch (message.event.type) {
|
|
89
|
-
case 'content_block_start':
|
|
90
|
-
onStreamingText?.(() => null)
|
|
91
|
-
if (
|
|
92
|
-
feature('CONNECTOR_TEXT') &&
|
|
93
|
-
isConnectorTextBlock(message.event.content_block)
|
|
94
|
-
) {
|
|
95
|
-
onSetStreamMode('responding')
|
|
96
|
-
return
|
|
97
|
-
}
|
|
98
|
-
switch (message.event.content_block.type) {
|
|
99
|
-
case 'thinking':
|
|
100
|
-
case 'redacted_thinking':
|
|
101
|
-
onSetStreamMode('thinking')
|
|
102
|
-
return
|
|
103
|
-
case 'text':
|
|
104
|
-
onSetStreamMode('responding')
|
|
105
|
-
return
|
|
106
|
-
case 'tool_use': {
|
|
107
|
-
onSetStreamMode('tool-input')
|
|
108
|
-
const contentBlock = message.event.content_block
|
|
109
|
-
const index = message.event.index
|
|
110
|
-
onStreamingToolUses(_ => [
|
|
111
|
-
..._,
|
|
112
|
-
{
|
|
113
|
-
index,
|
|
114
|
-
contentBlock,
|
|
115
|
-
unparsedToolInput: '',
|
|
116
|
-
},
|
|
117
|
-
])
|
|
118
|
-
return
|
|
119
|
-
}
|
|
120
|
-
case 'server_tool_use':
|
|
121
|
-
case 'web_search_tool_result':
|
|
122
|
-
case 'code_execution_tool_result':
|
|
123
|
-
case 'mcp_tool_use':
|
|
124
|
-
case 'mcp_tool_result':
|
|
125
|
-
case 'container_upload':
|
|
126
|
-
case 'web_fetch_tool_result':
|
|
127
|
-
case 'bash_code_execution_tool_result':
|
|
128
|
-
case 'text_editor_code_execution_tool_result':
|
|
129
|
-
case 'tool_search_tool_result':
|
|
130
|
-
case 'compaction':
|
|
131
|
-
onSetStreamMode('tool-input')
|
|
132
|
-
return
|
|
133
|
-
}
|
|
134
|
-
return
|
|
135
|
-
case 'content_block_delta':
|
|
136
|
-
switch (message.event.delta.type) {
|
|
137
|
-
case 'text_delta': {
|
|
138
|
-
const deltaText = message.event.delta.text
|
|
139
|
-
onUpdateLength(deltaText)
|
|
140
|
-
onStreamingText?.(text => (text ?? '') + deltaText)
|
|
141
|
-
return
|
|
142
|
-
}
|
|
143
|
-
case 'input_json_delta': {
|
|
144
|
-
const delta = message.event.delta.partial_json
|
|
145
|
-
const index = message.event.index
|
|
146
|
-
onUpdateLength(delta)
|
|
147
|
-
onStreamingToolUses(_ => {
|
|
148
|
-
const element = _.find(_ => _.index === index)
|
|
149
|
-
if (!element) {
|
|
150
|
-
return _
|
|
151
|
-
}
|
|
152
|
-
return [
|
|
153
|
-
..._.filter(_ => _ !== element),
|
|
154
|
-
{
|
|
155
|
-
...element,
|
|
156
|
-
unparsedToolInput: element.unparsedToolInput + delta,
|
|
157
|
-
},
|
|
158
|
-
]
|
|
159
|
-
})
|
|
160
|
-
return
|
|
161
|
-
}
|
|
162
|
-
case 'thinking_delta': {
|
|
163
|
-
const thinkingDelta = message.event.delta.thinking
|
|
164
|
-
onUpdateLength(thinkingDelta)
|
|
165
|
-
onStreamingThinking?.(prev => ({
|
|
166
|
-
thinking: (prev?.thinking ?? '') + thinkingDelta,
|
|
167
|
-
isStreaming: true,
|
|
168
|
-
streamingEndedAt: undefined,
|
|
169
|
-
}))
|
|
170
|
-
return
|
|
171
|
-
}
|
|
172
|
-
case 'signature_delta':
|
|
173
|
-
return
|
|
174
|
-
default:
|
|
175
|
-
return
|
|
176
|
-
}
|
|
177
|
-
case 'content_block_stop':
|
|
178
|
-
return
|
|
179
|
-
case 'message_delta':
|
|
180
|
-
onSetStreamMode('responding')
|
|
181
|
-
return
|
|
182
|
-
default:
|
|
183
|
-
onSetStreamMode('responding')
|
|
184
|
-
return
|
|
185
|
-
}
|
|
186
|
-
}
|