@synergenius/flow-weaver 0.33.2 → 0.44.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 +201 -226
- package/NOTICE +13 -0
- package/README.md +152 -245
- package/dist/agent/agent-loop.d.ts +4 -2
- package/dist/agent/cli-session.d.ts +3 -3
- package/dist/agent/cli-session.js +511 -438
- package/dist/agent/cli-spawn-config.d.ts +4 -4
- package/dist/agent/gate.d.ts +164 -0
- package/dist/agent/index.d.ts +4 -4
- package/dist/agent/index.js +174 -28
- package/dist/agent/mcp-bridge.d.ts +1 -1
- package/dist/agent/mcp-bridge.js +114 -128
- package/dist/agent/mcp-tool-server.d.ts +2 -2
- package/dist/agent/mcp-tool-server.js +147 -189
- package/dist/agent/profiles.d.ts +69 -0
- package/dist/agent/providers/anthropic.d.ts +2 -4
- package/dist/agent/providers/claude-cli.d.ts +4 -5
- package/dist/agent/providers/openai-compat.d.ts +8 -1
- package/dist/agent/streaming.d.ts +2 -2
- package/dist/agent/types.d.ts +16 -10
- package/dist/api/builder.d.ts +3 -3
- package/dist/api/compile.d.ts +9 -4
- package/dist/api/durable-validation.d.ts +15 -0
- package/dist/api/generate-in-place.d.ts +21 -19
- package/dist/api/generate.d.ts +21 -16
- package/dist/api/generated-module/local-node-functions.d.ts +24 -0
- package/dist/api/generated-module/module-format.d.ts +23 -0
- package/dist/api/generated-module/module-writer.d.ts +34 -0
- package/dist/api/generated-module/node-type-imports.d.ts +39 -0
- package/dist/api/generated-module/preamble.d.ts +16 -0
- package/dist/api/generated-module/workflow-functions.d.ts +29 -0
- package/dist/api/graph-identity.d.ts +39 -0
- package/dist/api/helpers.d.ts +4 -60
- package/dist/api/in-place/built-in-nodes.d.ts +18 -0
- package/dist/api/in-place/function-body.d.ts +21 -0
- package/dist/api/in-place/fw-imports.d.ts +30 -0
- package/dist/api/in-place/macro-coverage.d.ts +14 -0
- package/dist/api/in-place/node-type-functions.d.ts +18 -0
- package/dist/api/in-place/node-type-jsdoc.d.ts +20 -0
- package/dist/api/in-place/orphaned-node-types.d.ts +16 -0
- package/dist/api/in-place/runtime-section.d.ts +16 -0
- package/dist/api/in-place/signature.d.ts +47 -0
- package/dist/api/in-place/source-file.d.ts +19 -0
- package/dist/api/in-place/workflow-jsdoc.d.ts +19 -0
- package/dist/api/index.d.ts +18 -21
- package/dist/api/index.js +259 -53
- package/dist/api/inline-engine.generated.d.ts +3 -0
- package/dist/api/inline-runtime.d.ts +10 -2
- package/dist/api/manipulation/connections.d.ts +1 -1
- package/dist/api/manipulation/index.d.ts +8 -8
- package/dist/api/manipulation/node-types.d.ts +1 -1
- package/dist/api/manipulation/nodes.d.ts +3 -13
- package/dist/api/manipulation/ports.d.ts +1 -1
- package/dist/api/manipulation/scopes.d.ts +1 -1
- package/dist/api/manipulation/workflow.d.ts +1 -1
- package/dist/api/modify-operation.d.ts +0 -2
- package/dist/api/parse.d.ts +22 -1
- package/dist/api/port-references.d.ts +66 -0
- package/dist/api/query.d.ts +18 -2
- package/dist/api/templates.d.ts +1 -1
- package/dist/api/transform.d.ts +1 -1
- package/dist/api/validate.d.ts +1 -1
- package/dist/api/validation-registry.d.ts +2 -2
- package/dist/artifacts/brief.d.ts +43 -0
- package/dist/artifacts/index.d.ts +31 -0
- package/dist/artifacts/pdf.d.ts +19 -0
- package/dist/ast/builder.d.ts +3 -3
- package/dist/ast/index.d.ts +4 -4
- package/dist/ast/index.js +60 -5
- package/dist/ast/serialization-node.d.ts +1 -1
- package/dist/ast/serialization.d.ts +1 -1
- package/dist/ast/types.d.ts +82 -291
- package/dist/ast/workflow-utils.d.ts +4 -4
- package/dist/built-in-nodes/coercion-types.d.ts +1 -1
- package/dist/built-in-nodes/delay.d.ts +3 -1
- package/dist/built-in-nodes/generated-registry.d.ts +1 -1
- package/dist/built-in-nodes/index.d.ts +6 -5
- package/dist/built-in-nodes/index.js +79 -5
- package/dist/built-in-nodes/invoke-workflow.d.ts +2 -1
- package/dist/built-in-nodes/mock-types.d.ts +45 -14
- package/dist/built-in-nodes/sleep.d.ts +12 -0
- package/dist/built-in-nodes/wait-for-agent.d.ts +2 -1
- package/dist/built-in-nodes/wait-for-event.d.ts +2 -1
- package/dist/chevrotain-parser/coerce-parser.d.ts +1 -1
- package/dist/chevrotain-parser/connect-parser.d.ts +1 -1
- package/dist/chevrotain-parser/grammar-diagrams.d.ts +1 -1
- package/dist/chevrotain-parser/index.d.ts +20 -23
- package/dist/chevrotain-parser/node-parser.d.ts +7 -8
- package/dist/chevrotain-parser/parse-line.d.ts +54 -0
- package/dist/chevrotain-parser/tokens.d.ts +0 -17
- package/dist/chevrotain-parser/trigger-cancel-parser.d.ts +6 -1
- package/dist/chunks/chunk-4EUSHAY6.js +298 -0
- package/dist/chunks/chunk-4KDUEOFD.js +197 -0
- package/dist/chunks/chunk-5Y3AIUWY.js +911 -0
- package/dist/chunks/chunk-6KMVP6AU.js +20 -0
- package/dist/chunks/chunk-6PNJORFL.js +128 -0
- package/dist/chunks/chunk-7AAQNGRH.js +2001 -0
- package/dist/chunks/chunk-7YYKTPJ5.js +22705 -0
- package/dist/chunks/chunk-A5MBOFVY.js +33 -0
- package/dist/chunks/chunk-AXNQRVJB.js +18 -0
- package/dist/chunks/chunk-B6HQ6YS5.js +572 -0
- package/dist/chunks/chunk-CY3RNVML.js +296 -0
- package/dist/chunks/chunk-CYHYDLV4.js +653 -0
- package/dist/chunks/chunk-CZBCCK4Y.js +82 -0
- package/dist/chunks/chunk-DCMGQP5V.js +505 -0
- package/dist/chunks/chunk-DIAA66GL.js +72 -0
- package/dist/chunks/chunk-DUO6H5PR.js +20 -0
- package/dist/chunks/chunk-E5WN7IGO.js +125 -0
- package/dist/chunks/chunk-EFGFXXQF.js +184 -0
- package/dist/chunks/chunk-F3RTZV2A.js +2811 -0
- package/dist/chunks/chunk-FMTLP5ZX.js +1397 -0
- package/dist/chunks/chunk-HKZLQJDV.js +79 -0
- package/dist/chunks/chunk-INDEVYEC.js +146 -0
- package/dist/chunks/chunk-JQTF4R5L.js +390 -0
- package/dist/chunks/chunk-KMCAYNUM.js +331 -0
- package/dist/chunks/chunk-KMWCCOUJ.js +1444 -0
- package/dist/chunks/chunk-KU3CLJI2.js +338 -0
- package/dist/chunks/chunk-NDSTGMKR.js +3300 -0
- package/dist/chunks/chunk-NQNLUAPO.js +505 -0
- package/dist/chunks/chunk-O2U2LO57.js +466 -0
- package/dist/chunks/chunk-OOQG7UPP.js +457 -0
- package/dist/chunks/chunk-OZQAW5ZG.js +112 -0
- package/dist/chunks/chunk-P2CVDGHR.js +487 -0
- package/dist/chunks/chunk-P44RIZ7C.js +592 -0
- package/dist/chunks/chunk-PEZCT37T.js +1475 -0
- package/dist/chunks/chunk-PKWSAW6O.js +152 -0
- package/dist/chunks/chunk-Q6MDDZMT.js +4373 -0
- package/dist/chunks/chunk-QDE4Z7KW.js +6 -0
- package/dist/chunks/chunk-QJDAVSNY.js +8 -0
- package/dist/chunks/chunk-QYPORSLO.js +7552 -0
- package/dist/chunks/chunk-R4QGNK34.js +183 -0
- package/dist/chunks/chunk-REEYC73I.js +3002 -0
- package/dist/chunks/chunk-SEWDMQ6Q.js +46 -0
- package/dist/chunks/chunk-TAIUWKZB.js +3057 -0
- package/dist/chunks/chunk-TN4YZ3O7.js +196 -0
- package/dist/chunks/chunk-TRMFB43C.js +143 -0
- package/dist/chunks/chunk-VO4QXG2X.js +1016 -0
- package/dist/chunks/chunk-VP2P3BPA.js +1002 -0
- package/dist/chunks/chunk-VQ7H33J4.js +2176 -0
- package/dist/chunks/chunk-VWA7MCV2.js +105 -0
- package/dist/chunks/chunk-XAV22WD7.js +253 -0
- package/dist/chunks/chunk-YSPBPZDV.js +148 -0
- package/dist/chunks/chunk-ZKEGXO73.js +282 -0
- package/dist/chunks/chunk-ZMGN6F3S.js +4256 -0
- package/dist/chunks/grammar-diagrams-AI7VDXOM.js +14 -0
- package/dist/chunks/index.min-ECJD6GZC.js +37 -0
- package/dist/chunks/manifest-EPTR5MYH.js +21 -0
- package/dist/chunks/openapi-document-6TCGVDUW.js +69 -0
- package/dist/chunks/registry-K2U5KUTY.js +23 -0
- package/dist/chunks/serialization-node-UGY6CFH6.js +38 -0
- package/dist/chunks/validate-GEKSZPIN.js +24 -0
- package/dist/chunks/validation-registry-IQZX3UE3.js +7 -0
- package/dist/chunks/validator-VXFHLPDW.js +26 -0
- package/dist/chunks/workflow-executor-KBGFKHNR.js +36 -0
- package/dist/cli/commands/agents.d.ts +16 -0
- package/dist/cli/commands/artifact.d.ts +10 -0
- package/dist/cli/commands/compile.d.ts +0 -30
- package/dist/cli/commands/console.d.ts +32 -0
- package/dist/cli/commands/context.d.ts +0 -3
- package/dist/cli/commands/describe.js +386 -352
- package/dist/cli/commands/dev.d.ts +9 -4
- package/dist/cli/commands/diagram.d.ts +3 -5
- package/dist/cli/commands/doctor.d.ts +27 -4
- package/dist/cli/commands/doctor.js +3307 -633
- package/dist/cli/commands/export.d.ts +6 -4
- package/dist/cli/commands/grammar.d.ts +0 -3
- package/dist/cli/commands/implement.d.ts +1 -1
- package/dist/cli/commands/init/agent-handoff.d.ts +28 -0
- package/dist/cli/commands/init/config.d.ts +3 -0
- package/dist/cli/commands/init/files.d.ts +12 -0
- package/dist/cli/commands/init/naming.d.ts +13 -0
- package/dist/cli/commands/init/output.d.ts +12 -0
- package/dist/cli/commands/init/setup.d.ts +21 -0
- package/dist/cli/commands/init/types.d.ts +53 -0
- package/dist/cli/commands/init-personas.d.ts +9 -1
- package/dist/cli/commands/init.d.ts +24 -88
- package/dist/cli/commands/market.d.ts +1 -1
- package/dist/cli/commands/mcp-setup.d.ts +1 -4
- package/dist/cli/commands/modify.d.ts +0 -5
- package/dist/cli/commands/openapi.d.ts +9 -11
- package/dist/cli/commands/run.d.ts +0 -4
- package/dist/cli/commands/serve.d.ts +24 -26
- package/dist/cli/commands/status.d.ts +1 -1
- package/dist/cli/exports.d.ts +3 -4
- package/dist/cli/exports.js +124 -23
- package/dist/cli/flow-weaver-agents-H653446S.mjs +81 -0
- package/dist/cli/flow-weaver-artifact-WBFYTW76.mjs +58 -0
- package/dist/cli/flow-weaver-chunk-265CEK74.mjs +2 -0
- package/dist/cli/flow-weaver-chunk-2C7PZCV5.mjs +186 -0
- package/dist/cli/flow-weaver-chunk-3BSYCWPL.mjs +3109 -0
- package/dist/cli/flow-weaver-chunk-3MKUQP3D.mjs +547 -0
- package/dist/cli/flow-weaver-chunk-3ZLMPQTH.mjs +27 -0
- package/dist/cli/flow-weaver-chunk-4DVY73ML.mjs +280 -0
- package/dist/cli/flow-weaver-chunk-54M4KNEL.mjs +200 -0
- package/dist/cli/flow-weaver-chunk-55QMUZIA.mjs +256 -0
- package/dist/cli/flow-weaver-chunk-6ZUJ7LMX.mjs +2003 -0
- package/dist/cli/flow-weaver-chunk-7ET6N32V.mjs +419 -0
- package/dist/cli/flow-weaver-chunk-7G63RR4K.mjs +8880 -0
- package/dist/cli/flow-weaver-chunk-A6M5K3W7.mjs +4418 -0
- package/dist/cli/flow-weaver-chunk-AA3NATMX.mjs +154 -0
- package/dist/cli/flow-weaver-chunk-APX6MQ5A.mjs +5652 -0
- package/dist/cli/flow-weaver-chunk-BHCC5FE5.mjs +17 -0
- package/dist/cli/flow-weaver-chunk-DM4BBRRU.mjs +35 -0
- package/dist/cli/flow-weaver-chunk-DRN7KPWY.mjs +168 -0
- package/dist/cli/flow-weaver-chunk-EKWF27G6.mjs +23 -0
- package/dist/cli/flow-weaver-chunk-EM5HWQ4R.mjs +338 -0
- package/dist/cli/flow-weaver-chunk-FPPPU2DG.mjs +226 -0
- package/dist/cli/flow-weaver-chunk-GAQXZHNO.mjs +3005 -0
- package/dist/cli/flow-weaver-chunk-GBUNNP33.mjs +1329 -0
- package/dist/cli/flow-weaver-chunk-HMAKDE55.mjs +636 -0
- package/dist/cli/flow-weaver-chunk-HQ3ZAN44.mjs +367 -0
- package/dist/cli/flow-weaver-chunk-I4APCXYN.mjs +21442 -0
- package/dist/cli/flow-weaver-chunk-IJJ4JXTL.mjs +2297 -0
- package/dist/cli/flow-weaver-chunk-J7EPZW2I.mjs +33 -0
- package/dist/cli/flow-weaver-chunk-KOEMJHLG.mjs +83 -0
- package/dist/cli/flow-weaver-chunk-M6CBWQKJ.mjs +271 -0
- package/dist/cli/flow-weaver-chunk-MHJ4N652.mjs +1580 -0
- package/dist/cli/flow-weaver-chunk-MKAFQWLP.mjs +202 -0
- package/dist/cli/flow-weaver-chunk-MMV2XGD3.mjs +3291 -0
- package/dist/cli/flow-weaver-chunk-MSI2UJES.mjs +125 -0
- package/dist/cli/flow-weaver-chunk-N767YRAI.mjs +48 -0
- package/dist/cli/flow-weaver-chunk-NQKKWDGF.mjs +56 -0
- package/dist/cli/flow-weaver-chunk-NYZDQYFU.mjs +45 -0
- package/dist/cli/flow-weaver-chunk-OMVWSNHJ.mjs +14 -0
- package/dist/cli/flow-weaver-chunk-PUWZ47H5.mjs +2188 -0
- package/dist/cli/flow-weaver-chunk-QOPRVDES.mjs +46 -0
- package/dist/cli/flow-weaver-chunk-RIWE7YTR.mjs +216 -0
- package/dist/cli/flow-weaver-chunk-S63Q3JIU.mjs +789 -0
- package/dist/cli/flow-weaver-chunk-T7X5A23H.mjs +558 -0
- package/dist/cli/flow-weaver-chunk-TLV3VZUN.mjs +2 -0
- package/dist/cli/flow-weaver-chunk-TS5P3PIN.mjs +194 -0
- package/dist/cli/flow-weaver-chunk-U3EO3X4B.mjs +649 -0
- package/dist/cli/flow-weaver-chunk-UNFS3NQP.mjs +34 -0
- package/dist/cli/flow-weaver-chunk-V6DHWFQG.mjs +2811 -0
- package/dist/cli/flow-weaver-chunk-VXWNLYQU.mjs +9 -0
- package/dist/cli/flow-weaver-chunk-W3YNK26P.mjs +149 -0
- package/dist/cli/flow-weaver-chunk-XG2WKXYZ.mjs +324 -0
- package/dist/cli/flow-weaver-chunk-YLSRZWFK.mjs +2219 -0
- package/dist/cli/flow-weaver-chunk-YVPURWS6.mjs +40 -0
- package/dist/cli/flow-weaver-chunk-Z44JK332.mjs +582 -0
- package/dist/cli/flow-weaver-chunk-Z5ZJPNSY.mjs +517 -0
- package/dist/cli/flow-weaver-chunk-ZQALO25T.mjs +594 -0
- package/dist/cli/flow-weaver-compile-A2CABDSB.mjs +37 -0
- package/dist/cli/flow-weaver-console-6EBHDBTN.mjs +71 -0
- package/dist/cli/flow-weaver-context-ECLYANFF.mjs +17 -0
- package/dist/cli/flow-weaver-context-ZRUMW2KE.mjs +69 -0
- package/dist/cli/flow-weaver-create-WIP4EFNP.mjs +124 -0
- package/dist/cli/flow-weaver-deployment-WJJRK7NO.mjs +14 -0
- package/dist/cli/flow-weaver-describe-XDIFF5LI.mjs +41 -0
- package/dist/cli/flow-weaver-dev-LG2NSQAU.mjs +196 -0
- package/dist/cli/flow-weaver-diagram-3EVQARQE.mjs +52 -0
- package/dist/cli/flow-weaver-diagram-7LR7O4M2.mjs +44 -0
- package/dist/cli/flow-weaver-diff-USF7DJLU.mjs +85 -0
- package/dist/cli/flow-weaver-docs-QU2ZOXKH.mjs +96 -0
- package/dist/cli/flow-weaver-doctor-K447YWHR.mjs +43 -0
- package/dist/cli/flow-weaver-export-LAS6N56Y.mjs +140 -0
- package/dist/cli/flow-weaver-grammar-RIRUS3Q6.mjs +49 -0
- package/dist/cli/flow-weaver-grammar-diagrams-WXRTW5SK.mjs +15 -0
- package/dist/cli/flow-weaver-implement-5JG6BCFZ.mjs +114 -0
- package/dist/cli/flow-weaver-index.min-OR5SIHXD.mjs +39 -0
- package/dist/cli/flow-weaver-init-34YZNPQX.mjs +972 -0
- package/dist/cli/flow-weaver-init-personas-NOGZTQQ2.mjs +48 -0
- package/dist/cli/flow-weaver-manifest-4JNUSEB3.mjs +18 -0
- package/dist/cli/flow-weaver-market-WA4CKHKV.mjs +444 -0
- package/dist/cli/flow-weaver-mcp-setup-O26MGXSD.mjs +22 -0
- package/dist/cli/flow-weaver-migrate-VFVEUTPH.mjs +119 -0
- package/dist/cli/flow-weaver-modify-VM3JP5K6.mjs +97 -0
- package/dist/cli/flow-weaver-openapi-IRBWI3HM.mjs +71 -0
- package/dist/cli/flow-weaver-openapi-document-7N6YMPG3.mjs +30 -0
- package/dist/cli/flow-weaver-pack-commands-OS2QRXAK.mjs +146 -0
- package/dist/cli/flow-weaver-registry-5MLFRPPT.mjs +25 -0
- package/dist/cli/flow-weaver-run-DSTLSTHR.mjs +555 -0
- package/dist/cli/flow-weaver-serialization-node-LE6PCG4M.mjs +50 -0
- package/dist/cli/flow-weaver-serve-NVLCLSOW.mjs +192 -0
- package/dist/cli/flow-weaver-server-7IERLVXE.mjs +2925 -0
- package/dist/cli/flow-weaver-server-KWF4PXYC.mjs +19112 -0
- package/dist/cli/flow-weaver-status-75W2S3YB.mjs +138 -0
- package/dist/cli/flow-weaver-strip-AZPXUYVA.mjs +79 -0
- package/dist/cli/flow-weaver-templates-DSNMB6K7.mjs +72 -0
- package/dist/cli/flow-weaver-validate-A4UWDQN6.mjs +19 -0
- package/dist/cli/flow-weaver-validate-GRBZ5W4C.mjs +296 -0
- package/dist/cli/flow-weaver-validation-registry-BINGUNXX.mjs +9 -0
- package/dist/cli/flow-weaver-validator-TY56CI42.mjs +21 -0
- package/dist/cli/flow-weaver-watch-OPPERXL6.mjs +114 -0
- package/dist/cli/flow-weaver-workflow-executor-6AHYPXAN.mjs +26 -0
- package/dist/cli/flow-weaver.mjs +3557 -89384
- package/dist/cli/index.d.ts +5 -2
- package/dist/cli/pack-commands-needed.d.ts +12 -0
- package/dist/cli/program.d.ts +14 -0
- package/dist/cli/templates/ai/mock-provider.d.ts +1 -1
- package/dist/cli/templates/index.d.ts +1 -8
- package/dist/cli/templates/nodes/agent-router.d.ts +1 -1
- package/dist/cli/templates/nodes/aggregator.d.ts +1 -1
- package/dist/cli/templates/nodes/conversation-memory.d.ts +1 -1
- package/dist/cli/templates/nodes/http.d.ts +1 -1
- package/dist/cli/templates/nodes/human-approval.d.ts +1 -1
- package/dist/cli/templates/nodes/json-extractor.d.ts +1 -1
- package/dist/cli/templates/nodes/llm-call.d.ts +1 -1
- package/dist/cli/templates/nodes/prompt-template.d.ts +1 -1
- package/dist/cli/templates/nodes/rag-retriever.d.ts +1 -1
- package/dist/cli/templates/nodes/tool-executor.d.ts +1 -1
- package/dist/cli/templates/nodes/transformer.d.ts +1 -1
- package/dist/cli/templates/nodes/validator.d.ts +1 -1
- package/dist/cli/templates/shared/approval-types.d.ts +1 -1
- package/dist/cli/templates/shared/case.d.ts +14 -0
- package/dist/cli/templates/shared/llm-types.d.ts +4 -4
- package/dist/cli/templates/workflows/aggregator.d.ts +1 -1
- package/dist/cli/templates/workflows/ai-agent.d.ts +1 -1
- package/dist/cli/templates/workflows/ai-chat.d.ts +1 -1
- package/dist/cli/templates/workflows/ai-rag.d.ts +1 -1
- package/dist/cli/templates/workflows/ai-react.d.ts +1 -1
- package/dist/cli/templates/workflows/approval.d.ts +10 -0
- package/dist/cli/templates/workflows/conditional.d.ts +2 -2
- package/dist/cli/templates/workflows/error-handler.d.ts +2 -2
- package/dist/cli/templates/workflows/foreach.d.ts +1 -1
- package/dist/cli/templates/workflows/sequential.d.ts +1 -1
- package/dist/cli/templates/workflows/webhook.d.ts +1 -1
- package/dist/cli/utils/interactive.d.ts +6 -0
- package/dist/cli/utils/json-option.d.ts +8 -0
- package/dist/cli/utils/logger.d.ts +2 -0
- package/dist/compiler/durable-source-proof.d.ts +23 -0
- package/dist/compiler/executable-artifact.d.ts +29 -0
- package/dist/compiler/index.d.ts +4 -0
- package/dist/compiler/index.js +36 -0
- package/dist/console/app.js +106 -0
- package/dist/console/assets/synergenius.svg +18 -0
- package/dist/console/author.d.ts +32 -0
- package/dist/console/cli-catalog.d.ts +21 -0
- package/dist/console/cli-run.d.ts +35 -0
- package/dist/console/cli-run.js +46 -0
- package/dist/console/debug.d.ts +67 -0
- package/dist/console/diff-view.d.ts +96 -0
- package/dist/console/export.d.ts +36 -0
- package/dist/console/git.d.ts +27 -0
- package/dist/console/index.d.ts +4 -0
- package/dist/console/index.html +16 -0
- package/dist/console/index.js +203 -0
- package/dist/console/packs.d.ts +100 -0
- package/dist/console/request-guard.d.ts +10 -0
- package/dist/console/respond.d.ts +16 -0
- package/dist/console/router.d.ts +64 -0
- package/dist/console/routes-agents.d.ts +14 -0
- package/dist/console/routes-project.d.ts +3 -0
- package/dist/console/routes-runs.d.ts +3 -0
- package/dist/console/routes-services.d.ts +7 -0
- package/dist/console/routes-tools.d.ts +3 -0
- package/dist/console/runs.d.ts +69 -0
- package/dist/console/scan.d.ts +49 -0
- package/dist/console/schema.d.ts +74 -0
- package/dist/console/server.d.ts +34 -0
- package/dist/console/server.js +43264 -0
- package/dist/console/services.d.ts +119 -0
- package/dist/console/source.d.ts +23 -0
- package/dist/console/status.d.ts +68 -0
- package/dist/console/styles.css +1023 -0
- package/dist/console/terminals.d.ts +22 -0
- package/dist/console/workflow-view.d.ts +153 -0
- package/dist/constants.d.ts +5 -1
- package/dist/constants.js +56 -167
- package/dist/context/index.d.ts +10 -0
- package/dist/context/index.js +14 -191
- package/dist/coordinator/agent-gate.d.ts +107 -0
- package/dist/coordinator/bundle-digest.d.ts +20 -0
- package/dist/coordinator/clock-tick.d.ts +4 -0
- package/dist/coordinator/effect-receipts.d.ts +10 -0
- package/dist/coordinator/errors.d.ts +31 -0
- package/dist/coordinator/file-store.d.ts +3 -0
- package/dist/coordinator/gate-labeling.d.ts +33 -0
- package/dist/coordinator/gate-resolution.d.ts +28 -0
- package/dist/coordinator/index.d.ts +12 -0
- package/dist/coordinator/index.js +107 -0
- package/dist/coordinator/memory-store.d.ts +3 -0
- package/dist/coordinator/params.d.ts +18 -0
- package/dist/coordinator/run-annotations.d.ts +6 -0
- package/dist/coordinator/run-context.d.ts +11 -0
- package/dist/coordinator/run-ending.d.ts +5 -0
- package/dist/coordinator/run-outcome.d.ts +31 -0
- package/dist/coordinator/run-resume.d.ts +6 -0
- package/dist/coordinator/run-start.d.ts +4 -0
- package/dist/coordinator/run-store.d.ts +275 -0
- package/dist/coordinator/run-trace.d.ts +41 -0
- package/dist/coordinator/run-views.d.ts +12 -0
- package/dist/coordinator/runs-dir.d.ts +26 -0
- package/dist/coordinator/store.d.ts +67 -0
- package/dist/coordinator/time.d.ts +39 -0
- package/dist/coordinator/workflow-selection.d.ts +6 -0
- package/dist/deployment/index.d.ts +11 -16
- package/dist/deployment/index.js +541 -50
- package/dist/deployment/targets/base.d.ts +11 -13
- package/dist/deployment/targets/openapi-parts.d.ts +92 -0
- package/dist/diagram/arms.d.ts +70 -0
- package/dist/diagram/ascii-renderer.d.ts +1 -1
- package/dist/diagram/geometry.d.ts +20 -32
- package/dist/diagram/graph/bounds.d.ts +30 -0
- package/dist/diagram/graph/metrics.d.ts +21 -0
- package/dist/diagram/graph/nodes.d.ts +33 -0
- package/dist/diagram/graph/placement.d.ts +22 -0
- package/dist/diagram/graph/ports.d.ts +23 -0
- package/dist/diagram/graph/routing.d.ts +40 -0
- package/dist/diagram/graph/scopes.d.ts +30 -0
- package/dist/diagram/index.d.ts +15 -23
- package/dist/diagram/index.js +632 -111
- package/dist/diagram/labels.d.ts +12 -0
- package/dist/diagram/lanes.d.ts +93 -0
- package/dist/diagram/layout.d.ts +1 -1
- package/dist/diagram/material-symbols.d.ts +7 -0
- package/dist/diagram/orthogonal-router.d.ts +2 -3
- package/dist/diagram/process-view.d.ts +79 -0
- package/dist/diagram/spine.d.ts +25 -0
- package/dist/diagram/theme.d.ts +1 -5
- package/dist/diagram/types.d.ts +6 -20
- package/dist/diff/index.js +53 -9
- package/dist/diff/types.d.ts +1 -5
- package/dist/doc-metadata/extractors/annotations.d.ts +0 -4
- package/dist/doc-metadata/extractors/cli-commands.d.ts +2 -1
- package/dist/doc-metadata/extractors/core-metadata.d.ts +19 -4
- package/dist/doc-metadata/extractors/error-codes.d.ts +1 -1
- package/dist/doc-metadata/extractors/mcp-tools.d.ts +7 -3
- package/dist/doc-metadata/index.d.ts +1 -2
- package/dist/doc-metadata/index.js +2368 -9
- package/dist/doc-metadata/types.d.ts +7 -24
- package/dist/docs/guide.d.ts +33 -0
- package/dist/docs/index.d.ts +7 -4
- package/dist/docs/index.js +298 -298
- package/dist/docs/pack-topics.d.ts +18 -0
- package/dist/editor-completions/annotationValues.d.ts +1 -1
- package/dist/editor-completions/contextParser.d.ts +3 -2
- package/dist/editor-completions/dataTypes.d.ts +1 -1
- package/dist/editor-completions/goToDefinition.d.ts +1 -1
- package/dist/editor-completions/index.d.ts +8 -8
- package/dist/editor-completions/index.js +1244 -175
- package/dist/editor-completions/jsDocAnnotations.d.ts +1 -1
- package/dist/editor-completions/modifierCompletions.d.ts +1 -1
- package/dist/export/index.d.ts +7 -1
- package/dist/generated-branding.js +8 -21
- package/dist/generated-version.d.ts +1 -1
- package/dist/generated-version.js +7 -3
- package/dist/generator/annotation-generator.d.ts +84 -0
- package/dist/generator/async-detection.d.ts +1 -1
- package/dist/{body-generator.d.ts → generator/body-generator.d.ts} +7 -3
- package/dist/generator/code-utils.d.ts +15 -60
- package/dist/generator/connection-reads.d.ts +94 -0
- package/dist/generator/control-flow-plan.d.ts +74 -0
- package/dist/generator/control-flow.d.ts +1 -1
- package/dist/generator/exit-assembly.d.ts +11 -0
- package/dist/generator/index.d.ts +4 -5
- package/dist/generator/index.js +34 -11
- package/dist/generator/input-port-values.d.ts +22 -0
- package/dist/generator/{scope-function-generator.d.ts → node-arguments.d.ts} +76 -1
- package/dist/generator/node-invocation.d.ts +74 -0
- package/dist/{node-types-generator.d.ts → generator/node-types-generator.d.ts} +3 -2
- package/dist/generator/scope-closure.d.ts +23 -0
- package/dist/generator/scoped-child.d.ts +49 -0
- package/dist/{sugar-optimizer.d.ts → generator/sugar-optimizer.d.ts} +1 -1
- package/dist/generator/unified.d.ts +14 -2
- package/dist/generator/workflow-generator.d.ts +37 -0
- package/dist/index.d.ts +29 -26
- package/dist/index.js +1322 -92
- package/dist/jsdoc-port-sync/apply-diff.d.ts +15 -0
- package/dist/jsdoc-port-sync/callback-signature.d.ts +17 -0
- package/dist/jsdoc-port-sync/diff.d.ts +5 -7
- package/dist/jsdoc-port-sync/incomplete-lines.d.ts +41 -0
- package/dist/jsdoc-port-sync/index.d.ts +11 -11
- package/dist/jsdoc-port-sync/index.js +88 -45
- package/dist/jsdoc-port-sync/jsdoc-to-signature.d.ts +66 -0
- package/dist/jsdoc-port-sync/port-parser.d.ts +6 -24
- package/dist/jsdoc-port-sync/port-tag-placement.d.ts +55 -0
- package/dist/jsdoc-port-sync/scoped-ports.d.ts +21 -0
- package/dist/jsdoc-port-sync/signature-parser.d.ts +8 -1
- package/dist/jsdoc-port-sync/signature-to-jsdoc.d.ts +77 -0
- package/dist/jsdoc-port-sync/sync.d.ts +4 -1
- package/dist/marketplace/index.d.ts +5 -3
- package/dist/marketplace/index.js +62 -10
- package/dist/marketplace/install.d.ts +24 -0
- package/dist/marketplace/manifest.d.ts +1 -1
- package/dist/marketplace/npmrc.d.ts +24 -0
- package/dist/marketplace/registry.d.ts +46 -11
- package/dist/marketplace/types.d.ts +41 -24
- package/dist/marketplace/validator.d.ts +1 -1
- package/dist/mcp/debug-session.d.ts +2 -4
- package/dist/mcp/dist-imports.d.ts +12 -0
- package/dist/mcp/response-utils.d.ts +11 -9
- package/dist/mcp/server.d.ts +0 -1
- package/dist/mcp/tools-context.d.ts +11 -0
- package/dist/mcp/tools-diagram.d.ts +1 -2
- package/dist/mcp/tools-export.d.ts +2 -2
- package/dist/mcp/tools-marketplace.d.ts +1 -1
- package/dist/mcp/tools-run.d.ts +17 -0
- package/dist/mcp/tools-workflow.d.ts +3 -0
- package/dist/mcp/types.d.ts +4 -14
- package/dist/mcp/workflow-executor.d.ts +57 -19
- package/dist/npm-packages.d.ts +1 -1
- package/dist/npm-packages.js +10 -473
- package/dist/parser/annotation-parser.d.ts +88 -0
- package/dist/parser/annotation-suggestion.d.ts +23 -0
- package/dist/parser/durable-effect-contract.d.ts +10 -0
- package/dist/parser/expression-references.d.ts +101 -0
- package/dist/parser/external-node-types.d.ts +69 -0
- package/dist/{function-like.d.ts → parser/function-like.d.ts} +10 -3
- package/dist/parser/generated-sections.d.ts +25 -0
- package/dist/parser/import-resolution.d.ts +67 -0
- package/dist/parser/import-stub.d.ts +29 -0
- package/dist/parser/jsdoc/config-types.d.ts +209 -0
- package/dist/parser/jsdoc/graph-tags.d.ts +54 -0
- package/dist/parser/jsdoc/node-type-block.d.ts +23 -0
- package/dist/parser/jsdoc/parse-line-once.d.ts +11 -0
- package/dist/parser/jsdoc/port-tags.d.ts +42 -0
- package/dist/parser/jsdoc/runtime-tags.d.ts +65 -0
- package/dist/parser/jsdoc/signature-types.d.ts +52 -0
- package/dist/parser/jsdoc/workflow-block.d.ts +22 -0
- package/dist/parser/jsdoc-parser.d.ts +23 -0
- package/dist/parser/macro-expansion.d.ts +80 -0
- package/dist/parser/module-resolution.d.ts +38 -0
- package/dist/parser/node-inference.d.ts +39 -0
- package/dist/parser/npm-node-types.d.ts +24 -0
- package/dist/parser/pack-handlers.d.ts +12 -0
- package/dist/parser/path-data-resolution.d.ts +75 -0
- package/dist/parser/port-inference.d.ts +15 -0
- package/dist/{resolve-package-types.d.ts → parser/resolve-package-types.d.ts} +4 -0
- package/dist/parser/serialize-deploy-annotations.d.ts +19 -0
- package/dist/parser/tag-registry.d.ts +22 -0
- package/dist/parser/workflow-extraction.d.ts +39 -0
- package/dist/runtime/ExecutionContext.d.ts +87 -99
- package/dist/runtime/continuation-core.d.ts +147 -0
- package/dist/runtime/continuation.d.ts +48 -0
- package/dist/runtime/debug-controller.d.ts +7 -22
- package/dist/runtime/durable-execution.d.ts +176 -0
- package/dist/runtime/events.d.ts +16 -1
- package/dist/runtime/executable-module-contract.d.ts +16 -0
- package/dist/runtime/index.d.ts +13 -10
- package/dist/runtime/index.js +947 -9
- package/dist/runtime/strict-json.d.ts +15 -0
- package/dist/server/access.d.ts +12 -0
- package/dist/server/api.d.ts +126 -0
- package/dist/server/callback-delivery.d.ts +62 -0
- package/dist/server/callback-url.d.ts +44 -0
- package/dist/server/context.d.ts +35 -0
- package/dist/server/http-error.d.ts +10 -0
- package/dist/server/index.d.ts +7 -1
- package/dist/server/index.js +125 -6
- package/dist/server/openapi-document.d.ts +33 -0
- package/dist/server/openapi.d.ts +32 -0
- package/dist/server/respond.d.ts +35 -0
- package/dist/server/route-params.d.ts +17 -0
- package/dist/server/route-plan.d.ts +41 -0
- package/dist/server/routes-catalog.d.ts +5 -0
- package/dist/server/routes-declared.d.ts +12 -0
- package/dist/server/routes-runs.d.ts +8 -0
- package/dist/server/run-driver.d.ts +58 -0
- package/dist/server/run-view.d.ts +26 -0
- package/dist/server/transport.d.ts +35 -0
- package/dist/server/types.d.ts +143 -52
- package/dist/server/webhook-server.d.ts +12 -38
- package/dist/server/workflow-registry.d.ts +7 -4
- package/dist/service-registry.d.ts +49 -0
- package/dist/service-registry.js +123 -0
- package/dist/testing/assertions.d.ts +2 -2
- package/dist/testing/index.d.ts +14 -13
- package/dist/testing/index.js +582 -24
- package/dist/testing/mock-approval.d.ts +3 -5
- package/dist/testing/mock-llm.d.ts +2 -3
- package/dist/testing/recorder.d.ts +5 -6
- package/dist/testing/replayer.d.ts +6 -7
- package/dist/testing/run-store-check.d.ts +3 -0
- package/dist/testing/token-tracker.d.ts +2 -2
- package/dist/{type-mappings.d.ts → types/type-mappings.d.ts} +13 -1
- package/dist/utils/error-utils.d.ts +4 -2
- package/dist/utils/port-ordering.d.ts +2 -2
- package/dist/utils/port-tag-utils.d.ts +1 -1
- package/dist/validation/agent-detection.d.ts +17 -5
- package/dist/validation/agent-rules.d.ts +6 -7
- package/dist/validation/core-rules.d.ts +49 -0
- package/dist/validation/design-rules.d.ts +9 -3
- package/dist/validation/rule-registry.d.ts +3 -3
- package/dist/validation/rules/connections.d.ts +27 -0
- package/dist/validation/rules/context.d.ts +11 -0
- package/dist/validation/rules/cycles.d.ts +17 -0
- package/dist/validation/rules/data-flow.d.ts +19 -0
- package/dist/validation/rules/scope-topology.d.ts +35 -0
- package/dist/validation/rules/type-compatibility.d.ts +30 -0
- package/dist/validation/type-checker.d.ts +39 -0
- package/dist/validation/validator-helpers.d.ts +31 -0
- package/dist/validation/validator.d.ts +30 -0
- package/docs/reference/advanced-annotations.md +277 -60
- package/docs/reference/built-in-nodes.md +164 -94
- package/docs/reference/cancellation.md +44 -0
- package/docs/reference/cli-reference.md +252 -234
- package/docs/reference/compilation.md +36 -109
- package/docs/reference/concepts.md +80 -63
- package/docs/reference/console.md +169 -0
- package/docs/reference/debugging.md +26 -57
- package/docs/reference/deployment.md +217 -143
- package/docs/reference/durable-gates.md +445 -0
- package/docs/reference/error-codes.md +90 -43
- package/docs/reference/export-interface.md +91 -26
- package/docs/reference/iterative-development.md +50 -28
- package/docs/reference/jsdoc-grammar.md +66 -311
- package/docs/reference/library.md +250 -0
- package/docs/reference/marketplace.md +301 -152
- package/docs/reference/mcp-tools.md +102 -0
- package/docs/reference/node-conversion.md +84 -59
- package/docs/reference/orientation.md +68 -0
- package/docs/reference/scaffold.md +5 -4
- package/docs/reference/tutorial.md +106 -166
- package/docs/reference/visual-reference.md +1 -1
- package/package.json +85 -50
- package/dist/agent/agent-loop.js +0 -156
- package/dist/agent/cli-spawn-config.js +0 -65
- package/dist/agent/device-connection.d.ts +0 -79
- package/dist/agent/device-connection.js +0 -184
- package/dist/agent/env-allowlist.js +0 -60
- package/dist/agent/providers/anthropic.js +0 -198
- package/dist/agent/providers/claude-cli.js +0 -161
- package/dist/agent/providers/openai-compat.js +0 -205
- package/dist/agent/providers/platform.d.ts +0 -23
- package/dist/agent/providers/platform.js +0 -132
- package/dist/agent/streaming.js +0 -186
- package/dist/agent/types.js +0 -20
- package/dist/annotation-generator.d.ts +0 -50
- package/dist/annotation-generator.js +0 -743
- package/dist/api/builder.js +0 -345
- package/dist/api/command-runner.js +0 -787
- package/dist/api/compile.js +0 -148
- package/dist/api/extract-types.js +0 -57
- package/dist/api/generate-in-place.js +0 -1477
- package/dist/api/generate.js +0 -514
- package/dist/api/helpers.js +0 -285
- package/dist/api/inline-runtime.js +0 -526
- package/dist/api/manipulation/connections.js +0 -151
- package/dist/api/manipulation/index.js +0 -41
- package/dist/api/manipulation/node-types.js +0 -200
- package/dist/api/manipulation/nodes.js +0 -355
- package/dist/api/manipulation/ports.js +0 -228
- package/dist/api/manipulation/scopes.js +0 -156
- package/dist/api/manipulation/workflow.js +0 -116
- package/dist/api/modify-operation.js +0 -177
- package/dist/api/parse.js +0 -115
- package/dist/api/patterns.d.ts +0 -112
- package/dist/api/patterns.js +0 -303
- package/dist/api/query.js +0 -840
- package/dist/api/templates.js +0 -117
- package/dist/api/transform.js +0 -40
- package/dist/api/validate.js +0 -64
- package/dist/api/validation-registry.js +0 -10
- package/dist/api/workflow-file-operations.js +0 -180
- package/dist/ast/builder.js +0 -395
- package/dist/ast/serialization-node.js +0 -30
- package/dist/ast/serialization.js +0 -134
- package/dist/ast/types.js +0 -2
- package/dist/ast/workflow-utils.js +0 -114
- package/dist/body-generator.js +0 -35
- package/dist/built-in-nodes/coercion-types.js +0 -61
- package/dist/built-in-nodes/delay.js +0 -29
- package/dist/built-in-nodes/generated-registry.js +0 -299
- package/dist/built-in-nodes/invoke-workflow.js +0 -36
- package/dist/built-in-nodes/mock-types.js +0 -42
- package/dist/built-in-nodes/wait-for-agent.js +0 -31
- package/dist/built-in-nodes/wait-for-event.js +0 -25
- package/dist/chevrotain-parser/coerce-parser.js +0 -103
- package/dist/chevrotain-parser/connect-parser.js +0 -136
- package/dist/chevrotain-parser/fan-parser.js +0 -149
- package/dist/chevrotain-parser/grammar-diagrams.js +0 -273
- package/dist/chevrotain-parser/index.js +0 -31
- package/dist/chevrotain-parser/map-parser.js +0 -130
- package/dist/chevrotain-parser/node-parser.js +0 -558
- package/dist/chevrotain-parser/path-parser.js +0 -140
- package/dist/chevrotain-parser/port-parser.js +0 -519
- package/dist/chevrotain-parser/position-parser.d.ts +0 -20
- package/dist/chevrotain-parser/position-parser.js +0 -83
- package/dist/chevrotain-parser/scope-parser.js +0 -104
- package/dist/chevrotain-parser/tokens.js +0 -429
- package/dist/chevrotain-parser/trigger-cancel-parser.js +0 -291
- package/dist/cli/commands/account.d.ts +0 -4
- package/dist/cli/commands/account.js +0 -50
- package/dist/cli/commands/ai-credentials.d.ts +0 -12
- package/dist/cli/commands/ai-credentials.js +0 -95
- package/dist/cli/commands/apikey.d.ts +0 -4
- package/dist/cli/commands/apikey.js +0 -64
- package/dist/cli/commands/auth.d.ts +0 -9
- package/dist/cli/commands/auth.js +0 -255
- package/dist/cli/commands/compile.js +0 -331
- package/dist/cli/commands/connect.d.ts +0 -4
- package/dist/cli/commands/connect.js +0 -163
- package/dist/cli/commands/context.js +0 -51
- package/dist/cli/commands/create.js +0 -139
- package/dist/cli/commands/deploy.d.ts +0 -6
- package/dist/cli/commands/deploy.js +0 -74
- package/dist/cli/commands/dev.js +0 -227
- package/dist/cli/commands/diagram.js +0 -39
- package/dist/cli/commands/diff.js +0 -57
- package/dist/cli/commands/docs.js +0 -74
- package/dist/cli/commands/export.js +0 -153
- package/dist/cli/commands/grammar.js +0 -40
- package/dist/cli/commands/implement.js +0 -91
- package/dist/cli/commands/init-personas.js +0 -541
- package/dist/cli/commands/init.js +0 -797
- package/dist/cli/commands/market.js +0 -440
- package/dist/cli/commands/mcp-setup.js +0 -433
- package/dist/cli/commands/migrate.js +0 -91
- package/dist/cli/commands/modify.js +0 -58
- package/dist/cli/commands/openapi.js +0 -71
- package/dist/cli/commands/org.d.ts +0 -8
- package/dist/cli/commands/org.js +0 -136
- package/dist/cli/commands/pattern.d.ts +0 -34
- package/dist/cli/commands/pattern.js +0 -186
- package/dist/cli/commands/plugin.d.ts +0 -16
- package/dist/cli/commands/plugin.js +0 -176
- package/dist/cli/commands/run.js +0 -742
- package/dist/cli/commands/serve.js +0 -93
- package/dist/cli/commands/status.js +0 -123
- package/dist/cli/commands/strip.js +0 -61
- package/dist/cli/commands/templates.js +0 -58
- package/dist/cli/commands/validate.js +0 -267
- package/dist/cli/commands/watch.js +0 -71
- package/dist/cli/config/credentials.d.ts +0 -15
- package/dist/cli/config/credentials.js +0 -43
- package/dist/cli/config/platform-client.d.ts +0 -123
- package/dist/cli/config/platform-client.js +0 -248
- package/dist/cli/env-setup.js +0 -12
- package/dist/cli/index.js +0 -850
- package/dist/cli/pack-commands.js +0 -122
- package/dist/cli/postinstall.d.ts +0 -16
- package/dist/cli/postinstall.js +0 -119
- package/dist/cli/templates/ai/mock-provider.js +0 -64
- package/dist/cli/templates/ai/types.js +0 -5
- package/dist/cli/templates/approvals/index.d.ts +0 -15
- package/dist/cli/templates/approvals/index.js +0 -241
- package/dist/cli/templates/index.js +0 -123
- package/dist/cli/templates/nodes/agent-router.js +0 -114
- package/dist/cli/templates/nodes/aggregator.js +0 -63
- package/dist/cli/templates/nodes/conversation-memory.js +0 -85
- package/dist/cli/templates/nodes/http.js +0 -80
- package/dist/cli/templates/nodes/human-approval.js +0 -109
- package/dist/cli/templates/nodes/json-extractor.js +0 -119
- package/dist/cli/templates/nodes/llm-call.js +0 -106
- package/dist/cli/templates/nodes/prompt-template.js +0 -52
- package/dist/cli/templates/nodes/rag-retriever.js +0 -128
- package/dist/cli/templates/nodes/tool-executor.js +0 -108
- package/dist/cli/templates/nodes/transformer.js +0 -68
- package/dist/cli/templates/nodes/validator.js +0 -62
- package/dist/cli/templates/pack-loader.js +0 -58
- package/dist/cli/templates/providers/index.js +0 -239
- package/dist/cli/templates/shared/approval-types.js +0 -31
- package/dist/cli/templates/shared/llm-types.js +0 -109
- package/dist/cli/templates/workflows/aggregator.js +0 -101
- package/dist/cli/templates/workflows/ai-agent.js +0 -326
- package/dist/cli/templates/workflows/ai-chat.js +0 -167
- package/dist/cli/templates/workflows/ai-rag.js +0 -184
- package/dist/cli/templates/workflows/ai-react.js +0 -293
- package/dist/cli/templates/workflows/conditional.js +0 -139
- package/dist/cli/templates/workflows/error-handler.js +0 -145
- package/dist/cli/templates/workflows/foreach.js +0 -140
- package/dist/cli/templates/workflows/sequential.js +0 -200
- package/dist/cli/templates/workflows/webhook.js +0 -158
- package/dist/cli/utils/cli-helpers.d.ts +0 -44
- package/dist/cli/utils/cli-helpers.js +0 -99
- package/dist/cli/utils/logger.js +0 -126
- package/dist/cli/utils/parse-int-strict.js +0 -17
- package/dist/cli/utils/safe-write.js +0 -54
- package/dist/deployment/config/defaults.d.ts +0 -29
- package/dist/deployment/config/defaults.js +0 -98
- package/dist/deployment/config/loader.d.ts +0 -24
- package/dist/deployment/config/loader.js +0 -237
- package/dist/deployment/config/types.d.ts +0 -117
- package/dist/deployment/config/types.js +0 -5
- package/dist/deployment/core/adapters.d.ts +0 -66
- package/dist/deployment/core/adapters.js +0 -156
- package/dist/deployment/core/executor.d.ts +0 -62
- package/dist/deployment/core/executor.js +0 -197
- package/dist/deployment/core/formatters.d.ts +0 -42
- package/dist/deployment/core/formatters.js +0 -146
- package/dist/deployment/openapi/generator.d.ts +0 -146
- package/dist/deployment/openapi/generator.js +0 -347
- package/dist/deployment/openapi/schema-converter.d.ts +0 -49
- package/dist/deployment/openapi/schema-converter.js +0 -192
- package/dist/deployment/targets/base.js +0 -855
- package/dist/deployment/types.d.ts +0 -140
- package/dist/deployment/types.js +0 -8
- package/dist/diagram/ascii-renderer.js +0 -528
- package/dist/diagram/geometry.js +0 -1226
- package/dist/diagram/html-viewer.d.ts +0 -21
- package/dist/diagram/html-viewer.js +0 -1745
- package/dist/diagram/layout.js +0 -143
- package/dist/diagram/orthogonal-router.js +0 -458
- package/dist/diagram/renderer.d.ts +0 -3
- package/dist/diagram/renderer.js +0 -280
- package/dist/diagram/theme.js +0 -282
- package/dist/diagram/types.js +0 -2
- package/dist/diff/WorkflowDiffer.js +0 -429
- package/dist/diff/formatDiff.js +0 -239
- package/dist/diff/impact.js +0 -119
- package/dist/diff/types.js +0 -35
- package/dist/doc-metadata/extractors/annotations.js +0 -638
- package/dist/doc-metadata/extractors/cli-commands.js +0 -326
- package/dist/doc-metadata/extractors/core-metadata.js +0 -61
- package/dist/doc-metadata/extractors/error-codes.js +0 -372
- package/dist/doc-metadata/extractors/grammar-rules.js +0 -51
- package/dist/doc-metadata/extractors/mcp-tools.js +0 -705
- package/dist/doc-metadata/extractors/plugin-api.d.ts +0 -19
- package/dist/doc-metadata/extractors/plugin-api.js +0 -279
- package/dist/doc-metadata/types.js +0 -5
- package/dist/editor-completions/annotationValues.js +0 -146
- package/dist/editor-completions/contextParser.js +0 -410
- package/dist/editor-completions/dataTypes.js +0 -95
- package/dist/editor-completions/goToDefinition.js +0 -112
- package/dist/editor-completions/jsDocAnnotations.js +0 -359
- package/dist/editor-completions/modifierCompletions.js +0 -197
- package/dist/editor-completions/types.js +0 -8
- package/dist/export/index.js +0 -212
- package/dist/extensions/index.d.ts +0 -16
- package/dist/extensions/index.js +0 -17
- package/dist/friendly-errors.js +0 -761
- package/dist/function-like.js +0 -84
- package/dist/generator/async-detection.js +0 -56
- package/dist/generator/code-utils.js +0 -551
- package/dist/generator/compile-target-registry.d.ts +0 -20
- package/dist/generator/compile-target-registry.js +0 -20
- package/dist/generator/control-flow.js +0 -358
- package/dist/generator/dev-mode-registry.d.ts +0 -27
- package/dist/generator/dev-mode-registry.js +0 -20
- package/dist/generator/scope-function-generator.js +0 -397
- package/dist/generator/unified.js +0 -1831
- package/dist/generator.d.ts +0 -54
- package/dist/generator.js +0 -101
- package/dist/jsdoc-parser.d.ts +0 -377
- package/dist/jsdoc-parser.js +0 -1189
- package/dist/jsdoc-port-sync/constants.js +0 -103
- package/dist/jsdoc-port-sync/diff.js +0 -319
- package/dist/jsdoc-port-sync/port-parser.js +0 -579
- package/dist/jsdoc-port-sync/rename.js +0 -256
- package/dist/jsdoc-port-sync/signature-parser.js +0 -559
- package/dist/jsdoc-port-sync/sync.js +0 -653
- package/dist/marketplace/manifest.js +0 -194
- package/dist/marketplace/registry.js +0 -198
- package/dist/marketplace/types.js +0 -9
- package/dist/marketplace/validator.js +0 -150
- package/dist/mcp/agent-channel.d.ts +0 -35
- package/dist/mcp/agent-channel.js +0 -61
- package/dist/mcp/auto-registration.d.ts +0 -3
- package/dist/mcp/auto-registration.js +0 -62
- package/dist/mcp/debug-session.js +0 -25
- package/dist/mcp/index.d.ts +0 -11
- package/dist/mcp/index.js +0 -10
- package/dist/mcp/pack-tools.js +0 -59
- package/dist/mcp/prompts.js +0 -68
- package/dist/mcp/response-utils.js +0 -97
- package/dist/mcp/run-registry.d.ts +0 -29
- package/dist/mcp/run-registry.js +0 -24
- package/dist/mcp/server.js +0 -63
- package/dist/mcp/tools-context.js +0 -51
- package/dist/mcp/tools-debug.js +0 -451
- package/dist/mcp/tools-diagram.js +0 -97
- package/dist/mcp/tools-docs.js +0 -62
- package/dist/mcp/tools-export.js +0 -222
- package/dist/mcp/tools-marketplace.js +0 -132
- package/dist/mcp/tools-model.d.ts +0 -3
- package/dist/mcp/tools-model.js +0 -279
- package/dist/mcp/tools-pattern.d.ts +0 -3
- package/dist/mcp/tools-pattern.js +0 -604
- package/dist/mcp/tools-query.js +0 -377
- package/dist/mcp/tools-resources.js +0 -41
- package/dist/mcp/tools-template.js +0 -119
- package/dist/mcp/tools-workflow-run.d.ts +0 -40
- package/dist/mcp/tools-workflow-run.js +0 -150
- package/dist/mcp/types.js +0 -2
- package/dist/mcp/workflow-executor.js +0 -242
- package/dist/migration/registry.js +0 -29
- package/dist/node-types-generator.js +0 -139
- package/dist/parser/tag-registry.js +0 -57
- package/dist/parser.d.ts +0 -232
- package/dist/parser.js +0 -2500
- package/dist/plugin/PluginPanel.d.ts +0 -12
- package/dist/plugin/PluginPanel.js +0 -5
- package/dist/plugin/index.d.ts +0 -13
- package/dist/plugin/index.js +0 -14
- package/dist/plugin/types.d.ts +0 -75
- package/dist/plugin/types.js +0 -8
- package/dist/resolve-package-types.js +0 -123
- package/dist/runtime/CancellationError.js +0 -20
- package/dist/runtime/ExecutionContext.js +0 -280
- package/dist/runtime/builtin-functions.js +0 -549
- package/dist/runtime/checkpoint.d.ts +0 -84
- package/dist/runtime/checkpoint.js +0 -225
- package/dist/runtime/debug-controller.js +0 -247
- package/dist/runtime/events.js +0 -2
- package/dist/runtime/function-registry.js +0 -66
- package/dist/runtime/parameter-resolver.js +0 -113
- package/dist/server/types.js +0 -5
- package/dist/server/webhook-server.js +0 -269
- package/dist/server/workflow-registry.js +0 -202
- package/dist/shared-project.js +0 -28
- package/dist/sugar-optimizer.js +0 -498
- package/dist/testing/assertions.js +0 -127
- package/dist/testing/mock-approval.js +0 -98
- package/dist/testing/mock-llm.js +0 -119
- package/dist/testing/recorder.js +0 -70
- package/dist/testing/replayer.js +0 -143
- package/dist/testing/token-tracker.js +0 -94
- package/dist/type-checker.d.ts +0 -42
- package/dist/type-checker.js +0 -190
- package/dist/type-mappings.js +0 -131
- package/dist/types/branded-ports.d.ts +0 -151
- package/dist/types/branded-ports.js +0 -121
- package/dist/types/index.d.ts +0 -5
- package/dist/types/index.js +0 -5
- package/dist/types.d.ts +0 -139
- package/dist/types.js +0 -15
- package/dist/utils/error-utils.js +0 -27
- package/dist/utils/lru-cache.js +0 -40
- package/dist/utils/port-ordering.js +0 -81
- package/dist/utils/port-tag-utils.js +0 -41
- package/dist/utils/string-distance.js +0 -56
- package/dist/validation/agent-detection.js +0 -115
- package/dist/validation/agent-rules.js +0 -262
- package/dist/validation/design-rules.js +0 -377
- package/dist/validation/rule-registry.js +0 -37
- package/dist/validator.d.ts +0 -113
- package/dist/validator.js +0 -1631
- package/docs/reference/patterns.md +0 -159
- package/scripts/postinstall.cjs +0 -86
- /package/dist/{shared-project.d.ts → parser/shared-project.d.ts} +0 -0
- /package/dist/{friendly-errors.d.ts → validation/friendly-errors.d.ts} +0 -0
|
@@ -0,0 +1,2188 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from "module";
|
|
2
|
+
const require = __createRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
getErrorMessage
|
|
5
|
+
} from "./flow-weaver-chunk-OMVWSNHJ.mjs";
|
|
6
|
+
import {
|
|
7
|
+
__commonJS,
|
|
8
|
+
__require,
|
|
9
|
+
__toESM
|
|
10
|
+
} from "./flow-weaver-chunk-N767YRAI.mjs";
|
|
11
|
+
|
|
12
|
+
// node_modules/cli-width/index.js
|
|
13
|
+
var require_cli_width = __commonJS({
|
|
14
|
+
"node_modules/cli-width/index.js"(exports, module) {
|
|
15
|
+
"use strict";
|
|
16
|
+
module.exports = cliWidth2;
|
|
17
|
+
function normalizeOpts(options) {
|
|
18
|
+
const defaultOpts = {
|
|
19
|
+
defaultWidth: 0,
|
|
20
|
+
output: process.stdout,
|
|
21
|
+
tty: __require("tty")
|
|
22
|
+
};
|
|
23
|
+
if (!options) {
|
|
24
|
+
return defaultOpts;
|
|
25
|
+
}
|
|
26
|
+
Object.keys(defaultOpts).forEach(function(key) {
|
|
27
|
+
if (!options[key]) {
|
|
28
|
+
options[key] = defaultOpts[key];
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
return options;
|
|
32
|
+
}
|
|
33
|
+
function cliWidth2(options) {
|
|
34
|
+
const opts = normalizeOpts(options);
|
|
35
|
+
if (opts.output.getWindowSize) {
|
|
36
|
+
return opts.output.getWindowSize()[0] || opts.defaultWidth;
|
|
37
|
+
}
|
|
38
|
+
if (opts.tty.getWindowSize) {
|
|
39
|
+
return opts.tty.getWindowSize()[1] || opts.defaultWidth;
|
|
40
|
+
}
|
|
41
|
+
if (opts.output.columns) {
|
|
42
|
+
return opts.output.columns;
|
|
43
|
+
}
|
|
44
|
+
if (process.env.CLI_WIDTH) {
|
|
45
|
+
const width = parseInt(process.env.CLI_WIDTH, 10);
|
|
46
|
+
if (!isNaN(width) && width !== 0) {
|
|
47
|
+
return width;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return opts.defaultWidth;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
// node_modules/mute-stream/lib/index.js
|
|
56
|
+
var require_lib = __commonJS({
|
|
57
|
+
"node_modules/mute-stream/lib/index.js"(exports, module) {
|
|
58
|
+
var Stream = __require("stream");
|
|
59
|
+
var MuteStream2 = class extends Stream {
|
|
60
|
+
#isTTY = null;
|
|
61
|
+
constructor(opts = {}) {
|
|
62
|
+
super(opts);
|
|
63
|
+
this.writable = this.readable = true;
|
|
64
|
+
this.muted = false;
|
|
65
|
+
this.on("pipe", this._onpipe);
|
|
66
|
+
this.replace = opts.replace;
|
|
67
|
+
this._prompt = opts.prompt || null;
|
|
68
|
+
this._hadControl = false;
|
|
69
|
+
}
|
|
70
|
+
#destSrc(key, def) {
|
|
71
|
+
if (this._dest) {
|
|
72
|
+
return this._dest[key];
|
|
73
|
+
}
|
|
74
|
+
if (this._src) {
|
|
75
|
+
return this._src[key];
|
|
76
|
+
}
|
|
77
|
+
return def;
|
|
78
|
+
}
|
|
79
|
+
#proxy(method, ...args) {
|
|
80
|
+
if (typeof this._dest?.[method] === "function") {
|
|
81
|
+
this._dest[method](...args);
|
|
82
|
+
}
|
|
83
|
+
if (typeof this._src?.[method] === "function") {
|
|
84
|
+
this._src[method](...args);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
get isTTY() {
|
|
88
|
+
if (this.#isTTY !== null) {
|
|
89
|
+
return this.#isTTY;
|
|
90
|
+
}
|
|
91
|
+
return this.#destSrc("isTTY", false);
|
|
92
|
+
}
|
|
93
|
+
// basically just get replace the getter/setter with a regular value
|
|
94
|
+
set isTTY(val) {
|
|
95
|
+
this.#isTTY = val;
|
|
96
|
+
}
|
|
97
|
+
get rows() {
|
|
98
|
+
return this.#destSrc("rows");
|
|
99
|
+
}
|
|
100
|
+
get columns() {
|
|
101
|
+
return this.#destSrc("columns");
|
|
102
|
+
}
|
|
103
|
+
mute() {
|
|
104
|
+
this.muted = true;
|
|
105
|
+
}
|
|
106
|
+
unmute() {
|
|
107
|
+
this.muted = false;
|
|
108
|
+
}
|
|
109
|
+
_onpipe(src) {
|
|
110
|
+
this._src = src;
|
|
111
|
+
}
|
|
112
|
+
pipe(dest, options) {
|
|
113
|
+
this._dest = dest;
|
|
114
|
+
return super.pipe(dest, options);
|
|
115
|
+
}
|
|
116
|
+
pause() {
|
|
117
|
+
if (this._src) {
|
|
118
|
+
return this._src.pause();
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
resume() {
|
|
122
|
+
if (this._src) {
|
|
123
|
+
return this._src.resume();
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
write(c) {
|
|
127
|
+
if (this.muted) {
|
|
128
|
+
if (!this.replace) {
|
|
129
|
+
return true;
|
|
130
|
+
}
|
|
131
|
+
if (c.match(/^\u001b/)) {
|
|
132
|
+
if (c.indexOf(this._prompt) === 0) {
|
|
133
|
+
c = c.slice(this._prompt.length);
|
|
134
|
+
c = c.replace(/./g, this.replace);
|
|
135
|
+
c = this._prompt + c;
|
|
136
|
+
}
|
|
137
|
+
this._hadControl = true;
|
|
138
|
+
return this.emit("data", c);
|
|
139
|
+
} else {
|
|
140
|
+
if (this._prompt && this._hadControl && c.indexOf(this._prompt) === 0) {
|
|
141
|
+
this._hadControl = false;
|
|
142
|
+
this.emit("data", this._prompt);
|
|
143
|
+
c = c.slice(this._prompt.length);
|
|
144
|
+
}
|
|
145
|
+
c = c.toString().replace(/./g, this.replace);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
this.emit("data", c);
|
|
149
|
+
}
|
|
150
|
+
end(c) {
|
|
151
|
+
if (this.muted) {
|
|
152
|
+
if (c && this.replace) {
|
|
153
|
+
c = c.toString().replace(/./g, this.replace);
|
|
154
|
+
} else {
|
|
155
|
+
c = null;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
if (c) {
|
|
159
|
+
this.emit("data", c);
|
|
160
|
+
}
|
|
161
|
+
this.emit("end");
|
|
162
|
+
}
|
|
163
|
+
destroy(...args) {
|
|
164
|
+
return this.#proxy("destroy", ...args);
|
|
165
|
+
}
|
|
166
|
+
destroySoon(...args) {
|
|
167
|
+
return this.#proxy("destroySoon", ...args);
|
|
168
|
+
}
|
|
169
|
+
close(...args) {
|
|
170
|
+
return this.#proxy("close", ...args);
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
module.exports = MuteStream2;
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
// src/cli/commands/mcp-setup.ts
|
|
178
|
+
import { execSync } from "child_process";
|
|
179
|
+
import * as fs from "fs";
|
|
180
|
+
import * as path2 from "path";
|
|
181
|
+
import * as os from "os";
|
|
182
|
+
|
|
183
|
+
// node_modules/@inquirer/core/dist/lib/key.js
|
|
184
|
+
var keybindings = ["emacs", "vim"];
|
|
185
|
+
var keybindingLookup = new Set(keybindings);
|
|
186
|
+
function isKeybinding(value) {
|
|
187
|
+
return keybindingLookup.has(value);
|
|
188
|
+
}
|
|
189
|
+
function getDefaultKeybindings() {
|
|
190
|
+
const env = process.env["INQUIRER_KEYBINDINGS"];
|
|
191
|
+
if (!env)
|
|
192
|
+
return [];
|
|
193
|
+
return Array.from(new Set(env.toLowerCase().split(/[\s,]+/).filter(isKeybinding)));
|
|
194
|
+
}
|
|
195
|
+
var isUpKey = (key, keybindings2 = []) => (
|
|
196
|
+
// The up key
|
|
197
|
+
key.name === "up" || // Vim keybinding: hjkl keys map to left/down/up/right
|
|
198
|
+
keybindings2.includes("vim") && key.name === "k" || // Emacs keybinding: Ctrl+P means "previous" in Emacs navigation conventions
|
|
199
|
+
keybindings2.includes("emacs") && key.ctrl && key.name === "p"
|
|
200
|
+
);
|
|
201
|
+
var isDownKey = (key, keybindings2 = []) => (
|
|
202
|
+
// The down key
|
|
203
|
+
key.name === "down" || // Vim keybinding: hjkl keys map to left/down/up/right
|
|
204
|
+
keybindings2.includes("vim") && key.name === "j" || // Emacs keybinding: Ctrl+N means "next" in Emacs navigation conventions
|
|
205
|
+
keybindings2.includes("emacs") && key.ctrl && key.name === "n"
|
|
206
|
+
);
|
|
207
|
+
var isBackspaceKey = (key) => key.name === "backspace";
|
|
208
|
+
var isTabKey = (key) => key.name === "tab";
|
|
209
|
+
var isNumberKey = (key) => "1234567890".includes(key.name);
|
|
210
|
+
var isEnterKey = (key) => key.name === "enter" || key.name === "return";
|
|
211
|
+
|
|
212
|
+
// node_modules/@inquirer/core/dist/lib/errors.js
|
|
213
|
+
var AbortPromptError = class extends Error {
|
|
214
|
+
name = "AbortPromptError";
|
|
215
|
+
message = "Prompt was aborted";
|
|
216
|
+
constructor(options) {
|
|
217
|
+
super();
|
|
218
|
+
this.cause = options?.cause;
|
|
219
|
+
}
|
|
220
|
+
};
|
|
221
|
+
var CancelPromptError = class extends Error {
|
|
222
|
+
name = "CancelPromptError";
|
|
223
|
+
message = "Prompt was canceled";
|
|
224
|
+
};
|
|
225
|
+
var ExitPromptError = class extends Error {
|
|
226
|
+
name = "ExitPromptError";
|
|
227
|
+
};
|
|
228
|
+
var HookError = class extends Error {
|
|
229
|
+
name = "HookError";
|
|
230
|
+
};
|
|
231
|
+
var ValidationError = class extends Error {
|
|
232
|
+
name = "ValidationError";
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
// node_modules/@inquirer/core/dist/lib/use-state.js
|
|
236
|
+
import { AsyncResource as AsyncResource2 } from "node:async_hooks";
|
|
237
|
+
|
|
238
|
+
// node_modules/@inquirer/core/dist/lib/hook-engine.js
|
|
239
|
+
import { AsyncLocalStorage, AsyncResource } from "node:async_hooks";
|
|
240
|
+
var hookStorage = new AsyncLocalStorage();
|
|
241
|
+
function createStore(rl) {
|
|
242
|
+
const store = {
|
|
243
|
+
rl,
|
|
244
|
+
hooks: [],
|
|
245
|
+
hooksCleanup: [],
|
|
246
|
+
hooksEffect: [],
|
|
247
|
+
index: 0,
|
|
248
|
+
handleChange() {
|
|
249
|
+
}
|
|
250
|
+
};
|
|
251
|
+
return store;
|
|
252
|
+
}
|
|
253
|
+
function withHooks(rl, cb) {
|
|
254
|
+
const store = createStore(rl);
|
|
255
|
+
return hookStorage.run(store, () => {
|
|
256
|
+
function cycle(render) {
|
|
257
|
+
store.handleChange = () => {
|
|
258
|
+
store.index = 0;
|
|
259
|
+
render();
|
|
260
|
+
};
|
|
261
|
+
store.handleChange();
|
|
262
|
+
}
|
|
263
|
+
return cb(cycle);
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
function getStore() {
|
|
267
|
+
const store = hookStorage.getStore();
|
|
268
|
+
if (!store) {
|
|
269
|
+
throw new HookError("[Inquirer] Hook functions can only be called from within a prompt");
|
|
270
|
+
}
|
|
271
|
+
return store;
|
|
272
|
+
}
|
|
273
|
+
function readline() {
|
|
274
|
+
return getStore().rl;
|
|
275
|
+
}
|
|
276
|
+
function withUpdates(fn) {
|
|
277
|
+
const wrapped = (...args) => {
|
|
278
|
+
const store = getStore();
|
|
279
|
+
let shouldUpdate = false;
|
|
280
|
+
const oldHandleChange = store.handleChange;
|
|
281
|
+
store.handleChange = () => {
|
|
282
|
+
shouldUpdate = true;
|
|
283
|
+
};
|
|
284
|
+
const returnValue = fn(...args);
|
|
285
|
+
if (shouldUpdate) {
|
|
286
|
+
oldHandleChange();
|
|
287
|
+
}
|
|
288
|
+
store.handleChange = oldHandleChange;
|
|
289
|
+
return returnValue;
|
|
290
|
+
};
|
|
291
|
+
return AsyncResource.bind(wrapped);
|
|
292
|
+
}
|
|
293
|
+
function withPointer(cb) {
|
|
294
|
+
const store = getStore();
|
|
295
|
+
const { index } = store;
|
|
296
|
+
const pointer = {
|
|
297
|
+
get() {
|
|
298
|
+
return store.hooks[index];
|
|
299
|
+
},
|
|
300
|
+
set(value) {
|
|
301
|
+
store.hooks[index] = value;
|
|
302
|
+
},
|
|
303
|
+
initialized: index in store.hooks
|
|
304
|
+
};
|
|
305
|
+
const returnValue = cb(pointer);
|
|
306
|
+
store.index++;
|
|
307
|
+
return returnValue;
|
|
308
|
+
}
|
|
309
|
+
function handleChange() {
|
|
310
|
+
getStore().handleChange();
|
|
311
|
+
}
|
|
312
|
+
var effectScheduler = {
|
|
313
|
+
queue(cb) {
|
|
314
|
+
const store = getStore();
|
|
315
|
+
const { index } = store;
|
|
316
|
+
store.hooksEffect.push(() => {
|
|
317
|
+
store.hooksCleanup[index]?.();
|
|
318
|
+
const cleanFn = cb(readline());
|
|
319
|
+
if (cleanFn != null && typeof cleanFn !== "function") {
|
|
320
|
+
throw new ValidationError("useEffect return value must be a cleanup function or nothing.");
|
|
321
|
+
}
|
|
322
|
+
store.hooksCleanup[index] = cleanFn;
|
|
323
|
+
});
|
|
324
|
+
},
|
|
325
|
+
run() {
|
|
326
|
+
const store = getStore();
|
|
327
|
+
withUpdates(() => {
|
|
328
|
+
store.hooksEffect.forEach((effect) => {
|
|
329
|
+
effect();
|
|
330
|
+
});
|
|
331
|
+
store.hooksEffect.length = 0;
|
|
332
|
+
})();
|
|
333
|
+
},
|
|
334
|
+
clearAll() {
|
|
335
|
+
const store = getStore();
|
|
336
|
+
store.hooksCleanup.forEach((cleanFn) => {
|
|
337
|
+
cleanFn?.();
|
|
338
|
+
});
|
|
339
|
+
store.hooksEffect.length = 0;
|
|
340
|
+
store.hooksCleanup.length = 0;
|
|
341
|
+
}
|
|
342
|
+
};
|
|
343
|
+
|
|
344
|
+
// node_modules/@inquirer/core/dist/lib/use-state.js
|
|
345
|
+
function isFactory(value) {
|
|
346
|
+
return typeof value === "function";
|
|
347
|
+
}
|
|
348
|
+
function isReducer(value) {
|
|
349
|
+
return typeof value === "function";
|
|
350
|
+
}
|
|
351
|
+
function useState(defaultValue) {
|
|
352
|
+
return withPointer((pointer) => {
|
|
353
|
+
const setState = AsyncResource2.bind(function setState2(newValue) {
|
|
354
|
+
const currentValue = pointer.get();
|
|
355
|
+
const nextValue = isReducer(newValue) ? newValue(currentValue) : newValue;
|
|
356
|
+
if (!Object.is(currentValue, nextValue)) {
|
|
357
|
+
pointer.set(nextValue);
|
|
358
|
+
handleChange();
|
|
359
|
+
}
|
|
360
|
+
});
|
|
361
|
+
if (pointer.initialized) {
|
|
362
|
+
return [pointer.get(), setState];
|
|
363
|
+
}
|
|
364
|
+
const value = isFactory(defaultValue) ? defaultValue() : defaultValue;
|
|
365
|
+
pointer.set(value);
|
|
366
|
+
return [value, setState];
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
// node_modules/@inquirer/core/dist/lib/use-effect.js
|
|
371
|
+
function useEffect(cb, depArray) {
|
|
372
|
+
withPointer((pointer) => {
|
|
373
|
+
const oldDeps = pointer.get();
|
|
374
|
+
const hasChanged = !Array.isArray(oldDeps) || depArray.some((dep, i) => !Object.is(dep, oldDeps[i]));
|
|
375
|
+
if (hasChanged) {
|
|
376
|
+
effectScheduler.queue(cb);
|
|
377
|
+
}
|
|
378
|
+
pointer.set(depArray);
|
|
379
|
+
});
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
// node_modules/@inquirer/core/dist/lib/theme.js
|
|
383
|
+
import { styleText } from "node:util";
|
|
384
|
+
|
|
385
|
+
// node_modules/@inquirer/figures/dist/index.js
|
|
386
|
+
import process2 from "node:process";
|
|
387
|
+
function isUnicodeSupported() {
|
|
388
|
+
if (!process2.platform.startsWith("win")) {
|
|
389
|
+
return process2.env["TERM"] !== "linux";
|
|
390
|
+
}
|
|
391
|
+
return Boolean(process2.env["CI"]) || // CI environments generally support unicode
|
|
392
|
+
Boolean(process2.env["WT_SESSION"]) || // Windows Terminal
|
|
393
|
+
Boolean(process2.env["TERMINUS_SUBLIME"]) || // Terminus (<0.2.27)
|
|
394
|
+
process2.env["ConEmuTask"] === "{cmd::Cmder}" || // ConEmu and cmder
|
|
395
|
+
process2.env["TERM_PROGRAM"] === "Terminus-Sublime" || process2.env["TERM_PROGRAM"] === "vscode" || process2.env["TERM"] === "xterm-256color" || process2.env["TERM"] === "alacritty" || process2.env["TERMINAL_EMULATOR"] === "JetBrains-JediTerm";
|
|
396
|
+
}
|
|
397
|
+
var common = {
|
|
398
|
+
circleQuestionMark: "(?)",
|
|
399
|
+
questionMarkPrefix: "(?)",
|
|
400
|
+
square: "\u2588",
|
|
401
|
+
squareDarkShade: "\u2593",
|
|
402
|
+
squareMediumShade: "\u2592",
|
|
403
|
+
squareLightShade: "\u2591",
|
|
404
|
+
squareTop: "\u2580",
|
|
405
|
+
squareBottom: "\u2584",
|
|
406
|
+
squareLeft: "\u258C",
|
|
407
|
+
squareRight: "\u2590",
|
|
408
|
+
squareCenter: "\u25A0",
|
|
409
|
+
bullet: "\u25CF",
|
|
410
|
+
dot: "\u2024",
|
|
411
|
+
ellipsis: "\u2026",
|
|
412
|
+
pointerSmall: "\u203A",
|
|
413
|
+
triangleUp: "\u25B2",
|
|
414
|
+
triangleUpSmall: "\u25B4",
|
|
415
|
+
triangleDown: "\u25BC",
|
|
416
|
+
triangleDownSmall: "\u25BE",
|
|
417
|
+
triangleLeftSmall: "\u25C2",
|
|
418
|
+
triangleRightSmall: "\u25B8",
|
|
419
|
+
home: "\u2302",
|
|
420
|
+
heart: "\u2665",
|
|
421
|
+
musicNote: "\u266A",
|
|
422
|
+
musicNoteBeamed: "\u266B",
|
|
423
|
+
arrowUp: "\u2191",
|
|
424
|
+
arrowDown: "\u2193",
|
|
425
|
+
arrowLeft: "\u2190",
|
|
426
|
+
arrowRight: "\u2192",
|
|
427
|
+
arrowLeftRight: "\u2194",
|
|
428
|
+
arrowUpDown: "\u2195",
|
|
429
|
+
almostEqual: "\u2248",
|
|
430
|
+
notEqual: "\u2260",
|
|
431
|
+
lessOrEqual: "\u2264",
|
|
432
|
+
greaterOrEqual: "\u2265",
|
|
433
|
+
identical: "\u2261",
|
|
434
|
+
infinity: "\u221E",
|
|
435
|
+
subscriptZero: "\u2080",
|
|
436
|
+
subscriptOne: "\u2081",
|
|
437
|
+
subscriptTwo: "\u2082",
|
|
438
|
+
subscriptThree: "\u2083",
|
|
439
|
+
subscriptFour: "\u2084",
|
|
440
|
+
subscriptFive: "\u2085",
|
|
441
|
+
subscriptSix: "\u2086",
|
|
442
|
+
subscriptSeven: "\u2087",
|
|
443
|
+
subscriptEight: "\u2088",
|
|
444
|
+
subscriptNine: "\u2089",
|
|
445
|
+
oneHalf: "\xBD",
|
|
446
|
+
oneThird: "\u2153",
|
|
447
|
+
oneQuarter: "\xBC",
|
|
448
|
+
oneFifth: "\u2155",
|
|
449
|
+
oneSixth: "\u2159",
|
|
450
|
+
oneEighth: "\u215B",
|
|
451
|
+
twoThirds: "\u2154",
|
|
452
|
+
twoFifths: "\u2156",
|
|
453
|
+
threeQuarters: "\xBE",
|
|
454
|
+
threeFifths: "\u2157",
|
|
455
|
+
threeEighths: "\u215C",
|
|
456
|
+
fourFifths: "\u2158",
|
|
457
|
+
fiveSixths: "\u215A",
|
|
458
|
+
fiveEighths: "\u215D",
|
|
459
|
+
sevenEighths: "\u215E",
|
|
460
|
+
line: "\u2500",
|
|
461
|
+
lineBold: "\u2501",
|
|
462
|
+
lineDouble: "\u2550",
|
|
463
|
+
lineDashed0: "\u2504",
|
|
464
|
+
lineDashed1: "\u2505",
|
|
465
|
+
lineDashed2: "\u2508",
|
|
466
|
+
lineDashed3: "\u2509",
|
|
467
|
+
lineDashed4: "\u254C",
|
|
468
|
+
lineDashed5: "\u254D",
|
|
469
|
+
lineDashed6: "\u2574",
|
|
470
|
+
lineDashed7: "\u2576",
|
|
471
|
+
lineDashed8: "\u2578",
|
|
472
|
+
lineDashed9: "\u257A",
|
|
473
|
+
lineDashed10: "\u257C",
|
|
474
|
+
lineDashed11: "\u257E",
|
|
475
|
+
lineDashed12: "\u2212",
|
|
476
|
+
lineDashed13: "\u2013",
|
|
477
|
+
lineDashed14: "\u2010",
|
|
478
|
+
lineDashed15: "\u2043",
|
|
479
|
+
lineVertical: "\u2502",
|
|
480
|
+
lineVerticalBold: "\u2503",
|
|
481
|
+
lineVerticalDouble: "\u2551",
|
|
482
|
+
lineVerticalDashed0: "\u2506",
|
|
483
|
+
lineVerticalDashed1: "\u2507",
|
|
484
|
+
lineVerticalDashed2: "\u250A",
|
|
485
|
+
lineVerticalDashed3: "\u250B",
|
|
486
|
+
lineVerticalDashed4: "\u254E",
|
|
487
|
+
lineVerticalDashed5: "\u254F",
|
|
488
|
+
lineVerticalDashed6: "\u2575",
|
|
489
|
+
lineVerticalDashed7: "\u2577",
|
|
490
|
+
lineVerticalDashed8: "\u2579",
|
|
491
|
+
lineVerticalDashed9: "\u257B",
|
|
492
|
+
lineVerticalDashed10: "\u257D",
|
|
493
|
+
lineVerticalDashed11: "\u257F",
|
|
494
|
+
lineDownLeft: "\u2510",
|
|
495
|
+
lineDownLeftArc: "\u256E",
|
|
496
|
+
lineDownBoldLeftBold: "\u2513",
|
|
497
|
+
lineDownBoldLeft: "\u2512",
|
|
498
|
+
lineDownLeftBold: "\u2511",
|
|
499
|
+
lineDownDoubleLeftDouble: "\u2557",
|
|
500
|
+
lineDownDoubleLeft: "\u2556",
|
|
501
|
+
lineDownLeftDouble: "\u2555",
|
|
502
|
+
lineDownRight: "\u250C",
|
|
503
|
+
lineDownRightArc: "\u256D",
|
|
504
|
+
lineDownBoldRightBold: "\u250F",
|
|
505
|
+
lineDownBoldRight: "\u250E",
|
|
506
|
+
lineDownRightBold: "\u250D",
|
|
507
|
+
lineDownDoubleRightDouble: "\u2554",
|
|
508
|
+
lineDownDoubleRight: "\u2553",
|
|
509
|
+
lineDownRightDouble: "\u2552",
|
|
510
|
+
lineUpLeft: "\u2518",
|
|
511
|
+
lineUpLeftArc: "\u256F",
|
|
512
|
+
lineUpBoldLeftBold: "\u251B",
|
|
513
|
+
lineUpBoldLeft: "\u251A",
|
|
514
|
+
lineUpLeftBold: "\u2519",
|
|
515
|
+
lineUpDoubleLeftDouble: "\u255D",
|
|
516
|
+
lineUpDoubleLeft: "\u255C",
|
|
517
|
+
lineUpLeftDouble: "\u255B",
|
|
518
|
+
lineUpRight: "\u2514",
|
|
519
|
+
lineUpRightArc: "\u2570",
|
|
520
|
+
lineUpBoldRightBold: "\u2517",
|
|
521
|
+
lineUpBoldRight: "\u2516",
|
|
522
|
+
lineUpRightBold: "\u2515",
|
|
523
|
+
lineUpDoubleRightDouble: "\u255A",
|
|
524
|
+
lineUpDoubleRight: "\u2559",
|
|
525
|
+
lineUpRightDouble: "\u2558",
|
|
526
|
+
lineUpDownLeft: "\u2524",
|
|
527
|
+
lineUpBoldDownBoldLeftBold: "\u252B",
|
|
528
|
+
lineUpBoldDownBoldLeft: "\u2528",
|
|
529
|
+
lineUpDownLeftBold: "\u2525",
|
|
530
|
+
lineUpBoldDownLeftBold: "\u2529",
|
|
531
|
+
lineUpDownBoldLeftBold: "\u252A",
|
|
532
|
+
lineUpDownBoldLeft: "\u2527",
|
|
533
|
+
lineUpBoldDownLeft: "\u2526",
|
|
534
|
+
lineUpDoubleDownDoubleLeftDouble: "\u2563",
|
|
535
|
+
lineUpDoubleDownDoubleLeft: "\u2562",
|
|
536
|
+
lineUpDownLeftDouble: "\u2561",
|
|
537
|
+
lineUpDownRight: "\u251C",
|
|
538
|
+
lineUpBoldDownBoldRightBold: "\u2523",
|
|
539
|
+
lineUpBoldDownBoldRight: "\u2520",
|
|
540
|
+
lineUpDownRightBold: "\u251D",
|
|
541
|
+
lineUpBoldDownRightBold: "\u2521",
|
|
542
|
+
lineUpDownBoldRightBold: "\u2522",
|
|
543
|
+
lineUpDownBoldRight: "\u251F",
|
|
544
|
+
lineUpBoldDownRight: "\u251E",
|
|
545
|
+
lineUpDoubleDownDoubleRightDouble: "\u2560",
|
|
546
|
+
lineUpDoubleDownDoubleRight: "\u255F",
|
|
547
|
+
lineUpDownRightDouble: "\u255E",
|
|
548
|
+
lineDownLeftRight: "\u252C",
|
|
549
|
+
lineDownBoldLeftBoldRightBold: "\u2533",
|
|
550
|
+
lineDownLeftBoldRightBold: "\u252F",
|
|
551
|
+
lineDownBoldLeftRight: "\u2530",
|
|
552
|
+
lineDownBoldLeftBoldRight: "\u2531",
|
|
553
|
+
lineDownBoldLeftRightBold: "\u2532",
|
|
554
|
+
lineDownLeftRightBold: "\u252E",
|
|
555
|
+
lineDownLeftBoldRight: "\u252D",
|
|
556
|
+
lineDownDoubleLeftDoubleRightDouble: "\u2566",
|
|
557
|
+
lineDownDoubleLeftRight: "\u2565",
|
|
558
|
+
lineDownLeftDoubleRightDouble: "\u2564",
|
|
559
|
+
lineUpLeftRight: "\u2534",
|
|
560
|
+
lineUpBoldLeftBoldRightBold: "\u253B",
|
|
561
|
+
lineUpLeftBoldRightBold: "\u2537",
|
|
562
|
+
lineUpBoldLeftRight: "\u2538",
|
|
563
|
+
lineUpBoldLeftBoldRight: "\u2539",
|
|
564
|
+
lineUpBoldLeftRightBold: "\u253A",
|
|
565
|
+
lineUpLeftRightBold: "\u2536",
|
|
566
|
+
lineUpLeftBoldRight: "\u2535",
|
|
567
|
+
lineUpDoubleLeftDoubleRightDouble: "\u2569",
|
|
568
|
+
lineUpDoubleLeftRight: "\u2568",
|
|
569
|
+
lineUpLeftDoubleRightDouble: "\u2567",
|
|
570
|
+
lineUpDownLeftRight: "\u253C",
|
|
571
|
+
lineUpBoldDownBoldLeftBoldRightBold: "\u254B",
|
|
572
|
+
lineUpDownBoldLeftBoldRightBold: "\u2548",
|
|
573
|
+
lineUpBoldDownLeftBoldRightBold: "\u2547",
|
|
574
|
+
lineUpBoldDownBoldLeftRightBold: "\u254A",
|
|
575
|
+
lineUpBoldDownBoldLeftBoldRight: "\u2549",
|
|
576
|
+
lineUpBoldDownLeftRight: "\u2540",
|
|
577
|
+
lineUpDownBoldLeftRight: "\u2541",
|
|
578
|
+
lineUpDownLeftBoldRight: "\u253D",
|
|
579
|
+
lineUpDownLeftRightBold: "\u253E",
|
|
580
|
+
lineUpBoldDownBoldLeftRight: "\u2542",
|
|
581
|
+
lineUpDownLeftBoldRightBold: "\u253F",
|
|
582
|
+
lineUpBoldDownLeftBoldRight: "\u2543",
|
|
583
|
+
lineUpBoldDownLeftRightBold: "\u2544",
|
|
584
|
+
lineUpDownBoldLeftBoldRight: "\u2545",
|
|
585
|
+
lineUpDownBoldLeftRightBold: "\u2546",
|
|
586
|
+
lineUpDoubleDownDoubleLeftDoubleRightDouble: "\u256C",
|
|
587
|
+
lineUpDoubleDownDoubleLeftRight: "\u256B",
|
|
588
|
+
lineUpDownLeftDoubleRightDouble: "\u256A",
|
|
589
|
+
lineCross: "\u2573",
|
|
590
|
+
lineBackslash: "\u2572",
|
|
591
|
+
lineSlash: "\u2571"
|
|
592
|
+
};
|
|
593
|
+
var specialMainSymbols = {
|
|
594
|
+
tick: "\u2714",
|
|
595
|
+
info: "\u2139",
|
|
596
|
+
warning: "\u26A0",
|
|
597
|
+
cross: "\u2718",
|
|
598
|
+
squareSmall: "\u25FB",
|
|
599
|
+
squareSmallFilled: "\u25FC",
|
|
600
|
+
circle: "\u25EF",
|
|
601
|
+
circleFilled: "\u25C9",
|
|
602
|
+
circleDotted: "\u25CC",
|
|
603
|
+
circleDouble: "\u25CE",
|
|
604
|
+
circleCircle: "\u24DE",
|
|
605
|
+
circleCross: "\u24E7",
|
|
606
|
+
circlePipe: "\u24BE",
|
|
607
|
+
radioOn: "\u25C9",
|
|
608
|
+
radioOff: "\u25EF",
|
|
609
|
+
checkboxOn: "\u2612",
|
|
610
|
+
checkboxOff: "\u2610",
|
|
611
|
+
checkboxCircleOn: "\u24E7",
|
|
612
|
+
checkboxCircleOff: "\u24BE",
|
|
613
|
+
pointer: "\u276F",
|
|
614
|
+
triangleUpOutline: "\u25B3",
|
|
615
|
+
triangleLeft: "\u25C0",
|
|
616
|
+
triangleRight: "\u25B6",
|
|
617
|
+
lozenge: "\u25C6",
|
|
618
|
+
lozengeOutline: "\u25C7",
|
|
619
|
+
hamburger: "\u2630",
|
|
620
|
+
smiley: "\u32E1",
|
|
621
|
+
mustache: "\u0DF4",
|
|
622
|
+
star: "\u2605",
|
|
623
|
+
play: "\u25B6",
|
|
624
|
+
nodejs: "\u2B22",
|
|
625
|
+
oneSeventh: "\u2150",
|
|
626
|
+
oneNinth: "\u2151",
|
|
627
|
+
oneTenth: "\u2152"
|
|
628
|
+
};
|
|
629
|
+
var specialFallbackSymbols = {
|
|
630
|
+
tick: "\u221A",
|
|
631
|
+
info: "i",
|
|
632
|
+
warning: "\u203C",
|
|
633
|
+
cross: "\xD7",
|
|
634
|
+
squareSmall: "\u25A1",
|
|
635
|
+
squareSmallFilled: "\u25A0",
|
|
636
|
+
circle: "( )",
|
|
637
|
+
circleFilled: "(*)",
|
|
638
|
+
circleDotted: "( )",
|
|
639
|
+
circleDouble: "( )",
|
|
640
|
+
circleCircle: "(\u25CB)",
|
|
641
|
+
circleCross: "(\xD7)",
|
|
642
|
+
circlePipe: "(\u2502)",
|
|
643
|
+
radioOn: "(*)",
|
|
644
|
+
radioOff: "( )",
|
|
645
|
+
checkboxOn: "[\xD7]",
|
|
646
|
+
checkboxOff: "[ ]",
|
|
647
|
+
checkboxCircleOn: "(\xD7)",
|
|
648
|
+
checkboxCircleOff: "( )",
|
|
649
|
+
pointer: ">",
|
|
650
|
+
triangleUpOutline: "\u2206",
|
|
651
|
+
triangleLeft: "\u25C4",
|
|
652
|
+
triangleRight: "\u25BA",
|
|
653
|
+
lozenge: "\u2666",
|
|
654
|
+
lozengeOutline: "\u25CA",
|
|
655
|
+
hamburger: "\u2261",
|
|
656
|
+
smiley: "\u263A",
|
|
657
|
+
mustache: "\u250C\u2500\u2510",
|
|
658
|
+
star: "\u2736",
|
|
659
|
+
play: "\u25BA",
|
|
660
|
+
nodejs: "\u2666",
|
|
661
|
+
oneSeventh: "1/7",
|
|
662
|
+
oneNinth: "1/9",
|
|
663
|
+
oneTenth: "1/10"
|
|
664
|
+
};
|
|
665
|
+
var mainSymbols = {
|
|
666
|
+
...common,
|
|
667
|
+
...specialMainSymbols
|
|
668
|
+
};
|
|
669
|
+
var fallbackSymbols = {
|
|
670
|
+
...common,
|
|
671
|
+
...specialFallbackSymbols
|
|
672
|
+
};
|
|
673
|
+
var shouldUseMain = isUnicodeSupported();
|
|
674
|
+
var figures = shouldUseMain ? mainSymbols : fallbackSymbols;
|
|
675
|
+
var dist_default = figures;
|
|
676
|
+
var replacements = Object.entries(specialMainSymbols);
|
|
677
|
+
|
|
678
|
+
// node_modules/@inquirer/core/dist/lib/theme.js
|
|
679
|
+
var defaultTheme = {
|
|
680
|
+
prefix: {
|
|
681
|
+
idle: styleText("blue", "?"),
|
|
682
|
+
done: styleText("green", dist_default.tick)
|
|
683
|
+
},
|
|
684
|
+
spinner: {
|
|
685
|
+
interval: 80,
|
|
686
|
+
frames: ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"].map((frame) => styleText("yellow", frame))
|
|
687
|
+
},
|
|
688
|
+
keybindings: [],
|
|
689
|
+
style: {
|
|
690
|
+
answer: (text) => styleText("cyan", text),
|
|
691
|
+
message: (text) => styleText("bold", text),
|
|
692
|
+
error: (text) => styleText("red", `> ${text}`),
|
|
693
|
+
defaultAnswer: (text) => styleText("dim", `(${text})`),
|
|
694
|
+
help: (text) => styleText("dim", text),
|
|
695
|
+
highlight: (text) => styleText("cyan", text),
|
|
696
|
+
key: (text) => styleText("cyan", styleText("bold", `<${text}>`))
|
|
697
|
+
}
|
|
698
|
+
};
|
|
699
|
+
function getDefaultTheme() {
|
|
700
|
+
return {
|
|
701
|
+
...defaultTheme,
|
|
702
|
+
keybindings: getDefaultKeybindings()
|
|
703
|
+
};
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
// node_modules/@inquirer/core/dist/lib/make-theme.js
|
|
707
|
+
function isPlainObject(value) {
|
|
708
|
+
if (typeof value !== "object" || value === null)
|
|
709
|
+
return false;
|
|
710
|
+
let proto = value;
|
|
711
|
+
while (Object.getPrototypeOf(proto) !== null) {
|
|
712
|
+
proto = Object.getPrototypeOf(proto);
|
|
713
|
+
}
|
|
714
|
+
return Object.getPrototypeOf(value) === proto;
|
|
715
|
+
}
|
|
716
|
+
function deepMerge(...objects) {
|
|
717
|
+
const output = {};
|
|
718
|
+
for (const obj of objects) {
|
|
719
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
720
|
+
const prevValue = output[key];
|
|
721
|
+
output[key] = isPlainObject(prevValue) && isPlainObject(value) ? deepMerge(prevValue, value) : value;
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
return output;
|
|
725
|
+
}
|
|
726
|
+
function makeTheme(...themes) {
|
|
727
|
+
const themesToMerge = [
|
|
728
|
+
getDefaultTheme(),
|
|
729
|
+
...themes.filter((theme) => theme != null)
|
|
730
|
+
];
|
|
731
|
+
return deepMerge(...themesToMerge);
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
// node_modules/@inquirer/core/dist/lib/use-prefix.js
|
|
735
|
+
function usePrefix({ status = "idle", theme }) {
|
|
736
|
+
const [showLoader, setShowLoader] = useState(false);
|
|
737
|
+
const [tick, setTick] = useState(0);
|
|
738
|
+
const { prefix, spinner } = makeTheme(theme);
|
|
739
|
+
useEffect(() => {
|
|
740
|
+
if (status === "loading") {
|
|
741
|
+
let tickInterval;
|
|
742
|
+
let inc = -1;
|
|
743
|
+
const delayTimeout = setTimeout(() => {
|
|
744
|
+
setShowLoader(true);
|
|
745
|
+
tickInterval = setInterval(() => {
|
|
746
|
+
inc = inc + 1;
|
|
747
|
+
setTick(inc % spinner.frames.length);
|
|
748
|
+
}, spinner.interval);
|
|
749
|
+
}, 300);
|
|
750
|
+
return () => {
|
|
751
|
+
clearTimeout(delayTimeout);
|
|
752
|
+
clearInterval(tickInterval);
|
|
753
|
+
};
|
|
754
|
+
} else {
|
|
755
|
+
setShowLoader(false);
|
|
756
|
+
}
|
|
757
|
+
}, [status]);
|
|
758
|
+
if (showLoader) {
|
|
759
|
+
return spinner.frames[tick];
|
|
760
|
+
}
|
|
761
|
+
const iconName = status === "loading" ? "idle" : status;
|
|
762
|
+
return typeof prefix === "string" ? prefix : prefix[iconName] ?? prefix["idle"];
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
// node_modules/@inquirer/core/dist/lib/use-memo.js
|
|
766
|
+
function useMemo(fn, dependencies) {
|
|
767
|
+
return withPointer((pointer) => {
|
|
768
|
+
const prev = pointer.get();
|
|
769
|
+
if (!pointer.initialized || prev.dependencies.length !== dependencies.length || prev.dependencies.some((dep, i) => dep !== dependencies[i])) {
|
|
770
|
+
const value = fn();
|
|
771
|
+
pointer.set({ value, dependencies });
|
|
772
|
+
return value;
|
|
773
|
+
}
|
|
774
|
+
return prev.value;
|
|
775
|
+
});
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
// node_modules/@inquirer/core/dist/lib/use-ref.js
|
|
779
|
+
function useRef(val) {
|
|
780
|
+
return useState({ current: val })[0];
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
// node_modules/@inquirer/core/dist/lib/use-keypress.js
|
|
784
|
+
function useKeypress(userHandler) {
|
|
785
|
+
const signal = useRef(userHandler);
|
|
786
|
+
signal.current = userHandler;
|
|
787
|
+
useEffect((rl) => {
|
|
788
|
+
let ignore = false;
|
|
789
|
+
const handler = withUpdates((_input, event) => {
|
|
790
|
+
if (ignore)
|
|
791
|
+
return;
|
|
792
|
+
void signal.current(event, rl);
|
|
793
|
+
});
|
|
794
|
+
rl.input.on("keypress", handler);
|
|
795
|
+
return () => {
|
|
796
|
+
ignore = true;
|
|
797
|
+
rl.input.removeListener("keypress", handler);
|
|
798
|
+
};
|
|
799
|
+
}, []);
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
// node_modules/@inquirer/core/dist/lib/utils.js
|
|
803
|
+
var import_cli_width = __toESM(require_cli_width(), 1);
|
|
804
|
+
|
|
805
|
+
// node_modules/fast-string-truncated-width/dist/utils.js
|
|
806
|
+
var getCodePointsLength = /* @__PURE__ */ (() => {
|
|
807
|
+
const SURROGATE_PAIR_RE = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
|
|
808
|
+
return (input) => {
|
|
809
|
+
let surrogatePairsNr = 0;
|
|
810
|
+
SURROGATE_PAIR_RE.lastIndex = 0;
|
|
811
|
+
while (SURROGATE_PAIR_RE.test(input)) {
|
|
812
|
+
surrogatePairsNr += 1;
|
|
813
|
+
}
|
|
814
|
+
return input.length - surrogatePairsNr;
|
|
815
|
+
};
|
|
816
|
+
})();
|
|
817
|
+
var isFullWidth = (x) => {
|
|
818
|
+
return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
|
|
819
|
+
};
|
|
820
|
+
var isWideNotCJKTNotEmoji = (x) => {
|
|
821
|
+
return x === 8987 || x === 9001 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12771 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 19903 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
|
|
822
|
+
};
|
|
823
|
+
|
|
824
|
+
// node_modules/fast-string-truncated-width/dist/index.js
|
|
825
|
+
var ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y;
|
|
826
|
+
var CONTROL_RE = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
|
|
827
|
+
var CJKT_WIDE_RE = /(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu;
|
|
828
|
+
var TAB_RE = /\t{1,1000}/y;
|
|
829
|
+
var EMOJI_RE = new RegExp("[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation}|\\p{Emoji}\\uFE0F\\u20E3?))*", "yu");
|
|
830
|
+
var LATIN_RE = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
|
|
831
|
+
var MODIFIER_RE = new RegExp("\\p{M}+", "gu");
|
|
832
|
+
var NO_TRUNCATION = { limit: Infinity, ellipsis: "" };
|
|
833
|
+
var getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {}) => {
|
|
834
|
+
const LIMIT = truncationOptions.limit ?? Infinity;
|
|
835
|
+
const ELLIPSIS = truncationOptions.ellipsis ?? "";
|
|
836
|
+
const ELLIPSIS_WIDTH = truncationOptions?.ellipsisWidth ?? (ELLIPSIS ? getStringTruncatedWidth(ELLIPSIS, NO_TRUNCATION, widthOptions).width : 0);
|
|
837
|
+
const ANSI_WIDTH = 0;
|
|
838
|
+
const CONTROL_WIDTH = widthOptions.controlWidth ?? 0;
|
|
839
|
+
const TAB_WIDTH = widthOptions.tabWidth ?? 8;
|
|
840
|
+
const EMOJI_WIDTH = widthOptions.emojiWidth ?? 2;
|
|
841
|
+
const FULL_WIDTH_WIDTH = 2;
|
|
842
|
+
const REGULAR_WIDTH = widthOptions.regularWidth ?? 1;
|
|
843
|
+
const WIDE_WIDTH = widthOptions.wideWidth ?? FULL_WIDTH_WIDTH;
|
|
844
|
+
const PARSE_BLOCKS = [
|
|
845
|
+
[LATIN_RE, REGULAR_WIDTH],
|
|
846
|
+
[ANSI_RE, ANSI_WIDTH],
|
|
847
|
+
[CONTROL_RE, CONTROL_WIDTH],
|
|
848
|
+
[TAB_RE, TAB_WIDTH],
|
|
849
|
+
[EMOJI_RE, EMOJI_WIDTH],
|
|
850
|
+
[CJKT_WIDE_RE, WIDE_WIDTH]
|
|
851
|
+
];
|
|
852
|
+
let indexPrev = 0;
|
|
853
|
+
let index = 0;
|
|
854
|
+
let length = input.length;
|
|
855
|
+
let lengthExtra = 0;
|
|
856
|
+
let truncationEnabled = false;
|
|
857
|
+
let truncationIndex = length;
|
|
858
|
+
let truncationLimit = Math.max(0, LIMIT - ELLIPSIS_WIDTH);
|
|
859
|
+
let unmatchedStart = 0;
|
|
860
|
+
let unmatchedEnd = 0;
|
|
861
|
+
let width = 0;
|
|
862
|
+
let widthExtra = 0;
|
|
863
|
+
outer: while (true) {
|
|
864
|
+
if (unmatchedEnd > unmatchedStart || index >= length && index > indexPrev) {
|
|
865
|
+
const unmatched = input.slice(unmatchedStart, unmatchedEnd) || input.slice(indexPrev, index);
|
|
866
|
+
lengthExtra = 0;
|
|
867
|
+
for (const char of unmatched.replaceAll(MODIFIER_RE, "")) {
|
|
868
|
+
const codePoint = char.codePointAt(0) || 0;
|
|
869
|
+
if (isFullWidth(codePoint)) {
|
|
870
|
+
widthExtra = FULL_WIDTH_WIDTH;
|
|
871
|
+
} else if (isWideNotCJKTNotEmoji(codePoint)) {
|
|
872
|
+
widthExtra = WIDE_WIDTH;
|
|
873
|
+
} else {
|
|
874
|
+
widthExtra = REGULAR_WIDTH;
|
|
875
|
+
}
|
|
876
|
+
if (width + widthExtra > truncationLimit) {
|
|
877
|
+
truncationIndex = Math.min(truncationIndex, Math.max(unmatchedStart, indexPrev) + lengthExtra);
|
|
878
|
+
}
|
|
879
|
+
if (width + widthExtra > LIMIT) {
|
|
880
|
+
truncationEnabled = true;
|
|
881
|
+
break outer;
|
|
882
|
+
}
|
|
883
|
+
lengthExtra += char.length;
|
|
884
|
+
width += widthExtra;
|
|
885
|
+
}
|
|
886
|
+
unmatchedStart = unmatchedEnd = 0;
|
|
887
|
+
}
|
|
888
|
+
if (index >= length) {
|
|
889
|
+
break outer;
|
|
890
|
+
}
|
|
891
|
+
for (let i = 0, l = PARSE_BLOCKS.length; i < l; i++) {
|
|
892
|
+
const [BLOCK_RE, BLOCK_WIDTH] = PARSE_BLOCKS[i];
|
|
893
|
+
BLOCK_RE.lastIndex = index;
|
|
894
|
+
if (BLOCK_RE.test(input)) {
|
|
895
|
+
lengthExtra = BLOCK_RE === CJKT_WIDE_RE ? getCodePointsLength(input.slice(index, BLOCK_RE.lastIndex)) : BLOCK_RE === EMOJI_RE ? 1 : BLOCK_RE.lastIndex - index;
|
|
896
|
+
widthExtra = lengthExtra * BLOCK_WIDTH;
|
|
897
|
+
if (width + widthExtra > truncationLimit) {
|
|
898
|
+
truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / BLOCK_WIDTH));
|
|
899
|
+
}
|
|
900
|
+
if (width + widthExtra > LIMIT) {
|
|
901
|
+
truncationEnabled = true;
|
|
902
|
+
break outer;
|
|
903
|
+
}
|
|
904
|
+
width += widthExtra;
|
|
905
|
+
unmatchedStart = indexPrev;
|
|
906
|
+
unmatchedEnd = index;
|
|
907
|
+
index = indexPrev = BLOCK_RE.lastIndex;
|
|
908
|
+
continue outer;
|
|
909
|
+
}
|
|
910
|
+
}
|
|
911
|
+
index += 1;
|
|
912
|
+
}
|
|
913
|
+
return {
|
|
914
|
+
width: truncationEnabled ? truncationLimit : width,
|
|
915
|
+
index: truncationEnabled ? truncationIndex : length,
|
|
916
|
+
truncated: truncationEnabled,
|
|
917
|
+
ellipsed: truncationEnabled && LIMIT >= ELLIPSIS_WIDTH
|
|
918
|
+
};
|
|
919
|
+
};
|
|
920
|
+
var dist_default2 = getStringTruncatedWidth;
|
|
921
|
+
|
|
922
|
+
// node_modules/fast-string-width/dist/index.js
|
|
923
|
+
var NO_TRUNCATION2 = {
|
|
924
|
+
limit: Infinity,
|
|
925
|
+
ellipsis: "",
|
|
926
|
+
ellipsisWidth: 0
|
|
927
|
+
};
|
|
928
|
+
var fastStringWidth = (input, options = {}) => {
|
|
929
|
+
return dist_default2(input, NO_TRUNCATION2, options).width;
|
|
930
|
+
};
|
|
931
|
+
var dist_default3 = fastStringWidth;
|
|
932
|
+
|
|
933
|
+
// node_modules/fast-wrap-ansi/lib/main.js
|
|
934
|
+
var ESC = "\x1B";
|
|
935
|
+
var CSI = "\x9B";
|
|
936
|
+
var END_CODE = 39;
|
|
937
|
+
var ANSI_ESCAPE_BELL = "\x07";
|
|
938
|
+
var ANSI_CSI = "[";
|
|
939
|
+
var ANSI_OSC = "]";
|
|
940
|
+
var ANSI_SGR_TERMINATOR = "m";
|
|
941
|
+
var ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;
|
|
942
|
+
var GROUP_REGEX = new RegExp(`(?:\\${ANSI_CSI}(?<code>\\d+)m|\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`, "y");
|
|
943
|
+
var getClosingCode = (openingCode) => {
|
|
944
|
+
if (openingCode >= 30 && openingCode <= 37)
|
|
945
|
+
return 39;
|
|
946
|
+
if (openingCode >= 90 && openingCode <= 97)
|
|
947
|
+
return 39;
|
|
948
|
+
if (openingCode >= 40 && openingCode <= 47)
|
|
949
|
+
return 49;
|
|
950
|
+
if (openingCode >= 100 && openingCode <= 107)
|
|
951
|
+
return 49;
|
|
952
|
+
if (openingCode === 1 || openingCode === 2)
|
|
953
|
+
return 22;
|
|
954
|
+
if (openingCode === 3)
|
|
955
|
+
return 23;
|
|
956
|
+
if (openingCode === 4)
|
|
957
|
+
return 24;
|
|
958
|
+
if (openingCode === 7)
|
|
959
|
+
return 27;
|
|
960
|
+
if (openingCode === 8)
|
|
961
|
+
return 28;
|
|
962
|
+
if (openingCode === 9)
|
|
963
|
+
return 29;
|
|
964
|
+
if (openingCode === 0)
|
|
965
|
+
return 0;
|
|
966
|
+
return void 0;
|
|
967
|
+
};
|
|
968
|
+
var wrapAnsiCode = (code) => `${ESC}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;
|
|
969
|
+
var wrapAnsiHyperlink = (url) => `${ESC}${ANSI_ESCAPE_LINK}${url}${ANSI_ESCAPE_BELL}`;
|
|
970
|
+
var wrapWord = (rows, word, columns) => {
|
|
971
|
+
const characters = word[Symbol.iterator]();
|
|
972
|
+
let isInsideEscape = false;
|
|
973
|
+
let isInsideLinkEscape = false;
|
|
974
|
+
let lastRow = rows.at(-1);
|
|
975
|
+
let visible = lastRow === void 0 ? 0 : dist_default3(lastRow);
|
|
976
|
+
let currentCharacter = characters.next();
|
|
977
|
+
let nextCharacter = characters.next();
|
|
978
|
+
let rawCharacterIndex = 0;
|
|
979
|
+
while (!currentCharacter.done) {
|
|
980
|
+
const character = currentCharacter.value;
|
|
981
|
+
const characterLength = dist_default3(character);
|
|
982
|
+
if (visible + characterLength <= columns) {
|
|
983
|
+
rows[rows.length - 1] += character;
|
|
984
|
+
} else {
|
|
985
|
+
rows.push(character);
|
|
986
|
+
visible = 0;
|
|
987
|
+
}
|
|
988
|
+
if (character === ESC || character === CSI) {
|
|
989
|
+
isInsideEscape = true;
|
|
990
|
+
isInsideLinkEscape = word.startsWith(ANSI_ESCAPE_LINK, rawCharacterIndex + 1);
|
|
991
|
+
}
|
|
992
|
+
if (isInsideEscape) {
|
|
993
|
+
if (isInsideLinkEscape) {
|
|
994
|
+
if (character === ANSI_ESCAPE_BELL) {
|
|
995
|
+
isInsideEscape = false;
|
|
996
|
+
isInsideLinkEscape = false;
|
|
997
|
+
}
|
|
998
|
+
} else if (character === ANSI_SGR_TERMINATOR) {
|
|
999
|
+
isInsideEscape = false;
|
|
1000
|
+
}
|
|
1001
|
+
} else {
|
|
1002
|
+
visible += characterLength;
|
|
1003
|
+
if (visible === columns && !nextCharacter.done) {
|
|
1004
|
+
rows.push("");
|
|
1005
|
+
visible = 0;
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
currentCharacter = nextCharacter;
|
|
1009
|
+
nextCharacter = characters.next();
|
|
1010
|
+
rawCharacterIndex += character.length;
|
|
1011
|
+
}
|
|
1012
|
+
lastRow = rows.at(-1);
|
|
1013
|
+
if (!visible && lastRow !== void 0 && lastRow.length && rows.length > 1) {
|
|
1014
|
+
rows[rows.length - 2] += rows.pop();
|
|
1015
|
+
}
|
|
1016
|
+
};
|
|
1017
|
+
var stringVisibleTrimSpacesRight = (string) => {
|
|
1018
|
+
const words = string.split(" ");
|
|
1019
|
+
let last = words.length;
|
|
1020
|
+
while (last) {
|
|
1021
|
+
if (dist_default3(words[last - 1])) {
|
|
1022
|
+
break;
|
|
1023
|
+
}
|
|
1024
|
+
last--;
|
|
1025
|
+
}
|
|
1026
|
+
if (last === words.length) {
|
|
1027
|
+
return string;
|
|
1028
|
+
}
|
|
1029
|
+
return words.slice(0, last).join(" ") + words.slice(last).join("");
|
|
1030
|
+
};
|
|
1031
|
+
var exec = (string, columns, options = {}) => {
|
|
1032
|
+
if (options.trim !== false && string.trim() === "") {
|
|
1033
|
+
return "";
|
|
1034
|
+
}
|
|
1035
|
+
let returnValue = "";
|
|
1036
|
+
let escapeCode;
|
|
1037
|
+
let escapeUrl;
|
|
1038
|
+
const words = string.split(" ");
|
|
1039
|
+
let rows = [""];
|
|
1040
|
+
let rowLength = 0;
|
|
1041
|
+
for (let index = 0; index < words.length; index++) {
|
|
1042
|
+
const word = words[index];
|
|
1043
|
+
if (options.trim !== false) {
|
|
1044
|
+
const row = rows.at(-1) ?? "";
|
|
1045
|
+
const trimmed = row.trimStart();
|
|
1046
|
+
if (row.length !== trimmed.length) {
|
|
1047
|
+
rows[rows.length - 1] = trimmed;
|
|
1048
|
+
rowLength = dist_default3(trimmed);
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
1051
|
+
if (index !== 0) {
|
|
1052
|
+
if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {
|
|
1053
|
+
rows.push("");
|
|
1054
|
+
rowLength = 0;
|
|
1055
|
+
}
|
|
1056
|
+
if (rowLength || options.trim === false) {
|
|
1057
|
+
rows[rows.length - 1] += " ";
|
|
1058
|
+
rowLength++;
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
1061
|
+
const wordLength = dist_default3(word);
|
|
1062
|
+
if (options.hard && wordLength > columns) {
|
|
1063
|
+
const remainingColumns = columns - rowLength;
|
|
1064
|
+
const breaksStartingThisLine = 1 + Math.floor((wordLength - remainingColumns - 1) / columns);
|
|
1065
|
+
const breaksStartingNextLine = Math.floor((wordLength - 1) / columns);
|
|
1066
|
+
if (breaksStartingNextLine < breaksStartingThisLine) {
|
|
1067
|
+
rows.push("");
|
|
1068
|
+
}
|
|
1069
|
+
wrapWord(rows, word, columns);
|
|
1070
|
+
rowLength = dist_default3(rows.at(-1) ?? "");
|
|
1071
|
+
continue;
|
|
1072
|
+
}
|
|
1073
|
+
if (rowLength + wordLength > columns && rowLength && wordLength) {
|
|
1074
|
+
if (options.wordWrap === false && rowLength < columns) {
|
|
1075
|
+
wrapWord(rows, word, columns);
|
|
1076
|
+
rowLength = dist_default3(rows.at(-1) ?? "");
|
|
1077
|
+
continue;
|
|
1078
|
+
}
|
|
1079
|
+
rows.push("");
|
|
1080
|
+
rowLength = 0;
|
|
1081
|
+
}
|
|
1082
|
+
if (rowLength + wordLength > columns && options.wordWrap === false) {
|
|
1083
|
+
wrapWord(rows, word, columns);
|
|
1084
|
+
rowLength = dist_default3(rows.at(-1) ?? "");
|
|
1085
|
+
continue;
|
|
1086
|
+
}
|
|
1087
|
+
rows[rows.length - 1] += word;
|
|
1088
|
+
rowLength += wordLength;
|
|
1089
|
+
}
|
|
1090
|
+
if (options.trim !== false) {
|
|
1091
|
+
rows = rows.map((row) => stringVisibleTrimSpacesRight(row));
|
|
1092
|
+
}
|
|
1093
|
+
const preString = rows.join("\n");
|
|
1094
|
+
let inSurrogate = false;
|
|
1095
|
+
for (let i = 0; i < preString.length; i++) {
|
|
1096
|
+
const character = preString[i];
|
|
1097
|
+
returnValue += character;
|
|
1098
|
+
if (!inSurrogate) {
|
|
1099
|
+
inSurrogate = character >= "\uD800" && character <= "\uDBFF";
|
|
1100
|
+
if (inSurrogate) {
|
|
1101
|
+
continue;
|
|
1102
|
+
}
|
|
1103
|
+
} else {
|
|
1104
|
+
inSurrogate = false;
|
|
1105
|
+
}
|
|
1106
|
+
if (character === ESC || character === CSI) {
|
|
1107
|
+
GROUP_REGEX.lastIndex = i + 1;
|
|
1108
|
+
const groupsResult = GROUP_REGEX.exec(preString);
|
|
1109
|
+
const groups = groupsResult?.groups;
|
|
1110
|
+
if (groups?.code !== void 0) {
|
|
1111
|
+
const code = Number.parseFloat(groups.code);
|
|
1112
|
+
escapeCode = code === END_CODE ? void 0 : code;
|
|
1113
|
+
} else if (groups?.uri !== void 0) {
|
|
1114
|
+
escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri;
|
|
1115
|
+
}
|
|
1116
|
+
}
|
|
1117
|
+
if (preString[i + 1] === "\n") {
|
|
1118
|
+
if (escapeUrl) {
|
|
1119
|
+
returnValue += wrapAnsiHyperlink("");
|
|
1120
|
+
}
|
|
1121
|
+
const closingCode = escapeCode ? getClosingCode(escapeCode) : void 0;
|
|
1122
|
+
if (escapeCode && closingCode) {
|
|
1123
|
+
returnValue += wrapAnsiCode(closingCode);
|
|
1124
|
+
}
|
|
1125
|
+
} else if (character === "\n") {
|
|
1126
|
+
if (escapeCode && getClosingCode(escapeCode)) {
|
|
1127
|
+
returnValue += wrapAnsiCode(escapeCode);
|
|
1128
|
+
}
|
|
1129
|
+
if (escapeUrl) {
|
|
1130
|
+
returnValue += wrapAnsiHyperlink(escapeUrl);
|
|
1131
|
+
}
|
|
1132
|
+
}
|
|
1133
|
+
}
|
|
1134
|
+
return returnValue;
|
|
1135
|
+
};
|
|
1136
|
+
var CRLF_OR_LF = /\r?\n/;
|
|
1137
|
+
function wrapAnsi(string, columns, options) {
|
|
1138
|
+
return String(string).normalize().split(CRLF_OR_LF).map((line) => exec(line, columns, options)).join("\n");
|
|
1139
|
+
}
|
|
1140
|
+
|
|
1141
|
+
// node_modules/@inquirer/core/dist/lib/utils.js
|
|
1142
|
+
function breakLines(content, width) {
|
|
1143
|
+
return content.split("\n").flatMap((line) => wrapAnsi(line, width, { trim: false, wordWrap: false }).split("\n").map((str) => str.trimEnd())).join("\n");
|
|
1144
|
+
}
|
|
1145
|
+
function readlineWidth() {
|
|
1146
|
+
return (0, import_cli_width.default)({ defaultWidth: 80, output: readline().output });
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1149
|
+
// node_modules/@inquirer/core/dist/lib/pagination/use-pagination.js
|
|
1150
|
+
function usePointerPosition({ active, renderedItems, pageSize, loop }) {
|
|
1151
|
+
const state = useRef({
|
|
1152
|
+
lastPointer: active,
|
|
1153
|
+
lastActive: void 0
|
|
1154
|
+
});
|
|
1155
|
+
const { lastPointer, lastActive } = state.current;
|
|
1156
|
+
const middle = Math.floor(pageSize / 2);
|
|
1157
|
+
const renderedLength = renderedItems.reduce((acc, item) => acc + item.length, 0);
|
|
1158
|
+
const defaultPointerPosition = renderedItems.slice(0, active).reduce((acc, item) => acc + item.length, 0);
|
|
1159
|
+
let pointer = defaultPointerPosition;
|
|
1160
|
+
if (renderedLength > pageSize) {
|
|
1161
|
+
if (loop) {
|
|
1162
|
+
pointer = lastPointer;
|
|
1163
|
+
if (
|
|
1164
|
+
// First render, skip this logic.
|
|
1165
|
+
lastActive != null && // Only move the pointer down when the user moves down.
|
|
1166
|
+
lastActive < active && // Check user didn't move up across page boundary.
|
|
1167
|
+
active - lastActive < pageSize
|
|
1168
|
+
) {
|
|
1169
|
+
pointer = Math.min(
|
|
1170
|
+
// Furthest allowed position for the pointer is the middle of the list
|
|
1171
|
+
middle,
|
|
1172
|
+
Math.abs(active - lastActive) === 1 ? Math.min(
|
|
1173
|
+
// Move the pointer at most the height of the last active item.
|
|
1174
|
+
lastPointer + (renderedItems[lastActive]?.length ?? 0),
|
|
1175
|
+
// If the user moved by one item, move the pointer to the natural position of the active item as
|
|
1176
|
+
// long as it doesn't move the cursor up.
|
|
1177
|
+
Math.max(defaultPointerPosition, lastPointer)
|
|
1178
|
+
) : (
|
|
1179
|
+
// Otherwise, move the pointer down by the difference between the active and last active item.
|
|
1180
|
+
lastPointer + active - lastActive
|
|
1181
|
+
)
|
|
1182
|
+
);
|
|
1183
|
+
}
|
|
1184
|
+
} else {
|
|
1185
|
+
const spaceUnderActive = renderedItems.slice(active).reduce((acc, item) => acc + item.length, 0);
|
|
1186
|
+
pointer = spaceUnderActive < pageSize - middle ? (
|
|
1187
|
+
// If the active item is near the end of the list, progressively move the cursor towards the end.
|
|
1188
|
+
pageSize - spaceUnderActive
|
|
1189
|
+
) : (
|
|
1190
|
+
// Otherwise, progressively move the pointer to the middle of the list.
|
|
1191
|
+
Math.min(defaultPointerPosition, middle)
|
|
1192
|
+
);
|
|
1193
|
+
}
|
|
1194
|
+
}
|
|
1195
|
+
state.current.lastPointer = pointer;
|
|
1196
|
+
state.current.lastActive = active;
|
|
1197
|
+
return pointer;
|
|
1198
|
+
}
|
|
1199
|
+
function usePagination({ items, active, renderItem, pageSize, loop = true }) {
|
|
1200
|
+
const width = readlineWidth();
|
|
1201
|
+
const bound = (num) => (num % items.length + items.length) % items.length;
|
|
1202
|
+
const renderedItems = items.map((item, index) => {
|
|
1203
|
+
if (item == null)
|
|
1204
|
+
return [];
|
|
1205
|
+
return breakLines(renderItem({ item, index, isActive: index === active }), width).split("\n");
|
|
1206
|
+
});
|
|
1207
|
+
const renderedLength = renderedItems.reduce((acc, item) => acc + item.length, 0);
|
|
1208
|
+
const renderItemAtIndex = (index) => renderedItems[index] ?? [];
|
|
1209
|
+
const pointer = usePointerPosition({ active, renderedItems, pageSize, loop });
|
|
1210
|
+
const activeItem = renderItemAtIndex(active).slice(0, pageSize);
|
|
1211
|
+
const activeItemPosition = pointer + activeItem.length <= pageSize ? pointer : pageSize - activeItem.length;
|
|
1212
|
+
const pageBuffer = Array.from({ length: pageSize });
|
|
1213
|
+
pageBuffer.splice(activeItemPosition, activeItem.length, ...activeItem);
|
|
1214
|
+
const itemVisited = /* @__PURE__ */ new Set([active]);
|
|
1215
|
+
let bufferPointer = activeItemPosition + activeItem.length;
|
|
1216
|
+
let itemPointer = bound(active + 1);
|
|
1217
|
+
while (bufferPointer < pageSize && !itemVisited.has(itemPointer) && (loop && renderedLength > pageSize ? itemPointer !== active : itemPointer > active)) {
|
|
1218
|
+
const lines = renderItemAtIndex(itemPointer);
|
|
1219
|
+
const linesToAdd = lines.slice(0, pageSize - bufferPointer);
|
|
1220
|
+
pageBuffer.splice(bufferPointer, linesToAdd.length, ...linesToAdd);
|
|
1221
|
+
itemVisited.add(itemPointer);
|
|
1222
|
+
bufferPointer += linesToAdd.length;
|
|
1223
|
+
itemPointer = bound(itemPointer + 1);
|
|
1224
|
+
}
|
|
1225
|
+
bufferPointer = activeItemPosition - 1;
|
|
1226
|
+
itemPointer = bound(active - 1);
|
|
1227
|
+
while (bufferPointer >= 0 && !itemVisited.has(itemPointer) && (loop && renderedLength > pageSize ? itemPointer !== active : itemPointer < active)) {
|
|
1228
|
+
const lines = renderItemAtIndex(itemPointer);
|
|
1229
|
+
const linesToAdd = lines.slice(Math.max(0, lines.length - bufferPointer - 1));
|
|
1230
|
+
pageBuffer.splice(bufferPointer - linesToAdd.length + 1, linesToAdd.length, ...linesToAdd);
|
|
1231
|
+
itemVisited.add(itemPointer);
|
|
1232
|
+
bufferPointer -= linesToAdd.length;
|
|
1233
|
+
itemPointer = bound(itemPointer - 1);
|
|
1234
|
+
}
|
|
1235
|
+
return pageBuffer.filter((line) => typeof line === "string").join("\n");
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1238
|
+
// node_modules/@inquirer/core/dist/lib/create-prompt.js
|
|
1239
|
+
var import_mute_stream = __toESM(require_lib(), 1);
|
|
1240
|
+
import * as readline2 from "node:readline";
|
|
1241
|
+
import { AsyncResource as AsyncResource3 } from "node:async_hooks";
|
|
1242
|
+
|
|
1243
|
+
// node_modules/signal-exit/dist/mjs/signals.js
|
|
1244
|
+
var signals = [];
|
|
1245
|
+
signals.push("SIGHUP", "SIGINT", "SIGTERM");
|
|
1246
|
+
if (process.platform !== "win32") {
|
|
1247
|
+
signals.push(
|
|
1248
|
+
"SIGALRM",
|
|
1249
|
+
"SIGABRT",
|
|
1250
|
+
"SIGVTALRM",
|
|
1251
|
+
"SIGXCPU",
|
|
1252
|
+
"SIGXFSZ",
|
|
1253
|
+
"SIGUSR2",
|
|
1254
|
+
"SIGTRAP",
|
|
1255
|
+
"SIGSYS",
|
|
1256
|
+
"SIGQUIT",
|
|
1257
|
+
"SIGIOT"
|
|
1258
|
+
// should detect profiler and enable/disable accordingly.
|
|
1259
|
+
// see #21
|
|
1260
|
+
// 'SIGPROF'
|
|
1261
|
+
);
|
|
1262
|
+
}
|
|
1263
|
+
if (process.platform === "linux") {
|
|
1264
|
+
signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");
|
|
1265
|
+
}
|
|
1266
|
+
|
|
1267
|
+
// node_modules/signal-exit/dist/mjs/index.js
|
|
1268
|
+
var processOk = (process4) => !!process4 && typeof process4 === "object" && typeof process4.removeListener === "function" && typeof process4.emit === "function" && typeof process4.reallyExit === "function" && typeof process4.listeners === "function" && typeof process4.kill === "function" && typeof process4.pid === "number" && typeof process4.on === "function";
|
|
1269
|
+
var kExitEmitter = /* @__PURE__ */ Symbol.for("signal-exit emitter");
|
|
1270
|
+
var global = globalThis;
|
|
1271
|
+
var ObjectDefineProperty = Object.defineProperty.bind(Object);
|
|
1272
|
+
var Emitter = class {
|
|
1273
|
+
emitted = {
|
|
1274
|
+
afterExit: false,
|
|
1275
|
+
exit: false
|
|
1276
|
+
};
|
|
1277
|
+
listeners = {
|
|
1278
|
+
afterExit: [],
|
|
1279
|
+
exit: []
|
|
1280
|
+
};
|
|
1281
|
+
count = 0;
|
|
1282
|
+
id = Math.random();
|
|
1283
|
+
constructor() {
|
|
1284
|
+
if (global[kExitEmitter]) {
|
|
1285
|
+
return global[kExitEmitter];
|
|
1286
|
+
}
|
|
1287
|
+
ObjectDefineProperty(global, kExitEmitter, {
|
|
1288
|
+
value: this,
|
|
1289
|
+
writable: false,
|
|
1290
|
+
enumerable: false,
|
|
1291
|
+
configurable: false
|
|
1292
|
+
});
|
|
1293
|
+
}
|
|
1294
|
+
on(ev, fn) {
|
|
1295
|
+
this.listeners[ev].push(fn);
|
|
1296
|
+
}
|
|
1297
|
+
removeListener(ev, fn) {
|
|
1298
|
+
const list = this.listeners[ev];
|
|
1299
|
+
const i = list.indexOf(fn);
|
|
1300
|
+
if (i === -1) {
|
|
1301
|
+
return;
|
|
1302
|
+
}
|
|
1303
|
+
if (i === 0 && list.length === 1) {
|
|
1304
|
+
list.length = 0;
|
|
1305
|
+
} else {
|
|
1306
|
+
list.splice(i, 1);
|
|
1307
|
+
}
|
|
1308
|
+
}
|
|
1309
|
+
emit(ev, code, signal) {
|
|
1310
|
+
if (this.emitted[ev]) {
|
|
1311
|
+
return false;
|
|
1312
|
+
}
|
|
1313
|
+
this.emitted[ev] = true;
|
|
1314
|
+
let ret = false;
|
|
1315
|
+
for (const fn of this.listeners[ev]) {
|
|
1316
|
+
ret = fn(code, signal) === true || ret;
|
|
1317
|
+
}
|
|
1318
|
+
if (ev === "exit") {
|
|
1319
|
+
ret = this.emit("afterExit", code, signal) || ret;
|
|
1320
|
+
}
|
|
1321
|
+
return ret;
|
|
1322
|
+
}
|
|
1323
|
+
};
|
|
1324
|
+
var SignalExitBase = class {
|
|
1325
|
+
};
|
|
1326
|
+
var signalExitWrap = (handler) => {
|
|
1327
|
+
return {
|
|
1328
|
+
onExit(cb, opts) {
|
|
1329
|
+
return handler.onExit(cb, opts);
|
|
1330
|
+
},
|
|
1331
|
+
load() {
|
|
1332
|
+
return handler.load();
|
|
1333
|
+
},
|
|
1334
|
+
unload() {
|
|
1335
|
+
return handler.unload();
|
|
1336
|
+
}
|
|
1337
|
+
};
|
|
1338
|
+
};
|
|
1339
|
+
var SignalExitFallback = class extends SignalExitBase {
|
|
1340
|
+
onExit() {
|
|
1341
|
+
return () => {
|
|
1342
|
+
};
|
|
1343
|
+
}
|
|
1344
|
+
load() {
|
|
1345
|
+
}
|
|
1346
|
+
unload() {
|
|
1347
|
+
}
|
|
1348
|
+
};
|
|
1349
|
+
var SignalExit = class extends SignalExitBase {
|
|
1350
|
+
// "SIGHUP" throws an `ENOSYS` error on Windows,
|
|
1351
|
+
// so use a supported signal instead
|
|
1352
|
+
/* c8 ignore start */
|
|
1353
|
+
#hupSig = process3.platform === "win32" ? "SIGINT" : "SIGHUP";
|
|
1354
|
+
/* c8 ignore stop */
|
|
1355
|
+
#emitter = new Emitter();
|
|
1356
|
+
#process;
|
|
1357
|
+
#originalProcessEmit;
|
|
1358
|
+
#originalProcessReallyExit;
|
|
1359
|
+
#sigListeners = {};
|
|
1360
|
+
#loaded = false;
|
|
1361
|
+
constructor(process4) {
|
|
1362
|
+
super();
|
|
1363
|
+
this.#process = process4;
|
|
1364
|
+
this.#sigListeners = {};
|
|
1365
|
+
for (const sig of signals) {
|
|
1366
|
+
this.#sigListeners[sig] = () => {
|
|
1367
|
+
const listeners = this.#process.listeners(sig);
|
|
1368
|
+
let { count } = this.#emitter;
|
|
1369
|
+
const p = process4;
|
|
1370
|
+
if (typeof p.__signal_exit_emitter__ === "object" && typeof p.__signal_exit_emitter__.count === "number") {
|
|
1371
|
+
count += p.__signal_exit_emitter__.count;
|
|
1372
|
+
}
|
|
1373
|
+
if (listeners.length === count) {
|
|
1374
|
+
this.unload();
|
|
1375
|
+
const ret = this.#emitter.emit("exit", null, sig);
|
|
1376
|
+
const s = sig === "SIGHUP" ? this.#hupSig : sig;
|
|
1377
|
+
if (!ret)
|
|
1378
|
+
process4.kill(process4.pid, s);
|
|
1379
|
+
}
|
|
1380
|
+
};
|
|
1381
|
+
}
|
|
1382
|
+
this.#originalProcessReallyExit = process4.reallyExit;
|
|
1383
|
+
this.#originalProcessEmit = process4.emit;
|
|
1384
|
+
}
|
|
1385
|
+
onExit(cb, opts) {
|
|
1386
|
+
if (!processOk(this.#process)) {
|
|
1387
|
+
return () => {
|
|
1388
|
+
};
|
|
1389
|
+
}
|
|
1390
|
+
if (this.#loaded === false) {
|
|
1391
|
+
this.load();
|
|
1392
|
+
}
|
|
1393
|
+
const ev = opts?.alwaysLast ? "afterExit" : "exit";
|
|
1394
|
+
this.#emitter.on(ev, cb);
|
|
1395
|
+
return () => {
|
|
1396
|
+
this.#emitter.removeListener(ev, cb);
|
|
1397
|
+
if (this.#emitter.listeners["exit"].length === 0 && this.#emitter.listeners["afterExit"].length === 0) {
|
|
1398
|
+
this.unload();
|
|
1399
|
+
}
|
|
1400
|
+
};
|
|
1401
|
+
}
|
|
1402
|
+
load() {
|
|
1403
|
+
if (this.#loaded) {
|
|
1404
|
+
return;
|
|
1405
|
+
}
|
|
1406
|
+
this.#loaded = true;
|
|
1407
|
+
this.#emitter.count += 1;
|
|
1408
|
+
for (const sig of signals) {
|
|
1409
|
+
try {
|
|
1410
|
+
const fn = this.#sigListeners[sig];
|
|
1411
|
+
if (fn)
|
|
1412
|
+
this.#process.on(sig, fn);
|
|
1413
|
+
} catch (_) {
|
|
1414
|
+
}
|
|
1415
|
+
}
|
|
1416
|
+
this.#process.emit = (ev, ...a) => {
|
|
1417
|
+
return this.#processEmit(ev, ...a);
|
|
1418
|
+
};
|
|
1419
|
+
this.#process.reallyExit = (code) => {
|
|
1420
|
+
return this.#processReallyExit(code);
|
|
1421
|
+
};
|
|
1422
|
+
}
|
|
1423
|
+
unload() {
|
|
1424
|
+
if (!this.#loaded) {
|
|
1425
|
+
return;
|
|
1426
|
+
}
|
|
1427
|
+
this.#loaded = false;
|
|
1428
|
+
signals.forEach((sig) => {
|
|
1429
|
+
const listener = this.#sigListeners[sig];
|
|
1430
|
+
if (!listener) {
|
|
1431
|
+
throw new Error("Listener not defined for signal: " + sig);
|
|
1432
|
+
}
|
|
1433
|
+
try {
|
|
1434
|
+
this.#process.removeListener(sig, listener);
|
|
1435
|
+
} catch (_) {
|
|
1436
|
+
}
|
|
1437
|
+
});
|
|
1438
|
+
this.#process.emit = this.#originalProcessEmit;
|
|
1439
|
+
this.#process.reallyExit = this.#originalProcessReallyExit;
|
|
1440
|
+
this.#emitter.count -= 1;
|
|
1441
|
+
}
|
|
1442
|
+
#processReallyExit(code) {
|
|
1443
|
+
if (!processOk(this.#process)) {
|
|
1444
|
+
return 0;
|
|
1445
|
+
}
|
|
1446
|
+
this.#process.exitCode = code || 0;
|
|
1447
|
+
this.#emitter.emit("exit", this.#process.exitCode, null);
|
|
1448
|
+
return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode);
|
|
1449
|
+
}
|
|
1450
|
+
#processEmit(ev, ...args) {
|
|
1451
|
+
const og = this.#originalProcessEmit;
|
|
1452
|
+
if (ev === "exit" && processOk(this.#process)) {
|
|
1453
|
+
if (typeof args[0] === "number") {
|
|
1454
|
+
this.#process.exitCode = args[0];
|
|
1455
|
+
}
|
|
1456
|
+
const ret = og.call(this.#process, ev, ...args);
|
|
1457
|
+
this.#emitter.emit("exit", this.#process.exitCode, null);
|
|
1458
|
+
return ret;
|
|
1459
|
+
} else {
|
|
1460
|
+
return og.call(this.#process, ev, ...args);
|
|
1461
|
+
}
|
|
1462
|
+
}
|
|
1463
|
+
};
|
|
1464
|
+
var process3 = globalThis.process;
|
|
1465
|
+
var {
|
|
1466
|
+
/**
|
|
1467
|
+
* Called when the process is exiting, whether via signal, explicit
|
|
1468
|
+
* exit, or running out of stuff to do.
|
|
1469
|
+
*
|
|
1470
|
+
* If the global process object is not suitable for instrumentation,
|
|
1471
|
+
* then this will be a no-op.
|
|
1472
|
+
*
|
|
1473
|
+
* Returns a function that may be used to unload signal-exit.
|
|
1474
|
+
*/
|
|
1475
|
+
onExit,
|
|
1476
|
+
/**
|
|
1477
|
+
* Load the listeners. Likely you never need to call this, unless
|
|
1478
|
+
* doing a rather deep integration with signal-exit functionality.
|
|
1479
|
+
* Mostly exposed for the benefit of testing.
|
|
1480
|
+
*
|
|
1481
|
+
* @internal
|
|
1482
|
+
*/
|
|
1483
|
+
load,
|
|
1484
|
+
/**
|
|
1485
|
+
* Unload the listeners. Likely you never need to call this, unless
|
|
1486
|
+
* doing a rather deep integration with signal-exit functionality.
|
|
1487
|
+
* Mostly exposed for the benefit of testing.
|
|
1488
|
+
*
|
|
1489
|
+
* @internal
|
|
1490
|
+
*/
|
|
1491
|
+
unload
|
|
1492
|
+
} = signalExitWrap(processOk(process3) ? new SignalExit(process3) : new SignalExitFallback());
|
|
1493
|
+
|
|
1494
|
+
// node_modules/@inquirer/core/dist/lib/screen-manager.js
|
|
1495
|
+
import { stripVTControlCharacters } from "node:util";
|
|
1496
|
+
|
|
1497
|
+
// node_modules/@inquirer/ansi/dist/index.js
|
|
1498
|
+
var ESC2 = "\x1B[";
|
|
1499
|
+
var cursorLeft = ESC2 + "G";
|
|
1500
|
+
var cursorHide = ESC2 + "?25l";
|
|
1501
|
+
var cursorShow = ESC2 + "?25h";
|
|
1502
|
+
var cursorUp = (rows = 1) => rows > 0 ? `${ESC2}${rows}A` : "";
|
|
1503
|
+
var cursorDown = (rows = 1) => rows > 0 ? `${ESC2}${rows}B` : "";
|
|
1504
|
+
var cursorTo = (x, y) => {
|
|
1505
|
+
if (typeof y === "number" && !Number.isNaN(y)) {
|
|
1506
|
+
return `${ESC2}${y + 1};${x + 1}H`;
|
|
1507
|
+
}
|
|
1508
|
+
return `${ESC2}${x + 1}G`;
|
|
1509
|
+
};
|
|
1510
|
+
var eraseLine = ESC2 + "2K";
|
|
1511
|
+
var eraseLines = (lines) => lines > 0 ? (eraseLine + cursorUp(1)).repeat(lines - 1) + eraseLine + cursorLeft : "";
|
|
1512
|
+
|
|
1513
|
+
// node_modules/@inquirer/core/dist/lib/screen-manager.js
|
|
1514
|
+
var height = (content) => content.split("\n").length;
|
|
1515
|
+
var lastLine = (content) => content.split("\n").pop() ?? "";
|
|
1516
|
+
var ScreenManager = class {
|
|
1517
|
+
// These variables are keeping information to allow correct prompt re-rendering
|
|
1518
|
+
height = 0;
|
|
1519
|
+
extraLinesUnderPrompt = 0;
|
|
1520
|
+
cursorPos;
|
|
1521
|
+
rl;
|
|
1522
|
+
constructor(rl) {
|
|
1523
|
+
this.rl = rl;
|
|
1524
|
+
this.cursorPos = rl.getCursorPos();
|
|
1525
|
+
}
|
|
1526
|
+
write(content) {
|
|
1527
|
+
this.rl.output.unmute();
|
|
1528
|
+
this.rl.output.write(content);
|
|
1529
|
+
this.rl.output.mute();
|
|
1530
|
+
}
|
|
1531
|
+
render(content, bottomContent = "") {
|
|
1532
|
+
const promptLine = lastLine(content);
|
|
1533
|
+
const rawPromptLine = stripVTControlCharacters(promptLine);
|
|
1534
|
+
let prompt = rawPromptLine;
|
|
1535
|
+
if (this.rl.line.length > 0) {
|
|
1536
|
+
prompt = prompt.slice(0, -this.rl.line.length);
|
|
1537
|
+
}
|
|
1538
|
+
this.rl.setPrompt(prompt);
|
|
1539
|
+
this.cursorPos = this.rl.getCursorPos();
|
|
1540
|
+
const width = readlineWidth();
|
|
1541
|
+
content = breakLines(content, width);
|
|
1542
|
+
bottomContent = breakLines(bottomContent, width);
|
|
1543
|
+
if (rawPromptLine.length % width === 0) {
|
|
1544
|
+
content += "\n";
|
|
1545
|
+
}
|
|
1546
|
+
let output = content + (bottomContent ? "\n" + bottomContent : "");
|
|
1547
|
+
const promptLineUpDiff = Math.floor(rawPromptLine.length / width) - this.cursorPos.rows;
|
|
1548
|
+
const bottomContentHeight = promptLineUpDiff + (bottomContent ? height(bottomContent) : 0);
|
|
1549
|
+
if (bottomContentHeight > 0)
|
|
1550
|
+
output += cursorUp(bottomContentHeight);
|
|
1551
|
+
output += cursorTo(this.cursorPos.cols);
|
|
1552
|
+
this.write(cursorDown(this.extraLinesUnderPrompt) + eraseLines(this.height) + output);
|
|
1553
|
+
this.extraLinesUnderPrompt = bottomContentHeight;
|
|
1554
|
+
this.height = height(output);
|
|
1555
|
+
}
|
|
1556
|
+
checkCursorPos() {
|
|
1557
|
+
const cursorPos = this.rl.getCursorPos();
|
|
1558
|
+
if (cursorPos.cols !== this.cursorPos.cols) {
|
|
1559
|
+
this.write(cursorTo(cursorPos.cols));
|
|
1560
|
+
this.cursorPos = cursorPos;
|
|
1561
|
+
}
|
|
1562
|
+
}
|
|
1563
|
+
done({ clearContent }) {
|
|
1564
|
+
this.rl.setPrompt("");
|
|
1565
|
+
let output = cursorDown(this.extraLinesUnderPrompt);
|
|
1566
|
+
output += clearContent ? eraseLines(this.height) : "\n";
|
|
1567
|
+
output += cursorLeft;
|
|
1568
|
+
output += cursorShow;
|
|
1569
|
+
this.write(output);
|
|
1570
|
+
this.rl.close();
|
|
1571
|
+
}
|
|
1572
|
+
};
|
|
1573
|
+
|
|
1574
|
+
// node_modules/@inquirer/core/dist/lib/promise-polyfill.js
|
|
1575
|
+
var PromisePolyfill = class extends Promise {
|
|
1576
|
+
// Available starting from Node 22
|
|
1577
|
+
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/withResolvers
|
|
1578
|
+
static withResolver() {
|
|
1579
|
+
let resolve;
|
|
1580
|
+
let reject;
|
|
1581
|
+
const promise = new Promise((res, rej) => {
|
|
1582
|
+
resolve = res;
|
|
1583
|
+
reject = rej;
|
|
1584
|
+
});
|
|
1585
|
+
return { promise, resolve, reject };
|
|
1586
|
+
}
|
|
1587
|
+
};
|
|
1588
|
+
|
|
1589
|
+
// node_modules/@inquirer/core/dist/lib/create-prompt.js
|
|
1590
|
+
import path from "node:path";
|
|
1591
|
+
var nativeSetImmediate = globalThis.setImmediate;
|
|
1592
|
+
function listenTo(target, event, listener) {
|
|
1593
|
+
if ("on" in target) {
|
|
1594
|
+
target.on(event, listener);
|
|
1595
|
+
return () => target.removeListener(event, listener);
|
|
1596
|
+
}
|
|
1597
|
+
target.addEventListener(event, listener);
|
|
1598
|
+
return () => target.removeEventListener(event, listener);
|
|
1599
|
+
}
|
|
1600
|
+
function getCallSites() {
|
|
1601
|
+
const savedPrepareStackTrace = Error.prepareStackTrace;
|
|
1602
|
+
let result = [];
|
|
1603
|
+
try {
|
|
1604
|
+
Error.prepareStackTrace = (_, callSites) => {
|
|
1605
|
+
const callSitesWithoutCurrent = callSites.slice(1);
|
|
1606
|
+
result = callSitesWithoutCurrent;
|
|
1607
|
+
return callSitesWithoutCurrent;
|
|
1608
|
+
};
|
|
1609
|
+
new Error().stack;
|
|
1610
|
+
} catch {
|
|
1611
|
+
return result;
|
|
1612
|
+
}
|
|
1613
|
+
Error.prepareStackTrace = savedPrepareStackTrace;
|
|
1614
|
+
return result;
|
|
1615
|
+
}
|
|
1616
|
+
function createPrompt(view) {
|
|
1617
|
+
const callSites = getCallSites();
|
|
1618
|
+
const prompt = (config, context = {}) => {
|
|
1619
|
+
const { input = process.stdin, signal } = context;
|
|
1620
|
+
const cleanups = /* @__PURE__ */ new Set();
|
|
1621
|
+
const output = new import_mute_stream.default();
|
|
1622
|
+
output.pipe(context.output ?? process.stdout);
|
|
1623
|
+
const rl = readline2.createInterface({
|
|
1624
|
+
terminal: true,
|
|
1625
|
+
input,
|
|
1626
|
+
output
|
|
1627
|
+
});
|
|
1628
|
+
output.mute();
|
|
1629
|
+
const screen = new ScreenManager(rl);
|
|
1630
|
+
const { promise, resolve, reject } = PromisePolyfill.withResolver();
|
|
1631
|
+
return withHooks(rl, (cycle) => {
|
|
1632
|
+
const clearEffects = AsyncResource3.bind(() => effectScheduler.clearAll());
|
|
1633
|
+
const settlePrompt = (settle) => {
|
|
1634
|
+
try {
|
|
1635
|
+
clearEffects();
|
|
1636
|
+
settle();
|
|
1637
|
+
} catch (error) {
|
|
1638
|
+
reject(error);
|
|
1639
|
+
}
|
|
1640
|
+
};
|
|
1641
|
+
const resolvePrompt = (value) => settlePrompt(() => resolve(value));
|
|
1642
|
+
const rejectPrompt = (error) => settlePrompt(() => reject(error));
|
|
1643
|
+
const promptPromise = Object.assign(promise.finally(() => {
|
|
1644
|
+
cleanups.forEach((cleanup) => cleanup());
|
|
1645
|
+
screen.done({ clearContent: Boolean(context.clearPromptOnDone) });
|
|
1646
|
+
output.end();
|
|
1647
|
+
}).then(() => promise), { cancel: () => rejectPrompt(new CancelPromptError()) });
|
|
1648
|
+
if (signal) {
|
|
1649
|
+
const abort = () => rejectPrompt(new AbortPromptError({ cause: signal.reason }));
|
|
1650
|
+
if (signal.aborted) {
|
|
1651
|
+
abort();
|
|
1652
|
+
return promptPromise;
|
|
1653
|
+
}
|
|
1654
|
+
cleanups.add(listenTo(signal, "abort", abort));
|
|
1655
|
+
}
|
|
1656
|
+
cleanups.add(onExit((code, signal2) => {
|
|
1657
|
+
rejectPrompt(new ExitPromptError(`User force closed the prompt with ${code} ${signal2}`));
|
|
1658
|
+
}));
|
|
1659
|
+
cleanups.add(listenTo(rl, "SIGINT", () => rejectPrompt(new ExitPromptError(`User force closed the prompt with SIGINT`))));
|
|
1660
|
+
cleanups.add(listenTo(rl, "close", clearEffects));
|
|
1661
|
+
const startCycle = () => {
|
|
1662
|
+
cleanups.add(listenTo(rl.input, "keypress", () => screen.checkCursorPos()));
|
|
1663
|
+
let pendingDone = null;
|
|
1664
|
+
cycle(() => {
|
|
1665
|
+
let effectsSettled = false;
|
|
1666
|
+
try {
|
|
1667
|
+
const nextView = view(config, (value) => {
|
|
1668
|
+
if (effectsSettled) {
|
|
1669
|
+
resolvePrompt(value);
|
|
1670
|
+
} else {
|
|
1671
|
+
pendingDone = { value };
|
|
1672
|
+
}
|
|
1673
|
+
});
|
|
1674
|
+
if (nextView === void 0) {
|
|
1675
|
+
let callerFilename = callSites[1]?.getFileName();
|
|
1676
|
+
if (callerFilename && !callerFilename.startsWith("file://")) {
|
|
1677
|
+
callerFilename = path.resolve(callerFilename);
|
|
1678
|
+
}
|
|
1679
|
+
throw new Error(`Prompt functions must return a string.
|
|
1680
|
+
at ${callerFilename}`);
|
|
1681
|
+
}
|
|
1682
|
+
const [content, bottomContent] = typeof nextView === "string" ? [nextView] : nextView;
|
|
1683
|
+
screen.render(content, bottomContent);
|
|
1684
|
+
effectScheduler.run();
|
|
1685
|
+
} catch (error) {
|
|
1686
|
+
rejectPrompt(error);
|
|
1687
|
+
}
|
|
1688
|
+
effectsSettled = true;
|
|
1689
|
+
if (pendingDone !== null) {
|
|
1690
|
+
const { value } = pendingDone;
|
|
1691
|
+
pendingDone = null;
|
|
1692
|
+
resolvePrompt(value);
|
|
1693
|
+
}
|
|
1694
|
+
});
|
|
1695
|
+
};
|
|
1696
|
+
if ("readableFlowing" in input) {
|
|
1697
|
+
nativeSetImmediate(startCycle);
|
|
1698
|
+
} else {
|
|
1699
|
+
startCycle();
|
|
1700
|
+
}
|
|
1701
|
+
return promptPromise;
|
|
1702
|
+
});
|
|
1703
|
+
};
|
|
1704
|
+
return prompt;
|
|
1705
|
+
}
|
|
1706
|
+
|
|
1707
|
+
// node_modules/@inquirer/core/dist/lib/Separator.js
|
|
1708
|
+
import { styleText as styleText2 } from "node:util";
|
|
1709
|
+
var Separator = class {
|
|
1710
|
+
separator = styleText2("dim", Array.from({ length: 15 }).join(dist_default.line));
|
|
1711
|
+
type = "separator";
|
|
1712
|
+
constructor(separator) {
|
|
1713
|
+
if (separator) {
|
|
1714
|
+
this.separator = separator;
|
|
1715
|
+
}
|
|
1716
|
+
}
|
|
1717
|
+
static isSeparator(choice) {
|
|
1718
|
+
return Boolean(choice && typeof choice === "object" && "type" in choice && choice.type === "separator");
|
|
1719
|
+
}
|
|
1720
|
+
};
|
|
1721
|
+
|
|
1722
|
+
// node_modules/@inquirer/confirm/dist/index.js
|
|
1723
|
+
import { styleText as styleText3 } from "node:util";
|
|
1724
|
+
var confirmTheme = {
|
|
1725
|
+
keywords: {
|
|
1726
|
+
yes: "Yes",
|
|
1727
|
+
no: "No"
|
|
1728
|
+
},
|
|
1729
|
+
style: {
|
|
1730
|
+
confirmDefault: (text) => {
|
|
1731
|
+
const first = text[0] ?? "";
|
|
1732
|
+
if (first.toLowerCase() === first.toUpperCase()) {
|
|
1733
|
+
return styleText3("cyan", text);
|
|
1734
|
+
}
|
|
1735
|
+
return first.toUpperCase() + text.slice(1);
|
|
1736
|
+
}
|
|
1737
|
+
}
|
|
1738
|
+
};
|
|
1739
|
+
var dist_default4 = createPrompt((config, done) => {
|
|
1740
|
+
const [status, setStatus] = useState("idle");
|
|
1741
|
+
const [value, setValue] = useState("");
|
|
1742
|
+
const theme = makeTheme(confirmTheme, config.theme);
|
|
1743
|
+
const prefix = usePrefix({ status, theme });
|
|
1744
|
+
const { yes, no } = theme.keywords;
|
|
1745
|
+
const yesHint = (yes[0] ?? "").toLowerCase();
|
|
1746
|
+
const noHint = (no[0] ?? "").toLowerCase();
|
|
1747
|
+
const hint = config.default === false ? `${yesHint}/${theme.style.confirmDefault(noHint)}` : `${theme.style.confirmDefault(yesHint)}/${noHint}`;
|
|
1748
|
+
function boolToString(value2) {
|
|
1749
|
+
return value2 ? yes : no;
|
|
1750
|
+
}
|
|
1751
|
+
const { transformer = boolToString } = config;
|
|
1752
|
+
function getBooleanValue(value2, defaultValue2) {
|
|
1753
|
+
const v = value2.trim().toLowerCase();
|
|
1754
|
+
if (v === "")
|
|
1755
|
+
return defaultValue2 !== false;
|
|
1756
|
+
if (yes.toLowerCase().startsWith(v))
|
|
1757
|
+
return true;
|
|
1758
|
+
if (no.toLowerCase().startsWith(v))
|
|
1759
|
+
return false;
|
|
1760
|
+
return defaultValue2 !== false;
|
|
1761
|
+
}
|
|
1762
|
+
useKeypress((key, rl) => {
|
|
1763
|
+
if (status !== "idle")
|
|
1764
|
+
return;
|
|
1765
|
+
if (isEnterKey(key)) {
|
|
1766
|
+
const answer = getBooleanValue(value, config.default);
|
|
1767
|
+
setValue(transformer(answer));
|
|
1768
|
+
setStatus("done");
|
|
1769
|
+
done(answer);
|
|
1770
|
+
} else if (isTabKey(key)) {
|
|
1771
|
+
const answer = boolToString(!getBooleanValue(value, config.default));
|
|
1772
|
+
rl.clearLine(0);
|
|
1773
|
+
rl.write(answer);
|
|
1774
|
+
setValue(answer);
|
|
1775
|
+
} else {
|
|
1776
|
+
setValue(rl.line);
|
|
1777
|
+
}
|
|
1778
|
+
});
|
|
1779
|
+
let formattedValue = value;
|
|
1780
|
+
let defaultValue = "";
|
|
1781
|
+
if (status === "done") {
|
|
1782
|
+
formattedValue = theme.style.answer(value);
|
|
1783
|
+
} else {
|
|
1784
|
+
defaultValue = ` ${theme.style.defaultAnswer(hint)}`;
|
|
1785
|
+
}
|
|
1786
|
+
const message = theme.style.message(config.message, status);
|
|
1787
|
+
return `${prefix} ${message}${defaultValue} ${formattedValue}`;
|
|
1788
|
+
});
|
|
1789
|
+
|
|
1790
|
+
// src/cli/utils/interactive.ts
|
|
1791
|
+
function isNonInteractive() {
|
|
1792
|
+
return !process.stdin.isTTY;
|
|
1793
|
+
}
|
|
1794
|
+
|
|
1795
|
+
// src/cli/commands/mcp-setup.ts
|
|
1796
|
+
var MCP_COMMAND = "npx";
|
|
1797
|
+
var MCP_ARGS = ["@synergenius/flow-weaver@latest", "mcp-server", "--stdio"];
|
|
1798
|
+
var MCP_ENTRY = { command: MCP_COMMAND, args: [...MCP_ARGS] };
|
|
1799
|
+
var CLI_TOOL_IDS = /* @__PURE__ */ new Set(["claude", "codex"]);
|
|
1800
|
+
var CLI_TOOL_BINARY = {
|
|
1801
|
+
claude: "claude",
|
|
1802
|
+
codex: "codex"
|
|
1803
|
+
};
|
|
1804
|
+
function defaultDeps() {
|
|
1805
|
+
return {
|
|
1806
|
+
execCommand: async (cmd) => {
|
|
1807
|
+
try {
|
|
1808
|
+
const stdout = execSync(cmd, { encoding: "utf8", stdio: ["pipe", "pipe", "pipe"] });
|
|
1809
|
+
return { stdout: stdout.trim(), exitCode: 0 };
|
|
1810
|
+
} catch {
|
|
1811
|
+
return { stdout: "", exitCode: 1 };
|
|
1812
|
+
}
|
|
1813
|
+
},
|
|
1814
|
+
fileExists: async (filePath) => {
|
|
1815
|
+
try {
|
|
1816
|
+
await fs.promises.access(filePath);
|
|
1817
|
+
return true;
|
|
1818
|
+
} catch {
|
|
1819
|
+
return false;
|
|
1820
|
+
}
|
|
1821
|
+
},
|
|
1822
|
+
readFile: async (filePath) => {
|
|
1823
|
+
try {
|
|
1824
|
+
return await fs.promises.readFile(filePath, "utf8");
|
|
1825
|
+
} catch {
|
|
1826
|
+
return null;
|
|
1827
|
+
}
|
|
1828
|
+
},
|
|
1829
|
+
writeFile: async (filePath, content) => {
|
|
1830
|
+
await fs.promises.writeFile(filePath, content, "utf8");
|
|
1831
|
+
},
|
|
1832
|
+
mkdir: async (dirPath) => {
|
|
1833
|
+
await fs.promises.mkdir(dirPath, { recursive: true });
|
|
1834
|
+
},
|
|
1835
|
+
cwd: () => process.cwd(),
|
|
1836
|
+
homedir: () => os.homedir(),
|
|
1837
|
+
log: (msg) => process.stdout.write(msg + "\n")
|
|
1838
|
+
};
|
|
1839
|
+
}
|
|
1840
|
+
function whichCmd(binary) {
|
|
1841
|
+
return process.platform === "win32" ? `where ${binary}` : `which ${binary}`;
|
|
1842
|
+
}
|
|
1843
|
+
async function binaryExists(binary, deps) {
|
|
1844
|
+
const result = await deps.execCommand(whichCmd(binary));
|
|
1845
|
+
return result.exitCode === 0;
|
|
1846
|
+
}
|
|
1847
|
+
async function mergeJsonConfig(deps, filePath, rootKey) {
|
|
1848
|
+
const existing = await deps.readFile(filePath);
|
|
1849
|
+
if (existing === null) {
|
|
1850
|
+
const dir = path2.dirname(filePath);
|
|
1851
|
+
await deps.mkdir(dir);
|
|
1852
|
+
const config2 = { [rootKey]: { "flow-weaver": MCP_ENTRY } };
|
|
1853
|
+
await deps.writeFile(filePath, JSON.stringify(config2, null, 2) + "\n");
|
|
1854
|
+
return { action: "created", detail: `created ${filePath}` };
|
|
1855
|
+
}
|
|
1856
|
+
let config;
|
|
1857
|
+
try {
|
|
1858
|
+
config = JSON.parse(existing);
|
|
1859
|
+
} catch {
|
|
1860
|
+
throw new Error(`invalid JSON in ${filePath}`);
|
|
1861
|
+
}
|
|
1862
|
+
if (!config[rootKey] || typeof config[rootKey] !== "object") {
|
|
1863
|
+
config[rootKey] = {};
|
|
1864
|
+
}
|
|
1865
|
+
const servers = config[rootKey];
|
|
1866
|
+
if (servers["flow-weaver"]) {
|
|
1867
|
+
return { action: "already-configured", detail: `already in ${filePath}` };
|
|
1868
|
+
}
|
|
1869
|
+
servers["flow-weaver"] = MCP_ENTRY;
|
|
1870
|
+
await deps.writeFile(filePath, JSON.stringify(config, null, 2) + "\n");
|
|
1871
|
+
return { action: "added", detail: `added to ${filePath}` };
|
|
1872
|
+
}
|
|
1873
|
+
var TOOL_REGISTRY = [
|
|
1874
|
+
// Claude Code
|
|
1875
|
+
{
|
|
1876
|
+
id: "claude",
|
|
1877
|
+
displayName: "Claude Code",
|
|
1878
|
+
detect: (deps) => binaryExists("claude", deps),
|
|
1879
|
+
isConfigured: async (deps) => {
|
|
1880
|
+
const result = await deps.execCommand("claude mcp list");
|
|
1881
|
+
return result.exitCode === 0 && result.stdout.includes("flow-weaver");
|
|
1882
|
+
},
|
|
1883
|
+
configure: async (deps) => {
|
|
1884
|
+
const cmd = `claude mcp add --scope project flow-weaver -- ${MCP_COMMAND} ${MCP_ARGS.join(" ")}`;
|
|
1885
|
+
const result = await deps.execCommand(cmd);
|
|
1886
|
+
if (result.exitCode !== 0) {
|
|
1887
|
+
throw new Error("claude mcp add failed");
|
|
1888
|
+
}
|
|
1889
|
+
return "registered via claude mcp add";
|
|
1890
|
+
}
|
|
1891
|
+
},
|
|
1892
|
+
// Cursor
|
|
1893
|
+
{
|
|
1894
|
+
id: "cursor",
|
|
1895
|
+
displayName: "Cursor",
|
|
1896
|
+
detect: async (deps) => {
|
|
1897
|
+
const dirExists = await deps.fileExists(path2.join(deps.cwd(), ".cursor"));
|
|
1898
|
+
if (dirExists) return true;
|
|
1899
|
+
return binaryExists("cursor", deps);
|
|
1900
|
+
},
|
|
1901
|
+
isConfigured: async (deps) => {
|
|
1902
|
+
const filePath = path2.join(deps.cwd(), ".cursor", "mcp.json");
|
|
1903
|
+
const content = await deps.readFile(filePath);
|
|
1904
|
+
if (!content) return false;
|
|
1905
|
+
try {
|
|
1906
|
+
const config = JSON.parse(content);
|
|
1907
|
+
return !!config?.mcpServers?.["flow-weaver"];
|
|
1908
|
+
} catch {
|
|
1909
|
+
return false;
|
|
1910
|
+
}
|
|
1911
|
+
},
|
|
1912
|
+
configure: async (deps) => {
|
|
1913
|
+
const filePath = path2.join(deps.cwd(), ".cursor", "mcp.json");
|
|
1914
|
+
const result = await mergeJsonConfig(deps, filePath, "mcpServers");
|
|
1915
|
+
return result.detail;
|
|
1916
|
+
}
|
|
1917
|
+
},
|
|
1918
|
+
// VS Code Copilot
|
|
1919
|
+
{
|
|
1920
|
+
id: "vscode",
|
|
1921
|
+
displayName: "VS Code Copilot",
|
|
1922
|
+
detect: (deps) => binaryExists("code", deps),
|
|
1923
|
+
isConfigured: async (deps) => {
|
|
1924
|
+
const filePath = path2.join(deps.cwd(), ".vscode", "mcp.json");
|
|
1925
|
+
const content = await deps.readFile(filePath);
|
|
1926
|
+
if (!content) return false;
|
|
1927
|
+
try {
|
|
1928
|
+
const config = JSON.parse(content);
|
|
1929
|
+
return !!config?.servers?.["flow-weaver"];
|
|
1930
|
+
} catch {
|
|
1931
|
+
return false;
|
|
1932
|
+
}
|
|
1933
|
+
},
|
|
1934
|
+
configure: async (deps) => {
|
|
1935
|
+
const filePath = path2.join(deps.cwd(), ".vscode", "mcp.json");
|
|
1936
|
+
const result = await mergeJsonConfig(deps, filePath, "servers");
|
|
1937
|
+
return result.detail;
|
|
1938
|
+
}
|
|
1939
|
+
},
|
|
1940
|
+
// Windsurf
|
|
1941
|
+
{
|
|
1942
|
+
id: "windsurf",
|
|
1943
|
+
displayName: "Windsurf",
|
|
1944
|
+
detect: async (deps) => {
|
|
1945
|
+
const configDir = path2.join(deps.homedir(), ".codeium", "windsurf");
|
|
1946
|
+
const dirExists = await deps.fileExists(configDir);
|
|
1947
|
+
if (dirExists) return true;
|
|
1948
|
+
return binaryExists("windsurf", deps);
|
|
1949
|
+
},
|
|
1950
|
+
isConfigured: async (deps) => {
|
|
1951
|
+
const filePath = path2.join(deps.homedir(), ".codeium", "windsurf", "mcp_config.json");
|
|
1952
|
+
const content = await deps.readFile(filePath);
|
|
1953
|
+
if (!content) return false;
|
|
1954
|
+
try {
|
|
1955
|
+
const config = JSON.parse(content);
|
|
1956
|
+
return !!config?.mcpServers?.["flow-weaver"];
|
|
1957
|
+
} catch {
|
|
1958
|
+
return false;
|
|
1959
|
+
}
|
|
1960
|
+
},
|
|
1961
|
+
configure: async (deps) => {
|
|
1962
|
+
const filePath = path2.join(deps.homedir(), ".codeium", "windsurf", "mcp_config.json");
|
|
1963
|
+
const result = await mergeJsonConfig(deps, filePath, "mcpServers");
|
|
1964
|
+
return result.detail;
|
|
1965
|
+
}
|
|
1966
|
+
},
|
|
1967
|
+
// Codex (OpenAI)
|
|
1968
|
+
{
|
|
1969
|
+
id: "codex",
|
|
1970
|
+
displayName: "Codex",
|
|
1971
|
+
detect: (deps) => binaryExists("codex", deps),
|
|
1972
|
+
isConfigured: async (deps) => {
|
|
1973
|
+
const result = await deps.execCommand("codex mcp list");
|
|
1974
|
+
return result.exitCode === 0 && result.stdout.includes("flow-weaver");
|
|
1975
|
+
},
|
|
1976
|
+
configure: async (deps) => {
|
|
1977
|
+
const cmd = `codex mcp add flow-weaver -- ${MCP_COMMAND} ${MCP_ARGS.join(" ")}`;
|
|
1978
|
+
const result = await deps.execCommand(cmd);
|
|
1979
|
+
if (result.exitCode !== 0) {
|
|
1980
|
+
throw new Error("codex mcp add failed");
|
|
1981
|
+
}
|
|
1982
|
+
return "registered via codex mcp add";
|
|
1983
|
+
}
|
|
1984
|
+
},
|
|
1985
|
+
// OpenClaw
|
|
1986
|
+
{
|
|
1987
|
+
id: "openclaw",
|
|
1988
|
+
displayName: "OpenClaw",
|
|
1989
|
+
detect: async (deps) => {
|
|
1990
|
+
return deps.fileExists(path2.join(deps.cwd(), "openclaw.json"));
|
|
1991
|
+
},
|
|
1992
|
+
isConfigured: async (deps) => {
|
|
1993
|
+
const filePath = path2.join(deps.cwd(), "openclaw.json");
|
|
1994
|
+
const content = await deps.readFile(filePath);
|
|
1995
|
+
if (!content) return false;
|
|
1996
|
+
try {
|
|
1997
|
+
const config = JSON.parse(content);
|
|
1998
|
+
return !!config?.mcpServers?.["flow-weaver"];
|
|
1999
|
+
} catch {
|
|
2000
|
+
return false;
|
|
2001
|
+
}
|
|
2002
|
+
},
|
|
2003
|
+
configure: async (deps) => {
|
|
2004
|
+
const filePath = path2.join(deps.cwd(), "openclaw.json");
|
|
2005
|
+
const result = await mergeJsonConfig(deps, filePath, "mcpServers");
|
|
2006
|
+
return result.detail;
|
|
2007
|
+
}
|
|
2008
|
+
}
|
|
2009
|
+
];
|
|
2010
|
+
async function detectTools(deps) {
|
|
2011
|
+
const results = await Promise.all(
|
|
2012
|
+
TOOL_REGISTRY.map(async (tool) => {
|
|
2013
|
+
const detected = await tool.detect(deps);
|
|
2014
|
+
const configured = detected ? await tool.isConfigured(deps) : false;
|
|
2015
|
+
return { id: tool.id, displayName: tool.displayName, detected, configured };
|
|
2016
|
+
})
|
|
2017
|
+
);
|
|
2018
|
+
return results;
|
|
2019
|
+
}
|
|
2020
|
+
async function configureTool(tool, deps) {
|
|
2021
|
+
try {
|
|
2022
|
+
const already = await tool.isConfigured(deps);
|
|
2023
|
+
if (already) {
|
|
2024
|
+
return { id: tool.id, displayName: tool.displayName, action: "already-configured", detail: "already configured" };
|
|
2025
|
+
}
|
|
2026
|
+
const detail = await tool.configure(deps);
|
|
2027
|
+
return { id: tool.id, displayName: tool.displayName, action: "configured", detail };
|
|
2028
|
+
} catch (err) {
|
|
2029
|
+
const msg = getErrorMessage(err);
|
|
2030
|
+
return { id: tool.id, displayName: tool.displayName, action: "failed", detail: msg };
|
|
2031
|
+
}
|
|
2032
|
+
}
|
|
2033
|
+
async function runMcpSetupFromInit(deps) {
|
|
2034
|
+
const d = deps ?? defaultDeps();
|
|
2035
|
+
const detected = await detectTools(d);
|
|
2036
|
+
const toConfig = detected.filter((t) => t.detected && !t.configured);
|
|
2037
|
+
const configured = [];
|
|
2038
|
+
const failed = [];
|
|
2039
|
+
const toolMap = new Map(TOOL_REGISTRY.map((t) => [t.id, t]));
|
|
2040
|
+
for (const t of toConfig) {
|
|
2041
|
+
const tool = toolMap.get(t.id);
|
|
2042
|
+
if (!tool) continue;
|
|
2043
|
+
const result = await configureTool(tool, d);
|
|
2044
|
+
if (result.action === "configured") {
|
|
2045
|
+
configured.push(result.displayName);
|
|
2046
|
+
} else if (result.action === "failed") {
|
|
2047
|
+
failed.push(result.displayName);
|
|
2048
|
+
}
|
|
2049
|
+
}
|
|
2050
|
+
for (const t of detected) {
|
|
2051
|
+
if (t.configured) {
|
|
2052
|
+
configured.push(t.displayName);
|
|
2053
|
+
}
|
|
2054
|
+
}
|
|
2055
|
+
const allConfiguredIds = detected.filter((t) => t.detected && (t.configured || configured.includes(t.displayName))).map((t) => t.id);
|
|
2056
|
+
const cliTools = allConfiguredIds.filter((id) => CLI_TOOL_IDS.has(id));
|
|
2057
|
+
const guiTools = allConfiguredIds.filter((id) => !CLI_TOOL_IDS.has(id));
|
|
2058
|
+
return { configured, failed, detected, cliTools, guiTools };
|
|
2059
|
+
}
|
|
2060
|
+
async function detectCliTools(deps) {
|
|
2061
|
+
const d = deps ?? defaultDeps();
|
|
2062
|
+
const results = [];
|
|
2063
|
+
for (const [id, binary] of Object.entries(CLI_TOOL_BINARY)) {
|
|
2064
|
+
if (binary && await binaryExists(binary, d)) {
|
|
2065
|
+
results.push(id);
|
|
2066
|
+
}
|
|
2067
|
+
}
|
|
2068
|
+
return results;
|
|
2069
|
+
}
|
|
2070
|
+
async function mcpSetupCommand(options, deps) {
|
|
2071
|
+
const d = deps ?? defaultDeps();
|
|
2072
|
+
const detected = await detectTools(d);
|
|
2073
|
+
if (options.list) {
|
|
2074
|
+
d.log("");
|
|
2075
|
+
for (const t of detected) {
|
|
2076
|
+
const status = t.detected ? t.configured ? "detected, configured" : "detected" : "not found";
|
|
2077
|
+
const icon = t.detected ? t.configured ? "\u25CF" : "\u25CB" : " ";
|
|
2078
|
+
d.log(` ${icon} ${t.displayName.padEnd(18)} ${status}`);
|
|
2079
|
+
}
|
|
2080
|
+
d.log("");
|
|
2081
|
+
return;
|
|
2082
|
+
}
|
|
2083
|
+
let toolIds;
|
|
2084
|
+
if (options.tool && options.tool.length > 0) {
|
|
2085
|
+
const valid = new Set(TOOL_REGISTRY.map((t) => t.id));
|
|
2086
|
+
for (const name of options.tool) {
|
|
2087
|
+
if (!valid.has(name)) {
|
|
2088
|
+
d.log(`Unknown tool: "${name}". Valid tools: ${[...valid].join(", ")}`);
|
|
2089
|
+
return;
|
|
2090
|
+
}
|
|
2091
|
+
}
|
|
2092
|
+
toolIds = options.tool;
|
|
2093
|
+
} else if (options.all) {
|
|
2094
|
+
toolIds = detected.filter((t) => t.detected).map((t) => t.id);
|
|
2095
|
+
} else if (isNonInteractive()) {
|
|
2096
|
+
toolIds = detected.filter((t) => t.detected).map((t) => t.id);
|
|
2097
|
+
} else {
|
|
2098
|
+
const detectedTools = detected.filter((t) => t.detected);
|
|
2099
|
+
if (detectedTools.length === 0) {
|
|
2100
|
+
d.log("No AI coding tools detected. You can specify tools manually with --tool.");
|
|
2101
|
+
return;
|
|
2102
|
+
}
|
|
2103
|
+
d.log("");
|
|
2104
|
+
d.log("Detected tools:");
|
|
2105
|
+
for (const t of detected) {
|
|
2106
|
+
const icon = t.detected ? "\u2713" : "\u2717";
|
|
2107
|
+
d.log(` ${icon} ${t.displayName}`);
|
|
2108
|
+
}
|
|
2109
|
+
d.log("");
|
|
2110
|
+
toolIds = [];
|
|
2111
|
+
try {
|
|
2112
|
+
for (const t of detectedTools) {
|
|
2113
|
+
if (t.configured) {
|
|
2114
|
+
d.log(` ${t.displayName}: already configured, skipping`);
|
|
2115
|
+
continue;
|
|
2116
|
+
}
|
|
2117
|
+
const yes = await dist_default4({
|
|
2118
|
+
message: `Configure ${t.displayName}?`,
|
|
2119
|
+
default: true
|
|
2120
|
+
});
|
|
2121
|
+
if (yes) toolIds.push(t.id);
|
|
2122
|
+
}
|
|
2123
|
+
} catch (err) {
|
|
2124
|
+
if (err instanceof ExitPromptError) return;
|
|
2125
|
+
throw err;
|
|
2126
|
+
}
|
|
2127
|
+
d.log("");
|
|
2128
|
+
}
|
|
2129
|
+
if (toolIds.length === 0) {
|
|
2130
|
+
const anyDetected = detected.some((t) => t.detected);
|
|
2131
|
+
if (!anyDetected) {
|
|
2132
|
+
d.log("No AI coding tools detected. You can specify tools manually with --tool.");
|
|
2133
|
+
} else {
|
|
2134
|
+
d.log("No tools selected.");
|
|
2135
|
+
}
|
|
2136
|
+
return;
|
|
2137
|
+
}
|
|
2138
|
+
const toolMap = new Map(TOOL_REGISTRY.map((t) => [t.id, t]));
|
|
2139
|
+
const results = [];
|
|
2140
|
+
for (const id of toolIds) {
|
|
2141
|
+
const tool = toolMap.get(id);
|
|
2142
|
+
const result = await configureTool(tool, d);
|
|
2143
|
+
results.push(result);
|
|
2144
|
+
const icon = result.action === "configured" ? "\u2713" : result.action === "already-configured" ? "\u25CF" : "\u2717";
|
|
2145
|
+
d.log(`${icon} ${result.displayName}: ${result.detail}`);
|
|
2146
|
+
}
|
|
2147
|
+
const configured = results.filter((r) => r.action === "configured").length;
|
|
2148
|
+
const alreadyDone = results.filter((r) => r.action === "already-configured").length;
|
|
2149
|
+
const failed = results.filter((r) => r.action === "failed").length;
|
|
2150
|
+
const parts = [];
|
|
2151
|
+
if (configured > 0) parts.push(`${configured} configured`);
|
|
2152
|
+
if (alreadyDone > 0) parts.push(`${alreadyDone} already configured`);
|
|
2153
|
+
if (failed > 0) parts.push(`${failed} failed`);
|
|
2154
|
+
d.log("");
|
|
2155
|
+
d.log(`Done. ${parts.join(", ")}.`);
|
|
2156
|
+
}
|
|
2157
|
+
|
|
2158
|
+
export {
|
|
2159
|
+
isUpKey,
|
|
2160
|
+
isDownKey,
|
|
2161
|
+
isBackspaceKey,
|
|
2162
|
+
isTabKey,
|
|
2163
|
+
isNumberKey,
|
|
2164
|
+
isEnterKey,
|
|
2165
|
+
ExitPromptError,
|
|
2166
|
+
ValidationError,
|
|
2167
|
+
useState,
|
|
2168
|
+
useEffect,
|
|
2169
|
+
dist_default,
|
|
2170
|
+
makeTheme,
|
|
2171
|
+
usePrefix,
|
|
2172
|
+
useMemo,
|
|
2173
|
+
useRef,
|
|
2174
|
+
useKeypress,
|
|
2175
|
+
usePagination,
|
|
2176
|
+
cursorHide,
|
|
2177
|
+
createPrompt,
|
|
2178
|
+
Separator,
|
|
2179
|
+
isNonInteractive,
|
|
2180
|
+
dist_default4 as dist_default2,
|
|
2181
|
+
CLI_TOOL_BINARY,
|
|
2182
|
+
mergeJsonConfig,
|
|
2183
|
+
TOOL_REGISTRY,
|
|
2184
|
+
detectTools,
|
|
2185
|
+
runMcpSetupFromInit,
|
|
2186
|
+
detectCliTools,
|
|
2187
|
+
mcpSetupCommand
|
|
2188
|
+
};
|