@scheduler-systems/gal-run 0.1.63 → 0.1.64
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.cjs +101 -14
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3894,7 +3894,7 @@ var cliVersion, defaultApiUrl, BUILD_CONSTANTS, constants_default;
|
|
|
3894
3894
|
var init_constants = __esm({
|
|
3895
3895
|
"module_6"() {
|
|
3896
3896
|
"use strict";
|
|
3897
|
-
cliVersion = true ? "0.1.
|
|
3897
|
+
cliVersion = true ? "0.1.64" : "0.0.0-dev";
|
|
3898
3898
|
defaultApiUrl = true ? "https://api.gal.run" : "http://localhost:3000";
|
|
3899
3899
|
BUILD_CONSTANTS = Object.freeze([cliVersion, defaultApiUrl]);
|
|
3900
3900
|
constants_default = BUILD_CONSTANTS;
|
|
@@ -12032,7 +12032,7 @@ function detectEnvironment() {
|
|
|
12032
12032
|
return "dev";
|
|
12033
12033
|
}
|
|
12034
12034
|
try {
|
|
12035
|
-
const version2 = true ? "0.1.
|
|
12035
|
+
const version2 = true ? "0.1.64" : void 0;
|
|
12036
12036
|
if (version2 && version2.includes("-local")) {
|
|
12037
12037
|
return "dev";
|
|
12038
12038
|
}
|
|
@@ -12157,6 +12157,18 @@ var init_config_manager = __esm({
|
|
|
12157
12157
|
function productIssueGateHookCommand() {
|
|
12158
12158
|
return `${PRODUCT_ISSUE_GATE_HOOK_ENV} gal enforce product-issue hook --json # ${PRODUCT_ISSUE_GATE_HOOK_MARKER}`;
|
|
12159
12159
|
}
|
|
12160
|
+
function renderProductIssueGateHookJson(decision) {
|
|
12161
|
+
if (decision.decision !== "block") {
|
|
12162
|
+
return JSON.stringify({
|
|
12163
|
+
decision: "allow",
|
|
12164
|
+
...decision.statusMessage ? { statusMessage: decision.statusMessage } : {}
|
|
12165
|
+
});
|
|
12166
|
+
}
|
|
12167
|
+
return JSON.stringify({
|
|
12168
|
+
decision: "block",
|
|
12169
|
+
reason: decision.reason || "Blocked by GAL product issue gate"
|
|
12170
|
+
});
|
|
12171
|
+
}
|
|
12160
12172
|
function isManagedProductIssueGateHookCommand(command) {
|
|
12161
12173
|
return typeof command === "string" && command.includes(PRODUCT_ISSUE_GATE_HOOK_MARKER);
|
|
12162
12174
|
}
|
|
@@ -15201,7 +15213,7 @@ function getId() {
|
|
|
15201
15213
|
}
|
|
15202
15214
|
function getCliVersion() {
|
|
15203
15215
|
try {
|
|
15204
|
-
return true ? "0.1.
|
|
15216
|
+
return true ? "0.1.64" : "0.0.0-dev";
|
|
15205
15217
|
} catch {
|
|
15206
15218
|
return "0.0.0-dev";
|
|
15207
15219
|
}
|
|
@@ -25269,6 +25281,46 @@ async function printClaudeTokenExpiryWarning(apiUrl, authToken, jsonOutput) {
|
|
|
25269
25281
|
console.log(source_default.yellow(`
|
|
25270
25282
|
! ${expiryStatus.warningMessage}`));
|
|
25271
25283
|
}
|
|
25284
|
+
async function evaluateProductIssueGateForSession(apiUrl, authToken, orgName, input) {
|
|
25285
|
+
try {
|
|
25286
|
+
const response = await fetch(
|
|
25287
|
+
`${apiUrl}/organizations/${encodeURIComponent(orgName)}/product-issue-gate/evaluate`,
|
|
25288
|
+
{
|
|
25289
|
+
method: "POST",
|
|
25290
|
+
headers: {
|
|
25291
|
+
"Content-Type": "application/json",
|
|
25292
|
+
Authorization: `Bearer ${authToken}`
|
|
25293
|
+
},
|
|
25294
|
+
body: JSON.stringify({
|
|
25295
|
+
type: "session",
|
|
25296
|
+
command: input.command,
|
|
25297
|
+
source: {
|
|
25298
|
+
type: "github_issue",
|
|
25299
|
+
repository: input.projectContext?.trim() || void 0
|
|
25300
|
+
},
|
|
25301
|
+
context: JSON.stringify({
|
|
25302
|
+
issueTitle: input.title,
|
|
25303
|
+
issueBody: input.command,
|
|
25304
|
+
repository: input.projectContext?.trim() || void 0,
|
|
25305
|
+
branch: input.branch?.trim() || void 0,
|
|
25306
|
+
sessionSource: input.source
|
|
25307
|
+
})
|
|
25308
|
+
})
|
|
25309
|
+
}
|
|
25310
|
+
);
|
|
25311
|
+
if (!response.ok) {
|
|
25312
|
+
throw new Error(`product issue gate returned HTTP ${response.status}`);
|
|
25313
|
+
}
|
|
25314
|
+
return await response.json();
|
|
25315
|
+
} catch {
|
|
25316
|
+
return {
|
|
25317
|
+
applies: false,
|
|
25318
|
+
allowed: true,
|
|
25319
|
+
mode: "off",
|
|
25320
|
+
reason: "product_issue_gate_unavailable"
|
|
25321
|
+
};
|
|
25322
|
+
}
|
|
25323
|
+
}
|
|
25272
25324
|
function createAgentSessionCommand() {
|
|
25273
25325
|
const cmd = new Command("session").description("Manage agent execution sessions");
|
|
25274
25326
|
const getRepo = () => {
|
|
@@ -25366,6 +25418,24 @@ function createAgentSessionCommand() {
|
|
|
25366
25418
|
dispatchBackend,
|
|
25367
25419
|
model: options.model?.trim() || void 0
|
|
25368
25420
|
};
|
|
25421
|
+
const productIssueGate = await evaluateProductIssueGateForSession(
|
|
25422
|
+
apiUrl,
|
|
25423
|
+
authToken,
|
|
25424
|
+
defaultOrg || "unknown",
|
|
25425
|
+
{
|
|
25426
|
+
title: request.name || name,
|
|
25427
|
+
command: request.initialPrompt || request.name || name,
|
|
25428
|
+
projectContext: request.projectContext,
|
|
25429
|
+
branch: request.branch,
|
|
25430
|
+
source: "create"
|
|
25431
|
+
}
|
|
25432
|
+
);
|
|
25433
|
+
if (productIssueGate.applies && productIssueGate.allowed === false) {
|
|
25434
|
+
console.error(
|
|
25435
|
+
source_default.red(productIssueGate.reason || "Product issue gate blocked session creation")
|
|
25436
|
+
);
|
|
25437
|
+
process.exit(1);
|
|
25438
|
+
}
|
|
25369
25439
|
if (request.agent === "claude") {
|
|
25370
25440
|
await printClaudeTokenExpiryWarning(apiUrl, authToken, options.json === true);
|
|
25371
25441
|
}
|
|
@@ -25498,7 +25568,7 @@ Next cursor: ${result.nextCursor}`));
|
|
|
25498
25568
|
}
|
|
25499
25569
|
});
|
|
25500
25570
|
cmd.command("resume").description("Resume a TERMINATED session with a new prompt").argument("<session-id>", "Session ID (full UUID or prefix)").option("--prompt <text>", "Prompt to continue with").option("--prompt-file <path>", "Read resume prompt from a file").option("--dispatch <backend>", "Dispatch backend (auto, gha, hive)").option("--json", "Output as JSON", false).action(async (sessionId, options) => {
|
|
25501
|
-
const { repo, apiUrl, authToken } = getRepo();
|
|
25571
|
+
const { repo, apiUrl, authToken, defaultOrg } = getRepo();
|
|
25502
25572
|
const spinner = ora("Resuming session...").start();
|
|
25503
25573
|
try {
|
|
25504
25574
|
const dispatchBackend = (() => {
|
|
@@ -25527,6 +25597,24 @@ Next cursor: ${result.nextCursor}`));
|
|
|
25527
25597
|
const recent = await repo.list({ limit: 100 });
|
|
25528
25598
|
const resolved = await resolveSessionId(sessionId, recent.sessions || []);
|
|
25529
25599
|
const targetSession = (recent.sessions || []).find((session) => session.id === resolved);
|
|
25600
|
+
const productIssueGate = await evaluateProductIssueGateForSession(
|
|
25601
|
+
apiUrl,
|
|
25602
|
+
authToken,
|
|
25603
|
+
defaultOrg || "unknown",
|
|
25604
|
+
{
|
|
25605
|
+
title: targetSession?.name || resolved,
|
|
25606
|
+
command: prompt3.trim(),
|
|
25607
|
+
projectContext: targetSession?.projectContext,
|
|
25608
|
+
branch: targetSession?.branch,
|
|
25609
|
+
source: "resume"
|
|
25610
|
+
}
|
|
25611
|
+
);
|
|
25612
|
+
if (productIssueGate.applies && productIssueGate.allowed === false) {
|
|
25613
|
+
console.error(
|
|
25614
|
+
source_default.red(productIssueGate.reason || "Product issue gate blocked session resume")
|
|
25615
|
+
);
|
|
25616
|
+
process.exit(1);
|
|
25617
|
+
}
|
|
25530
25618
|
if (targetSession?.agent === "claude") {
|
|
25531
25619
|
await printClaudeTokenExpiryWarning(apiUrl, authToken, options.json === true);
|
|
25532
25620
|
}
|
|
@@ -45047,7 +45135,7 @@ var init_computer_use_binary = __esm({
|
|
|
45047
45135
|
});
|
|
45048
45136
|
|
|
45049
45137
|
function resolveCliVersion() {
|
|
45050
|
-
return true ? "0.1.
|
|
45138
|
+
return true ? "0.1.64" : "0.0.0-dev";
|
|
45051
45139
|
}
|
|
45052
45140
|
function resolveGalCodeRunnerAsset(version2) {
|
|
45053
45141
|
const platformMap = {
|
|
@@ -45175,7 +45263,7 @@ var init_gal_code_runner_install = __esm({
|
|
|
45175
45263
|
});
|
|
45176
45264
|
|
|
45177
45265
|
function resolveCliVersion2() {
|
|
45178
|
-
return true ? "0.1.
|
|
45266
|
+
return true ? "0.1.64" : "0.0.0-dev";
|
|
45179
45267
|
}
|
|
45180
45268
|
function resolveComputerUseHelperAsset(version2 = resolveCliVersion2(), platform5 = process.platform, arch3 = process.arch) {
|
|
45181
45269
|
if (platform5 !== "darwin") {
|
|
@@ -46028,7 +46116,7 @@ async function uploadSessionArchive(config, cwd, commandArgs, startedAt, exitCod
|
|
|
46028
46116
|
return;
|
|
46029
46117
|
}
|
|
46030
46118
|
const endedAt = /* @__PURE__ */ new Date();
|
|
46031
|
-
const wrapperVersion = true ? "0.1.
|
|
46119
|
+
const wrapperVersion = true ? "0.1.64" : "0.0.0-dev";
|
|
46032
46120
|
const model = childEnv.GAL_CODE_MODEL ?? DEFAULT_GAL_CODE_MODEL;
|
|
46033
46121
|
await uploadGalCodeSessionArchive(
|
|
46034
46122
|
{
|
|
@@ -50743,11 +50831,10 @@ Installing hooks for: ${platforms.join(", ")}`));
|
|
|
50743
50831
|
approved: options.approved
|
|
50744
50832
|
});
|
|
50745
50833
|
if (options.json) {
|
|
50746
|
-
const hookResponse = decision
|
|
50747
|
-
|
|
50748
|
-
|
|
50749
|
-
}
|
|
50750
|
-
console.log(JSON.stringify(hookResponse));
|
|
50834
|
+
const hookResponse = renderProductIssueGateHookJson(decision);
|
|
50835
|
+
if (hookResponse) {
|
|
50836
|
+
console.log(hookResponse);
|
|
50837
|
+
}
|
|
50751
50838
|
return;
|
|
50752
50839
|
}
|
|
50753
50840
|
if (decision.decision === "block") {
|
|
@@ -114399,7 +114486,7 @@ function rewriteGalDevArgv(argv) {
|
|
|
114399
114486
|
}
|
|
114400
114487
|
return [...argv.slice(0, 2), "dev", ...argv.slice(2)];
|
|
114401
114488
|
}
|
|
114402
|
-
if (requested === "dev") {
|
|
114489
|
+
if (requested === "dev" || isKnownCommand(requested)) {
|
|
114403
114490
|
return argv;
|
|
114404
114491
|
}
|
|
114405
114492
|
return [...argv.slice(0, 2), "dev", ...argv.slice(2)];
|
|
@@ -114644,7 +114731,7 @@ var init_index = __esm({
|
|
|
114644
114731
|
}
|
|
114645
114732
|
});
|
|
114646
114733
|
|
|
114647
|
-
var cliVersion10 = true ? "0.1.
|
|
114734
|
+
var cliVersion10 = true ? "0.1.64" : "0.0.0-dev";
|
|
114648
114735
|
var args = process.argv.slice(2);
|
|
114649
114736
|
var requestedGlobalHelp = args.length === 1 && (args[0] === "--help" || args[0] === "-h");
|
|
114650
114737
|
var requestedVersion = args.length === 1 && (args[0] === "--version" || args[0] === "-V");
|
package/package.json
CHANGED