agjan 0.0.14 → 0.0.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.
- package/README.md +3 -2
- package/dist/cli.js +7 -4
- package/dist/commands/setup.js +76 -12
- package/dist/select.js +54 -0
- package/dist/terminal.js +66 -14
- package/dist/ui.js +1 -1
- package/docs/guide.md +14 -3
- package/package.json +7 -2
package/README.md
CHANGED
|
@@ -7,8 +7,9 @@
|
|
|
7
7
|
|
|
8
8
|
# agjan
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
An agentic engineering harness. It runs AI coding agents like an engineering team (a
|
|
11
|
+
main agent, an independent reviewer and a QA tester) under your approval gates and
|
|
12
|
+
checks that CI enforces. Spec-driven, starting with SAP BTP: CAP, Fiori elements and UI5.
|
|
12
13
|
|
|
13
14
|
> **Status: closed beta (0.x).** The source repository is not public yet; it will open
|
|
14
15
|
> soon. Until then, links to the repository and to other documents do not work on npm;
|
package/dist/cli.js
CHANGED
|
@@ -49,18 +49,21 @@ const COMMANDS = {
|
|
|
49
49
|
};
|
|
50
50
|
const HELP = `agjan ${pkg.version}
|
|
51
51
|
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
Agentic engineering harness for AI coding agents: role agents (main agent,
|
|
53
|
+
reviewer, QA), human approval gates and CI-enforced checks. SAP BTP first.
|
|
54
|
+
Closed beta (0.x); the user guide is in this package: docs/guide.md
|
|
54
55
|
|
|
55
56
|
Usage: agjan <command> [options]
|
|
56
57
|
|
|
57
58
|
Setup (human):
|
|
58
59
|
init <folder | .> [--hosts claude-code,copilot] [--domains btp] [--base <ref>]
|
|
59
60
|
[--no-hook] [--no-ci] [--prepare] [--copilot-mcp | --no-copilot-mcp]
|
|
60
|
-
[--no-install] [--pm npm|pnpm|yarn|bun] [--dry-run]
|
|
61
|
+
[--commit | --no-commit] [--no-install] [--pm npm|pnpm|yarn|bun] [--dry-run]
|
|
61
62
|
set up agjan: <folder> is created (git init, package.json,
|
|
62
63
|
agjan pinned and installed), . is the current folder; without
|
|
63
|
-
--hosts it asks which hosts (claude-code, copilot) to set up
|
|
64
|
+
--hosts it asks which hosts (claude-code, copilot) to set up,
|
|
65
|
+
and at the end whether to commit the setup (a new repository:
|
|
66
|
+
on main; else on chore/set-up-agjan)
|
|
64
67
|
sync [--force] [--copilot-mcp]
|
|
65
68
|
regenerate managed files (skills, agents, blocks, settings);
|
|
66
69
|
--copilot-mcp adds missing MCP servers to Copilot
|
package/dist/commands/setup.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { spawnSync } from 'node:child_process';
|
|
2
|
-
import { existsSync, mkdirSync, readFileSync, realpathSync, statSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { existsSync, mkdirSync, readFileSync, readdirSync, realpathSync, statSync, writeFileSync } from 'node:fs';
|
|
3
3
|
import { homedir } from 'node:os';
|
|
4
4
|
import { basename, dirname, join, relative, resolve } from 'node:path';
|
|
5
5
|
import { fileURLToPath } from 'node:url';
|
|
@@ -81,23 +81,49 @@ function doSync(ctx, { force }) {
|
|
|
81
81
|
function ask(ctx, question, options) {
|
|
82
82
|
return ctx.ask(question, options);
|
|
83
83
|
}
|
|
84
|
+
const SETUP_BRANCH = 'chore/set-up-agjan';
|
|
85
|
+
const SETUP_COMMIT = 'chore: set up agjan';
|
|
84
86
|
/** The next steps after init, for the configured hosts (design decision 69). */
|
|
85
|
-
function nextSteps(ctx, hosts,
|
|
87
|
+
function nextSteps(ctx, hosts, left) {
|
|
86
88
|
const s = ctx.style;
|
|
87
|
-
const steps = [
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
89
|
+
const steps = [];
|
|
90
|
+
if (left.cd)
|
|
91
|
+
steps.push(`Move into the project: ${s.cyan(`cd ${/\s/.test(left.cd) ? JSON.stringify(left.cd) : left.cd}`)}`);
|
|
92
|
+
if (left.install)
|
|
93
|
+
steps.push(`Install the pinned agjan: ${s.cyan(left.install)}`);
|
|
94
|
+
if (left.committed?.created) {
|
|
95
|
+
steps.push(`The setup is committed on ${s.cyan(left.committed.branch)}: push it and merge it with a PR.`);
|
|
96
|
+
}
|
|
97
|
+
else if (!left.committed) {
|
|
98
|
+
steps.push(left.firstCommit
|
|
99
|
+
? `Commit the setup: ${s.cyan(`git add -A && git commit -m "${SETUP_COMMIT}"`)}`
|
|
100
|
+
: `Commit the setup on a branch of its own and merge it with a PR: ${s.cyan(`git switch -c ${SETUP_BRANCH} && git add -A && git commit -m "${SETUP_COMMIT}"`)}`);
|
|
101
|
+
}
|
|
92
102
|
if (hosts.includes('claude-code')) {
|
|
93
103
|
steps.push("Open this folder once in Claude Code and trust it: the reviewer's agjan tools load only in trusted folders.");
|
|
94
104
|
}
|
|
95
105
|
if (hosts.includes('copilot')) {
|
|
96
106
|
steps.push(`Start ${s.cyan('copilot')} in this folder and trust it.`);
|
|
97
107
|
}
|
|
98
|
-
steps.push(`Run: ${s.cyan('
|
|
108
|
+
steps.push(`Run: ${s.cyan('agjan doctor')}`);
|
|
99
109
|
return ['', s.bold('Next steps:'), ...steps.map((text, i) => ` ${i + 1}. ${text}`)];
|
|
100
110
|
}
|
|
111
|
+
/**
|
|
112
|
+
* Commits everything init wrote: on the current branch of a new repository, else on a
|
|
113
|
+
* branch of its own (the base branch changes through a PR). Returns the branch, or why not.
|
|
114
|
+
*/
|
|
115
|
+
function commitSetup(root, { firstCommit }) {
|
|
116
|
+
try {
|
|
117
|
+
if (!firstCommit)
|
|
118
|
+
git(root, ['switch', '-q', '-c', SETUP_BRANCH]);
|
|
119
|
+
git(root, ['add', '-A']);
|
|
120
|
+
git(root, ['commit', '-q', '-m', SETUP_COMMIT]);
|
|
121
|
+
return { branch: git(root, ['branch', '--show-current']).trim(), created: !firstCommit };
|
|
122
|
+
}
|
|
123
|
+
catch (error) {
|
|
124
|
+
return { error: error.message };
|
|
125
|
+
}
|
|
126
|
+
}
|
|
101
127
|
const INIT_USAGE = [
|
|
102
128
|
'Usage: agjan init <folder | .> --hosts <host,...> [options]',
|
|
103
129
|
'',
|
|
@@ -107,6 +133,7 @@ const INIT_USAGE = [
|
|
|
107
133
|
' --hosts <host,...> claude-code, copilot (asked for on a terminal when left out)',
|
|
108
134
|
' --domains btp --language en --base <ref> --no-hook --no-ci --prepare',
|
|
109
135
|
' --copilot-mcp | --no-copilot-mcp',
|
|
136
|
+
' --commit | --no-commit commit the setup (a new repository: on main; else on chore/set-up-agjan) or leave it to you',
|
|
110
137
|
' --no-install pin agjan in package.json but do not install it',
|
|
111
138
|
` --pm <${PACKAGE_MANAGERS.join('|')}> the package manager to install with (default: from the lockfile, else npm)`,
|
|
112
139
|
' --dry-run show what would be done and stop',
|
|
@@ -128,7 +155,10 @@ function planScaffold(ctx, target) {
|
|
|
128
155
|
if (top && realpathSync(top) !== join(realpathSync(ancestor), relative(ancestor, target))) {
|
|
129
156
|
throw new AgjanError(`${target} is inside the git repository ${top}; agjan is set up at the root of a repository (run 'agjan init .' there)`);
|
|
130
157
|
}
|
|
131
|
-
|
|
158
|
+
// Only a start without other work in it may be committed as a whole: a new folder, an
|
|
159
|
+
// empty one, or a repository whose working tree is clean.
|
|
160
|
+
const clean = !exists || (top ? git(target, ['status', '--porcelain']).trim() === '' : readdirSync(target).length === 0);
|
|
161
|
+
return { exists, repo: Boolean(top), packageJson: exists && existsSync(join(target, 'package.json')), clean };
|
|
132
162
|
}
|
|
133
163
|
/** A valid package name for a folder name. */
|
|
134
164
|
function packageName(folder) {
|
|
@@ -174,7 +204,7 @@ function scaffold(ctx, target, found, { install, manager }) {
|
|
|
174
204
|
/**
|
|
175
205
|
* agjan init <folder | .> --hosts claude-code,copilot [--domains btp] [--language en] [--base <ref>]
|
|
176
206
|
* [--no-hook] [--no-ci] [--prepare] [--copilot-mcp | --no-copilot-mcp]
|
|
177
|
-
* [--no-install] [--pm npm|pnpm|yarn|bun] [--dry-run]
|
|
207
|
+
* [--commit | --no-commit] [--no-install] [--pm npm|pnpm|yarn|bun] [--dry-run]
|
|
178
208
|
*/
|
|
179
209
|
export async function init(ctx, argv) {
|
|
180
210
|
const { values, positionals } = parseArgs({
|
|
@@ -190,6 +220,8 @@ export async function init(ctx, argv) {
|
|
|
190
220
|
prepare: { type: 'boolean' },
|
|
191
221
|
'copilot-mcp': { type: 'boolean' },
|
|
192
222
|
'no-copilot-mcp': { type: 'boolean' },
|
|
223
|
+
commit: { type: 'boolean' },
|
|
224
|
+
'no-commit': { type: 'boolean' },
|
|
193
225
|
'no-install': { type: 'boolean' },
|
|
194
226
|
pm: { type: 'string' },
|
|
195
227
|
'dry-run': { type: 'boolean' },
|
|
@@ -202,6 +234,8 @@ export async function init(ctx, argv) {
|
|
|
202
234
|
if (positionals.length > 1)
|
|
203
235
|
throw new UsageError(`init takes one folder, got ${positionals.length}: ${positionals.join(' ')}`);
|
|
204
236
|
const target = resolve(ctx.cwd, positionals[0]);
|
|
237
|
+
if (values.commit && values['no-commit'])
|
|
238
|
+
throw new UsageError('--commit and --no-commit exclude each other');
|
|
205
239
|
if (values.pm && !PACKAGE_MANAGERS.includes(values.pm))
|
|
206
240
|
throw new UsageError(`--pm must be one of ${PACKAGE_MANAGERS.join(', ')}`);
|
|
207
241
|
const found = planScaffold(ctx, target);
|
|
@@ -224,9 +258,10 @@ export async function init(ctx, argv) {
|
|
|
224
258
|
for (const line of lines)
|
|
225
259
|
ctx.out(line);
|
|
226
260
|
await blink(ctx, lines);
|
|
227
|
-
const hosts = chosen ?? ctx.select('Which hosts should agjan set up?', supported.map((id) => ({ id, label: id })));
|
|
261
|
+
const hosts = chosen ?? await ctx.select('Which hosts should agjan set up?', supported.map((id) => ({ id, label: id })));
|
|
228
262
|
if (!hosts)
|
|
229
263
|
throw new UsageError(`no host chosen and no terminal to ask on; pass --hosts <host,...> (supported: ${supported.join(', ')})`);
|
|
264
|
+
const origin = ctx.cwd;
|
|
230
265
|
ctx.out('');
|
|
231
266
|
scaffold(ctx, target, found, { install: !values['no-install'], manager });
|
|
232
267
|
ctx.chdir(target);
|
|
@@ -274,7 +309,36 @@ export async function init(ctx, argv) {
|
|
|
274
309
|
}
|
|
275
310
|
}
|
|
276
311
|
const firstCommit = git(root, ['rev-parse', '--verify', '--quiet', 'HEAD'], { allowFail: true }) === null;
|
|
277
|
-
|
|
312
|
+
// Asked once everything is written. Not when other work is in the folder (git add -A would
|
|
313
|
+
// sweep it in), unless --commit says so.
|
|
314
|
+
let committed = null;
|
|
315
|
+
// The pre-commit hook runs the project's agjan: without the install, committing would hang on it.
|
|
316
|
+
const hookNeedsInstall = values['no-install'] && !values['no-hook'];
|
|
317
|
+
const wanted = values['no-commit'] || hookNeedsInstall ? false : values.commit ? true : !found.clean ? false
|
|
318
|
+
: ask(ctx, firstCommit ? `Commit the setup now (${SETUP_COMMIT})?` : `Commit the setup on a new branch, ${SETUP_BRANCH}?`, { defaultYes: true }) ?? false;
|
|
319
|
+
if (hookNeedsInstall && !values['no-commit']) {
|
|
320
|
+
ctx.out('', s.yellow(`The setup is not committed: the pre-commit hook needs the installed agjan (${manager} install, then commit).`));
|
|
321
|
+
}
|
|
322
|
+
else if (!found.clean && !values.commit && !values['no-commit']) {
|
|
323
|
+
ctx.out('', s.yellow('The folder had other work in it, so the setup is not committed for you; commit what belongs to it yourself.'));
|
|
324
|
+
}
|
|
325
|
+
if (wanted) {
|
|
326
|
+
const result = commitSetup(root, { firstCommit });
|
|
327
|
+
if ('error' in result) {
|
|
328
|
+
ctx.out('', s.yellow(`Could not commit the setup: ${result.error}`));
|
|
329
|
+
}
|
|
330
|
+
else {
|
|
331
|
+
committed = result;
|
|
332
|
+
ctx.out('', ` ${pad(tone(s, 'created'), 'created', 14)} commit "${SETUP_COMMIT}" on ${result.branch}`);
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
const cd = relative(origin, target);
|
|
336
|
+
ctx.out(...nextSteps(ctx, hosts, {
|
|
337
|
+
cd: cd && cd !== '.' ? cd : null,
|
|
338
|
+
install: values['no-install'] ? `${manager} install` : null,
|
|
339
|
+
committed,
|
|
340
|
+
firstCommit,
|
|
341
|
+
}));
|
|
278
342
|
return 0;
|
|
279
343
|
}
|
|
280
344
|
function addPrepare(root) {
|
package/dist/select.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export function initialSelect(count) {
|
|
2
|
+
return { cursor: 0, picked: Array(count).fill(false), warn: false };
|
|
3
|
+
}
|
|
4
|
+
/** The key a chunk of terminal input stands for: arrows and k/j move, space ticks, `a` ticks all. */
|
|
5
|
+
export function keysOf(chunk) {
|
|
6
|
+
const keys = [];
|
|
7
|
+
for (const token of chunk.match(/\x1b\[[0-9;]*[A-Za-z]|\x1bO[A-Z]|\x1b|[\s\S]/g) ?? []) {
|
|
8
|
+
const key = {
|
|
9
|
+
'\x1b[A': 'up', '\x1bOA': 'up', k: 'up',
|
|
10
|
+
'\x1b[B': 'down', '\x1bOB': 'down', j: 'down',
|
|
11
|
+
' ': 'toggle', a: 'all',
|
|
12
|
+
'\r': 'enter', '\n': 'enter',
|
|
13
|
+
'\x03': 'cancel', '\x04': 'cancel', '\x1b': 'cancel', q: 'cancel',
|
|
14
|
+
}[token];
|
|
15
|
+
if (key)
|
|
16
|
+
keys.push(key);
|
|
17
|
+
}
|
|
18
|
+
return keys;
|
|
19
|
+
}
|
|
20
|
+
/** The state after a key; `done` when Enter confirmed a choice or the human cancelled. */
|
|
21
|
+
export function reduceSelect(state, key) {
|
|
22
|
+
const count = state.picked.length;
|
|
23
|
+
switch (key) {
|
|
24
|
+
case 'up':
|
|
25
|
+
return { state: { ...state, cursor: (state.cursor + count - 1) % count, warn: false } };
|
|
26
|
+
case 'down':
|
|
27
|
+
return { state: { ...state, cursor: (state.cursor + 1) % count, warn: false } };
|
|
28
|
+
case 'toggle':
|
|
29
|
+
return { state: { ...state, picked: state.picked.map((p, i) => (i === state.cursor ? !p : p)), warn: false } };
|
|
30
|
+
case 'all':
|
|
31
|
+
return { state: { ...state, picked: state.picked.map(() => !state.picked.every(Boolean)), warn: false } };
|
|
32
|
+
case 'enter':
|
|
33
|
+
return state.picked.some(Boolean) ? { state, done: 'confirm' } : { state: { ...state, warn: true } };
|
|
34
|
+
case 'cancel':
|
|
35
|
+
return { state, done: 'cancel' };
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
/** The lines of the picker: the question, one line per choice, and a hint (or the refusal). */
|
|
39
|
+
export function renderSelect(s, question, choices, state) {
|
|
40
|
+
const rows = choices.map((choice, i) => {
|
|
41
|
+
const here = i === state.cursor;
|
|
42
|
+
const box = state.picked[i] ? s.green('◉') : s.gray('◯');
|
|
43
|
+
const label = here ? s.bold(s.teal(choice.label)) : state.picked[i] ? s.green(choice.label) : choice.label;
|
|
44
|
+
return `${here ? s.teal('❯') : ' '} ${box} ${label}`;
|
|
45
|
+
});
|
|
46
|
+
const hint = state.warn
|
|
47
|
+
? s.red('Select at least one host with space, then press enter.')
|
|
48
|
+
: s.gray('↑/↓ move · space select · a all · enter confirm · esc cancel');
|
|
49
|
+
return [`${s.teal('?')} ${s.bold(question)}`, ...rows, ` ${hint}`];
|
|
50
|
+
}
|
|
51
|
+
/** The one line left on the terminal once the human confirmed. */
|
|
52
|
+
export function renderChosen(s, question, chosen) {
|
|
53
|
+
return `${s.green('✔')} ${s.bold(question)} ${s.teal(chosen.join(', '))}`;
|
|
54
|
+
}
|
package/dist/terminal.js
CHANGED
|
@@ -2,6 +2,8 @@ import { openSync, readSync, writeSync, closeSync } from 'node:fs';
|
|
|
2
2
|
import { createInterface } from 'node:readline';
|
|
3
3
|
import { ReadStream, WriteStream, isatty } from 'node:tty';
|
|
4
4
|
import { AgjanError } from './errors.js';
|
|
5
|
+
import { initialSelect, keysOf, reduceSelect, renderChosen, renderSelect } from './select.js';
|
|
6
|
+
import { createStyle } from './ui.js';
|
|
5
7
|
/**
|
|
6
8
|
* Opens the controlling terminal, bypassing stdin and stdout, so that piped input
|
|
7
9
|
* cannot answer a confirmation (design 9.4). Returns null when there is none, which is
|
|
@@ -82,32 +84,82 @@ export function askOnTerminal(question, { defaultYes = false } = {}) {
|
|
|
82
84
|
}
|
|
83
85
|
}
|
|
84
86
|
/**
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
* agent): the caller then needs the choice from a flag.
|
|
87
|
+
* Asks the human to choose among `choices` on the controlling terminal: with the cursor
|
|
88
|
+
* keys, space and Enter where the terminal allows, else by typing numbers or names
|
|
89
|
+
* separated by commas. Returns null when there is no terminal (a script, CI or an
|
|
90
|
+
* agent): the caller then needs the choice from a flag. Cancelling is an error.
|
|
89
91
|
*/
|
|
90
|
-
export function selectOnTerminal(question, choices) {
|
|
92
|
+
export async function selectOnTerminal(question, choices) {
|
|
91
93
|
const tty = openTerminal();
|
|
92
94
|
if (!tty)
|
|
93
95
|
return null;
|
|
96
|
+
const style = createStyle({ isTTY: true });
|
|
97
|
+
if (!isatty(tty.input)) {
|
|
98
|
+
try {
|
|
99
|
+
return typeSelection(tty, style, question, choices);
|
|
100
|
+
}
|
|
101
|
+
finally {
|
|
102
|
+
closeSync(tty.input);
|
|
103
|
+
if (tty.output !== tty.input)
|
|
104
|
+
closeSync(tty.output);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
const input = new ReadStream(tty.input);
|
|
108
|
+
const write = (text) => writeSync(tty.output, text);
|
|
109
|
+
let state = initialSelect(choices.length);
|
|
110
|
+
let lines = 0;
|
|
111
|
+
// Draws the picker over its previous drawing.
|
|
112
|
+
const draw = () => {
|
|
113
|
+
const frame = renderSelect(style, question, choices, state);
|
|
114
|
+
write(`${lines ? `\x1b[${lines - 1}A\r` : ''}${frame.map((l) => `\x1b[2K${l}`).join('\n')}`);
|
|
115
|
+
lines = frame.length;
|
|
116
|
+
};
|
|
117
|
+
const leave = (result) => {
|
|
118
|
+
write(`${lines > 1 ? `\x1b[${lines - 1}A` : ''}\r\x1b[J${result}\x1b[?25h`);
|
|
119
|
+
};
|
|
94
120
|
try {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
121
|
+
input.setRawMode(true);
|
|
122
|
+
write('\x1b[?25l');
|
|
123
|
+
draw();
|
|
124
|
+
const done = await new Promise((resolve) => {
|
|
125
|
+
input.on('data', (chunk) => {
|
|
126
|
+
for (const key of keysOf(chunk.toString('utf8'))) {
|
|
127
|
+
const next = reduceSelect(state, key);
|
|
128
|
+
state = next.state;
|
|
129
|
+
if (next.done)
|
|
130
|
+
return resolve(next.done);
|
|
131
|
+
}
|
|
132
|
+
draw();
|
|
133
|
+
});
|
|
134
|
+
input.on('end', () => resolve('cancel'));
|
|
135
|
+
});
|
|
136
|
+
if (done === 'cancel') {
|
|
137
|
+
leave(`${style.red('✖')} ${style.bold(question)} ${style.gray('cancelled')}\n`);
|
|
138
|
+
throw new AgjanError('cancelled; nothing was changed');
|
|
103
139
|
}
|
|
140
|
+
const chosen = choices.filter((_, i) => state.picked[i]).map((c) => c.id);
|
|
141
|
+
leave(`${renderChosen(style, question, chosen)}\n`);
|
|
142
|
+
return chosen;
|
|
104
143
|
}
|
|
105
144
|
finally {
|
|
106
|
-
|
|
145
|
+
write('\x1b[?25h');
|
|
146
|
+
input.destroy();
|
|
107
147
|
if (tty.output !== tty.input)
|
|
108
148
|
closeSync(tty.output);
|
|
109
149
|
}
|
|
110
150
|
}
|
|
151
|
+
/** The fallback without key input: a numbered list and a typed answer. */
|
|
152
|
+
function typeSelection(tty, s, question, choices) {
|
|
153
|
+
writeSync(tty.output, `${s.teal('?')} ${s.bold(question)}\n${choices.map((c, i) => ` ${s.teal(`${i + 1}.`)} ${c.label}`).join('\n')}\n`);
|
|
154
|
+
for (;;) {
|
|
155
|
+
writeSync(tty.output, `${s.gray('Choose one or more (numbers or names, separated by commas):')} `);
|
|
156
|
+
const answer = readLine(tty.input).trim();
|
|
157
|
+
const picked = answer.split(',').map((a) => a.trim()).filter(Boolean).map((a) => choices[Number(a) - 1]?.id ?? choices.find((c) => c.id === a)?.id);
|
|
158
|
+
if (picked.length && picked.every(Boolean))
|
|
159
|
+
return [...new Set(picked)];
|
|
160
|
+
writeSync(tty.output, `${s.red('Not understood:')} ${answer === '' ? '(nothing)' : answer}\n`);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
111
163
|
/**
|
|
112
164
|
* Asks for one line on the controlling terminal with `initial` already typed, so the human
|
|
113
165
|
* can edit it in place (cursor keys, backspace) or press Enter to keep it. Without line
|
package/dist/ui.js
CHANGED
|
@@ -93,7 +93,7 @@ export function highlightMarkdown(style, text) {
|
|
|
93
93
|
* The agjan mark (the "ag" of the app icon: the bowl of the a with its teal stem, and the
|
|
94
94
|
* g with its descender) with two lines of text beside it. Empty when the brand is off.
|
|
95
95
|
*/
|
|
96
|
-
export function mark(style, version, line2 = '
|
|
96
|
+
export function mark(style, version, line2 = 'agentic engineering harness, gated by you', line3 = '') {
|
|
97
97
|
if (!style.brand)
|
|
98
98
|
return [];
|
|
99
99
|
const stem = style.teal('┃');
|
package/docs/guide.md
CHANGED
|
@@ -3,6 +3,11 @@
|
|
|
3
3
|
How to set up agjan in a project and work with it. The reasons behind every rule are
|
|
4
4
|
in the [design](design.md); this guide is about using it.
|
|
5
5
|
|
|
6
|
+
agjan is an agentic engineering harness: it runs your AI coding agents like an engineering
|
|
7
|
+
team (a main agent, an independent reviewer and a QA tester), spec-driven, under approval
|
|
8
|
+
gates you hold and checks that CI enforces. It is not an agent or a model; it is the
|
|
9
|
+
structure around the agents you already use (Claude Code, GitHub Copilot).
|
|
10
|
+
|
|
6
11
|
- [Concepts](#concepts)
|
|
7
12
|
- [Set up a project](#set-up-a-project)
|
|
8
13
|
- [The workflow](#the-workflow)
|
|
@@ -34,10 +39,9 @@ Requirements: Node.js 22 or later, git, and Claude Code and/or GitHub Copilot.
|
|
|
34
39
|
|
|
35
40
|
```sh
|
|
36
41
|
npm install --global agjan
|
|
37
|
-
agjan init my-project --hosts claude-code,copilot
|
|
38
|
-
cd my-project
|
|
42
|
+
agjan init my-project # asks which hosts to set up (or: --hosts claude-code,copilot), then to commit the setup
|
|
43
|
+
cd my-project # a command cannot move your shell: init prints this as its first next step
|
|
39
44
|
agjan doctor
|
|
40
|
-
git add -A && git commit -m "chore: set up agjan"
|
|
41
45
|
```
|
|
42
46
|
|
|
43
47
|
`agjan init <folder>` creates the folder, runs `git init -b main`, writes a `package.json`
|
|
@@ -49,6 +53,13 @@ before changing anything when the folder already has an `agjan.config.json`, whe
|
|
|
49
53
|
`package.json` is not valid JSON, or when the folder lies inside another git repository.
|
|
50
54
|
`--dry-run` shows the plan, `--no-install` only pins the version.
|
|
51
55
|
|
|
56
|
+
When everything is written, `init` offers to commit the setup (`chore: set up agjan`): on
|
|
57
|
+
`main` in a new repository, on a branch of its own, `chore/set-up-agjan`, in an existing one
|
|
58
|
+
(the base branch changes through a PR). `--commit` and `--no-commit` answer the question.
|
|
59
|
+
Nothing is committed for you when the folder had other work in it (files in a folder that was
|
|
60
|
+
not a repository, or uncommitted changes), nor when `--no-install` leaves the pre-commit hook
|
|
61
|
+
without its agjan; the next steps then say what to run.
|
|
62
|
+
|
|
52
63
|
The global `agjan` runs `init`, `--help` and `--version` itself. Every other command runs
|
|
53
64
|
in the agjan the project pins in `node_modules`. If that is not installed (a fresh clone),
|
|
54
65
|
the command offers to run the install first; without a terminal it fails and says how
|
package/package.json
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agjan",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.0.15",
|
|
4
|
+
"description": "Agentic engineering harness for AI coding agents: role agents, human approval gates, independent review and CI-enforced checks. SAP BTP first.",
|
|
5
5
|
"keywords": [
|
|
6
|
+
"agentic-engineering",
|
|
7
|
+
"agent-harness",
|
|
6
8
|
"ai",
|
|
7
9
|
"agents",
|
|
10
|
+
"ai-agents",
|
|
8
11
|
"claude-code",
|
|
9
12
|
"copilot",
|
|
10
13
|
"spec-driven",
|
|
14
|
+
"code-review",
|
|
11
15
|
"workflow",
|
|
16
|
+
"sap",
|
|
12
17
|
"cap",
|
|
13
18
|
"fiori",
|
|
14
19
|
"ui5"
|