tinker-agent 1.0.50 → 1.0.51

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.
@@ -114,6 +114,20 @@ sudo chown -R ${AGENT_USER}:${GROUP_NAME} ${AGENT_HOME} || echo "⚠️ Failed t
114
114
  WORKDIR=\$(pwd)
115
115
  sudo chown -R ${AGENT_USER}:${GROUP_NAME} "\${WORKDIR}" || echo "⚠️ Failed to chown workdir"
116
116
 
117
+ # Reset git state if .git exists
118
+ if [ -d ".git" ]; then
119
+ echo "🧹 Resetting git state..."
120
+
121
+ # Remove stale index.lock
122
+ rm -f .git/index.lock
123
+
124
+ # Reset hard to HEAD
125
+ git reset --hard HEAD || echo "⚠️ Failed to git reset"
126
+
127
+ # Ensure clean state (optional cleans ignored files too?)
128
+ # git clean -fd || echo "⚠️ Failed to git clean"
129
+ fi
130
+
117
131
  # Execute command as agent user
118
132
  exec sudo -E -u ${AGENT_USER} env "HOME=${AGENT_HOME}" "\$@"
119
133
  EOF
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tinker-agent",
3
- "version": "1.0.50",
3
+ "version": "1.0.51",
4
4
  "description": "Tinker Agent Runner",
5
5
  "bin": {
6
6
  "tinker-agent": "./run-tinker-agent.rb"
package/setup-agent.rb CHANGED
@@ -399,45 +399,6 @@ def setup_git_config!
399
399
  puts "✅ Git configured to trust #{Dir.pwd}"
400
400
  end
401
401
 
402
- def prepare_git_state!
403
- return unless File.directory?(".git")
404
-
405
- puts "🧹 Preparing git repository..."
406
-
407
- # Fix permissions on .git to allow lock creation (fix for Permission denied)
408
- if system("command -v sudo > /dev/null 2>&1")
409
- current_user = `whoami`.strip
410
- if current_user != "root"
411
- # Try to take ownership of .git folder to ensure we can write locks
412
- system("sudo chown -R #{current_user} .git")
413
- end
414
- end
415
-
416
- # Remove stale index.lock if it exists
417
- if File.exist?(".git/index.lock")
418
- puts "🔓 Removing stale index.lock..."
419
- first_try = system("rm -f .git/index.lock")
420
-
421
- # If failed and sudo exists, try sudo
422
- if File.exist?(".git/index.lock") && system("command -v sudo > /dev/null 2>&1")
423
- system("sudo rm -f .git/index.lock")
424
- end
425
- end
426
-
427
- # Reset to clean state
428
- puts "🔄 Resetting to clean state..."
429
- system("git add .")
430
- if system("git reset --hard")
431
- puts "✅ Git state reset"
432
- else
433
- puts "⚠️ Failed to reset git state"
434
- end
435
- if system("git pull --rebase")
436
- puts "✅ Git repository up to date"
437
- else
438
- puts "⚠️ Failed to pull latest changes"
439
- end
440
- end
441
402
 
442
403
  def setup_git_hooks!
443
404
  # Install git hooks to encourage agents to use git-workflow skill
@@ -571,7 +532,7 @@ setup_system_prompt!
571
532
  setup_skills!
572
533
  setup_github_auth!
573
534
  setup_git_config!
574
- prepare_git_state!
575
535
  setup_git_hooks!
536
+ # prepare_git_state! is now in entrypoint.sh
576
537
  bin_dir = download_agent_bridge!
577
538
  run_agent!(bin_dir)