kodu 1.1.13 → 1.1.15

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.
Files changed (88) hide show
  1. package/AGENTS.md +184 -199
  2. package/README.md +32 -3
  3. package/dist/src/app.module.js +2 -0
  4. package/dist/src/app.module.js.map +1 -1
  5. package/dist/src/commands/init/init.command.js +16 -0
  6. package/dist/src/commands/init/init.command.js.map +1 -1
  7. package/dist/src/commands/ops/ops.command.d.ts +4 -0
  8. package/dist/src/commands/ops/ops.command.js +39 -0
  9. package/dist/src/commands/ops/ops.command.js.map +1 -0
  10. package/dist/src/commands/ops/ops.module.d.ts +2 -0
  11. package/dist/src/commands/ops/ops.module.js +33 -0
  12. package/dist/src/commands/ops/ops.module.js.map +1 -0
  13. package/dist/src/commands/ops/ops.types.d.ts +13 -0
  14. package/dist/src/commands/ops/ops.types.js +12 -0
  15. package/dist/src/commands/ops/ops.types.js.map +1 -0
  16. package/dist/src/commands/ops/ops.utils.d.ts +13 -0
  17. package/dist/src/commands/ops/ops.utils.js +117 -0
  18. package/dist/src/commands/ops/ops.utils.js.map +1 -0
  19. package/dist/src/commands/ops/subcommands/ops-env.command.d.ts +17 -0
  20. package/dist/src/commands/ops/subcommands/ops-env.command.js +109 -0
  21. package/dist/src/commands/ops/subcommands/ops-env.command.js.map +1 -0
  22. package/dist/src/commands/ops/subcommands/ops-routes.command.d.ts +18 -0
  23. package/dist/src/commands/ops/subcommands/ops-routes.command.js +166 -0
  24. package/dist/src/commands/ops/subcommands/ops-routes.command.js.map +1 -0
  25. package/dist/src/commands/ops/subcommands/ops-service.command.d.ts +16 -0
  26. package/dist/src/commands/ops/subcommands/ops-service.command.js +128 -0
  27. package/dist/src/commands/ops/subcommands/ops-service.command.js.map +1 -0
  28. package/dist/src/commands/ops/subcommands/ops-sysinfo.command.d.ts +9 -0
  29. package/dist/src/commands/ops/subcommands/ops-sysinfo.command.js +60 -0
  30. package/dist/src/commands/ops/subcommands/ops-sysinfo.command.js.map +1 -0
  31. package/dist/src/commands/pack/pack.command.js +1 -2
  32. package/dist/src/commands/pack/pack.command.js.map +1 -1
  33. package/dist/src/core/config/config.schema.d.ts +28 -0
  34. package/dist/src/core/config/config.schema.js +19 -0
  35. package/dist/src/core/config/config.schema.js.map +1 -1
  36. package/dist/src/core/file-system/fs.service.d.ts +4 -1
  37. package/dist/src/core/file-system/fs.service.js +57 -21
  38. package/dist/src/core/file-system/fs.service.js.map +1 -1
  39. package/dist/src/shared/constants.d.ts +1 -0
  40. package/dist/src/shared/constants.js +2 -1
  41. package/dist/src/shared/constants.js.map +1 -1
  42. package/dist/src/shared/ssh/ssh.module.d.ts +2 -0
  43. package/dist/src/shared/ssh/ssh.module.js +21 -0
  44. package/dist/src/shared/ssh/ssh.module.js.map +1 -0
  45. package/dist/src/shared/ssh/ssh.service.d.ts +11 -0
  46. package/dist/src/shared/ssh/ssh.service.js +53 -0
  47. package/dist/src/shared/ssh/ssh.service.js.map +1 -0
  48. package/dist/src/shared/tokenizer/tokenizer.service.js +1 -1
  49. package/dist/src/shared/tokenizer/tokenizer.service.js.map +1 -1
  50. package/dist/tsconfig.build.tsbuildinfo +1 -1
  51. package/docs/plans/2026-03-01-agentops-design.md +194 -0
  52. package/docs/plans/2026-03-01-agentops-implementation.md +358 -0
  53. package/kodu.json +15 -0
  54. package/kodu.schema.json +59 -0
  55. package/package.json +1 -1
  56. package/src/app.module.ts +2 -0
  57. package/src/commands/init/init.command.ts +16 -0
  58. package/src/commands/ops/ops.command.ts +30 -0
  59. package/src/commands/ops/ops.module.ts +20 -0
  60. package/src/commands/ops/ops.types.ts +24 -0
  61. package/src/commands/ops/ops.utils.ts +156 -0
  62. package/src/commands/ops/subcommands/ops-env.command.ts +121 -0
  63. package/src/commands/ops/subcommands/ops-routes.command.ts +185 -0
  64. package/src/commands/ops/subcommands/ops-service.command.ts +154 -0
  65. package/src/commands/ops/subcommands/ops-sysinfo.command.ts +53 -0
  66. package/src/commands/pack/pack.command.ts +1 -2
  67. package/src/core/config/config.schema.ts +23 -0
  68. package/src/core/file-system/fs.service.ts +72 -23
  69. package/src/shared/constants.ts +1 -0
  70. package/src/shared/ssh/ssh.module.ts +8 -0
  71. package/src/shared/ssh/ssh.service.ts +61 -0
  72. package/src/shared/tokenizer/tokenizer.service.ts +2 -2
  73. package/.cursor/commands/openspec-apply.md +0 -23
  74. package/.cursor/commands/openspec-archive.md +0 -27
  75. package/.cursor/commands/openspec-proposal.md +0 -28
  76. package/.windsurf/workflows/openspec-apply.md +0 -21
  77. package/.windsurf/workflows/openspec-archive.md +0 -25
  78. package/.windsurf/workflows/openspec-proposal.md +0 -26
  79. package/openspec/AGENTS.md +0 -456
  80. package/openspec/changes/archive/2026-01-26-translate-project-to-english/design.md +0 -30
  81. package/openspec/changes/archive/2026-01-26-translate-project-to-english/proposal.md +0 -17
  82. package/openspec/changes/archive/2026-01-26-translate-project-to-english/specs/ai/spec.md +0 -26
  83. package/openspec/changes/archive/2026-01-26-translate-project-to-english/specs/cleaner/spec.md +0 -26
  84. package/openspec/changes/archive/2026-01-26-translate-project-to-english/specs/config/spec.md +0 -22
  85. package/openspec/changes/archive/2026-01-26-translate-project-to-english/specs/ui/spec.md +0 -33
  86. package/openspec/changes/archive/2026-01-26-translate-project-to-english/tasks.md +0 -33
  87. package/openspec/project.md +0 -72
  88. package/openspec/specs/cleaner/spec.md +0 -31
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.OpsModule = void 0;
10
+ const common_1 = require("@nestjs/common");
11
+ const config_module_1 = require("../../core/config/config.module");
12
+ const ssh_module_1 = require("../../shared/ssh/ssh.module");
13
+ const ops_command_1 = require("./ops.command");
14
+ const ops_env_command_1 = require("./subcommands/ops-env.command");
15
+ const ops_routes_command_1 = require("./subcommands/ops-routes.command");
16
+ const ops_service_command_1 = require("./subcommands/ops-service.command");
17
+ const ops_sysinfo_command_1 = require("./subcommands/ops-sysinfo.command");
18
+ let OpsModule = class OpsModule {
19
+ };
20
+ exports.OpsModule = OpsModule;
21
+ exports.OpsModule = OpsModule = __decorate([
22
+ (0, common_1.Module)({
23
+ imports: [config_module_1.ConfigModule, ssh_module_1.SshModule],
24
+ providers: [
25
+ ops_command_1.OpsCommand,
26
+ ops_sysinfo_command_1.OpsSysinfoCommand,
27
+ ops_env_command_1.OpsEnvCommand,
28
+ ops_routes_command_1.OpsRoutesCommand,
29
+ ops_service_command_1.OpsServiceCommand,
30
+ ],
31
+ })
32
+ ], OpsModule);
33
+ //# sourceMappingURL=ops.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ops.module.js","sourceRoot":"","sources":["../../../../src/commands/ops/ops.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,mEAA+D;AAC/D,4DAAwD;AACxD,+CAA2C;AAC3C,mEAA8D;AAC9D,yEAAoE;AACpE,2EAAsE;AACtE,2EAAsE;AAY/D,IAAM,SAAS,GAAf,MAAM,SAAS;CAAG,CAAA;AAAZ,8BAAS;oBAAT,SAAS;IAVrB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,4BAAY,EAAE,sBAAS,CAAC;QAClC,SAAS,EAAE;YACT,wBAAU;YACV,uCAAiB;YACjB,+BAAa;YACb,qCAAgB;YAChB,uCAAiB;SAClB;KACF,CAAC;GACW,SAAS,CAAG"}
@@ -0,0 +1,13 @@
1
+ import type { ServerConfig } from '../../core/config/config.schema';
2
+ export type OpsErrorCode = 'CLI_ERROR' | 'CONFIG_ERROR' | 'NOT_FOUND' | 'VALIDATION_ERROR';
3
+ export type ResolvedServerConfig = ServerConfig & {
4
+ sshKeyPath: string;
5
+ paths?: {
6
+ apps: string;
7
+ caddy?: string;
8
+ };
9
+ };
10
+ export declare class OpsCliError extends Error {
11
+ readonly code: OpsErrorCode;
12
+ constructor(code: OpsErrorCode, message: string);
13
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OpsCliError = void 0;
4
+ class OpsCliError extends Error {
5
+ code;
6
+ constructor(code, message) {
7
+ super(message);
8
+ this.code = code;
9
+ }
10
+ }
11
+ exports.OpsCliError = OpsCliError;
12
+ //# sourceMappingURL=ops.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ops.types.js","sourceRoot":"","sources":["../../../../src/commands/ops/ops.types.ts"],"names":[],"mappings":";;;AAgBA,MAAa,WAAY,SAAQ,KAAK;IAElB;IADlB,YACkB,IAAkB,EAClC,OAAe;QAEf,KAAK,CAAC,OAAO,CAAC,CAAC;QAHC,SAAI,GAAJ,IAAI,CAAc;IAIpC,CAAC;CACF;AAPD,kCAOC"}
@@ -0,0 +1,13 @@
1
+ import type { KoduConfig } from '../../core/config/config.schema';
2
+ import type { SshResult } from '../../shared/ssh/ssh.service';
3
+ import { type ResolvedServerConfig } from './ops.types';
4
+ export declare function printJson(payload: unknown, isError?: boolean): void;
5
+ export declare function printCliError(error: unknown): void;
6
+ export declare function printSshError(result: SshResult, command: string): void;
7
+ export declare function resolveServerOrThrow(config: KoduConfig, alias: string): Promise<ResolvedServerConfig>;
8
+ export declare function resolveAppsPath(server: ResolvedServerConfig): string;
9
+ export declare function resolveCaddyPath(server: ResolvedServerConfig): string;
10
+ export declare function shellQuote(value: string): string;
11
+ export declare function ensureEnvKey(key: string | undefined): string;
12
+ export declare function ensureRequired(value: string | undefined, name: string): string;
13
+ export declare function ensureAction<T extends string>(value: string, allowed: readonly T[], context: string): T;
@@ -0,0 +1,117 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.printJson = printJson;
7
+ exports.printCliError = printCliError;
8
+ exports.printSshError = printSshError;
9
+ exports.resolveServerOrThrow = resolveServerOrThrow;
10
+ exports.resolveAppsPath = resolveAppsPath;
11
+ exports.resolveCaddyPath = resolveCaddyPath;
12
+ exports.shellQuote = shellQuote;
13
+ exports.ensureEnvKey = ensureEnvKey;
14
+ exports.ensureRequired = ensureRequired;
15
+ exports.ensureAction = ensureAction;
16
+ const promises_1 = require("node:fs/promises");
17
+ const node_path_1 = __importDefault(require("node:path"));
18
+ const ops_types_1 = require("./ops.types");
19
+ const DEFAULT_APPS_PATH = '/var/agent-apps';
20
+ function printJson(payload, isError = false) {
21
+ const line = JSON.stringify(payload);
22
+ if (isError) {
23
+ console.error(line);
24
+ return;
25
+ }
26
+ console.log(line);
27
+ }
28
+ function printCliError(error) {
29
+ const cliError = toCliError(error);
30
+ printJson({
31
+ status: 'error',
32
+ code: cliError.code,
33
+ error: cliError.message,
34
+ }, true);
35
+ }
36
+ function printSshError(result, command) {
37
+ printJson({
38
+ status: 'error',
39
+ code: result.exitCode,
40
+ stderr: result.stderr || result.error || 'Unknown SSH error',
41
+ command,
42
+ });
43
+ }
44
+ async function resolveServerOrThrow(config, alias) {
45
+ const servers = config.ops?.servers;
46
+ if (!servers) {
47
+ throw new ops_types_1.OpsCliError('CONFIG_ERROR', 'ops.servers not configured in kodu.json');
48
+ }
49
+ const server = servers[alias];
50
+ if (!server) {
51
+ throw new ops_types_1.OpsCliError('VALIDATION_ERROR', `Server alias '${alias}' not found in kodu.json`);
52
+ }
53
+ const resolved = normalizeServer(server);
54
+ await assertSshKeyExists(resolved.sshKeyPath);
55
+ return resolved;
56
+ }
57
+ function resolveAppsPath(server) {
58
+ return server.paths?.apps ?? DEFAULT_APPS_PATH;
59
+ }
60
+ function resolveCaddyPath(server) {
61
+ return (server.paths?.caddy ?? node_path_1.default.posix.join(resolveAppsPath(server), 'caddy'));
62
+ }
63
+ function shellQuote(value) {
64
+ return `'${value.replace(/'/g, `'"'"'`)}'`;
65
+ }
66
+ function ensureEnvKey(key) {
67
+ if (!key) {
68
+ throw new ops_types_1.OpsCliError('VALIDATION_ERROR', 'Option --key is required');
69
+ }
70
+ if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(key)) {
71
+ throw new ops_types_1.OpsCliError('VALIDATION_ERROR', 'Invalid env key format. Allowed: [A-Za-z_][A-Za-z0-9_]*');
72
+ }
73
+ return key;
74
+ }
75
+ function ensureRequired(value, name) {
76
+ if (!value) {
77
+ throw new ops_types_1.OpsCliError('VALIDATION_ERROR', `Option --${name} is required`);
78
+ }
79
+ return value;
80
+ }
81
+ function ensureAction(value, allowed, context) {
82
+ if (!allowed.includes(value)) {
83
+ throw new ops_types_1.OpsCliError('VALIDATION_ERROR', `Unsupported ${context}: '${value}'. Allowed: ${allowed.join(', ')}`);
84
+ }
85
+ return value;
86
+ }
87
+ function normalizeServer(server) {
88
+ const apps = server.paths?.apps ?? DEFAULT_APPS_PATH;
89
+ return {
90
+ ...server,
91
+ sshKeyPath: node_path_1.default.isAbsolute(server.sshKeyPath)
92
+ ? server.sshKeyPath
93
+ : node_path_1.default.resolve(process.cwd(), server.sshKeyPath),
94
+ paths: {
95
+ apps,
96
+ caddy: server.paths?.caddy,
97
+ },
98
+ };
99
+ }
100
+ async function assertSshKeyExists(sshKeyPath) {
101
+ try {
102
+ await (0, promises_1.access)(sshKeyPath);
103
+ }
104
+ catch {
105
+ throw new ops_types_1.OpsCliError('VALIDATION_ERROR', `SSH key file not found or inaccessible: ${sshKeyPath}`);
106
+ }
107
+ }
108
+ function toCliError(error) {
109
+ if (error instanceof ops_types_1.OpsCliError) {
110
+ return { code: error.code, message: error.message };
111
+ }
112
+ if (error instanceof Error) {
113
+ return { code: 'CLI_ERROR', message: error.message };
114
+ }
115
+ return { code: 'CLI_ERROR', message: 'Unknown CLI error' };
116
+ }
117
+ //# sourceMappingURL=ops.utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ops.utils.js","sourceRoot":"","sources":["../../../../src/commands/ops/ops.utils.ts"],"names":[],"mappings":";;;;;AAYA,8BAOC;AAED,sCAUC;AAED,sCAOC;AAED,oDAuBC;AAED,0CAEC;AAED,4CAIC;AAED,gCAEC;AAED,oCAaC;AAED,wCAQC;AAED,oCAYC;AAtHD,+CAA0C;AAC1C,0DAA6B;AAG7B,2CAIqB;AAErB,MAAM,iBAAiB,GAAG,iBAAiB,CAAC;AAE5C,SAAgB,SAAS,CAAC,OAAgB,EAAE,OAAO,GAAG,KAAK;IACzD,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACrC,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACpB,OAAO;IACT,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACpB,CAAC;AAED,SAAgB,aAAa,CAAC,KAAc;IAC1C,MAAM,QAAQ,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;IACnC,SAAS,CACP;QACE,MAAM,EAAE,OAAO;QACf,IAAI,EAAE,QAAQ,CAAC,IAAI;QACnB,KAAK,EAAE,QAAQ,CAAC,OAAO;KACxB,EACD,IAAI,CACL,CAAC;AACJ,CAAC;AAED,SAAgB,aAAa,CAAC,MAAiB,EAAE,OAAe;IAC9D,SAAS,CAAC;QACR,MAAM,EAAE,OAAO;QACf,IAAI,EAAE,MAAM,CAAC,QAAQ;QACrB,MAAM,EAAE,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,KAAK,IAAI,mBAAmB;QAC5D,OAAO;KACR,CAAC,CAAC;AACL,CAAC;AAEM,KA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AACH,CAAC;AAED,SAAS,UAAU,CAAC,KAAc;IAChC,IAAI,KAAK,YAAY,uBAAW,EAAE,CAAC;QACjC,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;IACtD,CAAC;IAED,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAC3B,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;IACvD,CAAC;IAED,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,mBAAmB,EAAE,CAAC;AAC7D,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { CommandRunner } from 'nest-commander';
2
+ import { ConfigService } from '../../../core/config/config.service';
3
+ import { SshService } from '../../../shared/ssh/ssh.service';
4
+ type OpsEnvOptions = {
5
+ key?: string;
6
+ val?: string;
7
+ };
8
+ export declare class OpsEnvCommand extends CommandRunner {
9
+ private readonly configService;
10
+ private readonly sshService;
11
+ constructor(configService: ConfigService, sshService: SshService);
12
+ parseKey(value: string): string;
13
+ parseVal(value: string): string;
14
+ run(passedParams: string[], options?: OpsEnvOptions): Promise<void>;
15
+ private buildCommand;
16
+ }
17
+ export {};
@@ -0,0 +1,109 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.OpsEnvCommand = void 0;
16
+ const node_path_1 = __importDefault(require("node:path"));
17
+ const nest_commander_1 = require("nest-commander");
18
+ const config_service_1 = require("../../../core/config/config.service");
19
+ const ssh_service_1 = require("../../../shared/ssh/ssh.service");
20
+ const ops_utils_1 = require("../ops.utils");
21
+ let OpsEnvCommand = class OpsEnvCommand extends nest_commander_1.CommandRunner {
22
+ configService;
23
+ sshService;
24
+ constructor(configService, sshService) {
25
+ super();
26
+ this.configService = configService;
27
+ this.sshService = sshService;
28
+ }
29
+ parseKey(value) {
30
+ return value;
31
+ }
32
+ parseVal(value) {
33
+ return value;
34
+ }
35
+ async run(passedParams, options = {}) {
36
+ const [alias, rawAction, project] = passedParams;
37
+ try {
38
+ const action = (0, ops_utils_1.ensureAction)(rawAction, ['get', 'set', 'unset'], 'env action');
39
+ const server = await (0, ops_utils_1.resolveServerOrThrow)(this.configService.getConfig(), alias);
40
+ const envPath = node_path_1.default.posix.join((0, ops_utils_1.resolveAppsPath)(server), project, '.env');
41
+ const command = this.buildCommand(action, envPath, options);
42
+ const result = await this.sshService.execute(server, command);
43
+ if (!result.success) {
44
+ (0, ops_utils_1.printSshError)(result, command);
45
+ return;
46
+ }
47
+ if (action === 'get') {
48
+ (0, ops_utils_1.printJson)({ status: 'ok', data: { content: result.stdout } });
49
+ return;
50
+ }
51
+ (0, ops_utils_1.printJson)({ status: 'ok', message: 'Env updated' });
52
+ }
53
+ catch (error) {
54
+ (0, ops_utils_1.printCliError)(error);
55
+ process.exitCode = 1;
56
+ }
57
+ }
58
+ buildCommand(action, envPath, options) {
59
+ const quotedPath = (0, ops_utils_1.shellQuote)(envPath);
60
+ if (action === 'get') {
61
+ return `cat ${quotedPath}`;
62
+ }
63
+ const key = (0, ops_utils_1.ensureEnvKey)(options.key);
64
+ const quotedKey = (0, ops_utils_1.shellQuote)(key);
65
+ if (action === 'set') {
66
+ const val = (0, ops_utils_1.ensureRequired)(options.val, 'val');
67
+ const quotedVal = (0, ops_utils_1.shellQuote)(val);
68
+ return [
69
+ `ENV_FILE=${quotedPath}`,
70
+ `KEY=${quotedKey}`,
71
+ `VAL=${quotedVal}`,
72
+ 'mkdir -p "$(dirname "$ENV_FILE")"',
73
+ 'touch "$ENV_FILE"',
74
+ 'awk -v k="$KEY" -v v="$VAL" \'BEGIN{found=0} $0 ~ "^" k "=" { print k "=" v; found=1; next } { print } END { if (!found) print k "=" v }\' "$ENV_FILE" > "$ENV_FILE.tmp"',
75
+ 'mv "$ENV_FILE.tmp" "$ENV_FILE"',
76
+ ].join(' && ');
77
+ }
78
+ return [
79
+ `ENV_FILE=${quotedPath}`,
80
+ `KEY=${quotedKey}`,
81
+ 'if [ ! -f "$ENV_FILE" ]; then exit 0; fi',
82
+ 'grep -v "^$KEY=" "$ENV_FILE" > "$ENV_FILE.tmp"',
83
+ 'mv "$ENV_FILE.tmp" "$ENV_FILE"',
84
+ ].join(' && ');
85
+ }
86
+ };
87
+ exports.OpsEnvCommand = OpsEnvCommand;
88
+ __decorate([
89
+ (0, nest_commander_1.Option)({ flags: '--key <key>', description: 'Environment key' }),
90
+ __metadata("design:type", Function),
91
+ __metadata("design:paramtypes", [String]),
92
+ __metadata("design:returntype", String)
93
+ ], OpsEnvCommand.prototype, "parseKey", null);
94
+ __decorate([
95
+ (0, nest_commander_1.Option)({ flags: '--val <value>', description: 'Environment value' }),
96
+ __metadata("design:type", Function),
97
+ __metadata("design:paramtypes", [String]),
98
+ __metadata("design:returntype", String)
99
+ ], OpsEnvCommand.prototype, "parseVal", null);
100
+ exports.OpsEnvCommand = OpsEnvCommand = __decorate([
101
+ (0, nest_commander_1.SubCommand)({
102
+ name: 'env',
103
+ description: 'Manage remote .env files',
104
+ arguments: '<alias> <action> <project>',
105
+ }),
106
+ __metadata("design:paramtypes", [config_service_1.ConfigService,
107
+ ssh_service_1.SshService])
108
+ ], OpsEnvCommand);
109
+ //# sourceMappingURL=ops-env.command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ops-env.command.js","sourceRoot":"","sources":["../../../../../src/commands/ops/subcommands/ops-env.command.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,0DAA6B;AAC7B,mDAAmE;AACnE,wEAAoE;AACpE,iEAA6D;AAC7D,4CAUsB;AAcf,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,8BAAa;IAE3B;IACA;IAFnB,YACmB,aAA4B,EAC5B,UAAsB;QAEvC,KAAK,EAAE,CAAC;QAHS,kBAAa,GAAb,aAAa,CAAe;QAC5B,eAAU,GAAV,UAAU,CAAY;IAGzC,CAAC;IAGD,QAAQ,CAAC,KAAa;QACpB,OAAO,KAAK,CAAC;IACf,CAAC;IAGD,QAAQ,CAAC,KAAa;QACpB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,KAAK,CAAC,GAAG,CACP,YAAsB,EACtB,UAAyB,EAAE;QAE3B,MAAM,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,CAAC,GAAG,YAAY,CAAC;QAEjD,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,IAAA,wBAAY,EACzB,SAAS,EACT,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,EACvB,YAAY,CACb,CAAC;YACF,MAAM,MAAM,GAAG,MAAM,IAAA,gCAAoB,EACvC,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE,EAC9B,KAAK,CACN,CAAC;YACF,MAAM,OAAO,GAAG,mBAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAA,2BAAe,EAAC,MAAM,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;YAE1E,MAAM,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;YAC5D,MAAM,MAAM,GAAG,MAAM,I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O,SAAS,EAAE;gBAClB,mCAAmC;gBACnC,mBAAmB;gBACnB,0KAA0K;gBAC1K,gCAAgC;aACjC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACjB,CAAC;QAED,OAAO;YACL,YAAY,UAAU,EAAE;YACxB,OAAO,SAAS,EAAE;YAClB,0CAA0C;YAC1C,gDAAgD;YAChD,gCAAgC;SACjC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACjB,CAAC;CACF,CAAA;AA5FY,sCAAa;AASxB;IADC,IAAA,uBAAM,EAAC,EAAE,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAC;;;;6CAGhE;AAGD;IADC,IAAA,uBAAM,EAAC,EAAE,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,mBAAmB,EAAE,CAAC;;;;6CAGpE;wBAhBU,aAAa;IALzB,IAAA,2BAAU,EAAC;QACV,IAAI,EAAE,KAAK;QACX,WAAW,EAAE,0BAA0B;QACvC,SAAS,EAAE,4BAA4B;KACxC,CAAC;qCAGkC,8BAAa;QAChB,wBAAU;GAH9B,aAAa,CA4FzB"}
@@ -0,0 +1,18 @@
1
+ import { CommandRunner } from 'nest-commander';
2
+ import { ConfigService } from '../../../core/config/config.service';
3
+ import { SshService } from '../../../shared/ssh/ssh.service';
4
+ type OpsRoutesOptions = {
5
+ domain?: string;
6
+ upstream?: string;
7
+ };
8
+ export declare class OpsRoutesCommand extends CommandRunner {
9
+ private readonly configService;
10
+ private readonly sshService;
11
+ constructor(configService: ConfigService, sshService: SshService);
12
+ parseDomain(value: string): string;
13
+ parseUpstream(value: string): string;
14
+ run(passedParams: string[], options?: OpsRoutesOptions): Promise<void>;
15
+ private buildEditCommand;
16
+ private buildNodeScript;
17
+ }
18
+ export {};
@@ -0,0 +1,166 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.OpsRoutesCommand = void 0;
16
+ const node_path_1 = __importDefault(require("node:path"));
17
+ const nest_commander_1 = require("nest-commander");
18
+ const config_service_1 = require("../../../core/config/config.service");
19
+ const ssh_service_1 = require("../../../shared/ssh/ssh.service");
20
+ const ops_utils_1 = require("../ops.utils");
21
+ let OpsRoutesCommand = class OpsRoutesCommand extends nest_commander_1.CommandRunner {
22
+ configService;
23
+ sshService;
24
+ constructor(configService, sshService) {
25
+ super();
26
+ this.configService = configService;
27
+ this.sshService = sshService;
28
+ }
29
+ parseDomain(value) {
30
+ return value;
31
+ }
32
+ parseUpstream(value) {
33
+ return value;
34
+ }
35
+ async run(passedParams, options = {}) {
36
+ const [alias, rawAction] = passedParams;
37
+ try {
38
+ const action = (0, ops_utils_1.ensureAction)(rawAction, ['list', 'add', 'remove', 'update'], 'routes action');
39
+ const server = await (0, ops_utils_1.resolveServerOrThrow)(this.configService.getConfig(), alias);
40
+ const caddyRoot = (0, ops_utils_1.resolveCaddyPath)(server);
41
+ const caddyfilePath = node_path_1.default.posix.join(caddyRoot, 'data', 'Caddyfile');
42
+ if (action === 'list') {
43
+ const command = `cat ${(0, ops_utils_1.shellQuote)(caddyfilePath)}`;
44
+ const result = await this.sshService.execute(server, command);
45
+ if (!result.success) {
46
+ (0, ops_utils_1.printSshError)(result, command);
47
+ return;
48
+ }
49
+ (0, ops_utils_1.printJson)({ status: 'ok', data: { caddyfile: result.stdout } });
50
+ return;
51
+ }
52
+ const domain = (0, ops_utils_1.ensureRequired)(options.domain, 'domain');
53
+ const upstream = action === 'add' || action === 'update'
54
+ ? (0, ops_utils_1.ensureRequired)(options.upstream, 'upstream')
55
+ : '';
56
+ const editCommand = this.buildEditCommand({
57
+ action,
58
+ caddyfilePath,
59
+ domain,
60
+ upstream,
61
+ });
62
+ const editResult = await this.sshService.execute(server, editCommand);
63
+ if (!editResult.success) {
64
+ if (editResult.exitCode === 4) {
65
+ (0, ops_utils_1.printJson)({
66
+ status: 'error',
67
+ code: 'NOT_FOUND',
68
+ stderr: editResult.stderr || editResult.stdout || 'Route not found',
69
+ command: editCommand,
70
+ });
71
+ return;
72
+ }
73
+ (0, ops_utils_1.printSshError)(editResult, editCommand);
74
+ return;
75
+ }
76
+ const applyCommand = `cd ${(0, ops_utils_1.shellQuote)(caddyRoot)} && ./caddy.sh`;
77
+ const applyResult = await this.sshService.execute(server, applyCommand);
78
+ if (!applyResult.success) {
79
+ (0, ops_utils_1.printSshError)(applyResult, applyCommand);
80
+ return;
81
+ }
82
+ (0, ops_utils_1.printJson)({
83
+ status: 'ok',
84
+ message: 'Routes updated',
85
+ data: {
86
+ action,
87
+ domain,
88
+ upstream: upstream || undefined,
89
+ caddyOutput: applyResult.stdout,
90
+ },
91
+ });
92
+ }
93
+ catch (error) {
94
+ (0, ops_utils_1.printCliError)(error);
95
+ process.exitCode = 1;
96
+ }
97
+ }
98
+ buildEditCommand(params) {
99
+ const script = this.buildNodeScript(params);
100
+ return `node -e ${(0, ops_utils_1.shellQuote)(script)}`;
101
+ }
102
+ buildNodeScript(params) {
103
+ return [
104
+ "const fs = require('node:fs');",
105
+ "const p = require('node:path');",
106
+ `const filePath = ${JSON.stringify(params.caddyfilePath)};`,
107
+ `const action = ${JSON.stringify(params.action)};`,
108
+ `const domain = ${JSON.stringify(params.domain)};`,
109
+ `const upstream = ${JSON.stringify(params.upstream)};`,
110
+ "const esc = (s) => s.replace(/[.*+?^\\$\\{\\}()|[\\]\\\\]/g, '\\\\$&');",
111
+ "const read = fs.readFileSync(filePath, 'utf8');",
112
+ "const domainRe = new RegExp('(^|\\n)\\\\s*' + esc(domain) + '\\s*\\\\{[\\\\s\\\\S]*?\\\\n\\\\}', 'm');",
113
+ 'let text = read;',
114
+ "if (action === 'add') {",
115
+ ' if (domainRe.test(text)) {',
116
+ " process.stderr.write('Route already exists for domain');",
117
+ ' process.exit(3);',
118
+ ' }',
119
+ " const block = '\\n' + domain + ' {\\n reverse_proxy ' + upstream + '\\n}\\n';",
120
+ ' text = text.replace(/\\s*$/g, "") + block;',
121
+ "} else if (action === 'remove') {",
122
+ ' if (!domainRe.test(text)) {',
123
+ " process.stderr.write('Route not found');",
124
+ ' process.exit(4);',
125
+ ' }',
126
+ " text = text.replace(domainRe, '\\n').replace(/\\n{3,}/g, '\\n\\n').replace(/^\\n+/, '');",
127
+ "} else if (action === 'update') {",
128
+ ' const match = text.match(domainRe);',
129
+ ' if (!match) {',
130
+ " process.stderr.write('Route not found');",
131
+ ' process.exit(4);',
132
+ ' }',
133
+ ' const block = match[0];',
134
+ " const updated = block.replace(/reverse_proxy\\s+[^\\n]+/, 'reverse_proxy ' + upstream);",
135
+ ' text = text.replace(domainRe, updated);',
136
+ '}',
137
+ "const tmp = p.join(p.dirname(filePath), '.tmp-' + Date.now() + '-' + Math.random().toString(36).slice(2));",
138
+ "fs.writeFileSync(tmp, text, 'utf8');",
139
+ 'fs.renameSync(tmp, filePath);',
140
+ "process.stdout.write(JSON.stringify({ status: 'ok' }));",
141
+ ].join('\n');
142
+ }
143
+ };
144
+ exports.OpsRoutesCommand = OpsRoutesCommand;
145
+ __decorate([
146
+ (0, nest_commander_1.Option)({ flags: '--domain <domain>', description: 'Domain name' }),
147
+ __metadata("design:type", Function),
148
+ __metadata("design:paramtypes", [String]),
149
+ __metadata("design:returntype", String)
150
+ ], OpsRoutesCommand.prototype, "parseDomain", null);
151
+ __decorate([
152
+ (0, nest_commander_1.Option)({ flags: '--upstream <upstream>', description: 'Upstream host:port' }),
153
+ __metadata("design:type", Function),
154
+ __metadata("design:paramtypes", [String]),
155
+ __metadata("design:returntype", String)
156
+ ], OpsRoutesCommand.prototype, "parseUpstream", null);
157
+ exports.OpsRoutesCommand = OpsRoutesCommand = __decorate([
158
+ (0, nest_commander_1.SubCommand)({
159
+ name: 'routes',
160
+ description: 'Manage remote Caddy routes',
161
+ arguments: '<alias> <action>',
162
+ }),
163
+ __metadata("design:paramtypes", [config_service_1.ConfigService,
164
+ ssh_service_1.SshService])
165
+ ], OpsRoutesCommand);
166
+ //# sourceMappingURL=ops-routes.command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ops-routes.command.js","sourceRoot":"","sources":["../../../../../src/commands/ops/subcommands/ops-routes.command.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,0DAA6B;AAC7B,mDAAmE;AACnE,wEAAoE;AACpE,iEAA6D;AAC7D,4CASsB;AAcf,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,8BAAa;IAE9B;IACA;IAFnB,YACmB,aAA4B,EAC5B,UAAsB;QAEvC,KAAK,EAAE,CAAC;QAHS,kBAAa,GAAb,aAAa,CAAe;QAC5B,eAAU,GAAV,UAAU,CAAY;IAGzC,CAAC;IAGD,WAAW,CAAC,KAAa;QACvB,OAAO,KAAK,CAAC;IACf,CAAC;IAGD,aAAa,CAAC,KAAa;QACzB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,KAAK,CAAC,GAAG,CACP,YAAsB,EACtB,UAA4B,EAAE;QAE9B,MAAM,CAAC,KAAK,EAAE,SAAS,CAAC,GAAG,YAAY,CAAC;QAExC,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,IAAA,wBAAY,EACzB,SAAS,EACT,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,E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AAE,4BAA4B;QACzC,SAAS,EAAE,kBAAkB;KAC9B,CAAC;qCAGkC,8BAAa;QAChB,wBAAU;GAH9B,gBAAgB,CA6J5B"}
@@ -0,0 +1,16 @@
1
+ import { CommandRunner } from 'nest-commander';
2
+ import { ConfigService } from '../../../core/config/config.service';
3
+ import { SshService } from '../../../shared/ssh/ssh.service';
4
+ type OpsServiceOptions = {
5
+ repo?: string;
6
+ };
7
+ export declare class OpsServiceCommand extends CommandRunner {
8
+ private readonly configService;
9
+ private readonly sshService;
10
+ constructor(configService: ConfigService, sshService: SshService);
11
+ parseRepo(value: string): string;
12
+ run(passedParams: string[], options?: OpsServiceOptions): Promise<void>;
13
+ private buildActionCommand;
14
+ private runStatus;
15
+ }
16
+ export {};