iterate on jules
This commit is contained in:
@@ -13,6 +13,15 @@ inputs:
|
|||||||
openai_api_key:
|
openai_api_key:
|
||||||
description: "OpenAI API key for Codex authentication"
|
description: "OpenAI API key for Codex authentication"
|
||||||
required: false
|
required: false
|
||||||
|
google_api_key:
|
||||||
|
description: "Google API key for Jules authentication"
|
||||||
|
required: false
|
||||||
|
gemini_api_key:
|
||||||
|
description: "Google API key for Jules authentication"
|
||||||
|
required: false
|
||||||
|
cursor_api_key:
|
||||||
|
description: "Cursor API key for Cursor authentication"
|
||||||
|
required: false
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: "node20"
|
using: "node20"
|
||||||
|
|||||||
+1
-17
@@ -24,26 +24,13 @@ export const jules = agent({
|
|||||||
if (!apiKey) {
|
if (!apiKey) {
|
||||||
throw new Error("google_api_key is required for jules agent");
|
throw new Error("google_api_key is required for jules agent");
|
||||||
}
|
}
|
||||||
|
process.env.GOOGLE_API_KEY = apiKey;
|
||||||
|
|
||||||
const repoContext = parseRepoContext();
|
const repoContext = parseRepoContext();
|
||||||
const repoName = `${repoContext.owner}/${repoContext.name}`;
|
const repoName = `${repoContext.owner}/${repoContext.name}`;
|
||||||
|
|
||||||
log.info(`Creating Jules session for ${repoName}...`);
|
log.info(`Creating Jules session for ${repoName}...`);
|
||||||
|
|
||||||
// Set API key as environment variable for CLI authentication
|
|
||||||
// Note: The CLI may require browser-based auth via 'jules login' in interactive mode
|
|
||||||
// In CI, we rely on the API key being set as an environment variable
|
|
||||||
const env: Record<string, string> = {
|
|
||||||
GOOGLE_API_KEY: apiKey,
|
|
||||||
JULES_API_KEY: apiKey,
|
|
||||||
};
|
|
||||||
// Copy over existing env vars, filtering out undefined values
|
|
||||||
for (const [key, value] of Object.entries(process.env)) {
|
|
||||||
if (value !== undefined) {
|
|
||||||
env[key] = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create a new remote session
|
// Create a new remote session
|
||||||
const sessionPrompt = addInstructions(prompt);
|
const sessionPrompt = addInstructions(prompt);
|
||||||
log.info(`Starting session with prompt: ${prompt.substring(0, 100)}...`);
|
log.info(`Starting session with prompt: ${prompt.substring(0, 100)}...`);
|
||||||
@@ -53,7 +40,6 @@ export const jules = agent({
|
|||||||
const createResult = await spawn({
|
const createResult = await spawn({
|
||||||
cmd: "node",
|
cmd: "node",
|
||||||
args: [cliPath, "remote", "new", "--repo", repoName, "--session", sessionPrompt],
|
args: [cliPath, "remote", "new", "--repo", repoName, "--session", sessionPrompt],
|
||||||
env,
|
|
||||||
onStdout: (chunk) => {
|
onStdout: (chunk) => {
|
||||||
log.info(chunk.trim());
|
log.info(chunk.trim());
|
||||||
// Try to extract session ID from output
|
// Try to extract session ID from output
|
||||||
@@ -114,7 +100,6 @@ export const jules = agent({
|
|||||||
const listResult = await spawn({
|
const listResult = await spawn({
|
||||||
cmd: "node",
|
cmd: "node",
|
||||||
args: [cliPath, "remote", "list", "--session"],
|
args: [cliPath, "remote", "list", "--session"],
|
||||||
env,
|
|
||||||
onStdout: (chunk) => {
|
onStdout: (chunk) => {
|
||||||
// Log session updates
|
// Log session updates
|
||||||
const trimmed = chunk.trim();
|
const trimmed = chunk.trim();
|
||||||
@@ -155,7 +140,6 @@ export const jules = agent({
|
|||||||
const pullResult = await spawn({
|
const pullResult = await spawn({
|
||||||
cmd: "node",
|
cmd: "node",
|
||||||
args: [cliPath, "remote", "pull", "--session", sessionId],
|
args: [cliPath, "remote", "pull", "--session", sessionId],
|
||||||
env,
|
|
||||||
onStdout: (chunk) => {
|
onStdout: (chunk) => {
|
||||||
log.info(chunk.trim());
|
log.info(chunk.trim());
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ export async function run(
|
|||||||
|
|
||||||
const inputs: Required<Inputs> = {
|
const inputs: Required<Inputs> = {
|
||||||
prompt,
|
prompt,
|
||||||
agent: "codex",
|
agent: "jules",
|
||||||
...flatMorph(agents, (_, agent) => [
|
...flatMorph(agents, (_, agent) => [
|
||||||
agent.inputKey,
|
agent.inputKey,
|
||||||
process.env[agent.inputKey.toUpperCase()],
|
process.env[agent.inputKey.toUpperCase()],
|
||||||
|
|||||||
Reference in New Issue
Block a user