feat: Complete zCode CLI X with Telegram bot integration

- Add full Telegram bot functionality with Z.AI API integration
- Implement 4 tools: Bash, FileEdit, WebSearch, Git
- Add 3 agents: Code Reviewer, Architect, DevOps Engineer
- Add 6 skills for common coding tasks
- Add systemd service file for 24/7 operation
- Add nginx configuration for HTTPS webhook
- Add comprehensive documentation
- Implement WebSocket server for real-time updates
- Add logging system with Winston
- Add environment validation

🤖 zCode CLI X - Agentic coder with Z.AI + Telegram integration
This commit is contained in:
admin
2026-05-05 09:01:26 +00:00
Unverified
parent 4a7035dd92
commit 875c7f9b91
24688 changed files with 3224957 additions and 221 deletions

View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2022 commander-js
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -0,0 +1,73 @@
# extra-typings for commander
[![NPM Version](http://img.shields.io/npm/v/@commander-js/extra-typings.svg?style=flat)](https://www.npmjs.org/package/@commander-js/extra-typings)
[![NPM Downloads](https://img.shields.io/npm/dm/@commander-js/extra-typings.svg?style=flat)](https://npmcharts.com/compare/@commander-js/extra-typings?minimal=true)
This package offers TypeScript typings for `commander` which infer strong types for:
- all the parameters of the action handler, including the options
- options returned by `.opts()`
The runtime is supplied by commander. This package is all about the typings.
Usage
- install `@commander-js/extra-typings` using your preferred package manager
- install `commander`, if not already installed (peer dependency)
- in code import from `@commander-js/extra-typings` instead of `commander`
The installed version of this package should match the major and minor version numbers of the installed commander package, but the patch version number is independent (following pattern used by [Definitely Typed](https://github.com/DefinitelyTyped/DefinitelyTyped#how-do-definitely-typed-package-versions-relate-to-versions-of-the-corresponding-library)).
Credit: this builds on work by @PaperStrike in <https://github.com/tj/commander.js/pull/1758>
## Limitations
- the generics lead to some noisy types visible in editor and errors
- some minor code changes required for subclasses of `Command`, `Argument`, or `Option` (see [subclass.test-d.ts](./tests/subclass.test-d.ts))
- chaining methods which do type inference return base class rather than `this`
- subclass of `Command` returns base class not subclass from `.command(name)`
- type parameter needed for class declaration of subclass of `Option` and `Argument`
## Usage tips
The types are built up as the options and arguments are defined. The usage pattern for action handlers is easy. Just chain the action handler after the options and arguments.
```typescript
import { program } from '@commander-js/extra-typings';
program.command('print')
.argument('<file>')
.option('--double-sided')
.action((targetFile, options) => {
// command-arguments and options are fully typed
});
```
For working with a single command without an action handler, the configuration need to be done at the same time as the variable is declared.
```typescript
import { Command } from '@commander-js/extra-typings';
// broken pattern
const program = new Command(); // program type does not include options or arguments
program.option('-d, --debug'); // adding option does not change type of program
const options = program.opts(); // dumb type
```
```typescript
import { Command } from '@commander-js/extra-typings';
// working pattern
const program = new Command()
.option('-d, --debug'); // program type includes chained options and arguments
const options = program.opts(); // smart type
```
Use a "const assertion" on the choices to narrow the option type from `string`:
```typescript
const program = new Command()
.addOption(new Option('--drink-size <size>').choices(['small', 'medium', 'large'] as const))
.parse();
const drinkSize = program.opts().drinkSize; // "small" | "medium" | "large" | undefined
```

View File

@@ -0,0 +1,2 @@
// Just reexport the types from cjs definition file.
export * from './index.js';

View File

@@ -0,0 +1,16 @@
import extraTypingsCommander from './index.js';
// wrapper to provide named exports for ESM.
export const {
program,
createCommand,
createArgument,
createOption,
CommanderError,
InvalidArgumentError,
InvalidOptionArgumentError, // deprecated old name
Command,
Argument,
Option,
Help,
} = extraTypingsCommander;

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,28 @@
const commander = require('commander');
exports = module.exports = {};
// Return a different global program than commander,
// and don't also return it as default export.
exports.program = new commander.Command();
/**
* Expose classes. The FooT versions are just types, so return Commander original implementations!
*/
exports.Argument = commander.Argument;
exports.Command = commander.Command;
exports.CommanderError = commander.CommanderError;
exports.Help = commander.Help;
exports.InvalidArgumentError = commander.InvalidArgumentError;
exports.InvalidOptionArgumentError = commander.InvalidArgumentError; // Deprecated
exports.Option = commander.Option;
// In Commander, the create routines end up being aliases for the matching
// methods on the global program due to the (deprecated) legacy default export.
// Here we roll our own, the way Commander might in future.
exports.createCommand = (name) => new commander.Command(name);
exports.createOption = (flags, description) =>
new commander.Option(flags, description);
exports.createArgument = (name, description) =>
new commander.Argument(name, description);

View File

@@ -0,0 +1,63 @@
{
"name": "@commander-js/extra-typings",
"version": "12.1.0",
"description": "Infer strong typings for commander options and action handlers",
"main": "index.js",
"scripts": {
"check": "npm run check:type && npm run check:lint && npm run check:format",
"check:format": "prettier --check .",
"check:lint": "eslint .",
"check:type": "tsd && tsc",
"fix": "npm run fix:lint && npm run fix:format",
"fix:format": "prettier --write .",
"fix:lint": "eslint --fix .",
"prepublishOnly": "npm run --silent test",
"test": "tsd && jest"
},
"repository": {
"type": "git",
"url": "git+https://github.com/commander-js/extra-typings.git"
},
"files": [
"esm.mjs",
"esm.d.mts",
"index.js",
"index.d.ts"
],
"type": "commonjs",
"exports": {
".": {
"require": "./index.js",
"import": "./esm.mjs"
}
},
"types": "index.d.ts",
"tsd": {
"directory": "tests"
},
"keywords": [],
"author": "",
"license": "MIT",
"bugs": {
"url": "https://github.com/commander-js/extra-typings/issues"
},
"homepage": "https://github.com/commander-js/extra-typings#readme",
"peerDependencies": {
"commander": "~12.1.0"
},
"devDependencies": {
"@types/jest": "^29.2.6",
"@types/node": "^20.11.7",
"commander": "~12.1.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-jest": "^27.9.0",
"globals": "^15.0.0",
"jest": "^29.3.1",
"prettier": "^3.2.5",
"ts-jest": "^29.0.5",
"tsd": "^0.30.4",
"typescript": "^5.3.3",
"typescript-eslint": "^7.5.0"
}
}