@promptbook/cli 0.114.0-49 → 0.114.0-50
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/README.md +3 -3
- package/apps/agents-server/src/app/globals.css +15 -0
- package/apps/agents-server/src/components/ContextMenu/ContextMenuPanel.tsx +1 -11
- package/apps/agents-server/src/utils/applicationFonts.ts +4 -25
- package/esm/index.es.js +36124 -33191
- package/esm/index.es.js.map +1 -1
- package/esm/scripts/run-codex-prompts/checks/CoderCheckExecutionError.d.ts +6 -0
- package/esm/scripts/run-codex-prompts/checks/CoderCheckFailedError.d.ts +6 -0
- package/esm/scripts/run-codex-prompts/checks/buildCheckBeforeScriptPath.d.ts +2 -0
- package/esm/scripts/run-codex-prompts/checks/createCheckBeforeRepairPrompt.d.ts +3 -1
- package/esm/scripts/run-codex-prompts/checks/runCheckBefore.d.ts +5 -0
- package/esm/scripts/run-codex-prompts/checks/runCoderCheck.d.ts +17 -0
- package/esm/scripts/run-codex-prompts/checks/runCoderCheckRepair.d.ts +40 -0
- package/esm/scripts/run-codex-prompts/checks/runPromptWithCheckFeedback.d.ts +5 -0
- package/esm/scripts/run-codex-prompts/common/createFreeDiskSpaceGuard.d.ts +3 -0
- package/esm/scripts/run-codex-prompts/common/resolveCoderProjectContext.d.ts +2 -0
- package/esm/scripts/run-codex-prompts/common/runGoScript/$spawnLoggedBashScript.d.ts +2 -0
- package/esm/scripts/run-codex-prompts/common/runGoScript/buildCoderExecutionArtifactPaths.d.ts +2 -0
- package/esm/scripts/run-codex-prompts/common/runGoScript/scriptExecutionLog.d.ts +1 -1
- package/esm/scripts/run-codex-prompts/common/sleepWithCountdown.d.ts +2 -0
- package/esm/scripts/run-codex-prompts/common/waitForSkippableWorldTimeDeadline.d.ts +1 -0
- package/esm/scripts/run-codex-prompts/common/withCoderWorkspaceLock.d.ts +9 -0
- package/esm/scripts/run-codex-prompts/git/CoderGitOperationError.d.ts +9 -0
- package/esm/scripts/run-codex-prompts/git/CoderPhasePersistence.d.ts +105 -0
- package/esm/scripts/run-codex-prompts/git/CoderPhaseRecovery.d.ts +43 -0
- package/esm/scripts/run-codex-prompts/git/buildCoderCheckCommitMessage.d.ts +11 -0
- package/esm/scripts/run-codex-prompts/git/coderCommitScope.d.ts +14 -1
- package/esm/scripts/run-codex-prompts/git/coderFinalizationFiles.d.ts +14 -0
- package/esm/scripts/run-codex-prompts/git/coderIndexLease.d.ts +11 -0
- package/esm/scripts/run-codex-prompts/git/coderRepositoryFiles.d.ts +6 -0
- package/esm/scripts/run-codex-prompts/git/coderRepositorySnapshot.d.ts +62 -0
- package/esm/scripts/run-codex-prompts/git/coderRepositoryView.d.ts +30 -0
- package/esm/scripts/run-codex-prompts/git/commitChanges.d.ts +36 -3
- package/esm/scripts/run-codex-prompts/git/gitLongPathsSupport.d.ts +1 -1
- package/esm/scripts/run-codex-prompts/git/pullLatestChanges.d.ts +3 -1
- package/esm/scripts/run-codex-prompts/git/quoteGitArgument.d.ts +5 -0
- package/esm/scripts/run-codex-prompts/git/runGitCommand.d.ts +4 -0
- package/esm/scripts/run-codex-prompts/git/runWorkspaceGitWithIndexReadRetry.d.ts +7 -0
- package/esm/scripts/run-codex-prompts/git/workingTreeChanges.d.ts +1 -1
- package/esm/scripts/run-codex-prompts/isolation/coderIsolationArtifacts.d.ts +16 -0
- package/esm/scripts/run-codex-prompts/isolation/coderIsolationIgnoredFiles.d.ts +18 -0
- package/esm/scripts/run-codex-prompts/isolation/createCoderIsolationWorktree.d.ts +1 -2
- package/esm/scripts/run-codex-prompts/isolation/mergeCoderIsolationWorktree.d.ts +5 -5
- package/esm/scripts/run-codex-prompts/isolation/preserveCoderIsolationRecovery.d.ts +3 -0
- package/esm/scripts/run-codex-prompts/isolation/runIsolatedPromptRound.d.ts +2 -2
- package/esm/scripts/run-codex-prompts/main/prepareCoderPromptExecution.d.ts +18 -0
- package/esm/scripts/run-codex-prompts/main/runCoderFix.d.ts +24 -0
- package/esm/scripts/run-codex-prompts/main/runPromptRound.d.ts +12 -2
- package/esm/scripts/run-codex-prompts/prompts/buildPromptRunTraceContent.d.ts +5 -2
- package/esm/scripts/run-codex-prompts/prompts/refreshPromptSelection.d.ts +6 -0
- package/esm/scripts/run-codex-prompts/prompts/writePromptErrorLog.d.ts +4 -0
- package/esm/scripts/run-codex-prompts/prompts/writePromptFile.d.ts +2 -0
- package/esm/scripts/run-codex-prompts/prompts/writePromptRunTrace.d.ts +2 -0
- package/esm/scripts/run-codex-prompts/server/buildCoderServerPromptResponse.d.ts +1 -1
- package/esm/scripts/run-codex-prompts/ui/CoderRunUiState.d.ts +1 -1
- package/esm/scripts/run-codex-prompts/ui/buildCoderCheckRepairUiFrame.d.ts +3 -0
- package/esm/scripts/run-codex-prompts/ui/output/CoderOutputEvent.d.ts +1 -1
- package/esm/scripts/run-codex-prompts/ui/output/CoderRunOutput.d.ts +2 -2
- package/esm/scripts/run-codex-prompts/ui/renderCoderRunUi.d.ts +4 -0
- package/esm/src/cli/cli-commands/coder/add.d.ts +7 -2
- package/esm/src/cli/cli-commands/coder/ensureCoderGitattributesFile.d.ts +13 -0
- package/esm/src/cli/cli-commands/coder/ensureCoderGitignoreFile.d.ts +1 -1
- package/esm/src/cli/cli-commands/coder/fix.d.ts +7 -0
- package/esm/src/cli/cli-commands/coder/fix.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder/fixWorkflow.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder/initializeCoderProjectConfiguration.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/coderCheckCliOptions.d.ts +1 -1
- package/esm/src/cli/cli-commands/common/ensureProjectTextFile.d.ts +7 -0
- package/esm/src/cli/cli-commands/common/harness/$ensureHarnessInstallations.d.ts +3 -1
- package/esm/src/cli/cli-commands/common/validateCoderRunOptions.d.ts +1 -1
- package/esm/src/cli/cli-commands/common/workspaceRepository.d.ts +12 -0
- package/esm/src/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/cli/cli-commands/coder/add.ts +20 -3
- package/src/cli/cli-commands/coder/ensureCoderGitattributesFile.ts +25 -0
- package/src/cli/cli-commands/coder/ensureCoderGitignoreFile.ts +3 -3
- package/src/cli/cli-commands/coder/ensureCoderMarkdownFile.ts +2 -20
- package/src/cli/cli-commands/coder/fix.ts +166 -0
- package/src/cli/cli-commands/coder/fixtures/fix.cjs +29 -0
- package/src/cli/cli-commands/coder/fixtures/healthyDisk.cjs +4 -0
- package/src/cli/cli-commands/coder/getCoderInitializationCommitPaths.ts +2 -0
- package/src/cli/cli-commands/coder/init.ts +3 -1
- package/src/cli/cli-commands/coder/initializeCoderProjectConfiguration.ts +7 -0
- package/src/cli/cli-commands/coder/planning/fixtures/coding.cjs +4 -0
- package/src/cli/cli-commands/coder/printInitializationSummary.ts +2 -0
- package/src/cli/cli-commands/coder/promptsReadmeTemplate.ts +25 -1
- package/src/cli/cli-commands/coder/run.ts +17 -8
- package/src/cli/cli-commands/coder/server.ts +9 -6
- package/src/cli/cli-commands/coder.ts +4 -0
- package/src/cli/cli-commands/common/coderCheckCliOptions.ts +7 -6
- package/src/cli/cli-commands/common/ensureProjectTextFile.ts +35 -0
- package/src/cli/cli-commands/common/harness/$ensureHarnessInstallations.ts +13 -0
- package/src/cli/cli-commands/common/validateCoderRunOptions.ts +16 -1
- package/src/cli/cli-commands/common/workspaceRepository.ts +61 -13
- package/src/other/templates/getTemplatesPipelineCollection.ts +1825 -1089
- package/src/utils/execCommand/$execCommand.ts +2 -1
- package/src/version.ts +2 -2
- package/src/versions.txt +1 -0
- package/umd/index.umd.js +36204 -33273
- package/umd/index.umd.js.map +1 -1
- package/umd/scripts/run-codex-prompts/checks/CoderCheckExecutionError.d.ts +6 -0
- package/umd/scripts/run-codex-prompts/checks/CoderCheckFailedError.d.ts +6 -0
- package/umd/scripts/run-codex-prompts/checks/buildCheckBeforeScriptPath.d.ts +2 -0
- package/umd/scripts/run-codex-prompts/checks/createCheckBeforeRepairPrompt.d.ts +3 -1
- package/umd/scripts/run-codex-prompts/checks/runCheckBefore.d.ts +5 -0
- package/umd/scripts/run-codex-prompts/checks/runCoderCheck.d.ts +17 -0
- package/umd/scripts/run-codex-prompts/checks/runCoderCheckRepair.d.ts +40 -0
- package/umd/scripts/run-codex-prompts/checks/runPromptWithCheckFeedback.d.ts +5 -0
- package/umd/scripts/run-codex-prompts/common/createFreeDiskSpaceGuard.d.ts +3 -0
- package/umd/scripts/run-codex-prompts/common/resolveCoderProjectContext.d.ts +2 -0
- package/umd/scripts/run-codex-prompts/common/runGoScript/$spawnLoggedBashScript.d.ts +2 -0
- package/umd/scripts/run-codex-prompts/common/runGoScript/buildCoderExecutionArtifactPaths.d.ts +2 -0
- package/umd/scripts/run-codex-prompts/common/runGoScript/scriptExecutionLog.d.ts +1 -1
- package/umd/scripts/run-codex-prompts/common/sleepWithCountdown.d.ts +2 -0
- package/umd/scripts/run-codex-prompts/common/waitForSkippableWorldTimeDeadline.d.ts +1 -0
- package/umd/scripts/run-codex-prompts/common/withCoderWorkspaceLock.d.ts +9 -0
- package/umd/scripts/run-codex-prompts/git/CoderGitOperationError.d.ts +9 -0
- package/umd/scripts/run-codex-prompts/git/CoderPhasePersistence.d.ts +105 -0
- package/umd/scripts/run-codex-prompts/git/CoderPhaseRecovery.d.ts +43 -0
- package/umd/scripts/run-codex-prompts/git/buildCoderCheckCommitMessage.d.ts +11 -0
- package/umd/scripts/run-codex-prompts/git/coderCommitScope.d.ts +14 -1
- package/umd/scripts/run-codex-prompts/git/coderFinalizationFiles.d.ts +14 -0
- package/umd/scripts/run-codex-prompts/git/coderIndexLease.d.ts +11 -0
- package/umd/scripts/run-codex-prompts/git/coderRepositoryFiles.d.ts +6 -0
- package/umd/scripts/run-codex-prompts/git/coderRepositorySnapshot.d.ts +62 -0
- package/umd/scripts/run-codex-prompts/git/coderRepositoryView.d.ts +30 -0
- package/umd/scripts/run-codex-prompts/git/commitChanges.d.ts +36 -3
- package/umd/scripts/run-codex-prompts/git/gitLongPathsSupport.d.ts +1 -1
- package/umd/scripts/run-codex-prompts/git/pullLatestChanges.d.ts +3 -1
- package/umd/scripts/run-codex-prompts/git/quoteGitArgument.d.ts +5 -0
- package/umd/scripts/run-codex-prompts/git/runGitCommand.d.ts +4 -0
- package/umd/scripts/run-codex-prompts/git/runWorkspaceGitWithIndexReadRetry.d.ts +7 -0
- package/umd/scripts/run-codex-prompts/git/workingTreeChanges.d.ts +1 -1
- package/umd/scripts/run-codex-prompts/isolation/coderIsolationArtifacts.d.ts +16 -0
- package/umd/scripts/run-codex-prompts/isolation/coderIsolationIgnoredFiles.d.ts +18 -0
- package/umd/scripts/run-codex-prompts/isolation/createCoderIsolationWorktree.d.ts +1 -2
- package/umd/scripts/run-codex-prompts/isolation/mergeCoderIsolationWorktree.d.ts +5 -5
- package/umd/scripts/run-codex-prompts/isolation/preserveCoderIsolationRecovery.d.ts +3 -0
- package/umd/scripts/run-codex-prompts/isolation/runIsolatedPromptRound.d.ts +2 -2
- package/umd/scripts/run-codex-prompts/main/prepareCoderPromptExecution.d.ts +18 -0
- package/umd/scripts/run-codex-prompts/main/runCoderFix.d.ts +24 -0
- package/umd/scripts/run-codex-prompts/main/runPromptRound.d.ts +12 -2
- package/umd/scripts/run-codex-prompts/prompts/buildPromptRunTraceContent.d.ts +5 -2
- package/umd/scripts/run-codex-prompts/prompts/refreshPromptSelection.d.ts +6 -0
- package/umd/scripts/run-codex-prompts/prompts/writePromptErrorLog.d.ts +4 -0
- package/umd/scripts/run-codex-prompts/prompts/writePromptFile.d.ts +2 -0
- package/umd/scripts/run-codex-prompts/prompts/writePromptRunTrace.d.ts +2 -0
- package/umd/scripts/run-codex-prompts/server/buildCoderServerPromptResponse.d.ts +1 -1
- package/umd/scripts/run-codex-prompts/ui/CoderRunUiState.d.ts +1 -1
- package/umd/scripts/run-codex-prompts/ui/buildCoderCheckRepairUiFrame.d.ts +3 -0
- package/umd/scripts/run-codex-prompts/ui/output/CoderOutputEvent.d.ts +1 -1
- package/umd/scripts/run-codex-prompts/ui/output/CoderRunOutput.d.ts +2 -2
- package/umd/scripts/run-codex-prompts/ui/renderCoderRunUi.d.ts +4 -0
- package/umd/src/cli/cli-commands/coder/add.d.ts +7 -2
- package/umd/src/cli/cli-commands/coder/ensureCoderGitattributesFile.d.ts +13 -0
- package/umd/src/cli/cli-commands/coder/ensureCoderGitignoreFile.d.ts +1 -1
- package/umd/src/cli/cli-commands/coder/fix.d.ts +7 -0
- package/umd/src/cli/cli-commands/coder/fix.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder/fixWorkflow.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder/initializeCoderProjectConfiguration.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/coderCheckCliOptions.d.ts +1 -1
- package/umd/src/cli/cli-commands/common/ensureProjectTextFile.d.ts +7 -0
- package/umd/src/cli/cli-commands/common/harness/$ensureHarnessInstallations.d.ts +3 -1
- package/umd/src/cli/cli-commands/common/validateCoderRunOptions.d.ts +1 -1
- package/umd/src/cli/cli-commands/common/workspaceRepository.d.ts +12 -0
- package/umd/src/version.d.ts +1 -1
|
@@ -1,17 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { spawn } from 'child_process';
|
|
2
2
|
import { lstat, realpath } from 'fs/promises';
|
|
3
3
|
import { dirname, join } from 'path';
|
|
4
4
|
import { spaceTrim } from 'spacetrim';
|
|
5
|
-
import { promisify } from 'util';
|
|
6
5
|
import { EnvironmentMismatchError } from '../../../errors/EnvironmentMismatchError';
|
|
7
6
|
import { NotAllowed } from '../../../errors/NotAllowed';
|
|
8
7
|
import { loadPromptsModule } from '../../common/loadPromptsModule';
|
|
9
8
|
import type { NormalizedQuestionsCliOptions } from './questionsCliOptions';
|
|
10
9
|
import { resolveProjectDirectory } from './projectCliOptions';
|
|
11
10
|
|
|
12
|
-
/** Shell-free Git execution, also usable from the packaged CLI. */
|
|
13
|
-
const EXECUTE_FILE = promisify(execFile);
|
|
14
|
-
|
|
15
11
|
/**
|
|
16
12
|
* Resolved project directory and its enclosing working tree. Project artifacts belong to `projectPath`;
|
|
17
13
|
* Git paths and synchronization belong to `repositoryRoot`, which may be an enclosing monorepo.
|
|
@@ -212,15 +208,67 @@ async function $assertNoBrokenRepositoryMetadata(projectPath: string, repository
|
|
|
212
208
|
}
|
|
213
209
|
}
|
|
214
210
|
|
|
215
|
-
/**
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
211
|
+
/**
|
|
212
|
+
* Executes Git without a shell, optional index locks, or credential prompts, retaining raw output boundaries.
|
|
213
|
+
* Drains both output streams without execFile's fixed buffer limit so large repository listings remain complete.
|
|
214
|
+
* @private shared Git discovery and commit-scope inspection
|
|
215
|
+
*/
|
|
216
|
+
export async function $runWorkspaceGit(
|
|
217
|
+
projectPath: string,
|
|
218
|
+
argumentsList: ReadonlyArray<string>,
|
|
219
|
+
options?: {
|
|
220
|
+
readonly env?: Record<string, string>;
|
|
221
|
+
readonly signal?: AbortSignal;
|
|
222
|
+
readonly input?: string | Buffer;
|
|
223
|
+
},
|
|
224
|
+
): Promise<string> {
|
|
225
|
+
return new Promise((resolve, reject) => {
|
|
226
|
+
const child = spawn('git', [...argumentsList], {
|
|
227
|
+
cwd: projectPath,
|
|
228
|
+
env: { ...process.env, LC_ALL: 'C', GIT_OPTIONAL_LOCKS: '0', GIT_TERMINAL_PROMPT: '0', ...options?.env },
|
|
229
|
+
windowsHide: true,
|
|
230
|
+
signal: options?.signal,
|
|
231
|
+
});
|
|
232
|
+
const stdoutChunks: string[] = [];
|
|
233
|
+
const stderrChunks: string[] = [];
|
|
234
|
+
let processError: Error | undefined;
|
|
235
|
+
let inputError: Error | undefined;
|
|
236
|
+
// Stream decoding preserves multibyte filenames even when a character spans two output chunks.
|
|
237
|
+
child.stdout.setEncoding('utf8');
|
|
238
|
+
child.stderr.setEncoding('utf8');
|
|
239
|
+
child.stdout.on('data', (chunk: string) => stdoutChunks.push(chunk));
|
|
240
|
+
child.stderr.on('data', (chunk: string) => stderrChunks.push(chunk));
|
|
241
|
+
child.on('error', (error) => {
|
|
242
|
+
processError = error;
|
|
243
|
+
});
|
|
244
|
+
child.stdin.on('error', (error) => {
|
|
245
|
+
// A failed Git command may close stdin early. Keep its exit status and stderr as the primary error.
|
|
246
|
+
inputError = error;
|
|
247
|
+
});
|
|
248
|
+
child.on('close', (code, signal) => {
|
|
249
|
+
const stdout = stdoutChunks.join('');
|
|
250
|
+
const stderr = stderrChunks.join('');
|
|
251
|
+
if (processError) {
|
|
252
|
+
reject(Object.assign(processError, { stdout, stderr }));
|
|
253
|
+
} else if (code !== 0 || signal) {
|
|
254
|
+
reject(
|
|
255
|
+
Object.assign(new Error(`Command failed: git ${argumentsList.join(' ')}\n${stderr}`), {
|
|
256
|
+
code,
|
|
257
|
+
signal,
|
|
258
|
+
killed: child.killed,
|
|
259
|
+
stdout,
|
|
260
|
+
stderr,
|
|
261
|
+
}),
|
|
262
|
+
);
|
|
263
|
+
} else if (inputError) {
|
|
264
|
+
reject(Object.assign(inputError, { stdout, stderr }));
|
|
265
|
+
} else {
|
|
266
|
+
resolve(stdout);
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
// Index-info uses NUL-delimited input. Closing stdin also lets commands finish when input is empty.
|
|
270
|
+
child.stdin.end(options?.input);
|
|
222
271
|
});
|
|
223
|
-
return result.stdout;
|
|
224
272
|
}
|
|
225
273
|
|
|
226
274
|
/** Translates discovery failures without ever treating an ownership or executable error as permission to init. */
|