@atolis-hq/wake 0.4.122 → 0.4.123
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.
|
@@ -1020,6 +1020,19 @@ function createSandboxSetupDependencies(home) {
|
|
|
1020
1020
|
if ((await isReadable(sourceAuth)) && !(await isReadable(targetAuth)))
|
|
1021
1021
|
await copyFile(sourceAuth, targetAuth);
|
|
1022
1022
|
},
|
|
1023
|
+
configureGitIdentity: async () => {
|
|
1024
|
+
const { stdout } = await execFile('gh', ['api', 'user', '--jq', '[.login, .id] | @tsv']);
|
|
1025
|
+
const [login, id] = stdout.trim().split('\t');
|
|
1026
|
+
if (!login || !id || !/^\d+$/.test(id))
|
|
1027
|
+
throw new Error('Could not resolve the GitHub account for the git identity');
|
|
1028
|
+
await execFile('git', ['config', '--global', 'user.name', login]);
|
|
1029
|
+
await execFile('git', [
|
|
1030
|
+
'config',
|
|
1031
|
+
'--global',
|
|
1032
|
+
'user.email',
|
|
1033
|
+
`${id}+${login}@users.noreply.github.com`,
|
|
1034
|
+
]);
|
|
1035
|
+
},
|
|
1023
1036
|
log: (message) => process.stdout.write(`${message}\n`),
|
|
1024
1037
|
};
|
|
1025
1038
|
}
|
|
@@ -124,6 +124,6 @@ export function resolveWakeVersion(options = {}) {
|
|
|
124
124
|
return `g${headHash.slice(0, 7)}`;
|
|
125
125
|
return '0.1.0-dev';
|
|
126
126
|
}
|
|
127
|
-
export const wakeVersion = "v0.4.
|
|
127
|
+
export const wakeVersion = "v0.4.123";
|
|
128
128
|
/** The registry-installable version used by packaged sandbox images. */
|
|
129
129
|
export const wakePackageVersion = packageVersion(defaultRepoRoot) ?? wakeVersion;
|
|
@@ -3,6 +3,8 @@ export interface SandboxSetupDependencies {
|
|
|
3
3
|
readonly runInteractive: (command: string, arguments_: readonly string[]) => Promise<void>;
|
|
4
4
|
readonly ensureSshKey: () => Promise<void>;
|
|
5
5
|
readonly prepareCodexHome: () => Promise<void>;
|
|
6
|
+
/** Sets the global git author from the authenticated GitHub account. */
|
|
7
|
+
readonly configureGitIdentity: () => Promise<void>;
|
|
6
8
|
readonly log: (message: string) => void;
|
|
7
9
|
}
|
|
8
10
|
/** Configures the sandbox-owned credentials and git identity interactively. */
|
|
@@ -10,6 +10,8 @@ export async function runSandboxSetup(deps) {
|
|
|
10
10
|
deps.log('Use a dedicated GitHub identity with only the repository access Wake needs when possible.');
|
|
11
11
|
await deps.runInteractive('gh', ['auth', 'login']);
|
|
12
12
|
await deps.runInteractive('gh', ['auth', 'setup-git']);
|
|
13
|
+
// Without an identity the first agent commit fails and each agent improvises its own.
|
|
14
|
+
await deps.configureGitIdentity();
|
|
13
15
|
}
|
|
14
16
|
else {
|
|
15
17
|
deps.log('Skipping GitHub auth setup.');
|