@jive-ai/cli 0.0.35 → 0.0.36
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/dist/index.mjs +38 -47
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2566,6 +2566,7 @@ const cliQueries = {
|
|
|
2566
2566
|
directory
|
|
2567
2567
|
repository
|
|
2568
2568
|
branch
|
|
2569
|
+
defaultBranch
|
|
2569
2570
|
gitAuth {
|
|
2570
2571
|
privateKey
|
|
2571
2572
|
repositoryUrl
|
|
@@ -2573,6 +2574,12 @@ const cliQueries = {
|
|
|
2573
2574
|
method
|
|
2574
2575
|
}
|
|
2575
2576
|
permissionMode
|
|
2577
|
+
settings {
|
|
2578
|
+
model
|
|
2579
|
+
environmentVariables
|
|
2580
|
+
betaFlags
|
|
2581
|
+
permissionMode
|
|
2582
|
+
}
|
|
2576
2583
|
}
|
|
2577
2584
|
sessionId
|
|
2578
2585
|
}
|
|
@@ -2925,7 +2932,15 @@ var ApiClient = class {
|
|
|
2925
2932
|
directory: t$2.ctx.directory,
|
|
2926
2933
|
repository: t$2.ctx.repository,
|
|
2927
2934
|
branch: t$2.ctx.branch,
|
|
2928
|
-
|
|
2935
|
+
defaultBranch: t$2.ctx.defaultBranch,
|
|
2936
|
+
gitAuth: t$2.ctx.gitAuth,
|
|
2937
|
+
permissionMode: t$2.ctx.permissionMode,
|
|
2938
|
+
settings: {
|
|
2939
|
+
model: t$2.ctx.settings.model,
|
|
2940
|
+
environmentVariables: t$2.ctx.settings.environmentVariables,
|
|
2941
|
+
betaFlags: t$2.ctx.settings.betaFlags,
|
|
2942
|
+
permissionMode: t$2.ctx.settings.permissionMode
|
|
2943
|
+
}
|
|
2929
2944
|
},
|
|
2930
2945
|
sessionId: t$2.sessionId
|
|
2931
2946
|
})) };
|
|
@@ -3421,7 +3436,7 @@ async function createGraphQLClient() {
|
|
|
3421
3436
|
|
|
3422
3437
|
//#endregion
|
|
3423
3438
|
//#region package.json
|
|
3424
|
-
var version = "0.0.
|
|
3439
|
+
var version = "0.0.36";
|
|
3425
3440
|
|
|
3426
3441
|
//#endregion
|
|
3427
3442
|
//#region src/runner/index.ts
|
|
@@ -3531,6 +3546,12 @@ var TaskRunner = class {
|
|
|
3531
3546
|
method
|
|
3532
3547
|
}
|
|
3533
3548
|
permissionMode
|
|
3549
|
+
settings {
|
|
3550
|
+
model
|
|
3551
|
+
environmentVariables
|
|
3552
|
+
betaFlags
|
|
3553
|
+
permissionMode
|
|
3554
|
+
}
|
|
3534
3555
|
}
|
|
3535
3556
|
}
|
|
3536
3557
|
`);
|
|
@@ -3558,7 +3579,13 @@ var TaskRunner = class {
|
|
|
3558
3579
|
branch: data.taskContext.branch,
|
|
3559
3580
|
defaultBranch: data.taskContext.defaultBranch,
|
|
3560
3581
|
gitAuth: auth || void 0,
|
|
3561
|
-
permissionMode: data.taskContext.permissionMode
|
|
3582
|
+
permissionMode: data.taskContext.permissionMode,
|
|
3583
|
+
settings: {
|
|
3584
|
+
model: data.taskContext.settings.model,
|
|
3585
|
+
environmentVariables: data.taskContext.settings.environmentVariables,
|
|
3586
|
+
betaFlags: data.taskContext.settings.betaFlags,
|
|
3587
|
+
permissionMode: data.taskContext.settings.permissionMode
|
|
3588
|
+
}
|
|
3562
3589
|
};
|
|
3563
3590
|
} catch (error$1) {
|
|
3564
3591
|
console.error(error$1);
|
|
@@ -3821,7 +3848,7 @@ async function queryClaude(prompt, mcpServer, opts) {
|
|
|
3821
3848
|
const credentials = await getCredentials();
|
|
3822
3849
|
if (!credentials?.anthropicApiKey) throw new Error("Anthropic API key not found in credentials JSON");
|
|
3823
3850
|
process.env.ANTHROPIC_API_KEY = credentials.anthropicApiKey;
|
|
3824
|
-
const { defaultModel, environmentVariables, betaFlags } =
|
|
3851
|
+
const { model: defaultModel, environmentVariables, betaFlags } = task.getSettings();
|
|
3825
3852
|
for (const [key, value$1] of Object.entries(environmentVariables)) process.env[key] = value$1;
|
|
3826
3853
|
debugLog(`[Task ${task.id}] Querying Claude with permission mode: ${permissionMode}`);
|
|
3827
3854
|
debugLog(`[Task ${task.id}] Using model: ${defaultModel}`);
|
|
@@ -3864,49 +3891,6 @@ async function queryClaude(prompt, mcpServer, opts) {
|
|
|
3864
3891
|
}
|
|
3865
3892
|
});
|
|
3866
3893
|
}
|
|
3867
|
-
async function getTaskClaudeSettings(opts) {
|
|
3868
|
-
const { projectId } = opts;
|
|
3869
|
-
let teamSettings;
|
|
3870
|
-
let projectSettings;
|
|
3871
|
-
try {
|
|
3872
|
-
const client = await getGraphQLClient();
|
|
3873
|
-
const projectData = await client.request(cliQueries.Project, { id: projectId });
|
|
3874
|
-
if (projectData.project) {
|
|
3875
|
-
const projectSettingsData = projectData.project?.settings;
|
|
3876
|
-
if (projectSettingsData) projectSettings = {
|
|
3877
|
-
defaultModel: projectSettingsData.defaultModel,
|
|
3878
|
-
environmentVariables: projectSettingsData.environmentVariables,
|
|
3879
|
-
betaFlags: projectSettingsData.betaFlags
|
|
3880
|
-
};
|
|
3881
|
-
if (projectData.project.team) {
|
|
3882
|
-
const teamClaude = (await client.request(cliQueries.Team, { id: projectData.project.team.id })).team?.settings?.claude;
|
|
3883
|
-
if (teamClaude) teamSettings = {
|
|
3884
|
-
defaultModel: teamClaude.defaultModel,
|
|
3885
|
-
environmentVariables: teamClaude.environmentVariables,
|
|
3886
|
-
betaFlags: teamClaude.betaFlags
|
|
3887
|
-
};
|
|
3888
|
-
}
|
|
3889
|
-
}
|
|
3890
|
-
} catch (error$1) {
|
|
3891
|
-
debugLog(`[Task] Failed to fetch settings, using defaults: ${error$1}`);
|
|
3892
|
-
}
|
|
3893
|
-
const defaultModel = projectSettings?.defaultModel || teamSettings?.defaultModel || "sonnet";
|
|
3894
|
-
const teamEnvVars = teamSettings?.environmentVariables || {};
|
|
3895
|
-
const projectEnvVars = projectSettings?.environmentVariables || {};
|
|
3896
|
-
const environmentVariables = {
|
|
3897
|
-
...teamEnvVars,
|
|
3898
|
-
...projectEnvVars
|
|
3899
|
-
};
|
|
3900
|
-
const betaFlags = [...teamSettings?.betaFlags || [], ...projectSettings?.betaFlags || []];
|
|
3901
|
-
debugLog(`[Task] Default model: ${defaultModel}`);
|
|
3902
|
-
debugLog(`[Task] Environment variables: ${Object.keys(environmentVariables).join(", ")}`);
|
|
3903
|
-
debugLog(`[Task] Beta flags: ${betaFlags.join(", ")}`);
|
|
3904
|
-
return {
|
|
3905
|
-
defaultModel,
|
|
3906
|
-
environmentVariables,
|
|
3907
|
-
betaFlags
|
|
3908
|
-
};
|
|
3909
|
-
}
|
|
3910
3894
|
function mapPermissionMode(permissionMode) {
|
|
3911
3895
|
switch (permissionMode) {
|
|
3912
3896
|
case "DEFAULT": return "default";
|
|
@@ -4317,6 +4301,13 @@ var Task = class {
|
|
|
4317
4301
|
get projectId() {
|
|
4318
4302
|
return this.ctx.projectId;
|
|
4319
4303
|
}
|
|
4304
|
+
/**
|
|
4305
|
+
* Get task settings (model, environment variables, beta flags, permission mode).
|
|
4306
|
+
* Settings are inherited from team/project at task creation time and can be overridden per-task.
|
|
4307
|
+
*/
|
|
4308
|
+
getSettings() {
|
|
4309
|
+
return this.ctx.settings;
|
|
4310
|
+
}
|
|
4320
4311
|
constructor(ctx) {
|
|
4321
4312
|
this.id = ctx.taskId;
|
|
4322
4313
|
this.ctx = ctx;
|