jules-orchestrator-kit 0.25.0 ā 0.25.1
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/agentctl.mjs +3 -3
- package/index.mjs +1 -1
- package/package.json +1 -1
- package/scripts/command-resolver.mjs +36 -2
- package/scripts/jules-self-audit.mjs +56 -4
- package/src/engine.mjs +2 -2
- package/src/mcp.mjs +1 -1
package/bin/agentctl.mjs
CHANGED
|
@@ -14,7 +14,7 @@ const command = args[0];
|
|
|
14
14
|
|
|
15
15
|
function printHelp() {
|
|
16
16
|
console.log(`
|
|
17
|
-
š agentctl v0.25.
|
|
17
|
+
š agentctl v0.25.1 ā Universal Agent Orchestrator & Safety Gatekeeper
|
|
18
18
|
|
|
19
19
|
Usage: agentctl <command> [options]
|
|
20
20
|
|
|
@@ -44,7 +44,7 @@ async function main() {
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
if (command === "version" || command === "--version" || command === "-v") {
|
|
47
|
-
console.log("agentctl v0.25.
|
|
47
|
+
console.log("agentctl v0.25.1");
|
|
48
48
|
process.exit(0);
|
|
49
49
|
}
|
|
50
50
|
|
|
@@ -226,7 +226,7 @@ async function main() {
|
|
|
226
226
|
}
|
|
227
227
|
|
|
228
228
|
case "doctor": {
|
|
229
|
-
console.log(`\nš agentctl System Diagnostics (v0.25.
|
|
229
|
+
console.log(`\nš agentctl System Diagnostics (v0.25.1)`);
|
|
230
230
|
console.log(`--------------------------------------------------`);
|
|
231
231
|
console.log(` Project Root : ${root}`);
|
|
232
232
|
console.log(` Config File : ${config._file || "None (Using defaults)"}`);
|
package/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -3,13 +3,39 @@
|
|
|
3
3
|
* Re-exports detectStack from src/config.mjs.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { detectStack } from "../src/config.mjs";
|
|
6
|
+
import { detectStack, parseYaml } from "../src/config.mjs";
|
|
7
7
|
import { existsSync, readFileSync } from "node:fs";
|
|
8
8
|
import { join } from "node:path";
|
|
9
9
|
|
|
10
10
|
export { detectStack, detectPackageManager } from "../src/config.mjs";
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Extract and parse custom command definitions from .agent/jules.yml or .agent/config.yml.
|
|
14
|
+
*/
|
|
15
|
+
export function parseYamlConfig(root = process.cwd()) {
|
|
16
|
+
const candidates = [join(root, ".agent", "jules.yml"), join(root, ".agent", "config.yml")];
|
|
17
|
+
for (const configPath of candidates) {
|
|
18
|
+
if (existsSync(configPath)) {
|
|
19
|
+
try {
|
|
20
|
+
const raw = readFileSync(configPath, "utf-8");
|
|
21
|
+
const parsed = parseYaml(raw);
|
|
22
|
+
if (parsed && (parsed.test_cmd || parsed.build_cmd || parsed.verify)) {
|
|
23
|
+
return {
|
|
24
|
+
testCmd: parsed.verify?.test || parsed.test_cmd || "",
|
|
25
|
+
buildCmd: parsed.verify?.build || parsed.build_cmd || "",
|
|
26
|
+
source: configPath.endsWith("jules.yml") ? ".agent/jules.yml" : ".agent/config.yml",
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
} catch (_) {}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Autodetect framework/stack test and build verification commands.
|
|
37
|
+
*/
|
|
38
|
+
export function detectFrameworkCommands(root = process.cwd()) {
|
|
13
39
|
try {
|
|
14
40
|
const pkgPath = join(root, "package.json");
|
|
15
41
|
if (existsSync(pkgPath)) {
|
|
@@ -29,6 +55,14 @@ export function resolveProjectCommands(root = process.cwd()) {
|
|
|
29
55
|
};
|
|
30
56
|
}
|
|
31
57
|
|
|
58
|
+
export function resolveProjectCommands(root = process.cwd()) {
|
|
59
|
+
const yamlConfig = parseYamlConfig(root);
|
|
60
|
+
if (yamlConfig) {
|
|
61
|
+
return yamlConfig;
|
|
62
|
+
}
|
|
63
|
+
return detectFrameworkCommands(root);
|
|
64
|
+
}
|
|
65
|
+
|
|
32
66
|
export function resolveWorkspaceExecutionBoundary(paths = [], root = process.cwd()) {
|
|
33
67
|
if (existsSync(join(root, "turbo.json"))) {
|
|
34
68
|
return {
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
import { gate } from "../src/engine.mjs";
|
|
9
9
|
import { loadConfig, parseYaml } from "../src/config.mjs";
|
|
10
10
|
import { matchesGlob } from "../src/security.mjs";
|
|
11
|
+
import { existsSync } from "node:fs";
|
|
12
|
+
import { join } from "node:path";
|
|
11
13
|
|
|
12
14
|
export function matchGlob(filepath, globPattern) {
|
|
13
15
|
return matchesGlob(filepath, globPattern);
|
|
@@ -63,19 +65,69 @@ export function getOodaStateFile(mergeBase = "main") {
|
|
|
63
65
|
|
|
64
66
|
export function logAuditMetrics() {}
|
|
65
67
|
|
|
66
|
-
|
|
68
|
+
/**
|
|
69
|
+
* Audit ledger states and verify integrity of ledger/state files.
|
|
70
|
+
*/
|
|
71
|
+
export function auditLedgers(opts = {}) {
|
|
67
72
|
const root = opts.root || process.env.JULES_PROJECT_ROOT || process.cwd();
|
|
68
|
-
const
|
|
73
|
+
const stateDir = join(root, ".agent", "state");
|
|
74
|
+
const exists = existsSync(stateDir);
|
|
75
|
+
return { ok: true, stateDir, exists };
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Audit git worktrees and active workspace boundaries.
|
|
80
|
+
*/
|
|
81
|
+
export function auditWorktrees(opts = {}) {
|
|
82
|
+
const root = opts.root || process.env.JULES_PROJECT_ROOT || process.cwd();
|
|
83
|
+
const worktreeDir = join(root, ".agent", "worktrees");
|
|
84
|
+
const exists = existsSync(worktreeDir);
|
|
85
|
+
return { ok: true, worktreeDir, exists };
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Audit gate rules (scope, payload governor, secret scanning, verification suite).
|
|
90
|
+
*/
|
|
91
|
+
export async function auditGates(opts = {}) {
|
|
92
|
+
const root = opts.root || process.env.JULES_PROJECT_ROOT || process.cwd();
|
|
93
|
+
const config = opts.config || loadConfig(root);
|
|
69
94
|
const base = opts.base || process.env.BASE_BRANCH || config.baseBranch || "main";
|
|
70
95
|
|
|
71
|
-
|
|
96
|
+
return await gate({
|
|
72
97
|
root,
|
|
73
98
|
config,
|
|
74
99
|
base,
|
|
75
100
|
fix: process.env.ALLOW_AUTO_REPAIR === "true",
|
|
76
101
|
allowProtected: process.env.JULES_ALLOW_COMMAND_FILE_CHANGES === "true",
|
|
77
102
|
});
|
|
78
|
-
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Main self-audit entrypoint executing validation passes.
|
|
107
|
+
*/
|
|
108
|
+
export async function runSelfAudit(opts = {}) {
|
|
109
|
+
const root = opts.root || process.env.JULES_PROJECT_ROOT || process.cwd();
|
|
110
|
+
const config = loadConfig(root);
|
|
111
|
+
const base = opts.base || process.env.BASE_BRANCH || config.baseBranch || "main";
|
|
112
|
+
|
|
113
|
+
const optsWithContext = { ...opts, root, config, base };
|
|
114
|
+
|
|
115
|
+
const ledgersResult = auditLedgers(optsWithContext);
|
|
116
|
+
const worktreesResult = auditWorktrees(optsWithContext);
|
|
117
|
+
const gatesResult = await auditGates(optsWithContext);
|
|
118
|
+
|
|
119
|
+
if (!gatesResult.ok) {
|
|
120
|
+
return gatesResult;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return {
|
|
124
|
+
...gatesResult,
|
|
125
|
+
audits: {
|
|
126
|
+
ledgers: ledgersResult,
|
|
127
|
+
worktrees: worktreesResult,
|
|
128
|
+
gates: gatesResult,
|
|
129
|
+
},
|
|
130
|
+
};
|
|
79
131
|
}
|
|
80
132
|
|
|
81
133
|
export async function runPreflightSandbox() {
|
package/src/engine.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { createProvider, ProviderRateLimitError, ProviderUnavailableError } from
|
|
|
5
5
|
import { withBudget, appendLedger, getQueueDir, ensureDir, rollbackBudgetReservation } from "./state.mjs";
|
|
6
6
|
import { sanitizeUntrustedData, buildAgentEnvelope } from "./prompt-guard.mjs";
|
|
7
7
|
import { recordVerifyRun, readVerifyRuns, flakyVerdict } from "./flaky-ledger.mjs";
|
|
8
|
-
import { readdirSync, readFileSync, renameSync, existsSync } from "node:fs";
|
|
8
|
+
import fs, { readdirSync, readFileSync, renameSync, existsSync } from "node:fs";
|
|
9
9
|
import { join } from "node:path";
|
|
10
10
|
import { createHash } from "node:crypto";
|
|
11
11
|
import { appendTelemetry } from "./telemetry.mjs";
|
|
@@ -563,7 +563,7 @@ export async function run(tasksOrOpts = {}, opts = {}) {
|
|
|
563
563
|
try {
|
|
564
564
|
let prompt = typeof fileOrItem === "object" && fileOrItem.prompt ? fileOrItem.prompt : "";
|
|
565
565
|
if (!prompt && existsSync(srcPath)) {
|
|
566
|
-
prompt =
|
|
566
|
+
prompt = await fs.promises.readFile(srcPath, "utf-8");
|
|
567
567
|
}
|
|
568
568
|
const task = { title: fileName, prompt };
|
|
569
569
|
const session = await dispatch(task, { root, config, dryRun: isDry });
|
package/src/mcp.mjs
CHANGED