@yunhozz/arc 0.4.7 → 0.5.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/MANIFEST.sha256 +37 -29
- package/README.md +1 -1
- package/claude/skill/models.toml +7 -7
- package/claude/skill/references/coordination.md +4 -0
- package/claude/skill/references/handoff-prep.md +1 -1
- package/claude/skill/references/verification.md +9 -4
- package/codex/skill/models.toml +5 -5
- package/codex/skill/references/coordination.md +4 -0
- package/codex/skill/references/handoff-prep.md +1 -1
- package/codex/skill/references/verification.md +9 -4
- package/gemini/agents/arc-implementer.md +1 -1
- package/gemini/agents/arc-planner.md +1 -1
- package/gemini/agents/arc-qa.md +1 -1
- package/gemini/agents/arc-reviewer.md +1 -1
- package/gemini/agents/arc-scouter.md +1 -1
- package/gemini/skill/models.toml +6 -6
- package/gemini/skill/references/coordination.md +4 -0
- package/gemini/skill/references/handoff-prep.md +1 -1
- package/gemini/skill/references/verification.md +9 -4
- package/grok/skill/references/coordination.md +4 -0
- package/grok/skill/references/handoff-prep.md +1 -1
- package/grok/skill/references/verification.md +9 -4
- package/lib/cli/postinstall.mjs +1 -1
- package/lib/installer/runtime-assets.mjs +5 -1
- package/lib/models/catalog-gemini.mjs +4 -1
- package/lib/models/gemini-models.json +4 -0
- package/lib/runtime/final-verify.mjs +2158 -0
- package/lib/runtime/node-test-reporter.mjs +81 -0
- package/lib/runtime/platform-registry.mjs +1 -1
- package/lib/runtime/test-results.mjs +736 -0
- package/lib/runtime/verify-cli.mjs +60 -0
- package/lib/tui/app.mjs +4 -2
- package/lib/tui/render.mjs +1 -1
- package/lib/watch/index.mjs +1 -1
- package/lib/watch/menu.mjs +26 -15
- package/package.json +1 -1
- package/shared/skill/runtime/final-verify.mjs +2158 -0
- package/shared/skill/runtime/node-test-reporter.mjs +81 -0
- package/shared/skill/runtime/platform-registry.mjs +1 -1
- package/shared/skill/runtime/test-results.mjs +736 -0
- package/shared/skill/runtime/verify-cli.mjs +60 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import {fileURLToPath} from 'node:url';
|
|
4
|
+
import {validateWorkflowId} from './scope.mjs';
|
|
5
|
+
import {dispatchVerify, VerifyError, VERIFY_COMMANDS} from './final-verify.mjs';
|
|
6
|
+
|
|
7
|
+
export async function runVerifyCommand(args, io = {}) {
|
|
8
|
+
const output = io.output ?? process.stdout;
|
|
9
|
+
let workflowId = null;
|
|
10
|
+
let result;
|
|
11
|
+
let exit;
|
|
12
|
+
try {
|
|
13
|
+
const [command, ...rest] = args;
|
|
14
|
+
const env = io.env ?? process.env;
|
|
15
|
+
if (VERIFY_COMMANDS.includes(command) && Object.hasOwn(env, 'ARC_BRIDGE_CHILD')) {
|
|
16
|
+
throw new VerifyError('bridge_child');
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
let cwd;
|
|
20
|
+
let input;
|
|
21
|
+
try {
|
|
22
|
+
if (!VERIFY_COMMANDS.includes(command)) throw Error('Expected verify command');
|
|
23
|
+
const options = {};
|
|
24
|
+
for (let i = 0; i < rest.length; i += 2) {
|
|
25
|
+
const key = rest[i];
|
|
26
|
+
if (!['--cwd', '--workflow', '--input'].includes(key) || Object.hasOwn(options, key) || typeof rest[i+1] !== 'string') {
|
|
27
|
+
throw Error('Invalid verify option');
|
|
28
|
+
}
|
|
29
|
+
options[key] = rest[i+1];
|
|
30
|
+
}
|
|
31
|
+
workflowId = validateWorkflowId(options['--workflow']);
|
|
32
|
+
cwd = options['--cwd'];
|
|
33
|
+
if (typeof cwd !== 'string' || !path.isAbsolute(cwd) || path.normalize(cwd) !== cwd || cwd.includes('\0')) {
|
|
34
|
+
throw Error('Absolute workspace required');
|
|
35
|
+
}
|
|
36
|
+
if (options['--input'] !== '-') throw Error('Verify commands require --input -');
|
|
37
|
+
} catch (error) {
|
|
38
|
+
throw new VerifyError('invalid_request', 'deny', {message: error.message});
|
|
39
|
+
}
|
|
40
|
+
const text = io.input ?? fs.readFileSync(0, 'utf8');
|
|
41
|
+
try {
|
|
42
|
+
input = JSON.parse(text);
|
|
43
|
+
} catch {
|
|
44
|
+
throw new VerifyError('invalid_request', 'deny', {message: 'Expected JSON input'});
|
|
45
|
+
}
|
|
46
|
+
result = await dispatchVerify(command, {cwd, workflowId, input, env});
|
|
47
|
+
} catch (error) {
|
|
48
|
+
if (error instanceof VerifyError) result = error.result;
|
|
49
|
+
else {
|
|
50
|
+
exit = 1;
|
|
51
|
+
result = {decision: 'hold', code: 'verify_error', message: error.message};
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
output.write(JSON.stringify({workflowId, ...result}) + '\n');
|
|
55
|
+
return exit ?? {allow: 0, deny: 2, hold: 3}[result.decision];
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (process.argv[1] && fs.realpathSync(process.argv[1], {throwIfNoEntry: false}) === fileURLToPath(import.meta.url)) {
|
|
59
|
+
process.exitCode = await runVerifyCommand(process.argv.slice(2));
|
|
60
|
+
}
|
package/lib/tui/app.mjs
CHANGED
|
@@ -16,7 +16,9 @@ export function resultRows(result,registry=installerRegistryOf(),{version}={}){
|
|
|
16
16
|
const clean=text=>text.replace(/; rollback: [^\r\n]*/g,''),label=platform=>platformLabel(platform,registry),errorLine=error=>clean(error.message.split(/[\r\n]/)[0]);
|
|
17
17
|
const residualRows=new Set();
|
|
18
18
|
const removed=result.code===0&&['removed','absent'].includes(result.cli?.status);
|
|
19
|
-
|
|
19
|
+
const platformOf=item=>item.platform??item.target?.platform??'Target',installed=result.code===0?(result.results??[]).filter(item=>item.status==='installed'&&!item.error):[];
|
|
20
|
+
const applied=installed.length?['🎉 Setup ran successfully! Please restart ARC to check.','Apply to: '+installed.map(item=>label(platformOf(item))).join(', ')]:[];
|
|
21
|
+
return[...(result.messages??[]).map(s=>clean(s.trim())),...[result.stdout,result.stderr].flatMap(text=>text?text.trimEnd().split(/\r?\n/).map(clean):[]),...(result.results??[]).flatMap(item=>{const platform=platformOf(item);return[...(removed&&item.status==='uninstalled'?[]:installed.includes(item)?(item===installed[0]?applied:[]):[item.status==='installed'?`ARC${version==null?'':' '+version} installed for ${label(platform)}.`:item.status==='uninstalled'?`Removed from ${label(platform)}.`:`${platform}: ${item.status}`]),...(item.residualPaths??[]).map(p=>'Residual path: '+p),...(item.error?['Error: '+errorLine(item.error)]:[])];}),...(removed?[result.cli.status==='removed'?'Removed ARC and CLI.':'Removed ARC.']:result.cli?['CLI: '+result.cli.status,...(result.cli.error?['CLI error: '+errorLine(result.cli.error)]:[])]:[]),...(result.error?['Error: '+errorLine(result.error)]:[]),...(result.code!==0?['Exit code: '+result.code]:[]),...(result.exitSession?[result.cli?'CLI removal ended this session.':'CLI replacement ended this session.']:[])].filter(row=>{if(!row.startsWith('Residual path: '))return true;if(residualRows.has(row))return false;residualRows.add(row);return true;});
|
|
20
22
|
}
|
|
21
23
|
function formatElapsed(ms){
|
|
22
24
|
const minutes=Math.floor(ms/60000),hours=Math.floor(minutes/60),days=Math.floor(hours/24);
|
|
@@ -73,7 +75,7 @@ export async function runTui(options={}){
|
|
|
73
75
|
}
|
|
74
76
|
}
|
|
75
77
|
if(code===0&&['install','preset','switch','composite'].includes(prepared.kind))for(const key of Object.keys(draft))delete draft[key];
|
|
76
|
-
const rows=prepared.kind==='update'&&code===0?[
|
|
78
|
+
const rows=prepared.kind==='update'&&code===0?['🎉 Update ran successfully! Please restart ARC to check.']:resultRows(result,registry,{version:packageVersion});
|
|
77
79
|
if(code===130||result.exitSession){finalReport=rows;if(result.exitSession)session.render({title:'Result',rows:finalReport,hint:'Session ended'});return true;}
|
|
78
80
|
await ui.page('Result',rows);return false;
|
|
79
81
|
}
|
package/lib/tui/render.mjs
CHANGED
|
@@ -13,7 +13,7 @@ export function navigationHint(mode='menu',{backLabel='back',horizontal=false}={
|
|
|
13
13
|
if(mode==='text')return'↑/↓: Select · Type/Paste Input · Backspace Delete · Enter Continue · Esc Home';
|
|
14
14
|
if(mode==='busy')return'Ctrl+C Interrupt';
|
|
15
15
|
if(mode==='page')return'↑/↓: Scroll · Enter Back · Esc Home';
|
|
16
|
-
if(mode==='checklist')return'↑/↓: Select · Enter Toggle · Esc Home';
|
|
16
|
+
if(mode==='checklist')return'↑/↓: Select · Enter Toggle · Esc '+(backLabel==='exit'?'Exit':'Home');
|
|
17
17
|
return'↑/↓: Select · '+(horizontal?'←/→: Change · ':'')+'Enter Continue · Esc '+(backLabel==='exit'?'Exit':'Home');
|
|
18
18
|
}
|
|
19
19
|
export function arrowValue(text,frame,active){return active&&Math.floor(frame/5)%2===1?' <'+text+'> ':'< '+text+' >';}
|
package/lib/watch/index.mjs
CHANGED
|
@@ -15,7 +15,7 @@ export const WATCH_HELP = `Usage: arc watch [options]
|
|
|
15
15
|
Follow session activity of supported platforms in one read-only stream.
|
|
16
16
|
|
|
17
17
|
Scope:
|
|
18
|
-
|
|
18
|
+
Check the platforms to watch in the menu; all supported platforms are checked by default. Every selection watches the current Git worktree, or the current directory outside Git. Requires an interactive terminal.
|
|
19
19
|
|
|
20
20
|
Output:
|
|
21
21
|
--tail <n> First show the last <n> events from recently active sessions (default 20, 0 = new only)
|
package/lib/watch/menu.mjs
CHANGED
|
@@ -2,37 +2,48 @@ import {createTuiInterface} from '../tui/interface.mjs';
|
|
|
2
2
|
import {createTerminalSession} from '../tui/terminal.mjs';
|
|
3
3
|
|
|
4
4
|
export function watchMenuRows(registry) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
return {label:label+' (not supported)',platforms:null};
|
|
9
|
-
}
|
|
10
|
-
all.platforms.push(id);
|
|
11
|
-
return {label,platforms:[id]};
|
|
12
|
-
});
|
|
13
|
-
return [all,...rows];
|
|
5
|
+
return registry.byDisplayOrder().map(({id,label,capabilities}) => ({
|
|
6
|
+
id,label,supported:capabilities.watch.state === 'verified',
|
|
7
|
+
}));
|
|
14
8
|
}
|
|
15
9
|
|
|
16
10
|
export async function chooseWatchPlatforms({input,output,env,signals,registry,createSession=createTerminalSession}) {
|
|
17
11
|
const rows = watchMenuRows(registry);
|
|
18
|
-
const
|
|
12
|
+
const checked = new Set(rows.filter(row => row.supported).map(row => row.id));
|
|
13
|
+
const watchIndex = rows.length;
|
|
14
|
+
const actionKinds = [...rows.map(() => undefined),'confirm'];
|
|
19
15
|
const session = createSession({input,output,env,signals});
|
|
20
16
|
try {
|
|
21
17
|
const ui = createTuiInterface(session,{input});
|
|
22
|
-
let selected =
|
|
18
|
+
let selected = watchIndex, notice = [];
|
|
23
19
|
for (;;) {
|
|
20
|
+
const labels = rows.map(({id,label,supported}) => {
|
|
21
|
+
if (!supported) return '[-] '+label+' (not supported)';
|
|
22
|
+
return (checked.has(id) ? '[x] ' : '[ ] ')+label;
|
|
23
|
+
});
|
|
24
|
+
labels.push('Watch');
|
|
24
25
|
const previous = selected;
|
|
25
|
-
selected = await ui.menu('Which
|
|
26
|
-
selected,backRow:true,backLabel:'exit',
|
|
26
|
+
selected = await ui.menu('Which platforms to watch?',labels,{
|
|
27
|
+
selected,backRow:true,backLabel:'exit',hint:'checklist',actionKinds,
|
|
27
28
|
notice:({selected:current})=>{
|
|
28
29
|
if (current !== previous) notice = [];
|
|
29
30
|
return notice;
|
|
30
31
|
},
|
|
31
32
|
});
|
|
32
33
|
if (selected === null) return null;
|
|
34
|
+
if (selected === watchIndex) {
|
|
35
|
+
if (checked.size) return rows.filter(row => checked.has(row.id)).map(row => row.id);
|
|
36
|
+
notice = ['Select at least one platform to watch.'];
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
33
39
|
const row = rows[selected];
|
|
34
|
-
if (row.
|
|
35
|
-
|
|
40
|
+
if (!row.supported) {
|
|
41
|
+
notice = [row.label+' is not supported by arc watch.'];
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
if (checked.has(row.id)) checked.delete(row.id);
|
|
45
|
+
else checked.add(row.id);
|
|
46
|
+
notice = [];
|
|
36
47
|
}
|
|
37
48
|
} catch (error) {
|
|
38
49
|
if (error.code === 'ARC_TUI_EOF') return null;
|