@gobing-ai/ts-ai-runner 0.3.7 → 0.3.9

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.
@@ -1 +1 @@
1
- {"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../src/identity.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,KAAK,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEzF,mFAAmF;AACnF,MAAM,WAAW,eAAe;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC9D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED,8HAA8H;AAC9H,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,eAAe,GAAG,MAAM,CA8ClE;AAED,kMAAkM;AAClM,wBAAgB,aAAa,CACzB,aAAa,EAAE,MAAM,EACrB,QAAQ,GAAE,mBAAkD,GAC7D,MAAM,GAAG,IAAI,CAYf"}
1
+ {"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../src/identity.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,KAAK,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEzF,mFAAmF;AACnF,MAAM,WAAW,eAAe;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC9D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED,8HAA8H;AAC9H,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,eAAe,GAAG,MAAM,CA8ClE;AAED,kMAAkM;AAClM,wBAAgB,aAAa,CACzB,aAAa,EAAE,MAAM,EACrB,QAAQ,GAAE,mBAAkD,GAC7D,MAAM,GAAG,IAAI,CASf"}
package/dist/identity.js CHANGED
@@ -34,18 +34,15 @@ export function buildIdentityPreamble(ctx) {
34
34
  }
35
35
  /** Query git for the current branch name and dirty file count in `workspacePath`. Returns a pre-formatted "Git context" block, or `null` if git is unavailable or the directory is not a repo. */
36
36
  export function getGitContext(workspacePath, executor = new BunSyncProcessExecutor()) {
37
- const git = Bun.which('git');
38
- if (git === null)
39
- return null;
40
- const branch = runGit(executor, git, ['-C', workspacePath, 'branch', '--show-current']);
37
+ const branch = runGit(executor, ['-C', workspacePath, 'branch', '--show-current']);
41
38
  if (branch === null || branch === '')
42
39
  return null;
43
- const status = runGit(executor, git, ['-C', workspacePath, 'status', '--porcelain']);
40
+ const status = runGit(executor, ['-C', workspacePath, 'status', '--porcelain']);
44
41
  const dirtyCount = status === null || status === '' ? 0 : status.split('\n').filter(Boolean).length;
45
42
  return ['Git context:', `branch: ${branch}`, `dirty: ${dirtyCount === 0 ? 'false' : `${dirtyCount} files`}`].join('\n');
46
43
  }
47
- function runGit(executor, command, args) {
48
- const result = executor.runSync({ command, args, rejectOnError: false, forceBuffered: true });
44
+ function runGit(executor, args) {
45
+ const result = executor.runSync({ command: 'git', args, rejectOnError: false, forceBuffered: true });
49
46
  if (result.exitCode !== 0)
50
47
  return null;
51
48
  return result.stdout.trim();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gobing-ai/ts-ai-runner",
3
- "version": "0.3.7",
3
+ "version": "0.3.9",
4
4
  "description": "@gobing-ai/ts-ai-runner — Coding-agent shims, detection, doctor checks, and prompt execution.",
5
5
  "keywords": [
6
6
  "typescript",
@@ -47,9 +47,9 @@
47
47
  "release": "echo 'Manual publish is disabled. Releases go through GitHub Actions via Trusted Publishing — push a tag: git tag @gobing-ai/ts-ai-runner-v<version> && git push --tags' && exit 1"
48
48
  },
49
49
  "dependencies": {
50
- "@gobing-ai/ts-db": "^0.3.7",
51
- "@gobing-ai/ts-infra": "^0.3.7",
52
- "@gobing-ai/ts-runtime": "^0.3.7"
50
+ "@gobing-ai/ts-db": "^0.3.9",
51
+ "@gobing-ai/ts-infra": "^0.3.9",
52
+ "@gobing-ai/ts-runtime": "^0.3.9"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@types/bun": "1.3.14"
package/src/identity.ts CHANGED
@@ -69,21 +69,18 @@ export function getGitContext(
69
69
  workspacePath: string,
70
70
  executor: SyncProcessExecutor = new BunSyncProcessExecutor(),
71
71
  ): string | null {
72
- const git = Bun.which('git');
73
- if (git === null) return null;
74
-
75
- const branch = runGit(executor, git, ['-C', workspacePath, 'branch', '--show-current']);
72
+ const branch = runGit(executor, ['-C', workspacePath, 'branch', '--show-current']);
76
73
  if (branch === null || branch === '') return null;
77
74
 
78
- const status = runGit(executor, git, ['-C', workspacePath, 'status', '--porcelain']);
75
+ const status = runGit(executor, ['-C', workspacePath, 'status', '--porcelain']);
79
76
  const dirtyCount = status === null || status === '' ? 0 : status.split('\n').filter(Boolean).length;
80
77
  return ['Git context:', `branch: ${branch}`, `dirty: ${dirtyCount === 0 ? 'false' : `${dirtyCount} files`}`].join(
81
78
  '\n',
82
79
  );
83
80
  }
84
81
 
85
- function runGit(executor: SyncProcessExecutor, command: string, args: string[]): string | null {
86
- const result = executor.runSync({ command, args, rejectOnError: false, forceBuffered: true });
82
+ function runGit(executor: SyncProcessExecutor, args: string[]): string | null {
83
+ const result = executor.runSync({ command: 'git', args, rejectOnError: false, forceBuffered: true });
87
84
  if (result.exitCode !== 0) return null;
88
85
  return result.stdout.trim();
89
86
  }