prompt_007.log 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. ----------
  2. # Task
  3. You're a diligent software engineer AI. You can't see, draw, or interact with a
  4. browser, but you can read and write files, and you can run commands, and you can think.
  5. You've been given the following task:
  6. Write a shell script 'hello.sh' that prints 'hello'. Do not ask me for confirmation at any point.
  7. ## Plan
  8. As you complete this task, you're building a plan and keeping
  9. track of your progress. Here's a JSON representation of your plan:
  10. {
  11. "id": "",
  12. "goal": "",
  13. "state": "in_progress",
  14. "subtasks": [
  15. {
  16. "id": "0",
  17. "goal": "Write a shell script 'hello.sh' that prints 'hello'.",
  18. "state": "in_progress",
  19. "subtasks": [
  20. {
  21. "id": "0.0",
  22. "goal": "Create the shell script file 'hello.sh'.",
  23. "state": "completed",
  24. "subtasks": []
  25. },
  26. {
  27. "id": "0.1",
  28. "goal": "Write the content to print 'hello' in the shell script.",
  29. "state": "in_progress",
  30. "subtasks": []
  31. },
  32. {
  33. "id": "0.2",
  34. "goal": "Run the shell script to verify it prints 'hello'.",
  35. "state": "open",
  36. "subtasks": []
  37. }
  38. ]
  39. }
  40. ]
  41. }
  42. You're currently working on this task:
  43. Write the content to print 'hello' in the shell script..
  44. If it's not achievable AND verifiable with a SINGLE action, you MUST break it down into subtasks NOW.
  45. You're responsible for managing this plan and the status of tasks in
  46. it, by using the `add_task` and `modify_task` actions described below.
  47. If the History below contradicts the state of any of these tasks, you
  48. MUST modify the task using the `modify_task` action described below.
  49. Be sure NOT to duplicate any tasks. Do NOT use the `add_task` action for
  50. a task that's already represented. Every task must be represented only once.
  51. Tasks that are sequential MUST be siblings. They must be added in order
  52. to their parent task.
  53. If you mark a task as 'completed', 'verified', or 'abandoned',
  54. all non-abandoned subtasks will be marked the same way.
  55. So before closing a task this way, you MUST not only be sure that it has
  56. been completed successfully--you must ALSO be sure that all its subtasks
  57. are ready to be marked the same way.
  58. If, and only if, ALL tasks have already been marked verified,
  59. you MUST respond with the `finish` action.
  60. ## History
  61. Here is a recent history of actions you've taken in service of this plan,
  62. as well as observations you've made. This only includes the MOST RECENT
  63. ten actions--more happened before that.
  64. [
  65. {
  66. "source": "user",
  67. "action": "message",
  68. "args": {
  69. "content": "Write a shell script 'hello.sh' that prints 'hello'. Do not ask me for confirmation at any point.",
  70. "wait_for_response": false
  71. }
  72. },
  73. {
  74. "source": "agent",
  75. "action": "add_task",
  76. "args": {
  77. "parent": "",
  78. "goal": "Write a shell script 'hello.sh' that prints 'hello'.",
  79. "subtasks": [
  80. {
  81. "goal": "Create the shell script file 'hello.sh'."
  82. },
  83. {
  84. "goal": "Write the content to print 'hello' in the shell script."
  85. },
  86. {
  87. "goal": "Run the shell script to verify it prints 'hello'."
  88. }
  89. ],
  90. "thought": ""
  91. }
  92. },
  93. {
  94. "source": "agent",
  95. "action": "modify_task",
  96. "args": {
  97. "task_id": "0.0",
  98. "state": "in_progress",
  99. "thought": ""
  100. }
  101. },
  102. {
  103. "source": "agent",
  104. "action": "write",
  105. "args": {
  106. "path": "hello.sh",
  107. "content": "#!/bin/bash\n\n# Print 'hello'\necho 'hello'",
  108. "start": 0,
  109. "end": -1,
  110. "thought": ""
  111. }
  112. },
  113. {
  114. "source": "agent",
  115. "observation": "write",
  116. "content": "",
  117. "extras": {
  118. "path": "hello.sh"
  119. }
  120. },
  121. {
  122. "source": "agent",
  123. "action": "modify_task",
  124. "args": {
  125. "task_id": "0.0",
  126. "state": "completed",
  127. "thought": "The shell script file 'hello.sh' has been created successfully."
  128. }
  129. },
  130. {
  131. "source": "agent",
  132. "action": "modify_task",
  133. "args": {
  134. "task_id": "0.1",
  135. "state": "in_progress",
  136. "thought": "Now that the shell script file 'hello.sh' has been created, I will write the content to print 'hello' in the shell script."
  137. }
  138. },
  139. {
  140. "source": "agent",
  141. "action": "write",
  142. "args": {
  143. "path": "hello.sh",
  144. "content": "#!/bin/bash\n\n# Print 'hello'\necho 'hello'",
  145. "start": 0,
  146. "end": -1,
  147. "thought": ""
  148. }
  149. },
  150. {
  151. "source": "agent",
  152. "observation": "write",
  153. "content": "",
  154. "extras": {
  155. "path": "hello.sh"
  156. }
  157. }
  158. ]
  159. Your most recent action is at the bottom of that history.
  160. ## Action
  161. What is your next thought or action? Your response must be in JSON format.
  162. It must be an object, and it must contain two fields:
  163. * `action`, which is one of the actions below
  164. * `args`, which is a map of key-value pairs, specifying the arguments for that action
  165. * `read` - reads the content of a file. Arguments:
  166. * `path` - the path of the file to read
  167. * `write` - writes the content to a file. Arguments:
  168. * `path` - the path of the file to write
  169. * `content` - the content to write to the file
  170. * `run` - runs a command on the command line in a Linux shell. Arguments:
  171. * `command` - the command to run
  172. * `browse` - opens a web page. Arguments:
  173. * `url` - the URL to open
  174. * `message` - make a plan, set a goal, record your thoughts, or ask for more input from the user. Arguments:
  175. * `content` - the message to record
  176. * `wait_for_response` - set to `true` to wait for the user to respond before proceeding
  177. * `add_task` - add a task to your plan. Arguments:
  178. * `parent` - the ID of the parent task (leave empty if it should go at the top level)
  179. * `goal` - the goal of the task
  180. * `subtasks` - a list of subtasks, each of which is a map with a `goal` key.
  181. * `modify_task` - close a task. Arguments:
  182. * `task_id` - the ID of the task to close
  183. * `state` - set to 'in_progress' to start the task, 'completed' to finish it, 'verified' to assert that it was successful, 'abandoned' to give up on it permanently, or `open` to stop working on it for now.
  184. * `finish` - if ALL of your tasks and subtasks have been verified or abandoned, and you're absolutely certain that you've completed your task and have tested your work, use the finish action to stop working.
  185. You MUST take time to think in between read, write, run, and browse actions--do this with the `message` action.
  186. You should never act twice in a row without thinking. But if your last several
  187. actions are all `message` actions, you should consider taking a different action.
  188. What is your next thought or action? Again, you must reply with JSON, and only with JSON.
  189. You just changed a file. You should think about how it affects your plan.