@markjaquith/agency 0.7.0 → 0.7.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markjaquith/agency",
3
- "version": "0.7.0",
3
+ "version": "0.7.2",
4
4
  "description": "Manages personal agents files",
5
5
  "license": "MIT",
6
6
  "author": "Mark Jaquith",
@@ -20,9 +20,6 @@
20
20
  "knip": "knip --production",
21
21
  "pushable": "./scripts/pushable",
22
22
  "check-commit-msg": "./scripts/check-commit-msg",
23
- "changeset": "changeset",
24
- "version": "changeset version",
25
- "release": "bun run build && changeset publish --provenance",
26
23
  "build": "bun build cli.ts --outdir dist --target node --minify"
27
24
  },
28
25
  "exports": {
@@ -46,7 +43,6 @@
46
43
  "personal-agents"
47
44
  ],
48
45
  "devDependencies": {
49
- "@changesets/cli": "^2.29.8",
50
46
  "@types/bun": "latest",
51
47
  "knip": "^5.70.1",
52
48
  "prettier": "^3.6.2"
@@ -65,5 +61,11 @@
65
61
  },
66
62
  "trustedDependencies": [
67
63
  "@triggi/native-exec"
68
- ]
64
+ ],
65
+ "publishConfig": {
66
+ "registry": "https://registry.npmjs.org/",
67
+ "tag": "latest",
68
+ "access": "public",
69
+ "provenance": true
70
+ }
69
71
  }
@@ -364,7 +364,7 @@ export class GitService extends Effect.Service<GitService>()("GitService", {
364
364
  const configBranch = yield* getGitConfigEffect(
365
365
  "agency.mainBranch",
366
366
  gitRoot,
367
- )
367
+ ).pipe(Effect.catchAll(() => Effect.succeed(null)))
368
368
  const mainBranch =
369
369
  configBranch || (yield* findMainBranchEffect(gitRoot))
370
370
 
@@ -383,6 +383,49 @@ export class GitService extends Effect.Service<GitService>()("GitService", {
383
383
  const strippedMainBranch =
384
384
  mainBranch.match(/^[^/]+\/(.+)$/)?.[1] || mainBranch
385
385
 
386
+ // If currentBranch is empty (detached HEAD), check if HEAD points to main branch
387
+ if (!currentBranch) {
388
+ const headCommit = yield* runGitCommandOrFail(
389
+ ["git", "rev-parse", "HEAD"],
390
+ gitRoot,
391
+ )
392
+ const headSha = headCommit.trim()
393
+
394
+ // Check if HEAD matches the configured main branch
395
+ const mainCommitResult = yield* spawnProcess(
396
+ ["git", "rev-parse", mainBranch],
397
+ { cwd: gitRoot },
398
+ )
399
+ if (
400
+ mainCommitResult.exitCode === 0 &&
401
+ headSha === mainCommitResult.stdout.trim()
402
+ ) {
403
+ return false
404
+ }
405
+
406
+ // If mainBranch doesn't have a remote prefix, also check the remote version
407
+ if (!mainBranch.includes("/")) {
408
+ const remote = yield* findDefaultRemoteEffect(gitRoot).pipe(
409
+ Effect.catchAll(() => Effect.succeed(null)),
410
+ )
411
+ if (remote) {
412
+ const remoteBranch = `${remote}/${mainBranch}`
413
+ const remoteCommitResult = yield* spawnProcess(
414
+ ["git", "rev-parse", remoteBranch],
415
+ { cwd: gitRoot },
416
+ )
417
+ if (
418
+ remoteCommitResult.exitCode === 0 &&
419
+ headSha === remoteCommitResult.stdout.trim()
420
+ ) {
421
+ return false
422
+ }
423
+ }
424
+ }
425
+
426
+ return true
427
+ }
428
+
386
429
  // Current branch is not a feature branch if it matches either the full or stripped name
387
430
  return (
388
431
  currentBranch !== mainBranch && currentBranch !== strippedMainBranch