@meistrari/tela-cli 1.6.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/docs/workflow-code/cli.md +28 -2
- package/dist/docs/workflow-code/manifest.json +1 -1
- package/dist/index.js +51279 -48867
- package/dist/program.d.ts +7 -0
- package/dist/program.js +17 -3
- package/dist/workflow-routing.d.ts +17 -0
- package/dist/workflow-routing.js +16 -0
- package/package.json +1 -1
package/dist/program.d.ts
CHANGED
|
@@ -1,2 +1,9 @@
|
|
|
1
1
|
import type { CliIo } from './output';
|
|
2
|
+
import type { WorkflowProcessEvents, WorkflowRunner } from './workflow-routing';
|
|
2
3
|
export declare function runCli(argv: string[], io: CliIo): Promise<number>;
|
|
4
|
+
type ProgramDependencies = Readonly<{
|
|
5
|
+
processEvents: WorkflowProcessEvents;
|
|
6
|
+
runWorkflowCli: WorkflowRunner<CliIo>;
|
|
7
|
+
}>;
|
|
8
|
+
export declare function runCliWithDependencies(argv: string[], io: CliIo, dependencies: ProgramDependencies): Promise<number>;
|
|
9
|
+
export {};
|
package/dist/program.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.runCli = runCli;
|
|
4
|
+
exports.runCliWithDependencies = runCliWithDependencies;
|
|
4
5
|
const node_fs_1 = require("node:fs");
|
|
5
6
|
const node_path_1 = require("node:path");
|
|
6
7
|
const output_1 = require("./output");
|
|
@@ -10,7 +11,17 @@ const doctor_auth_1 = require("./commands/doctor-auth");
|
|
|
10
11
|
const env_1 = require("./commands/env");
|
|
11
12
|
const ingredients_1 = require("./commands/ingredients");
|
|
12
13
|
const skills_1 = require("./commands/skills");
|
|
14
|
+
const workflow_routing_1 = require("./workflow-routing");
|
|
13
15
|
async function runCli(argv, io) {
|
|
16
|
+
return await runCliWithDependencies(argv, io, {
|
|
17
|
+
processEvents: process,
|
|
18
|
+
runWorkflowCli: async (workflowArgv, workflowIo, options) => {
|
|
19
|
+
const { runWorkflowCli } = await import('@meistrari/workflow-code/cli');
|
|
20
|
+
return await runWorkflowCli(workflowArgv, workflowIo, options);
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
async function runCliWithDependencies(argv, io, dependencies) {
|
|
14
25
|
const { args, options } = parseGlobalOptions(argv);
|
|
15
26
|
const [command, ...rest] = args;
|
|
16
27
|
if (!command || command === 'help' || command === '--help' || command === '-h') {
|
|
@@ -38,8 +49,10 @@ async function runCli(argv, io) {
|
|
|
38
49
|
return await runAgentCli(rest, io, options);
|
|
39
50
|
}
|
|
40
51
|
if (command === 'workflow') {
|
|
41
|
-
|
|
42
|
-
|
|
52
|
+
return await (0, workflow_routing_1.runWorkflowCommand)(rest, io, options, {
|
|
53
|
+
processEvents: dependencies.processEvents,
|
|
54
|
+
runWorkflowCli: dependencies.runWorkflowCli,
|
|
55
|
+
});
|
|
43
56
|
}
|
|
44
57
|
if (command === 'update' || command === 'api' || command === 'docs' || command === 'whoami' || command === 'token') {
|
|
45
58
|
return await (0, ingredients_1.runTelactlCommand)(command, rest, options, io);
|
|
@@ -91,7 +104,8 @@ function writeHelp(io) {
|
|
|
91
104
|
(0, output_1.writeLine)(io, ' workflow create <target> [--project <project-id>] [--config <path>] [--env <path>] [--json]');
|
|
92
105
|
(0, output_1.writeLine)(io, ' workflow sync [target] [--config <path>] [--env <path>] [--yes] [--json]');
|
|
93
106
|
(0, output_1.writeLine)(io, ' workflow publish [target] [--environment <name>] [--create-environment-if-missing] [--config <path>] [--env <path>] [--yes] [--json]');
|
|
94
|
-
(0, output_1.writeLine)(io, ' workflow codegen|run
|
|
107
|
+
(0, output_1.writeLine)(io, ' workflow codegen|run [--json]');
|
|
108
|
+
(0, output_1.writeLine)(io, ' workflow watch [target] [--config <path>] [--env <path>] [--json]');
|
|
95
109
|
(0, output_1.writeLine)(io, ' agent sync [repo] [--current] [--all] [--dry-run] [--json] [--verbose]');
|
|
96
110
|
(0, output_1.writeLine)(io, ' agent run [--input <name=path>...] [--mode one-shot|chat] [--input-conflict fail|overwrite|rename] [--plain] [--json] [--verbose]');
|
|
97
111
|
(0, output_1.writeLine)(io, ' agent push [--message <text>|--claude|--manual] [--dry-run] [--json] [--verbose]');
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
type WorkflowOptions = Readonly<{
|
|
2
|
+
json: boolean;
|
|
3
|
+
verbose?: boolean;
|
|
4
|
+
}>;
|
|
5
|
+
type WorkflowOptionsWithSignal = WorkflowOptions & Readonly<{
|
|
6
|
+
signal?: AbortSignal;
|
|
7
|
+
}>;
|
|
8
|
+
export type WorkflowProcessEvents = Readonly<{
|
|
9
|
+
on: (event: 'SIGINT', handler: () => void) => unknown;
|
|
10
|
+
off: (event: 'SIGINT', handler: () => void) => unknown;
|
|
11
|
+
}>;
|
|
12
|
+
export type WorkflowRunner<Io = unknown> = (argv: string[], io: Io, options: WorkflowOptionsWithSignal) => Promise<number>;
|
|
13
|
+
export declare function runWorkflowCommand<Io>(argv: string[], io: Io, options: WorkflowOptions, dependencies: Readonly<{
|
|
14
|
+
processEvents: WorkflowProcessEvents;
|
|
15
|
+
runWorkflowCli: WorkflowRunner<Io>;
|
|
16
|
+
}>): Promise<number>;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runWorkflowCommand = runWorkflowCommand;
|
|
4
|
+
async function runWorkflowCommand(argv, io, options, dependencies) {
|
|
5
|
+
if (argv[0] !== 'watch')
|
|
6
|
+
return await dependencies.runWorkflowCli(argv, io, options);
|
|
7
|
+
const controller = new AbortController();
|
|
8
|
+
const onSigint = () => controller.abort();
|
|
9
|
+
dependencies.processEvents.on('SIGINT', onSigint);
|
|
10
|
+
try {
|
|
11
|
+
return await dependencies.runWorkflowCli(argv, io, { ...options, signal: controller.signal });
|
|
12
|
+
}
|
|
13
|
+
finally {
|
|
14
|
+
dependencies.processEvents.off('SIGINT', onSigint);
|
|
15
|
+
}
|
|
16
|
+
}
|