@profoundlogic/coderflow-server 0.7.9 → 0.8.1
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/dist/base-image/coder-git-credential-helper +16 -0
- package/dist/base-image/entrypoint.sh +75 -5
- package/dist/base-image/sync-repos.sh +30 -1
- package/dist/coder-server.js +1 -1
- package/dist/config.js +1 -1
- package/dist/lib/agent-keepalive.js +1 -1
- package/dist/lib/agent-models.js +1 -1
- package/dist/lib/api-keys.js +1 -1
- package/dist/lib/apiKeys.js +1 -1
- package/dist/lib/app-server-ports.js +1 -1
- package/dist/lib/auto-judge.js +1 -1
- package/dist/lib/automation-service.js +1 -1
- package/dist/lib/basic-auth.js +1 -1
- package/dist/lib/bindings.js +1 -1
- package/dist/lib/build-history.js +1 -1
- package/dist/lib/build-output-service.js +1 -1
- package/dist/lib/build-scheduler.js +1 -1
- package/dist/lib/build-service.js +1 -1
- package/dist/lib/ca-certificates.js +1 -1
- package/dist/lib/claude-oauth-refresh.js +1 -1
- package/dist/lib/cli/build.js +1 -1
- package/dist/lib/cli/cleanup-users.js +1 -1
- package/dist/lib/cli/config-command.js +1 -1
- package/dist/lib/cli/config.js +1 -1
- package/dist/lib/cli/create-user.js +1 -1
- package/dist/lib/cli/grant-admin.js +1 -1
- package/dist/lib/cli/init.js +1 -1
- package/dist/lib/cli/jira.js +1 -1
- package/dist/lib/cli/license.js +1 -1
- package/dist/lib/cli/list-roles.js +1 -1
- package/dist/lib/cli/list-users.js +1 -1
- package/dist/lib/cli/server-manager.js +1 -1
- package/dist/lib/cli/set-password.js +1 -1
- package/dist/lib/compression-filter.js +1 -1
- package/dist/lib/config-migration.js +1 -1
- package/dist/lib/container-credential-sync.js +1 -1
- package/dist/lib/container-tokens.js +1 -1
- package/dist/lib/data-dir.js +1 -1
- package/dist/lib/deployment-history.js +1 -1
- package/dist/lib/deployment-service.js +1 -1
- package/dist/lib/docker-utils.js +1 -1
- package/dist/lib/email.js +1 -1
- package/dist/lib/emailTemplates.js +1 -1
- package/dist/lib/entitlement.js +1 -1
- package/dist/lib/external-connections.js +1 -1
- package/dist/lib/fetch-utils.js +1 -1
- package/dist/lib/git-commit-details-route.js +1 -1
- package/dist/lib/git-history-diff-guardrails.js +1 -1
- package/dist/lib/git-provider-service.js +1 -1
- package/dist/lib/git-provider-setup/github-setup-handler.js +1 -1
- package/dist/lib/git-provider-setup/index.js +1 -1
- package/dist/lib/git-provider-setup/setup-factory.js +1 -1
- package/dist/lib/git-provider-setup/setup-interface.js +1 -1
- package/dist/lib/git-providers/azure-devops-provider.js +1 -1
- package/dist/lib/git-providers/github-app-provider.js +1 -1
- package/dist/lib/git-providers/index.js +1 -1
- package/dist/lib/git-providers/provider-factory.js +1 -1
- package/dist/lib/git-providers/provider-interface.js +1 -1
- package/dist/lib/github-urls.js +1 -1
- package/dist/lib/group-objective-linking.js +1 -1
- package/dist/lib/ibmi-sync.js +1 -1
- package/dist/lib/jira-client.js +1 -1
- package/dist/lib/judge-blinding.js +1 -1
- package/dist/lib/logger.js +1 -1
- package/dist/lib/memory-utils.js +1 -1
- package/dist/lib/migration-to-scoped-rbac.js +1 -1
- package/dist/lib/model-fetcher.js +1 -1
- package/dist/lib/notifications.js +1 -1
- package/dist/lib/objective-context.js +1 -1
- package/dist/lib/oidc-auth.js +1 -1
- package/dist/lib/oidc-device-flow.js +1 -1
- package/dist/lib/passwordTokens.js +1 -1
- package/dist/lib/permission-resolver.js +1 -1
- package/dist/lib/pin-cascade.js +1 -1
- package/dist/lib/provider-accounts.js +1 -1
- package/dist/lib/provider-oauth.js +1 -1
- package/dist/lib/provider-profile.js +1 -1
- package/dist/lib/provider-token-refresh.js +1 -1
- package/dist/lib/rbac-user-state.js +1 -1
- package/dist/lib/request-url.js +1 -1
- package/dist/lib/rewind.js +1 -1
- package/dist/lib/role-definitions.js +1 -1
- package/dist/lib/roles.js +1 -1
- package/dist/lib/secrets.js +1 -1
- package/dist/lib/setup-repo-git-auth.js +1 -1
- package/dist/lib/state-capture.js +1 -1
- package/dist/lib/static-files.js +1 -1
- package/dist/lib/task-aliases.js +1 -1
- package/dist/lib/task-container-init.js +1 -0
- package/dist/lib/task-context-usage.js +1 -0
- package/dist/lib/task-name-format.js +1 -1
- package/dist/lib/task-name-generator.js +1 -1
- package/dist/lib/task-source-metadata.js +1 -1
- package/dist/lib/teams.js +1 -1
- package/dist/lib/user-git-oauth.js +1 -1
- package/dist/lib/user-git-tokens.js +1 -1
- package/dist/lib/users.js +1 -1
- package/dist/middleware/requireAuth.js +1 -1
- package/dist/middleware/requireInit.js +1 -1
- package/dist/middleware/requirePermission.js +1 -1
- package/dist/package.json +1 -1
- package/dist/playwright.config.js +1 -1
- package/dist/playwright.task-terminal.config.js +1 -1
- package/dist/routes/apiKeys.js +1 -1
- package/dist/routes/auth-oidc.js +1 -1
- package/dist/routes/auth.js +1 -1
- package/dist/routes/automations.js +1 -1
- package/dist/routes/bindings.js +1 -1
- package/dist/routes/build.js +1 -1
- package/dist/routes/containers.js +1 -1
- package/dist/routes/deploy-task.js +1 -1
- package/dist/routes/environment-management.js +1 -1
- package/dist/routes/environments.js +1 -1
- package/dist/routes/external-skills.js +1 -1
- package/dist/routes/git-credentials.js +1 -1
- package/dist/routes/git-oauth.js +1 -1
- package/dist/routes/git-provider-setup.js +1 -1
- package/dist/routes/health.js +1 -1
- package/dist/routes/jira.js +1 -1
- package/dist/routes/logs.js +1 -1
- package/dist/routes/objective-management.js +1 -1
- package/dist/routes/password.js +1 -1
- package/dist/routes/prompt.js +1 -1
- package/dist/routes/provider-auth.js +1 -1
- package/dist/routes/qa.js +1 -1
- package/dist/routes/roles.js +1 -1
- package/dist/routes/settings.js +1 -1
- package/dist/routes/skill-management.js +1 -1
- package/dist/routes/skills.js +1 -1
- package/dist/routes/stats.js +1 -1
- package/dist/routes/tasks.js +1 -1
- package/dist/routes/teams.js +1 -1
- package/dist/routes/templates.js +1 -1
- package/dist/routes/test-task.js +1 -1
- package/dist/routes/test.js +1 -1
- package/dist/routes/users.js +1 -1
- package/dist/routes/visualizations.js +1 -1
- package/dist/scripts/create-user.js +1 -1
- package/dist/scripts/migrate-config-to-data-dir.js +1 -1
- package/dist/start.js +1 -1
- package/dist/web-ui/public/activity-detail-modal.js +1 -1
- package/dist/web-ui/public/activity-feed.js +1 -1
- package/dist/web-ui/public/activity-formatters.js +1 -1
- package/dist/web-ui/public/admin.css +95 -1
- package/dist/web-ui/public/admin.html +29 -1
- package/dist/web-ui/public/admin.js +1 -1
- package/dist/web-ui/public/agent-event-parser.js +1 -1
- package/dist/web-ui/public/app.js +1 -1
- package/dist/web-ui/public/approve-dialog.js +1 -1
- package/dist/web-ui/public/automation-links.js +1 -1
- package/dist/web-ui/public/automation-schedule.js +1 -1
- package/dist/web-ui/public/comments-widget.js +1 -1
- package/dist/web-ui/public/diff-utils.js +1 -1
- package/dist/web-ui/public/environments.js +1 -1
- package/dist/web-ui/public/feedback-widget.css +45 -0
- package/dist/web-ui/public/feedback-widget.js +1 -1
- package/dist/web-ui/public/file-selection-tree.js +1 -1
- package/dist/web-ui/public/git-history-lazy-utils.js +1 -1
- package/dist/web-ui/public/git-history.js +1 -1
- package/dist/web-ui/public/git-status.js +1 -1
- package/dist/web-ui/public/ibmi-file-filter.js +1 -1
- package/dist/web-ui/public/index.js +1 -1
- package/dist/web-ui/public/login.js +1 -1
- package/dist/web-ui/public/markdown-editor.js +1 -1
- package/dist/web-ui/public/markdown-file-editor.js +1 -1
- package/dist/web-ui/public/modal-maximize.js +1 -1
- package/dist/web-ui/public/notifications.js +1 -1
- package/dist/web-ui/public/permissions.js +1 -1
- package/dist/web-ui/public/pr-dialog.js +1 -1
- package/dist/web-ui/public/roles.js +1 -1
- package/dist/web-ui/public/settings.js +1 -1
- package/dist/web-ui/public/setup-password.js +1 -1
- package/dist/web-ui/public/skills.js +1 -1
- package/dist/web-ui/public/sse-client.js +1 -1
- package/dist/web-ui/public/sse-shared-worker.js +1 -1
- package/dist/web-ui/public/styles.css +81 -0
- package/dist/web-ui/public/task-judging-helpers.js +1 -1
- package/dist/web-ui/public/task.html +35 -1
- package/dist/web-ui/public/task.js +1 -1
- package/dist/web-ui/public/teams.js +1 -1
- package/dist/web-ui/public/terminal.js +1 -1
- package/dist/web-ui/public/theme.js +1 -1
- package/dist/web-ui/public/users.js +1 -1
- package/dist/web-ui/public/variant-grouping.js +1 -1
- package/package.json +1 -1
|
@@ -197,6 +197,22 @@ fetch_from_server() {
|
|
|
197
197
|
if [ "$http_code" != "200" ]; then
|
|
198
198
|
debug_log "Server returned HTTP $http_code"
|
|
199
199
|
debug_log "Response: $response"
|
|
200
|
+
|
|
201
|
+
# Surface actionable errors to the user via stderr
|
|
202
|
+
local error_code error_message
|
|
203
|
+
error_code=$(echo "$response" | jq -r '.error_code // empty' 2>/dev/null)
|
|
204
|
+
error_message=$(echo "$response" | jq -r '.message // empty' 2>/dev/null)
|
|
205
|
+
|
|
206
|
+
if [ "$error_code" = "oauth_token_expired" ]; then
|
|
207
|
+
echo "[coderflow] Git authentication has expired for this repository." >&2
|
|
208
|
+
echo "[coderflow] Please reconnect your Git account in Settings > Git Connections." >&2
|
|
209
|
+
elif [ "$error_code" = "user_not_connected" ]; then
|
|
210
|
+
echo "[coderflow] Git account not connected for this repository." >&2
|
|
211
|
+
echo "[coderflow] Please connect your account in Settings > Git Connections." >&2
|
|
212
|
+
elif [ -n "$error_message" ]; then
|
|
213
|
+
echo "[coderflow] Credential error: $error_message" >&2
|
|
214
|
+
fi
|
|
215
|
+
|
|
200
216
|
return 1
|
|
201
217
|
fi
|
|
202
218
|
|
|
@@ -51,6 +51,39 @@ log_success() {
|
|
|
51
51
|
log "SUCCESS: $*"
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
+
write_task_status() {
|
|
55
|
+
local phase="$1"
|
|
56
|
+
local progress="$2"
|
|
57
|
+
local stage="${3:-}"
|
|
58
|
+
local error_message="${4:-}"
|
|
59
|
+
|
|
60
|
+
if [ -n "$stage" ] || [ -n "$error_message" ]; then
|
|
61
|
+
jq -n \
|
|
62
|
+
--argjson progress "$progress" \
|
|
63
|
+
--arg phase "$phase" \
|
|
64
|
+
--arg updated_at "$(date -Iseconds)" \
|
|
65
|
+
--arg stage "$stage" \
|
|
66
|
+
--arg error "$error_message" \
|
|
67
|
+
'{
|
|
68
|
+
progress: $progress,
|
|
69
|
+
phase: $phase,
|
|
70
|
+
updated_at: $updated_at
|
|
71
|
+
}
|
|
72
|
+
+ (if $stage != "" then {stage: $stage} else {} end)
|
|
73
|
+
+ (if $error != "" then {error: $error} else {} end)' > "$TASK_OUTPUT_DIR/.status"
|
|
74
|
+
else
|
|
75
|
+
jq -n \
|
|
76
|
+
--argjson progress "$progress" \
|
|
77
|
+
--arg phase "$phase" \
|
|
78
|
+
--arg updated_at "$(date -Iseconds)" \
|
|
79
|
+
'{
|
|
80
|
+
progress: $progress,
|
|
81
|
+
phase: $phase,
|
|
82
|
+
updated_at: $updated_at
|
|
83
|
+
}' > "$TASK_OUTPUT_DIR/.status"
|
|
84
|
+
fi
|
|
85
|
+
}
|
|
86
|
+
|
|
54
87
|
# Enhanced timing function with millisecond precision (only when DEBUG_TIMING is enabled)
|
|
55
88
|
log_timing() {
|
|
56
89
|
if [ "${DEBUG_TIMING:-false}" = "true" ]; then
|
|
@@ -170,6 +203,7 @@ update_repositories() {
|
|
|
170
203
|
|
|
171
204
|
# Array to store background job PIDs
|
|
172
205
|
declare -a update_pids=()
|
|
206
|
+
local failed_count=0
|
|
173
207
|
|
|
174
208
|
# Process each repository using jq
|
|
175
209
|
for index in $(seq 0 $((repo_count - 1))); do
|
|
@@ -178,6 +212,7 @@ update_repositories() {
|
|
|
178
212
|
|
|
179
213
|
if [ -z "$repo_json" ] || [ "$repo_json" = "null" ]; then
|
|
180
214
|
log_error "Invalid repository configuration at index $index" >&2
|
|
215
|
+
failed_count=$((failed_count + 1))
|
|
181
216
|
continue
|
|
182
217
|
fi
|
|
183
218
|
|
|
@@ -188,6 +223,7 @@ update_repositories() {
|
|
|
188
223
|
|
|
189
224
|
if [ -z "$repo_name" ] || [ "$repo_name" = "null" ]; then
|
|
190
225
|
log_error "Invalid repository configuration at index $index" >&2
|
|
226
|
+
failed_count=$((failed_count + 1))
|
|
191
227
|
continue
|
|
192
228
|
fi
|
|
193
229
|
|
|
@@ -384,7 +420,9 @@ update_repositories() {
|
|
|
384
420
|
update_pids+=($!)
|
|
385
421
|
else
|
|
386
422
|
# Run immediately (sequential)
|
|
387
|
-
update_single_repo "$repo_name" "$repo_url" "$repo_branch" "$repo_path"
|
|
423
|
+
if ! update_single_repo "$repo_name" "$repo_url" "$repo_branch" "$repo_path"; then
|
|
424
|
+
failed_count=$((failed_count + 1))
|
|
425
|
+
fi
|
|
388
426
|
fi
|
|
389
427
|
done
|
|
390
428
|
|
|
@@ -393,7 +431,6 @@ update_repositories() {
|
|
|
393
431
|
timing_checkpoint "update_repositories: Waiting for parallel updates"
|
|
394
432
|
log "Waiting for ${#update_pids[@]} repository updates to complete..." >&2
|
|
395
433
|
|
|
396
|
-
local failed_count=0
|
|
397
434
|
for pid in "${update_pids[@]}"; do
|
|
398
435
|
if ! wait $pid; then
|
|
399
436
|
failed_count=$((failed_count + 1))
|
|
@@ -405,6 +442,11 @@ update_repositories() {
|
|
|
405
442
|
fi
|
|
406
443
|
fi
|
|
407
444
|
|
|
445
|
+
if [ $failed_count -gt 0 ]; then
|
|
446
|
+
timing_checkpoint "update_repositories: END (failed)"
|
|
447
|
+
return 1
|
|
448
|
+
fi
|
|
449
|
+
|
|
408
450
|
log "Repository update complete" >&2
|
|
409
451
|
timing_checkpoint "update_repositories: END (all repos complete)"
|
|
410
452
|
return 0
|
|
@@ -673,6 +715,26 @@ REPO_EOF
|
|
|
673
715
|
echo "$repos_changed_json"
|
|
674
716
|
}
|
|
675
717
|
|
|
718
|
+
write_init_failure_summary() {
|
|
719
|
+
local stage="$1"
|
|
720
|
+
local summary_file="$TASK_OUTPUT_DIR/summary.md"
|
|
721
|
+
|
|
722
|
+
if [ -s "$summary_file" ]; then
|
|
723
|
+
return 0
|
|
724
|
+
fi
|
|
725
|
+
|
|
726
|
+
cat <<SUMMARY_EOF > "$summary_file"
|
|
727
|
+
Task ${TASK_ID} failed during initialization.
|
|
728
|
+
|
|
729
|
+
- Task Type: ${TASK_TYPE}
|
|
730
|
+
- Environment: ${ENVIRONMENT}
|
|
731
|
+
- Stage: ${stage}
|
|
732
|
+
- Next Step: Review log.txt for the specific initialization error.
|
|
733
|
+
SUMMARY_EOF
|
|
734
|
+
|
|
735
|
+
log "Summary file created at $summary_file"
|
|
736
|
+
}
|
|
737
|
+
|
|
676
738
|
# Generate task.json metadata file
|
|
677
739
|
generate_task_json() {
|
|
678
740
|
local exit_code=$1
|
|
@@ -848,7 +910,13 @@ main() {
|
|
|
848
910
|
REPO_UPDATE_PID=$!
|
|
849
911
|
timing_checkpoint "main: Repository updates backgrounded (PID: $REPO_UPDATE_PID)"
|
|
850
912
|
else
|
|
851
|
-
update_repositories
|
|
913
|
+
if ! update_repositories; then
|
|
914
|
+
log_error "Repository synchronization failed; aborting task execution"
|
|
915
|
+
write_task_status "InitFailed" "0" "repository_sync" "Repository synchronization failed; aborting task execution"
|
|
916
|
+
write_init_failure_summary "repository_sync"
|
|
917
|
+
generate_task_json 1 "repository_sync"
|
|
918
|
+
return 1
|
|
919
|
+
fi
|
|
852
920
|
timing_checkpoint "main: Repository updates complete (synchronous)"
|
|
853
921
|
fi
|
|
854
922
|
|
|
@@ -947,6 +1015,8 @@ main() {
|
|
|
947
1015
|
timing_checkpoint "main: Setup script skipped"
|
|
948
1016
|
elif ! run_setup_script; then
|
|
949
1017
|
log_error "Environment setup script failed; aborting task execution"
|
|
1018
|
+
write_task_status "InitFailed" "0" "setup_script" "Environment setup script failed; aborting task execution"
|
|
1019
|
+
write_init_failure_summary "setup_script"
|
|
950
1020
|
generate_task_json 1 "setup_script"
|
|
951
1021
|
return 1
|
|
952
1022
|
else
|
|
@@ -962,7 +1032,7 @@ main() {
|
|
|
962
1032
|
local exit_code=0
|
|
963
1033
|
|
|
964
1034
|
# Update status to indicate initialization is complete
|
|
965
|
-
|
|
1035
|
+
write_task_status "Ready" "0.01"
|
|
966
1036
|
timing_checkpoint "main: Status file written, ready for task execution"
|
|
967
1037
|
|
|
968
1038
|
# If SETUP_ONLY mode, return here without executing tasks (for interactive containers)
|
|
@@ -973,7 +1043,7 @@ main() {
|
|
|
973
1043
|
|
|
974
1044
|
# If STAGED_TASK mode, complete setup but skip agent execution (user will start later)
|
|
975
1045
|
if [ "${STAGED_TASK:-false}" = "true" ]; then
|
|
976
|
-
|
|
1046
|
+
write_task_status "Staged" "0.01"
|
|
977
1047
|
log "Setup complete (STAGED_TASK mode), waiting for instructions"
|
|
978
1048
|
return 0
|
|
979
1049
|
fi
|
|
@@ -88,9 +88,38 @@ process_repo() {
|
|
|
88
88
|
local files_detail=$(echo "$files_list" | jq -R -s -c 'split("\n") | map(select(length > 0)) | map({path: ., added: 0, deleted: 0})')
|
|
89
89
|
[ -z "$files_detail" ] || [ "$files_detail" = "null" ] && files_detail='[]'
|
|
90
90
|
|
|
91
|
+
# Detect upstream divergence for the current branch when tracking is configured.
|
|
92
|
+
local upstream_ref
|
|
93
|
+
upstream_ref=$(git rev-parse --abbrev-ref --symbolic-full-name @{upstream} 2>/dev/null || true)
|
|
94
|
+
local upstream_status="no-upstream"
|
|
95
|
+
local upstream_behind=0
|
|
96
|
+
local upstream_ahead=0
|
|
97
|
+
|
|
98
|
+
if [ -n "$upstream_ref" ] && [ "$upstream_ref" != "@{upstream}" ]; then
|
|
99
|
+
upstream_status="up-to-date"
|
|
100
|
+
local upstream_remote="${upstream_ref%%/*}"
|
|
101
|
+
|
|
102
|
+
if [ -n "$upstream_remote" ]; then
|
|
103
|
+
git fetch "$upstream_remote" --quiet 2>/dev/null || true
|
|
104
|
+
fi
|
|
105
|
+
|
|
106
|
+
upstream_behind=$(git rev-list --count HEAD.."$upstream_ref" 2>/dev/null || echo "0")
|
|
107
|
+
upstream_ahead=$(git rev-list --count "$upstream_ref"..HEAD 2>/dev/null || echo "0")
|
|
108
|
+
upstream_behind=${upstream_behind:-0}
|
|
109
|
+
upstream_ahead=${upstream_ahead:-0}
|
|
110
|
+
|
|
111
|
+
if [ "$upstream_behind" -gt 0 ] && [ "$upstream_ahead" -gt 0 ]; then
|
|
112
|
+
upstream_status="diverged"
|
|
113
|
+
elif [ "$upstream_behind" -gt 0 ]; then
|
|
114
|
+
upstream_status="behind"
|
|
115
|
+
elif [ "$upstream_ahead" -gt 0 ]; then
|
|
116
|
+
upstream_status="ahead"
|
|
117
|
+
fi
|
|
118
|
+
fi
|
|
119
|
+
|
|
91
120
|
# Write JSON result
|
|
92
121
|
cat > "$output_file" <<EOF
|
|
93
|
-
{"name":"$repo_name","path":"$repo_path","branch":"$current_branch","files_changed":$files_changed,"lines_added":$lines_added,"lines_deleted":$lines_deleted,"patch_file":"$patch_file","files":$files_detail}
|
|
122
|
+
{"name":"$repo_name","path":"$repo_path","branch":"$current_branch","upstream_status":"$upstream_status","upstream_behind":$upstream_behind,"upstream_ahead":$upstream_ahead,"files_changed":$files_changed,"lines_added":$lines_added,"lines_deleted":$lines_deleted,"patch_file":"$patch_file","files":$files_detail}
|
|
94
123
|
EOF
|
|
95
124
|
}
|
|
96
125
|
|