@open-agent-toolkit/cli 0.1.69 → 0.1.72
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/assets/docs/cli-utilities/configuration.md +27 -0
- package/assets/docs/cli-utilities/index.md +1 -1
- package/assets/docs/cli-utilities/workflow-gates.md +126 -3
- package/assets/docs/reference/cli-reference.md +5 -1
- package/assets/docs/workflows/projects/dispatch-ceiling.md +14 -5
- package/assets/docs/workflows/projects/orchestration-model.md +21 -0
- package/assets/docs/workflows/projects/review-flavors.md +9 -0
- package/assets/public-package-versions.json +4 -4
- package/assets/skills/oat-dispatch-subagents/SKILL.md +21 -1
- package/assets/skills/oat-dispatch-subagents/references/provider-claude.md +21 -0
- package/assets/skills/oat-dispatch-subagents/references/provider-codex.md +16 -0
- package/assets/skills/oat-dispatch-subagents/references/provider-cursor.md +21 -0
- package/assets/skills/oat-project-autonomous/references/gate-inventory.md +3 -0
- package/assets/skills/oat-project-document/references/docs/autonomy-contract.md +3 -0
- package/assets/skills/oat-project-implement/references/docs/autonomy-contract.md +3 -0
- package/assets/skills/oat-project-plan-writing/SKILL.md +23 -33
- package/assets/skills/oat-project-pr-final/references/docs/autonomy-contract.md +3 -0
- package/assets/skills/oat-project-quick-start/references/docs/autonomy-contract.md +3 -0
- package/assets/skills/oat-project-review-provide/SKILL.md +62 -1
- package/dist/commands/config/index.d.ts.map +1 -1
- package/dist/commands/config/index.js +65 -1
- package/dist/commands/gate/__fixtures__/fake-runtime.d.mts +3 -0
- package/dist/commands/gate/__fixtures__/fake-runtime.d.mts.map +1 -0
- package/dist/commands/gate/__fixtures__/fake-runtime.mjs +167 -0
- package/dist/commands/gate/activity-probes.d.ts +35 -0
- package/dist/commands/gate/activity-probes.d.ts.map +1 -0
- package/dist/commands/gate/activity-probes.js +135 -0
- package/dist/commands/gate/branch-local-cli.d.ts +31 -0
- package/dist/commands/gate/branch-local-cli.d.ts.map +1 -0
- package/dist/commands/gate/branch-local-cli.js +116 -0
- package/dist/commands/gate/index.d.ts +29 -0
- package/dist/commands/gate/index.d.ts.map +1 -1
- package/dist/commands/gate/index.js +438 -32
- package/dist/commands/gate/route.d.ts +22 -0
- package/dist/commands/gate/route.d.ts.map +1 -0
- package/dist/commands/gate/route.js +109 -0
- package/dist/commands/project/dispatch-ceiling/index.d.ts.map +1 -1
- package/dist/commands/project/dispatch-ceiling/index.js +100 -16
- package/dist/config/oat-config.d.ts +9 -0
- package/dist/config/oat-config.d.ts.map +1 -1
- package/dist/config/oat-config.js +23 -0
- package/dist/config/resolve.js +7 -0
- package/package.json +2 -2
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { readdir, realpath, stat } from 'node:fs/promises';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
const MAX_TRAVERSAL_DEPTH = 2;
|
|
4
|
+
export function encodeClaudeProjectPath(cwd) {
|
|
5
|
+
return cwd.replace(/[/._]/gu, '-');
|
|
6
|
+
}
|
|
7
|
+
export function encodeCursorProjectPath(cwd) {
|
|
8
|
+
return cwd.split(/[/._]/u).filter(Boolean).join('-');
|
|
9
|
+
}
|
|
10
|
+
function utcDatePath(timestamp) {
|
|
11
|
+
const date = new Date(timestamp);
|
|
12
|
+
return [
|
|
13
|
+
String(date.getUTCFullYear()),
|
|
14
|
+
String(date.getUTCMonth() + 1).padStart(2, '0'),
|
|
15
|
+
String(date.getUTCDate()).padStart(2, '0'),
|
|
16
|
+
];
|
|
17
|
+
}
|
|
18
|
+
export function resolveGateActivityPaths(context, observedAt = context.spawnedAt) {
|
|
19
|
+
const cwdVariants = [...new Set([context.cwd, context.realCwd])].filter((cwd) => Boolean(cwd));
|
|
20
|
+
if (context.runtime === 'claude') {
|
|
21
|
+
return cwdVariants.map((cwd) => join(context.home, '.claude', 'projects', encodeClaudeProjectPath(cwd)));
|
|
22
|
+
}
|
|
23
|
+
if (context.runtime === 'cursor') {
|
|
24
|
+
return cwdVariants.map((cwd) => join(context.home, '.cursor', 'projects', encodeCursorProjectPath(cwd), 'agent-transcripts'));
|
|
25
|
+
}
|
|
26
|
+
if (context.runtime === 'codex') {
|
|
27
|
+
const sessionsRoot = join(context.home, '.codex', 'sessions');
|
|
28
|
+
const paths = [
|
|
29
|
+
join(sessionsRoot, ...utcDatePath(context.spawnedAt)),
|
|
30
|
+
join(sessionsRoot, ...utcDatePath(observedAt)),
|
|
31
|
+
];
|
|
32
|
+
return [...new Set(paths)];
|
|
33
|
+
}
|
|
34
|
+
return [];
|
|
35
|
+
}
|
|
36
|
+
async function collectMetadata(path, depth) {
|
|
37
|
+
const pathStat = await stat(path);
|
|
38
|
+
let lastChangeAt = pathStat.mtimeMs;
|
|
39
|
+
let totalSizeBytes = pathStat.size;
|
|
40
|
+
if (!pathStat.isDirectory() || depth >= MAX_TRAVERSAL_DEPTH) {
|
|
41
|
+
return { lastChangeAt, totalSizeBytes };
|
|
42
|
+
}
|
|
43
|
+
const entries = await readdir(path, { withFileTypes: true });
|
|
44
|
+
for (const entry of entries) {
|
|
45
|
+
const child = await collectMetadata(join(path, entry.name), depth + 1);
|
|
46
|
+
lastChangeAt = Math.max(lastChangeAt, child.lastChangeAt);
|
|
47
|
+
totalSizeBytes += child.totalSizeBytes;
|
|
48
|
+
}
|
|
49
|
+
return { lastChangeAt, totalSizeBytes };
|
|
50
|
+
}
|
|
51
|
+
async function snapshotPaths(paths) {
|
|
52
|
+
let found = false;
|
|
53
|
+
let lastChangeAt = 0;
|
|
54
|
+
let totalSizeBytes = 0;
|
|
55
|
+
try {
|
|
56
|
+
for (const path of paths) {
|
|
57
|
+
try {
|
|
58
|
+
const snapshot = await collectMetadata(path, 0);
|
|
59
|
+
found = true;
|
|
60
|
+
lastChangeAt = Math.max(lastChangeAt, snapshot.lastChangeAt);
|
|
61
|
+
totalSizeBytes += snapshot.totalSizeBytes;
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
if (error instanceof Error &&
|
|
65
|
+
'code' in error &&
|
|
66
|
+
error.code === 'ENOENT') {
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
return { status: 'error' };
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
catch {
|
|
74
|
+
return { status: 'error' };
|
|
75
|
+
}
|
|
76
|
+
return found
|
|
77
|
+
? {
|
|
78
|
+
status: 'available',
|
|
79
|
+
snapshot: { lastChangeAt, totalSizeBytes },
|
|
80
|
+
}
|
|
81
|
+
: { status: 'path-absent' };
|
|
82
|
+
}
|
|
83
|
+
export async function createGateActivityProbe(context) {
|
|
84
|
+
const resolvedContext = {
|
|
85
|
+
...context,
|
|
86
|
+
realCwd: await realpath(context.cwd).catch(() => context.cwd),
|
|
87
|
+
};
|
|
88
|
+
const initialPaths = resolveGateActivityPaths(resolvedContext);
|
|
89
|
+
if (initialPaths.length === 0)
|
|
90
|
+
return null;
|
|
91
|
+
const baseline = await snapshotPaths(initialPaths);
|
|
92
|
+
const scope = context.runtime === 'codex' ? 'ambient-runtime' : 'project-dir';
|
|
93
|
+
const observe = async (observedAt = Date.now()) => {
|
|
94
|
+
const paths = resolveGateActivityPaths(resolvedContext, observedAt);
|
|
95
|
+
const current = await snapshotPaths(paths);
|
|
96
|
+
const attemptedPath = paths.join(',');
|
|
97
|
+
if (current.status !== 'available' || !current.snapshot) {
|
|
98
|
+
return {
|
|
99
|
+
status: current.status,
|
|
100
|
+
runtime: context.runtime,
|
|
101
|
+
scope,
|
|
102
|
+
attemptedPath,
|
|
103
|
+
observedAt,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
const evidence = {
|
|
107
|
+
source: 'transcript-dir',
|
|
108
|
+
runtime: context.runtime,
|
|
109
|
+
scope,
|
|
110
|
+
observedPath: attemptedPath,
|
|
111
|
+
lastChangeAt: current.snapshot.lastChangeAt,
|
|
112
|
+
totalSizeBytes: current.snapshot.totalSizeBytes,
|
|
113
|
+
changedSinceBaseline: baseline.status !== 'available' ||
|
|
114
|
+
!baseline.snapshot ||
|
|
115
|
+
current.snapshot.lastChangeAt !== baseline.snapshot.lastChangeAt ||
|
|
116
|
+
current.snapshot.totalSizeBytes !== baseline.snapshot.totalSizeBytes,
|
|
117
|
+
observedAt,
|
|
118
|
+
};
|
|
119
|
+
return {
|
|
120
|
+
status: 'available',
|
|
121
|
+
runtime: context.runtime,
|
|
122
|
+
scope,
|
|
123
|
+
attemptedPath,
|
|
124
|
+
observedAt,
|
|
125
|
+
evidence,
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
return {
|
|
129
|
+
runtime: context.runtime,
|
|
130
|
+
observe,
|
|
131
|
+
async probe(observedAt = Date.now()) {
|
|
132
|
+
return (await observe(observedAt)).evidence ?? null;
|
|
133
|
+
},
|
|
134
|
+
};
|
|
135
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export interface GateCliLaunch {
|
|
2
|
+
command: string;
|
|
3
|
+
args: string[];
|
|
4
|
+
cwd?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface BranchLocalGateCli {
|
|
7
|
+
cliPath: string;
|
|
8
|
+
cliRoot: string;
|
|
9
|
+
routeReceiptPath: string;
|
|
10
|
+
shimRoot: string;
|
|
11
|
+
}
|
|
12
|
+
export interface ValidatedGateRouteEnvelope {
|
|
13
|
+
route: 'inline' | 'delegate-sync' | 'refuse';
|
|
14
|
+
reason: string;
|
|
15
|
+
cliRoot: string;
|
|
16
|
+
}
|
|
17
|
+
export interface GateRouteReceipt extends ValidatedGateRouteEnvelope {
|
|
18
|
+
runtime: string;
|
|
19
|
+
}
|
|
20
|
+
export declare function currentGateCliRoot(): string;
|
|
21
|
+
export declare function currentGateCliLaunch(): GateCliLaunch;
|
|
22
|
+
export declare function createBranchLocalGateCli(input: {
|
|
23
|
+
runId: string;
|
|
24
|
+
launch: GateCliLaunch;
|
|
25
|
+
cliRoot?: string;
|
|
26
|
+
tempRoot?: string;
|
|
27
|
+
}): Promise<BranchLocalGateCli>;
|
|
28
|
+
export declare function removeBranchLocalGateCli(shim: BranchLocalGateCli): Promise<void>;
|
|
29
|
+
export declare function validateGateRouteEnvelope(output: string, expectedCliRoot: string): ValidatedGateRouteEnvelope;
|
|
30
|
+
export declare function readGateRouteReceipt(path: string, expectedCliRoot: string, expectedRuntime: string): Promise<GateRouteReceipt>;
|
|
31
|
+
//# sourceMappingURL=branch-local-cli.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"branch-local-cli.d.ts","sourceRoot":"","sources":["../../../src/commands/gate/branch-local-cli.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,0BAA0B;IACzC,KAAK,EAAE,QAAQ,GAAG,eAAe,GAAG,QAAQ,CAAC;IAC7C,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,gBAAiB,SAAQ,0BAA0B;IAClE,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C;AAED,wBAAgB,oBAAoB,IAAI,aAAa,CAUpD;AA4CD,wBAAsB,wBAAwB,CAAC,KAAK,EAAE;IACpD,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,aAAa,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CA+B9B;AAED,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,kBAAkB,GACvB,OAAO,CAAC,IAAI,CAAC,CAEf;AAED,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,MAAM,GACtB,0BAA0B,CA2B5B;AAED,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,MAAM,EACZ,eAAe,EAAE,MAAM,EACvB,eAAe,EAAE,MAAM,GACtB,OAAO,CAAC,gBAAgB,CAAC,CAU3B"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { chmod, mkdir, readFile, rm, writeFile } from 'node:fs/promises';
|
|
2
|
+
import { createRequire } from 'node:module';
|
|
3
|
+
import { tmpdir } from 'node:os';
|
|
4
|
+
import { dirname, join, resolve } from 'node:path';
|
|
5
|
+
import { fileURLToPath } from 'node:url';
|
|
6
|
+
export function currentGateCliRoot() {
|
|
7
|
+
return resolve(dirname(fileURLToPath(import.meta.url)), '../../../../..');
|
|
8
|
+
}
|
|
9
|
+
export function currentGateCliLaunch() {
|
|
10
|
+
const entrypoint = process.argv[1];
|
|
11
|
+
if (!entrypoint) {
|
|
12
|
+
throw new Error('Unable to resolve the running OAT CLI entrypoint.');
|
|
13
|
+
}
|
|
14
|
+
return {
|
|
15
|
+
command: process.execPath,
|
|
16
|
+
args: [...resolveCurrentLoaderArgs(process.execArgv), entrypoint],
|
|
17
|
+
cwd: process.cwd(),
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function resolveCurrentLoaderArgs(args) {
|
|
21
|
+
const resolved = [];
|
|
22
|
+
for (let index = 0; index < args.length; index += 1) {
|
|
23
|
+
const argument = args[index];
|
|
24
|
+
if (argument === '--import' || argument === '--require') {
|
|
25
|
+
const specifier = args[index + 1];
|
|
26
|
+
resolved.push(argument);
|
|
27
|
+
if (specifier) {
|
|
28
|
+
resolved.push(resolveLoaderSpecifier(argument, specifier));
|
|
29
|
+
index += 1;
|
|
30
|
+
}
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
const inline = argument.match(/^(--import|--require)=(.+)$/);
|
|
34
|
+
if (inline) {
|
|
35
|
+
resolved.push(`${inline[1]}=${resolveLoaderSpecifier(inline[1], inline[2])}`);
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
resolved.push(argument);
|
|
39
|
+
}
|
|
40
|
+
return resolved;
|
|
41
|
+
}
|
|
42
|
+
function resolveLoaderSpecifier(flag, specifier) {
|
|
43
|
+
if (specifier.startsWith('/') ||
|
|
44
|
+
specifier.startsWith('.') ||
|
|
45
|
+
specifier.startsWith('file:')) {
|
|
46
|
+
return specifier;
|
|
47
|
+
}
|
|
48
|
+
try {
|
|
49
|
+
return flag === '--require'
|
|
50
|
+
? createRequire(import.meta.url).resolve(specifier)
|
|
51
|
+
: import.meta.resolve(specifier);
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
return specifier;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
export async function createBranchLocalGateCli(input) {
|
|
58
|
+
const cliRoot = input.cliRoot ?? currentGateCliRoot();
|
|
59
|
+
const shimRoot = join(input.tempRoot ?? tmpdir(), 'oat-gate-runs', input.runId);
|
|
60
|
+
const cliPath = join(shimRoot, 'bin', 'oat');
|
|
61
|
+
const routeReceiptPath = join(shimRoot, 'route-receipt.json');
|
|
62
|
+
await mkdir(dirname(cliPath), { recursive: true });
|
|
63
|
+
await writeFile(cliPath, [
|
|
64
|
+
'#!/usr/bin/env node',
|
|
65
|
+
"import { spawnSync } from 'node:child_process';",
|
|
66
|
+
`const command = ${JSON.stringify(input.launch.command)};`,
|
|
67
|
+
`const args = ${JSON.stringify(input.launch.args)};`,
|
|
68
|
+
'const result = spawnSync(command, [...args, ...process.argv.slice(2)], {',
|
|
69
|
+
" stdio: 'inherit',",
|
|
70
|
+
' env: process.env,',
|
|
71
|
+
` cwd: ${JSON.stringify(input.launch.cwd)},`,
|
|
72
|
+
'});',
|
|
73
|
+
'if (result.error) {',
|
|
74
|
+
' process.stderr.write(`${result.error.message}\\n`);',
|
|
75
|
+
'}',
|
|
76
|
+
'process.exit(result.status ?? 1);',
|
|
77
|
+
'',
|
|
78
|
+
].join('\n'));
|
|
79
|
+
await chmod(cliPath, 0o700);
|
|
80
|
+
return { cliPath, cliRoot, routeReceiptPath, shimRoot };
|
|
81
|
+
}
|
|
82
|
+
export async function removeBranchLocalGateCli(shim) {
|
|
83
|
+
await rm(shim.shimRoot, { recursive: true, force: true });
|
|
84
|
+
}
|
|
85
|
+
export function validateGateRouteEnvelope(output, expectedCliRoot) {
|
|
86
|
+
let parsed;
|
|
87
|
+
try {
|
|
88
|
+
parsed = JSON.parse(output);
|
|
89
|
+
}
|
|
90
|
+
catch (error) {
|
|
91
|
+
throw new Error('Branch-local gate route did not return JSON.', {
|
|
92
|
+
cause: error,
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
if (!parsed || typeof parsed !== 'object') {
|
|
96
|
+
throw new Error('Branch-local gate route returned no decision envelope.');
|
|
97
|
+
}
|
|
98
|
+
const envelope = parsed;
|
|
99
|
+
if (!['inline', 'delegate-sync', 'refuse'].includes(String(envelope.route)) ||
|
|
100
|
+
typeof envelope.reason !== 'string') {
|
|
101
|
+
throw new Error('Branch-local gate route returned help or an invalid decision envelope.');
|
|
102
|
+
}
|
|
103
|
+
if (envelope.cliRoot !== expectedCliRoot) {
|
|
104
|
+
throw new Error(`Branch-local gate route resolved outside the expected checkout (${String(envelope.cliRoot)} != ${expectedCliRoot}).`);
|
|
105
|
+
}
|
|
106
|
+
return envelope;
|
|
107
|
+
}
|
|
108
|
+
export async function readGateRouteReceipt(path, expectedCliRoot, expectedRuntime) {
|
|
109
|
+
const output = await readFile(path, 'utf8').catch(() => '');
|
|
110
|
+
const envelope = validateGateRouteEnvelope(output, expectedCliRoot);
|
|
111
|
+
const parsed = JSON.parse(output);
|
|
112
|
+
if (parsed.runtime !== expectedRuntime) {
|
|
113
|
+
throw new Error(`Branch-local gate route receipt runtime did not match (${String(parsed.runtime)} != ${expectedRuntime}).`);
|
|
114
|
+
}
|
|
115
|
+
return { ...envelope, runtime: expectedRuntime };
|
|
116
|
+
}
|
|
@@ -4,6 +4,8 @@ import { type ResolvedConfig } from '../../config/resolve.js';
|
|
|
4
4
|
import { type ModelFamily } from '../../providers/identity/family.js';
|
|
5
5
|
import { type IdentityConfidence, type IdentityProvenance } from '../../providers/identity/provenance.js';
|
|
6
6
|
import { Command } from 'commander';
|
|
7
|
+
import { createGateActivityProbe, type GateActivityEvidence, type GateActivityProbe, type GateActivityProbeStatus } from './activity-probes.js';
|
|
8
|
+
import { createBranchLocalGateCli, currentGateCliLaunch, readGateRouteReceipt, removeBranchLocalGateCli } from './branch-local-cli.js';
|
|
7
9
|
import { parseReviewGateVerdict } from './review-verdict.js';
|
|
8
10
|
interface GateCommandDependencies {
|
|
9
11
|
buildCommandContext: (options: GlobalOptions) => CommandContext;
|
|
@@ -15,12 +17,20 @@ interface GateCommandDependencies {
|
|
|
15
17
|
readUserConfig: (userConfigDir: string) => Promise<UserConfig>;
|
|
16
18
|
writeUserConfig: (userConfigDir: string, config: UserConfig) => Promise<void>;
|
|
17
19
|
resolveEffectiveConfig: (repoRoot: string, userConfigDir: string, env: NodeJS.ProcessEnv) => Promise<ResolvedConfig>;
|
|
20
|
+
createGateActivityProbe: typeof createGateActivityProbe;
|
|
21
|
+
createBranchLocalGateCli: typeof createBranchLocalGateCli;
|
|
22
|
+
currentGateCliLaunch: typeof currentGateCliLaunch;
|
|
23
|
+
removeBranchLocalGateCli: typeof removeBranchLocalGateCli;
|
|
24
|
+
readGateRouteReceipt: typeof readGateRouteReceipt;
|
|
18
25
|
runProcess: (command: string, args: string[], options: ProcessRunOptions) => Promise<ProcessRunResult>;
|
|
19
26
|
parseReviewGateVerdict: typeof parseReviewGateVerdict;
|
|
20
27
|
processEnv: NodeJS.ProcessEnv;
|
|
28
|
+
writeGateRunMarker: (path: string, marker: GateRunMarker, warn: (message: string) => void) => Promise<boolean>;
|
|
29
|
+
removeGateRunMarker: (path: string, warn: (message: string) => void) => Promise<void>;
|
|
21
30
|
writeDiagnostic: (message: string) => void;
|
|
22
31
|
}
|
|
23
32
|
interface ProcessRunOptions {
|
|
33
|
+
activityProbe?: GateActivityProbe;
|
|
24
34
|
cwd: string;
|
|
25
35
|
env: NodeJS.ProcessEnv;
|
|
26
36
|
livenessIntervalMs?: number;
|
|
@@ -31,7 +41,11 @@ interface ProcessRunOptions {
|
|
|
31
41
|
timeoutMs: number;
|
|
32
42
|
}
|
|
33
43
|
interface ProcessRunResult {
|
|
44
|
+
activityEvidence?: GateActivityEvidence;
|
|
45
|
+
activityProbeStatus?: GateActivityProbeStatus;
|
|
46
|
+
capturedOutput?: string;
|
|
34
47
|
exitCode: number;
|
|
48
|
+
refusal?: string;
|
|
35
49
|
stderrBytes: number;
|
|
36
50
|
stdoutBytes: number;
|
|
37
51
|
timedOut?: boolean;
|
|
@@ -40,6 +54,21 @@ interface GateLivenessSnapshot {
|
|
|
40
54
|
elapsedMs: number;
|
|
41
55
|
hardBudgetMs: number;
|
|
42
56
|
idleMs: number;
|
|
57
|
+
processAlive: boolean;
|
|
58
|
+
activityProbeStatus?: GateActivityProbeStatus;
|
|
59
|
+
lastActivityEvidence?: GateActivityEvidence;
|
|
60
|
+
}
|
|
61
|
+
type GateTimeoutSource = 'cli' | 'target' | 'config' | 'env' | 'scope-default' | 'default';
|
|
62
|
+
interface GateRunMarker {
|
|
63
|
+
runId: string;
|
|
64
|
+
targetId: string;
|
|
65
|
+
runtime: string;
|
|
66
|
+
reviewType: string | null;
|
|
67
|
+
reviewScope: string | null;
|
|
68
|
+
project: string;
|
|
69
|
+
startedAt: string;
|
|
70
|
+
budgetMs: number;
|
|
71
|
+
budgetSource: GateTimeoutSource;
|
|
43
72
|
}
|
|
44
73
|
type CrossProviderAvoid = 'same-family' | 'same-runtime' | 'none';
|
|
45
74
|
type GateDiversityAchieved = 'different-family' | 'degraded-to-different-slug' | 'same-family - no diverse target available' | 'unknown-producer';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/gate/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/gate/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAC;AAS9B,OAAO,EAWL,KAAK,UAAU,EAIf,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,UAAU,EAEhB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAKL,KAAK,cAAc,EACpB,MAAM,iBAAiB,CAAC;AAWzB,OAAO,EAEL,KAAK,WAAW,EACjB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EAExB,MAAM,gCAAgC,CAAC;AAExC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EACL,uBAAuB,EACvB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,EAC7B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,wBAAwB,EACxB,oBAAoB,EACpB,oBAAoB,EACpB,wBAAwB,EAEzB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,sBAAsB,EAIvB,MAAM,kBAAkB,CAAC;AAG1B,UAAU,uBAAuB;IAC/B,mBAAmB,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,cAAc,CAAC;IAChE,kBAAkB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACrD,aAAa,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,SAAS,CAAC,CAAC;IACxD,cAAc,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACvE,kBAAkB,EAAE,CAAC,QAAQ,EAAE,MAA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