@agenthippo-ai/agenthippo 0.1.0
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/bin/agenthippo.js +2 -0
- package/out/agentpack/github.js +547 -0
- package/out/agentpack/index.js +66 -0
- package/out/agentpack/install.js +297 -0
- package/out/agentpack/manager.js +441 -0
- package/out/agentpack/manifest.js +135 -0
- package/out/agentpack/paths.js +475 -0
- package/out/agentpack/publish.js +248 -0
- package/out/agentpack/stores.js +554 -0
- package/out/agentpack/types.js +5 -0
- package/out/analytics/dashboard/artifactManager.js +439 -0
- package/out/analytics/dashboard/fleetDisplayUtils.js +159 -0
- package/out/analytics/dashboard/fleetOrchestrator.js +142 -0
- package/out/analytics/dashboard/fleetRegistry.js +79 -0
- package/out/analytics/dashboard/fleetRowDefaults.js +87 -0
- package/out/analytics/dashboard/fleetScriptAdapter.js +146 -0
- package/out/analytics/dashboard/fleetStatusUtils.js +30 -0
- package/out/analytics/dashboard/fleetTitleUtils.js +68 -0
- package/out/analytics/dashboard/fleetTypes.js +29 -0
- package/out/analytics/dashboard/index.js +17 -0
- package/out/analytics/dashboard/indexingService.js +422 -0
- package/out/analytics/dashboard/localFleetAdapter.js +222 -0
- package/out/analytics/dashboard/performanceMonitor.js +76 -0
- package/out/analytics/dashboard/processManager.js +209 -0
- package/out/analytics/dashboard/provider.js +3885 -0
- package/out/analytics/dashboard/queryRunner.js +994 -0
- package/out/analytics/dashboard/refreshPolicy.js +16 -0
- package/out/analytics/dashboard/scheduledFleetFingerprint.js +22 -0
- package/out/analytics/dashboard/scheduledFleetStorage.js +241 -0
- package/out/analytics/dashboard/scheduledFleetUtils.js +22 -0
- package/out/analytics/dashboard/sessionEventFleetStats.js +118 -0
- package/out/analytics/dashboard/sessionJsonlFleet.js +204 -0
- package/out/analytics/dashboard/teamViewDiscovery.js +106 -0
- package/out/analytics/dashboard/viewsConfigMerge.js +221 -0
- package/out/analytics/dashboard/webview/analytics-panel.html +155 -0
- package/out/analytics/dashboard/webview/codicon.ttf +0 -0
- package/out/analytics/dashboard/webview/index.html +78 -0
- package/out/analytics/dashboard/webview/panel.js +2295 -0
- package/out/analytics/dashboard/webview/runtime-bridge.js +82 -0
- package/out/analytics/dashboard/webview/styles.css +1009 -0
- package/out/analytics/lifecycle.js +43 -0
- package/out/analytics/service.js +1279 -0
- package/out/analytics/sessionEvents.js +231 -0
- package/out/auth/bootstrapApply.js +72 -0
- package/out/auth/brokerClient.js +126 -0
- package/out/auth/callbackUri.js +59 -0
- package/out/auth/callbackUriParse.js +59 -0
- package/out/auth/githubStoreGate.js +70 -0
- package/out/auth/loopbackAuthServer.js +165 -0
- package/out/auth/pkce.js +9 -0
- package/out/auth/provider.js +239 -0
- package/out/auth/sessionStore.js +193 -0
- package/out/auth/signInFlow.js +182 -0
- package/out/auth/types.js +12 -0
- package/out/auth-broker/config.js +62 -0
- package/out/auth-broker/jwt.js +105 -0
- package/out/auth-broker/pkce.js +57 -0
- package/out/auth-broker/server.js +539 -0
- package/out/auth-broker/store.js +273 -0
- package/out/base-prompts/gateway/openclaw-starter.json5 +144 -0
- package/out/base-prompts/gateway/slack-socket-mode-minimal.manifest.json +44 -0
- package/out/base-prompts/mcp-servers/.mcp.json +13 -0
- package/out/base-prompts/mcp-servers/langfuse-analytics/README.md +142 -0
- package/out/base-prompts/mcp-servers/langfuse-analytics/mcp.json +13 -0
- package/out/base-prompts/mcp-servers/langfuse-analytics/package-lock.json +1192 -0
- package/out/base-prompts/mcp-servers/langfuse-analytics/package.json +23 -0
- package/out/base-prompts/mcp-servers/langfuse-analytics/scripts/run-with-env.sh +12 -0
- package/out/base-prompts/mcp-servers/langfuse-analytics/scripts/sdk-test.js +102 -0
- package/out/base-prompts/mcp-servers/langfuse-analytics/scripts/simple-test.js +137 -0
- package/out/base-prompts/mcp-servers/langfuse-analytics/scripts/test-client.js +118 -0
- package/out/base-prompts/mcp-servers/langfuse-analytics/scripts/test-server.js +209 -0
- package/out/base-prompts/mcp-servers/langfuse-analytics/src/client.ts +431 -0
- package/out/base-prompts/mcp-servers/langfuse-analytics/src/index.ts +270 -0
- package/out/base-prompts/mcp-servers/langfuse-analytics/tsconfig.json +18 -0
- package/out/base-prompts/rules/AGENTS.md +204 -0
- package/out/base-prompts/skills/agent-browser/SKILL.md +102 -0
- package/out/base-prompts/skills/agent-builder/SKILL.md +73 -0
- package/out/base-prompts/skills/agent-builder/references/agent-pack.md +63 -0
- package/out/base-prompts/skills/agent-builder/references/crewai.md +66 -0
- package/out/base-prompts/skills/agent-builder/references/langchain.md +60 -0
- package/out/base-prompts/skills/agent-builder/references/raw-sdk.md +73 -0
- package/out/base-prompts/skills/agent-engine-creator/SKILL.md +586 -0
- package/out/base-prompts/skills/agent-engine-installer/SKILL.md +106 -0
- package/out/base-prompts/skills/agent-engine-installer/scripts/install-engine.mjs +259 -0
- package/out/base-prompts/skills/agent-engine-installer/scripts/install-engine.ps1 +189 -0
- package/out/base-prompts/skills/agenthippo-cli/SKILL.md +69 -0
- package/out/base-prompts/skills/agenthippo-cli/scripts/install.sh +63 -0
- package/out/base-prompts/skills/agentpack-creator/SKILL.md +375 -0
- package/out/base-prompts/skills/agentpack-creator/references/agent-templates.md +261 -0
- package/out/base-prompts/skills/agentpack-creator/references/agents-md-guide.md +195 -0
- package/out/base-prompts/skills/agentpack-creator/scripts/init_pack.py +391 -0
- package/out/base-prompts/skills/agentpack-creator/scripts/init_pack_test.py +294 -0
- package/out/base-prompts/skills/agentpack-testbench/SKILL.md +135 -0
- package/out/base-prompts/skills/algorithmic-art/LICENSE.txt +202 -0
- package/out/base-prompts/skills/algorithmic-art/SKILL.md +405 -0
- package/out/base-prompts/skills/algorithmic-art/templates/generator_template.js +223 -0
- package/out/base-prompts/skills/algorithmic-art/templates/viewer.html +599 -0
- package/out/base-prompts/skills/debug-agent/SKILL.md +83 -0
- package/out/base-prompts/skills/desktop-automation/SKILL.md +166 -0
- package/out/base-prompts/skills/desktop-automation/references/agenthippo-ui-recipes.md +441 -0
- package/out/base-prompts/skills/desktop-automation/scripts/windows-desktop-uia.psm1 +280 -0
- package/out/base-prompts/skills/docx/LICENSE.txt +30 -0
- package/out/base-prompts/skills/docx/SKILL.md +197 -0
- package/out/base-prompts/skills/docx/docx-js.md +350 -0
- package/out/base-prompts/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
- package/out/base-prompts/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
- package/out/base-prompts/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
- package/out/base-prompts/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
- package/out/base-prompts/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
- package/out/base-prompts/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
- package/out/base-prompts/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
- package/out/base-prompts/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
- package/out/base-prompts/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
- package/out/base-prompts/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
- package/out/base-prompts/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
- package/out/base-prompts/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
- package/out/base-prompts/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
- package/out/base-prompts/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
- package/out/base-prompts/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
- package/out/base-prompts/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
- package/out/base-prompts/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
- package/out/base-prompts/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
- package/out/base-prompts/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
- package/out/base-prompts/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
- package/out/base-prompts/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
- package/out/base-prompts/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
- package/out/base-prompts/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
- package/out/base-prompts/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
- package/out/base-prompts/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
- package/out/base-prompts/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
- package/out/base-prompts/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
- package/out/base-prompts/skills/docx/ooxml/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
- package/out/base-prompts/skills/docx/ooxml/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
- package/out/base-prompts/skills/docx/ooxml/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
- package/out/base-prompts/skills/docx/ooxml/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
- package/out/base-prompts/skills/docx/ooxml/schemas/mce/mc.xsd +75 -0
- package/out/base-prompts/skills/docx/ooxml/schemas/microsoft/wml-2010.xsd +560 -0
- package/out/base-prompts/skills/docx/ooxml/schemas/microsoft/wml-2012.xsd +67 -0
- package/out/base-prompts/skills/docx/ooxml/schemas/microsoft/wml-2018.xsd +14 -0
- package/out/base-prompts/skills/docx/ooxml/schemas/microsoft/wml-cex-2018.xsd +20 -0
- package/out/base-prompts/skills/docx/ooxml/schemas/microsoft/wml-cid-2016.xsd +13 -0
- package/out/base-prompts/skills/docx/ooxml/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
- package/out/base-prompts/skills/docx/ooxml/schemas/microsoft/wml-symex-2015.xsd +8 -0
- package/out/base-prompts/skills/docx/ooxml/scripts/pack.py +159 -0
- package/out/base-prompts/skills/docx/ooxml/scripts/unpack.py +29 -0
- package/out/base-prompts/skills/docx/ooxml/scripts/validate.py +69 -0
- package/out/base-prompts/skills/docx/ooxml/scripts/validation/__init__.py +15 -0
- package/out/base-prompts/skills/docx/ooxml/scripts/validation/base.py +951 -0
- package/out/base-prompts/skills/docx/ooxml/scripts/validation/docx.py +274 -0
- package/out/base-prompts/skills/docx/ooxml/scripts/validation/pptx.py +315 -0
- package/out/base-prompts/skills/docx/ooxml/scripts/validation/redlining.py +279 -0
- package/out/base-prompts/skills/docx/ooxml.md +610 -0
- package/out/base-prompts/skills/docx/scripts/__init__.py +1 -0
- package/out/base-prompts/skills/docx/scripts/document.py +1276 -0
- package/out/base-prompts/skills/docx/scripts/templates/comments.xml +3 -0
- package/out/base-prompts/skills/docx/scripts/templates/commentsExtended.xml +3 -0
- package/out/base-prompts/skills/docx/scripts/templates/commentsExtensible.xml +3 -0
- package/out/base-prompts/skills/docx/scripts/templates/commentsIds.xml +3 -0
- package/out/base-prompts/skills/docx/scripts/templates/people.xml +3 -0
- package/out/base-prompts/skills/docx/scripts/utilities.py +374 -0
- package/out/base-prompts/skills/gateway-outbound/SKILL.md +136 -0
- package/out/base-prompts/skills/mcp-builder/LICENSE.txt +202 -0
- package/out/base-prompts/skills/mcp-builder/SKILL.md +328 -0
- package/out/base-prompts/skills/mcp-builder/reference/evaluation.md +602 -0
- package/out/base-prompts/skills/mcp-builder/reference/mcp_best_practices.md +249 -0
- package/out/base-prompts/skills/mcp-builder/reference/node_mcp_server.md +970 -0
- package/out/base-prompts/skills/mcp-builder/reference/python_mcp_server.md +719 -0
- package/out/base-prompts/skills/mcp-builder/scripts/connections.py +151 -0
- package/out/base-prompts/skills/mcp-builder/scripts/evaluation.py +373 -0
- package/out/base-prompts/skills/mcp-builder/scripts/example_evaluation.xml +22 -0
- package/out/base-prompts/skills/mcp-builder/scripts/requirements.txt +2 -0
- package/out/base-prompts/skills/openclaw/SKILL.md +406 -0
- package/out/base-prompts/skills/openclaw/scripts/run-smoke.sh +61 -0
- package/out/base-prompts/skills/pdf/LICENSE.txt +30 -0
- package/out/base-prompts/skills/pdf/SKILL.md +294 -0
- package/out/base-prompts/skills/pdf/forms.md +205 -0
- package/out/base-prompts/skills/pdf/reference.md +612 -0
- package/out/base-prompts/skills/pdf/scripts/check_bounding_boxes.py +70 -0
- package/out/base-prompts/skills/pdf/scripts/check_bounding_boxes_test.py +226 -0
- package/out/base-prompts/skills/pdf/scripts/check_fillable_fields.py +12 -0
- package/out/base-prompts/skills/pdf/scripts/convert_pdf_to_images.py +35 -0
- package/out/base-prompts/skills/pdf/scripts/create_validation_image.py +41 -0
- package/out/base-prompts/skills/pdf/scripts/extract_form_field_info.py +152 -0
- package/out/base-prompts/skills/pdf/scripts/fill_fillable_fields.py +114 -0
- package/out/base-prompts/skills/pdf/scripts/fill_pdf_form_with_annotations.py +108 -0
- package/out/base-prompts/skills/pptx/LICENSE.txt +30 -0
- package/out/base-prompts/skills/pptx/SKILL.md +484 -0
- package/out/base-prompts/skills/pptx/html2pptx.md +625 -0
- package/out/base-prompts/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
- package/out/base-prompts/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
- package/out/base-prompts/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
- package/out/base-prompts/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
- package/out/base-prompts/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
- package/out/base-prompts/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
- package/out/base-prompts/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
- package/out/base-prompts/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
- package/out/base-prompts/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
- package/out/base-prompts/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
- package/out/base-prompts/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
- package/out/base-prompts/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
- package/out/base-prompts/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
- package/out/base-prompts/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
- package/out/base-prompts/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
- package/out/base-prompts/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
- package/out/base-prompts/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
- package/out/base-prompts/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
- package/out/base-prompts/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
- package/out/base-prompts/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
- package/out/base-prompts/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
- package/out/base-prompts/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
- package/out/base-prompts/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
- package/out/base-prompts/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
- package/out/base-prompts/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
- package/out/base-prompts/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
- package/out/base-prompts/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
- package/out/base-prompts/skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
- package/out/base-prompts/skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
- package/out/base-prompts/skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
- package/out/base-prompts/skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
- package/out/base-prompts/skills/pptx/ooxml/schemas/mce/mc.xsd +75 -0
- package/out/base-prompts/skills/pptx/ooxml/schemas/microsoft/wml-2010.xsd +560 -0
- package/out/base-prompts/skills/pptx/ooxml/schemas/microsoft/wml-2012.xsd +67 -0
- package/out/base-prompts/skills/pptx/ooxml/schemas/microsoft/wml-2018.xsd +14 -0
- package/out/base-prompts/skills/pptx/ooxml/schemas/microsoft/wml-cex-2018.xsd +20 -0
- package/out/base-prompts/skills/pptx/ooxml/schemas/microsoft/wml-cid-2016.xsd +13 -0
- package/out/base-prompts/skills/pptx/ooxml/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
- package/out/base-prompts/skills/pptx/ooxml/schemas/microsoft/wml-symex-2015.xsd +8 -0
- package/out/base-prompts/skills/pptx/ooxml/scripts/pack.py +159 -0
- package/out/base-prompts/skills/pptx/ooxml/scripts/unpack.py +29 -0
- package/out/base-prompts/skills/pptx/ooxml/scripts/validate.py +69 -0
- package/out/base-prompts/skills/pptx/ooxml/scripts/validation/__init__.py +15 -0
- package/out/base-prompts/skills/pptx/ooxml/scripts/validation/base.py +951 -0
- package/out/base-prompts/skills/pptx/ooxml/scripts/validation/docx.py +274 -0
- package/out/base-prompts/skills/pptx/ooxml/scripts/validation/pptx.py +315 -0
- package/out/base-prompts/skills/pptx/ooxml/scripts/validation/redlining.py +279 -0
- package/out/base-prompts/skills/pptx/ooxml.md +427 -0
- package/out/base-prompts/skills/pptx/scripts/html2pptx.js +984 -0
- package/out/base-prompts/skills/pptx/scripts/inventory.py +1020 -0
- package/out/base-prompts/skills/pptx/scripts/rearrange.py +231 -0
- package/out/base-prompts/skills/pptx/scripts/replace.py +385 -0
- package/out/base-prompts/skills/pptx/scripts/thumbnail.py +450 -0
- package/out/base-prompts/skills/prompt-lab/SKILL.md +149 -0
- package/out/base-prompts/skills/prompt-lab/scripts/query-analytics.sh +2551 -0
- package/out/base-prompts/skills/skill-creator/LICENSE.txt +202 -0
- package/out/base-prompts/skills/skill-creator/SKILL.md +371 -0
- package/out/base-prompts/skills/skill-creator/references/output-patterns.md +82 -0
- package/out/base-prompts/skills/skill-creator/references/workflows.md +28 -0
- package/out/base-prompts/skills/skill-creator/scripts/init_skill.py +303 -0
- package/out/base-prompts/skills/skill-creator/scripts/package_skill.py +110 -0
- package/out/base-prompts/skills/skill-creator/scripts/quick_validate.py +95 -0
- package/out/base-prompts/skills/skill-installer/SKILL.md +251 -0
- package/out/base-prompts/skills/skill-installer/references/store-api.md +219 -0
- package/out/base-prompts/skills/spotlight-dashboard/SKILL.md +83 -0
- package/out/base-prompts/skills/spotlight-insights/SKILL.md +101 -0
- package/out/base-prompts/skills/spotlight-optimize/SKILL.md +93 -0
- package/out/base-prompts/skills/spotlight-optimize/scripts/query-analytics.sh +2551 -0
- package/out/base-prompts/skills/spotlight-query/SKILL.md +314 -0
- package/out/base-prompts/skills/spotlight-query/references/otel-schema.md +163 -0
- package/out/base-prompts/skills/spotlight-query/scripts/query-analytics.sh +2551 -0
- package/out/base-prompts/skills/spotlight-query/scripts/query-analytics.test.sh +744 -0
- package/out/base-prompts/skills/spotlight-query/scripts/test-fixtures/analytics/sessions/sess-test-1.jsonl +14 -0
- package/out/base-prompts/skills/spotlight-query/scripts/test-fixtures/analytics/traces/.duckdb-index.json +7 -0
- package/out/base-prompts/skills/spotlight-query/scripts/test-fixtures/analytics/traces/sample.jsonl +5 -0
- package/out/base-prompts/skills/spotlight-report/SKILL.md +86 -0
- package/out/base-prompts/skills/spotlight-visualize/SKILL.md +92 -0
- package/out/base-prompts/skills/spotlight-visualize/scripts/query-analytics.sh +2551 -0
- package/out/base-prompts/skills/xlsx/LICENSE.txt +30 -0
- package/out/base-prompts/skills/xlsx/SKILL.md +289 -0
- package/out/base-prompts/skills/xlsx/recalc.py +178 -0
- package/out/branding.js +23 -0
- package/out/cli/commands/anywhere.js +66 -0
- package/out/cli/commands/ask.js +243 -0
- package/out/cli/commands/auth-broker.js +24 -0
- package/out/cli/commands/auth.js +219 -0
- package/out/cli/commands/chat.js +354 -0
- package/out/cli/commands/deploy.js +223 -0
- package/out/cli/commands/gateway.js +160 -0
- package/out/cli/commands/pack.js +220 -0
- package/out/cli/commands/probe-custom-engine.js +82 -0
- package/out/cli/commands/serve.js +583 -0
- package/out/cli/commands/store.js +919 -0
- package/out/cli/credential-context.js +113 -0
- package/out/cli/deploy-init.js +2087 -0
- package/out/cli/deps.js +238 -0
- package/out/cli/index.js +390 -0
- package/out/cli/pack-loader.js +376 -0
- package/out/cli/run-custom-engine-runner.js +318 -0
- package/out/cli/runtime.js +409 -0
- package/out/cli/serve-hardening.js +325 -0
- package/out/cli/state-sync.js +135 -0
- package/out/cli/utils.js +220 -0
- package/out/cli/vscode-shim.js +86 -0
- package/out/engines/base.js +159 -0
- package/out/engines/claude.js +1215 -0
- package/out/engines/codex.js +759 -0
- package/out/engines/custom.js +632 -0
- package/out/engines/customEngineIpc.js +95 -0
- package/out/engines/customEngineRunnerEmbed.js +107 -0
- package/out/engines/customRegistry.js +274 -0
- package/out/engines/embeddedCustomEngineRunner.generated.js +9 -0
- package/out/engines/engineApiKey.js +138 -0
- package/out/engines/factory.js +45 -0
- package/out/engines/install.js +372 -0
- package/out/engines/persistentEngineWorker.js +320 -0
- package/out/engines/publish.js +341 -0
- package/out/engines/types.js +17 -0
- package/out/examples/run-headless-repl.js +291 -0
- package/out/examples/run-headless.js +187 -0
- package/out/extension.js +4472 -0
- package/out/gateway/bridge.js +805 -0
- package/out/gateway/cli-agent-id.js +36 -0
- package/out/gateway/client.js +303 -0
- package/out/gateway/client.test.js +395 -0
- package/out/gateway/gateway-scope-errors.js +14 -0
- package/out/gateway/gatewayBackup.js +76 -0
- package/out/gateway/gatewayRouteIndex.js +371 -0
- package/out/gateway/gatewaySessionStore.js +243 -0
- package/out/gateway/index.js +31 -0
- package/out/gateway/lifecycle.js +3056 -0
- package/out/gateway/openclaw-channel-routing.js +317 -0
- package/out/gateway/outboundHandles.js +373 -0
- package/out/gateway/outboundPaths.js +72 -0
- package/out/gateway/outboundSend.js +254 -0
- package/out/gateway/protocol.js +48 -0
- package/out/gateway/resetMappings.js +52 -0
- package/out/gateway/service.js +1244 -0
- package/out/gateway/sessionRouting.js +77 -0
- package/out/headless/index.js +505 -0
- package/out/headless/sync.js +473 -0
- package/out/mcp/publish.js +143 -0
- package/out/mcp.js +597 -0
- package/out/permissions.js +108 -0
- package/out/permissions.mapping.yaml +68 -0
- package/out/registry/index.js +332 -0
- package/out/remote/handleRemoteChat.js +122 -0
- package/out/remote/remotePackStatusBar.js +103 -0
- package/out/remote/serveClient.js +216 -0
- package/out/remoteSkills.js +191 -0
- package/out/runtime/index.js +32 -0
- package/out/runtime/interfaces/config-provider.js +32 -0
- package/out/runtime/interfaces/edit-tracker.js +22 -0
- package/out/runtime/interfaces/index.js +29 -0
- package/out/runtime/interfaces/logger.js +40 -0
- package/out/runtime/interfaces/permission-handler.js +66 -0
- package/out/runtime/interfaces/session-store.js +342 -0
- package/out/runtime/vscode/index.js +20 -0
- package/out/runtime/vscode/vscode-config-provider.js +77 -0
- package/out/runtime/vscode/vscode-edit-tracker.js +120 -0
- package/out/runtime/vscode/vscode-logger.js +30 -0
- package/out/runtime/vscode/vscode-permission-handler.js +72 -0
- package/out/runtime/vscode/vscode-session-store.js +22 -0
- package/out/scripts/agentide-litellm.ps1 +501 -0
- package/out/scripts/agentide-litellm.sh +700 -0
- package/out/scripts/agentide_litellm_hooks_v1.py +604 -0
- package/out/scripts/analytics/agent-fleet-widget.js +954 -0
- package/out/scripts/analytics/agentide-litellm-otel.config.yaml +160 -0
- package/out/scripts/analytics/default-seed-scripts.json +12 -0
- package/out/scripts/analytics/duckdbLocator.js +29 -0
- package/out/scripts/analytics/fleet-local-adapter.js +246 -0
- package/out/scripts/analytics/fleet-workflow.sh +263 -0
- package/out/scripts/analytics/generate-default-charts.py +685 -0
- package/out/scripts/analytics/hotspot-analysis-widget.js +909 -0
- package/out/scripts/analytics/index-traces.py +1394 -0
- package/out/scripts/analytics/install-analytics.sh +286 -0
- package/out/scripts/analytics/live-fleet-4-collector.cjs +315 -0
- package/out/scripts/analytics/live-fleet-4-daemon.mjs +134 -0
- package/out/scripts/analytics/live-fleet-4-widget.cjs +433 -0
- package/out/scripts/analytics/otel-collector.yaml +55 -0
- package/out/scripts/analytics/query-analytics.ps1 +396 -0
- package/out/scripts/analytics/query-analytics.sh +2551 -0
- package/out/scripts/analytics/session-comparison-widget.js +1468 -0
- package/out/scripts/analytics/session-timeline-widget.js +2137 -0
- package/out/scripts/analytics/setup-analytics.ps1 +432 -0
- package/out/scripts/analytics/setup-analytics.sh +854 -0
- package/out/scripts/analytics/start-analytics.ps1 +169 -0
- package/out/scripts/analytics/start-analytics.sh +323 -0
- package/out/scripts/analytics/token-cost-flamegraph-widget.js +954 -0
- package/out/scripts/analytics/token-cost-trend-widget.js +1062 -0
- package/out/scripts/analytics/workflows-collector.cjs +315 -0
- package/out/scripts/analytics/workflows-daemon.mjs +186 -0
- package/out/scripts/analytics/workflows-widget.cjs +433 -0
- package/out/scripts/analytics/wow-model-widget.js +191 -0
- package/out/scripts/gateway/Dockerfile.serve +45 -0
- package/out/scripts/gateway/docker-serve.sh +248 -0
- package/out/scripts/gateway/setup-gateway-server.ps1 +953 -0
- package/out/scripts/gateway/setup-gateway-server.sh +935 -0
- package/out/scripts/gateway/setup-gateway.ps1 +1813 -0
- package/out/scripts/gateway/setup-gateway.sh +1541 -0
- package/out/scripts/setup-cli.ps1 +86 -0
- package/out/scripts/setup-cli.sh +117 -0
- package/out/scripts/tools-manifest.json +83 -0
- package/out/scripts/vendor-tools.mjs +234 -0
- package/out/session.js +272 -0
- package/out/shared/agentEngines.js +170 -0
- package/out/shared/index.js +109 -0
- package/out/shared/models.js +235 -0
- package/out/shared/providers.js +202 -0
- package/out/skills/publish.js +178 -0
- package/out/spotlight/install.js +339 -0
- package/out/spotlight/publish.js +544 -0
- package/out/spotlight/yaml.js +31 -0
- package/out/store/github/setup.js +235 -0
- package/out/store/github/templates/build-index.ts +339 -0
- package/out/store/github/templates/build-index.yml +97 -0
- package/out/store/github/templates/package.json +11 -0
- package/out/store/index.js +755 -0
- package/out/store/oramaIndex.js +884 -0
- package/out/store/shared.js +241 -0
- package/out/sync.js +1827 -0
- package/out/terminalLogger.js +358 -0
- package/out/test/agentEnvFile.test.js +97 -0
- package/out/test/agentYaml.test.js +373 -0
- package/out/test/agentpack.test.js +639 -0
- package/out/test/analytics-lifecycle.test.js +174 -0
- package/out/test/analytics.test.js +524 -0
- package/out/test/auth-bootstrapApply.test.js +102 -0
- package/out/test/auth-broker.test.js +434 -0
- package/out/test/auth-callback.test.js +62 -0
- package/out/test/branding.test.js +229 -0
- package/out/test/cli-agent-id.test.js +55 -0
- package/out/test/credential-context.test.js +105 -0
- package/out/test/customEngineInstall.test.js +100 -0
- package/out/test/customRegistry.test.js +122 -0
- package/out/test/deploy-init.test.js +532 -0
- package/out/test/deps-auto-install.test.js +81 -0
- package/out/test/engine-integration.test.js +297 -0
- package/out/test/enginePaths.test.js +195 -0
- package/out/test/enginePublish.test.js +82 -0
- package/out/test/fleetDisplayUtils.test.js +96 -0
- package/out/test/gateway-client.test.js +381 -0
- package/out/test/gateway-lifecycle.test.js +608 -0
- package/out/test/gateway-outbound.test.js +531 -0
- package/out/test/gateway-reset-mappings.test.js +221 -0
- package/out/test/gateway-route-index.test.js +235 -0
- package/out/test/gateway-session-routing.test.js +47 -0
- package/out/test/gateway-session-store.test.js +216 -0
- package/out/test/github.test.js +232 -0
- package/out/test/headless-sync.test.js +279 -0
- package/out/test/helpers/manifest-fixtures.js +27 -0
- package/out/test/mcp-obo.test.js +82 -0
- package/out/test/mcp.test.js +307 -0
- package/out/test/openclaw-channel-routing.test.js +191 -0
- package/out/test/pathSafety.test.js +63 -0
- package/out/test/permissions.test.js +175 -0
- package/out/test/persistent-engine-worker.test.js +220 -0
- package/out/test/refreshPolicy.test.js +60 -0
- package/out/test/registry.test.js +351 -0
- package/out/test/runtime.test.js +349 -0
- package/out/test/scheduledFleetStorage.test.js +72 -0
- package/out/test/serve-hardening.test.js +192 -0
- package/out/test/serveClient.test.js +173 -0
- package/out/test/sessionJsonlFleet.test.js +78 -0
- package/out/test/shared.test.js +173 -0
- package/out/test/skills-mcp.test.js +299 -0
- package/out/test/spotlightPublish.test.js +299 -0
- package/out/test/spotlightYaml.test.js +58 -0
- package/out/test/state-sync-peer.test.js +74 -0
- package/out/test/store.test.js +331 -0
- package/out/test/stores.test.js +504 -0
- package/out/test/sync-switch.test.js +251 -0
- package/out/test/teamViewDiscovery.test.js +90 -0
- package/out/test/toolPath.test.js +120 -0
- package/out/test/utils.test.js +308 -0
- package/out/test/viewsConfigMerge.test.js +180 -0
- package/out/test/windows-command-line.test.js +75 -0
- package/out/utils/agentEnvFile.js +131 -0
- package/out/utils/binary.js +175 -0
- package/out/utils/index.js +37 -0
- package/out/utils/network.js +74 -0
- package/out/utils/pathSafety.js +60 -0
- package/out/utils/paths.js +116 -0
- package/out/utils/pid.js +180 -0
- package/out/utils/pythonRunner.js +258 -0
- package/out/utils/resolveNodeBinary.js +168 -0
- package/out/utils/toolPath.js +83 -0
- package/out/utils/windowsCommandLine.js +29 -0
- package/out/utils.js +915 -0
- package/out/workspaceFolders.js +59 -0
- package/package.json +41 -0
|
@@ -0,0 +1,854 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
#
|
|
3
|
+
# Copyright (c) AgentHippo.ai. All rights reserved.
|
|
4
|
+
#
|
|
5
|
+
# AgentHippo Spotlight Setup Wizard
|
|
6
|
+
#
|
|
7
|
+
# Interactive setup for lightweight Spotlight observability (OTEL + DuckDB)
|
|
8
|
+
#
|
|
9
|
+
# Usage:
|
|
10
|
+
# ./setup-analytics.sh # Interactive setup
|
|
11
|
+
# ./setup-analytics.sh --yes # Non-interactive (accept defaults)
|
|
12
|
+
# ./setup-analytics.sh --check # Check status only
|
|
13
|
+
# ./setup-analytics.sh --uninstall # Remove Spotlight setup
|
|
14
|
+
#
|
|
15
|
+
|
|
16
|
+
set -euo pipefail
|
|
17
|
+
|
|
18
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
19
|
+
# AGENT_HOME_DIR is set by the extension with the branded directory path
|
|
20
|
+
# Falls back to ~/.agent-hippo for manual script runs
|
|
21
|
+
AGENT_HOME_DIR="${AGENT_HOME_DIR:-$HOME/.agent-hippo}"
|
|
22
|
+
ANALYTICS_DIR="${AGENT_HOME_DIR}/analytics"
|
|
23
|
+
BIN_DIR="${AGENT_HOME_DIR}/bin"
|
|
24
|
+
|
|
25
|
+
# Prepend common tool install locations so uv/python are discoverable when this
|
|
26
|
+
# script runs from a GUI-launched context (VS Code task, IDE command) where the
|
|
27
|
+
# inherited PATH is minimal. Mirrors extensions/agentide/src/utils/toolPath.ts.
|
|
28
|
+
augment_path_for_tools() {
|
|
29
|
+
local extra
|
|
30
|
+
for extra in \
|
|
31
|
+
"$HOME/.local/bin" \
|
|
32
|
+
"$HOME/.cargo/bin" \
|
|
33
|
+
"$HOME/.uv/bin" \
|
|
34
|
+
"/opt/homebrew/bin" \
|
|
35
|
+
"/usr/local/bin" \
|
|
36
|
+
"/home/linuxbrew/.linuxbrew/bin"; do
|
|
37
|
+
if [ -d "$extra" ] && [[ ":$PATH:" != *":$extra:"* ]]; then
|
|
38
|
+
PATH="$extra:$PATH"
|
|
39
|
+
fi
|
|
40
|
+
done
|
|
41
|
+
export PATH
|
|
42
|
+
}
|
|
43
|
+
augment_path_for_tools
|
|
44
|
+
|
|
45
|
+
# Colors
|
|
46
|
+
RED='\033[0;31m'
|
|
47
|
+
GREEN='\033[0;32m'
|
|
48
|
+
YELLOW='\033[1;33m'
|
|
49
|
+
BLUE='\033[0;34m'
|
|
50
|
+
CYAN='\033[0;36m'
|
|
51
|
+
BOLD='\033[1m'
|
|
52
|
+
NC='\033[0m'
|
|
53
|
+
|
|
54
|
+
# Flags
|
|
55
|
+
AUTO_YES=false
|
|
56
|
+
CHECK_ONLY=false
|
|
57
|
+
UNINSTALL=false
|
|
58
|
+
RESTART_LITELLM=false
|
|
59
|
+
|
|
60
|
+
# Parse arguments
|
|
61
|
+
for arg in "$@"; do
|
|
62
|
+
case $arg in
|
|
63
|
+
--yes|-y)
|
|
64
|
+
AUTO_YES=true
|
|
65
|
+
;;
|
|
66
|
+
--check|-c)
|
|
67
|
+
CHECK_ONLY=true
|
|
68
|
+
;;
|
|
69
|
+
--uninstall)
|
|
70
|
+
UNINSTALL=true
|
|
71
|
+
;;
|
|
72
|
+
--restart-litellm)
|
|
73
|
+
RESTART_LITELLM=true
|
|
74
|
+
;;
|
|
75
|
+
--help|-h)
|
|
76
|
+
echo "Usage: $0 [options]"
|
|
77
|
+
echo ""
|
|
78
|
+
echo "Options:"
|
|
79
|
+
echo " (none) Interactive setup wizard"
|
|
80
|
+
echo " --yes, -y Non-interactive (accept all defaults)"
|
|
81
|
+
echo " --check, -c Check installation status only"
|
|
82
|
+
echo " --uninstall Remove Spotlight setup"
|
|
83
|
+
echo " --restart-litellm Force restart LiteLLM to reload config"
|
|
84
|
+
echo " --help, -h Show this help"
|
|
85
|
+
exit 0
|
|
86
|
+
;;
|
|
87
|
+
esac
|
|
88
|
+
done
|
|
89
|
+
|
|
90
|
+
# Logging functions
|
|
91
|
+
log_info() { echo -e "${BLUE}[INFO]${NC} $1"; }
|
|
92
|
+
log_success() { echo -e "${GREEN} ✓${NC} $1"; }
|
|
93
|
+
log_warn() { echo -e "${YELLOW} ✗${NC} $1"; }
|
|
94
|
+
log_error() { echo -e "${RED}[ERROR]${NC} $1"; }
|
|
95
|
+
log_step() { echo -e "\n${BOLD}${CYAN}$1${NC}"; }
|
|
96
|
+
|
|
97
|
+
# Prompt function (respects --yes flag)
|
|
98
|
+
prompt_yn() {
|
|
99
|
+
local prompt="$1"
|
|
100
|
+
local default="${2:-y}"
|
|
101
|
+
|
|
102
|
+
if [[ "$AUTO_YES" == true ]]; then
|
|
103
|
+
return 0
|
|
104
|
+
fi
|
|
105
|
+
|
|
106
|
+
# Non-interactive fallback: honor default when prompts are not available.
|
|
107
|
+
if [[ ! -t 0 ]]; then
|
|
108
|
+
[[ "$default" =~ ^[Yy] ]]
|
|
109
|
+
return 0
|
|
110
|
+
fi
|
|
111
|
+
|
|
112
|
+
local yn_hint="[Y/n]"
|
|
113
|
+
[[ "$default" == "n" ]] && yn_hint="[y/N]"
|
|
114
|
+
|
|
115
|
+
read -r -p "$prompt $yn_hint " response
|
|
116
|
+
response="${response:-$default}"
|
|
117
|
+
|
|
118
|
+
[[ "$response" =~ ^[Yy] ]]
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
# Resolve canonical LiteLLM OTEL template path.
|
|
122
|
+
# In a repository checkout, prefer <repo>/scripts/analytics/agentide-litellm-otel.config.yaml when present.
|
|
123
|
+
# Otherwise use the template bundled next to this script (extension / packaged output).
|
|
124
|
+
resolve_litellm_template() {
|
|
125
|
+
local rel_path="scripts/analytics/agentide-litellm-otel.config.yaml"
|
|
126
|
+
local current="$SCRIPT_DIR"
|
|
127
|
+
|
|
128
|
+
while [[ "$current" != "/" ]]; do
|
|
129
|
+
if [[ -e "${current}/.git" ]]; then
|
|
130
|
+
local repo_candidate="${current}/${rel_path}"
|
|
131
|
+
if [[ -f "$repo_candidate" ]]; then
|
|
132
|
+
echo "$repo_candidate"
|
|
133
|
+
return 0
|
|
134
|
+
fi
|
|
135
|
+
fi
|
|
136
|
+
current="$(dirname "$current")"
|
|
137
|
+
done
|
|
138
|
+
|
|
139
|
+
local bundled_template="${SCRIPT_DIR}/agentide-litellm-otel.config.yaml"
|
|
140
|
+
if [[ -f "$bundled_template" ]]; then
|
|
141
|
+
echo "$bundled_template"
|
|
142
|
+
return 0
|
|
143
|
+
fi
|
|
144
|
+
|
|
145
|
+
return 1
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
# Resolve LiteLLM hook source path.
|
|
149
|
+
# Handles three layouts:
|
|
150
|
+
# 1. Packaged extension: out/scripts/analytics/setup-analytics.sh -> ../agentide_litellm_hooks_v1.py
|
|
151
|
+
# 2. Source checkout (scripts/analytics/): ../../scripts/agentide_litellm_hooks_v1.py via repo walk
|
|
152
|
+
# 3. Bundled-alongside dev mode: same dir as this script
|
|
153
|
+
resolve_litellm_hooks() {
|
|
154
|
+
local current="$SCRIPT_DIR"
|
|
155
|
+
|
|
156
|
+
# Use -s to skip empty placeholder files that may exist in some source trees.
|
|
157
|
+
local direct_candidates=(
|
|
158
|
+
"${SCRIPT_DIR}/agentide_litellm_hooks_v1.py"
|
|
159
|
+
"${SCRIPT_DIR}/../agentide_litellm_hooks_v1.py"
|
|
160
|
+
"${SCRIPT_DIR}/../scripts/agentide_litellm_hooks_v1.py"
|
|
161
|
+
)
|
|
162
|
+
for candidate in "${direct_candidates[@]}"; do
|
|
163
|
+
if [[ -s "$candidate" ]]; then
|
|
164
|
+
echo "$candidate"
|
|
165
|
+
return 0
|
|
166
|
+
fi
|
|
167
|
+
done
|
|
168
|
+
|
|
169
|
+
# Repo-root walk: try both VS Code-style and plain layouts.
|
|
170
|
+
local rel_paths=(
|
|
171
|
+
"scripts/agentide_litellm_hooks_v1.py"
|
|
172
|
+
"vscode/scripts/agentide_litellm_hooks_v1.py"
|
|
173
|
+
)
|
|
174
|
+
while [[ "$current" != "/" ]]; do
|
|
175
|
+
if [[ -e "${current}/.git" ]]; then
|
|
176
|
+
for rel_path in "${rel_paths[@]}"; do
|
|
177
|
+
local repo_candidate="${current}/${rel_path}"
|
|
178
|
+
if [[ -s "$repo_candidate" ]]; then
|
|
179
|
+
echo "$repo_candidate"
|
|
180
|
+
return 0
|
|
181
|
+
fi
|
|
182
|
+
done
|
|
183
|
+
fi
|
|
184
|
+
current="$(dirname "$current")"
|
|
185
|
+
done
|
|
186
|
+
|
|
187
|
+
return 1
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
# Check prerequisites
|
|
192
|
+
check_prerequisites() {
|
|
193
|
+
log_step "Checking prerequisites..."
|
|
194
|
+
|
|
195
|
+
local all_good=true
|
|
196
|
+
|
|
197
|
+
# curl (for downloads)
|
|
198
|
+
if command -v curl &>/dev/null; then
|
|
199
|
+
log_success "curl available"
|
|
200
|
+
else
|
|
201
|
+
log_warn "curl not found (required for downloads)"
|
|
202
|
+
all_good=false
|
|
203
|
+
fi
|
|
204
|
+
|
|
205
|
+
# uv (Python package manager — used for LiteLLM and analytics chart scripts)
|
|
206
|
+
if command -v uv &>/dev/null; then
|
|
207
|
+
log_success "uv available ($(uv --version 2>/dev/null || echo 'unknown version'))"
|
|
208
|
+
else
|
|
209
|
+
log_warn "uv not found (required for LiteLLM and analytics scripts)"
|
|
210
|
+
if command -v curl &>/dev/null; then
|
|
211
|
+
if prompt_yn "Install uv now? (recommended)" "y"; then
|
|
212
|
+
log_info "Installing uv..."
|
|
213
|
+
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
214
|
+
# Source the env so uv is available in this session
|
|
215
|
+
export PATH="$HOME/.local/bin:$HOME/.cargo/bin:$PATH"
|
|
216
|
+
if command -v uv &>/dev/null; then
|
|
217
|
+
log_success "uv installed ($(uv --version 2>/dev/null || echo 'unknown version'))"
|
|
218
|
+
else
|
|
219
|
+
log_warn "uv install completed but binary not found in PATH"
|
|
220
|
+
echo " You may need to restart your terminal or add ~/.local/bin to PATH"
|
|
221
|
+
all_good=false
|
|
222
|
+
fi
|
|
223
|
+
else
|
|
224
|
+
echo " Manual install: curl -LsSf https://astral.sh/uv/install.sh | sh"
|
|
225
|
+
all_good=false
|
|
226
|
+
fi
|
|
227
|
+
else
|
|
228
|
+
echo " Install manually: https://docs.astral.sh/uv/getting-started/installation/"
|
|
229
|
+
all_good=false
|
|
230
|
+
fi
|
|
231
|
+
fi
|
|
232
|
+
|
|
233
|
+
$all_good
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
# Check installed components
|
|
237
|
+
check_installed() {
|
|
238
|
+
log_step "Checking installed components..."
|
|
239
|
+
|
|
240
|
+
local all_installed=true
|
|
241
|
+
|
|
242
|
+
# OTEL Collector binary
|
|
243
|
+
if command -v otelcol-contrib &>/dev/null; then
|
|
244
|
+
log_success "OTEL Collector installed (system)"
|
|
245
|
+
elif [[ -x "${BIN_DIR}/otelcol-contrib" ]]; then
|
|
246
|
+
log_success "OTEL Collector installed (${BIN_DIR})"
|
|
247
|
+
else
|
|
248
|
+
log_warn "OTEL Collector not installed"
|
|
249
|
+
all_installed=false
|
|
250
|
+
fi
|
|
251
|
+
|
|
252
|
+
# DuckDB binary
|
|
253
|
+
if command -v duckdb &>/dev/null; then
|
|
254
|
+
log_success "DuckDB installed (system)"
|
|
255
|
+
elif [[ -x "${BIN_DIR}/duckdb" ]]; then
|
|
256
|
+
log_success "DuckDB installed (${BIN_DIR})"
|
|
257
|
+
else
|
|
258
|
+
log_warn "DuckDB not installed"
|
|
259
|
+
all_installed=false
|
|
260
|
+
fi
|
|
261
|
+
|
|
262
|
+
# OTEL Collector config
|
|
263
|
+
if [[ -f "${ANALYTICS_DIR}/config/otel-collector.yaml" ]]; then
|
|
264
|
+
log_success "OTEL Collector config present"
|
|
265
|
+
else
|
|
266
|
+
log_warn "OTEL Collector config not found"
|
|
267
|
+
all_installed=false
|
|
268
|
+
fi
|
|
269
|
+
|
|
270
|
+
# OTEL Collector running?
|
|
271
|
+
if [[ -f "${ANALYTICS_DIR}/otelcol.pid" ]]; then
|
|
272
|
+
local pid=$(cat "${ANALYTICS_DIR}/otelcol.pid")
|
|
273
|
+
if kill -0 "$pid" 2>/dev/null; then
|
|
274
|
+
log_success "OTEL Collector running (PID: $pid)"
|
|
275
|
+
else
|
|
276
|
+
log_warn "OTEL Collector not running (stale PID file)"
|
|
277
|
+
all_installed=false
|
|
278
|
+
fi
|
|
279
|
+
else
|
|
280
|
+
log_warn "OTEL Collector not running"
|
|
281
|
+
all_installed=false
|
|
282
|
+
fi
|
|
283
|
+
|
|
284
|
+
# Traces directory
|
|
285
|
+
if [[ -d "${ANALYTICS_DIR}/traces" ]]; then
|
|
286
|
+
local trace_count=$(find "${ANALYTICS_DIR}/traces" -name "*.jsonl" 2>/dev/null | wc -l | tr -d ' ')
|
|
287
|
+
if [[ "$trace_count" -gt 0 ]]; then
|
|
288
|
+
local trace_size=$(du -sh "${ANALYTICS_DIR}/traces" 2>/dev/null | cut -f1)
|
|
289
|
+
log_success "Traces directory: ${trace_count} files (${trace_size})"
|
|
290
|
+
else
|
|
291
|
+
log_success "Traces directory exists (empty)"
|
|
292
|
+
fi
|
|
293
|
+
else
|
|
294
|
+
log_warn "Traces directory not created"
|
|
295
|
+
fi
|
|
296
|
+
|
|
297
|
+
# LiteLLM OTEL config
|
|
298
|
+
local source_config=""
|
|
299
|
+
if [[ -f "${AGENT_HOME_DIR}/litellm-otel.yaml" ]]; then
|
|
300
|
+
log_success "LiteLLM OTEL config present"
|
|
301
|
+
elif source_config="$(resolve_litellm_template)"; then
|
|
302
|
+
log_warn "LiteLLM OTEL config not initialized (template exists)"
|
|
303
|
+
all_installed=false
|
|
304
|
+
else
|
|
305
|
+
log_warn "LiteLLM OTEL config template not found"
|
|
306
|
+
all_installed=false
|
|
307
|
+
fi
|
|
308
|
+
|
|
309
|
+
# LiteLLM running with OTEL?
|
|
310
|
+
local litellm_status=0
|
|
311
|
+
check_litellm || litellm_status=$?
|
|
312
|
+
case $litellm_status in
|
|
313
|
+
0)
|
|
314
|
+
local litellm_url
|
|
315
|
+
litellm_url="$(get_litellm_url)"
|
|
316
|
+
if [[ -n "$litellm_url" ]]; then
|
|
317
|
+
log_success "LiteLLM running with OTEL at $litellm_url"
|
|
318
|
+
else
|
|
319
|
+
log_success "LiteLLM running with OTEL"
|
|
320
|
+
fi
|
|
321
|
+
;;
|
|
322
|
+
1)
|
|
323
|
+
local litellm_url
|
|
324
|
+
litellm_url="$(get_litellm_url)"
|
|
325
|
+
if [[ -n "$litellm_url" ]]; then
|
|
326
|
+
log_warn "LiteLLM running without OTEL at $litellm_url"
|
|
327
|
+
else
|
|
328
|
+
log_warn "LiteLLM running without OTEL"
|
|
329
|
+
fi
|
|
330
|
+
all_installed=false
|
|
331
|
+
;;
|
|
332
|
+
2)
|
|
333
|
+
log_warn "LiteLLM not running"
|
|
334
|
+
all_installed=false
|
|
335
|
+
;;
|
|
336
|
+
*)
|
|
337
|
+
log_warn "Could not determine LiteLLM status (exit code: $litellm_status)"
|
|
338
|
+
all_installed=false
|
|
339
|
+
;;
|
|
340
|
+
esac
|
|
341
|
+
|
|
342
|
+
echo ""
|
|
343
|
+
if $all_installed; then
|
|
344
|
+
echo -e "${GREEN}${BOLD}Spotlight is fully configured and running!${NC}"
|
|
345
|
+
return 0
|
|
346
|
+
else
|
|
347
|
+
echo -e "${YELLOW}${BOLD}Spotlight is not fully installed.${NC}"
|
|
348
|
+
return 1
|
|
349
|
+
fi
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
# Run installation
|
|
353
|
+
run_install() {
|
|
354
|
+
log_step "Installing analytics components..."
|
|
355
|
+
|
|
356
|
+
if [[ -f "${SCRIPT_DIR}/install-analytics.sh" ]]; then
|
|
357
|
+
bash "${SCRIPT_DIR}/install-analytics.sh"
|
|
358
|
+
else
|
|
359
|
+
log_error "install-analytics.sh not found at ${SCRIPT_DIR}"
|
|
360
|
+
exit 1
|
|
361
|
+
fi
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
# Setup configuration
|
|
365
|
+
setup_config() {
|
|
366
|
+
log_step "Setting up configuration..."
|
|
367
|
+
|
|
368
|
+
# Create directories
|
|
369
|
+
mkdir -p "${AGENT_HOME_DIR}"
|
|
370
|
+
mkdir -p "${ANALYTICS_DIR}/config"
|
|
371
|
+
mkdir -p "${ANALYTICS_DIR}/traces"
|
|
372
|
+
|
|
373
|
+
# Copy OTEL Collector config if not present
|
|
374
|
+
if [[ ! -f "${ANALYTICS_DIR}/config/otel-collector.yaml" ]]; then
|
|
375
|
+
if [[ -f "${SCRIPT_DIR}/otel-collector.yaml" ]]; then
|
|
376
|
+
cp "${SCRIPT_DIR}/otel-collector.yaml" "${ANALYTICS_DIR}/config/"
|
|
377
|
+
log_success "Copied OTEL Collector config"
|
|
378
|
+
fi
|
|
379
|
+
else
|
|
380
|
+
log_success "OTEL Collector config already present"
|
|
381
|
+
fi
|
|
382
|
+
|
|
383
|
+
# Initialize user-owned LiteLLM OTEL config
|
|
384
|
+
local litellm_config="${AGENT_HOME_DIR}/litellm-otel.yaml"
|
|
385
|
+
local source_config=""
|
|
386
|
+
|
|
387
|
+
if ! source_config="$(resolve_litellm_template)"; then
|
|
388
|
+
log_warn "LiteLLM OTEL template not found; skipping config initialization"
|
|
389
|
+
return
|
|
390
|
+
fi
|
|
391
|
+
|
|
392
|
+
# Migration: older setups created a symlink into bundled templates.
|
|
393
|
+
# Convert it to a regular file so user edits persist across sessions.
|
|
394
|
+
if [[ -L "$litellm_config" ]]; then
|
|
395
|
+
local tmp_config="${litellm_config}.tmp.$$"
|
|
396
|
+
if cp -fL "$litellm_config" "$tmp_config" 2>/dev/null; then
|
|
397
|
+
rm -f "$litellm_config"
|
|
398
|
+
mv "$tmp_config" "$litellm_config"
|
|
399
|
+
log_success "Migrated LiteLLM OTEL config from symlink to local file"
|
|
400
|
+
else
|
|
401
|
+
rm -f "$tmp_config" 2>/dev/null || true
|
|
402
|
+
rm -f "$litellm_config"
|
|
403
|
+
log_warn "Removed broken LiteLLM OTEL config symlink"
|
|
404
|
+
fi
|
|
405
|
+
fi
|
|
406
|
+
|
|
407
|
+
if [[ ! -f "$litellm_config" ]]; then
|
|
408
|
+
cp "$source_config" "$litellm_config"
|
|
409
|
+
log_success "Created LiteLLM OTEL config from template"
|
|
410
|
+
else
|
|
411
|
+
log_success "LiteLLM OTEL config already present (user-owned)"
|
|
412
|
+
fi
|
|
413
|
+
|
|
414
|
+
# Keep canonical template in sync with user edits when writable.
|
|
415
|
+
if [[ -f "$source_config" ]] && ! cmp -s "$litellm_config" "$source_config"; then
|
|
416
|
+
if cp "$litellm_config" "$source_config" 2>/dev/null; then
|
|
417
|
+
log_success "Synced LiteLLM OTEL config back to source template"
|
|
418
|
+
else
|
|
419
|
+
log_info "Using user-owned LiteLLM config (source template is read-only)"
|
|
420
|
+
fi
|
|
421
|
+
fi
|
|
422
|
+
# Install LiteLLM hook for tool order sanitizer
|
|
423
|
+
local hooks_target="${AGENT_HOME_DIR}/agentide_litellm_hooks_v1.py"
|
|
424
|
+
local hooks_source=""
|
|
425
|
+
|
|
426
|
+
if hooks_source="$(resolve_litellm_hooks)"; then
|
|
427
|
+
if [[ ! -f "$hooks_target" ]] || ! cmp -s "$hooks_target" "$hooks_source"; then
|
|
428
|
+
cp "$hooks_source" "$hooks_target"
|
|
429
|
+
log_success "Installed LiteLLM tool order sanitizer hook"
|
|
430
|
+
else
|
|
431
|
+
log_success "LiteLLM tool order sanitizer hook already present"
|
|
432
|
+
fi
|
|
433
|
+
else
|
|
434
|
+
log_warn "LiteLLM tool order sanitizer hook not found; sanitizer callback may fail to import"
|
|
435
|
+
fi
|
|
436
|
+
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
# Start OTEL Collector
|
|
440
|
+
start_collector() {
|
|
441
|
+
log_step "Starting OTEL Collector..."
|
|
442
|
+
|
|
443
|
+
if [[ -f "${SCRIPT_DIR}/start-analytics.sh" ]]; then
|
|
444
|
+
FORCE=1 bash "${SCRIPT_DIR}/start-analytics.sh" --daemon
|
|
445
|
+
else
|
|
446
|
+
log_error "start-analytics.sh not found"
|
|
447
|
+
exit 1
|
|
448
|
+
fi
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
# Check if LiteLLM is running and its configuration
|
|
452
|
+
# Returns:
|
|
453
|
+
# 0 = running with OTEL
|
|
454
|
+
# 1 = running without OTEL
|
|
455
|
+
# 2 = not running
|
|
456
|
+
backfill_litellm_pid_file() {
|
|
457
|
+
local litellm_pid="$1"
|
|
458
|
+
local with_otel="$2"
|
|
459
|
+
local pid_file="${AGENT_HOME_DIR}/litellm.pid"
|
|
460
|
+
local tmp_file="${pid_file}.tmp.$$"
|
|
461
|
+
|
|
462
|
+
mkdir -p "${AGENT_HOME_DIR}" 2>/dev/null || true
|
|
463
|
+
printf '%s\n' "$litellm_pid" > "$tmp_file"
|
|
464
|
+
if [[ "$with_otel" == true ]]; then
|
|
465
|
+
printf '%s\n' "otel" >> "$tmp_file"
|
|
466
|
+
fi
|
|
467
|
+
|
|
468
|
+
if [[ ! -f "$pid_file" ]] || ! cmp -s "$tmp_file" "$pid_file"; then
|
|
469
|
+
mv "$tmp_file" "$pid_file"
|
|
470
|
+
else
|
|
471
|
+
rm -f "$tmp_file"
|
|
472
|
+
fi
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
check_litellm() {
|
|
476
|
+
local litellm_pid=""
|
|
477
|
+
local litellm_cmd=""
|
|
478
|
+
|
|
479
|
+
# Find LiteLLM process
|
|
480
|
+
litellm_pid=$(pgrep -f "litellm.*--config" 2>/dev/null | head -1 || true)
|
|
481
|
+
|
|
482
|
+
if [[ -z "$litellm_pid" ]]; then
|
|
483
|
+
log_info "LiteLLM process not found"
|
|
484
|
+
return 2 # Not running
|
|
485
|
+
fi
|
|
486
|
+
|
|
487
|
+
log_info "Found LiteLLM process (PID: $litellm_pid)"
|
|
488
|
+
|
|
489
|
+
# Get the command line to check config
|
|
490
|
+
litellm_cmd=$(ps -p "$litellm_pid" -o command= 2>/dev/null || true)
|
|
491
|
+
|
|
492
|
+
# Check if using OTEL config
|
|
493
|
+
if echo "$litellm_cmd" | grep -qE "(otel|OTEL)" 2>/dev/null; then
|
|
494
|
+
backfill_litellm_pid_file "$litellm_pid" true
|
|
495
|
+
log_info "LiteLLM is using OTEL config"
|
|
496
|
+
return 0 # Running with OTEL
|
|
497
|
+
else
|
|
498
|
+
backfill_litellm_pid_file "$litellm_pid" false
|
|
499
|
+
log_info "LiteLLM is NOT using OTEL config"
|
|
500
|
+
return 1 # Running without OTEL
|
|
501
|
+
fi
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
# Get LiteLLM PIDs
|
|
505
|
+
get_litellm_pids() {
|
|
506
|
+
pgrep -f "litellm" 2>/dev/null || true
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
# Stop LiteLLM gracefully
|
|
510
|
+
stop_litellm() {
|
|
511
|
+
local pids=$(get_litellm_pids)
|
|
512
|
+
if [[ -n "$pids" ]]; then
|
|
513
|
+
log_info "Stopping LiteLLM processes..."
|
|
514
|
+
echo "$pids" | xargs kill 2>/dev/null || true
|
|
515
|
+
sleep 2
|
|
516
|
+
# Force kill if still running
|
|
517
|
+
pids=$(get_litellm_pids)
|
|
518
|
+
if [[ -n "$pids" ]]; then
|
|
519
|
+
echo "$pids" | xargs kill -9 2>/dev/null || true
|
|
520
|
+
sleep 1
|
|
521
|
+
fi
|
|
522
|
+
fi
|
|
523
|
+
# Clean up PID file
|
|
524
|
+
rm -f "${AGENT_HOME_DIR}/litellm.pid" 2>/dev/null || true
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
# Start LiteLLM with OTEL config
|
|
528
|
+
start_litellm_with_otel() {
|
|
529
|
+
local otel_config="${AGENT_HOME_DIR}/litellm-otel.yaml"
|
|
530
|
+
local litellm_script=""
|
|
531
|
+
|
|
532
|
+
# Find the LiteLLM start script - check multiple locations
|
|
533
|
+
# 1. Relative to script (dev mode: scripts/analytics/ -> scripts/)
|
|
534
|
+
# 2. Relative to extension bundle (extensions/agentide/out/scripts/analytics/ -> vscode/scripts/)
|
|
535
|
+
# 3. Relative to workspace root
|
|
536
|
+
local search_paths=(
|
|
537
|
+
"${SCRIPT_DIR}/../agentide-litellm.sh"
|
|
538
|
+
"${SCRIPT_DIR}/../../scripts/agentide-litellm.sh"
|
|
539
|
+
"${SCRIPT_DIR}/../../../scripts/agentide-litellm.sh"
|
|
540
|
+
"${SCRIPT_DIR}/../../../../scripts/agentide-litellm.sh"
|
|
541
|
+
"${SCRIPT_DIR}/../../../../../scripts/agentide-litellm.sh"
|
|
542
|
+
)
|
|
543
|
+
|
|
544
|
+
for path in "${search_paths[@]}"; do
|
|
545
|
+
if [[ -f "$path" ]]; then
|
|
546
|
+
litellm_script="$path"
|
|
547
|
+
break
|
|
548
|
+
fi
|
|
549
|
+
done
|
|
550
|
+
|
|
551
|
+
if [[ -z "$litellm_script" ]]; then
|
|
552
|
+
log_warn "agentide-litellm.sh not found. Start LiteLLM manually:"
|
|
553
|
+
echo -e " ${CYAN}LITELLM_CONFIG_PATH=${otel_config} ./scripts/agentide-litellm.sh${NC}"
|
|
554
|
+
return 1
|
|
555
|
+
fi
|
|
556
|
+
|
|
557
|
+
log_info "Found LiteLLM script: $(basename "$litellm_script")"
|
|
558
|
+
log_info "Starting LiteLLM with OTEL config..."
|
|
559
|
+
log_info "Config: $otel_config"
|
|
560
|
+
# Start in background
|
|
561
|
+
LITELLM_CONFIG_PATH="$otel_config" nohup "$litellm_script" > /tmp/litellm-otel.log 2>&1 &
|
|
562
|
+
local litellm_pid=$!
|
|
563
|
+
|
|
564
|
+
# Write PID file with OTEL flag + base URL for fast status checks
|
|
565
|
+
local pid_file="${AGENT_HOME_DIR}/litellm.pid"
|
|
566
|
+
local litellm_host="${LITELLM_HOST:-127.0.0.1}"
|
|
567
|
+
local tls_enabled=true
|
|
568
|
+
case "${LITELLM_ENABLE_TLS:-true}" in
|
|
569
|
+
0|false|no|off) tls_enabled=false ;;
|
|
570
|
+
esac
|
|
571
|
+
local litellm_port="${LITELLM_PORT:-}"
|
|
572
|
+
if [[ -z "$litellm_port" ]]; then
|
|
573
|
+
if [[ "$tls_enabled" == true ]]; then
|
|
574
|
+
litellm_port="4443"
|
|
575
|
+
else
|
|
576
|
+
litellm_port="4000"
|
|
577
|
+
fi
|
|
578
|
+
fi
|
|
579
|
+
local litellm_scheme="http"
|
|
580
|
+
if [[ "$tls_enabled" == true ]]; then
|
|
581
|
+
litellm_scheme="https"
|
|
582
|
+
fi
|
|
583
|
+
local litellm_url="${litellm_scheme}://${litellm_host}:${litellm_port}"
|
|
584
|
+
echo -e "${litellm_pid}\notel\nurl=${litellm_url}" > "$pid_file"
|
|
585
|
+
log_info "LiteLLM PID: $litellm_pid (saved to $pid_file)"
|
|
586
|
+
log_info "LiteLLM URL: ${litellm_url}"
|
|
587
|
+
|
|
588
|
+
sleep 3
|
|
589
|
+
|
|
590
|
+
# Verify it started
|
|
591
|
+
if check_litellm; then
|
|
592
|
+
log_success "LiteLLM started with OTEL analytics"
|
|
593
|
+
return 0
|
|
594
|
+
else
|
|
595
|
+
log_error "Failed to start LiteLLM. Check /tmp/litellm-otel.log"
|
|
596
|
+
return 1
|
|
597
|
+
fi
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
# Configure LiteLLM for analytics
|
|
601
|
+
configure_litellm() {
|
|
602
|
+
log_step "Checking LiteLLM status..."
|
|
603
|
+
|
|
604
|
+
# Capture exit code without triggering set -e
|
|
605
|
+
local status=0
|
|
606
|
+
check_litellm || status=$?
|
|
607
|
+
|
|
608
|
+
case $status in
|
|
609
|
+
0)
|
|
610
|
+
if [[ "$RESTART_LITELLM" == true ]]; then
|
|
611
|
+
log_info "Force-restarting LiteLLM to reload OTEL config..."
|
|
612
|
+
stop_litellm
|
|
613
|
+
start_litellm_with_otel
|
|
614
|
+
else
|
|
615
|
+
log_success "LiteLLM is already running with OTEL analytics"
|
|
616
|
+
local litellm_url=$(get_litellm_url)
|
|
617
|
+
if [[ -n "$litellm_url" ]]; then
|
|
618
|
+
log_info "LiteLLM URL: $litellm_url"
|
|
619
|
+
fi
|
|
620
|
+
fi
|
|
621
|
+
;;
|
|
622
|
+
1)
|
|
623
|
+
log_warn "LiteLLM is running but NOT using OTEL config"
|
|
624
|
+
echo ""
|
|
625
|
+
if prompt_yn "Restart LiteLLM with OTEL analytics enabled?"; then
|
|
626
|
+
stop_litellm
|
|
627
|
+
start_litellm_with_otel
|
|
628
|
+
else
|
|
629
|
+
echo ""
|
|
630
|
+
echo -e "${BOLD}To enable OTEL manually, restart LiteLLM with:${NC}"
|
|
631
|
+
echo -e " ${CYAN}LITELLM_CONFIG_PATH=${AGENT_HOME_DIR}/litellm-otel.yaml ./scripts/agentide-litellm.sh${NC}"
|
|
632
|
+
fi
|
|
633
|
+
;;
|
|
634
|
+
2)
|
|
635
|
+
log_warn "LiteLLM is not running"
|
|
636
|
+
echo ""
|
|
637
|
+
if prompt_yn "Start LiteLLM with OTEL analytics enabled?"; then
|
|
638
|
+
start_litellm_with_otel
|
|
639
|
+
else
|
|
640
|
+
echo ""
|
|
641
|
+
echo -e "${BOLD}To start LiteLLM with analytics:${NC}"
|
|
642
|
+
echo -e " ${CYAN}LITELLM_CONFIG_PATH=${AGENT_HOME_DIR}/litellm-otel.yaml ./scripts/agentide-litellm.sh${NC}"
|
|
643
|
+
fi
|
|
644
|
+
;;
|
|
645
|
+
*)
|
|
646
|
+
log_warn "Could not determine LiteLLM status (exit code: $status)"
|
|
647
|
+
echo ""
|
|
648
|
+
echo -e "${BOLD}To start LiteLLM with analytics:${NC}"
|
|
649
|
+
echo -e " ${CYAN}LITELLM_CONFIG_PATH=${AGENT_HOME_DIR}/litellm-otel.yaml ./scripts/agentide-litellm.sh${NC}"
|
|
650
|
+
;;
|
|
651
|
+
esac
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
# Get LiteLLM URL if running
|
|
655
|
+
get_litellm_url() {
|
|
656
|
+
local litellm_cmd=$(ps aux | grep -E "litellm.*--port" | grep -v grep | head -1)
|
|
657
|
+
if [[ -z "$litellm_cmd" ]]; then
|
|
658
|
+
echo ""
|
|
659
|
+
return
|
|
660
|
+
fi
|
|
661
|
+
|
|
662
|
+
local port=$(echo "$litellm_cmd" | grep -oE "\-\-port [0-9]+" | awk '{print $2}')
|
|
663
|
+
local host=$(echo "$litellm_cmd" | grep -oE "\-\-host [^ ]+" | awk '{print $2}')
|
|
664
|
+
port="${port:-4000}"
|
|
665
|
+
host="${host:-127.0.0.1}"
|
|
666
|
+
|
|
667
|
+
# Check if using TLS
|
|
668
|
+
if echo "$litellm_cmd" | grep -q "ssl_certfile"; then
|
|
669
|
+
echo "https://${host}:${port}"
|
|
670
|
+
else
|
|
671
|
+
echo "http://${host}:${port}"
|
|
672
|
+
fi
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
# Print final status summary
|
|
676
|
+
print_status_summary() {
|
|
677
|
+
echo ""
|
|
678
|
+
echo -e "${BOLD}Status Summary:${NC}"
|
|
679
|
+
echo "─────────────────────────────────────"
|
|
680
|
+
|
|
681
|
+
# DuckDB
|
|
682
|
+
if command -v duckdb &> /dev/null || [[ -x "${BIN_DIR}/duckdb" ]]; then
|
|
683
|
+
echo -e " ${GREEN}✓${NC} DuckDB ready"
|
|
684
|
+
else
|
|
685
|
+
echo -e " ${RED}✗${NC} DuckDB not installed"
|
|
686
|
+
fi
|
|
687
|
+
|
|
688
|
+
# OTEL Collector binary
|
|
689
|
+
if command -v otelcol-contrib &> /dev/null || [[ -x "${BIN_DIR}/otelcol-contrib" ]]; then
|
|
690
|
+
echo -e " ${GREEN}✓${NC} OTEL Collector installed"
|
|
691
|
+
else
|
|
692
|
+
echo -e " ${RED}✗${NC} OTEL Collector not installed"
|
|
693
|
+
fi
|
|
694
|
+
|
|
695
|
+
# OTEL Collector running
|
|
696
|
+
if [[ -f "${ANALYTICS_DIR}/otelcol.pid" ]] && kill -0 "$(cat "${ANALYTICS_DIR}/otelcol.pid")" 2>/dev/null; then
|
|
697
|
+
echo -e " ${GREEN}✓${NC} OTEL Collector running (PID: $(cat "${ANALYTICS_DIR}/otelcol.pid"))"
|
|
698
|
+
else
|
|
699
|
+
echo -e " ${YELLOW}○${NC} OTEL Collector not running"
|
|
700
|
+
fi
|
|
701
|
+
|
|
702
|
+
# LiteLLM OTEL config
|
|
703
|
+
local source_config=""
|
|
704
|
+
if [[ -f "${AGENT_HOME_DIR}/litellm-otel.yaml" ]]; then
|
|
705
|
+
echo -e " ${GREEN}✓${NC} LiteLLM OTEL config present"
|
|
706
|
+
elif source_config="$(resolve_litellm_template)"; then
|
|
707
|
+
echo -e " ${YELLOW}○${NC} LiteLLM OTEL template found, config not initialized"
|
|
708
|
+
else
|
|
709
|
+
echo -e " ${YELLOW}○${NC} LiteLLM OTEL template not found"
|
|
710
|
+
fi
|
|
711
|
+
|
|
712
|
+
# LiteLLM status
|
|
713
|
+
local litellm_url=$(get_litellm_url)
|
|
714
|
+
if [[ -n "$litellm_url" ]]; then
|
|
715
|
+
if check_litellm; then
|
|
716
|
+
echo -e " ${GREEN}✓${NC} LiteLLM running with OTEL at ${CYAN}${litellm_url}${NC}"
|
|
717
|
+
else
|
|
718
|
+
echo -e " ${YELLOW}○${NC} LiteLLM running at ${litellm_url} (no OTEL)"
|
|
719
|
+
fi
|
|
720
|
+
else
|
|
721
|
+
echo -e " ${YELLOW}○${NC} LiteLLM not running"
|
|
722
|
+
fi
|
|
723
|
+
|
|
724
|
+
echo "─────────────────────────────────────"
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
# Print next steps
|
|
728
|
+
print_next_steps() {
|
|
729
|
+
echo ""
|
|
730
|
+
echo -e "${GREEN}${BOLD}==============================${NC}"
|
|
731
|
+
echo -e "${GREEN}${BOLD}✅ Spotlight setup complete!${NC}"
|
|
732
|
+
echo -e "${GREEN}${BOLD}==============================${NC}"
|
|
733
|
+
|
|
734
|
+
# Show status summary
|
|
735
|
+
print_status_summary
|
|
736
|
+
|
|
737
|
+
echo ""
|
|
738
|
+
echo -e "${BOLD}To query Spotlight data (this setup bundle):${NC}"
|
|
739
|
+
echo -e " ${CYAN}\"${SCRIPT_DIR}/query-analytics.sh\" --latest-session${NC}"
|
|
740
|
+
echo -e " ${CYAN}\"${SCRIPT_DIR}/query-analytics.sh\" --cost${NC}"
|
|
741
|
+
echo ""
|
|
742
|
+
echo -e "${BOLD}To check status:${NC}"
|
|
743
|
+
echo -e " ${CYAN}\"${SCRIPT_DIR}/start-analytics.sh\" --status${NC}"
|
|
744
|
+
echo ""
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
# Uninstall
|
|
748
|
+
do_uninstall() {
|
|
749
|
+
log_step "Uninstalling analytics..."
|
|
750
|
+
|
|
751
|
+
# Stop collector
|
|
752
|
+
if [[ -f "${SCRIPT_DIR}/start-analytics.sh" ]]; then
|
|
753
|
+
bash "${SCRIPT_DIR}/start-analytics.sh" --stop 2>/dev/null || true
|
|
754
|
+
fi
|
|
755
|
+
|
|
756
|
+
# Stop LiteLLM if running
|
|
757
|
+
stop_litellm 2>/dev/null || true
|
|
758
|
+
|
|
759
|
+
# Remove symlink from legacy installs, keep user-owned files
|
|
760
|
+
if [[ -L "${AGENT_HOME_DIR}/litellm-otel.yaml" ]]; then
|
|
761
|
+
rm -f "${AGENT_HOME_DIR}/litellm-otel.yaml"
|
|
762
|
+
log_success "Removed LiteLLM OTEL config symlink"
|
|
763
|
+
elif [[ -f "${AGENT_HOME_DIR}/litellm-otel.yaml" ]]; then
|
|
764
|
+
log_info "Kept user LiteLLM OTEL config at ${AGENT_HOME_DIR}/litellm-otel.yaml"
|
|
765
|
+
fi
|
|
766
|
+
|
|
767
|
+
# Ask about data
|
|
768
|
+
if [[ -d "${ANALYTICS_DIR}" ]]; then
|
|
769
|
+
echo ""
|
|
770
|
+
if prompt_yn "Remove Spotlight data (traces, configs)?" "n"; then
|
|
771
|
+
rm -rf "${ANALYTICS_DIR}"
|
|
772
|
+
log_success "Removed analytics directory"
|
|
773
|
+
else
|
|
774
|
+
log_info "Kept Spotlight data at ${ANALYTICS_DIR}"
|
|
775
|
+
fi
|
|
776
|
+
fi
|
|
777
|
+
|
|
778
|
+
# Ask about binaries
|
|
779
|
+
if [[ -d "${BIN_DIR}" ]]; then
|
|
780
|
+
echo ""
|
|
781
|
+
if prompt_yn "Remove installed binaries (otelcol-contrib, duckdb)?" "n"; then
|
|
782
|
+
rm -f "${BIN_DIR}/otelcol-contrib"
|
|
783
|
+
rm -f "${BIN_DIR}/duckdb"
|
|
784
|
+
rmdir "${BIN_DIR}" 2>/dev/null || true
|
|
785
|
+
log_success "Removed binaries"
|
|
786
|
+
else
|
|
787
|
+
log_info "Kept binaries at ${BIN_DIR}"
|
|
788
|
+
fi
|
|
789
|
+
fi
|
|
790
|
+
|
|
791
|
+
echo ""
|
|
792
|
+
log_success "Spotlight uninstalled"
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
# Main
|
|
796
|
+
main() {
|
|
797
|
+
echo ""
|
|
798
|
+
echo -e "${BOLD}🦛 AgentHippo Spotlight Setup${NC}"
|
|
799
|
+
echo "=============================="
|
|
800
|
+
|
|
801
|
+
# Handle uninstall
|
|
802
|
+
if [[ "$UNINSTALL" == true ]]; then
|
|
803
|
+
do_uninstall
|
|
804
|
+
exit 0
|
|
805
|
+
fi
|
|
806
|
+
|
|
807
|
+
# Check-only mode
|
|
808
|
+
if [[ "$CHECK_ONLY" == true ]]; then
|
|
809
|
+
check_installed
|
|
810
|
+
exit $?
|
|
811
|
+
fi
|
|
812
|
+
|
|
813
|
+
# Check prerequisites
|
|
814
|
+
if ! check_prerequisites; then
|
|
815
|
+
echo ""
|
|
816
|
+
log_error "Prerequisites not met. Please install missing tools and try again."
|
|
817
|
+
exit 1
|
|
818
|
+
fi
|
|
819
|
+
|
|
820
|
+
# Check current status
|
|
821
|
+
if check_installed; then
|
|
822
|
+
echo ""
|
|
823
|
+
if ! prompt_yn "Spotlight is already set up. Reconfigure?" "n"; then
|
|
824
|
+
echo ""
|
|
825
|
+
log_info "No changes made."
|
|
826
|
+
exit 0
|
|
827
|
+
fi
|
|
828
|
+
fi
|
|
829
|
+
|
|
830
|
+
# Prompt for installation
|
|
831
|
+
echo ""
|
|
832
|
+
if ! prompt_yn "Install/update analytics stack?"; then
|
|
833
|
+
echo ""
|
|
834
|
+
log_info "Setup cancelled."
|
|
835
|
+
exit 0
|
|
836
|
+
fi
|
|
837
|
+
|
|
838
|
+
# Run installation
|
|
839
|
+
run_install
|
|
840
|
+
|
|
841
|
+
# Setup configuration
|
|
842
|
+
setup_config
|
|
843
|
+
|
|
844
|
+
# Start collector
|
|
845
|
+
start_collector
|
|
846
|
+
|
|
847
|
+
# Configure LiteLLM
|
|
848
|
+
configure_litellm
|
|
849
|
+
|
|
850
|
+
# Print next steps
|
|
851
|
+
print_next_steps
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
main "$@"
|