diff --git a/agents/budget/workspace/openclaw-workspace-state.json b/agents/budget/workspace/openclaw-workspace-state.json new file mode 100644 index 0000000..45a2348 --- /dev/null +++ b/agents/budget/workspace/openclaw-workspace-state.json @@ -0,0 +1,4 @@ +{ + "version": 1, + "setupCompletedAt": "2026-04-23T06:17:48.250Z" +} diff --git a/agents/stock/workspace/scripts/behive_web.py b/agents/stock/workspace/scripts/behive_web.py index 8efa830..8212a2a 100644 --- a/agents/stock/workspace/scripts/behive_web.py +++ b/agents/stock/workspace/scripts/behive_web.py @@ -1747,6 +1747,31 @@ class MultipleMatchError(Exception): super().__init__(query) +_MARKET_BY_CODE_CACHE = None + + +def _market_label_html(code: str) -> str: + """종목코드 → 시장(코스피/코스닥) 작은 배지 HTML. 미상·ETF 등이면 ''. + stock_codes.json(name→{code,market})을 code→market로 뒤집어 프로세스 1회 캐시.""" + global _MARKET_BY_CODE_CACHE + code = (code or '').strip() + if not code: + return '' + if _MARKET_BY_CODE_CACHE is None: + import kiwoom_client as kc + _MARKET_BY_CODE_CACHE = { + info['code']: info['market'] + for info in kc._load_code_cache().values() + if info.get('code') and info.get('market') + } + mk = _MARKET_BY_CODE_CACHE.get(code) + if mk == 'KOSPI': + return 'KOSPI' + if mk == 'KOSDAQ': + return 'KOSDAQ' + return '' + + def _resolve_stock_fuzzy(query: str) -> dict: """정확 매칭(case-sensitive) → substring(case-insensitive) 단일 → 다중이면 후보 응답. 'lg' 입력 시 'LG' 단독 자동 통과하지 않고 'LG전자' 등도 함께 후보로 노출되도록 @@ -2160,30 +2185,51 @@ def _write_chart_hlines(d: dict) -> None: def _chart_hlines_ui(code: str, hlines: list) -> str: - """차트 하단 수평선 관리 UI — 등록된 선 칩(삭제 ×) + 가격 입력 폼. + """차트 하단 수평선 UI — 컴팩트 행(등록된 선 색상 칩 + '+' 버튼). + '+' 클릭 시 추가·삭제 모달. 색상은 정렬 인덱스로 SVG와 동일 매핑. /api/chart_svg 응답 HTML 블록에 포함돼 모든 차트(보유·관심·감시)에 동일하게 노출.""" code_s = (code or '').strip() if not code_s: return '' + import stock_analysis as sa + colors = getattr(sa, 'HLINE_COLORS', None) or ['#e879f9'] code_attr = html.escape(code_s, quote=True) if hlines: chips = ''.join( - f'{p:,}' - f'' - f'' - for p in hlines + f'{p:,}' + for i, p in enumerate(hlines) + ) + manage = ''.join( + f'