@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,919 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) AgentHippo.ai. All rights reserved.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.storeCommand = storeCommand;
|
|
40
|
+
exports.resolvePublishBundleMode = resolvePublishBundleMode;
|
|
41
|
+
/**
|
|
42
|
+
* Store Command - Search and install from the store
|
|
43
|
+
*
|
|
44
|
+
* Commands:
|
|
45
|
+
* agenthippo store search <query> Search for skills/packs/mcp/engines
|
|
46
|
+
* agenthippo store install <type/slug> Install from store
|
|
47
|
+
* agenthippo store publish <type/slug> Publish engine or Spotlight view
|
|
48
|
+
* agenthippo store publish view/<id>[@ver] [--bundle full|scripts-only] [--full]
|
|
49
|
+
* agenthippo store uninstall engine/<slug> Uninstall a custom engine
|
|
50
|
+
* agenthippo store info <type/slug> Show artifact details
|
|
51
|
+
*/
|
|
52
|
+
const fs = __importStar(require("fs/promises"));
|
|
53
|
+
const path = __importStar(require("path"));
|
|
54
|
+
const os = __importStar(require("os"));
|
|
55
|
+
const zlib_1 = require("zlib");
|
|
56
|
+
const branding_1 = require("../../branding");
|
|
57
|
+
const index_1 = require("../../registry/index");
|
|
58
|
+
const shared_1 = require("../../store/shared");
|
|
59
|
+
const install_1 = require("../../engines/install");
|
|
60
|
+
const publish_1 = require("../../engines/publish");
|
|
61
|
+
const index_2 = require("../../store/index");
|
|
62
|
+
const publish_2 = require("../../spotlight/publish");
|
|
63
|
+
// -----------------------------------------------------------------------------
|
|
64
|
+
// Configuration
|
|
65
|
+
// -----------------------------------------------------------------------------
|
|
66
|
+
/**
|
|
67
|
+
* Get store configuration from environment variables with defaults.
|
|
68
|
+
*
|
|
69
|
+
* Environment variables (CLI only; agentide.storeRepo in VS Code settings is not read here):
|
|
70
|
+
* AGENTHIPPO_STORE_REPO - GitHub repo (e.g., "myorg/my-store")
|
|
71
|
+
* AGENTHIPPO_STORE_URL - Direct index URL (overrides repo-based URL)
|
|
72
|
+
*/
|
|
73
|
+
function getStoreConfig() {
|
|
74
|
+
const repoEnv = process.env.AGENTHIPPO_STORE_REPO;
|
|
75
|
+
let owner = shared_1.DEFAULT_STORE_OWNER;
|
|
76
|
+
let repo = shared_1.DEFAULT_STORE_REPO;
|
|
77
|
+
if (repoEnv) {
|
|
78
|
+
const parts = repoEnv.split('/');
|
|
79
|
+
if (parts.length === 2) {
|
|
80
|
+
owner = parts[0];
|
|
81
|
+
repo = parts[1];
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return {
|
|
85
|
+
owner,
|
|
86
|
+
repo,
|
|
87
|
+
defaultBranch: shared_1.DEFAULT_STORE_BRANCH,
|
|
88
|
+
paths: shared_1.STORE_PATHS,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
function getIndexUrl() {
|
|
92
|
+
// Direct URL override
|
|
93
|
+
if (process.env.AGENTHIPPO_STORE_URL) {
|
|
94
|
+
return process.env.AGENTHIPPO_STORE_URL;
|
|
95
|
+
}
|
|
96
|
+
const config = getStoreConfig();
|
|
97
|
+
return `https://${config.owner}.github.io/${config.repo}/store-index.json`;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Get GitHub token for private repo access.
|
|
101
|
+
* Checks: GITHUB_TOKEN, GH_TOKEN, AGENTHIPPO_GITHUB_TOKEN
|
|
102
|
+
*/
|
|
103
|
+
function getGitHubToken() {
|
|
104
|
+
return process.env.GITHUB_TOKEN
|
|
105
|
+
|| process.env.GH_TOKEN
|
|
106
|
+
|| process.env.AGENTHIPPO_GITHUB_TOKEN;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Make authenticated GitHub API request (if token available).
|
|
110
|
+
*/
|
|
111
|
+
async function githubFetch(url, options = {}) {
|
|
112
|
+
const token = getGitHubToken();
|
|
113
|
+
const headers = {
|
|
114
|
+
'User-Agent': 'AgentHippo-CLI',
|
|
115
|
+
Accept: 'application/vnd.github.v3+json',
|
|
116
|
+
...(options.headers || {}),
|
|
117
|
+
};
|
|
118
|
+
if (token) {
|
|
119
|
+
headers.Authorization = `Bearer ${token}`;
|
|
120
|
+
}
|
|
121
|
+
return fetch(url, {
|
|
122
|
+
...options,
|
|
123
|
+
headers,
|
|
124
|
+
redirect: 'follow',
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
// -----------------------------------------------------------------------------
|
|
128
|
+
// Console Logger (CLI-compatible)
|
|
129
|
+
// -----------------------------------------------------------------------------
|
|
130
|
+
const cliLogger = {
|
|
131
|
+
appendLine: (msg) => {
|
|
132
|
+
if (process.env.VERBOSE === '1') {
|
|
133
|
+
console.error(msg);
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
};
|
|
137
|
+
// -----------------------------------------------------------------------------
|
|
138
|
+
// Main Command
|
|
139
|
+
// -----------------------------------------------------------------------------
|
|
140
|
+
async function storeCommand(options) {
|
|
141
|
+
if (options.verbose) {
|
|
142
|
+
process.env.VERBOSE = '1';
|
|
143
|
+
}
|
|
144
|
+
switch (options.action) {
|
|
145
|
+
case 'search':
|
|
146
|
+
await searchStore(options);
|
|
147
|
+
break;
|
|
148
|
+
case 'install':
|
|
149
|
+
await installFromStore(options);
|
|
150
|
+
break;
|
|
151
|
+
case 'publish':
|
|
152
|
+
await publishToStoreFromCli(options);
|
|
153
|
+
break;
|
|
154
|
+
case 'uninstall':
|
|
155
|
+
case 'remove':
|
|
156
|
+
await uninstallFromStore(options);
|
|
157
|
+
break;
|
|
158
|
+
case 'info':
|
|
159
|
+
await showStoreInfo(options);
|
|
160
|
+
break;
|
|
161
|
+
case 'list':
|
|
162
|
+
await listStoreArtifacts(options);
|
|
163
|
+
break;
|
|
164
|
+
default:
|
|
165
|
+
console.error(`Error: Unknown action: ${options.action}`);
|
|
166
|
+
console.log('');
|
|
167
|
+
console.log('Available actions:');
|
|
168
|
+
console.log(' search <query> Search for skills, packs, MCP servers, engines');
|
|
169
|
+
console.log(' install <ref> Install artifact (e.g., skill/pdf-tools@1.0.0)');
|
|
170
|
+
console.log(' publish <ref> Publish engine/<id> or view/<id>[@version]');
|
|
171
|
+
console.log(' uninstall <ref> Uninstall artifact (currently engine/<slug>)');
|
|
172
|
+
console.log(' info <ref> Show artifact details');
|
|
173
|
+
console.log(' list List all available artifacts');
|
|
174
|
+
console.log('');
|
|
175
|
+
console.log(' Override store repo (CLI): AGENTHIPPO_STORE_REPO=owner/repo');
|
|
176
|
+
process.exit(1);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
// -----------------------------------------------------------------------------
|
|
180
|
+
// Search
|
|
181
|
+
// -----------------------------------------------------------------------------
|
|
182
|
+
// Icons for source display
|
|
183
|
+
// Use shared icons for consistency with VS Code UI
|
|
184
|
+
const ICONS = shared_1.STORE_ICONS;
|
|
185
|
+
async function searchStore(options) {
|
|
186
|
+
const query = options.query?.toLowerCase() || '';
|
|
187
|
+
const limit = options.limit || 20;
|
|
188
|
+
const typeFilter = options.type;
|
|
189
|
+
const index = await fetchIndex();
|
|
190
|
+
// Load local registry to check installed status
|
|
191
|
+
const registry = new index_1.LocalRegistry();
|
|
192
|
+
const installedPacks = new Set((await registry.listPacks()).map(p => p.slug));
|
|
193
|
+
const installedSkills = await registry.listSkills();
|
|
194
|
+
const installedMcps = await registry.listMcp();
|
|
195
|
+
const installedEngines = await listInstalledEngineIds();
|
|
196
|
+
// Build installed map: slug -> { installedTo: string[] }
|
|
197
|
+
const installedSkillMap = new Map(installedSkills.map(s => [s.slug, s.installedTo || []]));
|
|
198
|
+
const installedMcpMap = new Map(installedMcps.map(m => [m.slug, m.installedTo || []]));
|
|
199
|
+
// Simple search: filter by query in name/description/tags
|
|
200
|
+
let results = index.artifacts.filter((a) => {
|
|
201
|
+
if (typeFilter && a.type !== typeFilter) {
|
|
202
|
+
return false;
|
|
203
|
+
}
|
|
204
|
+
if (!query) {
|
|
205
|
+
return true;
|
|
206
|
+
}
|
|
207
|
+
const searchText = [
|
|
208
|
+
a.slug,
|
|
209
|
+
a.displayName,
|
|
210
|
+
a.description,
|
|
211
|
+
...(a.tags || []),
|
|
212
|
+
].join(' ').toLowerCase();
|
|
213
|
+
return searchText.includes(query);
|
|
214
|
+
});
|
|
215
|
+
// Sort by relevance (exact match first, then by name)
|
|
216
|
+
results.sort((a, b) => {
|
|
217
|
+
const aExact = a.slug.toLowerCase() === query;
|
|
218
|
+
const bExact = b.slug.toLowerCase() === query;
|
|
219
|
+
if (aExact && !bExact) {
|
|
220
|
+
return -1;
|
|
221
|
+
}
|
|
222
|
+
if (!aExact && bExact) {
|
|
223
|
+
return 1;
|
|
224
|
+
}
|
|
225
|
+
return a.slug.localeCompare(b.slug);
|
|
226
|
+
});
|
|
227
|
+
results = results.slice(0, limit);
|
|
228
|
+
const enriched = results.map((a) => {
|
|
229
|
+
let isLocal = false;
|
|
230
|
+
let installedTo;
|
|
231
|
+
if (a.type === 'pack') {
|
|
232
|
+
isLocal = installedPacks.has(a.slug);
|
|
233
|
+
}
|
|
234
|
+
else if (a.type === 'skill') {
|
|
235
|
+
installedTo = installedSkillMap.get(a.slug);
|
|
236
|
+
isLocal = installedTo !== undefined && installedTo.length > 0;
|
|
237
|
+
}
|
|
238
|
+
else if (a.type === 'mcp') {
|
|
239
|
+
installedTo = installedMcpMap.get(a.slug);
|
|
240
|
+
isLocal = installedTo !== undefined && installedTo.length > 0;
|
|
241
|
+
}
|
|
242
|
+
else if (a.type === 'engine') {
|
|
243
|
+
isLocal = installedEngines.has(a.slug);
|
|
244
|
+
}
|
|
245
|
+
return { ...a, isLocal, installedTo };
|
|
246
|
+
});
|
|
247
|
+
if (options.json) {
|
|
248
|
+
console.log(JSON.stringify(enriched, null, 2));
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
251
|
+
if (enriched.length === 0) {
|
|
252
|
+
console.log(`No results found for "${query}"`);
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
console.log('');
|
|
256
|
+
console.log(`Found ${enriched.length} result(s):`);
|
|
257
|
+
console.log('');
|
|
258
|
+
for (const artifact of enriched) {
|
|
259
|
+
const version = artifact.latestVersion ? `v${artifact.latestVersion}` : '';
|
|
260
|
+
const sourceIcon = artifact.isLocal ? ICONS.local : ICONS.remote;
|
|
261
|
+
const installedLabel = artifact.isLocal ? ` ${ICONS.installed}` : '';
|
|
262
|
+
console.log(` ${sourceIcon} ${artifact.type}/${artifact.slug} ${version}${installedLabel}`);
|
|
263
|
+
if (artifact.description) {
|
|
264
|
+
const desc = artifact.description.length > 60
|
|
265
|
+
? artifact.description.slice(0, 57) + '...'
|
|
266
|
+
: artifact.description;
|
|
267
|
+
console.log(` ${desc}`);
|
|
268
|
+
}
|
|
269
|
+
// Show which packs this is installed to (for skills/MCPs)
|
|
270
|
+
if (artifact.installedTo && artifact.installedTo.length > 0) {
|
|
271
|
+
console.log(` Installed to: ${artifact.installedTo.join(', ')}`);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
console.log('');
|
|
275
|
+
console.log(`Legend: ${ICONS.local} Local ${ICONS.remote} Remote ${ICONS.installed} Installed`);
|
|
276
|
+
console.log('');
|
|
277
|
+
console.log('Install with:');
|
|
278
|
+
console.log(' agenthippo store install <type>/<slug>');
|
|
279
|
+
console.log('');
|
|
280
|
+
}
|
|
281
|
+
// -----------------------------------------------------------------------------
|
|
282
|
+
// Install
|
|
283
|
+
// -----------------------------------------------------------------------------
|
|
284
|
+
async function installFromStore(options) {
|
|
285
|
+
if (!options.query) {
|
|
286
|
+
console.error('Error: Artifact reference required.');
|
|
287
|
+
console.log('Usage: agenthippo store install <type>/<slug>[@version]');
|
|
288
|
+
console.log('');
|
|
289
|
+
console.log('Examples:');
|
|
290
|
+
console.log(' agenthippo store install skill/pdf-tools');
|
|
291
|
+
console.log(' agenthippo store install pack/code-reviewer@1.0.0');
|
|
292
|
+
console.log(' agenthippo store install mcp/filesystem');
|
|
293
|
+
console.log(' agenthippo store install engine/gemini');
|
|
294
|
+
console.log(' agenthippo store install view/cost-ops@1.0.0');
|
|
295
|
+
process.exit(1);
|
|
296
|
+
}
|
|
297
|
+
const parsed = parseArtifactRef(options.query);
|
|
298
|
+
const { type, slug, version } = parsed;
|
|
299
|
+
const workspace = options.workspace || process.cwd();
|
|
300
|
+
console.log(`Installing ${type}/${slug}${version ? `@${version}` : ''}...`);
|
|
301
|
+
// Resolve version
|
|
302
|
+
let targetVersion = version || options.version;
|
|
303
|
+
if (!targetVersion) {
|
|
304
|
+
const versions = await listVersions(type, slug);
|
|
305
|
+
if (versions.length > 0) {
|
|
306
|
+
const stable = versions.find(v => !v.isPrerelease);
|
|
307
|
+
targetVersion = stable?.version || versions[0].version;
|
|
308
|
+
console.log(` Using latest version: ${targetVersion}`);
|
|
309
|
+
}
|
|
310
|
+
else {
|
|
311
|
+
targetVersion = 'main';
|
|
312
|
+
console.log(` No versions found, using main branch`);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
if (type === 'view') {
|
|
316
|
+
console.log(` Downloading...`);
|
|
317
|
+
const files = await downloadArtifact(type, slug, targetVersion);
|
|
318
|
+
if (files.length === 0) {
|
|
319
|
+
console.error(`Error: No files found for ${type}/${slug}`);
|
|
320
|
+
process.exit(1);
|
|
321
|
+
}
|
|
322
|
+
const { installSpotlightViewFromFiles } = await import('../../spotlight/install.js');
|
|
323
|
+
const result = await installSpotlightViewFromFiles(files.map(file => ({ path: file.path, content: file.content })), {
|
|
324
|
+
slug,
|
|
325
|
+
version: targetVersion,
|
|
326
|
+
overwrite: !!options.force,
|
|
327
|
+
workspaceRoot: workspace,
|
|
328
|
+
logger: cliLogger,
|
|
329
|
+
});
|
|
330
|
+
console.log('');
|
|
331
|
+
console.log(`✓ Installed view/${result.id} to:`);
|
|
332
|
+
console.log(` ${result.installDir}`);
|
|
333
|
+
console.log(` Panel config: ${result.viewsConfigPath}`);
|
|
334
|
+
console.log('');
|
|
335
|
+
return;
|
|
336
|
+
}
|
|
337
|
+
if (type === 'engine') {
|
|
338
|
+
console.log(` Downloading...`);
|
|
339
|
+
const files = await downloadArtifact(type, slug, targetVersion);
|
|
340
|
+
if (files.length === 0) {
|
|
341
|
+
console.error(`Error: No files found for ${type}/${slug}`);
|
|
342
|
+
process.exit(1);
|
|
343
|
+
}
|
|
344
|
+
const result = await (0, install_1.installCustomEngineFromFiles)(files, {
|
|
345
|
+
slug,
|
|
346
|
+
version: targetVersion,
|
|
347
|
+
overwrite: !!options.force,
|
|
348
|
+
logger: cliLogger,
|
|
349
|
+
});
|
|
350
|
+
console.log('');
|
|
351
|
+
console.log(`✓ Installed engine/${result.id} to:`);
|
|
352
|
+
console.log(` ${result.installDir}`);
|
|
353
|
+
console.log('');
|
|
354
|
+
return;
|
|
355
|
+
}
|
|
356
|
+
// Determine install path
|
|
357
|
+
const agentId = options.agent || 'default';
|
|
358
|
+
let installDir;
|
|
359
|
+
switch (type) {
|
|
360
|
+
case 'skill':
|
|
361
|
+
installDir = path.join(workspace, branding_1.AGENTIDE_DIR_NAME, 'agents', agentId, 'skills', slug);
|
|
362
|
+
break;
|
|
363
|
+
case 'pack':
|
|
364
|
+
installDir = path.join(os.homedir(), branding_1.AGENTIDE_DIR_NAME, 'agents', slug, targetVersion);
|
|
365
|
+
break;
|
|
366
|
+
case 'mcp':
|
|
367
|
+
installDir = path.join(workspace, branding_1.AGENTIDE_DIR_NAME, 'agents', agentId, 'mcp', slug);
|
|
368
|
+
break;
|
|
369
|
+
}
|
|
370
|
+
// Check if already exists
|
|
371
|
+
try {
|
|
372
|
+
await fs.access(installDir);
|
|
373
|
+
if (!options.force) {
|
|
374
|
+
console.error(`Error: ${type}/${slug} already exists at ${installDir}`);
|
|
375
|
+
console.log('Use --force to overwrite.');
|
|
376
|
+
process.exit(1);
|
|
377
|
+
}
|
|
378
|
+
console.log(` Removing existing installation...`);
|
|
379
|
+
await fs.rm(installDir, { recursive: true, force: true });
|
|
380
|
+
}
|
|
381
|
+
catch {
|
|
382
|
+
// Doesn't exist, continue
|
|
383
|
+
}
|
|
384
|
+
// Download
|
|
385
|
+
console.log(` Downloading...`);
|
|
386
|
+
const files = await downloadArtifact(type, slug, targetVersion);
|
|
387
|
+
if (files.length === 0) {
|
|
388
|
+
console.error(`Error: No files found for ${type}/${slug}`);
|
|
389
|
+
process.exit(1);
|
|
390
|
+
}
|
|
391
|
+
// Extract
|
|
392
|
+
console.log(` Extracting ${files.length} files...`);
|
|
393
|
+
await fs.mkdir(installDir, { recursive: true });
|
|
394
|
+
for (const file of files) {
|
|
395
|
+
const filePath = path.join(installDir, file.path);
|
|
396
|
+
await fs.mkdir(path.dirname(filePath), { recursive: true });
|
|
397
|
+
await fs.writeFile(filePath, file.content);
|
|
398
|
+
}
|
|
399
|
+
// For packs, create current.txt
|
|
400
|
+
if (type === 'pack') {
|
|
401
|
+
const packRoot = path.join(os.homedir(), branding_1.AGENTIDE_DIR_NAME, 'agents', slug);
|
|
402
|
+
await fs.writeFile(path.join(packRoot, 'current.txt'), targetVersion);
|
|
403
|
+
}
|
|
404
|
+
console.log('');
|
|
405
|
+
console.log(`✓ Installed ${type}/${slug} to:`);
|
|
406
|
+
console.log(` ${installDir}`);
|
|
407
|
+
console.log('');
|
|
408
|
+
}
|
|
409
|
+
// -----------------------------------------------------------------------------
|
|
410
|
+
// Publish
|
|
411
|
+
// -----------------------------------------------------------------------------
|
|
412
|
+
/** Resolve Spotlight view publish bundle mode from CLI flags. */
|
|
413
|
+
function resolvePublishBundleMode(options) {
|
|
414
|
+
if (options.full && options.bundle && options.bundle.trim().toLowerCase() !== 'full') {
|
|
415
|
+
console.error('Error: Cannot combine --full with --bundle scripts-only');
|
|
416
|
+
process.exit(1);
|
|
417
|
+
}
|
|
418
|
+
if (options.full) {
|
|
419
|
+
return 'full';
|
|
420
|
+
}
|
|
421
|
+
if (options.bundle) {
|
|
422
|
+
const normalized = options.bundle.trim().toLowerCase();
|
|
423
|
+
if (normalized === 'full' || normalized === 'scripts-only') {
|
|
424
|
+
return normalized;
|
|
425
|
+
}
|
|
426
|
+
console.error('Error: Invalid --bundle value. Use scripts-only or full.');
|
|
427
|
+
process.exit(1);
|
|
428
|
+
}
|
|
429
|
+
return 'scripts-only';
|
|
430
|
+
}
|
|
431
|
+
async function publishToStoreFromCli(options) {
|
|
432
|
+
if (!options.query) {
|
|
433
|
+
console.error('Error: Artifact reference required.');
|
|
434
|
+
console.log('Usage: agenthippo store publish <engine|view>/<slug>[@version]');
|
|
435
|
+
console.log('');
|
|
436
|
+
console.log('Examples:');
|
|
437
|
+
console.log(' agenthippo store publish engine/rovo');
|
|
438
|
+
console.log(' agenthippo store publish engine/rovo@1.0.0');
|
|
439
|
+
console.log(' agenthippo store publish view/cost-ops@1.0.0');
|
|
440
|
+
console.log(' agenthippo store publish view/brand-board --bundle full');
|
|
441
|
+
console.log(' agenthippo store publish view/brand-board --full');
|
|
442
|
+
console.log('');
|
|
443
|
+
console.log('Requires GITHUB_TOKEN (or GH_TOKEN / AGENTHIPPO_GITHUB_TOKEN) with fork + PR access.');
|
|
444
|
+
console.log('Override store repo (CLI): AGENTHIPPO_STORE_REPO=owner/repo');
|
|
445
|
+
process.exit(1);
|
|
446
|
+
}
|
|
447
|
+
const parsed = parseArtifactRef(options.query);
|
|
448
|
+
const { type, slug, version: versionFromRef } = parsed;
|
|
449
|
+
if (type !== 'engine' && type !== 'view') {
|
|
450
|
+
console.error(`Error: store publish supports engine and view only, got ${type}/${slug}`);
|
|
451
|
+
console.log('Use: agenthippo store publish engine/<id>[@version]');
|
|
452
|
+
console.log(' agenthippo store publish view/<id>[@version] [--bundle full|scripts-only]');
|
|
453
|
+
process.exit(1);
|
|
454
|
+
}
|
|
455
|
+
const token = getGitHubToken();
|
|
456
|
+
if (!token) {
|
|
457
|
+
console.error('Error: GitHub token required to publish.');
|
|
458
|
+
console.log('Set GITHUB_TOKEN, GH_TOKEN, or AGENTHIPPO_GITHUB_TOKEN, then retry.');
|
|
459
|
+
process.exit(1);
|
|
460
|
+
}
|
|
461
|
+
if (type === 'engine') {
|
|
462
|
+
await publishEngineToStoreFromCli(options, slug, versionFromRef);
|
|
463
|
+
return;
|
|
464
|
+
}
|
|
465
|
+
await publishViewToStoreFromCli(options, slug, versionFromRef);
|
|
466
|
+
}
|
|
467
|
+
async function publishEngineToStoreFromCli(options, slug, versionFromRef) {
|
|
468
|
+
const workspace = options.workspace || process.cwd();
|
|
469
|
+
const engineDir = await (0, publish_1.resolveEngineSourceDir)(slug, workspace);
|
|
470
|
+
if (!engineDir) {
|
|
471
|
+
console.error(`Error: Engine "${slug}" not found under .agent-hippo/engines/ (workspace or home).`);
|
|
472
|
+
process.exit(1);
|
|
473
|
+
}
|
|
474
|
+
console.log(`Publishing engine/${slug} from ${engineDir}...`);
|
|
475
|
+
const validation = await (0, publish_1.validateEngineForPublish)(engineDir, slug);
|
|
476
|
+
if (!validation.valid) {
|
|
477
|
+
console.error(`Error: Cannot publish engine/${slug}`);
|
|
478
|
+
for (const error of validation.errors) {
|
|
479
|
+
console.error(` - ${error}`);
|
|
480
|
+
}
|
|
481
|
+
process.exit(1);
|
|
482
|
+
}
|
|
483
|
+
for (const warning of validation.warnings) {
|
|
484
|
+
console.log(` Warning: ${warning}`);
|
|
485
|
+
}
|
|
486
|
+
let version = versionFromRef || options.version || validation.metadata?.suggestedVersion;
|
|
487
|
+
if (!version) {
|
|
488
|
+
console.error('Error: Publish version required.');
|
|
489
|
+
console.log('Pass a version: agenthippo store publish engine/<slug>@1.0.0');
|
|
490
|
+
console.log('Or add a semver version field to package.json in the engine folder.');
|
|
491
|
+
process.exit(1);
|
|
492
|
+
}
|
|
493
|
+
version = version.replace(/^v/, '');
|
|
494
|
+
if (!(0, publish_1.isValidPublishVersion)(version)) {
|
|
495
|
+
console.error(`Error: Invalid version "${version}". Use semver (e.g., 1.0.0).`);
|
|
496
|
+
process.exit(1);
|
|
497
|
+
}
|
|
498
|
+
const files = await (0, publish_1.collectEngineFiles)(engineDir);
|
|
499
|
+
const config = getStoreConfig();
|
|
500
|
+
console.log(` Target store: ${config.owner}/${config.repo}`);
|
|
501
|
+
console.log(` Version tag: engines/${slug}/v${version}`);
|
|
502
|
+
console.log(` Files: ${files.length}`);
|
|
503
|
+
await submitStorePublish({
|
|
504
|
+
options,
|
|
505
|
+
type: 'engine',
|
|
506
|
+
slug,
|
|
507
|
+
version,
|
|
508
|
+
files,
|
|
509
|
+
installHint: `agenthippo store install engine/${slug}`,
|
|
510
|
+
});
|
|
511
|
+
}
|
|
512
|
+
async function publishViewToStoreFromCli(options, slug, versionFromRef) {
|
|
513
|
+
const workspace = options.workspace || process.cwd();
|
|
514
|
+
const mode = resolvePublishBundleMode(options);
|
|
515
|
+
const views = await (0, publish_2.discoverPublishableViews)(workspace);
|
|
516
|
+
const summary = views.find(view => view.id === slug);
|
|
517
|
+
if (!summary) {
|
|
518
|
+
console.error(`Error: Spotlight view "${slug}" not found.`);
|
|
519
|
+
console.log('Register a user view in .agent-hippo/analytics/panel/views.yaml (non-system id).');
|
|
520
|
+
if (views.length > 0) {
|
|
521
|
+
console.log('');
|
|
522
|
+
console.log('Publishable views:');
|
|
523
|
+
for (const view of views) {
|
|
524
|
+
console.log(` - view/${view.id} (${view.sourceLabel}, ${view.scope})`);
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
process.exit(1);
|
|
528
|
+
}
|
|
529
|
+
console.log(`Publishing view/${slug} from ${summary.viewRoot}...`);
|
|
530
|
+
console.log(` Bundle: ${mode === 'full' ? 'full (scripts + assets + charts/reports/exports + manifest.json)' : 'scripts only'}`);
|
|
531
|
+
const validation = await (0, publish_2.validateViewForPublish)(summary, {
|
|
532
|
+
expectedId: slug,
|
|
533
|
+
mode,
|
|
534
|
+
});
|
|
535
|
+
if (!validation.valid) {
|
|
536
|
+
console.error(`Error: Cannot publish view/${slug}`);
|
|
537
|
+
for (const error of validation.errors) {
|
|
538
|
+
console.error(` - ${error}`);
|
|
539
|
+
}
|
|
540
|
+
process.exit(1);
|
|
541
|
+
}
|
|
542
|
+
for (const warning of validation.warnings) {
|
|
543
|
+
console.log(` Warning: ${warning}`);
|
|
544
|
+
}
|
|
545
|
+
if (!validation.metadata) {
|
|
546
|
+
console.error('Error: Validation succeeded but metadata is missing.');
|
|
547
|
+
process.exit(1);
|
|
548
|
+
}
|
|
549
|
+
let version = versionFromRef || options.version || validation.metadata.publishVersion;
|
|
550
|
+
if (!version) {
|
|
551
|
+
console.error('Error: Publish version required.');
|
|
552
|
+
console.log('Pass a version: agenthippo store publish view/<slug>@1.0.0');
|
|
553
|
+
console.log('Or add version to view.yaml (e.g. version: 1.0.0).');
|
|
554
|
+
process.exit(1);
|
|
555
|
+
}
|
|
556
|
+
version = version.replace(/^v/, '');
|
|
557
|
+
if (!(0, publish_1.isValidPublishVersion)(version)) {
|
|
558
|
+
console.error(`Error: Invalid version "${version}". Use semver (e.g., 1.0.0).`);
|
|
559
|
+
process.exit(1);
|
|
560
|
+
}
|
|
561
|
+
const files = await (0, publish_2.collectViewFiles)(summary, version, validation.metadata, mode);
|
|
562
|
+
const config = getStoreConfig();
|
|
563
|
+
const binaryCount = files.filter(file => file.encoding === 'base64').length;
|
|
564
|
+
console.log(` Target store: ${config.owner}/${config.repo}`);
|
|
565
|
+
console.log(` Version tag: spotlight/${slug}/v${version}`);
|
|
566
|
+
console.log(` Files: ${files.length}${binaryCount > 0 ? ` (${binaryCount} binary)` : ''}`);
|
|
567
|
+
await submitStorePublish({
|
|
568
|
+
options,
|
|
569
|
+
type: 'view',
|
|
570
|
+
slug,
|
|
571
|
+
version,
|
|
572
|
+
files,
|
|
573
|
+
bundle: mode,
|
|
574
|
+
installHint: `agenthippo store install view/${slug}`,
|
|
575
|
+
});
|
|
576
|
+
}
|
|
577
|
+
async function submitStorePublish(params) {
|
|
578
|
+
const { options, type, slug, version, files, bundle, installHint } = params;
|
|
579
|
+
try {
|
|
580
|
+
const result = await (0, index_2.publishToStore)({
|
|
581
|
+
type,
|
|
582
|
+
slug,
|
|
583
|
+
version,
|
|
584
|
+
files,
|
|
585
|
+
}, cliLogger);
|
|
586
|
+
if (options.json) {
|
|
587
|
+
console.log(JSON.stringify({
|
|
588
|
+
success: true,
|
|
589
|
+
type,
|
|
590
|
+
slug,
|
|
591
|
+
version,
|
|
592
|
+
bundle,
|
|
593
|
+
prUrl: result.prUrl,
|
|
594
|
+
prNumber: result.prNumber,
|
|
595
|
+
tagName: result.tagName,
|
|
596
|
+
}, null, 2));
|
|
597
|
+
}
|
|
598
|
+
else {
|
|
599
|
+
console.log('');
|
|
600
|
+
const bundleLabel = bundle === 'full' ? ' (full bundle)' : '';
|
|
601
|
+
console.log(`✓ Opened pull request for ${type}/${slug} v${version}${bundleLabel}`);
|
|
602
|
+
console.log(` ${result.prUrl}`);
|
|
603
|
+
console.log('');
|
|
604
|
+
console.log(`After merge, install with: ${installHint}`);
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
catch (error) {
|
|
608
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
609
|
+
if (options.json) {
|
|
610
|
+
console.log(JSON.stringify({ success: false, error: message }));
|
|
611
|
+
}
|
|
612
|
+
else {
|
|
613
|
+
console.error(`Error: ${message}`);
|
|
614
|
+
}
|
|
615
|
+
process.exit(1);
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
// -----------------------------------------------------------------------------
|
|
619
|
+
// Uninstall
|
|
620
|
+
// -----------------------------------------------------------------------------
|
|
621
|
+
async function uninstallFromStore(options) {
|
|
622
|
+
if (!options.query) {
|
|
623
|
+
console.error('Error: Artifact reference required.');
|
|
624
|
+
console.log('Usage: agenthippo store uninstall engine/<slug>');
|
|
625
|
+
console.log('');
|
|
626
|
+
console.log('Examples:');
|
|
627
|
+
console.log(' agenthippo store uninstall engine/gemini');
|
|
628
|
+
process.exit(1);
|
|
629
|
+
}
|
|
630
|
+
const { type, slug } = parseArtifactRef(options.query);
|
|
631
|
+
if (type !== 'engine') {
|
|
632
|
+
console.error(`Error: store uninstall currently supports custom engines only, got ${type}/${slug}`);
|
|
633
|
+
process.exit(1);
|
|
634
|
+
}
|
|
635
|
+
const result = await (0, install_1.uninstallCustomEngine)(slug, { logger: cliLogger });
|
|
636
|
+
if (!result.removed) {
|
|
637
|
+
console.error(`Error: engine/${result.id} is not installed.`);
|
|
638
|
+
process.exit(1);
|
|
639
|
+
}
|
|
640
|
+
console.log('');
|
|
641
|
+
console.log(`✓ Uninstalled engine/${result.id} from:`);
|
|
642
|
+
console.log(` ${result.installDir}`);
|
|
643
|
+
console.log('');
|
|
644
|
+
}
|
|
645
|
+
// -----------------------------------------------------------------------------
|
|
646
|
+
// Info
|
|
647
|
+
// -----------------------------------------------------------------------------
|
|
648
|
+
async function showStoreInfo(options) {
|
|
649
|
+
if (!options.query) {
|
|
650
|
+
console.error('Error: Artifact reference required.');
|
|
651
|
+
console.log('Usage: agenthippo store info <type>/<slug>');
|
|
652
|
+
process.exit(1);
|
|
653
|
+
}
|
|
654
|
+
const parsed = parseArtifactRef(options.query);
|
|
655
|
+
const index = await fetchIndex();
|
|
656
|
+
const artifact = index.artifacts.find((a) => a.type === parsed.type && a.slug === parsed.slug);
|
|
657
|
+
if (!artifact) {
|
|
658
|
+
console.error(`Error: ${parsed.type}/${parsed.slug} not found in store.`);
|
|
659
|
+
process.exit(1);
|
|
660
|
+
}
|
|
661
|
+
if (options.json) {
|
|
662
|
+
// Also fetch versions
|
|
663
|
+
const versions = await listVersions(parsed.type, parsed.slug);
|
|
664
|
+
console.log(JSON.stringify({ ...artifact, versions }, null, 2));
|
|
665
|
+
return;
|
|
666
|
+
}
|
|
667
|
+
console.log('');
|
|
668
|
+
// allow-any-unicode-next-line
|
|
669
|
+
console.log('─'.repeat(60));
|
|
670
|
+
console.log(`${artifact.type}/${artifact.slug}`);
|
|
671
|
+
// allow-any-unicode-next-line
|
|
672
|
+
console.log('─'.repeat(60));
|
|
673
|
+
console.log(`Name: ${artifact.displayName}`);
|
|
674
|
+
console.log(`Type: ${artifact.type}`);
|
|
675
|
+
console.log(`Version: ${artifact.latestVersion || 'N/A'}`);
|
|
676
|
+
if (artifact.author) {
|
|
677
|
+
console.log(`Author: ${artifact.author}`);
|
|
678
|
+
}
|
|
679
|
+
if (artifact.description) {
|
|
680
|
+
console.log(`Description: ${artifact.description}`);
|
|
681
|
+
}
|
|
682
|
+
if (artifact.tags?.length) {
|
|
683
|
+
console.log(`Tags: ${artifact.tags.join(', ')}`);
|
|
684
|
+
}
|
|
685
|
+
// Fetch versions
|
|
686
|
+
const versions = await listVersions(parsed.type, parsed.slug);
|
|
687
|
+
if (versions.length > 0) {
|
|
688
|
+
console.log('');
|
|
689
|
+
console.log('Available versions:');
|
|
690
|
+
for (const v of versions.slice(0, 10)) {
|
|
691
|
+
const pre = v.isPrerelease ? ' (pre-release)' : '';
|
|
692
|
+
console.log(` - ${v.version}${pre}`);
|
|
693
|
+
}
|
|
694
|
+
if (versions.length > 10) {
|
|
695
|
+
console.log(` ... and ${versions.length - 10} more`);
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
// allow-any-unicode-next-line
|
|
699
|
+
console.log('─'.repeat(60));
|
|
700
|
+
console.log('');
|
|
701
|
+
console.log('Install with:');
|
|
702
|
+
console.log(` agenthippo store install ${artifact.type}/${artifact.slug}`);
|
|
703
|
+
console.log('');
|
|
704
|
+
}
|
|
705
|
+
// -----------------------------------------------------------------------------
|
|
706
|
+
// List
|
|
707
|
+
// -----------------------------------------------------------------------------
|
|
708
|
+
async function listStoreArtifacts(options) {
|
|
709
|
+
const index = await fetchIndex();
|
|
710
|
+
const typeFilter = options.type;
|
|
711
|
+
// Load local registry to check installed status
|
|
712
|
+
const registry = new index_1.LocalRegistry();
|
|
713
|
+
const installedPacks = new Set((await registry.listPacks()).map(p => p.slug));
|
|
714
|
+
const installedSkills = await registry.listSkills();
|
|
715
|
+
const installedMcps = await registry.listMcp();
|
|
716
|
+
const installedEngines = await listInstalledEngineIds();
|
|
717
|
+
// Build installed map: slug -> { installedTo: string[] }
|
|
718
|
+
const installedSkillMap = new Map(installedSkills.map(s => [s.slug, s.installedTo || []]));
|
|
719
|
+
const installedMcpMap = new Map(installedMcps.map(m => [m.slug, m.installedTo || []]));
|
|
720
|
+
let artifacts = index.artifacts;
|
|
721
|
+
if (typeFilter) {
|
|
722
|
+
artifacts = artifacts.filter((a) => a.type === typeFilter);
|
|
723
|
+
}
|
|
724
|
+
// Helper to check if an artifact is installed locally
|
|
725
|
+
const isLocalArtifact = (a) => {
|
|
726
|
+
if (a.type === 'pack') {
|
|
727
|
+
return installedPacks.has(a.slug);
|
|
728
|
+
}
|
|
729
|
+
if (a.type === 'skill') {
|
|
730
|
+
const installedTo = installedSkillMap.get(a.slug);
|
|
731
|
+
return installedTo !== undefined && installedTo.length > 0;
|
|
732
|
+
}
|
|
733
|
+
if (a.type === 'mcp') {
|
|
734
|
+
const installedTo = installedMcpMap.get(a.slug);
|
|
735
|
+
return installedTo !== undefined && installedTo.length > 0;
|
|
736
|
+
}
|
|
737
|
+
if (a.type === 'engine') {
|
|
738
|
+
return installedEngines.has(a.slug);
|
|
739
|
+
}
|
|
740
|
+
return false;
|
|
741
|
+
};
|
|
742
|
+
if (options.json) {
|
|
743
|
+
const enriched = artifacts.map((a) => ({
|
|
744
|
+
...a,
|
|
745
|
+
isLocal: isLocalArtifact(a),
|
|
746
|
+
installedTo: a.type === 'skill' ? installedSkillMap.get(a.slug)
|
|
747
|
+
: a.type === 'mcp' ? installedMcpMap.get(a.slug)
|
|
748
|
+
: undefined,
|
|
749
|
+
}));
|
|
750
|
+
console.log(JSON.stringify(enriched, null, 2));
|
|
751
|
+
return;
|
|
752
|
+
}
|
|
753
|
+
console.log('');
|
|
754
|
+
console.log(`Store contains ${artifacts.length} artifact(s):`);
|
|
755
|
+
console.log('');
|
|
756
|
+
// Group by type
|
|
757
|
+
const byType = {};
|
|
758
|
+
for (const a of artifacts) {
|
|
759
|
+
byType[a.type] = byType[a.type] || [];
|
|
760
|
+
byType[a.type].push(a);
|
|
761
|
+
}
|
|
762
|
+
for (const type of ['pack', 'skill', 'mcp', 'engine']) {
|
|
763
|
+
const items = byType[type] || [];
|
|
764
|
+
if (items.length === 0) {
|
|
765
|
+
continue;
|
|
766
|
+
}
|
|
767
|
+
console.log(`${type}s (${items.length}):`);
|
|
768
|
+
for (const item of items) {
|
|
769
|
+
const v = item.latestVersion ? ` v${item.latestVersion}` : '';
|
|
770
|
+
const isLocal = isLocalArtifact(item);
|
|
771
|
+
const sourceIcon = isLocal ? ICONS.local : ICONS.remote;
|
|
772
|
+
const installedLabel = isLocal ? ` ${ICONS.installed}` : '';
|
|
773
|
+
console.log(` ${sourceIcon} ${item.slug}${v}${installedLabel}`);
|
|
774
|
+
}
|
|
775
|
+
console.log('');
|
|
776
|
+
}
|
|
777
|
+
console.log(`Legend: ${ICONS.local} Local ${ICONS.remote} Remote ${ICONS.installed} Installed`);
|
|
778
|
+
console.log('');
|
|
779
|
+
}
|
|
780
|
+
// -----------------------------------------------------------------------------
|
|
781
|
+
// Helpers
|
|
782
|
+
// -----------------------------------------------------------------------------
|
|
783
|
+
function parseArtifactRef(ref) {
|
|
784
|
+
try {
|
|
785
|
+
return (0, shared_1.parseStoreUrl)(ref);
|
|
786
|
+
}
|
|
787
|
+
catch (e) {
|
|
788
|
+
const errorMsg = e instanceof Error ? e.message : String(e);
|
|
789
|
+
console.error(`Error: ${errorMsg}`);
|
|
790
|
+
console.log('Expected format: <type>/<slug>[@version]');
|
|
791
|
+
console.log('Examples: skill/pdf-tools, pack/code-reviewer@1.0.0, engine/gemini, view/cost-ops');
|
|
792
|
+
process.exit(1);
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
async function listInstalledEngineIds() {
|
|
796
|
+
return new Set((await (0, install_1.listInstalledCustomEngines)()).map(engine => engine.id));
|
|
797
|
+
}
|
|
798
|
+
async function fetchIndex() {
|
|
799
|
+
// Try GitHub Pages first (public, fast CDN)
|
|
800
|
+
const pagesUrl = getIndexUrl();
|
|
801
|
+
cliLogger.appendLine(`[Store] Fetching index from ${pagesUrl}`);
|
|
802
|
+
let response = await fetch(pagesUrl, {
|
|
803
|
+
headers: {
|
|
804
|
+
'User-Agent': 'AgentHippo-CLI',
|
|
805
|
+
Accept: 'application/json',
|
|
806
|
+
},
|
|
807
|
+
});
|
|
808
|
+
if (response.ok) {
|
|
809
|
+
return await response.json();
|
|
810
|
+
}
|
|
811
|
+
// Fallback: Try GitHub API (for private repos with token)
|
|
812
|
+
const token = getGitHubToken();
|
|
813
|
+
if (token && (response.status === 403 || response.status === 404)) {
|
|
814
|
+
cliLogger.appendLine(`[Store] GitHub Pages not available, trying API with auth...`);
|
|
815
|
+
const config = getStoreConfig();
|
|
816
|
+
const apiUrl = `https://api.github.com/repos/${config.owner}/${config.repo}/contents/dist/store-index.json`;
|
|
817
|
+
response = await githubFetch(apiUrl, {
|
|
818
|
+
headers: { Accept: 'application/vnd.github.raw+json' },
|
|
819
|
+
});
|
|
820
|
+
if (response.ok) {
|
|
821
|
+
return await response.json();
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
throw new Error(`Failed to fetch store index: ${response.status} ${response.statusText}`);
|
|
825
|
+
}
|
|
826
|
+
async function listVersions(type, slug) {
|
|
827
|
+
const config = getStoreConfig();
|
|
828
|
+
const typePath = (0, shared_1.getStorePath)(type);
|
|
829
|
+
const prefix = `${typePath}/${slug}/v`;
|
|
830
|
+
const url = `https://api.github.com/repos/${config.owner}/${config.repo}/git/refs/tags`;
|
|
831
|
+
cliLogger.appendLine(`[Store] Listing versions for ${type}/${slug}`);
|
|
832
|
+
const response = await githubFetch(url);
|
|
833
|
+
if (!response.ok) {
|
|
834
|
+
if (response.status === 404) {
|
|
835
|
+
return [];
|
|
836
|
+
}
|
|
837
|
+
throw new Error(`Failed to list versions: ${response.statusText}`);
|
|
838
|
+
}
|
|
839
|
+
const refs = (await response.json());
|
|
840
|
+
const versions = [];
|
|
841
|
+
for (const { ref } of refs) {
|
|
842
|
+
const tagName = ref.replace('refs/tags/', '');
|
|
843
|
+
if (tagName.startsWith(prefix)) {
|
|
844
|
+
const version = tagName.slice(prefix.length - 1); // Keep the 'v'
|
|
845
|
+
versions.push({
|
|
846
|
+
version: version.replace(/^v/, ''),
|
|
847
|
+
tagName,
|
|
848
|
+
isPrerelease: /-(alpha|beta|rc|pre)/.test(version),
|
|
849
|
+
});
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
return versions.sort((a, b) => b.version.localeCompare(a.version, undefined, { numeric: true }));
|
|
853
|
+
}
|
|
854
|
+
async function downloadArtifact(type, slug, version) {
|
|
855
|
+
const config = getStoreConfig();
|
|
856
|
+
const typePath = (0, shared_1.getStorePath)(type);
|
|
857
|
+
// Determine ref
|
|
858
|
+
let targetRef;
|
|
859
|
+
if (version === 'main' || version === 'latest') {
|
|
860
|
+
targetRef = config.defaultBranch;
|
|
861
|
+
}
|
|
862
|
+
else {
|
|
863
|
+
targetRef = `${typePath}/${slug}/v${version.replace(/^v/, '')}`;
|
|
864
|
+
}
|
|
865
|
+
cliLogger.appendLine(`[Store] Downloading ${type}/${slug} at ${targetRef}`);
|
|
866
|
+
// Download tarball
|
|
867
|
+
const encodedRef = encodeURIComponent(targetRef);
|
|
868
|
+
const url = `https://api.github.com/repos/${config.owner}/${config.repo}/tarball/${encodedRef}`;
|
|
869
|
+
const response = await githubFetch(url);
|
|
870
|
+
if (!response.ok) {
|
|
871
|
+
throw new Error(`Failed to download: ${response.status} ${response.statusText}`);
|
|
872
|
+
}
|
|
873
|
+
// Decompress and parse tar
|
|
874
|
+
const gzipped = Buffer.from(await response.arrayBuffer());
|
|
875
|
+
const tarData = (0, zlib_1.gunzipSync)(gzipped);
|
|
876
|
+
const allFiles = parseTar(tarData);
|
|
877
|
+
// Filter to files in our artifact's folder
|
|
878
|
+
const artifactPath = `${typePath}/${slug}/`;
|
|
879
|
+
const result = [];
|
|
880
|
+
for (const [fullPath, content] of allFiles) {
|
|
881
|
+
// Strip top-level directory (e.g., "repo-commit/")
|
|
882
|
+
const slashIndex = fullPath.indexOf('/');
|
|
883
|
+
if (slashIndex === -1) {
|
|
884
|
+
continue;
|
|
885
|
+
}
|
|
886
|
+
const relativePath = fullPath.slice(slashIndex + 1);
|
|
887
|
+
if (relativePath.startsWith(artifactPath)) {
|
|
888
|
+
const artifactRelativePath = relativePath.slice(artifactPath.length);
|
|
889
|
+
if (artifactRelativePath) {
|
|
890
|
+
result.push({ path: artifactRelativePath, content });
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
return result;
|
|
895
|
+
}
|
|
896
|
+
function parseTar(data) {
|
|
897
|
+
const files = new Map();
|
|
898
|
+
let offset = 0;
|
|
899
|
+
while (offset < data.length - 512) {
|
|
900
|
+
const header = data.subarray(offset, offset + 512);
|
|
901
|
+
if (header.every(b => b === 0)) {
|
|
902
|
+
break;
|
|
903
|
+
}
|
|
904
|
+
const name = header.subarray(0, 100).toString('utf-8').replace(/\0/g, '').trim();
|
|
905
|
+
const sizeOctal = header.subarray(124, 136).toString('utf-8').replace(/\0/g, '').trim();
|
|
906
|
+
const typeFlag = header[156];
|
|
907
|
+
if (!name) {
|
|
908
|
+
offset += 512;
|
|
909
|
+
continue;
|
|
910
|
+
}
|
|
911
|
+
const size = parseInt(sizeOctal, 8) || 0;
|
|
912
|
+
offset += 512;
|
|
913
|
+
if (typeFlag === 0 || typeFlag === 48) {
|
|
914
|
+
files.set(name, Buffer.from(data.subarray(offset, offset + size)));
|
|
915
|
+
}
|
|
916
|
+
offset += Math.ceil(size / 512) * 512;
|
|
917
|
+
}
|
|
918
|
+
return files;
|
|
919
|
+
}
|