@prover-coder-ai/docker-git 1.0.46 → 1.0.47
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.
|
@@ -1426,7 +1426,15 @@ var findDockerGitConfigPaths = (fs, path, rootDir) => Effect.gen(function* (_) {
|
|
|
1426
1426
|
//#endregion
|
|
1427
1427
|
//#region ../lib/src/usecases/projects-core.ts
|
|
1428
1428
|
var sshOptions = "-tt -Y -o LogLevel=ERROR -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null";
|
|
1429
|
-
var buildSshCommand = (config, sshKey) =>
|
|
1429
|
+
var buildSshCommand = (config, sshKey, ipAddress) => {
|
|
1430
|
+
const host = ipAddress ?? "localhost";
|
|
1431
|
+
const port = ipAddress ? 22 : config.sshPort;
|
|
1432
|
+
return sshKey === null ? `ssh ${sshOptions} -p ${port} ${config.sshUser}@${host}` : `ssh -i ${sshKey} ${sshOptions} -p ${port} ${config.sshUser}@${host}`;
|
|
1433
|
+
};
|
|
1434
|
+
var getContainerIpIfInsideContainer = (fs, projectDir, containerName) => Effect.gen(function* (_) {
|
|
1435
|
+
if (!(yield* _(fs.exists("/.dockerenv")))) return;
|
|
1436
|
+
return yield* _(runDockerInspectContainerIp(projectDir, containerName).pipe(Effect.orElse(() => Effect.succeed("")), Effect.map((ip) => ip.length > 0 ? ip : void 0)));
|
|
1437
|
+
});
|
|
1430
1438
|
var loadProjectBase = (configPath) => Effect.gen(function* (_) {
|
|
1431
1439
|
const { fs, path, resolved } = yield* _(resolveBaseDir(configPath));
|
|
1432
1440
|
const projectDir = path.dirname(resolved);
|
|
@@ -1440,12 +1448,14 @@ var loadProjectBase = (configPath) => Effect.gen(function* (_) {
|
|
|
1440
1448
|
var findProjectConfigPaths = (projectsRoot) => withFsPathContext(({ fs, path }) => findDockerGitConfigPaths(fs, path, path.resolve(projectsRoot)));
|
|
1441
1449
|
var loadProjectSummary = (configPath, sshKey) => Effect.gen(function* (_) {
|
|
1442
1450
|
const { config, fs, path, projectDir } = yield* _(loadProjectBase(configPath));
|
|
1451
|
+
const ipAddress = yield* _(getContainerIpIfInsideContainer(fs, projectDir, config.template.containerName));
|
|
1443
1452
|
const resolvedAuthorizedKeys = resolveAuthorizedKeysPath(path, projectDir, config.template.authorizedKeysPath);
|
|
1444
1453
|
const authExists = yield* _(fs.exists(resolvedAuthorizedKeys));
|
|
1445
1454
|
return {
|
|
1446
1455
|
projectDir,
|
|
1447
1456
|
config,
|
|
1448
|
-
sshCommand: buildSshCommand(config.template, sshKey),
|
|
1457
|
+
sshCommand: buildSshCommand(config.template, sshKey, ipAddress),
|
|
1458
|
+
ipAddress,
|
|
1449
1459
|
authorizedKeysPath: resolvedAuthorizedKeys,
|
|
1450
1460
|
authorizedKeysExists: authExists
|
|
1451
1461
|
};
|
|
@@ -1466,9 +1476,10 @@ var formatDisplayName = (repoUrl) => {
|
|
|
1466
1476
|
var loadProjectItem = (configPath, sshKey) => Effect.gen(function* (_) {
|
|
1467
1477
|
const { config, fs, path, projectDir } = yield* _(loadProjectBase(configPath));
|
|
1468
1478
|
const template = config.template;
|
|
1479
|
+
const ipAddress = yield* _(getContainerIpIfInsideContainer(fs, projectDir, template.containerName));
|
|
1469
1480
|
const resolvedAuthorizedKeys = resolveAuthorizedKeysPath(path, projectDir, template.authorizedKeysPath);
|
|
1470
1481
|
const authExists = yield* _(fs.exists(resolvedAuthorizedKeys));
|
|
1471
|
-
const sshCommand = buildSshCommand(template, sshKey);
|
|
1482
|
+
const sshCommand = buildSshCommand(template, sshKey, ipAddress);
|
|
1472
1483
|
return {
|
|
1473
1484
|
projectDir,
|
|
1474
1485
|
displayName: formatDisplayName(template.repoUrl),
|
|
@@ -1480,6 +1491,7 @@ var loadProjectItem = (configPath, sshKey) => Effect.gen(function* (_) {
|
|
|
1480
1491
|
sshPort: template.sshPort,
|
|
1481
1492
|
targetDir: template.targetDir,
|
|
1482
1493
|
sshCommand,
|
|
1494
|
+
ipAddress,
|
|
1483
1495
|
sshKeyPath: sshKey,
|
|
1484
1496
|
authorizedKeysPath: resolvedAuthorizedKeys,
|
|
1485
1497
|
authorizedKeysExists: authExists,
|
|
@@ -3064,6 +3076,62 @@ docker_git_refresh_gemini_env() {
|
|
|
3064
3076
|
|
|
3065
3077
|
docker_git_refresh_gemini_env`;
|
|
3066
3078
|
var renderGeminiAuthConfig = (config) => geminiAuthConfigTemplate.replaceAll("__GEMINI_AUTH_ROOT__", geminiAuthRootContainerPath(config.sshUser)).replaceAll("__GEMINI_HOME_DIR__", config.geminiHome);
|
|
3079
|
+
var geminiSettingsJsonTemplate = `{
|
|
3080
|
+
"model": {
|
|
3081
|
+
"name": "gemini-3.1-pro-preview-yolo",
|
|
3082
|
+
"compressionThreshold": 0.9,
|
|
3083
|
+
"disableLoopDetection": true
|
|
3084
|
+
},
|
|
3085
|
+
"modelConfigs": {
|
|
3086
|
+
"customAliases": {
|
|
3087
|
+
"yolo-ultra": {
|
|
3088
|
+
"modelConfig": {
|
|
3089
|
+
"model": "gemini-3.1-pro-preview-yolo",
|
|
3090
|
+
"generateContentConfig": {
|
|
3091
|
+
"tools": [
|
|
3092
|
+
{
|
|
3093
|
+
"googleSearch": {}
|
|
3094
|
+
},
|
|
3095
|
+
{
|
|
3096
|
+
"urlContext": {}
|
|
3097
|
+
}
|
|
3098
|
+
]
|
|
3099
|
+
}
|
|
3100
|
+
}
|
|
3101
|
+
}
|
|
3102
|
+
}
|
|
3103
|
+
},
|
|
3104
|
+
"general": {
|
|
3105
|
+
"defaultApprovalMode": "auto_edit"
|
|
3106
|
+
},
|
|
3107
|
+
"tools": {
|
|
3108
|
+
"allowed": [
|
|
3109
|
+
"run_shell_command",
|
|
3110
|
+
"write_file",
|
|
3111
|
+
"googleSearch",
|
|
3112
|
+
"urlContext"
|
|
3113
|
+
]
|
|
3114
|
+
},
|
|
3115
|
+
"sandbox": {
|
|
3116
|
+
"enabled": false
|
|
3117
|
+
},
|
|
3118
|
+
"security": {
|
|
3119
|
+
"folderTrust": {
|
|
3120
|
+
"enabled": false
|
|
3121
|
+
},
|
|
3122
|
+
"auth": {
|
|
3123
|
+
"selectedType": "oauth-personal"
|
|
3124
|
+
},
|
|
3125
|
+
"disableYoloMode": false
|
|
3126
|
+
},
|
|
3127
|
+
"mcpServers": {
|
|
3128
|
+
"playwright": {
|
|
3129
|
+
"command": "docker-git-playwright-mcp",
|
|
3130
|
+
"args": [],
|
|
3131
|
+
"trust": true
|
|
3132
|
+
}
|
|
3133
|
+
}
|
|
3134
|
+
}`;
|
|
3067
3135
|
var renderGeminiPermissionSettingsConfig = (config) => String.raw`# Gemini CLI: keep trust settings in sync with docker-git defaults
|
|
3068
3136
|
GEMINI_SETTINGS_DIR="${config.geminiHome}"
|
|
3069
3137
|
GEMINI_TRUST_SETTINGS_FILE="$GEMINI_SETTINGS_DIR/trustedFolders.json"
|
|
@@ -3075,14 +3143,7 @@ mkdir -p "$GEMINI_SETTINGS_DIR" || true
|
|
|
3075
3143
|
# Disable folder trust prompt and enable auto-approval in settings.json
|
|
3076
3144
|
if [[ ! -f "$GEMINI_CONFIG_SETTINGS_FILE" ]]; then
|
|
3077
3145
|
cat <<'EOF' > "$GEMINI_CONFIG_SETTINGS_FILE"
|
|
3078
|
-
{
|
|
3079
|
-
"security": {
|
|
3080
|
-
"folderTrust": {
|
|
3081
|
-
"enabled": false
|
|
3082
|
-
},
|
|
3083
|
-
"approvalPolicy": "never"
|
|
3084
|
-
}
|
|
3085
|
-
}
|
|
3146
|
+
${geminiSettingsJsonTemplate}
|
|
3086
3147
|
EOF
|
|
3087
3148
|
fi
|
|
3088
3149
|
|
|
@@ -5521,18 +5582,24 @@ var runDockerComposeUpWithPortCheck = (projectDir) => Effect.gen(function* (_) {
|
|
|
5521
5582
|
//#endregion
|
|
5522
5583
|
//#region ../lib/src/usecases/projects-ssh.ts
|
|
5523
5584
|
var buildSshArgs$1 = (item) => {
|
|
5585
|
+
const host = item.ipAddress ?? "localhost";
|
|
5586
|
+
const port = item.ipAddress ? 22 : item.sshPort;
|
|
5524
5587
|
const args = [];
|
|
5525
5588
|
if (item.sshKeyPath !== null) args.push("-i", item.sshKeyPath);
|
|
5526
|
-
args.push("-tt", "-Y", "-o", "LogLevel=ERROR", "-o", "StrictHostKeyChecking=no", "-o", "UserKnownHostsFile=/dev/null", "-p", String(
|
|
5589
|
+
args.push("-tt", "-Y", "-o", "LogLevel=ERROR", "-o", "StrictHostKeyChecking=no", "-o", "UserKnownHostsFile=/dev/null", "-p", String(port), `${item.sshUser}@${host}`);
|
|
5527
5590
|
return args;
|
|
5528
5591
|
};
|
|
5529
5592
|
var buildSshProbeArgs = (item) => {
|
|
5593
|
+
const host = item.ipAddress ?? "localhost";
|
|
5594
|
+
const port = item.ipAddress ? 22 : item.sshPort;
|
|
5530
5595
|
const args = [];
|
|
5531
5596
|
if (item.sshKeyPath !== null) args.push("-i", item.sshKeyPath);
|
|
5532
|
-
args.push("-T", "-o", "BatchMode=yes", "-o", "ConnectTimeout=2", "-o", "ConnectionAttempts=1", "-o", "LogLevel=ERROR", "-o", "StrictHostKeyChecking=no", "-o", "UserKnownHostsFile=/dev/null", "-p", String(
|
|
5597
|
+
args.push("-T", "-o", "BatchMode=yes", "-o", "ConnectTimeout=2", "-o", "ConnectionAttempts=1", "-o", "LogLevel=ERROR", "-o", "StrictHostKeyChecking=no", "-o", "UserKnownHostsFile=/dev/null", "-p", String(port), `${item.sshUser}@${host}`, "true");
|
|
5533
5598
|
return args;
|
|
5534
5599
|
};
|
|
5535
5600
|
var waitForSshReady = (item) => {
|
|
5601
|
+
const host = item.ipAddress ?? "localhost";
|
|
5602
|
+
const port = item.ipAddress ? 22 : item.sshPort;
|
|
5536
5603
|
const probe = Effect.gen(function* (_) {
|
|
5537
5604
|
const exitCode = yield* _(runCommandExitCode({
|
|
5538
5605
|
cwd: process.cwd(),
|
|
@@ -5544,7 +5611,7 @@ var waitForSshReady = (item) => {
|
|
|
5544
5611
|
exitCode
|
|
5545
5612
|
})));
|
|
5546
5613
|
});
|
|
5547
|
-
return pipe(Effect.log(`Waiting for SSH on
|
|
5614
|
+
return pipe(Effect.log(`Waiting for SSH on ${host}:${port} ...`), Effect.zipRight(Effect.retry(probe, pipe(Schedule.spaced(Duration.seconds(2)), Schedule.intersect(Schedule.recurs(30))))), Effect.tap(() => Effect.log("SSH is ready.")));
|
|
5548
5615
|
};
|
|
5549
5616
|
var connectProjectSsh = (item) => pipe(ensureTerminalCursorVisible(), Effect.zipRight(runCommandWithExitCodes({
|
|
5550
5617
|
cwd: process.cwd(),
|
|
@@ -5554,14 +5621,34 @@ var connectProjectSsh = (item) => pipe(ensureTerminalCursorVisible(), Effect.zip
|
|
|
5554
5621
|
command: "ssh",
|
|
5555
5622
|
exitCode
|
|
5556
5623
|
}))), Effect.ensuring(ensureTerminalCursorVisible()));
|
|
5557
|
-
var connectProjectSshWithUp = (item) =>
|
|
5558
|
-
|
|
5559
|
-
|
|
5560
|
-
|
|
5561
|
-
|
|
5624
|
+
var connectProjectSshWithUp = (item) => Effect.gen(function* (_) {
|
|
5625
|
+
const fs = yield* _(FileSystem.FileSystem);
|
|
5626
|
+
yield* _(Effect.log(`Starting docker compose for ${item.displayName} ...`));
|
|
5627
|
+
const template = yield* _(runDockerComposeUpWithPortCheck(item.projectDir));
|
|
5628
|
+
const isInsideContainer = yield* _(fs.exists("/.dockerenv"));
|
|
5629
|
+
let ipAddress;
|
|
5630
|
+
if (isInsideContainer) {
|
|
5631
|
+
const containerIp = yield* _(runDockerInspectContainerIp(item.projectDir, template.containerName).pipe(Effect.orElse(() => Effect.succeed(""))));
|
|
5632
|
+
if (containerIp.length > 0) ipAddress = containerIp;
|
|
5633
|
+
}
|
|
5634
|
+
const updated = {
|
|
5635
|
+
...item,
|
|
5636
|
+
sshPort: template.sshPort,
|
|
5637
|
+
ipAddress
|
|
5638
|
+
};
|
|
5639
|
+
yield* _(waitForSshReady(updated));
|
|
5640
|
+
yield* _(connectProjectSsh(updated));
|
|
5641
|
+
});
|
|
5642
|
+
var listProjectStatus = withProjectIndexAndSsh((index, sshKey) => forEachProjectStatus(index.configPaths, (status) => Effect.gen(function* (_) {
|
|
5643
|
+
const ipAddress = yield* _(getContainerIpIfInsideContainer(yield* _(FileSystem.FileSystem), status.projectDir, status.config.template.containerName));
|
|
5644
|
+
yield* _(Effect.log(renderProjectStatusHeader(status)));
|
|
5645
|
+
yield* _(Effect.log(`SSH access: ${buildSshCommand(status.config.template, sshKey, ipAddress)}`));
|
|
5646
|
+
const text = formatComposeRows(parseComposePsOutput(yield* _(runDockerComposePsFormatted(status.projectDir))));
|
|
5647
|
+
yield* _(Effect.log(text));
|
|
5648
|
+
}).pipe(Effect.matchEffect({
|
|
5562
5649
|
onFailure: (error) => Effect.logWarning(`docker compose ps failed for ${status.projectDir}: ${renderError(error)}`),
|
|
5563
5650
|
onSuccess: () => Effect.void
|
|
5564
|
-
})))))
|
|
5651
|
+
})))).pipe(Effect.asVoid);
|
|
5565
5652
|
//#endregion
|
|
5566
5653
|
//#region ../lib/src/usecases/actions/docker-up.ts
|
|
5567
5654
|
var clonePollInterval = Duration.seconds(1);
|
|
@@ -5573,9 +5660,15 @@ var agentFailPath = "/run/docker-git/agent.failed";
|
|
|
5573
5660
|
var logSshAccess = (baseDir, config) => Effect.gen(function* (_) {
|
|
5574
5661
|
const fs = yield* _(FileSystem.FileSystem);
|
|
5575
5662
|
const path = yield* _(Path.Path);
|
|
5663
|
+
const isInsideContainer = yield* _(fs.exists("/.dockerenv"));
|
|
5664
|
+
let ipAddress;
|
|
5665
|
+
if (isInsideContainer) {
|
|
5666
|
+
const containerIp = yield* _(runDockerInspectContainerIp(baseDir, config.containerName).pipe(Effect.orElse(() => Effect.succeed(""))));
|
|
5667
|
+
if (containerIp.length > 0) ipAddress = containerIp;
|
|
5668
|
+
}
|
|
5576
5669
|
const resolvedAuthorizedKeys = resolveAuthorizedKeysPath(path, baseDir, config.authorizedKeysPath);
|
|
5577
5670
|
const authExists = yield* _(fs.exists(resolvedAuthorizedKeys));
|
|
5578
|
-
const sshCommand = buildSshCommand(config, yield* _(findSshPrivateKey(fs, path, process.cwd())));
|
|
5671
|
+
const sshCommand = buildSshCommand(config, yield* _(findSshPrivateKey(fs, path, process.cwd())), ipAddress);
|
|
5579
5672
|
yield* _(Effect.log(`SSH access: ${sshCommand}`));
|
|
5580
5673
|
if (!authExists) yield* _(Effect.logWarning(`Authorized keys file missing: ${resolvedAuthorizedKeys} (SSH may fail without a matching key).`));
|
|
5581
5674
|
});
|
|
@@ -5818,23 +5911,28 @@ var formatStateSyncLabel = (repoUrl) => {
|
|
|
5818
5911
|
return repoPath.length > 0 ? repoPath : repoUrl;
|
|
5819
5912
|
};
|
|
5820
5913
|
var isInteractiveTty = () => process.stdin.isTTY && process.stdout.isTTY;
|
|
5821
|
-
var buildSshArgs = (config, sshKeyPath, remoteCommand) => {
|
|
5914
|
+
var buildSshArgs = (config, sshKeyPath, remoteCommand, ipAddress) => {
|
|
5915
|
+
const host = ipAddress ?? "localhost";
|
|
5916
|
+
const port = ipAddress ? 22 : config.sshPort;
|
|
5822
5917
|
const args = [];
|
|
5823
5918
|
if (sshKeyPath !== null) args.push("-i", sshKeyPath);
|
|
5824
|
-
args.push("-tt", "-Y", "-o", "LogLevel=ERROR", "-o", "StrictHostKeyChecking=no", "-o", "UserKnownHostsFile=/dev/null", "-p", String(
|
|
5919
|
+
args.push("-tt", "-Y", "-o", "LogLevel=ERROR", "-o", "StrictHostKeyChecking=no", "-o", "UserKnownHostsFile=/dev/null", "-p", String(port), `${config.sshUser}@${host}`);
|
|
5825
5920
|
if (remoteCommand !== void 0) args.push(remoteCommand);
|
|
5826
5921
|
return args;
|
|
5827
5922
|
};
|
|
5828
5923
|
var openSshBestEffort = (template, remoteCommand) => Effect.gen(function* (_) {
|
|
5829
|
-
const
|
|
5830
|
-
const
|
|
5924
|
+
const fs = yield* _(FileSystem.FileSystem);
|
|
5925
|
+
const path = yield* _(Path.Path);
|
|
5926
|
+
const ipAddress = yield* _(getContainerIpIfInsideContainer(fs, process.cwd(), template.containerName).pipe(Effect.orElse(() => Effect.succeed(""))));
|
|
5927
|
+
const sshKey = yield* _(findSshPrivateKey(fs, path, process.cwd()));
|
|
5928
|
+
const sshCommand = buildSshCommand(template, sshKey, ipAddress);
|
|
5831
5929
|
const remoteCommandLabel = remoteCommand === void 0 ? "" : ` (${remoteCommand})`;
|
|
5832
5930
|
yield* _(Effect.log(`Opening SSH: ${sshCommand}${remoteCommandLabel}`));
|
|
5833
5931
|
yield* _(ensureTerminalCursorVisible());
|
|
5834
5932
|
yield* _(runCommandWithExitCodes({
|
|
5835
5933
|
cwd: process.cwd(),
|
|
5836
5934
|
command: "ssh",
|
|
5837
|
-
args: buildSshArgs(template, sshKey, remoteCommand)
|
|
5935
|
+
args: buildSshArgs(template, sshKey, remoteCommand, ipAddress)
|
|
5838
5936
|
}, [0, 130], (exitCode) => new CommandFailedError({
|
|
5839
5937
|
command: "ssh",
|
|
5840
5938
|
exitCode
|
|
@@ -6685,23 +6783,38 @@ var prepareGeminiCredentialsDir = (cwd, accountPath, fs) => Effect.gen(function*
|
|
|
6685
6783
|
}).pipe(Effect.orElse(() => Effect.succeed(0))));
|
|
6686
6784
|
return credentialsDir;
|
|
6687
6785
|
});
|
|
6786
|
+
var defaultGeminiSettings = {
|
|
6787
|
+
model: {
|
|
6788
|
+
name: "gemini-3.1-pro-preview-yolo",
|
|
6789
|
+
compressionThreshold: .9,
|
|
6790
|
+
disableLoopDetection: true
|
|
6791
|
+
},
|
|
6792
|
+
modelConfigs: { customAliases: { "yolo-ultra": { "modelConfig": {
|
|
6793
|
+
"model": "gemini-3.1-pro-preview-yolo",
|
|
6794
|
+
"generateContentConfig": { "tools": [{ "googleSearch": {} }, { "urlContext": {} }] }
|
|
6795
|
+
} } } },
|
|
6796
|
+
general: { defaultApprovalMode: "auto_edit" },
|
|
6797
|
+
tools: { allowed: [
|
|
6798
|
+
"run_shell_command",
|
|
6799
|
+
"write_file",
|
|
6800
|
+
"googleSearch",
|
|
6801
|
+
"urlContext"
|
|
6802
|
+
] },
|
|
6803
|
+
sandbox: { enabled: false },
|
|
6804
|
+
security: {
|
|
6805
|
+
folderTrust: { enabled: false },
|
|
6806
|
+
auth: { selectedType: "oauth-personal" },
|
|
6807
|
+
disableYoloMode: false
|
|
6808
|
+
},
|
|
6809
|
+
mcpServers: { playwright: {
|
|
6810
|
+
command: "docker-git-playwright-mcp",
|
|
6811
|
+
args: [],
|
|
6812
|
+
trust: true
|
|
6813
|
+
} }
|
|
6814
|
+
};
|
|
6688
6815
|
var writeInitialSettings = (credentialsDir, fs) => Effect.gen(function* (_) {
|
|
6689
6816
|
const settingsPath = `${credentialsDir}/settings.json`;
|
|
6690
|
-
yield* _(fs.writeFileString(settingsPath, JSON.stringify(
|
|
6691
|
-
model: {
|
|
6692
|
-
name: "gemini-2.0-flash",
|
|
6693
|
-
compressionThreshold: .9,
|
|
6694
|
-
disableLoopDetection: true
|
|
6695
|
-
},
|
|
6696
|
-
general: { defaultApprovalMode: "auto_edit" },
|
|
6697
|
-
yolo: true,
|
|
6698
|
-
sandbox: { enabled: false },
|
|
6699
|
-
security: {
|
|
6700
|
-
folderTrust: { enabled: false },
|
|
6701
|
-
auth: { selectedType: "oauth-personal" },
|
|
6702
|
-
approvalPolicy: "never"
|
|
6703
|
-
}
|
|
6704
|
-
}, null, 2)));
|
|
6817
|
+
yield* _(fs.writeFileString(settingsPath, JSON.stringify(defaultGeminiSettings, null, 2) + "\n"));
|
|
6705
6818
|
const trustedFoldersPath = `${credentialsDir}/trustedFolders.json`;
|
|
6706
6819
|
yield* _(fs.writeFileString(trustedFoldersPath, JSON.stringify({
|
|
6707
6820
|
"/": "TRUST_FOLDER",
|
|
@@ -6882,6 +6995,30 @@ var runGeminiOauthLoginWithPrompt = (cwd, accountPath, options) => Effect.scoped
|
|
|
6882
6995
|
return yield* _(resolveGeminiLoginResult(resultBox.value, exitCode));
|
|
6883
6996
|
}));
|
|
6884
6997
|
//#endregion
|
|
6998
|
+
//#region ../lib/src/usecases/auth-gemini-logout.ts
|
|
6999
|
+
var authGeminiLogout = (command) => Effect.gen(function* (_) {
|
|
7000
|
+
const accountLabel = normalizeAccountLabel(command.label, "default");
|
|
7001
|
+
yield* _(withGeminiAuth(command, ({ accountPath, fs }) => Effect.gen(function* (_) {
|
|
7002
|
+
yield* _(fs.remove(geminiApiKeyPath(accountPath), { force: true }));
|
|
7003
|
+
yield* _(fs.remove(geminiEnvFilePath(accountPath), { force: true }));
|
|
7004
|
+
yield* _(fs.remove(geminiCredentialsPath(accountPath), {
|
|
7005
|
+
recursive: true,
|
|
7006
|
+
force: true
|
|
7007
|
+
}));
|
|
7008
|
+
})));
|
|
7009
|
+
yield* _(autoSyncState(`chore(state): auth gemini logout ${accountLabel}`));
|
|
7010
|
+
}).pipe(Effect.asVoid);
|
|
7011
|
+
//#endregion
|
|
7012
|
+
//#region ../lib/src/usecases/auth-gemini-status.ts
|
|
7013
|
+
var authGeminiStatus = (command) => withGeminiAuth(command, ({ accountLabel, accountPath, fs }) => Effect.gen(function* (_) {
|
|
7014
|
+
const authMethod = yield* _(resolveGeminiAuthMethod(fs, accountPath));
|
|
7015
|
+
if (authMethod === "none") {
|
|
7016
|
+
yield* _(Effect.log(`Gemini not connected (${accountLabel}).`));
|
|
7017
|
+
return;
|
|
7018
|
+
}
|
|
7019
|
+
yield* _(Effect.log(`Gemini connected (${accountLabel}, ${authMethod}).`));
|
|
7020
|
+
}));
|
|
7021
|
+
//#endregion
|
|
6885
7022
|
//#region ../lib/src/usecases/auth-gemini.ts
|
|
6886
7023
|
var authGeminiLogin = (command, apiKey) => {
|
|
6887
7024
|
const accountLabel = normalizeAccountLabel(command.label, "default");
|
|
@@ -6889,6 +7026,10 @@ var authGeminiLogin = (command, apiKey) => {
|
|
|
6889
7026
|
const apiKeyFilePath = geminiApiKeyPath(accountPath);
|
|
6890
7027
|
yield* _(fs.writeFileString(apiKeyFilePath, `${apiKey.trim()}\n`));
|
|
6891
7028
|
yield* _(fs.chmod(apiKeyFilePath, 384), Effect.orElseSucceed(() => void 0));
|
|
7029
|
+
const credentialsDir = geminiCredentialsPath(accountPath);
|
|
7030
|
+
yield* _(fs.makeDirectory(credentialsDir, { recursive: true }));
|
|
7031
|
+
const settingsPath = `${credentialsDir}/settings.json`;
|
|
7032
|
+
yield* _(fs.writeFileString(settingsPath, JSON.stringify(defaultGeminiSettings, null, 2) + "\n"));
|
|
6892
7033
|
})).pipe(Effect.zipRight(autoSyncState(`chore(state): auth gemini ${accountLabel}`)));
|
|
6893
7034
|
};
|
|
6894
7035
|
var authGeminiLoginCli = (_command) => Effect.gen(function* (_) {
|
|
@@ -6911,33 +7052,9 @@ var authGeminiLoginOauth = (command) => {
|
|
|
6911
7052
|
image: geminiImageName,
|
|
6912
7053
|
containerPath: geminiContainerHomeDir
|
|
6913
7054
|
}));
|
|
6914
|
-
yield* _(fs.writeFileString(settingsPath, JSON.stringify(
|
|
6915
|
-
folderTrust: { enabled: false },
|
|
6916
|
-
auth: { selectedType: "oauth-personal" },
|
|
6917
|
-
approvalPolicy: "never"
|
|
6918
|
-
} }, null, 2) + "\n"));
|
|
7055
|
+
yield* _(fs.writeFileString(settingsPath, JSON.stringify(defaultGeminiSettings, null, 2) + "\n"));
|
|
6919
7056
|
}), { buildImage: true }).pipe(Effect.zipRight(autoSyncState(`chore(state): auth gemini oauth ${accountLabel}`)));
|
|
6920
7057
|
};
|
|
6921
|
-
var authGeminiStatus = (command) => withGeminiAuth(command, ({ accountLabel, accountPath, fs }) => Effect.gen(function* (_) {
|
|
6922
|
-
const authMethod = yield* _(resolveGeminiAuthMethod(fs, accountPath));
|
|
6923
|
-
if (authMethod === "none") {
|
|
6924
|
-
yield* _(Effect.log(`Gemini not connected (${accountLabel}).`));
|
|
6925
|
-
return;
|
|
6926
|
-
}
|
|
6927
|
-
yield* _(Effect.log(`Gemini connected (${accountLabel}, ${authMethod}).`));
|
|
6928
|
-
}));
|
|
6929
|
-
var authGeminiLogout = (command) => Effect.gen(function* (_) {
|
|
6930
|
-
const accountLabel = normalizeAccountLabel(command.label, "default");
|
|
6931
|
-
yield* _(withGeminiAuth(command, ({ accountPath, fs }) => Effect.gen(function* (_) {
|
|
6932
|
-
yield* _(fs.remove(geminiApiKeyPath(accountPath), { force: true }));
|
|
6933
|
-
yield* _(fs.remove(geminiEnvFilePath(accountPath), { force: true }));
|
|
6934
|
-
yield* _(fs.remove(geminiCredentialsPath(accountPath), {
|
|
6935
|
-
recursive: true,
|
|
6936
|
-
force: true
|
|
6937
|
-
}));
|
|
6938
|
-
})));
|
|
6939
|
-
yield* _(autoSyncState(`chore(state): auth gemini logout ${accountLabel}`));
|
|
6940
|
-
}).pipe(Effect.asVoid);
|
|
6941
7058
|
//#endregion
|
|
6942
7059
|
//#region ../lib/src/usecases/state-repo-github.ts
|
|
6943
7060
|
var dotDockerGitRepoName = ".docker-git";
|