spacehub

surshar / claude-code

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

Built by Anthropic · github.com/anthropics

mods: the declarations carry process.run's truncation flags and list entries' mtimeMs; the test fakes answer themBrowse files
poteat authored 28 days ago parent 7779afb · commit 61eb8584727b
12 changed files+34 -6compared with 7779afb
Mmods/README.md
Mmods/diff/tests/fixtures/backend-of/recording-backend-host-of.ts
Mmods/diff/tests/fixtures/git-in.ts
Mmods/diff/tests/fixtures/not-a-repository.ts
Mmods/diff/tests/fixtures/old-files.ts
Mmods/diff/tests/fixtures/scripted/git-timed-out.ts
Mmods/diff/tests/fixtures/scripted/ok.ts
Mmods/diff/tests/fixtures/scripted/probe-missed.ts
Mmods/diff/tests/fixtures/scripted/unscripted.ts
Mmods/telemetry/tests/fixtures/listing.ts
Mmods/telemetry/tests/fixtures/probed.ts
Mmods/types/claude-code.d.ts
@@ -48,7 +48,13 @@
4848 on('session.start', ($, e) => ({ cwd: e.cwd }))
4949 on('command.register', ($, e) => ({ value: { command: e.name } }))
5050 on('process.run', () => ({
51- value: { exitCode: 128, stdout: '', stderr: 'fatal: not a git repository' },
51+ value: {
52+ exitCode: 128,
53+ stdout: '',
54+ stderr: 'fatal: not a git repository',
55+ isStdoutTruncated: false,
56+ isStderrTruncated: false,
57+ },
5258 }))
5359 on('ui.open', ($, e, next) => {
5460 opened.push(e.id)
@@ -20,7 +20,11 @@
2020 const host = backendHostOf(([program, ...rest]) => {
2121 programs.push(program)
2222
23- return scripted.run(rest)
23+ return scripted.run(rest).then(ran => ({
24+ ...ran,
25+ isStdoutTruncated: false,
26+ isStderrTruncated: false,
27+ }))
2428 })
2529
2630 return { host, programs }
@@ -22,6 +22,12 @@
2222 const found = Object.entries(script).find(([key]) => line.includes(key))
2323
2424 return found
25- ? { exitCode: 0, stdout: found[1], stderr: '' }
25+ ? {
26+ exitCode: 0,
27+ stdout: found[1],
28+ stderr: '',
29+ isStdoutTruncated: false,
30+ isStderrTruncated: false,
31+ }
2632 : NOT_A_REPOSITORY
2733 }
@@ -7,4 +7,6 @@
77 exitCode: 128,
88 stdout: '',
99 stderr: 'fatal: not a git repository',
10+ isStdoutTruncated: false,
11+ isStderrTruncated: false,
1012 }
@@ -9,8 +9,8 @@
99 export function oldFiles(on: On) {
1010 on('fs.list', () => ({
1111 value: [
12- { name: 'old.ts', kind: 'file', size: 2, isLink: false },
13- { name: 'moved.ts', kind: 'file', size: 2, isLink: false },
12+ { name: 'old.ts', kind: 'file', size: 2, mtimeMs: 0, isLink: false },
13+ { name: 'moved.ts', kind: 'file', size: 2, mtimeMs: 0, isLink: false },
1414 ],
1515 }))
1616
@@ -8,4 +8,6 @@
88 exitCode: -1,
99 stdout: '',
1010 stderr: '',
11+ isStdoutTruncated: false,
12+ isStderrTruncated: false,
1113 }
@@ -11,4 +11,6 @@
1111 exitCode: 0,
1212 stdout,
1313 stderr: '',
14+ isStdoutTruncated: false,
15+ isStderrTruncated: false,
1416 })
@@ -8,4 +8,6 @@
88 exitCode: 1,
99 stdout: '',
1010 stderr: '',
11+ isStdoutTruncated: false,
12+ isStderrTruncated: false,
1113 }
@@ -8,4 +8,6 @@
88 exitCode: 128,
99 stdout: '',
1010 stderr: '',
11+ isStdoutTruncated: false,
12+ isStderrTruncated: false,
1113 }
@@ -4,5 +4,5 @@
44 * What the session's working directory lists: a git checkout.
55 */
66 export const LISTING: FsEntry[] = [
7- { name: '.git', kind: 'dir', size: 0, isLink: false },
7+ { name: '.git', kind: 'dir', size: 0, mtimeMs: 0, isLink: false },
88 ]
@@ -8,4 +8,6 @@
88 exitCode: 0,
99 stdout: 'Darwin\n25.6.0\narm64\nnpm,pnpm,\nbun,node,\n',
1010 stderr: '',
11+ isStdoutTruncated: false,
12+ isStderrTruncated: false,
1113 }
Large file, diff not shown.