@pushpalsdev/cli 1.0.18 → 1.0.20

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.
Files changed (108) hide show
  1. package/dist/pushpals-cli.js +291 -44
  2. package/package.json +1 -1
  3. package/runtime/configs/backend.toml +1 -1
  4. package/runtime/configs/default.toml +1 -1
  5. package/runtime/sandbox/apps/workerpals/.python-version +1 -0
  6. package/runtime/sandbox/apps/workerpals/Dockerfile.sandbox +71 -0
  7. package/runtime/sandbox/apps/workerpals/package.json +25 -0
  8. package/runtime/sandbox/apps/workerpals/pyproject.toml +8 -0
  9. package/runtime/sandbox/apps/workerpals/src/backends/backend_config.ts +119 -0
  10. package/runtime/sandbox/apps/workerpals/src/backends/miniswe/miniswe_executor.py +2029 -0
  11. package/runtime/sandbox/apps/workerpals/src/backends/miniswe_backend.ts +48 -0
  12. package/runtime/sandbox/apps/workerpals/src/backends/openai_codex/openai_codex_executor.py +1259 -0
  13. package/runtime/sandbox/apps/workerpals/src/backends/openai_codex/test_openai_codex_runtime_config.py +110 -0
  14. package/runtime/sandbox/apps/workerpals/src/backends/openai_codex_backend.ts +67 -0
  15. package/runtime/sandbox/apps/workerpals/src/backends/openhands/openhands_executor.py +563 -0
  16. package/runtime/sandbox/apps/workerpals/src/backends/openhands_backend.ts +161 -0
  17. package/runtime/sandbox/apps/workerpals/src/backends/openhands_task_execute.ts +536 -0
  18. package/runtime/sandbox/apps/workerpals/src/backends/shared/executor_base.py +746 -0
  19. package/runtime/sandbox/apps/workerpals/src/backends/shared/test_settings_resolver.py +60 -0
  20. package/runtime/sandbox/apps/workerpals/src/backends/task_execute_registry.ts +21 -0
  21. package/runtime/sandbox/apps/workerpals/src/backends/types.ts +52 -0
  22. package/runtime/sandbox/apps/workerpals/src/common/execution_utils.ts +149 -0
  23. package/runtime/sandbox/apps/workerpals/src/common/executor_backend.ts +15 -0
  24. package/runtime/sandbox/apps/workerpals/src/common/generic_python_executor.ts +210 -0
  25. package/runtime/sandbox/apps/workerpals/src/common/logger.ts +65 -0
  26. package/runtime/sandbox/apps/workerpals/src/common/types.ts +9 -0
  27. package/runtime/sandbox/apps/workerpals/src/common/worktree_cleanup.ts +66 -0
  28. package/runtime/sandbox/apps/workerpals/src/context_manager.ts +45 -0
  29. package/runtime/sandbox/apps/workerpals/src/docker_executor.ts +1842 -0
  30. package/runtime/sandbox/apps/workerpals/src/execute_job.ts +3063 -0
  31. package/runtime/sandbox/apps/workerpals/src/job_runner.ts +194 -0
  32. package/runtime/sandbox/apps/workerpals/src/shell_manager.ts +210 -0
  33. package/runtime/sandbox/apps/workerpals/src/timeout_policy.ts +24 -0
  34. package/runtime/sandbox/apps/workerpals/src/workerpals_main.ts +1436 -0
  35. package/runtime/sandbox/apps/workerpals/tsconfig.json +15 -0
  36. package/runtime/sandbox/apps/workerpals/uv.lock +2014 -0
  37. package/runtime/sandbox/bun.lock +2591 -0
  38. package/runtime/sandbox/configs/backend.toml +79 -0
  39. package/runtime/sandbox/configs/default.toml +260 -0
  40. package/runtime/sandbox/configs/dev.toml +2 -0
  41. package/runtime/sandbox/configs/local.example.toml +129 -0
  42. package/runtime/sandbox/package.json +65 -0
  43. package/runtime/sandbox/packages/protocol/README.md +168 -0
  44. package/runtime/sandbox/packages/protocol/package.json +37 -0
  45. package/runtime/sandbox/packages/protocol/scripts/copy-schemas.js +17 -0
  46. package/runtime/sandbox/packages/protocol/src/a2a/README.md +52 -0
  47. package/runtime/sandbox/packages/protocol/src/a2a/mapping.ts +55 -0
  48. package/runtime/sandbox/packages/protocol/src/index.browser.ts +25 -0
  49. package/runtime/sandbox/packages/protocol/src/index.ts +25 -0
  50. package/runtime/sandbox/packages/protocol/src/schemas/approvals.schema.json +6 -0
  51. package/runtime/sandbox/packages/protocol/src/schemas/envelope.schema.json +96 -0
  52. package/runtime/sandbox/packages/protocol/src/schemas/events.schema.json +679 -0
  53. package/runtime/sandbox/packages/protocol/src/schemas/http.schema.json +50 -0
  54. package/runtime/sandbox/packages/protocol/src/types.ts +267 -0
  55. package/runtime/sandbox/packages/protocol/src/validate.browser.ts +154 -0
  56. package/runtime/sandbox/packages/protocol/src/validate.ts +233 -0
  57. package/runtime/sandbox/packages/protocol/src/version.ts +1 -0
  58. package/runtime/sandbox/packages/protocol/tsconfig.json +20 -0
  59. package/runtime/sandbox/packages/shared/package.json +19 -0
  60. package/runtime/sandbox/packages/shared/src/autonomy_policy.ts +400 -0
  61. package/runtime/sandbox/packages/shared/src/client_preflight.ts +286 -0
  62. package/runtime/sandbox/packages/shared/src/communication.ts +313 -0
  63. package/runtime/sandbox/packages/shared/src/config.ts +2180 -0
  64. package/runtime/sandbox/packages/shared/src/config_template_parity.ts +70 -0
  65. package/runtime/sandbox/packages/shared/src/git_backend.ts +205 -0
  66. package/runtime/sandbox/packages/shared/src/index.ts +101 -0
  67. package/runtime/sandbox/packages/shared/src/local_network.ts +101 -0
  68. package/runtime/sandbox/packages/shared/src/localbuddy_runtime.ts +314 -0
  69. package/runtime/sandbox/packages/shared/src/prompts.ts +64 -0
  70. package/runtime/sandbox/packages/shared/src/repo.ts +134 -0
  71. package/runtime/sandbox/packages/shared/src/session_event_visibility.ts +25 -0
  72. package/runtime/sandbox/packages/shared/src/vision.ts +247 -0
  73. package/runtime/sandbox/packages/shared/tsconfig.json +16 -0
  74. package/runtime/sandbox/prompts/workerpals/codex_quality_critic_instruction_prompt.md +14 -0
  75. package/runtime/sandbox/prompts/workerpals/commit_message_prompt.md +36 -0
  76. package/runtime/sandbox/prompts/workerpals/commit_message_user_prompt.md +7 -0
  77. package/runtime/sandbox/prompts/workerpals/miniswe_broker_system_prompt.md +33 -0
  78. package/runtime/sandbox/prompts/workerpals/miniswe_broker_task_prompt.md +5 -0
  79. package/runtime/sandbox/prompts/workerpals/miniswe_completion_requirement.md +1 -0
  80. package/runtime/sandbox/prompts/workerpals/miniswe_context_compaction_retry_prompt.md +1 -0
  81. package/runtime/sandbox/prompts/workerpals/miniswe_explicit_targets_block.md +2 -0
  82. package/runtime/sandbox/prompts/workerpals/miniswe_recovery_guidance_base.md +4 -0
  83. package/runtime/sandbox/prompts/workerpals/miniswe_recovery_guidance_blocker_line.md +1 -0
  84. package/runtime/sandbox/prompts/workerpals/miniswe_strict_tool_use_guidance.md +6 -0
  85. package/runtime/sandbox/prompts/workerpals/miniswe_supplemental_guidance_section.md +2 -0
  86. package/runtime/sandbox/prompts/workerpals/miniswe_timeout_note.md +1 -0
  87. package/runtime/sandbox/prompts/workerpals/miniswe_toolcall_retry_guidance.md +1 -0
  88. package/runtime/sandbox/prompts/workerpals/openai_codex_default_system_prompt.md +4 -0
  89. package/runtime/sandbox/prompts/workerpals/openai_codex_instruction_wrapper.md +5 -0
  90. package/runtime/sandbox/prompts/workerpals/openai_codex_runtime_policy_appendix.md +5 -0
  91. package/runtime/sandbox/prompts/workerpals/openai_codex_supplemental_guidance_section.md +2 -0
  92. package/runtime/sandbox/prompts/workerpals/openai_codex_task_execute_system_prompt.md +12 -0
  93. package/runtime/sandbox/prompts/workerpals/openhands_minimal_security_policy.j2 +8 -0
  94. package/runtime/sandbox/prompts/workerpals/openhands_minimal_system_prompt.j2 +20 -0
  95. package/runtime/sandbox/prompts/workerpals/openhands_strict_tool_use_message.md +1 -0
  96. package/runtime/sandbox/prompts/workerpals/openhands_supplemental_guidance_message.md +2 -0
  97. package/runtime/sandbox/prompts/workerpals/openhands_task_execute_fallback_system_prompt.md +1 -0
  98. package/runtime/sandbox/prompts/workerpals/openhands_task_execute_system_prompt.md +21 -0
  99. package/runtime/sandbox/prompts/workerpals/openhands_task_user_prompt.md +6 -0
  100. package/runtime/sandbox/prompts/workerpals/openhands_timeout_note.md +1 -0
  101. package/runtime/sandbox/prompts/workerpals/pr_description.md +42 -0
  102. package/runtime/sandbox/prompts/workerpals/task_quality_critic_system_prompt.md +9 -0
  103. package/runtime/sandbox/prompts/workerpals/task_quality_critic_user_prompt.md +17 -0
  104. package/runtime/sandbox/prompts/workerpals/workerpals_system_prompt.md +115 -0
  105. package/runtime/sandbox/protocol/schemas/approvals.schema.json +6 -0
  106. package/runtime/sandbox/protocol/schemas/envelope.schema.json +96 -0
  107. package/runtime/sandbox/protocol/schemas/events.schema.json +679 -0
  108. package/runtime/sandbox/protocol/schemas/http.schema.json +50 -0
