@telpin-sistemas/orqen 0.1.7 → 0.1.10
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/README.md +1 -17
- package/dist/commands/environment.js +29 -16
- package/dist/commands/init.js +10 -13
- package/dist/commands/update.js +20 -16
- package/dist/commands/workflow.js +31 -8
- package/dist/connectors/local.js +2 -2
- package/dist/index.js +4 -27
- package/dist/lib/config-keys.js +2 -2
- package/dist/lib/processes.js +147 -11
- package/dist/practice/practice.js +1 -1
- package/dist/template/.agents/commands/new_worq.md +21 -0
- package/dist/template/AGENTS.md +5 -1
- package/dist/workflow/board.js +6 -3
- package/dist/workflow/process.js +76 -8
- package/dist/workflow/routed.js +29 -0
- package/dist/workflow/store.js +4 -1
- package/dist/workflow/workspace.js +34 -14
- package/package.json +2 -2
- package/dist/commands/bootstrap.js +0 -260
package/README.md
CHANGED
|
@@ -17,27 +17,11 @@ orqen init # Run from the repository you want to initialize
|
|
|
17
17
|
6. Configures the connectors: the requests system the client sees and an optional issues system for the team (Jira, GitHub or Asana). It asks for the project/filter and the account, checks them against the tool and, if the check fails, lets you fix them, save them anyway or skip (`orqen connectors setup` later). The selection goes to `orqen/config.yaml`; provider accounts go to `~/.orqen/credentials.env`, shared across repositories (Enter keeps an existing token). Existing connectors and general settings are kept by default. `orqen connectors` checks the configured resources.
|
|
18
18
|
7. Writes the environment configuration (no Docker in between), agent instructions, plugin, stage guides, and manifest. It merges the OpenSpec workflow rules with the repository's existing configuration.
|
|
19
19
|
|
|
20
|
-
`init` configures an existing project without requesting, cloning or reading the external stack catalog. It reuses any database scripts already installed in the project
|
|
20
|
+
`init` configures an existing project without requesting, cloning or reading the external stack catalog. It reuses any database scripts already installed in the project.
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
Other options include `--agent "<command>"`, `--tools claude,codex`, `--no-openspec`, `--no-connectors` (skip the step), and `--connectors <file|->` (connectors as JSON, same format as `orqen connectors set`, for non-interactive runs; `--yes` alone keeps the current ones). Non-interactive runs use the defaults. If a managed file conflicts, `--yes` writes the proposed version alongside the original.
|
|
24
24
|
|
|
25
|
-
## Create a new project
|
|
26
|
-
|
|
27
|
-
```sh
|
|
28
|
-
orqen bootstrap "Payments Platform" [--tools-repo @company/tools] [--stack <id>] [--dir ./payments] [--yes]
|
|
29
|
-
orqen bootstrap --list
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
Asks the name, folder and stack; checks the stack requirements and asks its parameters (ports, Java package); creates the
|
|
33
|
-
folder and Git repository; generates the code (official generators plus the stack skeleton); copies the environment scripts
|
|
34
|
-
to `orqen/tools/` (e.g. `orqen/tools/db.mjs`, the database in Docker); runs `orqen init` with the stack and environments already known;
|
|
35
|
-
and offers the initial commit.
|
|
36
|
-
|
|
37
|
-
On first use, `bootstrap` asks for your GitHub stack repository (for example `@company/stacks`); its name can be anything. Git clones it into `cli/tools/` beside this CLI installation using your own HTTPS credential helper or SSH key. You need access to that repository. The clone is reused, ignored by Git and excluded from the npm package; no catalog is bundled. Each stack has `<id>/tool.yaml` and its scaffold, with shared scripts in `_shared/`.
|
|
38
|
-
|
|
39
|
-
For non-interactive first use of `bootstrap`, pass `--tools-repo @company/tools` or set `ORQEN_TOOLS_REPO`. HTTPS and SSH GitHub URLs are also accepted. To refresh it, use `git -C tools pull --ff-only` from the CLI installation directory. To select a different repository, move the existing clone aside first.
|
|
40
|
-
|
|
41
25
|
## Update an installation
|
|
42
26
|
|
|
43
27
|
Run `orqen update` from any directory to update the CLI. In an orqen project, the same command continues with OpenSpec and the kit using the newly installed CLI. Use `--cli-only` to update just the CLI from inside a project, or `orqen update --desktop` to update the global npm desktop app.
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* orqen env: start the project and run its tests without a person at the keyboard (used by the workflow and agents).
|
|
3
3
|
* setup install dependencies (entornos.preparar)
|
|
4
|
-
* up [--all]
|
|
5
|
-
* --all: also the processes that are only for e2e / visual tests (e.g. the frontend)
|
|
4
|
+
* up [--all] [name...] start the processes (npm run dev, npm start…) and wait until they are ready; then migrations and seed.
|
|
5
|
+
* --all: also the processes that are only for e2e / visual tests (e.g. the frontend); names: only those
|
|
6
|
+
* restart [name...] stop and start again
|
|
6
7
|
* test [type...] unit / integration / e2e / visual with the variables of orqen/environment.yaml
|
|
7
8
|
* `-- <args>`: appended to the command of the requested type (e.g. only the e2e of a change)
|
|
8
|
-
* status which processes are running
|
|
9
|
-
* down
|
|
9
|
+
* status which processes are running (--json: with the port of this worktree and the page to open)
|
|
10
|
+
* down [name...] stop the processes orqen started
|
|
11
|
+
*
|
|
12
|
+
* Everything works on the current directory: in a Worq's worktree it is that Worq's environment, with its own ports
|
|
13
|
+
* (see `${port}` in lib/processes.ts) and its own orqen/state.
|
|
10
14
|
*/
|
|
11
15
|
import { resolve } from "node:path";
|
|
12
16
|
import { leerConfig } from "../lib/config.js";
|
|
13
17
|
import { ejecutarLinea } from "../lib/proc.js";
|
|
14
|
-
import { bajarProcesos, estadoProcesos, levantarProcesos } from "../lib/processes.js";
|
|
18
|
+
import { bajarProcesos, estadoProcesos, levantarProcesos, variablesConPuertos } from "../lib/processes.js";
|
|
15
19
|
import { pc } from "../ui/console.js";
|
|
16
20
|
const TIPOS = ["unitarios", "integracion", "e2e", "visual"];
|
|
17
21
|
/** Test types as people write them (orqen/environment.yaml uses unit / integration); the Spanish names still work. */
|
|
@@ -19,7 +23,7 @@ const NOMBRE = { unitarios: "unit", integracion: "integration", e2e: "e2e", visu
|
|
|
19
23
|
const tipoDe = (s) => (Object.entries(NOMBRE).find(([, en]) => en === s)?.[0] ?? s);
|
|
20
24
|
const titulo = (s) => console.log(`\n${pc.bold(pc.magenta("▸"))} ${pc.bold(s)}`);
|
|
21
25
|
async function correr(repo, cfg, lineas, etiqueta) {
|
|
22
|
-
const env = { ...process.env, ...cfg.entornos.variables };
|
|
26
|
+
const env = { ...process.env, ...variablesConPuertos(repo, cfg.entornos.procesos, cfg.entornos.variables) };
|
|
23
27
|
for (const l of lineas) {
|
|
24
28
|
titulo(`${etiqueta}: ${l}`);
|
|
25
29
|
const c = await ejecutarLinea(l, { cwd: repo, env });
|
|
@@ -41,10 +45,16 @@ export async function entorno(sub, resto, o) {
|
|
|
41
45
|
case "setup":
|
|
42
46
|
ok = await correr(repo, cfg, e.preparar, "install dependencies");
|
|
43
47
|
break;
|
|
48
|
+
case "restart":
|
|
44
49
|
case "up": {
|
|
45
50
|
if (!e.procesos.length)
|
|
46
51
|
console.log(pc.dim("No processes configured in orqen/environment.yaml (processes)."));
|
|
47
|
-
|
|
52
|
+
if (sub === "restart") {
|
|
53
|
+
const bajados = bajarProcesos(repo, resto);
|
|
54
|
+
if (bajados.length)
|
|
55
|
+
titulo(`Stopped: ${bajados.join(", ")}`);
|
|
56
|
+
}
|
|
57
|
+
const r = await levantarProcesos(repo, e.procesos, e.variables, { todos: o.todos, solo: resto, alAvanzar: (m) => titulo(m) });
|
|
48
58
|
if (!r.ok) {
|
|
49
59
|
console.error(pc.red(`✘ ${r.detalle}`));
|
|
50
60
|
if (r.salida)
|
|
@@ -52,10 +62,12 @@ export async function entorno(sub, resto, o) {
|
|
|
52
62
|
ok = false;
|
|
53
63
|
break;
|
|
54
64
|
}
|
|
55
|
-
|
|
65
|
+
// migrations and seed only when the whole environment comes up, not when one process is (re)started
|
|
66
|
+
if (!resto.length)
|
|
67
|
+
ok = await correr(repo, cfg, e.migrar, "run migrations") && await correr(repo, cfg, e.seed, "seed");
|
|
56
68
|
if (ok) {
|
|
57
69
|
console.log(pc.green(`\n✔ ${r.detalle}`));
|
|
58
|
-
const vars = Object.entries(e.variables);
|
|
70
|
+
const vars = Object.entries(variablesConPuertos(repo, e.procesos, e.variables));
|
|
59
71
|
if (vars.length)
|
|
60
72
|
console.log(pc.dim(vars.map(([k, v]) => ` ${k}=${v}`).join("\n")));
|
|
61
73
|
console.log(pc.dim(" To stop them: orqen env down"));
|
|
@@ -87,19 +99,19 @@ export async function entorno(sub, resto, o) {
|
|
|
87
99
|
break;
|
|
88
100
|
}
|
|
89
101
|
case "status": {
|
|
90
|
-
const st = await estadoProcesos(repo, e.procesos);
|
|
102
|
+
const st = await estadoProcesos(repo, e.procesos, e.variables);
|
|
91
103
|
if (o.json) {
|
|
92
|
-
console.log(JSON.stringify({ processes: st, variables: e.variables, tests: e.tests }, null, 2));
|
|
104
|
+
console.log(JSON.stringify({ dir: repo, processes: st, variables: variablesConPuertos(repo, e.procesos, e.variables), tests: e.tests }, null, 2));
|
|
93
105
|
break;
|
|
94
106
|
}
|
|
95
107
|
if (!st.length)
|
|
96
108
|
console.log(pc.dim("No processes configured in orqen/environment.yaml (processes)."));
|
|
97
109
|
for (const x of st)
|
|
98
|
-
console.log(`${x.corriendo ? pc.green("●") : pc.dim("○")} ${x.nombre.padEnd(16)} ${pc.dim(x.comando)}${x.puerto ? pc.dim(` :${x.puerto}`) : ""}${x.cuando === "e2e" ? pc.dim(" (e2e only)") : ""}${x.log ? pc.dim(`\n log: ${x.log}`) : ""}`);
|
|
110
|
+
console.log(`${x.corriendo ? pc.green("●") : pc.dim("○")} ${x.nombre.padEnd(16)} ${pc.dim(x.comando)}${x.puerto ? pc.dim(` :${x.puerto}`) : ""}${x.cuando === "e2e" ? pc.dim(" (e2e only)") : ""}${x.web ? pc.dim(`\n web: ${x.web}`) : ""}${x.log ? pc.dim(`\n log: ${x.log}`) : ""}`);
|
|
99
111
|
break;
|
|
100
112
|
}
|
|
101
113
|
case "down": {
|
|
102
|
-
const bajados = bajarProcesos(repo);
|
|
114
|
+
const bajados = bajarProcesos(repo, resto);
|
|
103
115
|
console.log(bajados.length ? pc.green(`✔ Stopped: ${bajados.join(", ")}`) : pc.dim("No processes started by orqen are running."));
|
|
104
116
|
break;
|
|
105
117
|
}
|
|
@@ -107,11 +119,12 @@ export async function entorno(sub, resto, o) {
|
|
|
107
119
|
console.log([
|
|
108
120
|
"Usage: orqen env <command>",
|
|
109
121
|
" setup install dependencies (entornos.preparar)",
|
|
110
|
-
" up [--all]
|
|
122
|
+
" up [--all] [name...] start the processes and wait until they are ready, then migrate and seed (--all: include e2e-only processes)",
|
|
123
|
+
" restart [name...] stop and start again",
|
|
111
124
|
" test [type...] unit | integration | e2e | visual (default: all configured tests)",
|
|
112
125
|
" -- <args>: appended to that type's command, e.g. orqen env test e2e -- tests/login.spec.ts",
|
|
113
|
-
" status
|
|
114
|
-
" down
|
|
126
|
+
" status [--json] show which processes are running, their port in this worktree, page and log",
|
|
127
|
+
" down [name...] stop the processes orqen started",
|
|
115
128
|
].join("\n"));
|
|
116
129
|
if (sub)
|
|
117
130
|
process.exitCode = 1;
|
package/dist/commands/init.js
CHANGED
|
@@ -37,17 +37,16 @@ const HERRAMIENTAS_OPENSPEC = [
|
|
|
37
37
|
export async function init(o) {
|
|
38
38
|
const repo = resolve(o.dir ?? process.cwd());
|
|
39
39
|
let yes = !!o.yes;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
});
|
|
40
|
+
await mostrarLogo({
|
|
41
|
+
animar: !o.sinAnimacion && !o.yes, esperarTecla: true,
|
|
42
|
+
bienvenida: [
|
|
43
|
+
"Initialization will:",
|
|
44
|
+
" • Detect the stack and propose environments with your AI agent",
|
|
45
|
+
" • Install and configure OpenSpec",
|
|
46
|
+
" • Connect where the requests and issues live (Jira, GitHub or Asana)",
|
|
47
|
+
" • Prepare the repository for agents to work independently",
|
|
48
|
+
],
|
|
49
|
+
});
|
|
51
50
|
p.intro(`${azul("orqen")} ${magenta("init")} ${gris(`v${VERSION_CLI} · ${repo}`)}`);
|
|
52
51
|
if (!yes && !interactivo()) {
|
|
53
52
|
p.log.warn("Non-interactive terminal. Using defaults as with --yes.");
|
|
@@ -197,8 +196,6 @@ export async function init(o) {
|
|
|
197
196
|
gris(`(type /orqen: to list them; check with /plugin → orqen@${mk})`),
|
|
198
197
|
...(!commiteado ? [`Commit the changes (orqen/, .claude/, .claude-plugin/, AGENTS.md, CLAUDE.md, openspec/) so the team gets the same commands: ${pc.cyan('git add -A && git commit -m "Install orqen"')}`] : []),
|
|
199
198
|
];
|
|
200
|
-
if (o.sinLogo)
|
|
201
|
-
return; // `orqen bootstrap` shows its own next steps
|
|
202
199
|
p.note(pasos.map((x, i) => `${pc.bold(`${i + 1}.`)} ${x}`).join("\n"), "Next steps");
|
|
203
200
|
p.outro(`${magenta("//")} ${pc.bold("From request to production.")}`);
|
|
204
201
|
}
|
package/dist/commands/update.js
CHANGED
|
@@ -14,8 +14,8 @@ import { mostrarLogo } from "../ui/logo.js";
|
|
|
14
14
|
import { azul, confirmar, gris, interactivo, magenta, p, pc } from "../ui/console.js";
|
|
15
15
|
import { resolverConflicto } from "./init.js";
|
|
16
16
|
import { moveWorkToWorqs } from "../lib/worqs.js";
|
|
17
|
-
const
|
|
18
|
-
const DESKTOP_REPO = "sistemas-telpin/orqen-
|
|
17
|
+
const PAQUETES_DESKTOP = ["@telpin-sistemas/orqen-studio", "@telpin-sistemas/orqen-desktop"];
|
|
18
|
+
const DESKTOP_REPO = "sistemas-telpin/orqen-studio";
|
|
19
19
|
function paqueteGlobal(gestor, paquete) {
|
|
20
20
|
const r = ejecutar(gestor, ["root", "-g"], { timeoutMs: 20_000 });
|
|
21
21
|
if (r.codigo !== 0 || !r.stdout.trim())
|
|
@@ -35,18 +35,22 @@ async function actualizarPaquete(gestor, paquete, actual, yes, objetivo) {
|
|
|
35
35
|
throw new Error(`Update failed for ${paquete}: ${(r.stderr || r.stdout || r.error?.message || `exit code ${r.codigo}`).trim().slice(-1500)}`);
|
|
36
36
|
return { status: "installed", version: ultima };
|
|
37
37
|
}
|
|
38
|
-
function
|
|
39
|
-
const
|
|
40
|
-
if (!existsSync(manifest))
|
|
41
|
-
throw new Error("Install orqen Desktop globally with npm before updating it.");
|
|
38
|
+
function instalacionDesktop() {
|
|
39
|
+
const scope = paqueteGlobal("npm", "@telpin-sistemas");
|
|
42
40
|
const launcher = process.env.ORQEN_DESKTOP_NPM_MANIFEST;
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
const launcherPath = launcher && existsSync(launcher) ? realpathSync(launcher) : null;
|
|
42
|
+
for (const paquete of PAQUETES_DESKTOP) {
|
|
43
|
+
const manifest = join(scope, paquete.split("/")[1], "package.json");
|
|
44
|
+
if (!existsSync(manifest) || (launcher && launcherPath !== realpathSync(manifest)))
|
|
45
|
+
continue;
|
|
46
|
+
const { version } = JSON.parse(readFileSync(manifest, "utf8"));
|
|
47
|
+
if (typeof version !== "string" || !semver.valid(version))
|
|
48
|
+
throw new Error("Invalid installed desktop version.");
|
|
49
|
+
return { paquete, version };
|
|
45
50
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
return version;
|
|
51
|
+
if (launcher)
|
|
52
|
+
throw new Error("The running desktop app is outside the active global npm installation.");
|
|
53
|
+
throw new Error("Install orqen Studio globally with npm before updating it.");
|
|
50
54
|
}
|
|
51
55
|
async function githubDesktop(path) {
|
|
52
56
|
const api = `repos/${DESKTOP_REPO}/${path}`;
|
|
@@ -70,11 +74,11 @@ async function githubDesktop(path) {
|
|
|
70
74
|
export async function desktopRelease(installed) {
|
|
71
75
|
if (!semver.valid(installed))
|
|
72
76
|
throw new Error("Invalid running desktop version.");
|
|
73
|
-
const actual =
|
|
77
|
+
const { paquete, version: actual } = instalacionDesktop();
|
|
74
78
|
if (semver.gt(actual, installed)) {
|
|
75
79
|
return console.log(JSON.stringify({ status: "installed", version: actual }));
|
|
76
80
|
}
|
|
77
|
-
const version = ultimaVersionPaquete("npm",
|
|
81
|
+
const version = ultimaVersionPaquete("npm", paquete);
|
|
78
82
|
if (!version)
|
|
79
83
|
throw new Error("Could not check npm for orqen Desktop updates.");
|
|
80
84
|
if (!semver.gt(version, installed))
|
|
@@ -95,8 +99,8 @@ export async function update(o) {
|
|
|
95
99
|
if (o.target !== undefined && (!o.desktop || !semver.valid(o.target)))
|
|
96
100
|
throw new Error("--target requires --desktop and a valid version.");
|
|
97
101
|
if (o.desktop) {
|
|
98
|
-
const actual =
|
|
99
|
-
const result = await actualizarPaquete("npm",
|
|
102
|
+
const { paquete, version: actual } = instalacionDesktop();
|
|
103
|
+
const result = await actualizarPaquete("npm", paquete, actual, !!o.yes || !interactivo(), o.target);
|
|
100
104
|
if (result.status === "unavailable")
|
|
101
105
|
throw new Error("Could not check npm for orqen Desktop updates.");
|
|
102
106
|
if (o.json)
|
|
@@ -16,7 +16,7 @@ import { OpenSpecCli } from "../workflow/openspec.js";
|
|
|
16
16
|
import { Process } from "../workflow/process.js";
|
|
17
17
|
import { Store } from "../workflow/store.js";
|
|
18
18
|
import { GitWorkspace } from "../workflow/workspace.js";
|
|
19
|
-
export const WORKFLOW_COMMANDS = ["list", "qa", "approve", "merged", "cancel", "pending", "support", "analyze", "ask", "conversation", "lane", "take", "complete", "pr", "review", "code-review", "schema", "block", "release", "search", "status", "worqs", "worq", "cycle", "connectors", "comments", "comment"];
|
|
19
|
+
export const WORKFLOW_COMMANDS = ["list", "qa", "approve", "merged", "cancel", "new_worq", "pending", "support", "analyze", "ask", "conversation", "lane", "take", "complete", "pr", "review", "code-review", "schema", "block", "release", "search", "status", "worqs", "worq", "cycle", "connectors", "comments", "comment"];
|
|
20
20
|
/** What people run: the 9 steps (as /orqen:* commands in their agent) and the CLI commands meant for a person. */
|
|
21
21
|
export const WORKFLOW_HELP = `The 9 steps (run the /orqen:* commands in your agent: it calls the CLI for you):
|
|
22
22
|
1 /orqen:list requests orqen list requests [--json] [--all] Everyone's work list, by role (takes nothing)
|
|
@@ -36,6 +36,7 @@ Request commands for people:
|
|
|
36
36
|
worqs [--all] [--json] The worqs on this machine: orqen's unit of work, one per request (request + issue + branch + PR + record)
|
|
37
37
|
worq <KEY> [--json] One worq: state, request, issue, branch, PR and the files of its record in orqen/worqs/<KEY>/
|
|
38
38
|
merged <KEY> [--person N] Confirm the hand merge of an approved PR when orqen cannot read it from GitHub
|
|
39
|
+
new_worq "<title>" <brief.json|-> Worq with no request: creates its issue in the connector, skips support and analysis, born in DEVELOPMENT
|
|
39
40
|
cancel <KEY> --reason T Close the request without delivering it: closes the PR unmerged, comments both tickets (CANCELLED)
|
|
40
41
|
release <KEY> Free a request held by an agent that is no longer working on it
|
|
41
42
|
comments <KEY> [--json] Read the request and its conversation with the client
|
|
@@ -44,7 +45,7 @@ Request commands for people:
|
|
|
44
45
|
cycle [--loop] Unattended mode (cron/CI/server): agent stages only, never support or analysis
|
|
45
46
|
|
|
46
47
|
Agent-only commands (the /orqen:* commands run them) and JSON for tools: orqen help internal`;
|
|
47
|
-
/** What only the agent runs (inside the /orqen:* commands) and the JSON commands for tools such as orqen-
|
|
48
|
+
/** What only the agent runs (inside the /orqen:* commands) and the JSON commands for tools such as orqen-studio. */
|
|
48
49
|
export const WORKFLOW_INTERNAL_HELP = `Agent-only commands (the /orqen:* commands run them; a person does not need them):
|
|
49
50
|
support <KEY> [--person NAME] 2 · Open or resume first-line support and print the context
|
|
50
51
|
analyze <KEY> [--analyst NAME] 3 · Open or resume the analysis and print the context
|
|
@@ -61,12 +62,11 @@ export const WORKFLOW_INTERNAL_HELP = `Agent-only commands (the /orqen:* command
|
|
|
61
62
|
|
|
62
63
|
Older names (still work, with a notice): pending → list requests · qa → review
|
|
63
64
|
|
|
64
|
-
JSON for tools (orqen-
|
|
65
|
+
JSON for tools (orqen-studio):
|
|
65
66
|
status [KEY] --json · list requests|issues|prs --json · usage --json · tutorial --step <n> --json
|
|
66
67
|
spec [KEY|change] --json [--dir <worktree>] the spec in the neutral model of src/sdd (any SDD tool)
|
|
67
68
|
connectors get|check <json>|set <json>|general-get|general-set [--json]
|
|
68
|
-
connectors github-choices <json|-> <requests|issues> <repositories|projects|statuses
|
|
69
|
-
bootstrap --list --json · bootstrap --describe <stack> --json`;
|
|
69
|
+
connectors github-choices <json|-> <requests|issues> <repositories|projects|statuses>`;
|
|
70
70
|
/** The person at this machine: Git's user.name for this repository, otherwise the system user. */
|
|
71
71
|
export function quienSoy(repo) {
|
|
72
72
|
try {
|
|
@@ -264,7 +264,30 @@ export async function runWorkflow(cmd, rest) {
|
|
|
264
264
|
throw new Error("Usage: orqen approve <KEY> [--changes <comment.md|->] [--comment <text>]");
|
|
265
265
|
const body = changes !== undefined ? (changes === "-" || changes === "" ? readFileSync(0, "utf8") : readFileSync(changes, "utf8")) : (comment ?? "");
|
|
266
266
|
const r = await flow.decide(key, changes !== undefined ? "changes" : "approve", body, me || "senior", agent, force);
|
|
267
|
-
|
|
267
|
+
if (r.state === "DEVELOPMENT")
|
|
268
|
+
console.log(`✔ changes requested on ${r.url}: back to development`);
|
|
269
|
+
else
|
|
270
|
+
console.log(r.onGitHub ? `✔ PR approved on GitHub (${r.url}) → ${r.state}`
|
|
271
|
+
: `✔ Approval recorded in the tickets (${r.url}) → ${r.state}. The gate is "ticket": no review was posted on GitHub.`);
|
|
272
|
+
if (r.warning)
|
|
273
|
+
console.log(`⚠ ${r.warning}`);
|
|
274
|
+
}
|
|
275
|
+
catch (e) {
|
|
276
|
+
console.error(`✘ ${e.message}`);
|
|
277
|
+
process.exitCode = 1;
|
|
278
|
+
}
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
case "new_worq": {
|
|
282
|
+
try {
|
|
283
|
+
const title = rest[0] ?? "";
|
|
284
|
+
const src = rest[1];
|
|
285
|
+
if (!title || !src)
|
|
286
|
+
throw new Error('Usage: orqen new_worq "<title>" <brief.json|-> [--person NAME] (brief: {"description", "acceptance_criteria": [...], "plan": [...], "estimated_hours"})');
|
|
287
|
+
const raw = JSON.parse(src === "-" ? readFileSync(0, "utf8") : readFileSync(src, "utf8"));
|
|
288
|
+
const r = await flow.newWorq(title, raw, me || agent);
|
|
289
|
+
console.log(`✔ ${r.key} created in ${r.state}: issue ${r.url} (no client request) · worq: ${r.dir}/`);
|
|
290
|
+
console.log(` Next: /orqen:implement ${r.key}`);
|
|
268
291
|
}
|
|
269
292
|
catch (e) {
|
|
270
293
|
console.error(`✘ ${e.message}`);
|
|
@@ -577,7 +600,7 @@ export async function runWorkflow(cmd, rest) {
|
|
|
577
600
|
return;
|
|
578
601
|
}
|
|
579
602
|
case "connectors": {
|
|
580
|
-
// JSON for tools such as orqen-
|
|
603
|
+
// JSON for tools such as orqen-studio: {"conectores": {...}, "env": {"JIRA_TOKEN": "..."}} on stdin or in a file
|
|
581
604
|
const draftInput = () => JSON.parse(!rest[1] || rest[1] === "-" ? readFileSync(0, "utf8") : readFileSync(rest[1], "utf8"));
|
|
582
605
|
if (rest[0] === "general-get" || rest[0] === "general-set") {
|
|
583
606
|
const { leerConfig, escribirConfig } = await import("../lib/config.js");
|
|
@@ -590,7 +613,7 @@ export async function runWorkflow(cmd, rest) {
|
|
|
590
613
|
escribirConfig(cfg.repoPath, updated);
|
|
591
614
|
return console.log(JSON.stringify({ general: updated.general, hasHistory }));
|
|
592
615
|
}
|
|
593
|
-
// a connectors editor (orqen-
|
|
616
|
+
// a connectors editor (orqen-studio): current values (tokens masked) and a check of a draft before saving it
|
|
594
617
|
if (rest[0] === "get") {
|
|
595
618
|
const { connectorsView } = await import("../lib/connectors-edit.js");
|
|
596
619
|
const { existeConfig, leerConfig } = await import("../lib/config.js");
|
package/dist/connectors/local.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* { key, title, description, reportedBy, status, labels, created, comments: [{id, author, authorName, body, created}], clientSeen }
|
|
7
7
|
*/
|
|
8
8
|
import { existsSync, mkdirSync, readdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
9
|
-
import { join } from "node:path";
|
|
9
|
+
import { dirname, join } from "node:path";
|
|
10
10
|
import { pathToFileURL } from "node:url";
|
|
11
11
|
import { BOT_MARK, LEGACY_STATE_LABELS, STATE_LABEL } from "./types.js";
|
|
12
12
|
/** States of a local ticket that are no longer pending. */
|
|
@@ -28,8 +28,8 @@ export class LocalTracker {
|
|
|
28
28
|
}
|
|
29
29
|
/** Atomic write: the app and the CLI read the same files every few seconds. */
|
|
30
30
|
write(t) {
|
|
31
|
-
mkdirSync(this.s.dir, { recursive: true });
|
|
32
31
|
const f = this.file(t.key);
|
|
32
|
+
mkdirSync(dirname(f), { recursive: true });
|
|
33
33
|
const tmp = `${f}.${process.pid}.tmp`;
|
|
34
34
|
writeFileSync(tmp, JSON.stringify(t, null, 2) + "\n");
|
|
35
35
|
renameSync(tmp, f);
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
/** orqen command-line entry point. */
|
|
3
3
|
import { parseArgs } from "node:util";
|
|
4
4
|
import { entorno } from "./commands/environment.js";
|
|
5
|
-
import { bootstrap } from "./commands/bootstrap.js";
|
|
6
5
|
import { init } from "./commands/init.js";
|
|
7
6
|
import { WORKFLOW_HELP, WORKFLOW_INTERNAL_HELP, WORKFLOW_COMMANDS, runWorkflow } from "./commands/workflow.js";
|
|
8
7
|
import { desktopRelease, update } from "./commands/update.js";
|
|
@@ -16,7 +15,7 @@ import { SPEC_HELP, specCommand } from "./commands/spec.js";
|
|
|
16
15
|
import { practice } from "./practice/practice.js";
|
|
17
16
|
const AYUDA = `
|
|
18
17
|
Usage: orqen <command> [options]
|
|
19
|
-
orqen This help (the desktop app is a separate project: github.com/sistemas-telpin/orqen-
|
|
18
|
+
orqen This help (the desktop app is a separate project: github.com/sistemas-telpin/orqen-studio)
|
|
20
19
|
|
|
21
20
|
Commands:
|
|
22
21
|
init [dir] Initialize orqen in a repository (default: current directory)
|
|
@@ -30,23 +29,17 @@ Commands:
|
|
|
30
29
|
--no-connectors Skip the connectors step (keep the current ones; set them later with \`orqen connectors setup\`)
|
|
31
30
|
--commit Commit what init wrote ("Install orqen"); interactively it asks, with --yes it only does it with this flag
|
|
32
31
|
--connectors <file> Connectors as JSON ({"conectores": …, "env": …}, like \`orqen connectors set\`; "-" = stdin)
|
|
33
|
-
bootstrap [name] Create a new project from a stack (code, tools to run it, and orqen ready)
|
|
34
|
-
--tools-repo <repo> GitHub stack catalog (any repo name), cloned inside cli/tools
|
|
35
|
-
--list List the stacks from your catalog
|
|
36
|
-
--stack <id> Stack from your private catalog (orqen bootstrap --list lists them)
|
|
37
|
-
--dir <folder> Where to create it (default: ./<name>)
|
|
38
|
-
--params '<json>' Parameter values, e.g. '{"PORT":"8081"}' (the rest use their defaults)
|
|
39
32
|
update [dir] Update the CLI and, in an orqen project, OpenSpec and the kit
|
|
40
33
|
--cli-only Update only the CLI
|
|
41
34
|
--desktop Update the global npm install of orqen Desktop
|
|
42
35
|
--target <version> Install this exact desktop version
|
|
43
36
|
--yes, -y --no-cli --no-openspec --no-kit
|
|
44
|
-
env <cmd> setup | up [--all] | test [type...] | status | down
|
|
37
|
+
env <cmd> setup | up [--all] [name...] | restart [name...] | test [type...] | status [--json] | down [name...]
|
|
45
38
|
tutorial [step] Step-by-step tour for newcomers, in your system language (es/en)
|
|
46
39
|
--step <n|id> Print one step and exit (--json for agents) · --list · --lang es|en
|
|
47
40
|
lang Print the detected system language (es | en); ORQEN_LANG overrides it
|
|
48
41
|
usage [--json] AI agents installed on this machine and their quota used
|
|
49
|
-
practice <cmd> The interactive tutorial's practice project (orqen-
|
|
42
|
+
practice <cmd> The interactive tutorial's practice project (orqen-studio): create | request <1|2> | client <KEY>
|
|
50
43
|
${SWARM_HELP}
|
|
51
44
|
${EVAL_HELP}
|
|
52
45
|
${SPEC_HELP}
|
|
@@ -100,7 +93,6 @@ async function main() {
|
|
|
100
93
|
"no-animation": { type: "boolean" },
|
|
101
94
|
agent: { type: "string" },
|
|
102
95
|
tools: { type: "string" },
|
|
103
|
-
"tools-repo": { type: "string" },
|
|
104
96
|
"no-openspec": { type: "boolean" },
|
|
105
97
|
"no-connectors": { type: "boolean" },
|
|
106
98
|
commit: { type: "boolean" },
|
|
@@ -112,11 +104,7 @@ async function main() {
|
|
|
112
104
|
"no-kit": { type: "boolean" },
|
|
113
105
|
all: { type: "boolean" },
|
|
114
106
|
dir: { type: "string" },
|
|
115
|
-
stack: { type: "string" },
|
|
116
|
-
list: { type: "boolean" },
|
|
117
107
|
json: { type: "boolean" },
|
|
118
|
-
describe: { type: "string" },
|
|
119
|
-
params: { type: "string" },
|
|
120
108
|
},
|
|
121
109
|
});
|
|
122
110
|
const [cmd, ...resto] = positionals;
|
|
@@ -127,14 +115,12 @@ async function main() {
|
|
|
127
115
|
console.log(AYUDA);
|
|
128
116
|
return;
|
|
129
117
|
}
|
|
130
|
-
// `orqen` alone: logo and help. The desktop app is a separate project (github.com/sistemas-telpin/orqen-
|
|
118
|
+
// `orqen` alone: logo and help. The desktop app is a separate project (github.com/sistemas-telpin/orqen-studio).
|
|
131
119
|
if (!cmd) {
|
|
132
120
|
await mostrarLogo({ animar: !v["no-animation"] && !v.yes });
|
|
133
121
|
console.log(AYUDA);
|
|
134
122
|
return;
|
|
135
123
|
}
|
|
136
|
-
if (v["tools-repo"] && cmd !== "bootstrap")
|
|
137
|
-
throw new Error("--tools-repo is only supported by orqen bootstrap.");
|
|
138
124
|
switch (cmd) {
|
|
139
125
|
case "init":
|
|
140
126
|
return init({
|
|
@@ -142,15 +128,6 @@ async function main() {
|
|
|
142
128
|
sinOpenspec: !!v["no-openspec"], sinConectores: !!v["no-connectors"], commit: !!v.commit, conectores: v.connectors,
|
|
143
129
|
herramientas: typeof v.tools === "string" ? v.tools.split(",").map((s) => s.trim()).filter(Boolean) : undefined,
|
|
144
130
|
});
|
|
145
|
-
case "bootstrap":
|
|
146
|
-
return bootstrap({
|
|
147
|
-
nombre: resto.join(" ") || undefined, listar: !!v.list, stack: v.stack, dir: v.dir,
|
|
148
|
-
yes: !!v.yes, sinAnimacion: !!v["no-animation"], sinOpenspec: !!v["no-openspec"],
|
|
149
|
-
toolsRepo: v["tools-repo"],
|
|
150
|
-
json: !!v.json, describir: v.describe,
|
|
151
|
-
parametros: typeof v.params === "string" ? JSON.parse(v.params) : undefined,
|
|
152
|
-
herramientas: typeof v.tools === "string" ? v.tools.split(",").map((x) => x.trim()).filter(Boolean) : undefined,
|
|
153
|
-
});
|
|
154
131
|
case "update":
|
|
155
132
|
return update({
|
|
156
133
|
dir: v.dir ?? resto[0], yes: !!v.yes, sinCli: !!v["no-cli"],
|
package/dist/lib/config-keys.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Key names of orqen/config.yaml and orqen/environment.yaml. The files use English keys; the code (and the JSON that tools
|
|
3
|
-
* such as orqen-
|
|
3
|
+
* such as orqen-studio exchange with `orqen connectors get|set`) keeps the internal names. Files written by earlier versions,
|
|
4
4
|
* with the keys in Spanish, are still read: each key is accepted under either name.
|
|
5
5
|
*/
|
|
6
6
|
const TESTS = { unit: "unitarios", integration: "integracion", e2e: "e2e", visual: "visual" };
|
|
@@ -23,7 +23,7 @@ export const STACK_KEYS = {
|
|
|
23
23
|
tests: { as: "tests", keys: TESTS }, migrations: "migraciones", seed: "seed", variables: "variables", notes: "notas",
|
|
24
24
|
};
|
|
25
25
|
const PROCESS = {
|
|
26
|
-
name: "nombre", command: "comando", path: "ruta", port: "puerto", url: "url", ready_when: "listo_si", stop: "detener",
|
|
26
|
+
name: "nombre", command: "comando", path: "ruta", port: "puerto", url: "url", ready_when: "listo_si", stop: "detener", web: "web",
|
|
27
27
|
when: { as: "cuando", values: { always: "siempre" } }, wait_seconds: "espera_seg",
|
|
28
28
|
};
|
|
29
29
|
/** orqen/environment.yaml without `stack`: how the project starts and is tested (`entornos` inside). */
|