@sap/joule-studio-dev-cli 0.1.20-alpha.3
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 +38 -0
- package/README.md +53 -0
- package/dist/bin/commands/a2a.js +12 -0
- package/dist/bin/commands/a2a.js.map +1 -0
- package/dist/bin/commands/asset.js +20 -0
- package/dist/bin/commands/asset.js.map +1 -0
- package/dist/bin/commands/auth.js +16 -0
- package/dist/bin/commands/auth.js.map +1 -0
- package/dist/bin/commands/init.js +20 -0
- package/dist/bin/commands/init.js.map +1 -0
- package/dist/bin/commands/mcp.js +42 -0
- package/dist/bin/commands/mcp.js.map +1 -0
- package/dist/bin/commands/pro-code.js +12 -0
- package/dist/bin/commands/pro-code.js.map +1 -0
- package/dist/bin/commands/skills.js +27 -0
- package/dist/bin/commands/skills.js.map +1 -0
- package/dist/bin/commands/solution.js +52 -0
- package/dist/bin/commands/solution.js.map +1 -0
- package/dist/bin/help.js +42 -0
- package/dist/bin/help.js.map +1 -0
- package/dist/bin/jl.js +59 -0
- package/dist/bin/jl.js.map +1 -0
- package/dist/bin/login.js +60 -0
- package/dist/bin/login.js.map +1 -0
- package/dist/bin/logout.js +21 -0
- package/dist/bin/logout.js.map +1 -0
- package/dist/lib/a2a/message.js +74 -0
- package/dist/lib/a2a/message.js.map +1 -0
- package/dist/lib/asset/create.js +38 -0
- package/dist/lib/asset/create.js.map +1 -0
- package/dist/lib/asset/delete.js +57 -0
- package/dist/lib/asset/delete.js.map +1 -0
- package/dist/lib/asset/discover.js +46 -0
- package/dist/lib/asset/discover.js.map +1 -0
- package/dist/lib/auth-crypto.js +146 -0
- package/dist/lib/auth-crypto.js.map +1 -0
- package/dist/lib/auth.js +488 -0
- package/dist/lib/auth.js.map +1 -0
- package/dist/lib/context.js +35 -0
- package/dist/lib/context.js.map +1 -0
- package/dist/lib/errors.js +47 -0
- package/dist/lib/errors.js.map +1 -0
- package/dist/lib/fs-utils.js +34 -0
- package/dist/lib/fs-utils.js.map +1 -0
- package/dist/lib/init/agents.js +55 -0
- package/dist/lib/init/agents.js.map +1 -0
- package/dist/lib/init/shared.js +172 -0
- package/dist/lib/init/shared.js.map +1 -0
- package/dist/lib/mcp/call.js +158 -0
- package/dist/lib/mcp/call.js.map +1 -0
- package/dist/lib/mcp/client.js +100 -0
- package/dist/lib/mcp/client.js.map +1 -0
- package/dist/lib/mcp/list.js +20 -0
- package/dist/lib/mcp/list.js.map +1 -0
- package/dist/lib/mcp/start.js +120 -0
- package/dist/lib/mcp/start.js.map +1 -0
- package/dist/lib/mcp/tools.js +162 -0
- package/dist/lib/mcp/tools.js.map +1 -0
- package/dist/lib/plugin.js +77 -0
- package/dist/lib/plugin.js.map +1 -0
- package/dist/lib/plugins/agent/index.js +32 -0
- package/dist/lib/plugins/agent/index.js.map +1 -0
- package/dist/lib/plugins/agent/templates/asset.yaml.hbs +31 -0
- package/dist/lib/plugins/agent-extension/index.js +32 -0
- package/dist/lib/plugins/agent-extension/index.js.map +1 -0
- package/dist/lib/plugins/agent-extension/templates/asset.yaml.hbs +15 -0
- package/dist/lib/plugins/base-ui/index.js +32 -0
- package/dist/lib/plugins/base-ui/index.js.map +1 -0
- package/dist/lib/plugins/base-ui/templates/asset.yaml.hbs +8 -0
- package/dist/lib/plugins/cap-app/index.js +32 -0
- package/dist/lib/plugins/cap-app/index.js.map +1 -0
- package/dist/lib/plugins/cap-app/templates/asset.yaml.hbs +37 -0
- package/dist/lib/plugins/data-product/index.js +32 -0
- package/dist/lib/plugins/data-product/index.js.map +1 -0
- package/dist/lib/plugins/data-product/templates/asset.yaml.hbs +9 -0
- package/dist/lib/plugins/domain-model-extension/index.js +37 -0
- package/dist/lib/plugins/domain-model-extension/index.js.map +1 -0
- package/dist/lib/plugins/domain-model-extension/templates/asset.yaml.hbs +15 -0
- package/dist/lib/plugins/mcp-server/index.js +36 -0
- package/dist/lib/plugins/mcp-server/index.js.map +1 -0
- package/dist/lib/plugins/mcp-server/templates/asset.yaml.hbs +9 -0
- package/dist/lib/plugins/n8n-workflow/index.js +52 -0
- package/dist/lib/plugins/n8n-workflow/index.js.map +1 -0
- package/dist/lib/plugins/n8n-workflow/templates/asset.yaml.hbs +18 -0
- package/dist/lib/plugins/n8n-workflow/validation/asset-validator.js +62 -0
- package/dist/lib/plugins/n8n-workflow/validation/asset-validator.js.map +1 -0
- package/dist/lib/plugins/n8n-workflow/validation/yaml-validator.js +51 -0
- package/dist/lib/plugins/n8n-workflow/validation/yaml-validator.js.map +1 -0
- package/dist/lib/plugins/vercel-app/index.js +32 -0
- package/dist/lib/plugins/vercel-app/index.js.map +1 -0
- package/dist/lib/plugins/vercel-app/templates/asset.yaml.hbs +12 -0
- package/dist/lib/rule.js +2 -0
- package/dist/lib/rule.js.map +1 -0
- package/dist/lib/schemas/solution-schema.json +178 -0
- package/dist/lib/solution/build.js +186 -0
- package/dist/lib/solution/build.js.map +1 -0
- package/dist/lib/solution/create.js +42 -0
- package/dist/lib/solution/create.js.map +1 -0
- package/dist/lib/solution/deploy.js +66 -0
- package/dist/lib/solution/deploy.js.map +1 -0
- package/dist/lib/solution/list.js +21 -0
- package/dist/lib/solution/list.js.map +1 -0
- package/dist/lib/solution/logs.js +130 -0
- package/dist/lib/solution/logs.js.map +1 -0
- package/dist/lib/solution/status.js +161 -0
- package/dist/lib/solution/status.js.map +1 -0
- package/dist/lib/solution/templates/solution.yaml.hbs +9 -0
- package/dist/lib/solution/util/build-file.js +4 -0
- package/dist/lib/solution/util/build-file.js.map +1 -0
- package/dist/lib/template.js +74 -0
- package/dist/lib/template.js.map +1 -0
- package/dist/lib/term.js +16 -0
- package/dist/lib/term.js.map +1 -0
- package/dist/lib/validate.js +287 -0
- package/dist/lib/validate.js.map +1 -0
- package/dist/lib/yaml.js +33 -0
- package/dist/lib/yaml.js.map +1 -0
- package/dist/package.json +77 -0
- package/package.json +77 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
SAP DEVELOPER LICENSE AGREEMENT
|
|
2
|
+
|
|
3
|
+
Version 3.2
|
|
4
|
+
|
|
5
|
+
Please scroll down and read the following Developer License Agreement carefully ("Developer Agreement"). By clicking "I Accept" or by attempting to download, or install, or use the SAP software and other materials that accompany this Developer Agreement ("SAP Materials"), You agree that this Developer Agreement forms a legally binding agreement between You ("You" or "Your") and SAP SE, for and on behalf of itself and its subsidiaries and affiliates (as defined in Section 15 of the German Stock Corporation Act) and You agree to be bound by all of the terms and conditions stated in this Developer Agreement. If You are trying to access or download the SAP Materials on behalf of Your employer or as a consultant or agent of a third party (either "Your Company"), You represent and warrant that You have the authority to act on behalf of and bind Your Company to the terms of this Developer Agreement and everywhere in this Developer Agreement that refers to 'You' or 'Your' shall also include Your Company. If You do not agree to these terms, do not click "I Accept", and do not attempt to access or use the SAP Materials.
|
|
6
|
+
|
|
7
|
+
1. LICENSE: SAP grants You a non-exclusive, non-transferable, non-sublicensable, revocable, limited use license to copy, reproduce and distribute the application programming interfaces ("API"), documentation, plug-ins, templates, scripts and sample code ("Tools") on a desktop, laptop, tablet, smart phone, or other appropriate computer device that You own or control (any, a "Computer") to create new applications ("Customer Applications"). You agree that the Customer Applications will not: (a) unreasonably impair, degrade or reduce the performance or security of any SAP software applications, services or related technology ("Software"); (b) enable the bypassing or circumventing of SAP's license restrictions and/or provide users with access to the Software to which such users are not licensed; (c) render or provide, without prior written consent from SAP, any information concerning SAP software license terms, Software, or any other information related to SAP products; or (d) permit mass data extraction from an SAP product to a non-SAP product, including use, modification, saving or other processing of such data in the non-SAP product. In exchange for the right to develop Customer Applications under this Agreement, You covenant not to assert any Intellectual Property Rights in Customer Applications created by You against any SAP product, service, or future SAP development.
|
|
8
|
+
|
|
9
|
+
2. INTELLECTUAL PROPERTY: (a) SAP or its licensors retain all ownership and intellectual property rights in the APIs, Tools and Software. You may not: a) remove or modify any marks or proprietary notices of SAP, b) provide or make the APIs, Tools or Software available to any third party, c) assign this Developer Agreement or give or transfer the APIs, Tools or Software or an interest in them to another individual or entity, d) decompile, disassemble or reverse engineer (except to the extent permitted by applicable law) the APIs Tools or Software, (e) create derivative works of or based on the APIs, Tools or Software, (f) use any SAP name, trademark or logo, or (g) use the APIs or Tools to modify existing Software or other SAP product functionality or to access the Software or other SAP products' source code or metadata.
|
|
10
|
+
(b) Subject to SAP's underlying rights in any part of the APIs, Tools or Software, You retain all ownership and intellectual property rights in Your Customer Applications.
|
|
11
|
+
|
|
12
|
+
3. ARTIFICIAL INTELLIGENCE TRAINING: You are expressly prohibited from using the Software, Tools or APIs as well as any Customer Applications or any part thereof for the purpose of training (developing) artificial intelligence models or systems (“AI Training”). Prohibition of AI Training includes, but is not limited to, using the Software, Tools, APIs and/or Customer Applications or part thereof in any training data set, algorithm development, model development or refinement (including language learning models) related to artificial intelligence, as well as text and data mining in accordance with §44b UrhG and Art. 4 of EU Directive 2019/790. For the avoidance of doubt, by accepting this Developer Agreement You agree that Your ownership of Customer Applications shall not create nor encompass any right to use Customer Applications for AI Training and, hence, You will not use Customer Applications or any part of it for AI Training.
|
|
13
|
+
|
|
14
|
+
4. FREE AND OPEN SOURCE COMPONENTS: The SAP Materials may include certain third party free or open source components ("FOSS Components"). You may have additional rights in such FOSS Components that are provided by the third party licensors of those components.
|
|
15
|
+
|
|
16
|
+
5. THIRD PARTY DEPENDENCIES: The SAP Materials may require certain third party software dependencies ("Dependencies") for the use or operation of such SAP Materials. These dependencies may be identified by SAP in Maven POM files, product documentation or by other means. SAP does not grant You any rights in or to such Dependencies under this Developer Agreement. You are solely responsible for the acquisition, installation and use of Dependencies. SAP DOES NOT MAKE ANY REPRESENTATIONS OR WARRANTIES IN RESPECT OF DEPENDENCIES, INCLUDING BUT NOT LIMITED TO IMPLIED WARRANTIES OF MERCHANTABILITY AND OF FITNESS FOR A PARTICULAR PURPOSE. IN PARTICULAR, SAP DOES NOT WARRANT THAT DEPENDENCIES WILL BE AVAILABLE, ERROR FREE, INTEROPERABLE WITH THE SAP MATERIALS, SUITABLE FOR ANY PARTICULAR PURPOSE OR NON-INFRINGING. YOU ASSUME ALL RISKS ASSOCIATED WITH THE USE OF DEPENDENCIES, INCLUDING WITHOUT LIMITATION RISKS RELATING TO QUALITY, AVAILABILITY, PERFORMANCE, DATA LOSS, UTILITY IN A PRODUCTION ENVIRONMENT, AND NON-INFRINGEMENT. IN NO EVENT WILL SAP BE LIABLE DIRECTLY OR INDIRECTLY IN RESPECT OF ANY USE OF DEPENDENCIES BY YOU.
|
|
17
|
+
|
|
18
|
+
6. WARRANTY:
|
|
19
|
+
a) If You are located outside the US or Canada: AS THE API AND TOOLS ARE PROVIDED TO YOU FREE OF CHARGE, SAP DOES NOT GUARANTEE OR WARRANT ANY FEATURES OR QUALITIES OF THE TOOLS OR API OR GIVE ANY UNDERTAKING WITH REGARD TO ANY OTHER QUALITY. NO SUCH WARRANTY OR UNDERTAKING SHALL BE IMPLIED BY YOU FROM ANY DESCRIPTION IN THE API OR TOOLS OR ANY AVAILABLE DOCUMENTATION OR ANY OTHER COMMUNICATION OR ADVERTISEMENT. IN PARTICULAR, SAP DOES NOT WARRANT THAT THE SOFTWARE WILL BE AVAILABLE UNINTERRUPTED, ERROR FREE, OR PERMANENTLY AVAILABLE. FOR THE TOOLS AND API ALL WARRANTY CLAIMS ARE SUBJECT TO THE LIMITATION OF LIABILITY STIPULATED IN SECTION 4 BELOW.
|
|
20
|
+
b) If You are located in the US or Canada: THE API AND TOOLS ARE LICENSED TO YOU "AS IS", WITHOUT ANY WARRANTY, ESCROW, TRAINING, MAINTENANCE, OR SERVICE OBLIGATIONS WHATSOEVER ON THE PART OF SAP. SAP MAKES NO EXPRESS OR IMPLIED WARRANTIES OR CONDITIONS OF SALE OF ANY TYPE WHATSOEVER, INCLUDING BUT NOT LIMITED TO IMPLIED WARRANTIES OF MERCHANTABILITY AND OF FITNESS FOR A PARTICULAR PURPOSE. IN PARTICULAR, SAP DOES NOT WARRANT THAT THE SOFTWARE WILL BE AVAILABLE UNINTERRUPTED, ERROR FREE, OR PERMANENTLY AVAILABLE. YOU ASSUME ALL RISKS ASSOCIATED WITH THE USE OF THE API AND TOOLS, INCLUDING WITHOUT LIMITATION RISKS RELATING TO QUALITY, AVAILABILITY, PERFORMANCE, DATA LOSS, AND UTILITY IN A PRODUCTION ENVIRONMENT.
|
|
21
|
+
|
|
22
|
+
7. LIMITATION OF LIABILITY:
|
|
23
|
+
a) If You are located outside the US or Canada: IRRESPECTIVE OF THE LEGAL REASONS, SAP SHALL ONLY BE LIABLE FOR DAMAGES UNDER THIS AGREEMENT IF SUCH DAMAGE (I) CAN BE CLAIMED UNDER THE GERMAN PRODUCT LIABILITY ACT OR (II) IS CAUSED BY INTENTIONAL MISCONDUCT OF SAP OR (III) CONSISTS OF PERSONAL INJURY. IN ALL OTHER CASES, NEITHER SAP NOR ITS EMPLOYEES, AGENTS AND SUBCONTRACTORS SHALL BE LIABLE FOR ANY KIND OF DAMAGE OR CLAIMS HEREUNDER.
|
|
24
|
+
b) If You are located in the US or Canada: IN NO EVENT SHALL SAP BE LIABLE TO YOU, YOUR COMPANY OR TO ANY THIRD PARTY FOR ANY DAMAGES IN AN AMOUNT IN EXCESS OF $100 ARISING IN CONNECTION WITH YOUR USE OF OR INABILITY TO USE THE TOOLS OR API OR IN CONNECTION WITH SAP'S PROVISION OF OR FAILURE TO PROVIDE SERVICES PERTAINING TO THE TOOLS OR API, OR AS A RESULT OF ANY DEFECT IN THE API OR TOOLS. THIS DISCLAIMER OF LIABILITY SHALL APPLY REGARDLESS OF THE FORM OF ACTION THAT MAY BE BROUGHT AGAINST SAP, WHETHER IN CONTRACT OR TORT, INCLUDING WITHOUT LIMITATION ANY ACTION FOR NEGLIGENCE. YOUR SOLE REMEDY IN THE EVENT OF BREACH OF THIS DEVELOPER AGREEMENT BY SAP OR FOR ANY OTHER CLAIM RELATED TO THE API OR TOOLS SHALL BE TERMINATION OF THIS AGREEMENT. NOTWITHSTANDING ANYTHING TO THE CONTRARY HEREIN, UNDER NO CIRCUMSTANCES SHALL SAP AND ITS LICENSORS BE LIABLE TO YOU OR ANY OTHER PERSON OR ENTITY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, OR INDIRECT DAMAGES, LOSS OF GOOD WILL OR BUSINESS PROFITS, WORK STOPPAGE, DATA LOSS, COMPUTER FAILURE OR MALFUNCTION, ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSS, OR EXEMPLARY OR PUNITIVE DAMAGES.
|
|
25
|
+
|
|
26
|
+
8. INDEMNITY: You will fully indemnify, hold harmless and defend SAP against law suits based on any claim: (a) that any Customer Application created by You infringes or misappropriates any patent, copyright, trademark, trade secrets, or other proprietary rights of a third party, or (b) related to Your alleged violation of the terms of this Developer Agreement.
|
|
27
|
+
|
|
28
|
+
9. EXPORT: The Tools and API are subject to German, EU and US export control regulations. You confirm that: a) You will not use the Tools or API for, and will not allow the Tools or API to be used for, any purposes prohibited by German, EU and US law, including, without limitation, for the development, design, manufacture or production of nuclear, chemical or biological weapons of mass destruction; b) You are not located in Cuba, Iran, Sudan, Iraq, North Korea, Syria, nor any other country to which the United States has prohibited export or that has been designated by the U.S. Government as a "terrorist supporting" country (any, an "US Embargoed Country"); c) You are not a citizen, national or resident of, and are not under the control of, a US Embargoed Country; d) You will not download or otherwise export or re-export the API or Tools, directly or indirectly, to a US Embargoed Country nor to citizens, nationals or residents of a US Embargoed Country; e) You are not listed on the United States Department of Treasury lists of Specially Designated Nationals, Specially Designated Terrorists, and Specially Designated Narcotic Traffickers, nor listed on the United States Department of Commerce Table of Denial Orders or any other U.S. government list of prohibited or restricted parties and f) You will not download or otherwise export or re-export the API or Tools , directly or indirectly, to persons on the above-mentioned lists.
|
|
29
|
+
|
|
30
|
+
10. SUPPORT: Other than what is made available on the SAP Community Website (SCN) by SAP at its sole discretion and by SCN members, SAP does not offer support for the API or Tools which are the subject of this Developer Agreement.
|
|
31
|
+
|
|
32
|
+
11. TERM AND TERMINATION: You may terminate this Developer Agreement by destroying all copies of the API and Tools on Your Computer(s). SAP may terminate Your license to use the API and Tools immediately if You fail to comply with any of the terms of this Developer Agreement, or, for SAP's convenience by providing you with ten (10) day's written notice of termination (including by public notice). In case of termination or expiration of this Developer Agreement, You must destroy all copies of the API and Tools immediately. In the event Your Company or any of the intellectual property you create using the API, Tools or Software are acquired (by merger, purchase of stock, assets or intellectual property or exclusive license), or You become employed, by a direct competitor of SAP, then this Development Agreement and all licenses granted in this Developer Agreement shall immediately terminate upon the date of such acquisition.
|
|
33
|
+
|
|
34
|
+
12. LAW/VENUE:
|
|
35
|
+
a) If You are located outside the US or Canada: This Developer Agreement is governed by and construed in accordance with the laws of the Germany. You and SAP agree to submit to the exclusive jurisdiction of, and venue in, the courts of Karlsruhe in Germany in any dispute arising out of or relating to this Developer Agreement.
|
|
36
|
+
b) If You are located in the US or Canada: This Developer Agreement shall be governed by and construed under the Commonwealth of Pennsylvania law without reference to its conflicts of law principles. In the event of any conflicts between foreign law, rules, and regulations, and United States of America law, rules, and regulations, United States of America law, rules, and regulations shall prevail and govern. The United Nations Convention on Contracts for the International Sale of Goods shall not apply to this Developer Agreement. The Uniform Computer Information Transactions Act as enacted shall not apply.
|
|
37
|
+
|
|
38
|
+
13. MISCELLANEOUS: This Developer Agreement is the complete agreement for the API and Tools licensed (including reference to information/documentation contained in a URL). This Developer Agreement supersedes all prior or contemporaneous agreements or representations with regards to the subject matter of this Developer Agreement. If any term of this Developer Agreement is found to be invalid or unenforceable, the surviving provisions shall remain effective. SAP's failure to enforce any right or provisions stipulated in this Developer Agreement will not constitute a waiver of such provision, or any other provision of this Developer Agreement.
|
package/README.md
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# jl — Joule Studio Dev CLI
|
|
2
|
+
|
|
3
|
+
CLI for creating, validating, building, and deploying SAP Joule Studio solutions.
|
|
4
|
+
|
|
5
|
+
**[📖 Documentation](https://pages.github.tools.sap/AP-AC-Products-Services/js-cli/)**
|
|
6
|
+
|
|
7
|
+
> **License:** see [LICENSE](LICENSE)
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
**Requirements:** Node.js ≥ 24
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install -g @sap/joule-studio-dev-cli@latest --registry https://int.repositories.cloud.sap/artifactory/api/npm/build-milestones-npm/
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
**Local development:**
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
git clone https://github.tools.sap/AP-AC-Products-Services/js-cli.git
|
|
23
|
+
cd js-cli
|
|
24
|
+
npm install && npm link
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Quick start
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
jl login https://my-backend.cfapps.eu12.hana.ondemand.com
|
|
33
|
+
jl solution create --name my-solution
|
|
34
|
+
jl asset create agent --name my-agent
|
|
35
|
+
jl solution validate && jl solution build
|
|
36
|
+
jl solution deploy ./build/my-solution-1.0.0.zip
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
See the **[CLI Reference](https://pages.github.tools.sap/AP-AC-Products-Services/js-cli/reference/commands)** for all commands and options.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Contributing
|
|
44
|
+
|
|
45
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## License
|
|
50
|
+
|
|
51
|
+
This package is released under the SAP Developer License. See [LICENSE](LICENSE) for the full terms.
|
|
52
|
+
|
|
53
|
+
---
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { a2aMessage } from '../../lib/a2a/message.js';
|
|
2
|
+
export function addA2aCommands(program) {
|
|
3
|
+
const a2a = program.command('a2a').description('Agent-to-agent communication');
|
|
4
|
+
a2a.command('message')
|
|
5
|
+
.description('Send a message to an agent via A2A')
|
|
6
|
+
.argument('<message>', 'message text')
|
|
7
|
+
.option('-s, --solution <id>', 'solution id (default: from .build)')
|
|
8
|
+
.option('-a, --asset <name>', 'asset name (default: single agent asset in project)')
|
|
9
|
+
.option('-c, --continue', 'reuse the last conversation context id')
|
|
10
|
+
.action((message, options) => a2aMessage([message], options));
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=a2a.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"a2a.js","sourceRoot":"","sources":["../../../bin/commands/a2a.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAErD,MAAM,UAAU,cAAc,CAAC,OAAgB;IAC3C,MAAM,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,8BAA8B,CAAC,CAAA;IAE9E,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC;SACjB,WAAW,CAAC,oCAAoC,CAAC;SACjD,QAAQ,CAAC,WAAW,EAAE,cAAc,CAAC;SACrC,MAAM,CAAC,qBAAqB,EAAE,oCAAoC,CAAC;SACnE,MAAM,CAAC,oBAAoB,EAAE,qDAAqD,CAAC;SACnF,MAAM,CAAC,gBAAgB,EAAE,wCAAwC,CAAC;SAClE,MAAM,CAAC,CAAC,OAAe,EAAE,OAA0B,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC,CAAA;AAChG,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import assetCreate from '../../lib/asset/create.js';
|
|
2
|
+
import assetDelete from '../../lib/asset/delete.js';
|
|
3
|
+
export function addAssetCommands(program) {
|
|
4
|
+
const asset = program.command('asset').alias('a').description('Manage assets');
|
|
5
|
+
asset
|
|
6
|
+
.command('create')
|
|
7
|
+
.description('Create a new asset of the given type')
|
|
8
|
+
.argument('<type>', 'asset type (e.g. agent, cap-app, mcp-server)')
|
|
9
|
+
.option('-n, --name <name>', 'asset name')
|
|
10
|
+
.option('-w, --workflow-name <name>', 'workflow name (n8n-workflow)')
|
|
11
|
+
.option('-d, --definition-file <path>', 'workflow definition file (n8n-workflow)')
|
|
12
|
+
.option('--force', 'overwrite if asset already exists')
|
|
13
|
+
.action((type, options) => assetCreate([type], options));
|
|
14
|
+
asset
|
|
15
|
+
.command('delete')
|
|
16
|
+
.description('Delete an asset and remove its reference from solution.yaml')
|
|
17
|
+
.argument('<name>', 'asset name to delete')
|
|
18
|
+
.action((name) => assetDelete([name]));
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=asset.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asset.js","sourceRoot":"","sources":["../../../bin/commands/asset.ts"],"names":[],"mappings":"AAEA,OAAO,WAAW,MAAM,2BAA2B,CAAA;AACnD,OAAO,WAAW,MAAM,2BAA2B,CAAA;AAEnD,MAAM,UAAU,gBAAgB,CAAC,OAAgB;IAC7C,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,WAAW,CAAC,eAAe,CAAC,CAAA;IAE9E,KAAK;SACA,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,sCAAsC,CAAC;SACnD,QAAQ,CAAC,QAAQ,EAAE,8CAA8C,CAAC;SAClE,MAAM,CAAC,mBAAmB,EAAE,YAAY,CAAC;SACzC,MAAM,CAAC,4BAA4B,EAAE,8BAA8B,CAAC;SACpE,MAAM,CAAC,8BAA8B,EAAE,yCAAyC,CAAC;SACjF,MAAM,CAAC,SAAS,EAAE,mCAAmC,CAAC;SACtD,MAAM,CAAC,CAAC,IAAY,EAAE,OAA2B,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC,CAAA;IAExF,KAAK;SACA,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,6DAA6D,CAAC;SAC1E,QAAQ,CAAC,QAAQ,EAAE,sBAAsB,CAAC;SAC1C,MAAM,CAAC,CAAC,IAAY,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACtD,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import login from '../login.js';
|
|
2
|
+
import logout from '../logout.js';
|
|
3
|
+
export function addAuthCommands(program) {
|
|
4
|
+
program
|
|
5
|
+
.command('login')
|
|
6
|
+
.description('Log in to a backend')
|
|
7
|
+
.argument('[url]', 'backend URL')
|
|
8
|
+
.option('-u, --username <email>', 'username (email)')
|
|
9
|
+
.action((url, options) => login(url ? [url] : [], options));
|
|
10
|
+
program
|
|
11
|
+
.command('logout')
|
|
12
|
+
.description('Log out from the current backend')
|
|
13
|
+
.argument('[url]', 'backend URL (uses stored URL if omitted)')
|
|
14
|
+
.action((url) => logout(url ? [url] : []));
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=auth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../bin/commands/auth.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,aAAa,CAAA;AAC/B,OAAO,MAAM,MAAM,cAAc,CAAA;AAEjC,MAAM,UAAU,eAAe,CAAC,OAAgB;IAC5C,OAAO;SACF,OAAO,CAAC,OAAO,CAAC;SAChB,WAAW,CAAC,qBAAqB,CAAC;SAClC,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC;SAChC,MAAM,CAAC,wBAAwB,EAAE,kBAAkB,CAAC;SACpD,MAAM,CAAC,CAAC,GAAuB,EAAE,OAAqB,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC,CAAA;IAEjG,OAAO;SACF,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,kCAAkC,CAAC;SAC/C,QAAQ,CAAC,OAAO,EAAE,0CAA0C,CAAC;SAC7D,MAAM,CAAC,CAAC,GAAuB,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;AACtE,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Argument } from 'commander';
|
|
2
|
+
import { AGENTS } from '../../lib/init/agents.js';
|
|
3
|
+
export function addInitCommands(program) {
|
|
4
|
+
const cmd = program
|
|
5
|
+
.command('init')
|
|
6
|
+
.description('Initialise a directory for an AI coding agent')
|
|
7
|
+
.addArgument(new Argument('[agent]', 'agent to initialise').choices(Object.keys(AGENTS)))
|
|
8
|
+
.argument('[path]', 'target directory (defaults to current directory)')
|
|
9
|
+
.option('-f, --force', 'overwrite existing config values and skills')
|
|
10
|
+
.action(async (agent, targetPath, options) => {
|
|
11
|
+
if (!agent) {
|
|
12
|
+
cmd.help();
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
await AGENTS[agent].initSkills({ ...options, path: targetPath });
|
|
16
|
+
await AGENTS[agent].initMcp({ ...options, path: targetPath });
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=init.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../../bin/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAGpC,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AAGjD,MAAM,UAAU,eAAe,CAAC,OAAgB;IAC5C,MAAM,GAAG,GAAG,OAAO;SACd,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,+CAA+C,CAAC;SAC5D,WAAW,CAAC,IAAI,QAAQ,CAAC,SAAS,EAAE,qBAAqB,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;SACxF,QAAQ,CAAC,QAAQ,EAAE,kDAAkD,CAAC;SACtE,MAAM,CAAC,aAAa,EAAE,6CAA6C,CAAC;SACpE,MAAM,CAAC,KAAK,EAAE,KAAwB,EAAE,UAA8B,EAAE,OAAoB,EAAE,EAAE;QAC7F,IAAI,CAAC,KAAK,EAAE,CAAC;YACT,GAAG,CAAC,IAAI,EAAE,CAAA;QACd,CAAC;aAAM,CAAC;YACJ,MAAM,MAAM,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC,EAAE,GAAG,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAA;YAChE,MAAM,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,EAAE,GAAG,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAA;QACjE,CAAC;IACL,CAAC,CAAC,CAAA;AACV,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Argument } from 'commander';
|
|
2
|
+
import { mcpCall } from '../../lib/mcp/call.js';
|
|
3
|
+
import { mcpList } from '../../lib/mcp/list.js';
|
|
4
|
+
import { mcpStart } from '../../lib/mcp/start.js';
|
|
5
|
+
import { mcpTools } from '../../lib/mcp/tools.js';
|
|
6
|
+
import { AGENTS } from '../../lib/init/agents.js';
|
|
7
|
+
export function addMcpCommands(program) {
|
|
8
|
+
const mcp = program.command('mcp').description('Manage MCP servers');
|
|
9
|
+
mcp.command('list')
|
|
10
|
+
.description('List MCP servers available on the backend')
|
|
11
|
+
.action(() => mcpList());
|
|
12
|
+
mcp.command('tools')
|
|
13
|
+
.description('List tools exposed by an MCP server')
|
|
14
|
+
.argument('[server]', 'MCP server name')
|
|
15
|
+
.option('--json', 'output tools and their input schemas as JSON')
|
|
16
|
+
.action((server, options) => mcpTools(server ? [server] : [], options));
|
|
17
|
+
mcp.command('call')
|
|
18
|
+
.description('Call an MCP tool')
|
|
19
|
+
.argument('[server]', 'MCP server name')
|
|
20
|
+
.argument('[tool]', 'tool name')
|
|
21
|
+
.argument('[params...]', 'tool parameters as key=value pairs')
|
|
22
|
+
.option('--params <file>', 'JSON file of tool parameters (mutually exclusive with key=value pairs)')
|
|
23
|
+
.action((server, tool, params, opts) => mcpCall(server, tool, params, opts.params));
|
|
24
|
+
mcp.command('start')
|
|
25
|
+
.description('Start a local MCP stdio server proxying all synced servers')
|
|
26
|
+
.action(() => mcpStart([]));
|
|
27
|
+
const mcpInit = mcp
|
|
28
|
+
.command('init')
|
|
29
|
+
.description('Write MCP configuration files for an AI coding agent')
|
|
30
|
+
.addArgument(new Argument('[agent]', 'agent to configure').choices(Object.keys(AGENTS)))
|
|
31
|
+
.argument('[path]', 'target directory (defaults to current directory)')
|
|
32
|
+
.option('-f, --force', 'overwrite existing config values')
|
|
33
|
+
.action(async (agent, targetPath, options) => {
|
|
34
|
+
if (!agent) {
|
|
35
|
+
mcpInit.help();
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
await AGENTS[agent].initMcp({ ...options, path: targetPath });
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=mcp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp.js","sourceRoot":"","sources":["../../../bin/commands/mcp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAEpC,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AACjD,OAAO,EAAE,QAAQ,EAAwB,MAAM,wBAAwB,CAAA;AACvE,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AAGjD,MAAM,UAAU,cAAc,CAAC,OAAgB;IAC3C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sD,CAAC;SACnE,WAAW,CAAC,IAAI,QAAQ,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;SACvF,QAAQ,CAAC,QAAQ,EAAE,kDAAkD,CAAC;SACtE,MAAM,CAAC,aAAa,EAAE,kCAAkC,CAAC;SACzD,MAAM,CAAC,KAAK,EAAE,KAAwB,EAAE,UAA8B,EAAE,OAAoB,EAAE,EAAE;QAC7F,IAAI,CAAC,KAAK,EAAE,CAAC;YACT,OAAO,CAAC,IAAI,EAAE,CAAA;QAClB,CAAC;aAAM,CAAC;YACJ,MAAM,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,EAAE,GAAG,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAA;QACjE,CAAC;IACL,CAAC,CAAC,CAAA;AACV,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export function addProCodeCommands(program) {
|
|
2
|
+
const proCode = program.command('pro-code', { hidden: true }).alias('pc').description('Pro-code project setup');
|
|
3
|
+
proCode
|
|
4
|
+
.command('init')
|
|
5
|
+
.description('[deprecated] Use `jl init claude` or `jl init opencode` instead')
|
|
6
|
+
.argument('[path]', 'target directory (defaults to current directory)')
|
|
7
|
+
.option('-f, --force', 'overwrite existing config files')
|
|
8
|
+
.action(() => {
|
|
9
|
+
console.warn('⚠ `jl pro-code init` is deprecated. Use `jl init claude` or `jl init opencode` instead.');
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=pro-code.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pro-code.js","sourceRoot":"","sources":["../../../bin/commands/pro-code.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,kBAAkB,CAAC,OAAgB;IAC/C,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,wBAAwB,CAAC,CAAA;IAE/G,OAAO;SACF,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,iEAAiE,CAAC;SAC9E,QAAQ,CAAC,QAAQ,EAAE,kDAAkD,CAAC;SACtE,MAAM,CAAC,aAAa,EAAE,iCAAiC,CAAC;SACxD,MAAM,CAAC,GAAG,EAAE;QACT,OAAO,CAAC,IAAI,CAAC,yFAAyF,CAAC,CAAA;IAC3G,CAAC,CAAC,CAAA;AACV,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { initSkills } from '../../lib/init/shared.js';
|
|
2
|
+
import { AGENTS } from '../../lib/init/agents.js';
|
|
3
|
+
import { CliError } from '../../lib/errors.js';
|
|
4
|
+
export function addSkillsCommands(program) {
|
|
5
|
+
const skills = program.command('skills').description('Manage agent skills');
|
|
6
|
+
skills
|
|
7
|
+
.command('init')
|
|
8
|
+
.description('Fetch and install system skills for an AI coding agent')
|
|
9
|
+
.argument('[agent-or-path]', `agent (${Object.keys(AGENTS).join('|')}) or target directory`)
|
|
10
|
+
.argument('[path]', 'target directory when agent is specified (defaults to current directory)')
|
|
11
|
+
.option('-f, --force', 'overwrite existing skills')
|
|
12
|
+
.action(async (agentOrPath, targetPath, options, cmd) => {
|
|
13
|
+
if (!agentOrPath) {
|
|
14
|
+
cmd.help();
|
|
15
|
+
}
|
|
16
|
+
else if (agentOrPath in AGENTS) {
|
|
17
|
+
await AGENTS[agentOrPath].initSkills({ ...options, path: targetPath });
|
|
18
|
+
}
|
|
19
|
+
else if (targetPath) {
|
|
20
|
+
throw new CliError('INVALID_PARAM', `Unknown agent '${agentOrPath}'. Valid choices: ${Object.keys(AGENTS).join(', ')}`);
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
await initSkills({ ...options, path: agentOrPath });
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
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AAC;aAAM,CAAC;YACJ,MAAM,UAAU,CAAC,EAAE,GAAG,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAA;QACvD,CAAC;IACL,CAAC,CACJ,CAAA;AACT,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import solutionCreate from '../../lib/solution/create.js';
|
|
2
|
+
import solutionBuild from '../../lib/solution/build.js';
|
|
3
|
+
import { solutionDeploy } from '../../lib/solution/deploy.js';
|
|
4
|
+
import { solutionList } from '../../lib/solution/list.js';
|
|
5
|
+
import { solutionLogs } from '../../lib/solution/logs.js';
|
|
6
|
+
import { solutionStatus } from '../../lib/solution/status.js';
|
|
7
|
+
import { validateSolution } from '../../lib/validate.js';
|
|
8
|
+
export function addSolutionCommands(program) {
|
|
9
|
+
const solution = program.command('solution').alias('s').description('Manage solutions');
|
|
10
|
+
solution
|
|
11
|
+
.command('create')
|
|
12
|
+
.description('Create a solution in the current directory')
|
|
13
|
+
.option('-n, --name <name>', 'solution name')
|
|
14
|
+
.option('-d, --description <desc>', 'solution description')
|
|
15
|
+
.option('--force', 'overwrite solution.yaml, keep assets/')
|
|
16
|
+
.option('--reset', 'wipe assets/ and overwrite solution.yaml')
|
|
17
|
+
.action((options) => solutionCreate([], options));
|
|
18
|
+
solution
|
|
19
|
+
.command('validate')
|
|
20
|
+
.description('Validate the solution in the current directory')
|
|
21
|
+
.action(() => validateSolution([], {}));
|
|
22
|
+
solution
|
|
23
|
+
.command('build')
|
|
24
|
+
.description('Build a zip archive from the current solution')
|
|
25
|
+
.action(() => solutionBuild([], {}));
|
|
26
|
+
solution
|
|
27
|
+
.command('list')
|
|
28
|
+
.description('List solutions from the backend')
|
|
29
|
+
.action(() => solutionList());
|
|
30
|
+
const deploy = solution
|
|
31
|
+
.command('deploy')
|
|
32
|
+
.description('Deploy a zip file to the backend, or manage deployments')
|
|
33
|
+
.argument('[file]', 'zip file to deploy')
|
|
34
|
+
.option('-f, --file <path>', 'zip file to deploy (takes precedence over positional arg)')
|
|
35
|
+
.action((file, options) => solutionDeploy(file ? [file] : [], options));
|
|
36
|
+
deploy
|
|
37
|
+
.command('status')
|
|
38
|
+
.description('Show deployment status for a solution')
|
|
39
|
+
.argument('[id]', 'solution id')
|
|
40
|
+
.option('--version <version>', 'solution version')
|
|
41
|
+
.action((id, options) => solutionStatus(id ? [id] : [], options));
|
|
42
|
+
deploy
|
|
43
|
+
.command('logs')
|
|
44
|
+
.description('Fetch deployment logs for a solution job')
|
|
45
|
+
.argument('[id]', 'solution id')
|
|
46
|
+
.option('--version <version>', 'solution version')
|
|
47
|
+
.option('--job <job-id>', 'job id')
|
|
48
|
+
.option('--tail <n>', 'number of lines from the end')
|
|
49
|
+
.option('--limit <n>', 'maximum number of log lines')
|
|
50
|
+
.action((id, options) => solutionLogs(id ? [id] : [], options));
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=solution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solution.js","sourceRoot":"","sources":["../../../bin/commands/solution.ts"],"names":[],"mappings":"AAKA,OAAO,cAAc,MAAM,8BAA8B,CAAA;AACzD,OAAO,aAAa,MAAM,6BAA6B,CAAA;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAExD,MAAM,UAAU,mBAAmB,CAAC,OAAgB;IAChD,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAA;IAEvF,QAAQ;SACH,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,C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Aa,CAAC;SAC/B,MAAM,CAAC,qBAAqB,EAAE,kBAAkB,CAAC;SACjD,MAAM,CAAC,CAAC,EAAsB,EAAE,OAA8B,EAAE,EAAE,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC,CAAA;IAEhH,MAAM;SACD,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,0CAA0C,CAAC;SACvD,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;SAC/B,MAAM,CAAC,qBAAqB,EAAE,kBAAkB,CAAC;SACjD,MAAM,CAAC,gBAAgB,EAAE,QAAQ,CAAC;SAClC,MAAM,CAAC,YAAY,EAAE,8BAA8B,CAAC;SACpD,MAAM,CAAC,aAAa,EAAE,6BAA6B,CAAC;SACpD,MAAM,CAAC,CAAC,EAAsB,EAAE,OAA4B,EAAE,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC,CAAA;AAChH,CAAC"}
|
package/dist/bin/help.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import term from '../lib/term.js';
|
|
2
|
+
// Appended to `jl --help` output after the auto-generated command list.
|
|
3
|
+
export const EXTRA_HELP = `
|
|
4
|
+
${term.bold('ASSET TYPES')}
|
|
5
|
+
|
|
6
|
+
agent Agent asset — AI agent with container and health probe configuration
|
|
7
|
+
agent-extension Agent extension asset — extends a base agent with additional capabilities
|
|
8
|
+
base-ui Base UI asset — AppRouter-based frontend web application (Next.js, React, etc.)
|
|
9
|
+
cap-app CAP application asset — Node.js CAP service with container and health probe configuration
|
|
10
|
+
data-product Data product asset — data consumption and production with governance configuration
|
|
11
|
+
domain-model-extension Domain model extension asset — adds custom fields to existing CAP entities
|
|
12
|
+
mcp-server MCP server asset — API-to-MCP tool mapping (type: mcp-translation, asset.yaml + translation.json + api-spec.json)
|
|
13
|
+
n8n-workflow n8n workflow asset — n8n automation workflow integration
|
|
14
|
+
vercel-app Vercel app asset — Vercel-deployed frontend application
|
|
15
|
+
|
|
16
|
+
Names must be DNS-compatible: lowercase letters, digits, and hyphens only (1–63 chars).
|
|
17
|
+
|
|
18
|
+
${term.bold('SHORTCUTS')}
|
|
19
|
+
|
|
20
|
+
s → solution
|
|
21
|
+
a → asset
|
|
22
|
+
pc → pro-code
|
|
23
|
+
|
|
24
|
+
${term.bold('EXAMPLES')}
|
|
25
|
+
|
|
26
|
+
jl login
|
|
27
|
+
jl solution create --name my-solution
|
|
28
|
+
jl solution build
|
|
29
|
+
jl solution deploy ./my-solution.zip
|
|
30
|
+
jl solution list
|
|
31
|
+
jl solution deploy status
|
|
32
|
+
jl solution deploy logs --tail 100
|
|
33
|
+
jl mcp tools n8n-mcp
|
|
34
|
+
jl mcp call n8n-mcp validate-n8n-workflow workflow="..."
|
|
35
|
+
jl mcp call n8n-mcp validate-n8n-workflow --params args.json
|
|
36
|
+
jl asset create agent --name my-agent
|
|
37
|
+
jl asset create cap-app --name my-service
|
|
38
|
+
jl asset create mcp-server --name my-mcp
|
|
39
|
+
jl asset delete my-agent
|
|
40
|
+
jl solution validate
|
|
41
|
+
`;
|
|
42
|
+
//# sourceMappingURL=help.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"help.js","sourceRoot":"","sources":["../../bin/help.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,gBAAgB,CAAA;AAEjC,wEAAwE;AACxE,MAAM,CAAC,MAAM,UAAU,GAAG;IACtB,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC;;;;;;;;;;;;;;IAcxB,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC;;;;;;IAMtB,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC;;;;;;;;;;;;;;;;;CAiBxB,CAAA"}
|
package/dist/bin/jl.js
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Command } from 'commander';
|
|
3
|
+
import fs from 'node:fs';
|
|
4
|
+
import { createRequire } from 'node:module';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
import { fileURLToPath } from 'node:url';
|
|
7
|
+
import { CliError } from '../lib/errors.js';
|
|
8
|
+
import { addA2aCommands } from './commands/a2a.js';
|
|
9
|
+
import { addAssetCommands } from './commands/asset.js';
|
|
10
|
+
import { addAuthCommands } from './commands/auth.js';
|
|
11
|
+
import { addInitCommands } from './commands/init.js';
|
|
12
|
+
import { addMcpCommands } from './commands/mcp.js';
|
|
13
|
+
import { addProCodeCommands } from './commands/pro-code.js';
|
|
14
|
+
import { addSkillsCommands } from './commands/skills.js';
|
|
15
|
+
import { addSolutionCommands } from './commands/solution.js';
|
|
16
|
+
import { EXTRA_HELP } from './help.js';
|
|
17
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
18
|
+
const require = createRequire(import.meta.url);
|
|
19
|
+
const pkg = require('../package.json');
|
|
20
|
+
export function createProgram() {
|
|
21
|
+
const program = new Command();
|
|
22
|
+
program.name('jl').description('Solution Management CLI').addHelpText('after', EXTRA_HELP);
|
|
23
|
+
addSolutionCommands(program);
|
|
24
|
+
addAssetCommands(program);
|
|
25
|
+
addMcpCommands(program);
|
|
26
|
+
addA2aCommands(program);
|
|
27
|
+
addProCodeCommands(program);
|
|
28
|
+
addInitCommands(program);
|
|
29
|
+
addSkillsCommands(program);
|
|
30
|
+
addAuthCommands(program);
|
|
31
|
+
program
|
|
32
|
+
.command('version')
|
|
33
|
+
.alias('v')
|
|
34
|
+
.description('Show the jl client version number')
|
|
35
|
+
.action(() => console.log(`jl v${pkg.version}`));
|
|
36
|
+
return program;
|
|
37
|
+
}
|
|
38
|
+
const program = createProgram();
|
|
39
|
+
export default program;
|
|
40
|
+
// Guard: process.argv[1] is the script Node was invoked with. When this file is
|
|
41
|
+
// the entry point (e.g. `node dist/bin/jl.js`), argv[1] resolves to __filename
|
|
42
|
+
// and we run the CLI. When it is imported as a module in tests, argv[1] points
|
|
43
|
+
// to the Jest worker instead, so this block is skipped and parsing is not triggered.
|
|
44
|
+
if (fs.realpathSync(path.resolve(process.argv[1])) === fs.realpathSync(__filename)) {
|
|
45
|
+
program.parseAsync(process.argv).catch((err) => {
|
|
46
|
+
process.exitCode = 1;
|
|
47
|
+
if (CliError.isCliError(err)) {
|
|
48
|
+
console.error(`[${err.code}] ${err.message}`);
|
|
49
|
+
}
|
|
50
|
+
else if (typeof err === 'string') {
|
|
51
|
+
// TODO: remove once all throw 'string' sites are migrated to CliError
|
|
52
|
+
console.error(err);
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
console.error(err.message ?? String(err));
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=jl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jl.js","sourceRoot":"","sources":["../../bin/jl.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,MAAM,SAAS,CAAA;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAC3D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E,qFAAqF;AACrF,IAAI,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,EAAE,CAAC;IACjF,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;QACpD,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAA;QACpB,IAAI,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YAC3B,OAAO,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,IAAI,KAAK,GAAG,CAAC,OAAO,EAAE,CAAC,CAAA;QACjD,CAAC;aAAM,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;YACjC,sEAAsE;YACtE,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;QACtB,CAAC;aAAM,CAAC;YACJ,OAAO,CAAC,KAAK,CAAE,GAAa,CAAC,OAAO,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAA;QACxD,CAAC;IACL,CAAC,CAAC,CAAA;AACN,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import readline from 'node:readline';
|
|
2
|
+
import { authorizedFetch, deleteCredentials, getStoredUrl, headlessLogin, loadCredentials, saveCookies, } from '../lib/auth.js';
|
|
3
|
+
import term from '../lib/term.js';
|
|
4
|
+
import { CliError } from '../lib/errors.js';
|
|
5
|
+
function prompt(question) {
|
|
6
|
+
return new Promise(resolve => {
|
|
7
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
8
|
+
rl.question(question, answer => {
|
|
9
|
+
rl.close();
|
|
10
|
+
resolve(answer);
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
function promptPassword(question) {
|
|
15
|
+
return new Promise(resolve => {
|
|
16
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
17
|
+
let prompted = false;
|
|
18
|
+
rl._writeToOutput = str => {
|
|
19
|
+
if (!prompted) {
|
|
20
|
+
process.stdout.write(str);
|
|
21
|
+
prompted = true;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
rl.question(question, answer => {
|
|
25
|
+
process.stdout.write('\n');
|
|
26
|
+
rl.close();
|
|
27
|
+
resolve(answer);
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
async function login(args, { username: optUsername } = {}) {
|
|
32
|
+
const rawUrl = args[0] ?? process.env.JL_URL ?? getStoredUrl();
|
|
33
|
+
if (!rawUrl) {
|
|
34
|
+
throw new CliError('AUTH_URL_REQUIRED', 'A backend URL is required. Pass it as an argument or set JL_URL. Example: jl login https://your-tenant.cloud.sap');
|
|
35
|
+
}
|
|
36
|
+
const url = rawUrl.replace(/\/+$/, '');
|
|
37
|
+
const existing = loadCredentials(url);
|
|
38
|
+
if (existing?.loggedInAt && Date.now() - existing.loggedInAt < 30 * 60 * 1000) {
|
|
39
|
+
console.log(`${term.yellow('!')} Already logged in to ${term.bold(url)}.`);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const username = optUsername ?? process.env.JL_USERNAME ?? (await prompt('Email: '));
|
|
43
|
+
const password = process.env.JL_PASSWORD ?? (await promptPassword('Password: '));
|
|
44
|
+
const nonInteractive = (optUsername || process.env.JL_USERNAME) && process.env.JL_PASSWORD;
|
|
45
|
+
console.log(`${nonInteractive ? '' : '\n'}Logging in...`);
|
|
46
|
+
const { cookies, expiresAt } = await headlessLogin(url, username, password);
|
|
47
|
+
const expiryMsg = expiresAt ? term.dim(` (session expires ${new Date(expiresAt).toLocaleString()})`) : '';
|
|
48
|
+
saveCookies(url, cookies, expiresAt);
|
|
49
|
+
try {
|
|
50
|
+
await authorizedFetch('/destinations/DYN_AGENTS_SERVICE/api/v1/feature-flags');
|
|
51
|
+
console.log(`${term.green('✓')} Logged in to ${term.bold(url)}${expiryMsg}`);
|
|
52
|
+
}
|
|
53
|
+
catch (err) {
|
|
54
|
+
console.log(term.red(` No backend found for ${url} - is the URL correct?`));
|
|
55
|
+
deleteCredentials(url);
|
|
56
|
+
throw err;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
export default login;
|
|
60
|
+
//# sourceMappingURL=login.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"login.js","sourceRoot":"","sources":["../../bin/login.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,eAAe,CAAA;AACpC,OAAO,EACH,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,eAAe,EACf,WAAW,GACd,MAAM,gBAAgB,CAAA;AACvB,OAAO,IAAI,MAAM,gBAAgB,CAAA;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAE3C,SAAS,MAAM,CAAC,QAAgB;IAC5B,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE;QACzB,MAAM,EAAE,GAAG,QAAQ,CAAC,eAAe,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAA;QACrF,EAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,EAAE;YAC3B,EAAE,CAAC,KAAK,EAAE,CAAA;YACV,OAAO,CAAC,MAAM,CAAC,CAAA;QACnB,CAAC,CAAC,CAAA;IACN,CAAC,CAAC,CAAA;AACN,CAAC;AAED,SAAS,cAAc,CAAC,QAAgB;IACpC,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE;QACzB,MAAM,EAAE,GAAG,QAAQ,CAAC,eAAe,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAA;QACrF,IAAI,QAAQ,GAAG,KA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|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { deleteCredentials, getStoredUrl, isSessionExpired, loadCredentials, serverLogout } from '../lib/auth.js';
|
|
2
|
+
import term from '../lib/term.js';
|
|
3
|
+
async function logout(args) {
|
|
4
|
+
const url = args[0] ?? getStoredUrl();
|
|
5
|
+
if (!url || !loadCredentials(url)) {
|
|
6
|
+
console.log(`${term.yellow('!')} No stored credentials for ${term.bold(url)}.`);
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
const expired = isSessionExpired(url);
|
|
10
|
+
try {
|
|
11
|
+
await serverLogout(url);
|
|
12
|
+
}
|
|
13
|
+
catch {
|
|
14
|
+
console.log(`${term.yellow('!')} Server-side session could not be invalidated — local credentials removed.`);
|
|
15
|
+
}
|
|
16
|
+
deleteCredentials(url);
|
|
17
|
+
const note = expired ? term.dim(' (session was already expired)') : '';
|
|
18
|
+
console.log(`${term.green('✓')} Logged out from ${term.bold(url)}.${note}`);
|
|
19
|
+
}
|
|
20
|
+
export default logout;
|
|
21
|
+
//# sourceMappingURL=logout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logout.js","sourceRoot":"","sources":["../../bin/logout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AACjH,OAAO,IAAI,MAAM,gBAAgB,CAAA;AAEjC,KAAK,UAAU,MAAM,CAAC,IAAc;IAChC,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,YAAY,EAAE,CAAA;IACrC,IAAI,CAAC,GAAG,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,EAAE,CAAC;QAChC,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,8BAA8B,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QAC/E,OAAM;IACV,CAAC;IACD,MAAM,OAAO,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAA;IACrC,IAAI,CAAC;QACD,MAAM,YAAY,CAAC,GAAG,CAAC,CAAA;IAC3B,CAAC;IAAC,MAAM,CAAC;QACL,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,4EAA4E,CAAC,CAAA;IAChH,CAAC;IACD,iBAAiB,CAAC,GAAG,CAAC,CAAA;IACtB,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;IACtE,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,oBAAoB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,CAAA;AAC/E,CAAC;AAED,eAAe,MAAM,CAAA"}
|