hanseol-dev 4.0.12
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/LICENSE +21 -0
- package/README.md +267 -0
- package/dist/agents/base/base-agent.d.ts +38 -0
- package/dist/agents/base/base-agent.d.ts.map +1 -0
- package/dist/agents/base/base-agent.js +69 -0
- package/dist/agents/base/base-agent.js.map +1 -0
- package/dist/agents/docs-search/index.d.ts +33 -0
- package/dist/agents/docs-search/index.d.ts.map +1 -0
- package/dist/agents/docs-search/index.js +244 -0
- package/dist/agents/docs-search/index.js.map +1 -0
- package/dist/agents/index.d.ts +4 -0
- package/dist/agents/index.d.ts.map +1 -0
- package/dist/agents/index.js +4 -0
- package/dist/agents/index.js.map +1 -0
- package/dist/agents/planner/index.d.ts +19 -0
- package/dist/agents/planner/index.d.ts.map +1 -0
- package/dist/agents/planner/index.js +339 -0
- package/dist/agents/planner/index.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +205 -0
- package/dist/cli.js.map +1 -0
- package/dist/constants.d.ts +10 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +12 -0
- package/dist/constants.js.map +1 -0
- package/dist/core/auth/oauth-login.d.ts +19 -0
- package/dist/core/auth/oauth-login.d.ts.map +1 -0
- package/dist/core/auth/oauth-login.js +197 -0
- package/dist/core/auth/oauth-login.js.map +1 -0
- package/dist/core/compact/compact-manager.d.ts +22 -0
- package/dist/core/compact/compact-manager.d.ts.map +1 -0
- package/dist/core/compact/compact-manager.js +75 -0
- package/dist/core/compact/compact-manager.js.map +1 -0
- package/dist/core/compact/compact-prompts.d.ts +11 -0
- package/dist/core/compact/compact-prompts.d.ts.map +1 -0
- package/dist/core/compact/compact-prompts.js +90 -0
- package/dist/core/compact/compact-prompts.js.map +1 -0
- package/dist/core/compact/context-tracker.d.ts +28 -0
- package/dist/core/compact/context-tracker.d.ts.map +1 -0
- package/dist/core/compact/context-tracker.js +71 -0
- package/dist/core/compact/context-tracker.js.map +1 -0
- package/dist/core/compact/index.d.ts +4 -0
- package/dist/core/compact/index.d.ts.map +1 -0
- package/dist/core/compact/index.js +4 -0
- package/dist/core/compact/index.js.map +1 -0
- package/dist/core/config/config-manager.d.ts +43 -0
- package/dist/core/config/config-manager.d.ts.map +1 -0
- package/dist/core/config/config-manager.js +254 -0
- package/dist/core/config/config-manager.js.map +1 -0
- package/dist/core/config/index.d.ts +2 -0
- package/dist/core/config/index.d.ts.map +1 -0
- package/dist/core/config/index.js +2 -0
- package/dist/core/config/index.js.map +1 -0
- package/dist/core/docs-manager.d.ts +46 -0
- package/dist/core/docs-manager.d.ts.map +1 -0
- package/dist/core/docs-manager.js +475 -0
- package/dist/core/docs-manager.js.map +1 -0
- package/dist/core/llm/index.d.ts +2 -0
- package/dist/core/llm/index.d.ts.map +1 -0
- package/dist/core/llm/index.js +2 -0
- package/dist/core/llm/index.js.map +1 -0
- package/dist/core/llm/llm-client.d.ts +98 -0
- package/dist/core/llm/llm-client.d.ts.map +1 -0
- package/dist/core/llm/llm-client.js +1024 -0
- package/dist/core/llm/llm-client.js.map +1 -0
- package/dist/core/s3-auto-updater.d.ts +44 -0
- package/dist/core/s3-auto-updater.d.ts.map +1 -0
- package/dist/core/s3-auto-updater.js +158 -0
- package/dist/core/s3-auto-updater.js.map +1 -0
- package/dist/core/session/index.d.ts +2 -0
- package/dist/core/session/index.d.ts.map +1 -0
- package/dist/core/session/index.js +2 -0
- package/dist/core/session/index.js.map +1 -0
- package/dist/core/session/session-manager.d.ts +71 -0
- package/dist/core/session/session-manager.d.ts.map +1 -0
- package/dist/core/session/session-manager.js +250 -0
- package/dist/core/session/session-manager.js.map +1 -0
- package/dist/core/slash-command-handler.d.ts +32 -0
- package/dist/core/slash-command-handler.d.ts.map +1 -0
- package/dist/core/slash-command-handler.js +455 -0
- package/dist/core/slash-command-handler.js.map +1 -0
- package/dist/core/usage-tracker.d.ts +74 -0
- package/dist/core/usage-tracker.d.ts.map +1 -0
- package/dist/core/usage-tracker.js +279 -0
- package/dist/core/usage-tracker.js.map +1 -0
- package/dist/errors/base.d.ts +22 -0
- package/dist/errors/base.d.ts.map +1 -0
- package/dist/errors/base.js +43 -0
- package/dist/errors/base.js.map +1 -0
- package/dist/errors/file.d.ts +31 -0
- package/dist/errors/file.d.ts.map +1 -0
- package/dist/errors/file.js +110 -0
- package/dist/errors/file.js.map +1 -0
- package/dist/errors/index.d.ts +12 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/index.js +42 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/errors/llm.d.ts +26 -0
- package/dist/errors/llm.d.ts.map +1 -0
- package/dist/errors/llm.js +86 -0
- package/dist/errors/llm.js.map +1 -0
- package/dist/errors/network.d.ts +19 -0
- package/dist/errors/network.d.ts.map +1 -0
- package/dist/errors/network.js +82 -0
- package/dist/errors/network.js.map +1 -0
- package/dist/errors/quota.d.ts +25 -0
- package/dist/errors/quota.d.ts.map +1 -0
- package/dist/errors/quota.js +10 -0
- package/dist/errors/quota.js.map +1 -0
- package/dist/errors/validation.d.ts +19 -0
- package/dist/errors/validation.d.ts.map +1 -0
- package/dist/errors/validation.js +62 -0
- package/dist/errors/validation.js.map +1 -0
- package/dist/eval/eval-runner.d.ts +24 -0
- package/dist/eval/eval-runner.d.ts.map +1 -0
- package/dist/eval/eval-runner.js +291 -0
- package/dist/eval/eval-runner.js.map +1 -0
- package/dist/eval/index.d.ts +3 -0
- package/dist/eval/index.d.ts.map +1 -0
- package/dist/eval/index.js +3 -0
- package/dist/eval/index.js.map +1 -0
- package/dist/eval/types.d.ts +77 -0
- package/dist/eval/types.d.ts.map +1 -0
- package/dist/eval/types.js +2 -0
- package/dist/eval/types.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/orchestration/index.d.ts +4 -0
- package/dist/orchestration/index.d.ts.map +1 -0
- package/dist/orchestration/index.js +3 -0
- package/dist/orchestration/index.js.map +1 -0
- package/dist/orchestration/plan-executor.d.ts +28 -0
- package/dist/orchestration/plan-executor.d.ts.map +1 -0
- package/dist/orchestration/plan-executor.js +376 -0
- package/dist/orchestration/plan-executor.js.map +1 -0
- package/dist/orchestration/types.d.ts +65 -0
- package/dist/orchestration/types.d.ts.map +1 -0
- package/dist/orchestration/types.js +2 -0
- package/dist/orchestration/types.js.map +1 -0
- package/dist/orchestration/utils.d.ts +13 -0
- package/dist/orchestration/utils.d.ts.map +1 -0
- package/dist/orchestration/utils.js +81 -0
- package/dist/orchestration/utils.js.map +1 -0
- package/dist/prompts/agents/docs-search-decision.d.ts +6 -0
- package/dist/prompts/agents/docs-search-decision.d.ts.map +1 -0
- package/dist/prompts/agents/docs-search-decision.js +46 -0
- package/dist/prompts/agents/docs-search-decision.js.map +1 -0
- package/dist/prompts/agents/docs-search.d.ts +4 -0
- package/dist/prompts/agents/docs-search.d.ts.map +1 -0
- package/dist/prompts/agents/docs-search.js +70 -0
- package/dist/prompts/agents/docs-search.js.map +1 -0
- package/dist/prompts/agents/planning.d.ts +4 -0
- package/dist/prompts/agents/planning.d.ts.map +1 -0
- package/dist/prompts/agents/planning.js +179 -0
- package/dist/prompts/agents/planning.js.map +1 -0
- package/dist/prompts/index.d.ts +10 -0
- package/dist/prompts/index.d.ts.map +1 -0
- package/dist/prompts/index.js +10 -0
- package/dist/prompts/index.js.map +1 -0
- package/dist/prompts/shared/codebase-rules.d.ts +4 -0
- package/dist/prompts/shared/codebase-rules.d.ts.map +1 -0
- package/dist/prompts/shared/codebase-rules.js +16 -0
- package/dist/prompts/shared/codebase-rules.js.map +1 -0
- package/dist/prompts/shared/git-rules.d.ts +2 -0
- package/dist/prompts/shared/git-rules.d.ts.map +1 -0
- package/dist/prompts/shared/git-rules.js +87 -0
- package/dist/prompts/shared/git-rules.js.map +1 -0
- package/dist/prompts/shared/language-rules.d.ts +4 -0
- package/dist/prompts/shared/language-rules.d.ts.map +1 -0
- package/dist/prompts/shared/language-rules.js +22 -0
- package/dist/prompts/shared/language-rules.js.map +1 -0
- package/dist/prompts/shared/tool-usage.d.ts +12 -0
- package/dist/prompts/shared/tool-usage.d.ts.map +1 -0
- package/dist/prompts/shared/tool-usage.js +51 -0
- package/dist/prompts/shared/tool-usage.js.map +1 -0
- package/dist/prompts/system/compact.d.ts +3 -0
- package/dist/prompts/system/compact.d.ts.map +1 -0
- package/dist/prompts/system/compact.js +73 -0
- package/dist/prompts/system/compact.js.map +1 -0
- package/dist/prompts/system/plan-execute.d.ts +3 -0
- package/dist/prompts/system/plan-execute.d.ts.map +1 -0
- package/dist/prompts/system/plan-execute.js +119 -0
- package/dist/prompts/system/plan-execute.js.map +1 -0
- package/dist/tools/browser/browser-client.d.ts +119 -0
- package/dist/tools/browser/browser-client.d.ts.map +1 -0
- package/dist/tools/browser/browser-client.js +1083 -0
- package/dist/tools/browser/browser-client.js.map +1 -0
- package/dist/tools/browser/browser-tools.d.ts +23 -0
- package/dist/tools/browser/browser-tools.d.ts.map +1 -0
- package/dist/tools/browser/browser-tools.js +1347 -0
- package/dist/tools/browser/browser-tools.js.map +1 -0
- package/dist/tools/browser/index.d.ts +7 -0
- package/dist/tools/browser/index.d.ts.map +1 -0
- package/dist/tools/browser/index.js +17 -0
- package/dist/tools/browser/index.js.map +1 -0
- package/dist/tools/index.d.ts +4 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +4 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/llm/agents/docs-search-tools.d.ts +17 -0
- package/dist/tools/llm/agents/docs-search-tools.d.ts.map +1 -0
- package/dist/tools/llm/agents/docs-search-tools.js +265 -0
- package/dist/tools/llm/agents/docs-search-tools.js.map +1 -0
- package/dist/tools/llm/agents/index.d.ts +4 -0
- package/dist/tools/llm/agents/index.d.ts.map +1 -0
- package/dist/tools/llm/agents/index.js +3 -0
- package/dist/tools/llm/agents/index.js.map +1 -0
- package/dist/tools/llm/index.d.ts +3 -0
- package/dist/tools/llm/index.d.ts.map +1 -0
- package/dist/tools/llm/index.js +3 -0
- package/dist/tools/llm/index.js.map +1 -0
- package/dist/tools/llm/simple/ask-user-tool.d.ts +5 -0
- package/dist/tools/llm/simple/ask-user-tool.d.ts.map +1 -0
- package/dist/tools/llm/simple/ask-user-tool.js +7 -0
- package/dist/tools/llm/simple/ask-user-tool.js.map +1 -0
- package/dist/tools/llm/simple/background-bash-tool.d.ts +30 -0
- package/dist/tools/llm/simple/background-bash-tool.d.ts.map +1 -0
- package/dist/tools/llm/simple/background-bash-tool.js +320 -0
- package/dist/tools/llm/simple/background-bash-tool.js.map +1 -0
- package/dist/tools/llm/simple/background-powershell-tool.d.ts +30 -0
- package/dist/tools/llm/simple/background-powershell-tool.d.ts.map +1 -0
- package/dist/tools/llm/simple/background-powershell-tool.js +302 -0
- package/dist/tools/llm/simple/background-powershell-tool.js.map +1 -0
- package/dist/tools/llm/simple/bash-tool.d.ts +4 -0
- package/dist/tools/llm/simple/bash-tool.d.ts.map +1 -0
- package/dist/tools/llm/simple/bash-tool.js +167 -0
- package/dist/tools/llm/simple/bash-tool.js.map +1 -0
- package/dist/tools/llm/simple/docs-search-agent-tool.d.ts +6 -0
- package/dist/tools/llm/simple/docs-search-agent-tool.d.ts.map +1 -0
- package/dist/tools/llm/simple/docs-search-agent-tool.js +104 -0
- package/dist/tools/llm/simple/docs-search-agent-tool.js.map +1 -0
- package/dist/tools/llm/simple/file-tools.d.ts +13 -0
- package/dist/tools/llm/simple/file-tools.d.ts.map +1 -0
- package/dist/tools/llm/simple/file-tools.js +751 -0
- package/dist/tools/llm/simple/file-tools.js.map +1 -0
- package/dist/tools/llm/simple/final-response-tool.d.ts +12 -0
- package/dist/tools/llm/simple/final-response-tool.d.ts.map +1 -0
- package/dist/tools/llm/simple/final-response-tool.js +107 -0
- package/dist/tools/llm/simple/final-response-tool.js.map +1 -0
- package/dist/tools/llm/simple/index.d.ts +11 -0
- package/dist/tools/llm/simple/index.d.ts.map +1 -0
- package/dist/tools/llm/simple/index.js +20 -0
- package/dist/tools/llm/simple/index.js.map +1 -0
- package/dist/tools/llm/simple/planning-tools.d.ts +6 -0
- package/dist/tools/llm/simple/planning-tools.d.ts.map +1 -0
- package/dist/tools/llm/simple/planning-tools.js +171 -0
- package/dist/tools/llm/simple/planning-tools.js.map +1 -0
- package/dist/tools/llm/simple/powershell-tool.d.ts +4 -0
- package/dist/tools/llm/simple/powershell-tool.d.ts.map +1 -0
- package/dist/tools/llm/simple/powershell-tool.js +150 -0
- package/dist/tools/llm/simple/powershell-tool.js.map +1 -0
- package/dist/tools/llm/simple/simple-tool-executor.d.ts +38 -0
- package/dist/tools/llm/simple/simple-tool-executor.d.ts.map +1 -0
- package/dist/tools/llm/simple/simple-tool-executor.js +134 -0
- package/dist/tools/llm/simple/simple-tool-executor.js.map +1 -0
- package/dist/tools/llm/simple/todo-tools.d.ts +15 -0
- package/dist/tools/llm/simple/todo-tools.d.ts.map +1 -0
- package/dist/tools/llm/simple/todo-tools.js +145 -0
- package/dist/tools/llm/simple/todo-tools.js.map +1 -0
- package/dist/tools/llm/simple/user-interaction-tools.d.ts +22 -0
- package/dist/tools/llm/simple/user-interaction-tools.d.ts.map +1 -0
- package/dist/tools/llm/simple/user-interaction-tools.js +168 -0
- package/dist/tools/llm/simple/user-interaction-tools.js.map +1 -0
- package/dist/tools/office/common/constants.d.ts +194 -0
- package/dist/tools/office/common/constants.d.ts.map +1 -0
- package/dist/tools/office/common/constants.js +169 -0
- package/dist/tools/office/common/constants.js.map +1 -0
- package/dist/tools/office/common/index.d.ts +4 -0
- package/dist/tools/office/common/index.d.ts.map +1 -0
- package/dist/tools/office/common/index.js +3 -0
- package/dist/tools/office/common/index.js.map +1 -0
- package/dist/tools/office/common/types.d.ts +82 -0
- package/dist/tools/office/common/types.d.ts.map +1 -0
- package/dist/tools/office/common/types.js +2 -0
- package/dist/tools/office/common/types.js.map +1 -0
- package/dist/tools/office/common/utils.d.ts +14 -0
- package/dist/tools/office/common/utils.d.ts.map +1 -0
- package/dist/tools/office/common/utils.js +58 -0
- package/dist/tools/office/common/utils.js.map +1 -0
- package/dist/tools/office/excel-client.d.ts +212 -0
- package/dist/tools/office/excel-client.d.ts.map +1 -0
- package/dist/tools/office/excel-client.js +2242 -0
- package/dist/tools/office/excel-client.js.map +1 -0
- package/dist/tools/office/excel-tools/advanced.d.ts +13 -0
- package/dist/tools/office/excel-tools/advanced.d.ts.map +1 -0
- package/dist/tools/office/excel-tools/advanced.js +364 -0
- package/dist/tools/office/excel-tools/advanced.js.map +1 -0
- package/dist/tools/office/excel-tools/cells.d.ts +10 -0
- package/dist/tools/office/excel-tools/cells.d.ts.map +1 -0
- package/dist/tools/office/excel-tools/cells.js +279 -0
- package/dist/tools/office/excel-tools/cells.js.map +1 -0
- package/dist/tools/office/excel-tools/charts.d.ts +12 -0
- package/dist/tools/office/excel-tools/charts.d.ts.map +1 -0
- package/dist/tools/office/excel-tools/charts.js +373 -0
- package/dist/tools/office/excel-tools/charts.js.map +1 -0
- package/dist/tools/office/excel-tools/comments.d.ts +7 -0
- package/dist/tools/office/excel-tools/comments.d.ts.map +1 -0
- package/dist/tools/office/excel-tools/comments.js +150 -0
- package/dist/tools/office/excel-tools/comments.js.map +1 -0
- package/dist/tools/office/excel-tools/data-ops.d.ts +14 -0
- package/dist/tools/office/excel-tools/data-ops.d.ts.map +1 -0
- package/dist/tools/office/excel-tools/data-ops.js +420 -0
- package/dist/tools/office/excel-tools/data-ops.js.map +1 -0
- package/dist/tools/office/excel-tools/export.d.ts +8 -0
- package/dist/tools/office/excel-tools/export.d.ts.map +1 -0
- package/dist/tools/office/excel-tools/export.js +191 -0
- package/dist/tools/office/excel-tools/export.js.map +1 -0
- package/dist/tools/office/excel-tools/formatting.d.ts +12 -0
- package/dist/tools/office/excel-tools/formatting.d.ts.map +1 -0
- package/dist/tools/office/excel-tools/formatting.js +350 -0
- package/dist/tools/office/excel-tools/formatting.js.map +1 -0
- package/dist/tools/office/excel-tools/formulas.d.ts +11 -0
- package/dist/tools/office/excel-tools/formulas.d.ts.map +1 -0
- package/dist/tools/office/excel-tools/formulas.js +313 -0
- package/dist/tools/office/excel-tools/formulas.js.map +1 -0
- package/dist/tools/office/excel-tools/index.d.ts +21 -0
- package/dist/tools/office/excel-tools/index.d.ts.map +1 -0
- package/dist/tools/office/excel-tools/index.js +57 -0
- package/dist/tools/office/excel-tools/index.js.map +1 -0
- package/dist/tools/office/excel-tools/launch.d.ts +10 -0
- package/dist/tools/office/excel-tools/launch.d.ts.map +1 -0
- package/dist/tools/office/excel-tools/launch.js +248 -0
- package/dist/tools/office/excel-tools/launch.js.map +1 -0
- package/dist/tools/office/excel-tools/media.d.ts +10 -0
- package/dist/tools/office/excel-tools/media.d.ts.map +1 -0
- package/dist/tools/office/excel-tools/media.js +260 -0
- package/dist/tools/office/excel-tools/media.js.map +1 -0
- package/dist/tools/office/excel-tools/named-ranges.d.ts +6 -0
- package/dist/tools/office/excel-tools/named-ranges.d.ts.map +1 -0
- package/dist/tools/office/excel-tools/named-ranges.js +113 -0
- package/dist/tools/office/excel-tools/named-ranges.js.map +1 -0
- package/dist/tools/office/excel-tools/page-setup.d.ts +6 -0
- package/dist/tools/office/excel-tools/page-setup.d.ts.map +1 -0
- package/dist/tools/office/excel-tools/page-setup.js +144 -0
- package/dist/tools/office/excel-tools/page-setup.js.map +1 -0
- package/dist/tools/office/excel-tools/pivot-table.d.ts +7 -0
- package/dist/tools/office/excel-tools/pivot-table.d.ts.map +1 -0
- package/dist/tools/office/excel-tools/pivot-table.js +151 -0
- package/dist/tools/office/excel-tools/pivot-table.js.map +1 -0
- package/dist/tools/office/excel-tools/protection.d.ts +5 -0
- package/dist/tools/office/excel-tools/protection.d.ts.map +1 -0
- package/dist/tools/office/excel-tools/protection.js +75 -0
- package/dist/tools/office/excel-tools/protection.js.map +1 -0
- package/dist/tools/office/excel-tools/rows-columns.d.ts +15 -0
- package/dist/tools/office/excel-tools/rows-columns.d.ts.map +1 -0
- package/dist/tools/office/excel-tools/rows-columns.js +440 -0
- package/dist/tools/office/excel-tools/rows-columns.js.map +1 -0
- package/dist/tools/office/excel-tools/sheets.d.ts +16 -0
- package/dist/tools/office/excel-tools/sheets.d.ts.map +1 -0
- package/dist/tools/office/excel-tools/sheets.js +465 -0
- package/dist/tools/office/excel-tools/sheets.js.map +1 -0
- package/dist/tools/office/excel-tools/tables.d.ts +7 -0
- package/dist/tools/office/excel-tools/tables.d.ts.map +1 -0
- package/dist/tools/office/excel-tools/tables.js +151 -0
- package/dist/tools/office/excel-tools/tables.js.map +1 -0
- package/dist/tools/office/excel-tools/validation.d.ts +7 -0
- package/dist/tools/office/excel-tools/validation.d.ts.map +1 -0
- package/dist/tools/office/excel-tools/validation.js +175 -0
- package/dist/tools/office/excel-tools/validation.js.map +1 -0
- package/dist/tools/office/excel-tools.d.ts +3 -0
- package/dist/tools/office/excel-tools.d.ts.map +1 -0
- package/dist/tools/office/excel-tools.js +3 -0
- package/dist/tools/office/excel-tools.js.map +1 -0
- package/dist/tools/office/index.d.ts +6 -0
- package/dist/tools/office/index.d.ts.map +1 -0
- package/dist/tools/office/index.js +9 -0
- package/dist/tools/office/index.js.map +1 -0
- package/dist/tools/office/office-client-base.d.ts +31 -0
- package/dist/tools/office/office-client-base.d.ts.map +1 -0
- package/dist/tools/office/office-client-base.js +154 -0
- package/dist/tools/office/office-client-base.js.map +1 -0
- package/dist/tools/office/office-client.d.ts +196 -0
- package/dist/tools/office/office-client.d.ts.map +1 -0
- package/dist/tools/office/office-client.js +200 -0
- package/dist/tools/office/office-client.js.map +1 -0
- package/dist/tools/office/powerpoint-client.d.ts +155 -0
- package/dist/tools/office/powerpoint-client.d.ts.map +1 -0
- package/dist/tools/office/powerpoint-client.js +1359 -0
- package/dist/tools/office/powerpoint-client.js.map +1 -0
- package/dist/tools/office/powerpoint-tools/effects.d.ts +9 -0
- package/dist/tools/office/powerpoint-tools/effects.d.ts.map +1 -0
- package/dist/tools/office/powerpoint-tools/effects.js +259 -0
- package/dist/tools/office/powerpoint-tools/effects.js.map +1 -0
- package/dist/tools/office/powerpoint-tools/export.d.ts +7 -0
- package/dist/tools/office/powerpoint-tools/export.d.ts.map +1 -0
- package/dist/tools/office/powerpoint-tools/export.js +151 -0
- package/dist/tools/office/powerpoint-tools/export.js.map +1 -0
- package/dist/tools/office/powerpoint-tools/index.d.ts +13 -0
- package/dist/tools/office/powerpoint-tools/index.d.ts.map +1 -0
- package/dist/tools/office/powerpoint-tools/index.js +33 -0
- package/dist/tools/office/powerpoint-tools/index.js.map +1 -0
- package/dist/tools/office/powerpoint-tools/launch.d.ts +9 -0
- package/dist/tools/office/powerpoint-tools/launch.d.ts.map +1 -0
- package/dist/tools/office/powerpoint-tools/launch.js +214 -0
- package/dist/tools/office/powerpoint-tools/launch.js.map +1 -0
- package/dist/tools/office/powerpoint-tools/media.d.ts +8 -0
- package/dist/tools/office/powerpoint-tools/media.d.ts.map +1 -0
- package/dist/tools/office/powerpoint-tools/media.js +221 -0
- package/dist/tools/office/powerpoint-tools/media.js.map +1 -0
- package/dist/tools/office/powerpoint-tools/notes.d.ts +8 -0
- package/dist/tools/office/powerpoint-tools/notes.d.ts.map +1 -0
- package/dist/tools/office/powerpoint-tools/notes.js +181 -0
- package/dist/tools/office/powerpoint-tools/notes.js.map +1 -0
- package/dist/tools/office/powerpoint-tools/sections.d.ts +6 -0
- package/dist/tools/office/powerpoint-tools/sections.d.ts.map +1 -0
- package/dist/tools/office/powerpoint-tools/sections.js +111 -0
- package/dist/tools/office/powerpoint-tools/sections.js.map +1 -0
- package/dist/tools/office/powerpoint-tools/shapes.d.ts +24 -0
- package/dist/tools/office/powerpoint-tools/shapes.d.ts.map +1 -0
- package/dist/tools/office/powerpoint-tools/shapes.js +817 -0
- package/dist/tools/office/powerpoint-tools/shapes.js.map +1 -0
- package/dist/tools/office/powerpoint-tools/slides.d.ts +15 -0
- package/dist/tools/office/powerpoint-tools/slides.d.ts.map +1 -0
- package/dist/tools/office/powerpoint-tools/slides.js +447 -0
- package/dist/tools/office/powerpoint-tools/slides.js.map +1 -0
- package/dist/tools/office/powerpoint-tools/tables.d.ts +12 -0
- package/dist/tools/office/powerpoint-tools/tables.d.ts.map +1 -0
- package/dist/tools/office/powerpoint-tools/tables.js +362 -0
- package/dist/tools/office/powerpoint-tools/tables.js.map +1 -0
- package/dist/tools/office/powerpoint-tools/text.d.ts +13 -0
- package/dist/tools/office/powerpoint-tools/text.d.ts.map +1 -0
- package/dist/tools/office/powerpoint-tools/text.js +428 -0
- package/dist/tools/office/powerpoint-tools/text.js.map +1 -0
- package/dist/tools/office/powerpoint-tools.d.ts +3 -0
- package/dist/tools/office/powerpoint-tools.d.ts.map +1 -0
- package/dist/tools/office/powerpoint-tools.js +3 -0
- package/dist/tools/office/powerpoint-tools.js.map +1 -0
- package/dist/tools/office/word-client.d.ts +147 -0
- package/dist/tools/office/word-client.d.ts.map +1 -0
- package/dist/tools/office/word-client.js +1341 -0
- package/dist/tools/office/word-client.js.map +1 -0
- package/dist/tools/office/word-tools/bookmarks.d.ts +7 -0
- package/dist/tools/office/word-tools/bookmarks.d.ts.map +1 -0
- package/dist/tools/office/word-tools/bookmarks.js +146 -0
- package/dist/tools/office/word-tools/bookmarks.js.map +1 -0
- package/dist/tools/office/word-tools/comments.d.ts +7 -0
- package/dist/tools/office/word-tools/comments.d.ts.map +1 -0
- package/dist/tools/office/word-tools/comments.js +146 -0
- package/dist/tools/office/word-tools/comments.js.map +1 -0
- package/dist/tools/office/word-tools/content.d.ts +7 -0
- package/dist/tools/office/word-tools/content.d.ts.map +1 -0
- package/dist/tools/office/word-tools/content.js +168 -0
- package/dist/tools/office/word-tools/content.js.map +1 -0
- package/dist/tools/office/word-tools/export.d.ts +5 -0
- package/dist/tools/office/word-tools/export.d.ts.map +1 -0
- package/dist/tools/office/word-tools/export.js +73 -0
- package/dist/tools/office/word-tools/export.js.map +1 -0
- package/dist/tools/office/word-tools/find.d.ts +5 -0
- package/dist/tools/office/word-tools/find.d.ts.map +1 -0
- package/dist/tools/office/word-tools/find.js +106 -0
- package/dist/tools/office/word-tools/find.js.map +1 -0
- package/dist/tools/office/word-tools/footnotes.d.ts +9 -0
- package/dist/tools/office/word-tools/footnotes.d.ts.map +1 -0
- package/dist/tools/office/word-tools/footnotes.js +227 -0
- package/dist/tools/office/word-tools/footnotes.js.map +1 -0
- package/dist/tools/office/word-tools/formatting.d.ts +6 -0
- package/dist/tools/office/word-tools/formatting.d.ts.map +1 -0
- package/dist/tools/office/word-tools/formatting.js +129 -0
- package/dist/tools/office/word-tools/formatting.js.map +1 -0
- package/dist/tools/office/word-tools/headers-footers.d.ts +6 -0
- package/dist/tools/office/word-tools/headers-footers.d.ts.map +1 -0
- package/dist/tools/office/word-tools/headers-footers.js +117 -0
- package/dist/tools/office/word-tools/headers-footers.js.map +1 -0
- package/dist/tools/office/word-tools/index.d.ts +22 -0
- package/dist/tools/office/word-tools/index.d.ts.map +1 -0
- package/dist/tools/office/word-tools/index.js +63 -0
- package/dist/tools/office/word-tools/index.js.map +1 -0
- package/dist/tools/office/word-tools/launch.d.ts +10 -0
- package/dist/tools/office/word-tools/launch.d.ts.map +1 -0
- package/dist/tools/office/word-tools/launch.js +255 -0
- package/dist/tools/office/word-tools/launch.js.map +1 -0
- package/dist/tools/office/word-tools/lists.d.ts +5 -0
- package/dist/tools/office/word-tools/lists.d.ts.map +1 -0
- package/dist/tools/office/word-tools/lists.js +73 -0
- package/dist/tools/office/word-tools/lists.js.map +1 -0
- package/dist/tools/office/word-tools/navigation.d.ts +5 -0
- package/dist/tools/office/word-tools/navigation.d.ts.map +1 -0
- package/dist/tools/office/word-tools/navigation.js +85 -0
- package/dist/tools/office/word-tools/navigation.js.map +1 -0
- package/dist/tools/office/word-tools/page-setup.d.ts +7 -0
- package/dist/tools/office/word-tools/page-setup.d.ts.map +1 -0
- package/dist/tools/office/word-tools/page-setup.js +152 -0
- package/dist/tools/office/word-tools/page-setup.js.map +1 -0
- package/dist/tools/office/word-tools/selection.d.ts +8 -0
- package/dist/tools/office/word-tools/selection.d.ts.map +1 -0
- package/dist/tools/office/word-tools/selection.js +193 -0
- package/dist/tools/office/word-tools/selection.js.map +1 -0
- package/dist/tools/office/word-tools/tables-advanced.d.ts +8 -0
- package/dist/tools/office/word-tools/tables-advanced.d.ts.map +1 -0
- package/dist/tools/office/word-tools/tables-advanced.js +190 -0
- package/dist/tools/office/word-tools/tables-advanced.js.map +1 -0
- package/dist/tools/office/word-tools/tables.d.ts +8 -0
- package/dist/tools/office/word-tools/tables.d.ts.map +1 -0
- package/dist/tools/office/word-tools/tables.js +197 -0
- package/dist/tools/office/word-tools/tables.js.map +1 -0
- package/dist/tools/office/word-tools/text.d.ts +9 -0
- package/dist/tools/office/word-tools/text.d.ts.map +1 -0
- package/dist/tools/office/word-tools/text.js +235 -0
- package/dist/tools/office/word-tools/text.js.map +1 -0
- package/dist/tools/office/word-tools/toc.d.ts +6 -0
- package/dist/tools/office/word-tools/toc.d.ts.map +1 -0
- package/dist/tools/office/word-tools/toc.js +114 -0
- package/dist/tools/office/word-tools/toc.js.map +1 -0
- package/dist/tools/office/word-tools/track-changes.d.ts +8 -0
- package/dist/tools/office/word-tools/track-changes.d.ts.map +1 -0
- package/dist/tools/office/word-tools/track-changes.js +195 -0
- package/dist/tools/office/word-tools/track-changes.js.map +1 -0
- package/dist/tools/office/word-tools/undo-redo.d.ts +5 -0
- package/dist/tools/office/word-tools/undo-redo.d.ts.map +1 -0
- package/dist/tools/office/word-tools/undo-redo.js +73 -0
- package/dist/tools/office/word-tools/undo-redo.js.map +1 -0
- package/dist/tools/office/word-tools/watermarks.d.ts +5 -0
- package/dist/tools/office/word-tools/watermarks.d.ts.map +1 -0
- package/dist/tools/office/word-tools/watermarks.js +81 -0
- package/dist/tools/office/word-tools/watermarks.js.map +1 -0
- package/dist/tools/office/word-tools.d.ts +3 -0
- package/dist/tools/office/word-tools.d.ts.map +1 -0
- package/dist/tools/office/word-tools.js +3 -0
- package/dist/tools/office/word-tools.js.map +1 -0
- package/dist/tools/registry.d.ts +53 -0
- package/dist/tools/registry.d.ts.map +1 -0
- package/dist/tools/registry.js +282 -0
- package/dist/tools/registry.js.map +1 -0
- package/dist/tools/types.d.ts +88 -0
- package/dist/tools/types.d.ts.map +1 -0
- package/dist/tools/types.js +19 -0
- package/dist/tools/types.js.map +1 -0
- package/dist/types/index.d.ts +123 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/dist/ui/PlanExecuteView.d.ts +11 -0
- package/dist/ui/PlanExecuteView.d.ts.map +1 -0
- package/dist/ui/PlanExecuteView.js +27 -0
- package/dist/ui/PlanExecuteView.js.map +1 -0
- package/dist/ui/TodoPanel.d.ts +13 -0
- package/dist/ui/TodoPanel.d.ts.map +1 -0
- package/dist/ui/TodoPanel.js +135 -0
- package/dist/ui/TodoPanel.js.map +1 -0
- package/dist/ui/UpdateNotification.d.ts +13 -0
- package/dist/ui/UpdateNotification.d.ts.map +1 -0
- package/dist/ui/UpdateNotification.js +42 -0
- package/dist/ui/UpdateNotification.js.map +1 -0
- package/dist/ui/components/ActivityIndicator.d.ts +25 -0
- package/dist/ui/components/ActivityIndicator.d.ts.map +1 -0
- package/dist/ui/components/ActivityIndicator.js +115 -0
- package/dist/ui/components/ActivityIndicator.js.map +1 -0
- package/dist/ui/components/CommandBrowser.d.ts +10 -0
- package/dist/ui/components/CommandBrowser.d.ts.map +1 -0
- package/dist/ui/components/CommandBrowser.js +53 -0
- package/dist/ui/components/CommandBrowser.js.map +1 -0
- package/dist/ui/components/CustomTextInput.d.ts +13 -0
- package/dist/ui/components/CustomTextInput.d.ts.map +1 -0
- package/dist/ui/components/CustomTextInput.js +245 -0
- package/dist/ui/components/CustomTextInput.js.map +1 -0
- package/dist/ui/components/DocsSearchProgress.d.ts +13 -0
- package/dist/ui/components/DocsSearchProgress.d.ts.map +1 -0
- package/dist/ui/components/DocsSearchProgress.js +37 -0
- package/dist/ui/components/DocsSearchProgress.js.map +1 -0
- package/dist/ui/components/FileBrowser.d.ts +11 -0
- package/dist/ui/components/FileBrowser.d.ts.map +1 -0
- package/dist/ui/components/FileBrowser.js +45 -0
- package/dist/ui/components/FileBrowser.js.map +1 -0
- package/dist/ui/components/LLMSetupWizard.d.ts +8 -0
- package/dist/ui/components/LLMSetupWizard.d.ts.map +1 -0
- package/dist/ui/components/LLMSetupWizard.js +183 -0
- package/dist/ui/components/LLMSetupWizard.js.map +1 -0
- package/dist/ui/components/Logo.d.ts +21 -0
- package/dist/ui/components/Logo.d.ts.map +1 -0
- package/dist/ui/components/Logo.js +110 -0
- package/dist/ui/components/Logo.js.map +1 -0
- package/dist/ui/components/MarkdownRenderer.d.ts +9 -0
- package/dist/ui/components/MarkdownRenderer.d.ts.map +1 -0
- package/dist/ui/components/MarkdownRenderer.js +198 -0
- package/dist/ui/components/MarkdownRenderer.js.map +1 -0
- package/dist/ui/components/ModelSelector.d.ts +8 -0
- package/dist/ui/components/ModelSelector.d.ts.map +1 -0
- package/dist/ui/components/ModelSelector.js +111 -0
- package/dist/ui/components/ModelSelector.js.map +1 -0
- package/dist/ui/components/PlanExecuteApp.d.ts +23 -0
- package/dist/ui/components/PlanExecuteApp.d.ts.map +1 -0
- package/dist/ui/components/PlanExecuteApp.js +1433 -0
- package/dist/ui/components/PlanExecuteApp.js.map +1 -0
- package/dist/ui/components/ProgressBar.d.ts +10 -0
- package/dist/ui/components/ProgressBar.d.ts.map +1 -0
- package/dist/ui/components/ProgressBar.js +26 -0
- package/dist/ui/components/ProgressBar.js.map +1 -0
- package/dist/ui/components/StatusBar.d.ts +23 -0
- package/dist/ui/components/StatusBar.d.ts.map +1 -0
- package/dist/ui/components/StatusBar.js +162 -0
- package/dist/ui/components/StatusBar.js.map +1 -0
- package/dist/ui/components/ThinkingIndicator.d.ts +14 -0
- package/dist/ui/components/ThinkingIndicator.d.ts.map +1 -0
- package/dist/ui/components/ThinkingIndicator.js +63 -0
- package/dist/ui/components/ThinkingIndicator.js.map +1 -0
- package/dist/ui/components/TodoListView.d.ts +11 -0
- package/dist/ui/components/TodoListView.d.ts.map +1 -0
- package/dist/ui/components/TodoListView.js +69 -0
- package/dist/ui/components/TodoListView.js.map +1 -0
- package/dist/ui/components/ToolSelector.d.ts +7 -0
- package/dist/ui/components/ToolSelector.d.ts.map +1 -0
- package/dist/ui/components/ToolSelector.js +112 -0
- package/dist/ui/components/ToolSelector.js.map +1 -0
- package/dist/ui/components/dialogs/ApprovalDialog.d.ts +13 -0
- package/dist/ui/components/dialogs/ApprovalDialog.d.ts.map +1 -0
- package/dist/ui/components/dialogs/ApprovalDialog.js +173 -0
- package/dist/ui/components/dialogs/ApprovalDialog.js.map +1 -0
- package/dist/ui/components/dialogs/AskUserDialog.d.ts +9 -0
- package/dist/ui/components/dialogs/AskUserDialog.d.ts.map +1 -0
- package/dist/ui/components/dialogs/AskUserDialog.js +111 -0
- package/dist/ui/components/dialogs/AskUserDialog.js.map +1 -0
- package/dist/ui/components/dialogs/DocsBrowser.d.ts +8 -0
- package/dist/ui/components/dialogs/DocsBrowser.d.ts.map +1 -0
- package/dist/ui/components/dialogs/DocsBrowser.js +127 -0
- package/dist/ui/components/dialogs/DocsBrowser.js.map +1 -0
- package/dist/ui/components/dialogs/SettingsDialog.d.ts +10 -0
- package/dist/ui/components/dialogs/SettingsDialog.d.ts.map +1 -0
- package/dist/ui/components/dialogs/SettingsDialog.js +563 -0
- package/dist/ui/components/dialogs/SettingsDialog.js.map +1 -0
- package/dist/ui/components/dialogs/index.d.ts +4 -0
- package/dist/ui/components/dialogs/index.d.ts.map +1 -0
- package/dist/ui/components/dialogs/index.js +4 -0
- package/dist/ui/components/dialogs/index.js.map +1 -0
- package/dist/ui/components/index.d.ts +12 -0
- package/dist/ui/components/index.d.ts.map +1 -0
- package/dist/ui/components/index.js +9 -0
- package/dist/ui/components/index.js.map +1 -0
- package/dist/ui/components/panels/LogPanel.d.ts +7 -0
- package/dist/ui/components/panels/LogPanel.d.ts.map +1 -0
- package/dist/ui/components/panels/LogPanel.js +280 -0
- package/dist/ui/components/panels/LogPanel.js.map +1 -0
- package/dist/ui/components/panels/SessionPanel.d.ts +8 -0
- package/dist/ui/components/panels/SessionPanel.d.ts.map +1 -0
- package/dist/ui/components/panels/SessionPanel.js +81 -0
- package/dist/ui/components/panels/SessionPanel.js.map +1 -0
- package/dist/ui/components/panels/index.d.ts +4 -0
- package/dist/ui/components/panels/index.d.ts.map +1 -0
- package/dist/ui/components/panels/index.js +4 -0
- package/dist/ui/components/panels/index.js.map +1 -0
- package/dist/ui/components/views/ChatView.d.ts +12 -0
- package/dist/ui/components/views/ChatView.d.ts.map +1 -0
- package/dist/ui/components/views/ChatView.js +289 -0
- package/dist/ui/components/views/ChatView.js.map +1 -0
- package/dist/ui/components/views/index.d.ts +2 -0
- package/dist/ui/components/views/index.d.ts.map +1 -0
- package/dist/ui/components/views/index.js +2 -0
- package/dist/ui/components/views/index.js.map +1 -0
- package/dist/ui/contexts/TokenContext.d.ts +29 -0
- package/dist/ui/contexts/TokenContext.d.ts.map +1 -0
- package/dist/ui/contexts/TokenContext.js +79 -0
- package/dist/ui/contexts/TokenContext.js.map +1 -0
- package/dist/ui/hooks/atFileProcessor.d.ts +15 -0
- package/dist/ui/hooks/atFileProcessor.d.ts.map +1 -0
- package/dist/ui/hooks/atFileProcessor.js +88 -0
- package/dist/ui/hooks/atFileProcessor.js.map +1 -0
- package/dist/ui/hooks/index.d.ts +8 -0
- package/dist/ui/hooks/index.d.ts.map +1 -0
- package/dist/ui/hooks/index.js +8 -0
- package/dist/ui/hooks/index.js.map +1 -0
- package/dist/ui/hooks/slashCommandProcessor.d.ts +21 -0
- package/dist/ui/hooks/slashCommandProcessor.d.ts.map +1 -0
- package/dist/ui/hooks/slashCommandProcessor.js +100 -0
- package/dist/ui/hooks/slashCommandProcessor.js.map +1 -0
- package/dist/ui/hooks/useCommandBrowserState.d.ts +12 -0
- package/dist/ui/hooks/useCommandBrowserState.d.ts.map +1 -0
- package/dist/ui/hooks/useCommandBrowserState.js +66 -0
- package/dist/ui/hooks/useCommandBrowserState.js.map +1 -0
- package/dist/ui/hooks/useFileBrowserState.d.ts +15 -0
- package/dist/ui/hooks/useFileBrowserState.d.ts.map +1 -0
- package/dist/ui/hooks/useFileBrowserState.js +80 -0
- package/dist/ui/hooks/useFileBrowserState.js.map +1 -0
- package/dist/ui/hooks/useFileList.d.ts +20 -0
- package/dist/ui/hooks/useFileList.d.ts.map +1 -0
- package/dist/ui/hooks/useFileList.js +57 -0
- package/dist/ui/hooks/useFileList.js.map +1 -0
- package/dist/ui/hooks/useInputHistory.d.ts +9 -0
- package/dist/ui/hooks/useInputHistory.d.ts.map +1 -0
- package/dist/ui/hooks/useInputHistory.js +68 -0
- package/dist/ui/hooks/useInputHistory.js.map +1 -0
- package/dist/ui/hooks/usePlanExecution.d.ts +8 -0
- package/dist/ui/hooks/usePlanExecution.d.ts.map +1 -0
- package/dist/ui/hooks/usePlanExecution.js +208 -0
- package/dist/ui/hooks/usePlanExecution.js.map +1 -0
- package/dist/ui/index.d.ts +7 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +7 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/ink-entry.d.ts +3 -0
- package/dist/ui/ink-entry.d.ts.map +1 -0
- package/dist/ui/ink-entry.js +22 -0
- package/dist/ui/ink-entry.js.map +1 -0
- package/dist/utils/file-system.d.ts +9 -0
- package/dist/utils/file-system.d.ts.map +1 -0
- package/dist/utils/file-system.js +99 -0
- package/dist/utils/file-system.js.map +1 -0
- package/dist/utils/git-utils.d.ts +2 -0
- package/dist/utils/git-utils.d.ts.map +1 -0
- package/dist/utils/git-utils.js +16 -0
- package/dist/utils/git-utils.js.map +1 -0
- package/dist/utils/json-stream-logger.d.ts +74 -0
- package/dist/utils/json-stream-logger.d.ts.map +1 -0
- package/dist/utils/json-stream-logger.js +808 -0
- package/dist/utils/json-stream-logger.js.map +1 -0
- package/dist/utils/logger.d.ts +152 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +1672 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/platform-utils.d.ts +19 -0
- package/dist/utils/platform-utils.d.ts.map +1 -0
- package/dist/utils/platform-utils.js +134 -0
- package/dist/utils/platform-utils.js.map +1 -0
- package/dist/utils/wsl-utils.d.ts +4 -0
- package/dist/utils/wsl-utils.d.ts.map +1 -0
- package/dist/utils/wsl-utils.js +72 -0
- package/dist/utils/wsl-utils.js.map +1 -0
- package/package.json +148 -0
- package/scripts/patch-yoga.js +48 -0
|
@@ -0,0 +1,1672 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import { getJsonStreamLogger } from './json-stream-logger.js';
|
|
3
|
+
import * as path from 'path';
|
|
4
|
+
export var LogLevel;
|
|
5
|
+
(function (LogLevel) {
|
|
6
|
+
LogLevel[LogLevel["ERROR"] = 0] = "ERROR";
|
|
7
|
+
LogLevel[LogLevel["WARN"] = 1] = "WARN";
|
|
8
|
+
LogLevel[LogLevel["INFO"] = 2] = "INFO";
|
|
9
|
+
LogLevel[LogLevel["DEBUG"] = 3] = "DEBUG";
|
|
10
|
+
LogLevel[LogLevel["VERBOSE"] = 4] = "VERBOSE";
|
|
11
|
+
})(LogLevel || (LogLevel = {}));
|
|
12
|
+
let llmLogEnabled = false;
|
|
13
|
+
export function enableLLMLog() {
|
|
14
|
+
llmLogEnabled = true;
|
|
15
|
+
}
|
|
16
|
+
export function disableLLMLog() {
|
|
17
|
+
llmLogEnabled = false;
|
|
18
|
+
}
|
|
19
|
+
export function isLLMLogEnabled() {
|
|
20
|
+
return llmLogEnabled;
|
|
21
|
+
}
|
|
22
|
+
export class Logger {
|
|
23
|
+
level;
|
|
24
|
+
prefix;
|
|
25
|
+
showTimestamp;
|
|
26
|
+
showLocation;
|
|
27
|
+
showPid;
|
|
28
|
+
traceId = null;
|
|
29
|
+
timers = new Map();
|
|
30
|
+
constructor(options = {}) {
|
|
31
|
+
this.level = options.level ?? LogLevel.INFO;
|
|
32
|
+
this.prefix = options.prefix ?? '';
|
|
33
|
+
this.showTimestamp = options.timestamp ?? true;
|
|
34
|
+
this.showLocation = options.showLocation ?? true;
|
|
35
|
+
this.showPid = options.showPid ?? false;
|
|
36
|
+
}
|
|
37
|
+
setLevel(level) {
|
|
38
|
+
this.level = level;
|
|
39
|
+
}
|
|
40
|
+
setTraceId(traceId) {
|
|
41
|
+
this.traceId = traceId;
|
|
42
|
+
}
|
|
43
|
+
clearTraceId() {
|
|
44
|
+
this.traceId = null;
|
|
45
|
+
}
|
|
46
|
+
getTraceId() {
|
|
47
|
+
return this.traceId;
|
|
48
|
+
}
|
|
49
|
+
getCallLocation(depth = 3) {
|
|
50
|
+
try {
|
|
51
|
+
const stack = new Error().stack;
|
|
52
|
+
if (!stack)
|
|
53
|
+
return null;
|
|
54
|
+
const lines = stack.split('\n');
|
|
55
|
+
if (lines.length <= depth)
|
|
56
|
+
return null;
|
|
57
|
+
const line = lines[depth];
|
|
58
|
+
if (!line)
|
|
59
|
+
return null;
|
|
60
|
+
const match = line.match(/at\s+(?:(.+?)\s+\()?(.+?):(\d+):(\d+)\)?/);
|
|
61
|
+
if (!match)
|
|
62
|
+
return null;
|
|
63
|
+
const [, functionName, file, lineNum, column] = match;
|
|
64
|
+
if (!file || !lineNum || !column)
|
|
65
|
+
return null;
|
|
66
|
+
return {
|
|
67
|
+
file: path.basename(file),
|
|
68
|
+
line: parseInt(lineNum),
|
|
69
|
+
column: parseInt(column),
|
|
70
|
+
function: functionName?.trim() || '<anonymous>',
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
catch {
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
getTimestamp() {
|
|
78
|
+
if (!this.showTimestamp)
|
|
79
|
+
return '';
|
|
80
|
+
const now = new Date();
|
|
81
|
+
return chalk.gray(`[${now.toISOString()}]`);
|
|
82
|
+
}
|
|
83
|
+
getPrefix() {
|
|
84
|
+
if (!this.prefix)
|
|
85
|
+
return '';
|
|
86
|
+
return chalk.cyan(`[${this.prefix}]`);
|
|
87
|
+
}
|
|
88
|
+
getPid() {
|
|
89
|
+
if (!this.showPid)
|
|
90
|
+
return '';
|
|
91
|
+
return chalk.dim(`[PID:${process.pid}]`);
|
|
92
|
+
}
|
|
93
|
+
getTraceIdStr() {
|
|
94
|
+
if (!this.traceId)
|
|
95
|
+
return '';
|
|
96
|
+
return chalk.magenta(`[Trace:${this.traceId.slice(0, 8)}]`);
|
|
97
|
+
}
|
|
98
|
+
getLocation(location) {
|
|
99
|
+
if (!this.showLocation || !location)
|
|
100
|
+
return '';
|
|
101
|
+
return chalk.dim(`[${location.file}:${location.line}:${location.function}]`);
|
|
102
|
+
}
|
|
103
|
+
formatVariable(variable) {
|
|
104
|
+
const type = variable.type || typeof variable.value;
|
|
105
|
+
const valueStr = this.formatValue(variable.value);
|
|
106
|
+
return chalk.yellow(variable.name) + chalk.gray('=') + chalk.white(valueStr) + chalk.dim(` (${type})`);
|
|
107
|
+
}
|
|
108
|
+
formatValue(value) {
|
|
109
|
+
if (value === null)
|
|
110
|
+
return 'null';
|
|
111
|
+
if (value === undefined)
|
|
112
|
+
return 'undefined';
|
|
113
|
+
if (typeof value === 'string')
|
|
114
|
+
return `"${value}"`;
|
|
115
|
+
if (typeof value === 'number' || typeof value === 'boolean')
|
|
116
|
+
return String(value);
|
|
117
|
+
if (typeof value === 'function')
|
|
118
|
+
return '[Function]';
|
|
119
|
+
if (Array.isArray(value))
|
|
120
|
+
return `Array(${value.length})`;
|
|
121
|
+
if (value instanceof Error)
|
|
122
|
+
return `Error: ${value.message}`;
|
|
123
|
+
try {
|
|
124
|
+
const json = JSON.stringify(value);
|
|
125
|
+
return json.length > 100 ? json.slice(0, 100) + '...' : json;
|
|
126
|
+
}
|
|
127
|
+
catch {
|
|
128
|
+
return '[Object]';
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
error(message, error) {
|
|
132
|
+
const jsonLogger = getJsonStreamLogger();
|
|
133
|
+
if (jsonLogger?.isActive()) {
|
|
134
|
+
jsonLogger.logError(error || new Error(message), this.prefix || 'logger');
|
|
135
|
+
}
|
|
136
|
+
if (this.level < LogLevel.ERROR)
|
|
137
|
+
return;
|
|
138
|
+
const location = this.getCallLocation();
|
|
139
|
+
const timestamp = this.getTimestamp();
|
|
140
|
+
const prefix = this.getPrefix();
|
|
141
|
+
const pid = this.getPid();
|
|
142
|
+
const traceId = this.getTraceIdStr();
|
|
143
|
+
const loc = this.getLocation(location);
|
|
144
|
+
console.error(timestamp, prefix, pid, traceId, loc, chalk.red('❌ ERROR:'), message);
|
|
145
|
+
if (error) {
|
|
146
|
+
if (error instanceof Error) {
|
|
147
|
+
console.error(chalk.red(' Message:'), error.message);
|
|
148
|
+
if (error.stack) {
|
|
149
|
+
console.error(chalk.gray(' Stack:'));
|
|
150
|
+
console.error(chalk.gray(error.stack));
|
|
151
|
+
}
|
|
152
|
+
if (error.cause) {
|
|
153
|
+
console.error(chalk.red(' Cause:'), error.cause);
|
|
154
|
+
}
|
|
155
|
+
if (error.details) {
|
|
156
|
+
console.error(chalk.yellow(' Details:'), JSON.stringify(error.details, null, 2));
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
console.error(chalk.red(' Error:'), error);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
warn(message, data) {
|
|
165
|
+
const jsonLogger = getJsonStreamLogger();
|
|
166
|
+
if (jsonLogger?.isActive()) {
|
|
167
|
+
jsonLogger.logInfo(`[WARN] ${message}`, data);
|
|
168
|
+
}
|
|
169
|
+
if (this.level < LogLevel.WARN)
|
|
170
|
+
return;
|
|
171
|
+
const location = this.getCallLocation();
|
|
172
|
+
const timestamp = this.getTimestamp();
|
|
173
|
+
const prefix = this.getPrefix();
|
|
174
|
+
const pid = this.getPid();
|
|
175
|
+
const traceId = this.getTraceIdStr();
|
|
176
|
+
const loc = this.getLocation(location);
|
|
177
|
+
console.warn(timestamp, prefix, pid, traceId, loc, chalk.yellow('⚠️ WARN:'), message);
|
|
178
|
+
if (data) {
|
|
179
|
+
console.warn(chalk.yellow(' Data:'), JSON.stringify(data, null, 2));
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
info(message, data) {
|
|
183
|
+
const jsonLogger = getJsonStreamLogger();
|
|
184
|
+
if (jsonLogger?.isActive()) {
|
|
185
|
+
jsonLogger.logInfo(message, data);
|
|
186
|
+
}
|
|
187
|
+
if (this.level < LogLevel.INFO)
|
|
188
|
+
return;
|
|
189
|
+
const location = this.getCallLocation();
|
|
190
|
+
const timestamp = this.getTimestamp();
|
|
191
|
+
const prefix = this.getPrefix();
|
|
192
|
+
const pid = this.getPid();
|
|
193
|
+
const traceId = this.getTraceIdStr();
|
|
194
|
+
const loc = this.getLocation(location);
|
|
195
|
+
console.log(timestamp, prefix, pid, traceId, loc, chalk.blue('ℹ️ INFO:'), message);
|
|
196
|
+
if (data) {
|
|
197
|
+
console.log(chalk.blue(' Data:'), JSON.stringify(data, null, 2));
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
debug(message, data) {
|
|
201
|
+
const jsonLogger = getJsonStreamLogger();
|
|
202
|
+
if (jsonLogger?.isActive()) {
|
|
203
|
+
jsonLogger.logDebug(message, data);
|
|
204
|
+
}
|
|
205
|
+
if (this.level < LogLevel.DEBUG)
|
|
206
|
+
return;
|
|
207
|
+
const location = this.getCallLocation();
|
|
208
|
+
const timestamp = this.getTimestamp();
|
|
209
|
+
const prefix = this.getPrefix();
|
|
210
|
+
const pid = this.getPid();
|
|
211
|
+
const traceId = this.getTraceIdStr();
|
|
212
|
+
const loc = this.getLocation(location);
|
|
213
|
+
console.log(timestamp, prefix, pid, traceId, loc, chalk.magenta('🐛 DEBUG:'), message);
|
|
214
|
+
if (data) {
|
|
215
|
+
console.log(chalk.magenta(' Data:'), JSON.stringify(data, null, 2));
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
verbose(message, data) {
|
|
219
|
+
const jsonLogger = getJsonStreamLogger();
|
|
220
|
+
if (jsonLogger?.isActive()) {
|
|
221
|
+
jsonLogger.logDebug(`[VERBOSE] ${message}`, data);
|
|
222
|
+
}
|
|
223
|
+
if (this.level < LogLevel.VERBOSE)
|
|
224
|
+
return;
|
|
225
|
+
const location = this.getCallLocation();
|
|
226
|
+
const timestamp = this.getTimestamp();
|
|
227
|
+
const prefix = this.getPrefix();
|
|
228
|
+
const pid = this.getPid();
|
|
229
|
+
const traceId = this.getTraceIdStr();
|
|
230
|
+
const loc = this.getLocation(location);
|
|
231
|
+
console.log(timestamp, prefix, pid, traceId, loc, chalk.gray('🔍 VERBOSE:'), message);
|
|
232
|
+
if (data) {
|
|
233
|
+
console.log(chalk.gray(' Data:'), JSON.stringify(data, null, 2));
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
flow(message, context) {
|
|
237
|
+
const jsonLogger = getJsonStreamLogger();
|
|
238
|
+
if (jsonLogger?.isActive()) {
|
|
239
|
+
jsonLogger.logDebug(`[FLOW] ${message}`, context);
|
|
240
|
+
}
|
|
241
|
+
if (this.level < LogLevel.DEBUG)
|
|
242
|
+
return;
|
|
243
|
+
const location = this.getCallLocation();
|
|
244
|
+
const timestamp = this.getTimestamp();
|
|
245
|
+
const prefix = this.getPrefix();
|
|
246
|
+
const pid = this.getPid();
|
|
247
|
+
const traceId = this.getTraceIdStr();
|
|
248
|
+
const loc = this.getLocation(location);
|
|
249
|
+
console.log(timestamp, prefix, pid, traceId, loc, chalk.green('➜ FLOW:'), message);
|
|
250
|
+
if (context) {
|
|
251
|
+
console.log(chalk.green(' Context:'), JSON.stringify(context, null, 2));
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
vars(...variables) {
|
|
255
|
+
const jsonLogger = getJsonStreamLogger();
|
|
256
|
+
if (jsonLogger?.isActive()) {
|
|
257
|
+
const varsData = variables.reduce((acc, v) => {
|
|
258
|
+
acc[v.name] = v.value;
|
|
259
|
+
return acc;
|
|
260
|
+
}, {});
|
|
261
|
+
jsonLogger.logDebug('[VARS]', varsData);
|
|
262
|
+
}
|
|
263
|
+
if (this.level < LogLevel.DEBUG)
|
|
264
|
+
return;
|
|
265
|
+
const location = this.getCallLocation();
|
|
266
|
+
const timestamp = this.getTimestamp();
|
|
267
|
+
const prefix = this.getPrefix();
|
|
268
|
+
const pid = this.getPid();
|
|
269
|
+
const traceId = this.getTraceIdStr();
|
|
270
|
+
const loc = this.getLocation(location);
|
|
271
|
+
console.log(timestamp, prefix, pid, traceId, loc, chalk.cyan('📦 VARS:'));
|
|
272
|
+
variables.forEach(variable => {
|
|
273
|
+
console.log(' ', this.formatVariable(variable));
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
enter(functionName, args) {
|
|
277
|
+
const jsonLogger = getJsonStreamLogger();
|
|
278
|
+
if (jsonLogger?.isActive()) {
|
|
279
|
+
jsonLogger.logDebug(`[ENTER] ${functionName}`, args);
|
|
280
|
+
}
|
|
281
|
+
if (this.level < LogLevel.DEBUG)
|
|
282
|
+
return;
|
|
283
|
+
const location = this.getCallLocation();
|
|
284
|
+
const timestamp = this.getTimestamp();
|
|
285
|
+
const prefix = this.getPrefix();
|
|
286
|
+
const pid = this.getPid();
|
|
287
|
+
const traceId = this.getTraceIdStr();
|
|
288
|
+
const loc = this.getLocation(location);
|
|
289
|
+
console.log(timestamp, prefix, pid, traceId, loc, chalk.green('↓ ENTER:'), chalk.bold(functionName));
|
|
290
|
+
if (args) {
|
|
291
|
+
console.log(chalk.green(' Args:'), JSON.stringify(args, null, 2));
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
exit(functionName, result) {
|
|
295
|
+
const jsonLogger = getJsonStreamLogger();
|
|
296
|
+
if (jsonLogger?.isActive()) {
|
|
297
|
+
jsonLogger.logDebug(`[EXIT] ${functionName}`, { result });
|
|
298
|
+
}
|
|
299
|
+
if (this.level < LogLevel.DEBUG)
|
|
300
|
+
return;
|
|
301
|
+
const location = this.getCallLocation();
|
|
302
|
+
const timestamp = this.getTimestamp();
|
|
303
|
+
const prefix = this.getPrefix();
|
|
304
|
+
const pid = this.getPid();
|
|
305
|
+
const traceId = this.getTraceIdStr();
|
|
306
|
+
const loc = this.getLocation(location);
|
|
307
|
+
console.log(timestamp, prefix, pid, traceId, loc, chalk.green('↑ EXIT:'), chalk.bold(functionName));
|
|
308
|
+
if (result !== undefined) {
|
|
309
|
+
console.log(chalk.green(' Result:'), this.formatValue(result));
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
state(description, before, after) {
|
|
313
|
+
const jsonLogger = getJsonStreamLogger();
|
|
314
|
+
if (jsonLogger?.isActive()) {
|
|
315
|
+
jsonLogger.logDebug(`[STATE] ${description}`, { before, after });
|
|
316
|
+
}
|
|
317
|
+
if (this.level < LogLevel.DEBUG)
|
|
318
|
+
return;
|
|
319
|
+
const location = this.getCallLocation();
|
|
320
|
+
const timestamp = this.getTimestamp();
|
|
321
|
+
const prefix = this.getPrefix();
|
|
322
|
+
const pid = this.getPid();
|
|
323
|
+
const traceId = this.getTraceIdStr();
|
|
324
|
+
const loc = this.getLocation(location);
|
|
325
|
+
console.log(timestamp, prefix, pid, traceId, loc, chalk.yellow('🔄 STATE:'), description);
|
|
326
|
+
console.log(chalk.red(' Before:'), this.formatValue(before));
|
|
327
|
+
console.log(chalk.green(' After:'), this.formatValue(after));
|
|
328
|
+
}
|
|
329
|
+
startTimer(label) {
|
|
330
|
+
const jsonLogger = getJsonStreamLogger();
|
|
331
|
+
if (jsonLogger?.isActive()) {
|
|
332
|
+
jsonLogger.logDebug(`[TIMER] Start: ${label}`);
|
|
333
|
+
}
|
|
334
|
+
this.timers.set(label, Date.now());
|
|
335
|
+
if (this.level >= LogLevel.DEBUG) {
|
|
336
|
+
const location = this.getCallLocation();
|
|
337
|
+
const timestamp = this.getTimestamp();
|
|
338
|
+
const prefix = this.getPrefix();
|
|
339
|
+
const pid = this.getPid();
|
|
340
|
+
const traceId = this.getTraceIdStr();
|
|
341
|
+
const loc = this.getLocation(location);
|
|
342
|
+
console.log(timestamp, prefix, pid, traceId, loc, chalk.blue('⏱️ TIMER START:'), label);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
endTimer(label) {
|
|
346
|
+
const startTime = this.timers.get(label);
|
|
347
|
+
if (!startTime) {
|
|
348
|
+
this.warn(`Timer "${label}" was not started`);
|
|
349
|
+
return 0;
|
|
350
|
+
}
|
|
351
|
+
const elapsed = Date.now() - startTime;
|
|
352
|
+
this.timers.delete(label);
|
|
353
|
+
const jsonLogger = getJsonStreamLogger();
|
|
354
|
+
if (jsonLogger?.isActive()) {
|
|
355
|
+
jsonLogger.logDebug(`[TIMER] End: ${label}`, { elapsed });
|
|
356
|
+
}
|
|
357
|
+
if (this.level >= LogLevel.DEBUG) {
|
|
358
|
+
const location = this.getCallLocation();
|
|
359
|
+
const timestamp = this.getTimestamp();
|
|
360
|
+
const prefix = this.getPrefix();
|
|
361
|
+
const pid = this.getPid();
|
|
362
|
+
const traceId = this.getTraceIdStr();
|
|
363
|
+
const loc = this.getLocation(location);
|
|
364
|
+
console.log(timestamp, prefix, pid, traceId, loc, chalk.blue('⏱️ TIMER END:'), label, chalk.bold(`${elapsed}ms`));
|
|
365
|
+
}
|
|
366
|
+
return elapsed;
|
|
367
|
+
}
|
|
368
|
+
httpRequest(method, url, body) {
|
|
369
|
+
const jsonLogger = getJsonStreamLogger();
|
|
370
|
+
if (jsonLogger?.isActive()) {
|
|
371
|
+
jsonLogger.logDebug(`HTTP ${method} ${url}`, { body });
|
|
372
|
+
}
|
|
373
|
+
if (this.level < LogLevel.DEBUG)
|
|
374
|
+
return;
|
|
375
|
+
const location = this.getCallLocation();
|
|
376
|
+
const timestamp = this.getTimestamp();
|
|
377
|
+
const prefix = this.getPrefix();
|
|
378
|
+
const pid = this.getPid();
|
|
379
|
+
const traceId = this.getTraceIdStr();
|
|
380
|
+
const loc = this.getLocation(location);
|
|
381
|
+
console.log(timestamp, prefix, pid, traceId, loc, chalk.cyan('→ HTTP REQUEST:'), chalk.bold(method), url);
|
|
382
|
+
if (body) {
|
|
383
|
+
console.log(chalk.cyan(' Body:'), JSON.stringify(body, null, 2));
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
httpResponse(status, statusText, data) {
|
|
387
|
+
const jsonLogger = getJsonStreamLogger();
|
|
388
|
+
if (jsonLogger?.isActive()) {
|
|
389
|
+
jsonLogger.logDebug(`HTTP Response ${status} ${statusText}`, { status, statusText, data });
|
|
390
|
+
}
|
|
391
|
+
if (this.level < LogLevel.DEBUG)
|
|
392
|
+
return;
|
|
393
|
+
const location = this.getCallLocation();
|
|
394
|
+
const timestamp = this.getTimestamp();
|
|
395
|
+
const prefix = this.getPrefix();
|
|
396
|
+
const pid = this.getPid();
|
|
397
|
+
const traceId = this.getTraceIdStr();
|
|
398
|
+
const loc = this.getLocation(location);
|
|
399
|
+
const statusColor = status >= 400 ? chalk.red : status >= 300 ? chalk.yellow : chalk.green;
|
|
400
|
+
console.log(timestamp, prefix, pid, traceId, loc, chalk.cyan('← HTTP RESPONSE:'), statusColor(`${status} ${statusText}`));
|
|
401
|
+
if (data && this.level >= LogLevel.VERBOSE) {
|
|
402
|
+
console.log(chalk.cyan(' Data:'), JSON.stringify(data, null, 2));
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
toolExecution(toolName, args, result, error) {
|
|
406
|
+
const jsonLogger = getJsonStreamLogger();
|
|
407
|
+
if (jsonLogger?.isActive()) {
|
|
408
|
+
jsonLogger.logToolCall(toolName, args, result, error);
|
|
409
|
+
}
|
|
410
|
+
if (this.level < LogLevel.DEBUG)
|
|
411
|
+
return;
|
|
412
|
+
const location = this.getCallLocation();
|
|
413
|
+
const timestamp = this.getTimestamp();
|
|
414
|
+
const prefix = this.getPrefix();
|
|
415
|
+
const pid = this.getPid();
|
|
416
|
+
const traceId = this.getTraceIdStr();
|
|
417
|
+
const loc = this.getLocation(location);
|
|
418
|
+
if (error) {
|
|
419
|
+
console.log(timestamp, prefix, pid, traceId, loc, chalk.red('🔧 TOOL FAILED:'), chalk.bold(toolName));
|
|
420
|
+
console.log(chalk.red(' Args:'), JSON.stringify(args, null, 2));
|
|
421
|
+
console.log(chalk.red(' Error:'), error.message);
|
|
422
|
+
}
|
|
423
|
+
else {
|
|
424
|
+
console.log(timestamp, prefix, pid, traceId, loc, chalk.green('🔧 TOOL SUCCESS:'), chalk.bold(toolName));
|
|
425
|
+
console.log(chalk.green(' Args:'), JSON.stringify(args, null, 2));
|
|
426
|
+
if (result && this.level >= LogLevel.VERBOSE) {
|
|
427
|
+
console.log(chalk.green(' Result:'), JSON.stringify(result, null, 2));
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
bashExecution(formattedDisplay) {
|
|
432
|
+
const jsonLogger = getJsonStreamLogger();
|
|
433
|
+
if (jsonLogger?.isActive()) {
|
|
434
|
+
jsonLogger.logDebug('[BASH] Execution', { output: formattedDisplay });
|
|
435
|
+
}
|
|
436
|
+
if (this.level < LogLevel.INFO)
|
|
437
|
+
return;
|
|
438
|
+
const lines = formattedDisplay.split('\n');
|
|
439
|
+
lines.forEach((line) => {
|
|
440
|
+
if (line.startsWith('●')) {
|
|
441
|
+
console.log(chalk.cyan(line));
|
|
442
|
+
}
|
|
443
|
+
else if (line.includes('Error:')) {
|
|
444
|
+
console.log(chalk.red(line));
|
|
445
|
+
}
|
|
446
|
+
else {
|
|
447
|
+
console.log(line);
|
|
448
|
+
}
|
|
449
|
+
});
|
|
450
|
+
console.log();
|
|
451
|
+
}
|
|
452
|
+
llmRequest(messages, model, tools) {
|
|
453
|
+
const jsonLogger = getJsonStreamLogger();
|
|
454
|
+
if (jsonLogger?.isActive()) {
|
|
455
|
+
jsonLogger.logDebug('[LLM] Request', { model, messageCount: messages?.length, toolCount: tools?.length });
|
|
456
|
+
}
|
|
457
|
+
if (!llmLogEnabled)
|
|
458
|
+
return;
|
|
459
|
+
const timestamp = this.getTimestamp();
|
|
460
|
+
console.log();
|
|
461
|
+
console.log(chalk.cyan('─'.repeat(80)));
|
|
462
|
+
console.log(chalk.cyan.bold(`[${timestamp}] 📤 LLM REQUEST`));
|
|
463
|
+
console.log(chalk.gray(`Model: ${model}`));
|
|
464
|
+
if (tools && Array.isArray(tools) && tools.length > 0) {
|
|
465
|
+
console.log(chalk.gray(`Tools: ${tools.length} available`));
|
|
466
|
+
}
|
|
467
|
+
console.log(chalk.cyan('─'.repeat(40)));
|
|
468
|
+
if (Array.isArray(messages)) {
|
|
469
|
+
messages.forEach((msg, idx) => {
|
|
470
|
+
const role = msg.role || 'unknown';
|
|
471
|
+
const content = msg.content || '';
|
|
472
|
+
const roleColor = role === 'user' ? chalk.green : role === 'assistant' ? chalk.blue : chalk.yellow;
|
|
473
|
+
console.log(roleColor.bold(`[${role.toUpperCase()}]`));
|
|
474
|
+
if (content) {
|
|
475
|
+
const displayContent = content.length > 2000
|
|
476
|
+
? content.substring(0, 2000) + chalk.gray(`\n... (${content.length - 2000} more chars)`)
|
|
477
|
+
: content;
|
|
478
|
+
console.log(displayContent);
|
|
479
|
+
}
|
|
480
|
+
if (msg.tool_calls && msg.tool_calls.length > 0) {
|
|
481
|
+
console.log(chalk.yellow(` Tool calls: ${msg.tool_calls.map((tc) => tc.function?.name).join(', ')}`));
|
|
482
|
+
}
|
|
483
|
+
if (idx < messages.length - 1)
|
|
484
|
+
console.log();
|
|
485
|
+
});
|
|
486
|
+
}
|
|
487
|
+
console.log(chalk.cyan('─'.repeat(80)));
|
|
488
|
+
}
|
|
489
|
+
llmResponse(response, toolCalls) {
|
|
490
|
+
const jsonLogger = getJsonStreamLogger();
|
|
491
|
+
if (jsonLogger?.isActive()) {
|
|
492
|
+
jsonLogger.logDebug('[LLM] Response', { responseLength: response?.length, toolCallCount: toolCalls?.length });
|
|
493
|
+
}
|
|
494
|
+
if (!llmLogEnabled)
|
|
495
|
+
return;
|
|
496
|
+
const timestamp = this.getTimestamp();
|
|
497
|
+
console.log();
|
|
498
|
+
console.log(chalk.green('─'.repeat(80)));
|
|
499
|
+
console.log(chalk.green.bold(`[${timestamp}] 📥 LLM RESPONSE`));
|
|
500
|
+
console.log(chalk.green('─'.repeat(40)));
|
|
501
|
+
const displayResponse = response.length > 3000
|
|
502
|
+
? response.substring(0, 3000) + chalk.gray(`\n... (${response.length - 3000} more chars)`)
|
|
503
|
+
: response;
|
|
504
|
+
console.log(displayResponse);
|
|
505
|
+
if (toolCalls && Array.isArray(toolCalls) && toolCalls.length > 0) {
|
|
506
|
+
console.log();
|
|
507
|
+
console.log(chalk.yellow.bold('Tool Calls:'));
|
|
508
|
+
toolCalls.forEach((tc) => {
|
|
509
|
+
console.log(chalk.yellow(` - ${tc.function?.name}:`));
|
|
510
|
+
try {
|
|
511
|
+
const args = JSON.parse(tc.function?.arguments || '{}');
|
|
512
|
+
console.log(chalk.gray(JSON.stringify(args, null, 2)));
|
|
513
|
+
}
|
|
514
|
+
catch {
|
|
515
|
+
console.log(chalk.gray(tc.function?.arguments || '(no arguments)'));
|
|
516
|
+
}
|
|
517
|
+
});
|
|
518
|
+
}
|
|
519
|
+
console.log(chalk.green('─'.repeat(80)));
|
|
520
|
+
}
|
|
521
|
+
llmToolResult(toolName, result, success) {
|
|
522
|
+
const jsonLogger = getJsonStreamLogger();
|
|
523
|
+
if (jsonLogger?.isActive()) {
|
|
524
|
+
jsonLogger.logDebug(`[LLM] Tool Result: ${toolName}`, { success, resultLength: result?.length });
|
|
525
|
+
}
|
|
526
|
+
if (!llmLogEnabled)
|
|
527
|
+
return;
|
|
528
|
+
const timestamp = this.getTimestamp();
|
|
529
|
+
const color = success ? chalk.cyan : chalk.red;
|
|
530
|
+
console.log();
|
|
531
|
+
console.log(color('─'.repeat(80)));
|
|
532
|
+
console.log(color.bold(`[${timestamp}] 🔧 TOOL: ${toolName} ${success ? '✓' : '✗'}`));
|
|
533
|
+
console.log(color('─'.repeat(40)));
|
|
534
|
+
const displayResult = result.length > 1000
|
|
535
|
+
? result.substring(0, 1000) + chalk.gray(`\n... (${result.length - 1000} more chars)`)
|
|
536
|
+
: result;
|
|
537
|
+
console.log(displayResult);
|
|
538
|
+
console.log(color('─'.repeat(80)));
|
|
539
|
+
}
|
|
540
|
+
httpError(url, error) {
|
|
541
|
+
const jsonLogger = getJsonStreamLogger();
|
|
542
|
+
if (jsonLogger?.isActive()) {
|
|
543
|
+
jsonLogger.logError(error instanceof Error ? error : new Error(String(error)), `HTTP ${url}`);
|
|
544
|
+
}
|
|
545
|
+
if (this.level < LogLevel.DEBUG)
|
|
546
|
+
return;
|
|
547
|
+
const location = this.getCallLocation();
|
|
548
|
+
const timestamp = this.getTimestamp();
|
|
549
|
+
const prefix = this.getPrefix();
|
|
550
|
+
const pid = this.getPid();
|
|
551
|
+
const traceId = this.getTraceIdStr();
|
|
552
|
+
const loc = this.getLocation(location);
|
|
553
|
+
console.log(timestamp, prefix, pid, traceId, loc, chalk.red('✗ HTTP ERROR:'), url);
|
|
554
|
+
if (error instanceof Error) {
|
|
555
|
+
console.log(chalk.red(' Message:'), error.message);
|
|
556
|
+
}
|
|
557
|
+
else {
|
|
558
|
+
console.log(chalk.red(' Error:'), error);
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
httpStreamStart(method, url) {
|
|
562
|
+
const jsonLogger = getJsonStreamLogger();
|
|
563
|
+
if (jsonLogger?.isActive()) {
|
|
564
|
+
jsonLogger.logDebug(`HTTP Stream Start: ${method} ${url}`);
|
|
565
|
+
}
|
|
566
|
+
if (this.level < LogLevel.DEBUG)
|
|
567
|
+
return;
|
|
568
|
+
const location = this.getCallLocation();
|
|
569
|
+
const timestamp = this.getTimestamp();
|
|
570
|
+
const prefix = this.getPrefix();
|
|
571
|
+
const pid = this.getPid();
|
|
572
|
+
const traceId = this.getTraceIdStr();
|
|
573
|
+
const loc = this.getLocation(location);
|
|
574
|
+
console.log(timestamp, prefix, pid, traceId, loc, chalk.cyan('⇢ HTTP STREAM START:'), chalk.bold(method), url);
|
|
575
|
+
}
|
|
576
|
+
httpStreamChunk(data) {
|
|
577
|
+
const chunkSize = typeof data === 'string' ? data.length : JSON.stringify(data).length;
|
|
578
|
+
const jsonLogger = getJsonStreamLogger();
|
|
579
|
+
if (jsonLogger?.isActive()) {
|
|
580
|
+
jsonLogger.logDebug('[HTTP] Stream Chunk', { bytes: chunkSize });
|
|
581
|
+
}
|
|
582
|
+
if (this.level < LogLevel.VERBOSE)
|
|
583
|
+
return;
|
|
584
|
+
const location = this.getCallLocation();
|
|
585
|
+
const timestamp = this.getTimestamp();
|
|
586
|
+
const prefix = this.getPrefix();
|
|
587
|
+
const pid = this.getPid();
|
|
588
|
+
const traceId = this.getTraceIdStr();
|
|
589
|
+
const loc = this.getLocation(location);
|
|
590
|
+
console.log(timestamp, prefix, pid, traceId, loc, chalk.gray('⇨ HTTP STREAM CHUNK:'), `${chunkSize} bytes`);
|
|
591
|
+
}
|
|
592
|
+
httpStreamEnd(totalBytes, duration) {
|
|
593
|
+
const jsonLogger = getJsonStreamLogger();
|
|
594
|
+
if (jsonLogger?.isActive()) {
|
|
595
|
+
jsonLogger.logDebug(`HTTP Stream End`, { totalBytes, duration });
|
|
596
|
+
}
|
|
597
|
+
if (this.level < LogLevel.DEBUG)
|
|
598
|
+
return;
|
|
599
|
+
const location = this.getCallLocation();
|
|
600
|
+
const timestamp = this.getTimestamp();
|
|
601
|
+
const prefix = this.getPrefix();
|
|
602
|
+
const pid = this.getPid();
|
|
603
|
+
const traceId = this.getTraceIdStr();
|
|
604
|
+
const loc = this.getLocation(location);
|
|
605
|
+
console.log(timestamp, prefix, pid, traceId, loc, chalk.cyan('⇠ HTTP STREAM END:'), `${totalBytes} bytes in ${duration}ms`);
|
|
606
|
+
}
|
|
607
|
+
toolStart(name, args, reason) {
|
|
608
|
+
const jsonLogger = getJsonStreamLogger();
|
|
609
|
+
if (jsonLogger?.isActive()) {
|
|
610
|
+
jsonLogger.logToolStart(name, args, reason);
|
|
611
|
+
}
|
|
612
|
+
if (this.level < LogLevel.DEBUG)
|
|
613
|
+
return;
|
|
614
|
+
const location = this.getCallLocation();
|
|
615
|
+
const timestamp = this.getTimestamp();
|
|
616
|
+
const prefix = this.getPrefix();
|
|
617
|
+
const pid = this.getPid();
|
|
618
|
+
const traceId = this.getTraceIdStr();
|
|
619
|
+
const loc = this.getLocation(location);
|
|
620
|
+
console.log(timestamp, prefix, pid, traceId, loc, chalk.blue('🔧 TOOL START:'), chalk.bold(name));
|
|
621
|
+
if (reason) {
|
|
622
|
+
console.log(chalk.blue(' Reason:'), reason);
|
|
623
|
+
}
|
|
624
|
+
if (args && this.level >= LogLevel.VERBOSE) {
|
|
625
|
+
console.log(chalk.blue(' Args:'), JSON.stringify(args, null, 2));
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
toolSuccess(name, _args, result, duration) {
|
|
629
|
+
const jsonLogger = getJsonStreamLogger();
|
|
630
|
+
if (jsonLogger?.isActive()) {
|
|
631
|
+
jsonLogger.logToolEnd(name, true, result, undefined, duration);
|
|
632
|
+
}
|
|
633
|
+
if (this.level < LogLevel.DEBUG)
|
|
634
|
+
return;
|
|
635
|
+
const location = this.getCallLocation();
|
|
636
|
+
const timestamp = this.getTimestamp();
|
|
637
|
+
const prefix = this.getPrefix();
|
|
638
|
+
const pid = this.getPid();
|
|
639
|
+
const traceId = this.getTraceIdStr();
|
|
640
|
+
const loc = this.getLocation(location);
|
|
641
|
+
console.log(timestamp, prefix, pid, traceId, loc, chalk.green('✓ TOOL SUCCESS:'), chalk.bold(name), chalk.dim(`(${duration}ms)`));
|
|
642
|
+
if (result && this.level >= LogLevel.VERBOSE) {
|
|
643
|
+
console.log(chalk.green(' Result:'), this.formatValue(result));
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
toolError(name, args, error, duration) {
|
|
647
|
+
const jsonLogger = getJsonStreamLogger();
|
|
648
|
+
if (jsonLogger?.isActive()) {
|
|
649
|
+
jsonLogger.logToolEnd(name, false, undefined, error.message, duration);
|
|
650
|
+
}
|
|
651
|
+
if (this.level < LogLevel.ERROR)
|
|
652
|
+
return;
|
|
653
|
+
const location = this.getCallLocation();
|
|
654
|
+
const timestamp = this.getTimestamp();
|
|
655
|
+
const prefix = this.getPrefix();
|
|
656
|
+
const pid = this.getPid();
|
|
657
|
+
const traceId = this.getTraceIdStr();
|
|
658
|
+
const loc = this.getLocation(location);
|
|
659
|
+
console.log(timestamp, prefix, pid, traceId, loc, chalk.red('✗ TOOL ERROR:'), chalk.bold(name), chalk.dim(`(${duration}ms)`));
|
|
660
|
+
console.log(chalk.red(' Error:'), error.message);
|
|
661
|
+
if (args) {
|
|
662
|
+
console.log(chalk.red(' Args:'), JSON.stringify(args, null, 2));
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
userClick(element, context) {
|
|
666
|
+
const jsonLogger = getJsonStreamLogger();
|
|
667
|
+
if (jsonLogger?.isActive()) {
|
|
668
|
+
jsonLogger.logDebug(`[UI] User Click: ${element}`, context);
|
|
669
|
+
}
|
|
670
|
+
if (this.level < LogLevel.DEBUG)
|
|
671
|
+
return;
|
|
672
|
+
const location = this.getCallLocation();
|
|
673
|
+
const timestamp = this.getTimestamp();
|
|
674
|
+
const prefix = this.getPrefix();
|
|
675
|
+
const loc = this.getLocation(location);
|
|
676
|
+
console.log(timestamp, prefix, loc, chalk.yellow('👆 USER CLICK:'), element);
|
|
677
|
+
if (Object.keys(context).length > 0) {
|
|
678
|
+
console.log(chalk.yellow(' Context:'), JSON.stringify(context, null, 2));
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
userKeyboard(type, context) {
|
|
682
|
+
const jsonLogger = getJsonStreamLogger();
|
|
683
|
+
if (jsonLogger?.isActive()) {
|
|
684
|
+
jsonLogger.logDebug(`[UI] User Keyboard: ${type}`, context);
|
|
685
|
+
}
|
|
686
|
+
if (this.level < LogLevel.DEBUG)
|
|
687
|
+
return;
|
|
688
|
+
const location = this.getCallLocation();
|
|
689
|
+
const timestamp = this.getTimestamp();
|
|
690
|
+
const prefix = this.getPrefix();
|
|
691
|
+
const loc = this.getLocation(location);
|
|
692
|
+
console.log(timestamp, prefix, loc, chalk.yellow('⌨️ USER KEYBOARD:'), type);
|
|
693
|
+
if (Object.keys(context).length > 0) {
|
|
694
|
+
console.log(chalk.yellow(' Context:'), JSON.stringify(context, null, 2));
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
userScroll(context) {
|
|
698
|
+
const jsonLogger = getJsonStreamLogger();
|
|
699
|
+
if (jsonLogger?.isActive()) {
|
|
700
|
+
jsonLogger.logDebug('[UI] User Scroll', context);
|
|
701
|
+
}
|
|
702
|
+
if (this.level < LogLevel.VERBOSE)
|
|
703
|
+
return;
|
|
704
|
+
const location = this.getCallLocation();
|
|
705
|
+
const timestamp = this.getTimestamp();
|
|
706
|
+
const prefix = this.getPrefix();
|
|
707
|
+
const loc = this.getLocation(location);
|
|
708
|
+
console.log(timestamp, prefix, loc, chalk.gray('📜 USER SCROLL'));
|
|
709
|
+
if (Object.keys(context).length > 0) {
|
|
710
|
+
console.log(chalk.gray(' Context:'), JSON.stringify(context, null, 2));
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
userDragStart(element, context) {
|
|
714
|
+
const jsonLogger = getJsonStreamLogger();
|
|
715
|
+
if (jsonLogger?.isActive()) {
|
|
716
|
+
jsonLogger.logDebug(`[UI] User Drag Start: ${element}`, context);
|
|
717
|
+
}
|
|
718
|
+
if (this.level < LogLevel.DEBUG)
|
|
719
|
+
return;
|
|
720
|
+
const location = this.getCallLocation();
|
|
721
|
+
const timestamp = this.getTimestamp();
|
|
722
|
+
const prefix = this.getPrefix();
|
|
723
|
+
const loc = this.getLocation(location);
|
|
724
|
+
console.log(timestamp, prefix, loc, chalk.yellow('🖱️ USER DRAG START:'), element);
|
|
725
|
+
if (Object.keys(context).length > 0) {
|
|
726
|
+
console.log(chalk.yellow(' Context:'), JSON.stringify(context, null, 2));
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
userDragEnd(element, context) {
|
|
730
|
+
const jsonLogger = getJsonStreamLogger();
|
|
731
|
+
if (jsonLogger?.isActive()) {
|
|
732
|
+
jsonLogger.logDebug(`[UI] User Drag End: ${element}`, context);
|
|
733
|
+
}
|
|
734
|
+
if (this.level < LogLevel.DEBUG)
|
|
735
|
+
return;
|
|
736
|
+
const location = this.getCallLocation();
|
|
737
|
+
const timestamp = this.getTimestamp();
|
|
738
|
+
const prefix = this.getPrefix();
|
|
739
|
+
const loc = this.getLocation(location);
|
|
740
|
+
console.log(timestamp, prefix, loc, chalk.yellow('🖱️ USER DRAG END:'), element);
|
|
741
|
+
if (Object.keys(context).length > 0) {
|
|
742
|
+
console.log(chalk.yellow(' Context:'), JSON.stringify(context, null, 2));
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
componentMount(name, context) {
|
|
746
|
+
const jsonLogger = getJsonStreamLogger();
|
|
747
|
+
if (jsonLogger?.isActive()) {
|
|
748
|
+
jsonLogger.logDebug(`[COMPONENT] Mount: ${name}`, context);
|
|
749
|
+
}
|
|
750
|
+
if (this.level < LogLevel.DEBUG)
|
|
751
|
+
return;
|
|
752
|
+
const location = this.getCallLocation();
|
|
753
|
+
const timestamp = this.getTimestamp();
|
|
754
|
+
const prefix = this.getPrefix();
|
|
755
|
+
const loc = this.getLocation(location);
|
|
756
|
+
console.log(timestamp, prefix, loc, chalk.green('📦 COMPONENT MOUNT:'), name);
|
|
757
|
+
if (Object.keys(context).length > 0) {
|
|
758
|
+
console.log(chalk.green(' Context:'), JSON.stringify(context, null, 2));
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
componentUnmount(name, context) {
|
|
762
|
+
const jsonLogger = getJsonStreamLogger();
|
|
763
|
+
if (jsonLogger?.isActive()) {
|
|
764
|
+
jsonLogger.logDebug(`[COMPONENT] Unmount: ${name}`, context);
|
|
765
|
+
}
|
|
766
|
+
if (this.level < LogLevel.DEBUG)
|
|
767
|
+
return;
|
|
768
|
+
const location = this.getCallLocation();
|
|
769
|
+
const timestamp = this.getTimestamp();
|
|
770
|
+
const prefix = this.getPrefix();
|
|
771
|
+
const loc = this.getLocation(location);
|
|
772
|
+
console.log(timestamp, prefix, loc, chalk.red('📦 COMPONENT UNMOUNT:'), name);
|
|
773
|
+
if (Object.keys(context).length > 0) {
|
|
774
|
+
console.log(chalk.red(' Context:'), JSON.stringify(context, null, 2));
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
componentRender(name, context) {
|
|
778
|
+
const jsonLogger = getJsonStreamLogger();
|
|
779
|
+
if (jsonLogger?.isActive()) {
|
|
780
|
+
jsonLogger.logDebug(`[COMPONENT] Render: ${name}`, context);
|
|
781
|
+
}
|
|
782
|
+
if (this.level < LogLevel.VERBOSE)
|
|
783
|
+
return;
|
|
784
|
+
const location = this.getCallLocation();
|
|
785
|
+
const timestamp = this.getTimestamp();
|
|
786
|
+
const prefix = this.getPrefix();
|
|
787
|
+
const loc = this.getLocation(location);
|
|
788
|
+
console.log(timestamp, prefix, loc, chalk.blue('📦 COMPONENT RENDER:'), name);
|
|
789
|
+
if (Object.keys(context).length > 0) {
|
|
790
|
+
console.log(chalk.blue(' Context:'), JSON.stringify(context, null, 2));
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
componentRenderComplete(name, context) {
|
|
794
|
+
const jsonLogger = getJsonStreamLogger();
|
|
795
|
+
if (jsonLogger?.isActive()) {
|
|
796
|
+
jsonLogger.logDebug(`[COMPONENT] Render Complete: ${name}`, context);
|
|
797
|
+
}
|
|
798
|
+
if (this.level < LogLevel.VERBOSE)
|
|
799
|
+
return;
|
|
800
|
+
const location = this.getCallLocation();
|
|
801
|
+
const timestamp = this.getTimestamp();
|
|
802
|
+
const prefix = this.getPrefix();
|
|
803
|
+
const loc = this.getLocation(location);
|
|
804
|
+
console.log(timestamp, prefix, loc, chalk.green('✓ COMPONENT RENDER COMPLETE:'), name);
|
|
805
|
+
if (Object.keys(context).length > 0) {
|
|
806
|
+
console.log(chalk.green(' Context:'), JSON.stringify(context, null, 2));
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
componentStateChange(name, field, context) {
|
|
810
|
+
const jsonLogger = getJsonStreamLogger();
|
|
811
|
+
if (jsonLogger?.isActive()) {
|
|
812
|
+
jsonLogger.logDebug(`[COMPONENT] State Change: ${name}.${field}`, context);
|
|
813
|
+
}
|
|
814
|
+
if (this.level < LogLevel.DEBUG)
|
|
815
|
+
return;
|
|
816
|
+
const location = this.getCallLocation();
|
|
817
|
+
const timestamp = this.getTimestamp();
|
|
818
|
+
const prefix = this.getPrefix();
|
|
819
|
+
const loc = this.getLocation(location);
|
|
820
|
+
console.log(timestamp, prefix, loc, chalk.yellow('🔄 COMPONENT STATE:'), `${name}.${field}`);
|
|
821
|
+
if (Object.keys(context).length > 0) {
|
|
822
|
+
console.log(chalk.yellow(' Context:'), JSON.stringify(context, null, 2));
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
screenChange(to, context) {
|
|
826
|
+
const jsonLogger = getJsonStreamLogger();
|
|
827
|
+
if (jsonLogger?.isActive()) {
|
|
828
|
+
jsonLogger.logDebug(`[SCREEN] Change: ${to}`, context);
|
|
829
|
+
}
|
|
830
|
+
if (this.level < LogLevel.DEBUG)
|
|
831
|
+
return;
|
|
832
|
+
const location = this.getCallLocation();
|
|
833
|
+
const timestamp = this.getTimestamp();
|
|
834
|
+
const prefix = this.getPrefix();
|
|
835
|
+
const loc = this.getLocation(location);
|
|
836
|
+
console.log(timestamp, prefix, loc, chalk.magenta('📱 SCREEN CHANGE:'), to);
|
|
837
|
+
if (Object.keys(context).length > 0) {
|
|
838
|
+
console.log(chalk.magenta(' Context:'), JSON.stringify(context, null, 2));
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
tabChange(container, context) {
|
|
842
|
+
const jsonLogger = getJsonStreamLogger();
|
|
843
|
+
if (jsonLogger?.isActive()) {
|
|
844
|
+
jsonLogger.logDebug(`[TAB] Change: ${container}`, context);
|
|
845
|
+
}
|
|
846
|
+
if (this.level < LogLevel.DEBUG)
|
|
847
|
+
return;
|
|
848
|
+
const location = this.getCallLocation();
|
|
849
|
+
const timestamp = this.getTimestamp();
|
|
850
|
+
const prefix = this.getPrefix();
|
|
851
|
+
const loc = this.getLocation(location);
|
|
852
|
+
console.log(timestamp, prefix, loc, chalk.magenta('🗂️ TAB CHANGE:'), container);
|
|
853
|
+
if (Object.keys(context).length > 0) {
|
|
854
|
+
console.log(chalk.magenta(' Context:'), JSON.stringify(context, null, 2));
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
routeChange(context) {
|
|
858
|
+
const jsonLogger = getJsonStreamLogger();
|
|
859
|
+
if (jsonLogger?.isActive()) {
|
|
860
|
+
jsonLogger.logDebug(`[ROUTE] Change`, context);
|
|
861
|
+
}
|
|
862
|
+
if (this.level < LogLevel.DEBUG)
|
|
863
|
+
return;
|
|
864
|
+
const location = this.getCallLocation();
|
|
865
|
+
const timestamp = this.getTimestamp();
|
|
866
|
+
const prefix = this.getPrefix();
|
|
867
|
+
const loc = this.getLocation(location);
|
|
868
|
+
console.log(timestamp, prefix, loc, chalk.magenta('🛤️ ROUTE CHANGE'));
|
|
869
|
+
if (Object.keys(context).length > 0) {
|
|
870
|
+
console.log(chalk.magenta(' Context:'), JSON.stringify(context, null, 2));
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
formStart(formId, context) {
|
|
874
|
+
const jsonLogger = getJsonStreamLogger();
|
|
875
|
+
if (jsonLogger?.isActive()) {
|
|
876
|
+
jsonLogger.logDebug(`[FORM] Start: ${formId}`, context);
|
|
877
|
+
}
|
|
878
|
+
if (this.level < LogLevel.DEBUG)
|
|
879
|
+
return;
|
|
880
|
+
const location = this.getCallLocation();
|
|
881
|
+
const timestamp = this.getTimestamp();
|
|
882
|
+
const prefix = this.getPrefix();
|
|
883
|
+
const loc = this.getLocation(location);
|
|
884
|
+
console.log(timestamp, prefix, loc, chalk.blue('📝 FORM START:'), formId);
|
|
885
|
+
if (Object.keys(context).length > 0) {
|
|
886
|
+
console.log(chalk.blue(' Context:'), JSON.stringify(context, null, 2));
|
|
887
|
+
}
|
|
888
|
+
}
|
|
889
|
+
formSubmit(formId, context) {
|
|
890
|
+
const jsonLogger = getJsonStreamLogger();
|
|
891
|
+
if (jsonLogger?.isActive()) {
|
|
892
|
+
jsonLogger.logDebug(`[FORM] Submit: ${formId}`, context);
|
|
893
|
+
}
|
|
894
|
+
if (this.level < LogLevel.DEBUG)
|
|
895
|
+
return;
|
|
896
|
+
const location = this.getCallLocation();
|
|
897
|
+
const timestamp = this.getTimestamp();
|
|
898
|
+
const prefix = this.getPrefix();
|
|
899
|
+
const loc = this.getLocation(location);
|
|
900
|
+
console.log(timestamp, prefix, loc, chalk.blue('📤 FORM SUBMIT:'), formId);
|
|
901
|
+
if (Object.keys(context).length > 0) {
|
|
902
|
+
console.log(chalk.blue(' Context:'), JSON.stringify(context, null, 2));
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
formResult(formId, context) {
|
|
906
|
+
const jsonLogger = getJsonStreamLogger();
|
|
907
|
+
if (jsonLogger?.isActive()) {
|
|
908
|
+
jsonLogger.logDebug(`[FORM] Result: ${formId}`, context);
|
|
909
|
+
}
|
|
910
|
+
if (this.level < LogLevel.DEBUG)
|
|
911
|
+
return;
|
|
912
|
+
const location = this.getCallLocation();
|
|
913
|
+
const timestamp = this.getTimestamp();
|
|
914
|
+
const prefix = this.getPrefix();
|
|
915
|
+
const loc = this.getLocation(location);
|
|
916
|
+
console.log(timestamp, prefix, loc, chalk.green('✓ FORM RESULT:'), formId);
|
|
917
|
+
if (Object.keys(context).length > 0) {
|
|
918
|
+
console.log(chalk.green(' Context:'), JSON.stringify(context, null, 2));
|
|
919
|
+
}
|
|
920
|
+
}
|
|
921
|
+
formError(formId, context) {
|
|
922
|
+
const jsonLogger = getJsonStreamLogger();
|
|
923
|
+
if (jsonLogger?.isActive()) {
|
|
924
|
+
jsonLogger.logDebug(`[FORM] Error: ${formId}`, context);
|
|
925
|
+
}
|
|
926
|
+
if (this.level < LogLevel.DEBUG)
|
|
927
|
+
return;
|
|
928
|
+
const location = this.getCallLocation();
|
|
929
|
+
const timestamp = this.getTimestamp();
|
|
930
|
+
const prefix = this.getPrefix();
|
|
931
|
+
const loc = this.getLocation(location);
|
|
932
|
+
console.log(timestamp, prefix, loc, chalk.red('✗ FORM ERROR:'), formId);
|
|
933
|
+
if (Object.keys(context).length > 0) {
|
|
934
|
+
console.log(chalk.red(' Context:'), JSON.stringify(context, null, 2));
|
|
935
|
+
}
|
|
936
|
+
}
|
|
937
|
+
fieldChange(formId, field, context) {
|
|
938
|
+
const jsonLogger = getJsonStreamLogger();
|
|
939
|
+
if (jsonLogger?.isActive()) {
|
|
940
|
+
jsonLogger.logDebug(`[FORM] Field Change: ${formId}.${field}`, context);
|
|
941
|
+
}
|
|
942
|
+
if (this.level < LogLevel.VERBOSE)
|
|
943
|
+
return;
|
|
944
|
+
const location = this.getCallLocation();
|
|
945
|
+
const timestamp = this.getTimestamp();
|
|
946
|
+
const prefix = this.getPrefix();
|
|
947
|
+
const loc = this.getLocation(location);
|
|
948
|
+
console.log(timestamp, prefix, loc, chalk.gray('📝 FIELD CHANGE:'), `${formId}.${field}`);
|
|
949
|
+
if (Object.keys(context).length > 0) {
|
|
950
|
+
console.log(chalk.gray(' Context:'), JSON.stringify(context, null, 2));
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
fieldValidation(formId, field, context) {
|
|
954
|
+
const jsonLogger = getJsonStreamLogger();
|
|
955
|
+
if (jsonLogger?.isActive()) {
|
|
956
|
+
jsonLogger.logDebug(`[FORM] Field Validation: ${formId}.${field}`, context);
|
|
957
|
+
}
|
|
958
|
+
if (this.level < LogLevel.DEBUG)
|
|
959
|
+
return;
|
|
960
|
+
const location = this.getCallLocation();
|
|
961
|
+
const timestamp = this.getTimestamp();
|
|
962
|
+
const prefix = this.getPrefix();
|
|
963
|
+
const loc = this.getLocation(location);
|
|
964
|
+
console.log(timestamp, prefix, loc, chalk.yellow('✓ FIELD VALIDATION:'), `${formId}.${field}`);
|
|
965
|
+
if (Object.keys(context).length > 0) {
|
|
966
|
+
console.log(chalk.yellow(' Context:'), JSON.stringify(context, null, 2));
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
modalOpen(id, context) {
|
|
970
|
+
const jsonLogger = getJsonStreamLogger();
|
|
971
|
+
if (jsonLogger?.isActive()) {
|
|
972
|
+
jsonLogger.logDebug(`[MODAL] Open: ${id}`, context);
|
|
973
|
+
}
|
|
974
|
+
if (this.level < LogLevel.DEBUG)
|
|
975
|
+
return;
|
|
976
|
+
const location = this.getCallLocation();
|
|
977
|
+
const timestamp = this.getTimestamp();
|
|
978
|
+
const prefix = this.getPrefix();
|
|
979
|
+
const loc = this.getLocation(location);
|
|
980
|
+
console.log(timestamp, prefix, loc, chalk.cyan('📭 MODAL OPEN:'), id);
|
|
981
|
+
if (Object.keys(context).length > 0) {
|
|
982
|
+
console.log(chalk.cyan(' Context:'), JSON.stringify(context, null, 2));
|
|
983
|
+
}
|
|
984
|
+
}
|
|
985
|
+
modalClose(id, context) {
|
|
986
|
+
const jsonLogger = getJsonStreamLogger();
|
|
987
|
+
if (jsonLogger?.isActive()) {
|
|
988
|
+
jsonLogger.logDebug(`[MODAL] Close: ${id}`, context);
|
|
989
|
+
}
|
|
990
|
+
if (this.level < LogLevel.DEBUG)
|
|
991
|
+
return;
|
|
992
|
+
const location = this.getCallLocation();
|
|
993
|
+
const timestamp = this.getTimestamp();
|
|
994
|
+
const prefix = this.getPrefix();
|
|
995
|
+
const loc = this.getLocation(location);
|
|
996
|
+
console.log(timestamp, prefix, loc, chalk.cyan('📪 MODAL CLOSE:'), id);
|
|
997
|
+
if (Object.keys(context).length > 0) {
|
|
998
|
+
console.log(chalk.cyan(' Context:'), JSON.stringify(context, null, 2));
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
dialogShow(type, context) {
|
|
1002
|
+
const jsonLogger = getJsonStreamLogger();
|
|
1003
|
+
if (jsonLogger?.isActive()) {
|
|
1004
|
+
jsonLogger.logDebug(`[DIALOG] Show: ${type}`, context);
|
|
1005
|
+
}
|
|
1006
|
+
if (this.level < LogLevel.DEBUG)
|
|
1007
|
+
return;
|
|
1008
|
+
const location = this.getCallLocation();
|
|
1009
|
+
const timestamp = this.getTimestamp();
|
|
1010
|
+
const prefix = this.getPrefix();
|
|
1011
|
+
const loc = this.getLocation(location);
|
|
1012
|
+
console.log(timestamp, prefix, loc, chalk.cyan('💬 DIALOG SHOW:'), type);
|
|
1013
|
+
if (Object.keys(context).length > 0) {
|
|
1014
|
+
console.log(chalk.cyan(' Context:'), JSON.stringify(context, null, 2));
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
dialogResult(type, context) {
|
|
1018
|
+
const jsonLogger = getJsonStreamLogger();
|
|
1019
|
+
if (jsonLogger?.isActive()) {
|
|
1020
|
+
jsonLogger.logDebug(`[DIALOG] Result: ${type}`, context);
|
|
1021
|
+
}
|
|
1022
|
+
if (this.level < LogLevel.DEBUG)
|
|
1023
|
+
return;
|
|
1024
|
+
const location = this.getCallLocation();
|
|
1025
|
+
const timestamp = this.getTimestamp();
|
|
1026
|
+
const prefix = this.getPrefix();
|
|
1027
|
+
const loc = this.getLocation(location);
|
|
1028
|
+
console.log(timestamp, prefix, loc, chalk.cyan('💬 DIALOG RESULT:'), type);
|
|
1029
|
+
if (Object.keys(context).length > 0) {
|
|
1030
|
+
console.log(chalk.cyan(' Context:'), JSON.stringify(context, null, 2));
|
|
1031
|
+
}
|
|
1032
|
+
}
|
|
1033
|
+
toastShow(context) {
|
|
1034
|
+
const jsonLogger = getJsonStreamLogger();
|
|
1035
|
+
if (jsonLogger?.isActive()) {
|
|
1036
|
+
jsonLogger.logDebug(`[TOAST] Show`, context);
|
|
1037
|
+
}
|
|
1038
|
+
if (this.level < LogLevel.DEBUG)
|
|
1039
|
+
return;
|
|
1040
|
+
const location = this.getCallLocation();
|
|
1041
|
+
const timestamp = this.getTimestamp();
|
|
1042
|
+
const prefix = this.getPrefix();
|
|
1043
|
+
const loc = this.getLocation(location);
|
|
1044
|
+
console.log(timestamp, prefix, loc, chalk.yellow('🔔 TOAST SHOW'));
|
|
1045
|
+
if (Object.keys(context).length > 0) {
|
|
1046
|
+
console.log(chalk.yellow(' Context:'), JSON.stringify(context, null, 2));
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
toastDismiss(context) {
|
|
1050
|
+
const jsonLogger = getJsonStreamLogger();
|
|
1051
|
+
if (jsonLogger?.isActive()) {
|
|
1052
|
+
jsonLogger.logDebug(`[TOAST] Dismiss`, context);
|
|
1053
|
+
}
|
|
1054
|
+
if (this.level < LogLevel.DEBUG)
|
|
1055
|
+
return;
|
|
1056
|
+
const location = this.getCallLocation();
|
|
1057
|
+
const timestamp = this.getTimestamp();
|
|
1058
|
+
const prefix = this.getPrefix();
|
|
1059
|
+
const loc = this.getLocation(location);
|
|
1060
|
+
console.log(timestamp, prefix, loc, chalk.gray('🔕 TOAST DISMISS'));
|
|
1061
|
+
if (Object.keys(context).length > 0) {
|
|
1062
|
+
console.log(chalk.gray(' Context:'), JSON.stringify(context, null, 2));
|
|
1063
|
+
}
|
|
1064
|
+
}
|
|
1065
|
+
loadingStart(id, context) {
|
|
1066
|
+
const jsonLogger = getJsonStreamLogger();
|
|
1067
|
+
if (jsonLogger?.isActive()) {
|
|
1068
|
+
jsonLogger.logDebug(`[LOADING] Start: ${id}`, context);
|
|
1069
|
+
}
|
|
1070
|
+
if (this.level < LogLevel.DEBUG)
|
|
1071
|
+
return;
|
|
1072
|
+
const location = this.getCallLocation();
|
|
1073
|
+
const timestamp = this.getTimestamp();
|
|
1074
|
+
const prefix = this.getPrefix();
|
|
1075
|
+
const loc = this.getLocation(location);
|
|
1076
|
+
console.log(timestamp, prefix, loc, chalk.blue('⏳ LOADING START:'), id);
|
|
1077
|
+
if (Object.keys(context).length > 0) {
|
|
1078
|
+
console.log(chalk.blue(' Context:'), JSON.stringify(context, null, 2));
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1081
|
+
loadingEnd(id, context) {
|
|
1082
|
+
const jsonLogger = getJsonStreamLogger();
|
|
1083
|
+
if (jsonLogger?.isActive()) {
|
|
1084
|
+
jsonLogger.logDebug(`[LOADING] End: ${id}`, context);
|
|
1085
|
+
}
|
|
1086
|
+
if (this.level < LogLevel.DEBUG)
|
|
1087
|
+
return;
|
|
1088
|
+
const location = this.getCallLocation();
|
|
1089
|
+
const timestamp = this.getTimestamp();
|
|
1090
|
+
const prefix = this.getPrefix();
|
|
1091
|
+
const loc = this.getLocation(location);
|
|
1092
|
+
console.log(timestamp, prefix, loc, chalk.green('✓ LOADING END:'), id);
|
|
1093
|
+
if (Object.keys(context).length > 0) {
|
|
1094
|
+
console.log(chalk.green(' Context:'), JSON.stringify(context, null, 2));
|
|
1095
|
+
}
|
|
1096
|
+
}
|
|
1097
|
+
loadingError(id, context) {
|
|
1098
|
+
const jsonLogger = getJsonStreamLogger();
|
|
1099
|
+
if (jsonLogger?.isActive()) {
|
|
1100
|
+
jsonLogger.logDebug(`[LOADING] Error: ${id}`, context);
|
|
1101
|
+
}
|
|
1102
|
+
if (this.level < LogLevel.DEBUG)
|
|
1103
|
+
return;
|
|
1104
|
+
const location = this.getCallLocation();
|
|
1105
|
+
const timestamp = this.getTimestamp();
|
|
1106
|
+
const prefix = this.getPrefix();
|
|
1107
|
+
const loc = this.getLocation(location);
|
|
1108
|
+
console.log(timestamp, prefix, loc, chalk.red('✗ LOADING ERROR:'), id);
|
|
1109
|
+
if (Object.keys(context).length > 0) {
|
|
1110
|
+
console.log(chalk.red(' Context:'), JSON.stringify(context, null, 2));
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
1113
|
+
skeletonShow(id, context) {
|
|
1114
|
+
const jsonLogger = getJsonStreamLogger();
|
|
1115
|
+
if (jsonLogger?.isActive()) {
|
|
1116
|
+
jsonLogger.logDebug(`[UI] Skeleton Show: ${id}`, context);
|
|
1117
|
+
}
|
|
1118
|
+
if (this.level < LogLevel.VERBOSE)
|
|
1119
|
+
return;
|
|
1120
|
+
const location = this.getCallLocation();
|
|
1121
|
+
const timestamp = this.getTimestamp();
|
|
1122
|
+
const prefix = this.getPrefix();
|
|
1123
|
+
const loc = this.getLocation(location);
|
|
1124
|
+
console.log(timestamp, prefix, loc, chalk.gray('💀 SKELETON SHOW:'), id);
|
|
1125
|
+
if (Object.keys(context).length > 0) {
|
|
1126
|
+
console.log(chalk.gray(' Context:'), JSON.stringify(context, null, 2));
|
|
1127
|
+
}
|
|
1128
|
+
}
|
|
1129
|
+
skeletonHide(id, context) {
|
|
1130
|
+
const jsonLogger = getJsonStreamLogger();
|
|
1131
|
+
if (jsonLogger?.isActive()) {
|
|
1132
|
+
jsonLogger.logDebug(`[UI] Skeleton Hide: ${id}`, context);
|
|
1133
|
+
}
|
|
1134
|
+
if (this.level < LogLevel.VERBOSE)
|
|
1135
|
+
return;
|
|
1136
|
+
const location = this.getCallLocation();
|
|
1137
|
+
const timestamp = this.getTimestamp();
|
|
1138
|
+
const prefix = this.getPrefix();
|
|
1139
|
+
const loc = this.getLocation(location);
|
|
1140
|
+
console.log(timestamp, prefix, loc, chalk.gray('💀 SKELETON HIDE:'), id);
|
|
1141
|
+
if (Object.keys(context).length > 0) {
|
|
1142
|
+
console.log(chalk.gray(' Context:'), JSON.stringify(context, null, 2));
|
|
1143
|
+
}
|
|
1144
|
+
}
|
|
1145
|
+
progressStart(id, context) {
|
|
1146
|
+
const jsonLogger = getJsonStreamLogger();
|
|
1147
|
+
if (jsonLogger?.isActive()) {
|
|
1148
|
+
jsonLogger.logDebug(`[PROGRESS] Start: ${id}`, context);
|
|
1149
|
+
}
|
|
1150
|
+
if (this.level < LogLevel.DEBUG)
|
|
1151
|
+
return;
|
|
1152
|
+
const location = this.getCallLocation();
|
|
1153
|
+
const timestamp = this.getTimestamp();
|
|
1154
|
+
const prefix = this.getPrefix();
|
|
1155
|
+
const loc = this.getLocation(location);
|
|
1156
|
+
console.log(timestamp, prefix, loc, chalk.blue('📊 PROGRESS START:'), id);
|
|
1157
|
+
if (Object.keys(context).length > 0) {
|
|
1158
|
+
console.log(chalk.blue(' Context:'), JSON.stringify(context, null, 2));
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
1161
|
+
progressUpdate(id, context) {
|
|
1162
|
+
const jsonLogger = getJsonStreamLogger();
|
|
1163
|
+
if (jsonLogger?.isActive()) {
|
|
1164
|
+
jsonLogger.logDebug(`[PROGRESS] Update: ${id}`, context);
|
|
1165
|
+
}
|
|
1166
|
+
if (this.level < LogLevel.VERBOSE)
|
|
1167
|
+
return;
|
|
1168
|
+
const location = this.getCallLocation();
|
|
1169
|
+
const timestamp = this.getTimestamp();
|
|
1170
|
+
const prefix = this.getPrefix();
|
|
1171
|
+
const loc = this.getLocation(location);
|
|
1172
|
+
console.log(timestamp, prefix, loc, chalk.blue('📊 PROGRESS UPDATE:'), id);
|
|
1173
|
+
if (Object.keys(context).length > 0) {
|
|
1174
|
+
console.log(chalk.blue(' Context:'), JSON.stringify(context, null, 2));
|
|
1175
|
+
}
|
|
1176
|
+
}
|
|
1177
|
+
progressComplete(id, context) {
|
|
1178
|
+
const jsonLogger = getJsonStreamLogger();
|
|
1179
|
+
if (jsonLogger?.isActive()) {
|
|
1180
|
+
jsonLogger.logDebug(`[PROGRESS] Complete: ${id}`, context);
|
|
1181
|
+
}
|
|
1182
|
+
if (this.level < LogLevel.DEBUG)
|
|
1183
|
+
return;
|
|
1184
|
+
const location = this.getCallLocation();
|
|
1185
|
+
const timestamp = this.getTimestamp();
|
|
1186
|
+
const prefix = this.getPrefix();
|
|
1187
|
+
const loc = this.getLocation(location);
|
|
1188
|
+
console.log(timestamp, prefix, loc, chalk.green('✓ PROGRESS COMPLETE:'), id);
|
|
1189
|
+
if (Object.keys(context).length > 0) {
|
|
1190
|
+
console.log(chalk.green(' Context:'), JSON.stringify(context, null, 2));
|
|
1191
|
+
}
|
|
1192
|
+
}
|
|
1193
|
+
progressError(id, context) {
|
|
1194
|
+
const jsonLogger = getJsonStreamLogger();
|
|
1195
|
+
if (jsonLogger?.isActive()) {
|
|
1196
|
+
jsonLogger.logDebug(`[PROGRESS] Error: ${id}`, context);
|
|
1197
|
+
}
|
|
1198
|
+
if (this.level < LogLevel.DEBUG)
|
|
1199
|
+
return;
|
|
1200
|
+
const location = this.getCallLocation();
|
|
1201
|
+
const timestamp = this.getTimestamp();
|
|
1202
|
+
const prefix = this.getPrefix();
|
|
1203
|
+
const loc = this.getLocation(location);
|
|
1204
|
+
console.log(timestamp, prefix, loc, chalk.red('✗ PROGRESS ERROR:'), id);
|
|
1205
|
+
if (Object.keys(context).length > 0) {
|
|
1206
|
+
console.log(chalk.red(' Context:'), JSON.stringify(context, null, 2));
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1209
|
+
animationStart(name, context) {
|
|
1210
|
+
const jsonLogger = getJsonStreamLogger();
|
|
1211
|
+
if (jsonLogger?.isActive()) {
|
|
1212
|
+
jsonLogger.logDebug(`[UI] Animation Start: ${name}`, context);
|
|
1213
|
+
}
|
|
1214
|
+
if (this.level < LogLevel.VERBOSE)
|
|
1215
|
+
return;
|
|
1216
|
+
const location = this.getCallLocation();
|
|
1217
|
+
const timestamp = this.getTimestamp();
|
|
1218
|
+
const prefix = this.getPrefix();
|
|
1219
|
+
const loc = this.getLocation(location);
|
|
1220
|
+
console.log(timestamp, prefix, loc, chalk.magenta('🎬 ANIMATION START:'), name);
|
|
1221
|
+
if (Object.keys(context).length > 0) {
|
|
1222
|
+
console.log(chalk.magenta(' Context:'), JSON.stringify(context, null, 2));
|
|
1223
|
+
}
|
|
1224
|
+
}
|
|
1225
|
+
animationEnd(name, context) {
|
|
1226
|
+
const jsonLogger = getJsonStreamLogger();
|
|
1227
|
+
if (jsonLogger?.isActive()) {
|
|
1228
|
+
jsonLogger.logDebug(`[UI] Animation End: ${name}`, context);
|
|
1229
|
+
}
|
|
1230
|
+
if (this.level < LogLevel.VERBOSE)
|
|
1231
|
+
return;
|
|
1232
|
+
const location = this.getCallLocation();
|
|
1233
|
+
const timestamp = this.getTimestamp();
|
|
1234
|
+
const prefix = this.getPrefix();
|
|
1235
|
+
const loc = this.getLocation(location);
|
|
1236
|
+
console.log(timestamp, prefix, loc, chalk.magenta('🎬 ANIMATION END:'), name);
|
|
1237
|
+
if (Object.keys(context).length > 0) {
|
|
1238
|
+
console.log(chalk.magenta(' Context:'), JSON.stringify(context, null, 2));
|
|
1239
|
+
}
|
|
1240
|
+
}
|
|
1241
|
+
transitionStart(name, context) {
|
|
1242
|
+
const jsonLogger = getJsonStreamLogger();
|
|
1243
|
+
if (jsonLogger?.isActive()) {
|
|
1244
|
+
jsonLogger.logDebug(`[UI] Transition Start: ${name}`, context);
|
|
1245
|
+
}
|
|
1246
|
+
if (this.level < LogLevel.VERBOSE)
|
|
1247
|
+
return;
|
|
1248
|
+
const location = this.getCallLocation();
|
|
1249
|
+
const timestamp = this.getTimestamp();
|
|
1250
|
+
const prefix = this.getPrefix();
|
|
1251
|
+
const loc = this.getLocation(location);
|
|
1252
|
+
console.log(timestamp, prefix, loc, chalk.magenta('🔀 TRANSITION START:'), name);
|
|
1253
|
+
if (Object.keys(context).length > 0) {
|
|
1254
|
+
console.log(chalk.magenta(' Context:'), JSON.stringify(context, null, 2));
|
|
1255
|
+
}
|
|
1256
|
+
}
|
|
1257
|
+
transitionEnd(name, context) {
|
|
1258
|
+
const jsonLogger = getJsonStreamLogger();
|
|
1259
|
+
if (jsonLogger?.isActive()) {
|
|
1260
|
+
jsonLogger.logDebug(`[UI] Transition End: ${name}`, context);
|
|
1261
|
+
}
|
|
1262
|
+
if (this.level < LogLevel.VERBOSE)
|
|
1263
|
+
return;
|
|
1264
|
+
const location = this.getCallLocation();
|
|
1265
|
+
const timestamp = this.getTimestamp();
|
|
1266
|
+
const prefix = this.getPrefix();
|
|
1267
|
+
const loc = this.getLocation(location);
|
|
1268
|
+
console.log(timestamp, prefix, loc, chalk.magenta('🔀 TRANSITION END:'), name);
|
|
1269
|
+
if (Object.keys(context).length > 0) {
|
|
1270
|
+
console.log(chalk.magenta(' Context:'), JSON.stringify(context, null, 2));
|
|
1271
|
+
}
|
|
1272
|
+
}
|
|
1273
|
+
hoverEnter(element, context) {
|
|
1274
|
+
const jsonLogger = getJsonStreamLogger();
|
|
1275
|
+
if (jsonLogger?.isActive()) {
|
|
1276
|
+
jsonLogger.logDebug(`[UI] Hover Enter: ${element}`, context);
|
|
1277
|
+
}
|
|
1278
|
+
if (this.level < LogLevel.VERBOSE)
|
|
1279
|
+
return;
|
|
1280
|
+
const location = this.getCallLocation();
|
|
1281
|
+
const timestamp = this.getTimestamp();
|
|
1282
|
+
const prefix = this.getPrefix();
|
|
1283
|
+
const loc = this.getLocation(location);
|
|
1284
|
+
console.log(timestamp, prefix, loc, chalk.gray('🖱️ HOVER ENTER:'), element);
|
|
1285
|
+
if (Object.keys(context).length > 0) {
|
|
1286
|
+
console.log(chalk.gray(' Context:'), JSON.stringify(context, null, 2));
|
|
1287
|
+
}
|
|
1288
|
+
}
|
|
1289
|
+
hoverLeave(element, context) {
|
|
1290
|
+
const jsonLogger = getJsonStreamLogger();
|
|
1291
|
+
if (jsonLogger?.isActive()) {
|
|
1292
|
+
jsonLogger.logDebug(`[UI] Hover Leave: ${element}`, context);
|
|
1293
|
+
}
|
|
1294
|
+
if (this.level < LogLevel.VERBOSE)
|
|
1295
|
+
return;
|
|
1296
|
+
const location = this.getCallLocation();
|
|
1297
|
+
const timestamp = this.getTimestamp();
|
|
1298
|
+
const prefix = this.getPrefix();
|
|
1299
|
+
const loc = this.getLocation(location);
|
|
1300
|
+
console.log(timestamp, prefix, loc, chalk.gray('🖱️ HOVER LEAVE:'), element);
|
|
1301
|
+
if (Object.keys(context).length > 0) {
|
|
1302
|
+
console.log(chalk.gray(' Context:'), JSON.stringify(context, null, 2));
|
|
1303
|
+
}
|
|
1304
|
+
}
|
|
1305
|
+
viewportResize(context) {
|
|
1306
|
+
const jsonLogger = getJsonStreamLogger();
|
|
1307
|
+
if (jsonLogger?.isActive()) {
|
|
1308
|
+
jsonLogger.logDebug(`[LAYOUT] Viewport Resize`, context);
|
|
1309
|
+
}
|
|
1310
|
+
if (this.level < LogLevel.DEBUG)
|
|
1311
|
+
return;
|
|
1312
|
+
const location = this.getCallLocation();
|
|
1313
|
+
const timestamp = this.getTimestamp();
|
|
1314
|
+
const prefix = this.getPrefix();
|
|
1315
|
+
const loc = this.getLocation(location);
|
|
1316
|
+
console.log(timestamp, prefix, loc, chalk.blue('📐 VIEWPORT RESIZE'));
|
|
1317
|
+
if (Object.keys(context).length > 0) {
|
|
1318
|
+
console.log(chalk.blue(' Context:'), JSON.stringify(context, null, 2));
|
|
1319
|
+
}
|
|
1320
|
+
}
|
|
1321
|
+
breakpointChange(context) {
|
|
1322
|
+
const jsonLogger = getJsonStreamLogger();
|
|
1323
|
+
if (jsonLogger?.isActive()) {
|
|
1324
|
+
jsonLogger.logDebug(`[LAYOUT] Breakpoint Change`, context);
|
|
1325
|
+
}
|
|
1326
|
+
if (this.level < LogLevel.DEBUG)
|
|
1327
|
+
return;
|
|
1328
|
+
const location = this.getCallLocation();
|
|
1329
|
+
const timestamp = this.getTimestamp();
|
|
1330
|
+
const prefix = this.getPrefix();
|
|
1331
|
+
const loc = this.getLocation(location);
|
|
1332
|
+
console.log(timestamp, prefix, loc, chalk.blue('📐 BREAKPOINT CHANGE'));
|
|
1333
|
+
if (Object.keys(context).length > 0) {
|
|
1334
|
+
console.log(chalk.blue(' Context:'), JSON.stringify(context, null, 2));
|
|
1335
|
+
}
|
|
1336
|
+
}
|
|
1337
|
+
layoutShift(context) {
|
|
1338
|
+
const jsonLogger = getJsonStreamLogger();
|
|
1339
|
+
if (jsonLogger?.isActive()) {
|
|
1340
|
+
jsonLogger.logDebug(`[LAYOUT] Shift`, context);
|
|
1341
|
+
}
|
|
1342
|
+
if (this.level < LogLevel.DEBUG)
|
|
1343
|
+
return;
|
|
1344
|
+
const location = this.getCallLocation();
|
|
1345
|
+
const timestamp = this.getTimestamp();
|
|
1346
|
+
const prefix = this.getPrefix();
|
|
1347
|
+
const loc = this.getLocation(location);
|
|
1348
|
+
console.log(timestamp, prefix, loc, chalk.yellow('📐 LAYOUT SHIFT'));
|
|
1349
|
+
if (Object.keys(context).length > 0) {
|
|
1350
|
+
console.log(chalk.yellow(' Context:'), JSON.stringify(context, null, 2));
|
|
1351
|
+
}
|
|
1352
|
+
}
|
|
1353
|
+
scrollPosition(context) {
|
|
1354
|
+
const jsonLogger = getJsonStreamLogger();
|
|
1355
|
+
if (jsonLogger?.isActive()) {
|
|
1356
|
+
jsonLogger.logDebug('[UI] Scroll Position', context);
|
|
1357
|
+
}
|
|
1358
|
+
if (this.level < LogLevel.VERBOSE)
|
|
1359
|
+
return;
|
|
1360
|
+
const location = this.getCallLocation();
|
|
1361
|
+
const timestamp = this.getTimestamp();
|
|
1362
|
+
const prefix = this.getPrefix();
|
|
1363
|
+
const loc = this.getLocation(location);
|
|
1364
|
+
console.log(timestamp, prefix, loc, chalk.gray('📜 SCROLL POSITION'));
|
|
1365
|
+
if (Object.keys(context).length > 0) {
|
|
1366
|
+
console.log(chalk.gray(' Context:'), JSON.stringify(context, null, 2));
|
|
1367
|
+
}
|
|
1368
|
+
}
|
|
1369
|
+
errorBoundary(context) {
|
|
1370
|
+
const jsonLogger = getJsonStreamLogger();
|
|
1371
|
+
if (jsonLogger?.isActive()) {
|
|
1372
|
+
jsonLogger.logError(new Error('Error Boundary'), 'errorBoundary');
|
|
1373
|
+
}
|
|
1374
|
+
if (this.level < LogLevel.ERROR)
|
|
1375
|
+
return;
|
|
1376
|
+
const location = this.getCallLocation();
|
|
1377
|
+
const timestamp = this.getTimestamp();
|
|
1378
|
+
const prefix = this.getPrefix();
|
|
1379
|
+
const loc = this.getLocation(location);
|
|
1380
|
+
console.log(timestamp, prefix, loc, chalk.red('🛡️ ERROR BOUNDARY'));
|
|
1381
|
+
if (Object.keys(context).length > 0) {
|
|
1382
|
+
console.log(chalk.red(' Context:'), JSON.stringify(context, null, 2));
|
|
1383
|
+
}
|
|
1384
|
+
}
|
|
1385
|
+
unhandledRejection(context) {
|
|
1386
|
+
const jsonLogger = getJsonStreamLogger();
|
|
1387
|
+
if (jsonLogger?.isActive()) {
|
|
1388
|
+
jsonLogger.logError(new Error('Unhandled Rejection'), 'unhandledRejection');
|
|
1389
|
+
}
|
|
1390
|
+
if (this.level < LogLevel.ERROR)
|
|
1391
|
+
return;
|
|
1392
|
+
const location = this.getCallLocation();
|
|
1393
|
+
const timestamp = this.getTimestamp();
|
|
1394
|
+
const prefix = this.getPrefix();
|
|
1395
|
+
const loc = this.getLocation(location);
|
|
1396
|
+
console.log(timestamp, prefix, loc, chalk.red('⚠️ UNHANDLED REJECTION'));
|
|
1397
|
+
if (Object.keys(context).length > 0) {
|
|
1398
|
+
console.log(chalk.red(' Context:'), JSON.stringify(context, null, 2));
|
|
1399
|
+
}
|
|
1400
|
+
}
|
|
1401
|
+
globalError(context) {
|
|
1402
|
+
const jsonLogger = getJsonStreamLogger();
|
|
1403
|
+
if (jsonLogger?.isActive()) {
|
|
1404
|
+
jsonLogger.logError(new Error('Global Error'), 'globalError');
|
|
1405
|
+
}
|
|
1406
|
+
if (this.level < LogLevel.ERROR)
|
|
1407
|
+
return;
|
|
1408
|
+
const location = this.getCallLocation();
|
|
1409
|
+
const timestamp = this.getTimestamp();
|
|
1410
|
+
const prefix = this.getPrefix();
|
|
1411
|
+
const loc = this.getLocation(location);
|
|
1412
|
+
console.log(timestamp, prefix, loc, chalk.red('💥 GLOBAL ERROR'));
|
|
1413
|
+
if (Object.keys(context).length > 0) {
|
|
1414
|
+
console.log(chalk.red(' Context:'), JSON.stringify(context, null, 2));
|
|
1415
|
+
}
|
|
1416
|
+
}
|
|
1417
|
+
sessionStart(context) {
|
|
1418
|
+
const jsonLogger = getJsonStreamLogger();
|
|
1419
|
+
if (jsonLogger?.isActive()) {
|
|
1420
|
+
jsonLogger.logInfo(`Session Start`, context);
|
|
1421
|
+
}
|
|
1422
|
+
if (this.level < LogLevel.INFO)
|
|
1423
|
+
return;
|
|
1424
|
+
const location = this.getCallLocation();
|
|
1425
|
+
const timestamp = this.getTimestamp();
|
|
1426
|
+
const prefix = this.getPrefix();
|
|
1427
|
+
const loc = this.getLocation(location);
|
|
1428
|
+
console.log(timestamp, prefix, loc, chalk.green('🚀 SESSION START'));
|
|
1429
|
+
if (Object.keys(context).length > 0) {
|
|
1430
|
+
console.log(chalk.green(' Context:'), JSON.stringify(context, null, 2));
|
|
1431
|
+
}
|
|
1432
|
+
}
|
|
1433
|
+
sessionEnd(context) {
|
|
1434
|
+
const jsonLogger = getJsonStreamLogger();
|
|
1435
|
+
if (jsonLogger?.isActive()) {
|
|
1436
|
+
jsonLogger.logInfo(`Session End`, context);
|
|
1437
|
+
}
|
|
1438
|
+
if (this.level < LogLevel.INFO)
|
|
1439
|
+
return;
|
|
1440
|
+
const location = this.getCallLocation();
|
|
1441
|
+
const timestamp = this.getTimestamp();
|
|
1442
|
+
const prefix = this.getPrefix();
|
|
1443
|
+
const loc = this.getLocation(location);
|
|
1444
|
+
console.log(timestamp, prefix, loc, chalk.red('🏁 SESSION END'));
|
|
1445
|
+
if (Object.keys(context).length > 0) {
|
|
1446
|
+
console.log(chalk.red(' Context:'), JSON.stringify(context, null, 2));
|
|
1447
|
+
}
|
|
1448
|
+
}
|
|
1449
|
+
userMilestone(name, context) {
|
|
1450
|
+
const jsonLogger = getJsonStreamLogger();
|
|
1451
|
+
if (jsonLogger?.isActive()) {
|
|
1452
|
+
jsonLogger.logInfo(`User Milestone: ${name}`, context);
|
|
1453
|
+
}
|
|
1454
|
+
if (this.level < LogLevel.INFO)
|
|
1455
|
+
return;
|
|
1456
|
+
const location = this.getCallLocation();
|
|
1457
|
+
const timestamp = this.getTimestamp();
|
|
1458
|
+
const prefix = this.getPrefix();
|
|
1459
|
+
const loc = this.getLocation(location);
|
|
1460
|
+
console.log(timestamp, prefix, loc, chalk.yellow('🏆 USER MILESTONE:'), name);
|
|
1461
|
+
if (Object.keys(context).length > 0) {
|
|
1462
|
+
console.log(chalk.yellow(' Context:'), JSON.stringify(context, null, 2));
|
|
1463
|
+
}
|
|
1464
|
+
}
|
|
1465
|
+
featureUsage(name, context) {
|
|
1466
|
+
const jsonLogger = getJsonStreamLogger();
|
|
1467
|
+
if (jsonLogger?.isActive()) {
|
|
1468
|
+
jsonLogger.logDebug(`Feature Usage: ${name}`, context);
|
|
1469
|
+
}
|
|
1470
|
+
if (this.level < LogLevel.DEBUG)
|
|
1471
|
+
return;
|
|
1472
|
+
const location = this.getCallLocation();
|
|
1473
|
+
const timestamp = this.getTimestamp();
|
|
1474
|
+
const prefix = this.getPrefix();
|
|
1475
|
+
const loc = this.getLocation(location);
|
|
1476
|
+
console.log(timestamp, prefix, loc, chalk.cyan('📊 FEATURE USAGE:'), name);
|
|
1477
|
+
if (Object.keys(context).length > 0) {
|
|
1478
|
+
console.log(chalk.cyan(' Context:'), JSON.stringify(context, null, 2));
|
|
1479
|
+
}
|
|
1480
|
+
}
|
|
1481
|
+
updateCheckStart() {
|
|
1482
|
+
const jsonLogger = getJsonStreamLogger();
|
|
1483
|
+
if (jsonLogger?.isActive()) {
|
|
1484
|
+
jsonLogger.logInfo('Update Check Start', {});
|
|
1485
|
+
}
|
|
1486
|
+
if (this.level < LogLevel.INFO)
|
|
1487
|
+
return;
|
|
1488
|
+
const location = this.getCallLocation();
|
|
1489
|
+
const timestamp = this.getTimestamp();
|
|
1490
|
+
const prefix = this.getPrefix();
|
|
1491
|
+
const loc = this.getLocation(location);
|
|
1492
|
+
console.log(timestamp, prefix, loc, chalk.cyan('🔄 UPDATE CHECK START'));
|
|
1493
|
+
}
|
|
1494
|
+
updateAvailable(context) {
|
|
1495
|
+
const jsonLogger = getJsonStreamLogger();
|
|
1496
|
+
if (jsonLogger?.isActive()) {
|
|
1497
|
+
jsonLogger.logInfo('Update Available', context);
|
|
1498
|
+
}
|
|
1499
|
+
if (this.level < LogLevel.INFO)
|
|
1500
|
+
return;
|
|
1501
|
+
const location = this.getCallLocation();
|
|
1502
|
+
const timestamp = this.getTimestamp();
|
|
1503
|
+
const prefix = this.getPrefix();
|
|
1504
|
+
const loc = this.getLocation(location);
|
|
1505
|
+
console.log(timestamp, prefix, loc, chalk.green('✨ UPDATE AVAILABLE'));
|
|
1506
|
+
if (Object.keys(context).length > 0) {
|
|
1507
|
+
console.log(chalk.green(' Version:'), context['version']);
|
|
1508
|
+
}
|
|
1509
|
+
}
|
|
1510
|
+
updateDownloadStart(context) {
|
|
1511
|
+
const jsonLogger = getJsonStreamLogger();
|
|
1512
|
+
if (jsonLogger?.isActive()) {
|
|
1513
|
+
jsonLogger.logInfo('Update Download Start', context);
|
|
1514
|
+
}
|
|
1515
|
+
if (this.level < LogLevel.INFO)
|
|
1516
|
+
return;
|
|
1517
|
+
const location = this.getCallLocation();
|
|
1518
|
+
const timestamp = this.getTimestamp();
|
|
1519
|
+
const prefix = this.getPrefix();
|
|
1520
|
+
const loc = this.getLocation(location);
|
|
1521
|
+
console.log(timestamp, prefix, loc, chalk.cyan('⬇️ UPDATE DOWNLOAD START'));
|
|
1522
|
+
if (Object.keys(context).length > 0) {
|
|
1523
|
+
console.log(chalk.cyan(' Context:'), JSON.stringify(context, null, 2));
|
|
1524
|
+
}
|
|
1525
|
+
}
|
|
1526
|
+
updateDownloadProgress(context) {
|
|
1527
|
+
const jsonLogger = getJsonStreamLogger();
|
|
1528
|
+
if (jsonLogger?.isActive()) {
|
|
1529
|
+
jsonLogger.logDebug('Update Download Progress', context);
|
|
1530
|
+
}
|
|
1531
|
+
if (this.level < LogLevel.DEBUG)
|
|
1532
|
+
return;
|
|
1533
|
+
const location = this.getCallLocation();
|
|
1534
|
+
const timestamp = this.getTimestamp();
|
|
1535
|
+
const prefix = this.getPrefix();
|
|
1536
|
+
const loc = this.getLocation(location);
|
|
1537
|
+
console.log(timestamp, prefix, loc, chalk.cyan('⬇️ DOWNLOAD PROGRESS:'), `${context['percent']}%`);
|
|
1538
|
+
}
|
|
1539
|
+
updateDownloadComplete(context) {
|
|
1540
|
+
const jsonLogger = getJsonStreamLogger();
|
|
1541
|
+
if (jsonLogger?.isActive()) {
|
|
1542
|
+
jsonLogger.logInfo('Update Download Complete', context);
|
|
1543
|
+
}
|
|
1544
|
+
if (this.level < LogLevel.INFO)
|
|
1545
|
+
return;
|
|
1546
|
+
const location = this.getCallLocation();
|
|
1547
|
+
const timestamp = this.getTimestamp();
|
|
1548
|
+
const prefix = this.getPrefix();
|
|
1549
|
+
const loc = this.getLocation(location);
|
|
1550
|
+
console.log(timestamp, prefix, loc, chalk.green('✅ UPDATE DOWNLOAD COMPLETE'));
|
|
1551
|
+
if (Object.keys(context).length > 0) {
|
|
1552
|
+
console.log(chalk.green(' Version:'), context['version']);
|
|
1553
|
+
}
|
|
1554
|
+
}
|
|
1555
|
+
updateInstalling() {
|
|
1556
|
+
const jsonLogger = getJsonStreamLogger();
|
|
1557
|
+
if (jsonLogger?.isActive()) {
|
|
1558
|
+
jsonLogger.logInfo('Update Installing', {});
|
|
1559
|
+
}
|
|
1560
|
+
if (this.level < LogLevel.INFO)
|
|
1561
|
+
return;
|
|
1562
|
+
const location = this.getCallLocation();
|
|
1563
|
+
const timestamp = this.getTimestamp();
|
|
1564
|
+
const prefix = this.getPrefix();
|
|
1565
|
+
const loc = this.getLocation(location);
|
|
1566
|
+
console.log(timestamp, prefix, loc, chalk.yellow('🔧 UPDATE INSTALLING'));
|
|
1567
|
+
}
|
|
1568
|
+
updateInstalled(context) {
|
|
1569
|
+
const jsonLogger = getJsonStreamLogger();
|
|
1570
|
+
if (jsonLogger?.isActive()) {
|
|
1571
|
+
jsonLogger.logInfo('Update Installed', context);
|
|
1572
|
+
}
|
|
1573
|
+
if (this.level < LogLevel.INFO)
|
|
1574
|
+
return;
|
|
1575
|
+
const location = this.getCallLocation();
|
|
1576
|
+
const timestamp = this.getTimestamp();
|
|
1577
|
+
const prefix = this.getPrefix();
|
|
1578
|
+
const loc = this.getLocation(location);
|
|
1579
|
+
console.log(timestamp, prefix, loc, chalk.green('🎉 UPDATE INSTALLED'));
|
|
1580
|
+
if (Object.keys(context).length > 0) {
|
|
1581
|
+
console.log(chalk.green(' Version:'), context['version']);
|
|
1582
|
+
}
|
|
1583
|
+
}
|
|
1584
|
+
updateError(context) {
|
|
1585
|
+
const jsonLogger = getJsonStreamLogger();
|
|
1586
|
+
if (jsonLogger?.isActive()) {
|
|
1587
|
+
jsonLogger.logError(new Error(String(context['error'] || 'Unknown error')), 'updateError');
|
|
1588
|
+
}
|
|
1589
|
+
if (this.level < LogLevel.ERROR)
|
|
1590
|
+
return;
|
|
1591
|
+
const location = this.getCallLocation();
|
|
1592
|
+
const timestamp = this.getTimestamp();
|
|
1593
|
+
const prefix = this.getPrefix();
|
|
1594
|
+
const loc = this.getLocation(location);
|
|
1595
|
+
console.log(timestamp, prefix, loc, chalk.red('❌ UPDATE ERROR'));
|
|
1596
|
+
if (Object.keys(context).length > 0) {
|
|
1597
|
+
console.log(chalk.red(' Error:'), context['error']);
|
|
1598
|
+
}
|
|
1599
|
+
}
|
|
1600
|
+
}
|
|
1601
|
+
export const logger = new Logger({
|
|
1602
|
+
level: LogLevel.ERROR,
|
|
1603
|
+
prefix: '한설',
|
|
1604
|
+
timestamp: true,
|
|
1605
|
+
showLocation: false,
|
|
1606
|
+
showPid: false,
|
|
1607
|
+
});
|
|
1608
|
+
export function setLogLevel(level) {
|
|
1609
|
+
logger.setLevel(level);
|
|
1610
|
+
if (level >= LogLevel.DEBUG) {
|
|
1611
|
+
logger['showLocation'] = true;
|
|
1612
|
+
}
|
|
1613
|
+
}
|
|
1614
|
+
export function enableVerbose() {
|
|
1615
|
+
logger.setLevel(LogLevel.VERBOSE);
|
|
1616
|
+
}
|
|
1617
|
+
export function disableVerbose() {
|
|
1618
|
+
logger.setLevel(LogLevel.INFO);
|
|
1619
|
+
}
|
|
1620
|
+
export function enableDebug() {
|
|
1621
|
+
logger.setLevel(LogLevel.DEBUG);
|
|
1622
|
+
}
|
|
1623
|
+
export function createLogger(prefix, options) {
|
|
1624
|
+
return new Logger({
|
|
1625
|
+
level: logger['level'],
|
|
1626
|
+
prefix,
|
|
1627
|
+
timestamp: true,
|
|
1628
|
+
showLocation: logger['showLocation'],
|
|
1629
|
+
showPid: logger['showPid'],
|
|
1630
|
+
...options,
|
|
1631
|
+
});
|
|
1632
|
+
}
|
|
1633
|
+
export function generateTraceId() {
|
|
1634
|
+
return `${Date.now()}-${Math.random().toString(36).slice(2, 11)}`;
|
|
1635
|
+
}
|
|
1636
|
+
export async function setupLogging(options) {
|
|
1637
|
+
const { initializeJsonStreamLogger, closeJsonStreamLogger } = await import('./json-stream-logger.js');
|
|
1638
|
+
const { sessionManager } = await import('../core/session/session-manager.js');
|
|
1639
|
+
const isVerboseMode = options.verbose || options.debug;
|
|
1640
|
+
const sessionId = options.sessionId || sessionManager.getCurrentSessionId();
|
|
1641
|
+
const jsonLogger = await initializeJsonStreamLogger(sessionId, false, isVerboseMode);
|
|
1642
|
+
if (options.llmLog) {
|
|
1643
|
+
enableLLMLog();
|
|
1644
|
+
}
|
|
1645
|
+
if (options.debug) {
|
|
1646
|
+
setLogLevel(LogLevel.VERBOSE);
|
|
1647
|
+
logger.debug('🔍 Debug mode enabled - maximum logging with location tracking');
|
|
1648
|
+
}
|
|
1649
|
+
else if (options.verbose) {
|
|
1650
|
+
setLogLevel(LogLevel.DEBUG);
|
|
1651
|
+
logger.debug('📝 Verbose mode enabled - detailed logging');
|
|
1652
|
+
}
|
|
1653
|
+
else if (options.llmLog) {
|
|
1654
|
+
console.log(chalk.cyan('📡 LLM Log mode enabled - showing LLM requests/responses only'));
|
|
1655
|
+
}
|
|
1656
|
+
let cleanupCalled = false;
|
|
1657
|
+
const cleanup = async () => {
|
|
1658
|
+
if (cleanupCalled) {
|
|
1659
|
+
return;
|
|
1660
|
+
}
|
|
1661
|
+
cleanupCalled = true;
|
|
1662
|
+
await closeJsonStreamLogger();
|
|
1663
|
+
};
|
|
1664
|
+
const exitHandler = async (signal) => {
|
|
1665
|
+
logger.debug(`Received ${signal}, cleaning up...`);
|
|
1666
|
+
await cleanup();
|
|
1667
|
+
process.exit(0);
|
|
1668
|
+
};
|
|
1669
|
+
process.once('SIGTERM', () => exitHandler('SIGTERM'));
|
|
1670
|
+
return { cleanup, jsonLogger };
|
|
1671
|
+
}
|
|
1672
|
+
//# sourceMappingURL=logger.js.map
|