@yeaft/webchat-agent 1.0.496 → 1.0.498
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/bin/yeaft-repo.js +4 -0
- package/local-runtime/version.json +1 -1
- package/local-runtime/web/app.bundle.js +119 -110
- package/local-runtime/web/app.bundle.js.gz +0 -0
- package/local-runtime/web/index.html +1 -1
- package/package.json +3 -1
- package/repo-workflow-cli.js +101 -0
- package/repo-workflow.js +1437 -0
- package/skills/review-merge-tag/SKILL.md +78 -0
- package/yeaft/cli-session-runner.js +4 -1
- package/yeaft/debug-trace.js +19 -6
- package/yeaft/engine.js +2 -0
- package/yeaft/init.js +5 -2
- package/yeaft/routing/router.js +140 -2
- package/yeaft/skills.js +58 -37
- package/yeaft/tools/activation.js +3 -0
- package/yeaft/tools/index.js +2 -0
- package/yeaft/tools/repo-workflow.js +80 -0
- package/yeaft/tools/route-forward.js +19 -1
- package/yeaft/web-bridge.js +65 -7
- package/yeaft/work-center/projection.js +1 -1
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yeaft/webchat-agent",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.498",
|
|
4
4
|
"description": "Remote worker agent for Yeaft Web Code Agent — connects the native Yeaft engine, CLI providers, and workbench tools",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
"yeaft-agent": "cli.js",
|
|
9
9
|
"yeaft-agent-container": "container-cli.js",
|
|
10
10
|
"yeaft": "yeaft/cli.js",
|
|
11
|
+
"yeaft-repo": "bin/yeaft-repo.js",
|
|
11
12
|
"yeaft-stats": "bin/yeaft-stats.js"
|
|
12
13
|
},
|
|
13
14
|
"scripts": {
|
|
@@ -41,6 +42,7 @@
|
|
|
41
42
|
"docker-entrypoint.sh",
|
|
42
43
|
"yeaft/templates/**/*.md",
|
|
43
44
|
"yeaft/dream/prompts/**/*.md",
|
|
45
|
+
"skills/**/*.md",
|
|
44
46
|
"browser-runtime/extension/**/*",
|
|
45
47
|
"browser-runtime/*.ps1",
|
|
46
48
|
"local-runtime/**/*"
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import {
|
|
2
|
+
formatRepoWorkflowError,
|
|
3
|
+
landRepoWorkflow,
|
|
4
|
+
prepareRepoReview,
|
|
5
|
+
prepareRepoWorkflow,
|
|
6
|
+
} from './repo-workflow.js';
|
|
7
|
+
|
|
8
|
+
const COMMANDS = new Set(['prepare', 'review-prep', 'land']);
|
|
9
|
+
|
|
10
|
+
function requireValue(argv, index, option) {
|
|
11
|
+
const value = argv[index + 1];
|
|
12
|
+
if (value === undefined || value.startsWith('--')) {
|
|
13
|
+
throw new Error(`${option} requires a value`);
|
|
14
|
+
}
|
|
15
|
+
return value;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function parseInteger(value, option) {
|
|
19
|
+
const parsed = Number(value);
|
|
20
|
+
if (!Number.isInteger(parsed) || parsed < 0) {
|
|
21
|
+
throw new Error(`${option} must be a non-negative integer`);
|
|
22
|
+
}
|
|
23
|
+
return parsed;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function parseRepoWorkflowArgs(argv) {
|
|
27
|
+
const args = [...argv];
|
|
28
|
+
const command = args.shift();
|
|
29
|
+
if (!command || command === '--help' || command === '-h') {
|
|
30
|
+
return { help: true, command: null, options: {} };
|
|
31
|
+
}
|
|
32
|
+
if (!COMMANDS.has(command)) {
|
|
33
|
+
throw new Error(`Unknown command: ${command}`);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const options = {};
|
|
37
|
+
for (let index = 0; index < args.length; index += 1) {
|
|
38
|
+
const arg = args[index];
|
|
39
|
+
if (arg === '--help' || arg === '-h') return { help: true, command, options };
|
|
40
|
+
if (!arg.startsWith('--')) throw new Error(`Unexpected argument: ${arg}`);
|
|
41
|
+
const value = requireValue(args, index, arg);
|
|
42
|
+
index += 1;
|
|
43
|
+
switch (arg) {
|
|
44
|
+
case '--cwd': options.cwd = value; break;
|
|
45
|
+
case '--remote': options.remote = value; break;
|
|
46
|
+
case '--base': options.baseBranch = value; break;
|
|
47
|
+
case '--name': options.name = value; break;
|
|
48
|
+
case '--worktree': options.worktreePath = value; break;
|
|
49
|
+
case '--pr': options.pr = parseInteger(value, arg); break;
|
|
50
|
+
case '--reviewed-head': options.reviewedHead = value; break;
|
|
51
|
+
case '--reviewed-snapshot': options.reviewedSnapshot = value; break;
|
|
52
|
+
case '--tag-prefix': options.tagPrefix = value; break;
|
|
53
|
+
case '--tag-start': options.tagStart = parseInteger(value, arg); break;
|
|
54
|
+
case '--workflow': options.workflow = value; break;
|
|
55
|
+
case '--wait-timeout-ms': options.waitTimeoutMs = parseInteger(value, arg); break;
|
|
56
|
+
case '--poll-interval-ms': options.pollIntervalMs = parseInteger(value, arg); break;
|
|
57
|
+
default: throw new Error(`Unknown option: ${arg}`);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return { help: false, command, options };
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function repoWorkflowHelp(command = null) {
|
|
64
|
+
const common = `Common options:\n --cwd <path> Repository or worktree path (default: current directory)\n --remote <name> Git remote (default: origin)`;
|
|
65
|
+
if (command === 'prepare') {
|
|
66
|
+
return `Usage: yeaft-repo prepare --name <name> [options]\n\nFetch the default branch and create or reuse an exact-base development worktree.\n\nOptions:\n --name <name> Worktree and yeaft-wt/<name> branch name\n --base <branch> Base branch (default: repository default)\n --worktree <path> Worktree path\n${common}`;
|
|
67
|
+
}
|
|
68
|
+
if (command === 'review-prep') {
|
|
69
|
+
return `Usage: yeaft-repo review-prep --pr <number> [options]\n\nFreeze GitHub PR head/base/merge refs and create a clean detached review worktree.\n\nOptions:\n --pr <number> Pull request number\n --name <name> Review worktree name\n --worktree <path> Review worktree path\n${common}`;
|
|
70
|
+
}
|
|
71
|
+
if (command === 'land') {
|
|
72
|
+
return `Usage: yeaft-repo land [options]\n\nLanding is unavailable from the standalone CLI. Use RepoWorkflow inside a Session turn carrying a host-issued, exact-review approval capability.\n${common}`;
|
|
73
|
+
}
|
|
74
|
+
return `yeaft-repo — deterministic GitHub repository workflow\n\nUsage:\n yeaft-repo prepare --name <name> [options]\n yeaft-repo review-prep --pr <number> [options]\n\nThe standalone CLI cannot land pull requests; Session landing requires a host-issued approval capability.\nEach command emits one JSON result. GitHub repositories require authenticated git and gh CLIs.\nRun yeaft-repo <command> --help for command options.`;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export async function runRepoWorkflowCli(argv, dependencies = {}) {
|
|
78
|
+
const writeOut = dependencies.writeOut || (text => process.stdout.write(`${text}\n`));
|
|
79
|
+
const writeErr = dependencies.writeErr || (text => process.stderr.write(`${text}\n`));
|
|
80
|
+
try {
|
|
81
|
+
const parsed = parseRepoWorkflowArgs(argv);
|
|
82
|
+
if (parsed.help) {
|
|
83
|
+
writeOut(repoWorkflowHelp(parsed.command));
|
|
84
|
+
return 0;
|
|
85
|
+
}
|
|
86
|
+
let result;
|
|
87
|
+
if (parsed.command === 'prepare') {
|
|
88
|
+
result = await prepareRepoWorkflow(parsed.options, dependencies);
|
|
89
|
+
} else if (parsed.command === 'review-prep') {
|
|
90
|
+
result = await prepareRepoReview(parsed.options, dependencies);
|
|
91
|
+
} else {
|
|
92
|
+
result = await landRepoWorkflow(parsed.options, dependencies);
|
|
93
|
+
}
|
|
94
|
+
writeOut(JSON.stringify(result));
|
|
95
|
+
return 0;
|
|
96
|
+
} catch (error) {
|
|
97
|
+
const result = formatRepoWorkflowError(error);
|
|
98
|
+
writeErr(JSON.stringify(result));
|
|
99
|
+
return 1;
|
|
100
|
+
}
|
|
101
|
+
}
|