@agenthippo-ai/agenthippo 1.110.9 → 1.110.19
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/out/agentpack/types.js +2 -5
- package/out/analytics/dashboard/artifactManager.js +2 -439
- package/out/analytics/dashboard/fleetDisplayUtils.js +2 -162
- package/out/analytics/dashboard/fleetOrchestrator.js +3 -142
- package/out/analytics/dashboard/fleetRegistry.js +2 -79
- package/out/analytics/dashboard/fleetRowDefaults.js +2 -87
- package/out/analytics/dashboard/fleetScriptAdapter.js +2 -146
- package/out/analytics/dashboard/fleetTypes.js +2 -29
- package/out/analytics/dashboard/index.js +2 -17
- package/out/analytics/dashboard/indexingService.js +2 -422
- package/out/analytics/dashboard/localFleetAdapter.js +2 -222
- package/out/analytics/dashboard/performanceMonitor.js +5 -76
- package/out/analytics/dashboard/processManager.js +2 -209
- package/out/analytics/dashboard/provider.js +38 -3817
- package/out/analytics/dashboard/queryRunner.js +62 -750
- package/out/analytics/dashboard/scheduledFleetStorage.js +2 -241
- package/out/analytics/dashboard/sessionJsonlFleet.js +3 -204
- package/out/analytics/dashboard/teamViewDiscovery.js +2 -106
- package/out/analytics/dashboard/webview/panel.js +34 -2318
- package/out/analytics/dashboard/webview/runtime-bridge.js +2 -82
- package/out/analytics/lifecycle.js +2 -43
- package/out/analytics/service.js +8 -1277
- package/out/auth/authBaseUrl.js +2 -59
- package/out/auth/bootstrapApply.js +2 -71
- package/out/auth/brokerClient.js +2 -160
- package/out/auth/callbackUri.js +2 -59
- package/out/auth/githubStoreGate.js +2 -70
- package/out/auth/loopbackAuthServer.js +4 -159
- package/out/auth/onboardingPrompt.js +2 -112
- package/out/auth/pkce.js +2 -9
- package/out/auth/provider.js +2 -226
- package/out/auth/sessionStore.js +2 -156
- package/out/auth/signInFlow.js +2 -183
- package/out/cli/index.js +619 -551
- package/out/cli/run-custom-engine-runner.js +3 -318
- package/out/cli/vscode-shim.js +2 -86
- package/out/engines/factory.js +2 -45
- package/out/engines/types.js +2 -17
- package/out/examples/run-headless-repl.js +6 -286
- package/out/examples/run-headless.js +2 -187
- package/out/extension.js +32 -4473
- package/out/gateway/gatewayRouteIndex.js +6 -371
- package/out/gateway/gatewaySessionStore.js +3 -243
- package/out/gateway/index.js +2 -31
- package/out/gateway/resetMappings.js +2 -52
- package/out/gateway/service.js +5 -1249
- package/out/mcp/publish.js +2 -143
- package/out/remote/handleRemoteChat.js +2 -169
- package/out/remote/remotePackStatusBar.js +3 -103
- package/out/remote/remoteTrust.js +6 -277
- package/out/remote/serveClient.js +4 -277
- package/out/remoteSkills.js +3 -191
- package/out/runtime/index.js +2 -32
- package/out/runtime/vscode/index.js +2 -20
- package/out/runtime/vscode/vscode-config-provider.js +2 -77
- package/out/runtime/vscode/vscode-edit-tracker.js +2 -122
- package/out/runtime/vscode/vscode-logger.js +2 -30
- package/out/runtime/vscode/vscode-permission-handler.js +2 -72
- package/out/scripts/agentide-litellm.sh +0 -1
- package/out/scripts/agentide_litellm_hooks_v1.py +170 -418
- package/out/scripts/analytics/agent-fleet-widget.js +18 -257
- package/out/scripts/analytics/agentide-litellm-otel.config.yaml +4 -4
- package/out/scripts/analytics/duckdbLocator.js +2 -28
- package/out/scripts/analytics/generate-default-charts.py +43 -323
- package/out/scripts/analytics/hotspot-analysis-widget.js +4 -430
- package/out/scripts/analytics/index-traces.py +78 -1036
- package/out/scripts/analytics/session-comparison-widget.js +26 -472
- package/out/scripts/analytics/session-timeline-widget.js +25 -846
- package/out/scripts/analytics/setup-analytics.ps1 +8 -1
- package/out/scripts/analytics/setup-analytics.sh +13 -2
- package/out/scripts/analytics/token-cost-flamegraph-widget.js +4 -461
- package/out/scripts/analytics/token-cost-trend-widget.js +4 -534
- package/out/scripts/analytics/workflows-collector.cjs +4 -314
- package/out/scripts/analytics/workflows-daemon.mjs +9 -185
- package/out/scripts/analytics/workflows-widget.cjs +15 -159
- package/out/scripts/analytics/wow-model-widget.js +10 -120
- package/out/scripts/vendor-tools.mjs +2 -233
- package/out/skills/publish.js +3 -178
- package/out/store/github/setup.js +7 -212
- package/out/store/oramaIndex.js +2 -884
- package/out/sync.js +26 -1829
- package/out/terminalLogger.js +5 -358
- package/out/utils/pathSafety.js +2 -60
- package/out/utils/pythonRunner.js +4 -258
- package/out/utils/toolPath.js +2 -83
- package/out/workspaceFolders.js +2 -59
- package/package.json +1 -1
- package/out/agentpack/github.js +0 -547
- package/out/agentpack/index.js +0 -67
- package/out/agentpack/install.js +0 -297
- package/out/agentpack/manager.js +0 -441
- package/out/agentpack/manifest.js +0 -135
- package/out/agentpack/paths.js +0 -498
- package/out/agentpack/publish.js +0 -248
- package/out/agentpack/stores.js +0 -554
- package/out/analytics/dashboard/fleetStatusUtils.js +0 -30
- package/out/analytics/dashboard/fleetTitleUtils.js +0 -68
- package/out/analytics/dashboard/refreshPolicy.js +0 -16
- package/out/analytics/dashboard/scheduledFleetFingerprint.js +0 -22
- package/out/analytics/dashboard/scheduledFleetUtils.js +0 -22
- package/out/analytics/dashboard/sessionEventFleetStats.js +0 -118
- package/out/analytics/dashboard/viewsConfigMerge.js +0 -221
- package/out/analytics/dashboard/webview/codicon.ttf +0 -0
- package/out/analytics/identity.js +0 -0
- package/out/analytics/sessionEvents.js +0 -323
- package/out/auth/callbackUriParse.js +0 -59
- package/out/auth/types.js +0 -12
- package/out/auth-broker/config.js +0 -112
- package/out/auth-broker/jwt.js +0 -105
- package/out/auth-broker/pkce.js +0 -59
- package/out/auth-broker/server.js +0 -677
- package/out/auth-broker/store.js +0 -275
- package/out/authority/warrant.js +0 -206
- package/out/base-prompts/mcp-servers/.mcp.json +0 -13
- package/out/base-prompts/mcp-servers/langfuse-analytics/README.md +0 -142
- package/out/base-prompts/mcp-servers/langfuse-analytics/mcp.json +0 -13
- package/out/base-prompts/mcp-servers/langfuse-analytics/package-lock.json +0 -1192
- package/out/base-prompts/mcp-servers/langfuse-analytics/package.json +0 -23
- package/out/base-prompts/mcp-servers/langfuse-analytics/scripts/run-with-env.sh +0 -12
- package/out/base-prompts/mcp-servers/langfuse-analytics/scripts/sdk-test.js +0 -102
- package/out/base-prompts/mcp-servers/langfuse-analytics/scripts/simple-test.js +0 -137
- package/out/base-prompts/mcp-servers/langfuse-analytics/scripts/test-client.js +0 -118
- package/out/base-prompts/mcp-servers/langfuse-analytics/scripts/test-server.js +0 -209
- package/out/base-prompts/mcp-servers/langfuse-analytics/src/client.ts +0 -431
- package/out/base-prompts/mcp-servers/langfuse-analytics/src/index.ts +0 -270
- package/out/base-prompts/mcp-servers/langfuse-analytics/tsconfig.json +0 -18
- package/out/base-prompts/rules/AGENTS.md +0 -204
- package/out/base-prompts/skills/agent-browser/SKILL.md +0 -102
- package/out/base-prompts/skills/agent-builder/SKILL.md +0 -73
- package/out/base-prompts/skills/agent-builder/references/agent-pack.md +0 -63
- package/out/base-prompts/skills/agent-builder/references/crewai.md +0 -66
- package/out/base-prompts/skills/agent-builder/references/langchain.md +0 -60
- package/out/base-prompts/skills/agent-builder/references/raw-sdk.md +0 -73
- package/out/base-prompts/skills/agent-engine-creator/SKILL.md +0 -586
- package/out/base-prompts/skills/agent-engine-installer/SKILL.md +0 -106
- package/out/base-prompts/skills/agent-engine-installer/scripts/install-engine.mjs +0 -259
- package/out/base-prompts/skills/agent-engine-installer/scripts/install-engine.ps1 +0 -189
- package/out/base-prompts/skills/agenthippo-cli/SKILL.md +0 -69
- package/out/base-prompts/skills/agenthippo-cli/scripts/install.sh +0 -63
- package/out/base-prompts/skills/agentpack-creator/SKILL.md +0 -375
- package/out/base-prompts/skills/agentpack-creator/references/agent-templates.md +0 -261
- package/out/base-prompts/skills/agentpack-creator/references/agents-md-guide.md +0 -195
- package/out/base-prompts/skills/agentpack-creator/scripts/init_pack.py +0 -391
- package/out/base-prompts/skills/agentpack-creator/scripts/init_pack_test.py +0 -294
- package/out/base-prompts/skills/agentpack-testbench/SKILL.md +0 -135
- package/out/base-prompts/skills/algorithmic-art/LICENSE.txt +0 -202
- package/out/base-prompts/skills/algorithmic-art/SKILL.md +0 -405
- package/out/base-prompts/skills/algorithmic-art/templates/generator_template.js +0 -223
- package/out/base-prompts/skills/algorithmic-art/templates/viewer.html +0 -599
- package/out/base-prompts/skills/debug-agent/SKILL.md +0 -83
- package/out/base-prompts/skills/desktop-automation/SKILL.md +0 -166
- package/out/base-prompts/skills/desktop-automation/references/agenthippo-ui-recipes.md +0 -441
- package/out/base-prompts/skills/desktop-automation/scripts/windows-desktop-uia.psm1 +0 -280
- package/out/base-prompts/skills/docx/LICENSE.txt +0 -30
- package/out/base-prompts/skills/docx/SKILL.md +0 -197
- package/out/base-prompts/skills/docx/docx-js.md +0 -350
- package/out/base-prompts/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +0 -1499
- package/out/base-prompts/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +0 -146
- package/out/base-prompts/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +0 -1085
- package/out/base-prompts/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +0 -11
- package/out/base-prompts/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-main.xsd +0 -3081
- package/out/base-prompts/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +0 -23
- package/out/base-prompts/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +0 -185
- package/out/base-prompts/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +0 -287
- package/out/base-prompts/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/pml.xsd +0 -1676
- package/out/base-prompts/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +0 -28
- package/out/base-prompts/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +0 -144
- package/out/base-prompts/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +0 -174
- package/out/base-prompts/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +0 -25
- package/out/base-prompts/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +0 -18
- package/out/base-prompts/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +0 -59
- package/out/base-prompts/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +0 -56
- package/out/base-prompts/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +0 -195
- package/out/base-prompts/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-math.xsd +0 -582
- package/out/base-prompts/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +0 -25
- package/out/base-prompts/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/sml.xsd +0 -4439
- package/out/base-prompts/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-main.xsd +0 -570
- package/out/base-prompts/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +0 -509
- package/out/base-prompts/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +0 -12
- package/out/base-prompts/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +0 -108
- package/out/base-prompts/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +0 -96
- package/out/base-prompts/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/wml.xsd +0 -3646
- package/out/base-prompts/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/xml.xsd +0 -116
- package/out/base-prompts/skills/docx/ooxml/schemas/ecma/fouth-edition/opc-contentTypes.xsd +0 -42
- package/out/base-prompts/skills/docx/ooxml/schemas/ecma/fouth-edition/opc-coreProperties.xsd +0 -50
- package/out/base-prompts/skills/docx/ooxml/schemas/ecma/fouth-edition/opc-digSig.xsd +0 -49
- package/out/base-prompts/skills/docx/ooxml/schemas/ecma/fouth-edition/opc-relationships.xsd +0 -33
- package/out/base-prompts/skills/docx/ooxml/schemas/mce/mc.xsd +0 -75
- package/out/base-prompts/skills/docx/ooxml/schemas/microsoft/wml-2010.xsd +0 -560
- package/out/base-prompts/skills/docx/ooxml/schemas/microsoft/wml-2012.xsd +0 -67
- package/out/base-prompts/skills/docx/ooxml/schemas/microsoft/wml-2018.xsd +0 -14
- package/out/base-prompts/skills/docx/ooxml/schemas/microsoft/wml-cex-2018.xsd +0 -20
- package/out/base-prompts/skills/docx/ooxml/schemas/microsoft/wml-cid-2016.xsd +0 -13
- package/out/base-prompts/skills/docx/ooxml/schemas/microsoft/wml-sdtdatahash-2020.xsd +0 -4
- package/out/base-prompts/skills/docx/ooxml/schemas/microsoft/wml-symex-2015.xsd +0 -8
- package/out/base-prompts/skills/docx/ooxml/scripts/pack.py +0 -159
- package/out/base-prompts/skills/docx/ooxml/scripts/unpack.py +0 -29
- package/out/base-prompts/skills/docx/ooxml/scripts/validate.py +0 -69
- package/out/base-prompts/skills/docx/ooxml/scripts/validation/__init__.py +0 -15
- package/out/base-prompts/skills/docx/ooxml/scripts/validation/base.py +0 -951
- package/out/base-prompts/skills/docx/ooxml/scripts/validation/docx.py +0 -274
- package/out/base-prompts/skills/docx/ooxml/scripts/validation/pptx.py +0 -315
- package/out/base-prompts/skills/docx/ooxml/scripts/validation/redlining.py +0 -279
- package/out/base-prompts/skills/docx/ooxml.md +0 -610
- package/out/base-prompts/skills/docx/scripts/__init__.py +0 -1
- package/out/base-prompts/skills/docx/scripts/document.py +0 -1276
- package/out/base-prompts/skills/docx/scripts/templates/comments.xml +0 -3
- package/out/base-prompts/skills/docx/scripts/templates/commentsExtended.xml +0 -3
- package/out/base-prompts/skills/docx/scripts/templates/commentsExtensible.xml +0 -3
- package/out/base-prompts/skills/docx/scripts/templates/commentsIds.xml +0 -3
- package/out/base-prompts/skills/docx/scripts/templates/people.xml +0 -3
- package/out/base-prompts/skills/docx/scripts/utilities.py +0 -374
- package/out/base-prompts/skills/gateway-outbound/SKILL.md +0 -136
- package/out/base-prompts/skills/mcp-builder/LICENSE.txt +0 -202
- package/out/base-prompts/skills/mcp-builder/SKILL.md +0 -328
- package/out/base-prompts/skills/mcp-builder/reference/evaluation.md +0 -602
- package/out/base-prompts/skills/mcp-builder/reference/mcp_best_practices.md +0 -249
- package/out/base-prompts/skills/mcp-builder/reference/node_mcp_server.md +0 -970
- package/out/base-prompts/skills/mcp-builder/reference/python_mcp_server.md +0 -719
- package/out/base-prompts/skills/mcp-builder/scripts/connections.py +0 -151
- package/out/base-prompts/skills/mcp-builder/scripts/evaluation.py +0 -373
- package/out/base-prompts/skills/mcp-builder/scripts/example_evaluation.xml +0 -22
- package/out/base-prompts/skills/mcp-builder/scripts/requirements.txt +0 -2
- package/out/base-prompts/skills/openclaw/SKILL.md +0 -406
- package/out/base-prompts/skills/openclaw/scripts/run-smoke.sh +0 -61
- package/out/base-prompts/skills/pdf/LICENSE.txt +0 -30
- package/out/base-prompts/skills/pdf/SKILL.md +0 -294
- package/out/base-prompts/skills/pdf/forms.md +0 -205
- package/out/base-prompts/skills/pdf/reference.md +0 -612
- package/out/base-prompts/skills/pdf/scripts/check_bounding_boxes.py +0 -70
- package/out/base-prompts/skills/pdf/scripts/check_bounding_boxes_test.py +0 -226
- package/out/base-prompts/skills/pdf/scripts/check_fillable_fields.py +0 -12
- package/out/base-prompts/skills/pdf/scripts/convert_pdf_to_images.py +0 -35
- package/out/base-prompts/skills/pdf/scripts/create_validation_image.py +0 -41
- package/out/base-prompts/skills/pdf/scripts/extract_form_field_info.py +0 -152
- package/out/base-prompts/skills/pdf/scripts/fill_fillable_fields.py +0 -114
- package/out/base-prompts/skills/pdf/scripts/fill_pdf_form_with_annotations.py +0 -108
- package/out/base-prompts/skills/pptx/LICENSE.txt +0 -30
- package/out/base-prompts/skills/pptx/SKILL.md +0 -484
- package/out/base-prompts/skills/pptx/html2pptx.md +0 -625
- package/out/base-prompts/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +0 -1499
- package/out/base-prompts/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +0 -146
- package/out/base-prompts/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +0 -1085
- package/out/base-prompts/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +0 -11
- package/out/base-prompts/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-main.xsd +0 -3081
- package/out/base-prompts/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +0 -23
- package/out/base-prompts/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +0 -185
- package/out/base-prompts/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +0 -287
- package/out/base-prompts/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/pml.xsd +0 -1676
- package/out/base-prompts/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +0 -28
- package/out/base-prompts/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +0 -144
- package/out/base-prompts/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +0 -174
- package/out/base-prompts/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +0 -25
- package/out/base-prompts/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +0 -18
- package/out/base-prompts/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +0 -59
- package/out/base-prompts/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +0 -56
- package/out/base-prompts/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +0 -195
- package/out/base-prompts/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-math.xsd +0 -582
- package/out/base-prompts/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +0 -25
- package/out/base-prompts/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/sml.xsd +0 -4439
- package/out/base-prompts/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-main.xsd +0 -570
- package/out/base-prompts/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +0 -509
- package/out/base-prompts/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +0 -12
- package/out/base-prompts/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +0 -108
- package/out/base-prompts/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +0 -96
- package/out/base-prompts/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/wml.xsd +0 -3646
- package/out/base-prompts/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/xml.xsd +0 -116
- package/out/base-prompts/skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-contentTypes.xsd +0 -42
- package/out/base-prompts/skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-coreProperties.xsd +0 -50
- package/out/base-prompts/skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-digSig.xsd +0 -49
- package/out/base-prompts/skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-relationships.xsd +0 -33
- package/out/base-prompts/skills/pptx/ooxml/schemas/mce/mc.xsd +0 -75
- package/out/base-prompts/skills/pptx/ooxml/schemas/microsoft/wml-2010.xsd +0 -560
- package/out/base-prompts/skills/pptx/ooxml/schemas/microsoft/wml-2012.xsd +0 -67
- package/out/base-prompts/skills/pptx/ooxml/schemas/microsoft/wml-2018.xsd +0 -14
- package/out/base-prompts/skills/pptx/ooxml/schemas/microsoft/wml-cex-2018.xsd +0 -20
- package/out/base-prompts/skills/pptx/ooxml/schemas/microsoft/wml-cid-2016.xsd +0 -13
- package/out/base-prompts/skills/pptx/ooxml/schemas/microsoft/wml-sdtdatahash-2020.xsd +0 -4
- package/out/base-prompts/skills/pptx/ooxml/schemas/microsoft/wml-symex-2015.xsd +0 -8
- package/out/base-prompts/skills/pptx/ooxml/scripts/pack.py +0 -159
- package/out/base-prompts/skills/pptx/ooxml/scripts/unpack.py +0 -29
- package/out/base-prompts/skills/pptx/ooxml/scripts/validate.py +0 -69
- package/out/base-prompts/skills/pptx/ooxml/scripts/validation/__init__.py +0 -15
- package/out/base-prompts/skills/pptx/ooxml/scripts/validation/base.py +0 -951
- package/out/base-prompts/skills/pptx/ooxml/scripts/validation/docx.py +0 -274
- package/out/base-prompts/skills/pptx/ooxml/scripts/validation/pptx.py +0 -315
- package/out/base-prompts/skills/pptx/ooxml/scripts/validation/redlining.py +0 -279
- package/out/base-prompts/skills/pptx/ooxml.md +0 -427
- package/out/base-prompts/skills/pptx/scripts/html2pptx.js +0 -984
- package/out/base-prompts/skills/pptx/scripts/inventory.py +0 -1020
- package/out/base-prompts/skills/pptx/scripts/rearrange.py +0 -231
- package/out/base-prompts/skills/pptx/scripts/replace.py +0 -385
- package/out/base-prompts/skills/pptx/scripts/thumbnail.py +0 -450
- package/out/base-prompts/skills/prompt-lab/SKILL.md +0 -149
- package/out/base-prompts/skills/prompt-lab/scripts/query-analytics.sh +0 -2551
- package/out/base-prompts/skills/skill-creator/LICENSE.txt +0 -202
- package/out/base-prompts/skills/skill-creator/SKILL.md +0 -371
- package/out/base-prompts/skills/skill-creator/references/output-patterns.md +0 -82
- package/out/base-prompts/skills/skill-creator/references/workflows.md +0 -28
- package/out/base-prompts/skills/skill-creator/scripts/init_skill.py +0 -303
- package/out/base-prompts/skills/skill-creator/scripts/package_skill.py +0 -110
- package/out/base-prompts/skills/skill-creator/scripts/quick_validate.py +0 -95
- package/out/base-prompts/skills/skill-installer/SKILL.md +0 -251
- package/out/base-prompts/skills/skill-installer/references/store-api.md +0 -219
- package/out/base-prompts/skills/spotlight-dashboard/SKILL.md +0 -83
- package/out/base-prompts/skills/spotlight-insights/SKILL.md +0 -101
- package/out/base-prompts/skills/spotlight-optimize/SKILL.md +0 -93
- package/out/base-prompts/skills/spotlight-optimize/scripts/query-analytics.sh +0 -2551
- package/out/base-prompts/skills/spotlight-query/SKILL.md +0 -314
- package/out/base-prompts/skills/spotlight-query/references/otel-schema.md +0 -163
- package/out/base-prompts/skills/spotlight-query/scripts/query-analytics.sh +0 -2551
- package/out/base-prompts/skills/spotlight-query/scripts/query-analytics.test.sh +0 -744
- package/out/base-prompts/skills/spotlight-query/scripts/test-fixtures/analytics/sessions/sess-test-1.jsonl +0 -14
- package/out/base-prompts/skills/spotlight-query/scripts/test-fixtures/analytics/traces/.duckdb-index.json +0 -7
- package/out/base-prompts/skills/spotlight-query/scripts/test-fixtures/analytics/traces/sample.jsonl +0 -5
- package/out/base-prompts/skills/spotlight-report/SKILL.md +0 -86
- package/out/base-prompts/skills/spotlight-visualize/SKILL.md +0 -92
- package/out/base-prompts/skills/spotlight-visualize/scripts/query-analytics.sh +0 -2551
- package/out/base-prompts/skills/xlsx/LICENSE.txt +0 -30
- package/out/base-prompts/skills/xlsx/SKILL.md +0 -289
- package/out/base-prompts/skills/xlsx/recalc.py +0 -178
- package/out/branding.js +0 -49
- package/out/cli/commands/anywhere.js +0 -66
- package/out/cli/commands/ask.js +0 -246
- package/out/cli/commands/auth-broker.js +0 -24
- package/out/cli/commands/auth.js +0 -219
- package/out/cli/commands/chat.js +0 -357
- package/out/cli/commands/conformance.js +0 -249
- package/out/cli/commands/data-plane.js +0 -67
- package/out/cli/commands/deploy.js +0 -263
- package/out/cli/commands/gateway.js +0 -218
- package/out/cli/commands/idp.js +0 -85
- package/out/cli/commands/pack.js +0 -399
- package/out/cli/commands/probe-custom-engine.js +0 -82
- package/out/cli/commands/sandbox.js +0 -332
- package/out/cli/commands/serve.js +0 -1758
- package/out/cli/commands/store.js +0 -927
- package/out/cli/credential-context.js +0 -91
- package/out/cli/data-plane/broker.js +0 -78
- package/out/cli/data-plane/connector-host.js +0 -121
- package/out/cli/data-plane/egress.js +0 -189
- package/out/cli/data-plane/gateway.js +0 -218
- package/out/cli/data-plane/index.js +0 -152
- package/out/cli/data-plane/registry.js +0 -89
- package/out/cli/data-plane/remote.js +0 -106
- package/out/cli/data-plane/sidecar.js +0 -161
- package/out/cli/deploy/blueprints/registry.js +0 -84
- package/out/cli/deploy/layers/identity.js +0 -172
- package/out/cli/deploy-init.js +0 -3023
- package/out/cli/deps.js +0 -342
- package/out/cli/idp-init.js +0 -338
- package/out/cli/pack-install-ref.js +0 -15
- package/out/cli/pack-loader.js +0 -418
- package/out/cli/pack-runtime.js +0 -61
- package/out/cli/runtime.js +0 -450
- package/out/cli/serve-hardening.js +0 -607
- package/out/cli/state-sync.js +0 -424
- package/out/cli/utils.js +0 -231
- package/out/engines/base.js +0 -188
- package/out/engines/claude.js +0 -1254
- package/out/engines/codex.js +0 -862
- package/out/engines/custom.js +0 -674
- package/out/engines/customEngineIpc.js +0 -95
- package/out/engines/customEngineRunnerEmbed.js +0 -107
- package/out/engines/customRegistry.js +0 -274
- package/out/engines/embeddedCustomEngineRunner.generated.js +0 -9
- package/out/engines/engineApiKey.js +0 -138
- package/out/engines/install.js +0 -372
- package/out/engines/persistentEngineWorker.js +0 -320
- package/out/engines/publish.js +0 -341
- package/out/evidence/sessionShip.js +0 -610
- package/out/gateway/bridge.js +0 -843
- package/out/gateway/cli-agent-id.js +0 -36
- package/out/gateway/client.js +0 -336
- package/out/gateway/client.test.js +0 -395
- package/out/gateway/gateway-scope-errors.js +0 -14
- package/out/gateway/gatewayBackup.js +0 -76
- package/out/gateway/installSource.js +0 -68
- package/out/gateway/lifecycle.js +0 -3190
- package/out/gateway/openclaw-channel-routing.js +0 -317
- package/out/gateway/outboundHandles.js +0 -373
- package/out/gateway/outboundPaths.js +0 -75
- package/out/gateway/outboundSend.js +0 -254
- package/out/gateway/protocol.js +0 -48
- package/out/gateway/secretsPreflight.js +0 -90
- package/out/gateway/sessionRouting.js +0 -77
- package/out/headless/index.js +0 -539
- package/out/headless/sync.js +0 -473
- package/out/live-e2e/mcp-demo/server.mjs +0 -32
- package/out/live-probe/connector.mjs +0 -8
- package/out/live-probe/env-report.mjs +0 -8
- package/out/mcp.js +0 -654
- package/out/pack/caps.js +0 -271
- package/out/pack/governor.js +0 -309
- package/out/pack/lease-schema.js +0 -270
- package/out/pack/lease.js +0 -640
- package/out/pack/reconcile.js +0 -217
- package/out/pack/signature.js +0 -839
- package/out/permissions.js +0 -108
- package/out/permissions.mapping.yaml +0 -68
- package/out/registry/index.js +0 -332
- package/out/runner/host.js +0 -131
- package/out/runner/protocol.js +0 -108
- package/out/runner/remoteEngine.js +0 -130
- package/out/runtime/interfaces/config-provider.js +0 -32
- package/out/runtime/interfaces/edit-tracker.js +0 -24
- package/out/runtime/interfaces/index.js +0 -29
- package/out/runtime/interfaces/logger.js +0 -40
- package/out/runtime/interfaces/permission-handler.js +0 -66
- package/out/runtime/interfaces/session-store.js +0 -342
- package/out/runtime/vscode/vscode-session-store.js +0 -22
- package/out/sandbox/containerDriver.js +0 -570
- package/out/sandbox/processDriver.js +0 -315
- package/out/sandbox/sandboxRunner.js +0 -191
- package/out/sandbox/support.js +0 -301
- package/out/sandbox/types.js +0 -55
- package/out/scripts/analytics/fleet-local-adapter.js +0 -246
- package/out/scripts/analytics/live-fleet-4-collector.cjs +0 -315
- package/out/scripts/analytics/live-fleet-4-daemon.mjs +0 -134
- package/out/scripts/analytics/live-fleet-4-widget.cjs +0 -433
- package/out/scripts/gateway/Dockerfile.serve +0 -45
- package/out/scripts/gateway/docker-serve.sh +0 -248
- package/out/scripts/gateway/setup-gateway-server.ps1 +0 -953
- package/out/scripts/gateway/setup-gateway-server.sh +0 -935
- package/out/session.js +0 -272
- package/out/shared/agentEngines.js +0 -170
- package/out/shared/index.js +0 -109
- package/out/shared/models.js +0 -136
- package/out/shared/providers.js +0 -205
- package/out/spotlight/install.js +0 -345
- package/out/spotlight/publish.js +0 -544
- package/out/spotlight/yaml.js +0 -31
- package/out/store/index.js +0 -786
- package/out/store/shared.js +0 -241
- package/out/test/agentEnvFile.test.js +0 -97
- package/out/test/agentYaml.test.js +0 -373
- package/out/test/agentpack.test.js +0 -639
- package/out/test/analytics-lifecycle.test.js +0 -174
- package/out/test/analytics.test.js +0 -756
- package/out/test/auth-baseurl.test.js +0 -132
- package/out/test/auth-bootstrapApply.test.js +0 -123
- package/out/test/auth-broker-hardening.test.js +0 -227
- package/out/test/auth-broker.test.js +0 -541
- package/out/test/auth-callback.test.js +0 -62
- package/out/test/blueprint-registry.test.js +0 -105
- package/out/test/branding.test.js +0 -242
- package/out/test/caps-governor.test.js +0 -455
- package/out/test/cli-agent-id.test.js +0 -55
- package/out/test/codex-new-file-survival.test.js +0 -119
- package/out/test/configuration-scopes.test.js +0 -131
- package/out/test/credential-context.test.js +0 -160
- package/out/test/custom-env-layering.test.js +0 -151
- package/out/test/customEngineInstall.test.js +0 -100
- package/out/test/customRegistry.test.js +0 -122
- package/out/test/data-plane-engine-wiring.test.js +0 -250
- package/out/test/data-plane.test.js +0 -311
- package/out/test/deploy-init.test.js +0 -854
- package/out/test/deps-auto-install.test.js +0 -81
- package/out/test/egress-broker.test.js +0 -172
- package/out/test/engine-integration.test.js +0 -297
- package/out/test/enginePaths.test.js +0 -195
- package/out/test/enginePublish.test.js +0 -82
- package/out/test/fleetDisplayUtils.test.js +0 -100
- package/out/test/gateway-client.test.js +0 -409
- package/out/test/gateway-install-source.test.js +0 -111
- package/out/test/gateway-lifecycle.test.js +0 -608
- package/out/test/gateway-outbound.test.js +0 -538
- package/out/test/gateway-reset-mappings.test.js +0 -221
- package/out/test/gateway-route-index.test.js +0 -235
- package/out/test/gateway-secrets-preflight.test.js +0 -127
- package/out/test/gateway-session-routing.test.js +0 -65
- package/out/test/gateway-session-store.test.js +0 -216
- package/out/test/github.test.js +0 -232
- package/out/test/governor-hardening.test.js +0 -217
- package/out/test/headless-sync.test.js +0 -301
- package/out/test/helpers/manifest-fixtures.js +0 -27
- package/out/test/idp-init.test.js +0 -151
- package/out/test/lease-signature.test.js +0 -357
- package/out/test/lease-trust-root.test.js +0 -273
- package/out/test/lease-validation.test.js +0 -169
- package/out/test/lease.test.js +0 -114
- package/out/test/mcp-obo.test.js +0 -107
- package/out/test/mcp.test.js +0 -389
- package/out/test/model-routing.test.js +0 -133
- package/out/test/openclaw-channel-routing.test.js +0 -191
- package/out/test/pack-admission.test.js +0 -216
- package/out/test/pack-digest-parity.test.js +0 -140
- package/out/test/pack-reconcile.test.js +0 -183
- package/out/test/pack-signature-artifact.test.js +0 -103
- package/out/test/pack-signature.test.js +0 -176
- package/out/test/pack-trust-root.test.js +0 -202
- package/out/test/pathSafety.test.js +0 -63
- package/out/test/permissions.test.js +0 -175
- package/out/test/persistent-engine-worker.test.js +0 -220
- package/out/test/refreshPolicy.test.js +0 -60
- package/out/test/registry.test.js +0 -351
- package/out/test/remote-trust.test.js +0 -242
- package/out/test/runner-protocol.test.js +0 -249
- package/out/test/runtime.test.js +0 -349
- package/out/test/sandbox-driver.test.js +0 -553
- package/out/test/sandbox-hardening.test.js +0 -395
- package/out/test/sandbox-runner.test.js +0 -343
- package/out/test/scheduledFleetStorage.test.js +0 -72
- package/out/test/serve-gateway-turn.test.js +0 -267
- package/out/test/serve-hardening.test.js +0 -418
- package/out/test/serveClient.test.js +0 -209
- package/out/test/sessionJsonlFleet.test.js +0 -78
- package/out/test/sessionShip.test.js +0 -560
- package/out/test/shared.test.js +0 -173
- package/out/test/skills-mcp.test.js +0 -299
- package/out/test/spotlightPublish.test.js +0 -327
- package/out/test/spotlightYaml.test.js +0 -58
- package/out/test/state-sync-peer.test.js +0 -156
- package/out/test/store-install-safe.test.js +0 -69
- package/out/test/store.test.js +0 -331
- package/out/test/stores.test.js +0 -504
- package/out/test/sync-switch.test.js +0 -251
- package/out/test/teamViewDiscovery.test.js +0 -90
- package/out/test/tls-bypass.test.js +0 -90
- package/out/test/toolPath.test.js +0 -120
- package/out/test/utils.test.js +0 -308
- package/out/test/viewsConfigMerge.test.js +0 -180
- package/out/test/warrant.test.js +0 -138
- package/out/test/windows-command-line.test.js +0 -75
- package/out/utils/agentEnvFile.js +0 -131
- package/out/utils/binary.js +0 -175
- package/out/utils/index.js +0 -37
- package/out/utils/network.js +0 -74
- package/out/utils/paths.js +0 -116
- package/out/utils/pid.js +0 -180
- package/out/utils/resolveNodeBinary.js +0 -168
- package/out/utils/windowsCommandLine.js +0 -29
- package/out/utils.js +0 -968
|
@@ -1,935 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
#
|
|
3
|
-
# Copyright (c) AgentHippo.ai. All rights reserved.
|
|
4
|
-
#
|
|
5
|
-
# AgentHippo — Server Gateway Setup
|
|
6
|
-
#
|
|
7
|
-
# Installs OpenClaw Gateway on a server (headless or desktop) so agents
|
|
8
|
-
# can connect from the CLI or IDE and be reached on messaging channels.
|
|
9
|
-
#
|
|
10
|
-
# This script mirrors setup-gateway.sh (IDE-triggered) but adds:
|
|
11
|
-
# - Background start (nohup) or systemd service
|
|
12
|
-
# - Auth token configuration
|
|
13
|
-
# - Remote bind address (0.0.0.0)
|
|
14
|
-
# - Connection info printout
|
|
15
|
-
#
|
|
16
|
-
# Usage:
|
|
17
|
-
# ./setup-gateway-server.sh --source /path/to/openclaw # Local source
|
|
18
|
-
# ./setup-gateway-server.sh --source openclaw/openclaw#branch # Git source
|
|
19
|
-
# ./setup-gateway-server.sh --source openclaw@latest # npm source
|
|
20
|
-
# ./setup-gateway-server.sh --bind 0.0.0.0 --token mysecret # Remote access
|
|
21
|
-
# ./setup-gateway-server.sh --systemd # systemd service
|
|
22
|
-
# ./setup-gateway-server.sh --check # Check status only
|
|
23
|
-
# ./setup-gateway-server.sh --uninstall # stop gateway + remove global openclaw (config kept)
|
|
24
|
-
# ./setup-gateway-server.sh --reinstall --source <src> # uninstall, verify, install (+ start)
|
|
25
|
-
#
|
|
26
|
-
|
|
27
|
-
set -euo pipefail
|
|
28
|
-
|
|
29
|
-
# npm/@npmcli: lifecycle hooks spawn bare `sh`; setPATH can omit /bin if parent PATH is empty.
|
|
30
|
-
export PATH="/usr/bin:/bin:/usr/sbin:/sbin${PATH:+:$PATH}"
|
|
31
|
-
export npm_config_script_shell=/bin/sh
|
|
32
|
-
# Corepack should never block Agent Anywhere setup waiting for interactive approval.
|
|
33
|
-
export COREPACK_ENABLE_DOWNLOAD_PROMPT=0
|
|
34
|
-
|
|
35
|
-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
36
|
-
|
|
37
|
-
# Colors
|
|
38
|
-
RED='\033[0;31m'
|
|
39
|
-
GREEN='\033[0;32m'
|
|
40
|
-
YELLOW='\033[1;33m'
|
|
41
|
-
BLUE='\033[0;34m'
|
|
42
|
-
CYAN='\033[0;36m'
|
|
43
|
-
BOLD='\033[1m'
|
|
44
|
-
NC='\033[0m'
|
|
45
|
-
|
|
46
|
-
# Defaults
|
|
47
|
-
INSTALL_SOURCE="${INSTALL_SOURCE:-}"
|
|
48
|
-
CHECK_ONLY=false
|
|
49
|
-
UNINSTALL=false
|
|
50
|
-
REINSTALL=false
|
|
51
|
-
GATEWAY_PORT="${GATEWAY_PORT:-18789}"
|
|
52
|
-
GATEWAY_BIND="${GATEWAY_BIND:-127.0.0.1}"
|
|
53
|
-
GATEWAY_TOKEN="${GATEWAY_TOKEN:-}"
|
|
54
|
-
INSTALL_SYSTEMD=false
|
|
55
|
-
CONFIG_TEMPLATE="${CONFIG_TEMPLATE:-}"
|
|
56
|
-
START_GATEWAY=true
|
|
57
|
-
PORT_FROM_CLI=false
|
|
58
|
-
|
|
59
|
-
# Parse arguments
|
|
60
|
-
while [[ $# -gt 0 ]]; do
|
|
61
|
-
case "$1" in
|
|
62
|
-
--source|-s)
|
|
63
|
-
INSTALL_SOURCE="$2"
|
|
64
|
-
shift 2
|
|
65
|
-
;;
|
|
66
|
-
--check|-c)
|
|
67
|
-
CHECK_ONLY=true
|
|
68
|
-
shift
|
|
69
|
-
;;
|
|
70
|
-
--uninstall)
|
|
71
|
-
UNINSTALL=true
|
|
72
|
-
shift
|
|
73
|
-
;;
|
|
74
|
-
--reinstall)
|
|
75
|
-
REINSTALL=true
|
|
76
|
-
shift
|
|
77
|
-
;;
|
|
78
|
-
--port|-p)
|
|
79
|
-
GATEWAY_PORT="$2"
|
|
80
|
-
PORT_FROM_CLI=true
|
|
81
|
-
shift 2
|
|
82
|
-
;;
|
|
83
|
-
--bind|-b)
|
|
84
|
-
GATEWAY_BIND="$2"
|
|
85
|
-
shift 2
|
|
86
|
-
;;
|
|
87
|
-
--token|-t)
|
|
88
|
-
GATEWAY_TOKEN="$2"
|
|
89
|
-
shift 2
|
|
90
|
-
;;
|
|
91
|
-
--systemd)
|
|
92
|
-
INSTALL_SYSTEMD=true
|
|
93
|
-
shift
|
|
94
|
-
;;
|
|
95
|
-
--no-start)
|
|
96
|
-
START_GATEWAY=false
|
|
97
|
-
shift
|
|
98
|
-
;;
|
|
99
|
-
--config-template)
|
|
100
|
-
CONFIG_TEMPLATE="$2"
|
|
101
|
-
shift 2
|
|
102
|
-
;;
|
|
103
|
-
--help|-h)
|
|
104
|
-
echo "Usage: $0 [options]"
|
|
105
|
-
echo ""
|
|
106
|
-
echo "Options:"
|
|
107
|
-
echo " --source, -s <src> npm install source (git repo, local path, or npm package)"
|
|
108
|
-
echo " --check, -c Check installation status only"
|
|
109
|
-
echo " --uninstall Stop gateway, remove global openclaw (~/.openclaw unchanged)"
|
|
110
|
-
echo " --reinstall With --source: uninstall, check, then full install"
|
|
111
|
-
echo " --port, -p <port> Gateway port (default: gateway.port in ~/.openclaw/openclaw.json, else 18789)"
|
|
112
|
-
echo " --bind, -b <addr> Bind address (default: 127.0.0.1, use 0.0.0.0 for remote)"
|
|
113
|
-
echo " --token, -t <token> Auth token for gateway connections"
|
|
114
|
-
echo " --systemd Install and enable systemd user service"
|
|
115
|
-
echo " --no-start Install and configure only, don't start the gateway"
|
|
116
|
-
echo " --config-template <f> Path to starter config template"
|
|
117
|
-
echo " --help, -h Show this help"
|
|
118
|
-
exit 0
|
|
119
|
-
;;
|
|
120
|
-
*)
|
|
121
|
-
echo "Unknown option: $1"
|
|
122
|
-
exit 1
|
|
123
|
-
;;
|
|
124
|
-
esac
|
|
125
|
-
done
|
|
126
|
-
|
|
127
|
-
read_openclaw_config_gateway_port() {
|
|
128
|
-
local f="$HOME/.openclaw/openclaw.json"
|
|
129
|
-
[[ -f "$f" ]] || return 1
|
|
130
|
-
command -v node &>/dev/null || return 1
|
|
131
|
-
node -e '
|
|
132
|
-
const fs = require("fs");
|
|
133
|
-
const path = require("path");
|
|
134
|
-
const os = require("os");
|
|
135
|
-
const fp = path.join(os.homedir(), ".openclaw", "openclaw.json");
|
|
136
|
-
if (!fs.existsSync(fp)) process.exit(1);
|
|
137
|
-
let t = fs.readFileSync(fp, "utf8");
|
|
138
|
-
t = t.replace(/^\s*\/\/.*$/gm, "").replace(/,\s*([\]}])/g, "$1");
|
|
139
|
-
try {
|
|
140
|
-
const j = JSON.parse(t);
|
|
141
|
-
const p = j && j.gateway && j.gateway.port;
|
|
142
|
-
if (typeof p === "number" && p >= 1 && p <= 65535) { process.stdout.write(String(p)); process.exit(0); }
|
|
143
|
-
if (typeof p === "string" && /^[0-9]+$/.test(p)) { process.stdout.write(p); process.exit(0); }
|
|
144
|
-
} catch (e) {}
|
|
145
|
-
process.exit(1);
|
|
146
|
-
' 2>/dev/null
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
if ! $PORT_FROM_CLI; then
|
|
150
|
-
_cfg_port=""
|
|
151
|
-
_cfg_port=$(read_openclaw_config_gateway_port) || true
|
|
152
|
-
if [[ -n "$_cfg_port" ]]; then
|
|
153
|
-
GATEWAY_PORT="$_cfg_port"
|
|
154
|
-
fi
|
|
155
|
-
fi
|
|
156
|
-
|
|
157
|
-
# Logging
|
|
158
|
-
log_info() { echo -e "${BLUE}[INFO]${NC} $1"; }
|
|
159
|
-
log_success() { echo -e "${GREEN} ✓${NC} $1"; }
|
|
160
|
-
log_warn() { echo -e "${YELLOW} ✗${NC} $1"; }
|
|
161
|
-
log_error() { echo -e "${RED}[ERROR]${NC} $1"; }
|
|
162
|
-
log_step() { echo -e "\n${BOLD}${CYAN}$1${NC}"; }
|
|
163
|
-
|
|
164
|
-
# Git / GitHub-style sources need a local UI build (published tarballs ship dist/).
|
|
165
|
-
needs_source_build() {
|
|
166
|
-
if [[ -z "$INSTALL_SOURCE" ]]; then
|
|
167
|
-
return 1
|
|
168
|
-
fi
|
|
169
|
-
local s="$INSTALL_SOURCE"
|
|
170
|
-
if [[ "$s" == /* || "$s" == ./* ]]; then
|
|
171
|
-
return 0
|
|
172
|
-
fi
|
|
173
|
-
if [[ "$s" == github:* || "$s" == git+http:* || "$s" == git+https:* ]]; then
|
|
174
|
-
return 0
|
|
175
|
-
fi
|
|
176
|
-
if [[ "$s" == *"#"* ]]; then
|
|
177
|
-
return 0
|
|
178
|
-
fi
|
|
179
|
-
if [[ "$s" =~ ^[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$ ]]; then
|
|
180
|
-
return 0
|
|
181
|
-
fi
|
|
182
|
-
return 1
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
needs_pnpm() {
|
|
186
|
-
needs_source_build
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
# Git checkouts omit compiled dist/; build in clone before npm pack so dist/entry.(m)js and control-ui exist.
|
|
190
|
-
install_openclaw_from_remote_git_spec() {
|
|
191
|
-
local spec="$1"
|
|
192
|
-
local s="$spec" ref=""
|
|
193
|
-
if [[ "$s" == *"#"* ]]; then
|
|
194
|
-
ref="${s##*#}"
|
|
195
|
-
s="${s%#*}"
|
|
196
|
-
fi
|
|
197
|
-
|
|
198
|
-
local clone_url=""
|
|
199
|
-
if [[ "$s" == git+https:* || "$s" == git+http:* ]]; then
|
|
200
|
-
clone_url="${s#git+}"
|
|
201
|
-
elif [[ "$s" == github:* ]]; then
|
|
202
|
-
clone_url="https://github.com/${s#github:}.git"
|
|
203
|
-
elif [[ "$s" =~ ^[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$ ]]; then
|
|
204
|
-
clone_url="https://github.com/${s}.git"
|
|
205
|
-
else
|
|
206
|
-
log_error "Unsupported git install source: $spec"
|
|
207
|
-
exit 1
|
|
208
|
-
fi
|
|
209
|
-
|
|
210
|
-
local work
|
|
211
|
-
work="$(mktemp -d "${TMPDIR:-/tmp}/openclaw-gateway-src.XXXXXX")"
|
|
212
|
-
|
|
213
|
-
log_info "Cloning $(basename "$clone_url" .git) (shallow) for npm pack install..."
|
|
214
|
-
if [[ -n "$ref" ]]; then
|
|
215
|
-
git clone --depth 1 -b "$ref" "$clone_url" "$work/src" || {
|
|
216
|
-
log_error "git clone failed (check ref and network)"
|
|
217
|
-
rm -rf "$work"
|
|
218
|
-
exit 1
|
|
219
|
-
}
|
|
220
|
-
else
|
|
221
|
-
git clone --depth 1 "$clone_url" "$work/src" || {
|
|
222
|
-
log_error "git clone failed"
|
|
223
|
-
rm -rf "$work"
|
|
224
|
-
exit 1
|
|
225
|
-
}
|
|
226
|
-
fi
|
|
227
|
-
|
|
228
|
-
build_openclaw_in_dir "$work/src" || {
|
|
229
|
-
log_error "OpenClaw build failed in clone (need pnpm, Node 22.12+, network for deps)"
|
|
230
|
-
rm -rf "$work"
|
|
231
|
-
exit 1
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
log_info "npm pack --ignore-scripts ..."
|
|
235
|
-
(cd "$work/src" && npm pack --ignore-scripts) || {
|
|
236
|
-
log_error "npm pack failed"
|
|
237
|
-
rm -rf "$work"
|
|
238
|
-
exit 1
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
local tgz
|
|
242
|
-
tgz="$(ls -t "$work/src"/openclaw-*.tgz 2>/dev/null | head -1)"
|
|
243
|
-
if [[ -z "$tgz" || ! -f "$tgz" ]]; then
|
|
244
|
-
log_error "npm pack did not produce openclaw-*.tgz under clone"
|
|
245
|
-
rm -rf "$work"
|
|
246
|
-
exit 1
|
|
247
|
-
fi
|
|
248
|
-
|
|
249
|
-
log_info "npm install -g $(basename "$tgz") ..."
|
|
250
|
-
npm install -g "$tgz" || {
|
|
251
|
-
log_error "npm install -g tarball failed"
|
|
252
|
-
rm -rf "$work"
|
|
253
|
-
exit 1
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
REMOTE_GATEWAY_CLONE_SRC="$work/src"
|
|
257
|
-
REMOTE_GATEWAY_WORK_DIR="$work"
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
# ============================================================================
|
|
261
|
-
# Check prerequisites (same as setup-gateway.sh)
|
|
262
|
-
# ============================================================================
|
|
263
|
-
check_prerequisites() {
|
|
264
|
-
log_step "Checking prerequisites..."
|
|
265
|
-
|
|
266
|
-
local all_good=true
|
|
267
|
-
|
|
268
|
-
# Node.js >= 22
|
|
269
|
-
if command -v node &>/dev/null; then
|
|
270
|
-
local node_version
|
|
271
|
-
node_version=$(node -v | sed 's/v//' | cut -d. -f1)
|
|
272
|
-
if [[ "$node_version" -ge 22 ]]; then
|
|
273
|
-
log_success "Node.js $(node -v)"
|
|
274
|
-
else
|
|
275
|
-
log_warn "Node.js $(node -v) — version 22+ required"
|
|
276
|
-
all_good=false
|
|
277
|
-
fi
|
|
278
|
-
else
|
|
279
|
-
log_warn "Node.js not found (version 22+ required)"
|
|
280
|
-
echo " Install: https://nodejs.org/ or: curl -fsSL https://fnm.vercel.app/install | bash && fnm install 22"
|
|
281
|
-
all_good=false
|
|
282
|
-
fi
|
|
283
|
-
|
|
284
|
-
# npm
|
|
285
|
-
if command -v npm &>/dev/null; then
|
|
286
|
-
log_success "npm $(npm -v)"
|
|
287
|
-
else
|
|
288
|
-
log_warn "npm not found"
|
|
289
|
-
all_good=false
|
|
290
|
-
fi
|
|
291
|
-
|
|
292
|
-
if needs_pnpm; then
|
|
293
|
-
local src="$INSTALL_SOURCE"
|
|
294
|
-
if [[ "$src" != /* && "$src" != ./* ]]; then
|
|
295
|
-
if command -v git &>/dev/null; then
|
|
296
|
-
log_success "git $(git --version | head -1)"
|
|
297
|
-
else
|
|
298
|
-
log_warn "git not found (required for GitHub / git URL gateway install sources)"
|
|
299
|
-
all_good=false
|
|
300
|
-
fi
|
|
301
|
-
fi
|
|
302
|
-
fi
|
|
303
|
-
|
|
304
|
-
# pnpm (needed for pnpm build + ui:build when installing from git/local source)
|
|
305
|
-
if needs_pnpm; then
|
|
306
|
-
if command -v pnpm &>/dev/null; then
|
|
307
|
-
log_success "pnpm $(pnpm -v)"
|
|
308
|
-
else
|
|
309
|
-
log_warn "pnpm not found (needed to build OpenClaw from source)"
|
|
310
|
-
echo " Install: npm install -g pnpm"
|
|
311
|
-
fi
|
|
312
|
-
else
|
|
313
|
-
log_info "pnpm not required for published package install"
|
|
314
|
-
fi
|
|
315
|
-
|
|
316
|
-
$all_good
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
# ============================================================================
|
|
320
|
-
# Ensure pnpm is available when we need to build the UI
|
|
321
|
-
# ============================================================================
|
|
322
|
-
ensure_pnpm() {
|
|
323
|
-
if command -v pnpm &>/dev/null; then
|
|
324
|
-
log_success "pnpm $(pnpm -v)"
|
|
325
|
-
return 0
|
|
326
|
-
fi
|
|
327
|
-
|
|
328
|
-
log_warn "pnpm not found — attempting to install"
|
|
329
|
-
|
|
330
|
-
if command -v corepack &>/dev/null; then
|
|
331
|
-
log_info "Installing pnpm via corepack..."
|
|
332
|
-
export COREPACK_ENABLE_DOWNLOAD_PROMPT=0
|
|
333
|
-
if corepack prepare pnpm@latest --activate &>/dev/null; then
|
|
334
|
-
if command -v pnpm &>/dev/null; then
|
|
335
|
-
log_success "pnpm $(pnpm -v)"
|
|
336
|
-
return 0
|
|
337
|
-
fi
|
|
338
|
-
fi
|
|
339
|
-
fi
|
|
340
|
-
|
|
341
|
-
if command -v npm &>/dev/null; then
|
|
342
|
-
log_info "Installing pnpm via npm..."
|
|
343
|
-
if npm install -g pnpm; then
|
|
344
|
-
log_success "pnpm $(pnpm -v)"
|
|
345
|
-
return 0
|
|
346
|
-
fi
|
|
347
|
-
fi
|
|
348
|
-
|
|
349
|
-
log_warn "pnpm install failed — skipping web UI build"
|
|
350
|
-
return 1
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
build_openclaw_in_dir() {
|
|
354
|
-
local dir="$1"
|
|
355
|
-
if [[ ! -d "$dir" ]]; then
|
|
356
|
-
log_error "build_openclaw_in_dir: not a directory: $dir"
|
|
357
|
-
return 1
|
|
358
|
-
fi
|
|
359
|
-
ensure_pnpm || {
|
|
360
|
-
log_error "pnpm is required to build OpenClaw from a git checkout"
|
|
361
|
-
return 1
|
|
362
|
-
}
|
|
363
|
-
log_info "pnpm install && pnpm build && pnpm ui:build in $(basename "$dir") (may take several minutes)..."
|
|
364
|
-
(
|
|
365
|
-
cd "$dir" || exit 1
|
|
366
|
-
if [[ ! -f pnpm-lock.yaml ]]; then
|
|
367
|
-
log_error "pnpm-lock.yaml missing — expected an OpenClaw repo checkout"
|
|
368
|
-
exit 1
|
|
369
|
-
fi
|
|
370
|
-
pnpm install || {
|
|
371
|
-
log_error "pnpm install failed"
|
|
372
|
-
exit 1
|
|
373
|
-
}
|
|
374
|
-
pnpm build || {
|
|
375
|
-
log_error "pnpm build failed"
|
|
376
|
-
exit 1
|
|
377
|
-
}
|
|
378
|
-
pnpm ui:build || {
|
|
379
|
-
log_error "pnpm ui:build failed"
|
|
380
|
-
exit 1
|
|
381
|
-
}
|
|
382
|
-
)
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
# ============================================================================
|
|
386
|
-
# Check installed components (extended for server: systemd, bind, token)
|
|
387
|
-
# ============================================================================
|
|
388
|
-
check_installed() {
|
|
389
|
-
log_step "Checking installed components..."
|
|
390
|
-
|
|
391
|
-
local all_ok=true
|
|
392
|
-
|
|
393
|
-
# openclaw binary
|
|
394
|
-
if command -v openclaw &>/dev/null; then
|
|
395
|
-
local oc_version
|
|
396
|
-
oc_version=$(openclaw --version 2>/dev/null | head -1 || echo "unknown")
|
|
397
|
-
log_success "openclaw installed: $oc_version"
|
|
398
|
-
else
|
|
399
|
-
# Check common install locations
|
|
400
|
-
local found=false
|
|
401
|
-
for candidate in \
|
|
402
|
-
"$HOME/Library/pnpm/openclaw" \
|
|
403
|
-
"$HOME/.local/share/pnpm/openclaw" \
|
|
404
|
-
"$HOME/.npm-global/bin/openclaw" \
|
|
405
|
-
"/usr/local/bin/openclaw" \
|
|
406
|
-
"/usr/bin/openclaw"; do
|
|
407
|
-
if [[ -x "$candidate" ]]; then
|
|
408
|
-
local oc_version
|
|
409
|
-
oc_version=$("$candidate" --version 2>/dev/null | head -1 || echo "unknown")
|
|
410
|
-
log_success "openclaw installed at $candidate: $oc_version"
|
|
411
|
-
found=true
|
|
412
|
-
break
|
|
413
|
-
fi
|
|
414
|
-
done
|
|
415
|
-
if ! $found; then
|
|
416
|
-
log_warn "openclaw not installed"
|
|
417
|
-
all_ok=false
|
|
418
|
-
fi
|
|
419
|
-
fi
|
|
420
|
-
|
|
421
|
-
local groot
|
|
422
|
-
groot="$(npm root -g 2>/dev/null)/openclaw"
|
|
423
|
-
if [[ -f "$groot/dist/entry.mjs" || -f "$groot/dist/entry.js" ]]; then
|
|
424
|
-
log_success "CLI dist present ($groot/dist/entry.*)"
|
|
425
|
-
else
|
|
426
|
-
log_warn "CLI dist missing (run setup with source build or reinstall from npm)"
|
|
427
|
-
all_ok=false
|
|
428
|
-
fi
|
|
429
|
-
|
|
430
|
-
# Web UI assets
|
|
431
|
-
local ui_dir
|
|
432
|
-
ui_dir="$groot/dist/control-ui"
|
|
433
|
-
if [[ -f "$ui_dir/index.html" ]]; then
|
|
434
|
-
log_success "Web UI built ($ui_dir)"
|
|
435
|
-
else
|
|
436
|
-
log_warn "Web UI not built"
|
|
437
|
-
all_ok=false
|
|
438
|
-
fi
|
|
439
|
-
|
|
440
|
-
# Gateway running?
|
|
441
|
-
if nc -z 127.0.0.1 "$GATEWAY_PORT" 2>/dev/null; then
|
|
442
|
-
log_success "Gateway running on port $GATEWAY_PORT"
|
|
443
|
-
else
|
|
444
|
-
log_warn "Gateway not running on port $GATEWAY_PORT"
|
|
445
|
-
fi
|
|
446
|
-
|
|
447
|
-
# Config file
|
|
448
|
-
local config_path="$HOME/.openclaw/openclaw.json"
|
|
449
|
-
if [[ -f "$config_path" ]]; then
|
|
450
|
-
log_success "Config file present ($config_path)"
|
|
451
|
-
else
|
|
452
|
-
log_warn "Config file not found ($config_path)"
|
|
453
|
-
fi
|
|
454
|
-
|
|
455
|
-
# systemd service (Linux only)
|
|
456
|
-
if [[ "$(uname)" == "Linux" ]] && command -v systemctl &>/dev/null; then
|
|
457
|
-
if systemctl --user is-enabled openclaw-gateway &>/dev/null 2>&1; then
|
|
458
|
-
local svc_status
|
|
459
|
-
svc_status=$(systemctl --user is-active openclaw-gateway 2>/dev/null || echo "inactive")
|
|
460
|
-
log_success "systemd service: $svc_status"
|
|
461
|
-
elif [[ -f "$HOME/.config/systemd/user/openclaw-gateway.service" ]]; then
|
|
462
|
-
log_warn "systemd service installed but not enabled"
|
|
463
|
-
fi
|
|
464
|
-
fi
|
|
465
|
-
|
|
466
|
-
echo ""
|
|
467
|
-
if $all_ok; then
|
|
468
|
-
echo -e "${GREEN}${BOLD}Gateway is fully installed!${NC}"
|
|
469
|
-
return 0
|
|
470
|
-
else
|
|
471
|
-
echo -e "${YELLOW}${BOLD}Gateway setup is incomplete.${NC}"
|
|
472
|
-
return 1
|
|
473
|
-
fi
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
# ============================================================================
|
|
477
|
-
# Install gateway (same as setup-gateway.sh)
|
|
478
|
-
# ============================================================================
|
|
479
|
-
install_gateway() {
|
|
480
|
-
if [[ -z "$INSTALL_SOURCE" ]]; then
|
|
481
|
-
log_error "No install source specified. Use --source <source>"
|
|
482
|
-
exit 1
|
|
483
|
-
fi
|
|
484
|
-
|
|
485
|
-
REMOTE_GATEWAY_CLONE_SRC=""
|
|
486
|
-
REMOTE_GATEWAY_WORK_DIR=""
|
|
487
|
-
|
|
488
|
-
log_step "Installing OpenClaw Gateway..."
|
|
489
|
-
log_info "Source: $INSTALL_SOURCE"
|
|
490
|
-
|
|
491
|
-
local _npm_root
|
|
492
|
-
_npm_root="$(npm root -g 2>/dev/null || true)"
|
|
493
|
-
if [[ -n "$_npm_root" && -e "$_npm_root/openclaw" ]]; then
|
|
494
|
-
log_info "Removing existing global openclaw tree (avoids partial install / tar errors)..."
|
|
495
|
-
rm -rf "$_npm_root/openclaw"
|
|
496
|
-
fi
|
|
497
|
-
|
|
498
|
-
if needs_source_build; then
|
|
499
|
-
if [[ "$INSTALL_SOURCE" == /* || "$INSTALL_SOURCE" == ./* ]]; then
|
|
500
|
-
local abs_src
|
|
501
|
-
abs_src="$(cd "$INSTALL_SOURCE" && pwd)"
|
|
502
|
-
build_openclaw_in_dir "$abs_src" || exit 1
|
|
503
|
-
npm install -g "$abs_src"
|
|
504
|
-
else
|
|
505
|
-
install_openclaw_from_remote_git_spec "$INSTALL_SOURCE"
|
|
506
|
-
fi
|
|
507
|
-
else
|
|
508
|
-
npm install -g "$INSTALL_SOURCE"
|
|
509
|
-
fi
|
|
510
|
-
log_success "npm install complete"
|
|
511
|
-
|
|
512
|
-
if needs_source_build; then
|
|
513
|
-
if [[ -n "${REMOTE_GATEWAY_WORK_DIR:-}" ]]; then
|
|
514
|
-
log_info "Removing temporary clone directory..."
|
|
515
|
-
rm -rf "$REMOTE_GATEWAY_WORK_DIR"
|
|
516
|
-
REMOTE_GATEWAY_WORK_DIR=""
|
|
517
|
-
REMOTE_GATEWAY_CLONE_SRC=""
|
|
518
|
-
fi
|
|
519
|
-
else
|
|
520
|
-
log_info "Published package — web UI should be pre-built"
|
|
521
|
-
fi
|
|
522
|
-
}
|
|
523
|
-
|
|
524
|
-
# ============================================================================
|
|
525
|
-
# Stop gateway listeners (graceful CLI stop, then best-effort process/port cleanup)
|
|
526
|
-
# ============================================================================
|
|
527
|
-
resolve_openclaw_bin() {
|
|
528
|
-
if command -v openclaw &>/dev/null; then
|
|
529
|
-
command -v openclaw
|
|
530
|
-
return 0
|
|
531
|
-
fi
|
|
532
|
-
local candidate
|
|
533
|
-
for candidate in \
|
|
534
|
-
"$HOME/Library/pnpm/openclaw" \
|
|
535
|
-
"$HOME/.local/share/pnpm/openclaw" \
|
|
536
|
-
"$HOME/.npm-global/bin/openclaw" \
|
|
537
|
-
"/usr/local/bin/openclaw" \
|
|
538
|
-
"/usr/bin/openclaw"; do
|
|
539
|
-
if [[ -x "$candidate" ]]; then
|
|
540
|
-
printf '%s\n' "$candidate"
|
|
541
|
-
return 0
|
|
542
|
-
fi
|
|
543
|
-
done
|
|
544
|
-
return 1
|
|
545
|
-
}
|
|
546
|
-
|
|
547
|
-
free_local_gateway_ports_if_busy() {
|
|
548
|
-
log_step "Clearing local gateway listener(s) if still bound..."
|
|
549
|
-
rm -f "$HOME/.openclaw/gateway.pid" 2>/dev/null || true
|
|
550
|
-
local sweep_ports=("$GATEWAY_PORT")
|
|
551
|
-
[[ "$GATEWAY_PORT" != "18789" ]] && sweep_ports+=(18789)
|
|
552
|
-
local sp pids
|
|
553
|
-
for sp in "${sweep_ports[@]}"; do
|
|
554
|
-
nc -z 127.0.0.1 "$sp" 2>/dev/null || continue
|
|
555
|
-
command -v lsof &>/dev/null || {
|
|
556
|
-
log_warn "Port $sp in use but lsof not available — stop the process manually"
|
|
557
|
-
continue
|
|
558
|
-
}
|
|
559
|
-
log_info "Port $sp in use — stopping listener PID(s)..."
|
|
560
|
-
pids=$(lsof -nP -iTCP:"$sp" -sTCP:LISTEN -t 2>/dev/null | tr '\n' ' ' || true)
|
|
561
|
-
if [[ -n "${pids// }" ]]; then
|
|
562
|
-
# shellcheck disable=SC2086
|
|
563
|
-
kill $pids 2>/dev/null || true
|
|
564
|
-
sleep 1
|
|
565
|
-
pids=$(lsof -nP -iTCP:"$sp" -sTCP:LISTEN -t 2>/dev/null | tr '\n' ' ' || true)
|
|
566
|
-
if [[ -n "${pids// }" ]]; then
|
|
567
|
-
# shellcheck disable=SC2086
|
|
568
|
-
kill -9 $pids 2>/dev/null || true
|
|
569
|
-
fi
|
|
570
|
-
fi
|
|
571
|
-
done
|
|
572
|
-
local any_up=false
|
|
573
|
-
for sp in "${sweep_ports[@]}"; do
|
|
574
|
-
if nc -z 127.0.0.1 "$sp" 2>/dev/null; then
|
|
575
|
-
any_up=true
|
|
576
|
-
break
|
|
577
|
-
fi
|
|
578
|
-
done
|
|
579
|
-
if $any_up; then
|
|
580
|
-
log_warn "A process may still be listening on 127.0.0.1 (${sweep_ports[*]})"
|
|
581
|
-
else
|
|
582
|
-
log_success "Gateway port(s) free on 127.0.0.1 (${sweep_ports[*]})"
|
|
583
|
-
fi
|
|
584
|
-
}
|
|
585
|
-
|
|
586
|
-
# Official teardown: openclaw uninstall --service before npm remove (see docs.openclaw.ai/cli/uninstall).
|
|
587
|
-
openclaw_cli_uninstall_service() {
|
|
588
|
-
local oc_bin=""
|
|
589
|
-
oc_bin=$(resolve_openclaw_bin) || true
|
|
590
|
-
if [[ -z "$oc_bin" ]]; then
|
|
591
|
-
return 0
|
|
592
|
-
fi
|
|
593
|
-
log_step "OpenClaw CLI: uninstall gateway service..."
|
|
594
|
-
log_info "Running: $oc_bin uninstall --service --yes --non-interactive"
|
|
595
|
-
if "$oc_bin" uninstall --service --yes --non-interactive; then
|
|
596
|
-
log_success "openclaw uninstall --service completed"
|
|
597
|
-
else
|
|
598
|
-
log_info "openclaw uninstall --service failed or skipped (continuing)"
|
|
599
|
-
fi
|
|
600
|
-
}
|
|
601
|
-
|
|
602
|
-
# ============================================================================
|
|
603
|
-
# Uninstall gateway (OpenClaw service uninstall + npm global remove + port cleanup)
|
|
604
|
-
# ============================================================================
|
|
605
|
-
uninstall_gateway() {
|
|
606
|
-
openclaw_cli_uninstall_service
|
|
607
|
-
echo ""
|
|
608
|
-
log_step "Uninstalling OpenClaw (global npm package)..."
|
|
609
|
-
if ! command -v npm &>/dev/null; then
|
|
610
|
-
log_error "npm not found"
|
|
611
|
-
exit 1
|
|
612
|
-
fi
|
|
613
|
-
npm uninstall -g openclaw 2>/dev/null || true
|
|
614
|
-
log_success "Ran: npm uninstall -g openclaw (global tree removed if present)"
|
|
615
|
-
log_info "~/.openclaw was not removed (config, sessions, and credentials stay on disk)."
|
|
616
|
-
echo ""
|
|
617
|
-
free_local_gateway_ports_if_busy
|
|
618
|
-
}
|
|
619
|
-
|
|
620
|
-
# ============================================================================
|
|
621
|
-
# Write starter config (extended for server: bind, token, port)
|
|
622
|
-
# ============================================================================
|
|
623
|
-
write_config() {
|
|
624
|
-
local config_path="$HOME/.openclaw/openclaw.json"
|
|
625
|
-
|
|
626
|
-
if [[ -f "$config_path" ]]; then
|
|
627
|
-
log_info "Config already exists at $config_path — skipping"
|
|
628
|
-
return
|
|
629
|
-
fi
|
|
630
|
-
|
|
631
|
-
log_step "Writing starter config..."
|
|
632
|
-
mkdir -p "$HOME/.openclaw"
|
|
633
|
-
|
|
634
|
-
if [[ -n "$CONFIG_TEMPLATE" && -f "$CONFIG_TEMPLATE" ]]; then
|
|
635
|
-
cp "$CONFIG_TEMPLATE" "$config_path"
|
|
636
|
-
log_success "Config written from template: $config_path"
|
|
637
|
-
return
|
|
638
|
-
fi
|
|
639
|
-
|
|
640
|
-
# Build bind mode
|
|
641
|
-
local bind_mode="loopback"
|
|
642
|
-
if [[ "$GATEWAY_BIND" == "0.0.0.0" || "$GATEWAY_BIND" == "::" ]]; then
|
|
643
|
-
bind_mode="any"
|
|
644
|
-
fi
|
|
645
|
-
|
|
646
|
-
# Build auth line
|
|
647
|
-
local auth_line=""
|
|
648
|
-
if [[ -n "$GATEWAY_TOKEN" ]]; then
|
|
649
|
-
auth_line="\"auth\": { \"token\": \"$GATEWAY_TOKEN\" },"
|
|
650
|
-
fi
|
|
651
|
-
|
|
652
|
-
cat > "$config_path" <<CONF
|
|
653
|
-
// OpenClaw Gateway Configuration (JSON5)
|
|
654
|
-
// Docs: https://docs.openclaw.ai/configuration
|
|
655
|
-
// Created by: setup-gateway-server.sh
|
|
656
|
-
{
|
|
657
|
-
"gateway": {
|
|
658
|
-
"mode": "local",
|
|
659
|
-
"port": $GATEWAY_PORT,
|
|
660
|
-
"bind": "$bind_mode",
|
|
661
|
-
${auth_line}
|
|
662
|
-
"controlUi": { "enabled": true }
|
|
663
|
-
},
|
|
664
|
-
"bindings": [],
|
|
665
|
-
"channels": {},
|
|
666
|
-
"plugins": { "entries": {} },
|
|
667
|
-
"commands": { "nativeSkills": false },
|
|
668
|
-
"session": { "dmScope": "per-peer" },
|
|
669
|
-
"agents": { "defaults": { "maxConcurrent": 4 } }
|
|
670
|
-
}
|
|
671
|
-
CONF
|
|
672
|
-
|
|
673
|
-
chmod 600 "$config_path"
|
|
674
|
-
log_success "Config written: $config_path"
|
|
675
|
-
}
|
|
676
|
-
|
|
677
|
-
# ============================================================================
|
|
678
|
-
# Start gateway (nohup background)
|
|
679
|
-
# ============================================================================
|
|
680
|
-
start_gateway() {
|
|
681
|
-
# Check if already running
|
|
682
|
-
if nc -z 127.0.0.1 "$GATEWAY_PORT" 2>/dev/null; then
|
|
683
|
-
log_info "Gateway already running on port $GATEWAY_PORT"
|
|
684
|
-
return
|
|
685
|
-
fi
|
|
686
|
-
|
|
687
|
-
log_step "Starting gateway..."
|
|
688
|
-
|
|
689
|
-
local openclaw_bin
|
|
690
|
-
openclaw_bin=$(command -v openclaw 2>/dev/null || echo "")
|
|
691
|
-
if [[ -z "$openclaw_bin" ]]; then
|
|
692
|
-
# Check common install locations
|
|
693
|
-
for candidate in \
|
|
694
|
-
"$HOME/Library/pnpm/openclaw" \
|
|
695
|
-
"$HOME/.local/share/pnpm/openclaw" \
|
|
696
|
-
"$HOME/.npm-global/bin/openclaw" \
|
|
697
|
-
"/usr/local/bin/openclaw"; do
|
|
698
|
-
if [[ -x "$candidate" ]]; then
|
|
699
|
-
openclaw_bin="$candidate"
|
|
700
|
-
break
|
|
701
|
-
fi
|
|
702
|
-
done
|
|
703
|
-
fi
|
|
704
|
-
|
|
705
|
-
if [[ -z "$openclaw_bin" ]]; then
|
|
706
|
-
log_error "openclaw binary not found in PATH or common locations"
|
|
707
|
-
return 1
|
|
708
|
-
fi
|
|
709
|
-
|
|
710
|
-
local log_file="$HOME/.openclaw/gateway.log"
|
|
711
|
-
nohup "$openclaw_bin" gateway run \
|
|
712
|
-
--bind "$GATEWAY_BIND" \
|
|
713
|
-
--port "$GATEWAY_PORT" \
|
|
714
|
-
--force \
|
|
715
|
-
> "$log_file" 2>&1 &
|
|
716
|
-
|
|
717
|
-
local pid=$!
|
|
718
|
-
echo "$pid" > "$HOME/.openclaw/gateway.pid"
|
|
719
|
-
|
|
720
|
-
# Wait for it to come up
|
|
721
|
-
local retries=10
|
|
722
|
-
while [[ $retries -gt 0 ]]; do
|
|
723
|
-
if nc -z 127.0.0.1 "$GATEWAY_PORT" 2>/dev/null; then
|
|
724
|
-
log_success "Gateway started (pid=$pid, port=$GATEWAY_PORT)"
|
|
725
|
-
return
|
|
726
|
-
fi
|
|
727
|
-
sleep 1
|
|
728
|
-
retries=$((retries - 1))
|
|
729
|
-
done
|
|
730
|
-
|
|
731
|
-
log_warn "Gateway may not have started. Check: tail -f $log_file"
|
|
732
|
-
}
|
|
733
|
-
|
|
734
|
-
# ============================================================================
|
|
735
|
-
# systemd service (Linux only)
|
|
736
|
-
# ============================================================================
|
|
737
|
-
install_systemd_service() {
|
|
738
|
-
if [[ "$(uname)" != "Linux" ]]; then
|
|
739
|
-
log_warn "systemd is only available on Linux. Use nohup or launchd on macOS."
|
|
740
|
-
return 1
|
|
741
|
-
fi
|
|
742
|
-
|
|
743
|
-
log_step "Installing systemd user service..."
|
|
744
|
-
|
|
745
|
-
local openclaw_bin
|
|
746
|
-
openclaw_bin=$(command -v openclaw 2>/dev/null || echo "")
|
|
747
|
-
if [[ -z "$openclaw_bin" ]]; then
|
|
748
|
-
log_error "openclaw binary not found in PATH"
|
|
749
|
-
return 1
|
|
750
|
-
fi
|
|
751
|
-
|
|
752
|
-
local service_dir="$HOME/.config/systemd/user"
|
|
753
|
-
mkdir -p "$service_dir"
|
|
754
|
-
|
|
755
|
-
local node_bin
|
|
756
|
-
node_bin=$(command -v node 2>/dev/null || echo "/usr/bin/node")
|
|
757
|
-
local node_dir
|
|
758
|
-
node_dir=$(dirname "$node_bin")
|
|
759
|
-
|
|
760
|
-
# Include npm/pnpm bin dirs in PATH so openclaw resolves
|
|
761
|
-
local extra_paths=""
|
|
762
|
-
for dir in \
|
|
763
|
-
"$HOME/Library/pnpm" \
|
|
764
|
-
"$HOME/.local/share/pnpm" \
|
|
765
|
-
"$HOME/.npm-global/bin" \
|
|
766
|
-
"/usr/local/bin"; do
|
|
767
|
-
if [[ -d "$dir" ]]; then
|
|
768
|
-
extra_paths="${extra_paths:+$extra_paths:}$dir"
|
|
769
|
-
fi
|
|
770
|
-
done
|
|
771
|
-
|
|
772
|
-
cat > "$service_dir/openclaw-gateway.service" <<SERVICE
|
|
773
|
-
[Unit]
|
|
774
|
-
Description=OpenClaw Gateway (AgentHippo)
|
|
775
|
-
After=network.target
|
|
776
|
-
|
|
777
|
-
[Service]
|
|
778
|
-
Type=simple
|
|
779
|
-
ExecStart=$openclaw_bin gateway run --bind $GATEWAY_BIND --port $GATEWAY_PORT --force
|
|
780
|
-
Restart=on-failure
|
|
781
|
-
RestartSec=5
|
|
782
|
-
Environment=PATH=$node_dir:${extra_paths:+$extra_paths:}/usr/local/bin:/usr/bin:/bin
|
|
783
|
-
Environment=HOME=$HOME
|
|
784
|
-
WorkingDirectory=$HOME
|
|
785
|
-
|
|
786
|
-
[Install]
|
|
787
|
-
WantedBy=default.target
|
|
788
|
-
SERVICE
|
|
789
|
-
|
|
790
|
-
systemctl --user daemon-reload
|
|
791
|
-
systemctl --user enable openclaw-gateway
|
|
792
|
-
systemctl --user start openclaw-gateway
|
|
793
|
-
|
|
794
|
-
log_success "systemd service installed and started"
|
|
795
|
-
echo ""
|
|
796
|
-
echo -e " ${CYAN}Status:${NC} systemctl --user status openclaw-gateway"
|
|
797
|
-
echo -e " ${CYAN}Logs:${NC} journalctl --user -u openclaw-gateway -f"
|
|
798
|
-
echo -e " ${CYAN}Stop:${NC} systemctl --user stop openclaw-gateway"
|
|
799
|
-
echo -e " ${CYAN}Restart:${NC} systemctl --user restart openclaw-gateway"
|
|
800
|
-
|
|
801
|
-
# Enable lingering so service runs after SSH logout
|
|
802
|
-
if command -v loginctl &>/dev/null; then
|
|
803
|
-
loginctl enable-linger "$(whoami)" 2>/dev/null || true
|
|
804
|
-
log_success "Lingering enabled (service persists after SSH logout)"
|
|
805
|
-
fi
|
|
806
|
-
}
|
|
807
|
-
|
|
808
|
-
# ============================================================================
|
|
809
|
-
# Print connection info
|
|
810
|
-
# ============================================================================
|
|
811
|
-
print_connection_info() {
|
|
812
|
-
log_step "Connection info"
|
|
813
|
-
|
|
814
|
-
local host
|
|
815
|
-
if [[ "$GATEWAY_BIND" == "0.0.0.0" || "$GATEWAY_BIND" == "::" ]]; then
|
|
816
|
-
host=$(hostname -f 2>/dev/null || hostname 2>/dev/null || echo "your-server")
|
|
817
|
-
else
|
|
818
|
-
host="127.0.0.1"
|
|
819
|
-
fi
|
|
820
|
-
|
|
821
|
-
echo ""
|
|
822
|
-
echo -e " ${BOLD}Gateway URL:${NC} ws://$host:$GATEWAY_PORT"
|
|
823
|
-
if [[ -n "$GATEWAY_TOKEN" ]]; then
|
|
824
|
-
echo -e " ${BOLD}Auth token:${NC} $GATEWAY_TOKEN"
|
|
825
|
-
fi
|
|
826
|
-
echo -e " ${BOLD}Web UI:${NC} http://$host:$GATEWAY_PORT"
|
|
827
|
-
echo ""
|
|
828
|
-
echo -e " ${CYAN}Connect from AgentHippo CLI:${NC}"
|
|
829
|
-
echo -e " export OPENCLAW_GATEWAY_URL=ws://$host:$GATEWAY_PORT"
|
|
830
|
-
if [[ -n "$GATEWAY_TOKEN" ]]; then
|
|
831
|
-
echo -e " export OPENCLAW_GATEWAY_TOKEN=$GATEWAY_TOKEN"
|
|
832
|
-
fi
|
|
833
|
-
echo -e " agenthippo serve -a myagent --bind telegram,whatsapp"
|
|
834
|
-
echo ""
|
|
835
|
-
echo -e " ${CYAN}Connect from VS Code (AgentHippo IDE):${NC}"
|
|
836
|
-
echo -e " Set agentide.gateway.url = ws://$host:$GATEWAY_PORT"
|
|
837
|
-
if [[ -n "$GATEWAY_TOKEN" ]]; then
|
|
838
|
-
echo -e " Set agentide.gateway.token = $GATEWAY_TOKEN"
|
|
839
|
-
fi
|
|
840
|
-
echo ""
|
|
841
|
-
}
|
|
842
|
-
|
|
843
|
-
# ============================================================================
|
|
844
|
-
# Main
|
|
845
|
-
# ============================================================================
|
|
846
|
-
|
|
847
|
-
echo -e "${BOLD}${CYAN}"
|
|
848
|
-
echo " ╔═══════════════════════════════════════╗"
|
|
849
|
-
echo " ║ AgentHippo Gateway (Server) ║"
|
|
850
|
-
echo " ║ Reach your agents from anywhere ║"
|
|
851
|
-
echo " ╚═══════════════════════════════════════╝"
|
|
852
|
-
echo -e "${NC}"
|
|
853
|
-
|
|
854
|
-
if $CHECK_ONLY; then
|
|
855
|
-
check_installed
|
|
856
|
-
exit $?
|
|
857
|
-
fi
|
|
858
|
-
|
|
859
|
-
if $REINSTALL; then
|
|
860
|
-
if [[ -z "$INSTALL_SOURCE" ]]; then
|
|
861
|
-
log_error "--reinstall requires --source <src> (or set INSTALL_SOURCE)"
|
|
862
|
-
exit 1
|
|
863
|
-
fi
|
|
864
|
-
log_step "Reinstall: uninstall → verify → install"
|
|
865
|
-
uninstall_gateway
|
|
866
|
-
echo ""
|
|
867
|
-
log_step "Post-uninstall verification (--check)..."
|
|
868
|
-
check_installed || true
|
|
869
|
-
echo ""
|
|
870
|
-
if ! check_prerequisites; then
|
|
871
|
-
echo ""
|
|
872
|
-
log_error "Prerequisites not met. Install the missing tools and try again."
|
|
873
|
-
exit 1
|
|
874
|
-
fi
|
|
875
|
-
echo ""
|
|
876
|
-
install_gateway
|
|
877
|
-
write_config
|
|
878
|
-
if $START_GATEWAY; then
|
|
879
|
-
if $INSTALL_SYSTEMD; then
|
|
880
|
-
install_systemd_service
|
|
881
|
-
else
|
|
882
|
-
start_gateway
|
|
883
|
-
fi
|
|
884
|
-
fi
|
|
885
|
-
echo ""
|
|
886
|
-
check_installed || true
|
|
887
|
-
print_connection_info
|
|
888
|
-
echo -e "${BOLD}Reinstall complete.${NC}"
|
|
889
|
-
echo ""
|
|
890
|
-
exit 0
|
|
891
|
-
fi
|
|
892
|
-
|
|
893
|
-
if $UNINSTALL; then
|
|
894
|
-
uninstall_gateway
|
|
895
|
-
echo ""
|
|
896
|
-
check_installed || true
|
|
897
|
-
exit 0
|
|
898
|
-
fi
|
|
899
|
-
|
|
900
|
-
# Prerequisites
|
|
901
|
-
if ! check_prerequisites; then
|
|
902
|
-
echo ""
|
|
903
|
-
log_error "Prerequisites not met. Install the missing tools and try again."
|
|
904
|
-
exit 1
|
|
905
|
-
fi
|
|
906
|
-
|
|
907
|
-
# Install if not present
|
|
908
|
-
if ! command -v openclaw &>/dev/null; then
|
|
909
|
-
echo ""
|
|
910
|
-
install_gateway
|
|
911
|
-
fi
|
|
912
|
-
|
|
913
|
-
# Write config if missing
|
|
914
|
-
write_config
|
|
915
|
-
|
|
916
|
-
# Start the gateway
|
|
917
|
-
if $START_GATEWAY; then
|
|
918
|
-
if $INSTALL_SYSTEMD; then
|
|
919
|
-
install_systemd_service
|
|
920
|
-
else
|
|
921
|
-
start_gateway
|
|
922
|
-
fi
|
|
923
|
-
fi
|
|
924
|
-
|
|
925
|
-
# Final status
|
|
926
|
-
echo ""
|
|
927
|
-
check_installed || true
|
|
928
|
-
|
|
929
|
-
# Print connection info
|
|
930
|
-
print_connection_info
|
|
931
|
-
|
|
932
|
-
echo -e "${BOLD}Done!${NC} Next steps:"
|
|
933
|
-
echo -e " 1. Set up channels: open ${CYAN}http://${GATEWAY_BIND}:${GATEWAY_PORT}${NC} or edit ${CYAN}~/.openclaw/openclaw.json${NC}"
|
|
934
|
-
echo -e " 2. Connect your agent: ${CYAN}agenthippo serve -a myagent --bind telegram${NC}"
|
|
935
|
-
echo ""
|