@@ -0,0 +1,79 @@
1
+ default_backend = "openai_codex"
2
+
3
+ [env]
4
+ shared_passthrough = [
5
+ "HTTP_PROXY",
6
+ "HTTPS_PROXY",
7
+ "NO_PROXY",
8
+ "ALL_PROXY",
9
+ "http_proxy",
10
+ "https_proxy",
11
+ "no_proxy",
12
+ "all_proxy",
13
+ "PUSHPALS_GIT_TOKEN",
14
+ "GITHUB_TOKEN",
15
+ "GH_TOKEN",
16
+ "GIT_TOKEN",
17
+ "OPENAI_API_KEY",
18
+ "OPENAI_BASE_URL",
19
+ "OPENAI_API_BASE",
20
+ "OPENAI_ORG_ID",
21
+ "OPENAI_PROJECT",
22
+ "PUSHPALS_REPO_PATH",
23
+ "WORKERPALS_DEBUG",
24
+ ]
25
+
26
+ [backends.openhands]
27
+ script_segments = ["backends", "openhands", "openhands_executor.py"]
28
+ python_config_key = "openhandsPython"
29
+ timeout_config_key = "openhandsTimeoutMs"
30
+ passthrough_env = [
31
+ "WORKERPALS_OPENHANDS_PROMPT_PROFILE",
32
+ "WORKERPALS_OPENHANDS_AGENT_MAX_STEPS",
33
+ "WORKERPALS_OPENHANDS_WORKSPACE_PYTHON",
34
+ "WORKERPALS_OPENHANDS_LLM_NUM_RETRIES",
35
+ "WORKERPALS_OPENHANDS_LLM_RETRY_MULTIPLIER",
36
+ "WORKERPALS_OPENHANDS_LLM_RETRY_MIN_WAIT",
37
+ "WORKERPALS_OPENHANDS_LLM_RETRY_MAX_WAIT",
38
+ "WORKERPALS_OPENHANDS_LLM_TIMEOUT_SEC",
39
+ "WORKERPALS_OPENHANDS_LLM_MAX_MESSAGE_CHARS",
40
+ "WORKERPALS_OPENHANDS_LLM_TIMEOUT_RECOVERY_ATTEMPTS",
41
+ "WORKERPALS_OPENHANDS_LLM_TIMEOUT_RECOVERY_BACKOFF_SEC",
42
+ "WORKERPALS_OPENHANDS_TASK_PROMPT_MODE",
43
+ "WORKERPALS_OPENHANDS_LARGE_INSTRUCTION_CHARS",
44
+ "WORKERPALS_OPENHANDS_ENABLE_BROWSER_TOOL",
45
+ "WORKERPALS_OPENHANDS_ENABLE_WEB_MCP",
46
+ "WORKERPALS_OPENHANDS_MCP_CONFIG_JSON",
47
+ "WORKERPALS_OPENHANDS_WEB_MCP_URL",
48
+ "WORKERPALS_OPENHANDS_WEB_MCP_NAME",
49
+ "WORKERPALS_OPENHANDS_WEB_MCP_TRANSPORT",
50
+ "WORKERPALS_OPENHANDS_WEB_MCP_AUTH_TOKEN",
51
+ "WORKERPALS_OPENHANDS_WEB_MCP_HEADERS_JSON",
52
+ "WORKERPALS_OPENHANDS_WEB_MCP_TIMEOUT_SEC",
53
+ ]
54
+
55
+ [backends.miniswe]
56
+ script_segments = ["backends", "miniswe", "miniswe_executor.py"]
57
+ python_config_key = "miniswePython"
58
+ timeout_config_key = "minisweTimeoutMs"
59
+ passthrough_env = [
60
+ "WORKERPALS_MINISWE_AGENT_MAX_STEPS",
61
+ "WORKERPALS_MINISWE_TOOLCALL_RETRY_MAX",
62
+ "WORKERPALS_MINISWE_TOOL_BROKER",
63
+ "WORKERPALS_MINISWE_TOOL_BROKER_MAX_STEPS",
64
+ "WORKERPALS_MINISWE_TOOL_BROKER_MAX_ACTIONS_PER_STEP",
65
+ "WORKERPALS_MINISWE_TOOL_BROKER_SHELL_TIMEOUT_SEC",
66
+ ]
67
+
68
+ [backends.openai_codex]
69
+ script_segments = ["backends", "openai_codex", "openai_codex_executor.py"]
70
+ python_config_key = "openaiCodexPython"
71
+ timeout_config_key = "openaiCodexTimeoutMs"
72
+ passthrough_env = [
73
+ "PUSHPALS_OPENAI_CODEX_BIN",
74
+ "PUSHPALS_OPENAI_CODEX_BIN_JSON",
75
+ "PUSHPALS_OPENAI_CODEX_AUTH_MODE",
76
+ "PUSHPALS_OPENAI_CODEX_BASE_URL",
77
+ "PUSHPALS_OPENAI_CODEX_HOST_CODEX_HOME",
78
+ "PUSHPALS_OPENAI_CODEX_CONTAINER_CODEX_HOME",
79
+ ]
@@ -0,0 +1,260 @@
1
+ profile = "dev"
2
+ session_id = "dev"
3
+
4
+ [llm.lmstudio]
5
+ context_window = 4096
6
+ min_output_tokens = 256
7
+ token_safety_margin = 64
8
+ batch_tail_messages = 3
9
+ batch_chunk_tokens = 0
10
+ batch_memory_chars = 0
11
+
12
+ [paths]
13
+ data_dir = "outputs/data"
14
+ shared_db_path = "outputs/data/pushpals.db"
15
+ remotebuddy_db_path = "outputs/data/remotebuddy-state.db"
16
+
17
+ [server]
18
+ url = "http://127.0.0.1:3001"
19
+ host = "127.0.0.1"
20
+ port = 3001
21
+ debug_http = false
22
+ stale_claim_ttl_ms = 120000
23
+ stale_claim_sweep_interval_ms = 5000
24
+
25
+ [localbuddy]
26
+ enabled = false
27
+ port = 3003
28
+ status_heartbeat_ms = 120000
29
+
30
+ [localbuddy.llm]
31
+ backend = "lmstudio"
32
+ endpoint = "http://127.0.0.1:1234"
33
+ model = "local-model"
34
+ session_id = "localbuddy-dev"
35
+
36
+ [remotebuddy]
37
+ poll_ms = 2000
38
+ status_heartbeat_ms = 120000
39
+ workerpal_online_ttl_ms = 15000
40
+ wait_for_workerpal_ms = 15000
41
+ auto_spawn_workerpals = true
42
+ max_workerpals = 10
43
+ workerpal_startup_timeout_ms = 10000
44
+ workerpal_docker = true
45
+ workerpal_require_docker = true
46
+ workerpal_image = ""
47
+ workerpal_poll_ms = 0
48
+ workerpal_heartbeat_ms = 0
49
+ workerpal_labels = []
50
+ execution_budget_interactive_ms = 600000
51
+ execution_budget_normal_ms = 1500000
52
+ execution_budget_background_ms = 1800000
53
+ finalization_budget_ms = 120000
54
+ crash_restart_enabled = true
55
+ crash_restart_max_restarts = 3
56
+ crash_restart_backoff_ms = 3000
57
+
58
+ [remotebuddy.memory]
59
+ enabled = true
60
+ include_cross_session = true
61
+ max_recall_items = 12
62
+ max_recall_chars = 2400
63
+ max_summary_chars = 420
64
+ retention_days = 30
65
+
66
+ [remotebuddy.llm]
67
+ backend = "lmstudio"
68
+ endpoint = "http://127.0.0.1:1234"
69
+ model = "local-model"
70
+ session_id = "remotebuddy-dev"
71
+
72
+ [remotebuddy.autonomy]
73
+ enabled = true
74
+ kill_switch_enabled = false
75
+ tick_interval_ms = 300000
76
+ heartbeat_log_ms = 30000
77
+ vision_context_max_chars = 65536
78
+ ideation_budget_ms = 20000
79
+ llm_timeout_ms = 60000
80
+ allow_dirty_worktree = false
81
+ ideation_max_candidates = 20
82
+ top_k = 3
83
+ explore_rate = 0.3
84
+ min_confidence = 0.65
85
+ max_concurrent_objectives = 2
86
+ max_dispatch_per_hour = 6
87
+ max_dispatch_per_hour_by_type = { flaky_test = 4, lint_fix = 3, type_fix = 3, small_refactor = 2, feature_small = 2, feature_medium = 1, feature_large = 0, docs = 1, dep_bump = 0 }
88
+ max_dispatch_per_hour_by_component = { "apps/server" = 3, "apps/remotebuddy" = 2, "apps/workerpals" = 2, "apps/client" = 2, "packages/protocol" = 1, "packages/shared" = 2, "tests/integration" = 2, "tests/unit" = 2 }
89
+ max_token_usage_per_hour = 120000
90
+ max_runtime_ms_per_hour = 5400000
91
+ cooldown_fail_streak_threshold = 2
92
+ cooldown_ms = 1800000
93
+ stale_objective_ttl_ms = 2700000
94
+ stale_objective_sweep_interval_ms = 60000
95
+ auto_freeze_fail_streak_threshold = 3
96
+ auto_freeze_duration_ms = 1800000
97
+ evaluator_window_hours = 24
98
+ evaluator_min_samples = 6
99
+ evaluator_min_success_rate = 0.45
100
+ evaluator_max_regret_rate = 0.35
101
+ evaluator_run_interval_ms = 120000
102
+ alert_queue_pending_threshold = 20
103
+ alert_job_failure_rate_threshold = 0.3
104
+ alert_autonomy_failure_rate_threshold = 0.45
105
+ allow_read_anywhere = true
106
+ pr_feedback_comment_rows = 16
107
+ pr_feedback_comment_chars = 600
108
+ pr_feedback_summary_chars = 600
109
+ question_ttl_ms = 259200000
110
+ policy_version = "policy-v3.3"
111
+ impact_model_version = "impact-v1"
112
+
113
+ [remotebuddy.autonomy.replay]
114
+ store_prompt_payloads = false
115
+ max_runs_with_payloads = 50
116
+ max_payload_bytes = 262144
117
+
118
+ [workerpals]
119
+ poll_ms = 2000
120
+ heartbeat_ms = 5000
121
+ executor = "openai_codex"
122
+ openhands_python = "python"
123
+ openhands_timeout_ms = 1800000
124
+ miniswe_python = "python"
125
+ miniswe_timeout_ms = 1800000
126
+ openai_codex_python = "python"
127
+ openai_codex_timeout_ms = 7200000
128
+ openhands_stuck_guard_enabled = true
129
+ openhands_stuck_guard_explore_limit = 18
130
+ openhands_stuck_guard_min_elapsed_ms = 180000
131
+ openhands_stuck_guard_broad_scan_limit = 2
132
+ openhands_stuck_guard_no_progress_max_ms = 300000
133
+ require_push = false
134
+ push_agent_branch = false
135
+ require_docker = false
136
+ skip_docker_self_check = false
137
+ docker_image = "pushpals-worker-sandbox:latest"
138
+ docker_timeout_ms = 7260000
139
+ docker_idle_timeout_ms = 600000
140
+ docker_agent_startup_timeout_ms = 45000
141
+ docker_warm_max_attempts = 3
142
+ docker_warm_retry_backoff_ms = 2000
143
+ docker_job_max_attempts = 2
144
+ docker_job_retry_backoff_ms = 3000
145
+ docker_warm_memory_mb = 2048
146
+ docker_warm_cpus = 2
147
+ file_modifying_jobs = ["task.execute"]
148
+ output_max_chars = 196608
149
+ output_max_lines = 600
150
+ output_max_head_lines = 120
151
+ quality_max_auto_revisions = 1
152
+ quality_validation_step_timeout_ms = 180000
153
+ quality_critic_timeout_ms = 45000
154
+ quality_soft_pass_on_exhausted = true
155
+ quality_critic_min_score = 8.0
156
+ quality_critic_max_diff_chars = 16000
157
+ quality_critic_max_validation_output_chars = 8000
158
+ executor_result_prefix = "__PUSHPALS_OH_RESULT__ "
159
+ docker_network_mode = "bridge"
160
+ base_ref = "origin/main_agents"
161
+ labels = []
162
+ failure_cooldown_ms = 20000
163
+
164
+ [workerpals.openhands]
165
+ workspace_python = "python3"
166
+ agent_server_url = ""
167
+ prompt_profile = "auto"
168
+ task_prompt_mode = "none"
169
+ large_instruction_chars = 1800
170
+ enable_web_mcp = false
171
+ web_mcp_url = ""
172
+ web_mcp_name = "web-search"
173
+ web_mcp_transport = "streamable-http"
174
+ web_mcp_timeout_sec = 0
175
+ enable_browser_tool = false
176
+ lmstudio_slot_id = -1
177
+ llm_num_retries = 2
178
+ llm_retry_multiplier = 1.5
179
+ llm_retry_min_wait = 1
180
+ llm_retry_max_wait = 4
181
+ llm_timeout_sec = 240
182
+ llm_max_message_chars = 8000
183
+ llm_timeout_recovery_attempts = 2
184
+ llm_timeout_recovery_backoff_sec = 5
185
+ agent_max_steps = 30
186
+ auto_steer_enabled = true
187
+ auto_steer_initial_delay_sec = 90
188
+ auto_steer_interval_sec = 60
189
+ auto_steer_max_nudges = 30
190
+
191
+ [workerpals.llm]
192
+ backend = "lmstudio"
193
+ endpoint = "http://127.0.0.1:1234"
194
+ model = "local-model"
195
+ session_id = "workerpals-dev"
196
+
197
+ [workerpals.openai_codex]
198
+ timeout_ms = 7200000
199
+ progress_log_interval_s = 30
200
+ reasoning_effort = "high"
201
+ approval_policy = "never"
202
+ sandbox = "workspace-write"
203
+ color = "never"
204
+ json = true
205
+
206
+ [source_control_manager]
207
+ repo_path = ".worktrees/source_control_manager"
208
+ remote = "origin"
209
+ pushpals_branch = "main_agents"
210
+ base_branch = "main"
211
+ branch_prefix = "agent/"
212
+ poll_interval_seconds = 10
213
+ checks = []
214
+ state_dir = "outputs/data/source_control_manager"
215
+ port = 3002
216
+ delete_after_merge = false
217
+ max_attempts = 3
218
+ merge_strategy = "cherry-pick"
219
+ push_main_after_merge = true
220
+ open_pr_after_push = true
221
+ pr_base_branch = "main"
222
+ pr_title = ""
223
+ pr_body = ""
224
+ pr_draft = false
225
+ status_heartbeat_ms = 120000
226
+ skip_clean_check = false
227
+ auto_create_main_branch = false
228
+
229
+ [source_control_manager.review_agent]
230
+ enabled = false
231
+ poll_interval_ms = 60000
232
+ reviewer_md_path = "prompts/review_agent/reviewer.md"
233
+ pass_threshold = 9.5
234
+ max_pr_comments_before_give_up = 10
235
+ merge_method = "squash"
236
+ codex_auth_mode = "chatgpt"
237
+ codex_bin = "bun x --yes @openai/codex"
238
+ codex_home_dir = ""
239
+ codex_timeout_ms = 300000
240
+
241
+ [startup]
242
+ worker_image_rebuild = "auto"
243
+ log_config_on_start = true
244
+ sync_integration_with_main = true
245
+ skip_llm_preflight = false
246
+ auto_start_lmstudio = true
247
+ lmstudio_ready_timeout_ms = 120000
248
+ lmstudio_cli = "lms"
249
+ lmstudio_port = 1234
250
+ lmstudio_start_args = ""
251
+ startup_warmup = true
252
+ startup_warmup_timeout_ms = 120000
253
+ startup_warmup_poll_ms = 1000
254
+ allow_external_clean = false
255
+ port_preflight = true
256
+ port_conflict_policy = "terminate_pushpals"
257
+
258
+ [client]
259
+ local_agent_url = "http://127.0.0.1:3003"
260
+ trace_tail_lines = 100
@@ -0,0 +1,2 @@
1
+ [source_control_manager]
2
+ skip_clean_check = true
@@ -0,0 +1,129 @@
1
+ # Copy this file to configs/local.toml for machine-specific, non-secret overrides.
2
+ # Keep secrets in .env (or CI secret store), not in TOML.
3
+
4
+ # Uncomment to enable LocalBuddy when using `bun run start`.
5
+ # The `bun run start` supervisor applies `localbuddy.enabled` changes live.
6
+ # [localbuddy]
7
+ # enabled = true
8
+
9
+ [localbuddy.llm]
10
+ backend = "openai_codex"
11
+ model = "gpt-5-codex"
12
+ codex_auth_mode = "chatgpt"
13
+ codex_bin = "bun x --yes @openai/codex"
14
+ codex_timeout_ms = 120000
15
+ reasoning_effort = "high"
16
+
17
+ [remotebuddy.llm]
18
+ backend = "openai_codex"
19
+ model = "gpt-5-codex"
20
+ codex_auth_mode = "chatgpt"
21
+ codex_bin = "bun x --yes @openai/codex"
22
+ codex_timeout_ms = 120000
23
+ reasoning_effort = "high"
24
+
25
+ [remotebuddy]
26
+ max_workerpals = 10
27
+ crash_restart_enabled = true
28
+ crash_restart_max_restarts = 3
29
+ crash_restart_backoff_ms = 3000
30
+
31
+ [remotebuddy.autonomy]
32
+ llm_timeout_ms = 60000
33
+ allow_dirty_worktree = false
34
+
35
+ [remotebuddy.memory]
36
+ enabled = true
37
+ include_cross_session = true
38
+ max_recall_items = 12
39
+ max_recall_chars = 2400
40
+ max_summary_chars = 420
41
+ retention_days = 30
42
+
43
+ [workerpals.llm]
44
+ backend = "openai_codex"
45
+ model = "gpt-5-codex"
46
+ codex_auth_mode = "chatgpt"
47
+ codex_bin = "bun x --yes @openai/codex"
48
+ codex_timeout_ms = 120000
49
+ reasoning_effort = "high"
50
+
51
+ [workerpals]
52
+ executor = "openai_codex"
53
+ docker_image = "pushpals-worker-sandbox:latest"
54
+ openhands_timeout_ms = 1800000
55
+ openai_codex_timeout_ms = 7200000
56
+ docker_timeout_ms = 7260000
57
+ openhands_stuck_guard_enabled = true
58
+ openhands_stuck_guard_explore_limit = 18
59
+ openhands_stuck_guard_min_elapsed_ms = 180000
60
+ openhands_stuck_guard_broad_scan_limit = 2
61
+ openhands_stuck_guard_no_progress_max_ms = 300000
62
+ docker_warm_memory_mb = 2048
63
+ docker_warm_cpus = 2
64
+ file_modifying_jobs = ["task.execute"]
65
+ output_max_chars = 196608
66
+ output_max_lines = 600
67
+ output_max_head_lines = 120
68
+ quality_max_auto_revisions = 1
69
+ quality_validation_step_timeout_ms = 180000
70
+ quality_critic_timeout_ms = 45000
71
+ quality_soft_pass_on_exhausted = true
72
+ quality_critic_min_score = 8.0
73
+ quality_critic_max_diff_chars = 16000
74
+ quality_critic_max_validation_output_chars = 8000
75
+ executor_result_prefix = "__PUSHPALS_OH_RESULT__ "
76
+
77
+ [workerpals.openhands]
78
+ prompt_profile = "minimal"
79
+ llm_timeout_sec = 180
80
+ llm_max_message_chars = 12000
81
+ llm_timeout_recovery_attempts = 2
82
+ llm_timeout_recovery_backoff_sec = 5
83
+ agent_max_steps = 30
84
+ auto_steer_enabled = true
85
+ auto_steer_initial_delay_sec = 90
86
+ auto_steer_interval_sec = 60
87
+ auto_steer_max_nudges = 30
88
+
89
+ [workerpals.openai_codex]
90
+ auth_mode = "chatgpt"
91
+ bin = "bun x --yes @openai/codex"
92
+ timeout_ms = 7200000
93
+ progress_log_interval_s = 30
94
+ # timeout_s = 120 # optional; if set, overrides timeout_ms
95
+ reasoning_effort = "high"
96
+ approval_policy = "never"
97
+ sandbox = "workspace-write"
98
+ color = "never"
99
+ json = true
100
+
101
+ [llm.lmstudio]
102
+ context_window = 4096
103
+ min_output_tokens = 256
104
+ batch_tail_messages = 3
105
+
106
+ [source_control_manager]
107
+ repo_path = ".worktrees/source_control_manager"
108
+ pushpals_branch = "main_agents"
109
+ base_branch = "main"
110
+ checks = []
111
+
112
+ [source_control_manager.review_agent]
113
+ enabled = true
114
+ poll_interval_ms = 60000
115
+ reviewer_md_path = "prompts/review_agent/reviewer.md"
116
+ pass_threshold = 8.1
117
+ max_pr_comments_before_give_up = 10
118
+ merge_method = "squash"
119
+ codex_auth_mode = "chatgpt"
120
+ codex_bin = "bun x --yes @openai/codex"
121
+ codex_home_dir = ""
122
+ codex_timeout_ms = 300000
123
+
124
+ [startup]
125
+ log_config_on_start = true
126
+ startup_warmup = true
127
+ lmstudio_ready_timeout_ms = 120000
128
+ port_preflight = true
129
+ port_conflict_policy = "terminate_pushpals" # fail|terminate_pushpals
@@ -0,0 +1,65 @@
1
+ {
2
+ "name": "pushpals",
3
+ "private": true,
4
+ "workspaces": [
5
+ "apps/*",
6
+ "packages/*"
7
+ ],
8
+ "scripts": {
9
+ "cli": "bun run scripts/pushpals-cli.ts",
10
+ "cli:integration": "bun run scripts/cli-integration.ts",
11
+ "cli:bundle": "bun run --cwd packages/cli build",
12
+ "cli:monitor:export": "bun run scripts/sync-cli-monitor-ui.ts",
13
+ "protocol:build": "bun --cwd packages/protocol build",
14
+ "protocol:typecheck": "bun --cwd packages/protocol typecheck",
15
+ "server:only": "bun --cwd apps/server --env-file ../../.env dev",
16
+ "client:only": "bun run scripts/start-client.ts",
17
+ "client:only:offline": "bun run scripts/start-client.ts --offline",
18
+ "web:only": "bun --cwd apps/client web",
19
+ "ios:only": "bun --cwd apps/client ios",
20
+ "android:only": "bun --cwd apps/client android",
21
+ "localbuddy:only": "bun --cwd apps/localbuddy --env-file ../../.env dev",
22
+ "workerpals:only": "bun --cwd apps/workerpals --env-file ../../.env start",
23
+ "workerpals:only:watch": "bun --cwd apps/workerpals --env-file ../../.env dev",
24
+ "workerpals:only:docker": "bun --cwd apps/workerpals --env-file ../../.env start -- --docker --require-docker",
25
+ "workerpals:only:docker:watch": "bun --cwd apps/workerpals --env-file ../../.env dev -- --docker --require-docker",
26
+ "source_control_manager:only": "bun --cwd apps/source_control_manager --env-file ../../.env start",
27
+ "source_control_manager:only:dev": "bun --cwd apps/source_control_manager --env-file ../../.env start -- --skip-clean-check",
28
+ "remotebuddy:only": "bun --cwd apps/remotebuddy --env-file ../../.env start",
29
+ "remotebuddy:only:watch": "bun --cwd apps/remotebuddy --env-file ../../.env dev",
30
+ "server": "bun run protocol:build && bun run server:only",
31
+ "client": "bun run protocol:build && bun run client:only",
32
+ "web": "bun run protocol:build && bun run web:only",
33
+ "ios": "bun run protocol:build && bun run ios:only",
34
+ "android": "bun run protocol:build && bun run android:only",
35
+ "localbuddy": "bun run protocol:build && bun run localbuddy:only",
36
+ "workerpals": "bun run protocol:build && bun run workerpals:only",
37
+ "source_control_manager": "bun run protocol:build && bun run source_control_manager:only",
38
+ "remotebuddy": "bun run protocol:build && bun run remotebuddy:only",
39
+ "dev": "bun run protocol:build && concurrently -p \"[{time}][{name}]\" -t \"HH:mm:ss\" -n server,client -c blue,green \"bun run server:only\" \"bun run client:only\"",
40
+ "dev:full": "bun run protocol:build && concurrently -p \"[{time}][{name}]\" -t \"HH:mm:ss\" -n server,localbuddy,remotebuddy,workerpals,source_control_manager,client -c blue,magenta,red,yellow,cyan,green \"bun run server:only\" \"bun run localbuddy:only\" \"bun run remotebuddy:only\" \"bun run workerpals:only:docker\" \"bun run source_control_manager:only:dev\" \"bun run client:only:offline\"",
41
+ "start": "bun run scripts/start.ts",
42
+ "lint": "bun --cwd apps/client lint",
43
+ "format": "prettier --write .",
44
+ "format:check": "prettier --check .",
45
+ "test:prompt-policy": "bun test tests/prompt-policy.enforcement.test.ts",
46
+ "test:cli:integration": "bun test tests/cli.invocation-logging.test.ts tests/cli.runtime-bootstrap.test.ts tests/client.runtime-bootstrap.test.ts tests/shared.client-preflight.test.ts",
47
+ "test:root": "bun test tests",
48
+ "test:protocol": "bun run tests/protocol.integration.ts",
49
+ "test:integration": "python -u tests/integration/integration_controller.py --mode integration",
50
+ "test:integration:eval": "python -u tests/integration/integration_controller.py --mode eval",
51
+ "test": "bun run test:prompt-policy && bun run test:root && bun run test:protocol",
52
+ "smoke": "bun run scripts/smoke-test.ts",
53
+ "vscode:client:compile": "bun run --cwd apps/vscode-client compile",
54
+ "vscode:client:lint": "bun run --cwd apps/vscode-client lint",
55
+ "vscode:client:test": "bun run --cwd apps/vscode-client test",
56
+ "vscode:client:package": "bun run --cwd apps/vscode-client package"
57
+ },
58
+ "bin": {
59
+ "pushpals": "./scripts/pushpals-cli.ts"
60
+ },
61
+ "devDependencies": {
62
+ "concurrently": "^9.2.1",
63
+ "prettier": "^3.8.1"
64
+ }
65
+ }
@@ -0,0 +1,168 @@
1
+ # PushPals Protocol (v0.1.0)
2
+
3
+ A shared, versioned protocol package for PushPals event streaming over both SSE (web) and WebSocket (mobile/desktop).
4
+
5
+ ## Overview
6
+
7
+ The protocol defines:
8
+
9
+ - **JSON Schemas** for all events and HTTP contracts
10
+ - **TypeScript types** generated from/validated against schemas
11
+ - **Runtime validators** (AJV-based) for both server and client
12
+ - **A2A adapter scaffolding** for future Agent-to-Agent integration
13
+
14
+ ## Files
15
+
16
+ - `src/version.ts` - Protocol version constant (0.1.0)
17
+ - `src/types.ts` - TypeScript type definitions
18
+ - `src/validate.ts` - Runtime validators (Ajv)
19
+ - `src/index.ts` - Public API
20
+ - `src/schemas/` - JSON Schema definitions
21
+ - `envelope.schema.json` - Base event envelope structure
22
+ - `events.schema.json` - Event type discriminator + payloads
23
+ - `http.schema.json` - HTTP request/response contracts
24
+ - `approvals.schema.json` - Approval workflow schemas
25
+ - `src/a2a/` - A2A adapter scaffolding (future)
26
+ - `README.md` - Architecture notes
27
+ - `mapping.ts` - Placeholder interfaces
28
+
29
+ ## Event Types
30
+
31
+ All events conform to `EventEnvelope`:
32
+
33
+ ```typescript
34
+ {
35
+ protocolVersion: "0.1.0",
36
+ id: string, // UUID or other unique ID
37
+ ts: string, // ISO-8601 timestamp
38
+ sessionId: string, // Session identifier
39
+ type: EventType, // Discriminator
40
+ traceId?: string, // Optional for debugging
41
+ payload: Record<string, unknown>
42
+ }
43
+ ```
44
+
45
+ ### Supported Types
46
+
47
+ - `log` - Debug/info/warn/error logging
48
+ - `scan_result` - Repository scan results
49
+ - `suggestions` - List of actionable suggestions
50
+ - `diff_ready` - Diff and stat information
51
+ - `approval_required` - Awaiting human approval
52
+ - `approved` / `denied` - Approval decisions
53
+ - `committed` - Git commit result
54
+ - `error` - Error event
55
+ - `done` - Workflow completed
56
+
57
+ ## Usage
58
+
59
+ ### In Server (apps/server)
60
+
61
+ ```typescript
62
+ import { EventEnvelope, validateEventEnvelope, PROTOCOL_VERSION } from "protocol";
63
+
64
+ const envelope: EventEnvelope = {
65
+ protocolVersion: PROTOCOL_VERSION,
66
+ id: randomUUID(),
67
+ ts: new Date().toISOString(),
68
+ sessionId: "...",
69
+ type: "log",
70
+ payload: { level: "info", message: "Hello" },
71
+ };
72
+
73
+ const validation = validateEventEnvelope(envelope);
74
+ if (validation.ok) {
75
+ // Send via SSE or WebSocket
76
+ }
77
+ ```
78
+
79
+ ### In Client (apps/client)
80
+
81
+ ```typescript
82
+ import { subscribeEvents } from "./lib/pushpalsApi";
83
+
84
+ subscribeEvents("http://localhost:3001", sessionId, (event) => {
85
+ if (event.type === "_error") {
86
+ console.error(event.message);
87
+ return;
88
+ }
89
+
90
+ console.log(`Event: ${event.type}`, event.payload);
91
+ });
92
+ ```
93
+
94
+ ## HTTP Contracts
95
+
96
+ ### POST /sessions
97
+
98
+ **Response:**
99
+
100
+ ```json
101
+ { "sessionId": "uuid", "protocolVersion": "0.1.0" }
102
+ ```
103
+
104
+ ### POST /sessions/:id/message
105
+
106
+ **Request:**
107
+
108
+ ```json
109
+ { "text": "user input" }
110
+ ```
111
+
112
+ **Response:**
113
+
114
+ ```json
115
+ { "ok": true }
116
+ ```
117
+
118
+ ### POST /approvals/:approvalId
119
+
120
+ **Request:**
121
+
122
+ ```json
123
+ { "decision": "approve" | "deny" }
124
+ ```
125
+
126
+ **Response:**
127
+
128
+ ```json
129
+ { "ok": true }
130
+ ```
131
+
132
+ ### GET /sessions/:id/events (SSE)
133
+
134
+ Content-Type: `text/event-stream`
135
+
136
+ ```
137
+ event: message
138
+ data: <JSON EventEnvelope>
139
+ ```
140
+
141
+ ### GET /sessions/:id/ws (WebSocket)
142
+
143
+ Sends EventEnvelope as JSON messages.
144
+
145
+ ## Validation
146
+
147
+ All validators are compiled at module load time for performance:
148
+
149
+ ```typescript
150
+ import {
151
+ validateEventEnvelope,
152
+ validateMessageRequest,
153
+ validateApprovalDecisionRequest,
154
+ } from "protocol";
155
+
156
+ const result = validateEventEnvelope(data);
157
+ if (!result.ok) {
158
+ console.error("Validation errors:", result.errors);
159
+ }
160
+ ```
161
+
162
+ ## Notes
163
+
164
+ - Protocol version is pinned to **0.1.0** across all envelopes
165
+ - Event IDs should be UUIDs for traceability
166
+ - All times are ISO-8601 UTC
167
+ - The protocol is immutable; changes require a version bump
168
+ - A2A integration is future work; see `src/a2a/README.md`