@ran-sh/dsh-crew 1.10.3 → 1.10.4

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,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-crew",
3
- "version": "1.10.3",
3
+ "version": "1.10.4",
4
4
  "description": "Dispatch subtasks to DeepSeek Harness (DSH) agents as native subagents with live progress",
5
5
  "author": {
6
6
  "name": "ZSeven-W"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ran-sh/dsh-crew",
3
- "version": "1.10.3",
3
+ "version": "1.10.4",
4
4
  "type": "module",
5
5
  "main": "./src/hub/entry.mjs",
6
6
  "bin": {
@@ -36,7 +36,7 @@ export {
36
36
  // included in the identity contract.
37
37
  const RUNTIME_ID = randomUUID();
38
38
 
39
- export const RUNTIME_VERSION = '1.10.3';
39
+ export const RUNTIME_VERSION = '1.10.4';
40
40
  export const HUB_PROTOCOL_VERSION = 1;
41
41
 
42
42
  export const HUB_CAPABILITIES = Object.freeze([
@@ -25,6 +25,8 @@ export const NOT_GIT_REPOSITORY = 'NOT_GIT_REPOSITORY';
25
25
  export const GIT_NOT_FOUND = 'GIT_NOT_FOUND';
26
26
  export const GIT_TIMEOUT = 'GIT_TIMEOUT';
27
27
  export const GIT_ERROR = 'GIT_ERROR';
28
+ /** A valid repository whose HEAD does not resolve because nothing is committed. */
29
+ export const REPOSITORY_HAS_NO_COMMITS = 'REPOSITORY_HAS_NO_COMMITS';
28
30
  export const WORKTREE_LOCKED = 'WORKTREE_LOCKED';
29
31
  export const WORKTREE_RESERVE_FAILED = 'WORKTREE_RESERVE_FAILED';
30
32
  export const CANDIDATE_CAPTURE_FAILED = 'CANDIDATE_CAPTURE_FAILED';
@@ -269,7 +271,22 @@ export async function inspectRepository({ cwd, git, runner } = {}) {
269
271
  runGit(run, ['status', '--porcelain', '-uall'], { cwd }),
270
272
  ]);
271
273
  if (!root.ok) return { ok: false, reason: root.reason, error: root.error };
272
- if (!head.ok) return { ok: false, reason: head.reason, error: head.error };
274
+ if (!head.ok) {
275
+ // A repository with no commits yet is a valid repository whose HEAD simply
276
+ // does not resolve, and it cannot be told apart from a broken one by that
277
+ // command alone. It is worth telling apart: `git init && <ask Crew to do
278
+ // something>` is how a new project starts, and reporting it as a generic git
279
+ // error leaves the operator with nothing to act on.
280
+ const verified = await runGit(run, ['rev-parse', '--verify', '--quiet', 'HEAD'], { cwd });
281
+ if (verified.ok === false && (verified.code === 1 || verified.code === 128) && !verified.stdout?.trim()) {
282
+ return {
283
+ ok: false,
284
+ reason: REPOSITORY_HAS_NO_COMMITS,
285
+ error: 'this repository has no commits yet, so there is no revision for an isolated job to start from; make an initial commit, or set execution.isolation to "shared" to run in the working tree',
286
+ };
287
+ }
288
+ return { ok: false, reason: head.reason, error: head.error };
289
+ }
273
290
  return {
274
291
  ok: true,
275
292
  repoRoot: resolve(root.stdout.trim()),