@mmerterden/multi-agent-pipeline 23.6.0 → 24.0.0
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/CHANGELOG.md +56 -1
- package/README.md +61 -27
- package/README.tr.md +46 -12
- package/SECURITY.md +3 -3
- package/docs/architecture.md +47 -8
- package/docs/ecosystem.md +20 -18
- package/docs/engineering.md +1 -1
- package/docs/facts.json +8 -6
- package/docs/features.md +59 -15
- package/install/_codex-agents.mjs +13 -8
- package/install/_common.mjs +24 -0
- package/install/_dev-only-files.mjs +4 -0
- package/install/_mcp-register.mjs +6 -2
- package/install/_rewrite-tree.mjs +197 -0
- package/install/codex.mjs +96 -180
- package/install/copilot.mjs +24 -54
- package/install/index.mjs +29 -11
- package/install/templates/codex-instructions.md +21 -5
- package/install/templates/copilot-instructions.md +21 -14
- package/manifest.json +2082 -0
- package/package.json +6 -2
- package/pipeline/commands/multi-agent/SKILL.md +7 -5
- package/pipeline/commands/multi-agent/analysis/SKILL.md +4 -0
- package/pipeline/commands/multi-agent/autopilot-on/SKILL.md +31 -3
- package/pipeline/commands/multi-agent/autopilot-status/SKILL.md +5 -1
- package/pipeline/commands/multi-agent/channels/SKILL.md +16 -8
- package/pipeline/commands/multi-agent/log/SKILL.md +2 -0
- package/pipeline/commands/multi-agent/resume/SKILL.md +2 -0
- package/pipeline/commands/multi-agent/review-rounds/SKILL.md +94 -0
- package/pipeline/commands/multi-agent/stack/SKILL.md +1 -1
- package/pipeline/commands/multi-agent/sync/SKILL.md +3 -3
- package/pipeline/contract/manifest.json +1 -1
- package/pipeline/contract/types/index.d.ts +1 -0
- package/pipeline/lib/_jira-auth.sh +50 -78
- package/pipeline/lib/_service-account.sh +191 -0
- package/pipeline/lib/credential-inventory.sh +49 -37
- package/pipeline/lib/credential-store.sh +48 -3
- package/pipeline/lib/fetch-confluence.sh +76 -92
- package/pipeline/lib/fetch-crashlytics.sh +30 -59
- package/pipeline/lib/fetch-figma-annotations.sh +9 -9
- package/pipeline/lib/fetch-fortify.sh +77 -81
- package/pipeline/lib/fetch-graylog.sh +38 -77
- package/pipeline/lib/figma-mcp-refresh.sh +23 -4
- package/pipeline/lib/figma-screenshot.sh +7 -8
- package/pipeline/lib/figma-token.sh +39 -46
- package/pipeline/lib/host.mjs +138 -0
- package/pipeline/lib/host.sh +48 -0
- package/pipeline/lib/issue-fetcher.sh +25 -41
- package/pipeline/lib/jira-publish.sh +23 -21
- package/pipeline/lib/local-model.mjs +93 -0
- package/pipeline/lib/md2confluence-v3.py +37 -30
- package/pipeline/lib/model-dispatch.sh +41 -4
- package/pipeline/lib/model-resolve.mjs +58 -0
- package/pipeline/lib/post-pr-review.sh +38 -53
- package/pipeline/lib/reviewer-families.mjs +70 -0
- package/pipeline/lib/service-account.mjs +2131 -0
- package/pipeline/lib/service-account.sh +35 -0
- package/pipeline/lib/usage-names.generated.mjs +3 -0
- package/pipeline/lib/usage-token.mjs +64 -24
- package/pipeline/lib/usage-vocab.mjs +1 -1
- package/pipeline/lib/user-facing.mjs +11 -3
- package/pipeline/lib/vercel-deploy.sh +17 -26
- package/pipeline/multi-agent-refs/_entry-picker.md +62 -0
- package/pipeline/multi-agent-refs/_input-parser.md +1 -1
- package/pipeline/multi-agent-refs/analysis/intake.md +2 -0
- package/pipeline/multi-agent-refs/analysis/reusable-refs.md +1 -0
- package/pipeline/multi-agent-refs/analysis/unattended.md +135 -0
- package/pipeline/multi-agent-refs/autopilot-on/details.md +16 -0
- package/pipeline/multi-agent-refs/channels/generator.md +10 -2
- package/pipeline/multi-agent-refs/channels/menu.md +3 -1
- package/pipeline/multi-agent-refs/channels/preview.md +3 -1
- package/pipeline/multi-agent-refs/channels/reference.md +16 -2
- package/pipeline/multi-agent-refs/channels/report-file.md +188 -0
- package/pipeline/multi-agent-refs/component-dispatch.md +2 -2
- package/pipeline/multi-agent-refs/cross-cli-contract.md +38 -30
- package/pipeline/multi-agent-refs/features/autopilot-circuit-breaker.md +4 -4
- package/pipeline/multi-agent-refs/features/doctor.md +37 -11
- package/pipeline/multi-agent-refs/features/free-models.md +3 -3
- package/pipeline/multi-agent-refs/features/local-model.md +87 -0
- package/pipeline/multi-agent-refs/features/model-fallback.md +25 -10
- package/pipeline/multi-agent-refs/features/product-context.md +6 -5
- package/pipeline/multi-agent-refs/features/review-delta.md +1 -1
- package/pipeline/multi-agent-refs/features/review-rounds.md +40 -0
- package/pipeline/multi-agent-refs/features/rework-escalation.md +5 -4
- package/pipeline/multi-agent-refs/features/service-accounts.md +233 -0
- package/pipeline/multi-agent-refs/features/unattended-security.md +10 -1
- package/pipeline/multi-agent-refs/help/en.md +31 -2
- package/pipeline/multi-agent-refs/help/tr.md +31 -2
- package/pipeline/multi-agent-refs/orchestrator/copilot-pipeline.md +3 -2
- package/pipeline/multi-agent-refs/orchestrator/dispatcher.md +2 -1
- package/pipeline/multi-agent-refs/phases/modes.md +20 -1
- package/pipeline/multi-agent-refs/phases/operations.md +1 -1
- package/pipeline/multi-agent-refs/phases/phase-0-init.md +1 -1
- package/pipeline/multi-agent-refs/phases/phase-2-dev.md +4 -4
- package/pipeline/multi-agent-refs/phases/phase-3-review.md +7 -3
- package/pipeline/multi-agent-refs/phases/phase-5-report.md +12 -10
- package/pipeline/multi-agent-refs/phases.md +4 -3
- package/pipeline/multi-agent-refs/resume/details.md +2 -0
- package/pipeline/multi-agent-refs/review/panel.md +30 -18
- package/pipeline/multi-agent-refs/setup/discovery.md +17 -5
- package/pipeline/multi-agent-refs/setup/token-save-flow.md +21 -2
- package/pipeline/multi-agent-refs/sync/overview.md +11 -5
- package/pipeline/multi-agent-refs/tracker-contract.md +28 -10
- package/pipeline/office/index.html +4 -4
- package/pipeline/schemas/agent-state.schema.json +19 -1
- package/pipeline/schemas/autopilot-config.schema.json +29 -4
- package/pipeline/schemas/hosts.json +512 -0
- package/pipeline/schemas/hosts.schema.json +310 -0
- package/pipeline/schemas/launch.json +22 -2
- package/pipeline/schemas/launch.schema.json +2 -1
- package/pipeline/schemas/phases.json +21 -3
- package/pipeline/schemas/phases.schema.json +8 -0
- package/pipeline/schemas/prefs.schema.json +346 -7
- package/pipeline/schemas/token-budget.json +2 -2
- package/pipeline/scripts/.doctor-mut.47076.mjs +2253 -0
- package/pipeline/scripts/_autopilot-config.mjs +67 -4
- package/pipeline/scripts/_autopilot-item.mjs +67 -0
- package/pipeline/scripts/_autopilot-outcomes.mjs +6 -0
- package/pipeline/scripts/_cost.mjs +75 -3
- package/pipeline/scripts/analysis-sources.mjs +22 -5
- package/pipeline/scripts/analysis-unattended.mjs +360 -0
- package/pipeline/scripts/anonymize-findings.mjs +3 -7
- package/pipeline/scripts/autopilot-arming.mjs +19 -10
- package/pipeline/scripts/autopilot-intake.mjs +124 -27
- package/pipeline/scripts/autopilot-menubar.swift +7 -0
- package/pipeline/scripts/autopilot-runner.mjs +77 -48
- package/pipeline/scripts/autopilot-status.sh +32 -9
- package/pipeline/scripts/bulk-read.sh +37 -5
- package/pipeline/scripts/confluence-readback.mjs +15 -7
- package/pipeline/scripts/cost-table.json +65 -25
- package/pipeline/scripts/doctor.mjs +119 -32
- package/pipeline/scripts/entry-mode.mjs +101 -0
- package/pipeline/scripts/estimate.mjs +30 -16
- package/pipeline/scripts/feedback-send.mjs +11 -8
- package/pipeline/scripts/gen-facts.mjs +16 -13
- package/pipeline/scripts/jira-attach.sh +23 -28
- package/pipeline/scripts/jira-search.sh +5 -21
- package/pipeline/scripts/launch-request.mjs +15 -9
- package/pipeline/scripts/migrate-prefs.mjs +56 -0
- package/pipeline/scripts/phase-tracker.sh +146 -38
- package/pipeline/scripts/priority-review.mjs +14 -7
- package/pipeline/scripts/product-context.mjs +26 -7
- package/pipeline/scripts/prune-logs.sh +4 -2
- package/pipeline/scripts/report-file.mjs +285 -0
- package/pipeline/scripts/review-rounds.mjs +592 -0
- package/pipeline/scripts/rework-escalation.mjs +26 -7
- package/pipeline/scripts/service-read.mjs +19 -17
- package/pipeline/scripts/skill-siblings.mjs +17 -1
- package/pipeline/scripts/status-overview.mjs +20 -10
- package/pipeline/scripts/uninstall.mjs +145 -57
- package/pipeline/scripts/usage-register.mjs +34 -11
- package/pipeline/scripts/usage-report.mjs +31 -26
- package/pipeline/scripts/validate-state.mjs +19 -11
- package/pipeline/scripts/validate-triage.mjs +11 -1
- package/pipeline/scripts/work-items.mjs +25 -28
- package/pipeline/scripts/write-store-config.mjs +37 -11
- package/pipeline/skills/.skill-manifest.json +11 -7
- package/pipeline/skills/.skills-index.json +13 -2
- package/pipeline/skills/shared/README.md +4 -3
- package/pipeline/skills/shared/core/multi-agent/SKILL.md +14 -6
- package/pipeline/skills/shared/core/multi-agent-analysis/SKILL.md +2 -0
- package/pipeline/skills/shared/core/multi-agent-channels/SKILL.md +11 -8
- package/pipeline/skills/shared/core/multi-agent-resume/SKILL.md +1 -1
- package/pipeline/skills/shared/core/multi-agent-review-rounds/SKILL.md +92 -0
- package/pipeline/skills/shared/core/multi-agent-sync/SKILL.md +3 -3
- package/pipeline/skills/skills-index.md +2 -1
- package/pipeline/lib/credential-resolve.mjs +0 -75
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
#
|
|
19
19
|
# Commands:
|
|
20
20
|
# init <task_id> Reset tracker for this task
|
|
21
|
-
# add <phase_id> "<name>" Register a phase (status=pending); idempotent - existing id is a no-op
|
|
21
|
+
# add <phase_id> "<name>" Register a phase and its contract sub-steps (status=pending); idempotent - existing id is a no-op
|
|
22
22
|
# update <phase_id> <status> Change status + re-render
|
|
23
23
|
# sub <phase_id> <sub_id> "<name>" [status] Add or update a sub-phase
|
|
24
24
|
# tokens <phase_id> <in> <out> [cached] Add to phase's token totals (in = fresh input, cache-exclusive)
|
|
@@ -129,6 +129,24 @@ waiting_word() {
|
|
|
129
129
|
esac
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
+
# The sub-steps each phase declares before it starts, keyed `<id>:<name>` so a
|
|
133
|
+
# mode that renames a slot only inherits the set when the slot is the same one.
|
|
134
|
+
# Held to pipeline/schemas/phases.json `steps` by smoke-phase-tracker.sh, which
|
|
135
|
+
# compares the two sets; it stays a case statement here for the same reason
|
|
136
|
+
# phase-banner.sh keeps its label table (ADR-0004, no runtime schema read).
|
|
137
|
+
#
|
|
138
|
+
# Dev is absent on purpose: its sub-steps are Phase 1's plan tasks, which `plan`
|
|
139
|
+
# attaches once they exist. Declaring a second set would put two lists of work
|
|
140
|
+
# under one phase.
|
|
141
|
+
phase_steps() {
|
|
142
|
+
case "$1" in
|
|
143
|
+
0:Init) printf 'Intake\nWorkspace\nTask contract\n' ;;
|
|
144
|
+
1:Plan) printf 'Context\nExploration\nTask breakdown\n' ;;
|
|
145
|
+
3:Review) printf 'Gates\nReview panel\nTriage\n' ;;
|
|
146
|
+
4:Commit) printf 'Commit\nPush\nPull request\n' ;;
|
|
147
|
+
5:Report) printf 'Channels dispatch\nLog + telemetry\nKnowledge + memory\n' ;;
|
|
148
|
+
esac
|
|
149
|
+
}
|
|
132
150
|
|
|
133
151
|
if [ "$#" -lt 1 ]; then
|
|
134
152
|
cat >&2 <<USAGE
|
|
@@ -779,12 +797,12 @@ tracker_next_hint() {
|
|
|
779
797
|
# default only up to Opus 4.7 / Sonnet 4.6, a default that landed in
|
|
780
798
|
# v2.1.268. Naming the fallback on the same line is what keeps a newer model
|
|
781
799
|
# from advancing six phases in silence.
|
|
782
|
-
# `
|
|
783
|
-
# update_plan takes the whole list anyway, so re-reading it is what puts
|
|
784
|
-
#
|
|
800
|
+
# `tiles` prints the whole payload with each row's current status, and
|
|
801
|
+
# update_plan takes the whole list anyway, so re-reading it is what puts the
|
|
802
|
+
# sub-steps on the Codex plan without a second mechanism. Codex has no
|
|
785
803
|
# dependency concept; the "(waiting on: ...)" suffix inside the step text is
|
|
786
804
|
# where that information survives on this host.
|
|
787
|
-
codex) mirror="update_plan: set step \"Phase $pid $name\" to $status, re-reading the FULL
|
|
805
|
+
codex) mirror="update_plan: set step \"Phase $pid $name\" to $status, re-reading the FULL payload from \`phase-tracker.sh tiles\` (it is not a delta, and the indented rows are plan steps that belong in it)" ;;
|
|
788
806
|
*) mirror="no task widget on this host - reprint the card above inside your reply text" ;;
|
|
789
807
|
esac
|
|
790
808
|
printf '\n-- NEXT (required) --\n %s\n' "$mirror"
|
|
@@ -795,6 +813,23 @@ tracker_next_hint() {
|
|
|
795
813
|
esac
|
|
796
814
|
}
|
|
797
815
|
|
|
816
|
+
# Printed after every sub-step change, for the same reason the phase hint is:
|
|
817
|
+
# the card goes to stdout and the host collapses it, so a sub-step that moves
|
|
818
|
+
# only in the state file moves nowhere the user can see. The row text is the
|
|
819
|
+
# one `subjects` prints, so the tile it names is the tile that exists.
|
|
820
|
+
sub_next_hint() {
|
|
821
|
+
local pid="$1" sid="$2" status="$3" row mirror
|
|
822
|
+
[ "${TRACKER_QUIET:-0}" = "1" ] && return 0
|
|
823
|
+
row=$(sub_rows "$(load_state)" "$pid" "$sid")
|
|
824
|
+
[ -n "$row" ] || return 0
|
|
825
|
+
case "$(host_kind)" in
|
|
826
|
+
claude) mirror="TaskUpdate(<tile \"$row\">, status=\"$status\") - the sub-step is a tile of its own, created from \`phase-tracker.sh tiles\`; if it has no tile yet, re-run \`tiles\` and rebuild the list first" ;;
|
|
827
|
+
codex) mirror="update_plan: set step \"$row\" to $status, re-reading the FULL list from \`phase-tracker.sh tiles\` (it is not a delta)" ;;
|
|
828
|
+
*) mirror="no task widget on this host - reprint the card above inside your reply text" ;;
|
|
829
|
+
esac
|
|
830
|
+
printf '\n-- NEXT (required) --\n %s\n' "$mirror"
|
|
831
|
+
}
|
|
832
|
+
|
|
798
833
|
# Elapsed with an hours bucket. format_elapsed stops at minutes because the card
|
|
799
834
|
# shows one phase at a time; a whole-run total reads as "102m" without this.
|
|
800
835
|
format_span() {
|
|
@@ -950,18 +985,34 @@ subjects() {
|
|
|
950
985
|
# Indentation is two spaces INSIDE the subject because the widget takes
|
|
951
986
|
# exactly one string per row and has no parent field - there is no nesting
|
|
952
987
|
# to ask for, so the only place a hierarchy can be expressed is the string.
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
988
|
+
#
|
|
989
|
+
# The row carries `<phase>.<step>` and not the bare step id because the
|
|
990
|
+
# number has to survive in the string: the widget renders one string per row
|
|
991
|
+
# and no field beside it, so a `1` on its own row says nothing about which
|
|
992
|
+
# phase it belongs to.
|
|
993
|
+
#
|
|
994
|
+
# A single-phase read (`subjects <id>`) is the subject of ONE tile and stays
|
|
995
|
+
# one line; the sub rows are tiles of their own and belong to the full list.
|
|
996
|
+
if [ -z "$want" ]; then
|
|
997
|
+
sub_rows "$state" "$pid"
|
|
961
998
|
fi
|
|
962
999
|
done <<< "$rows"
|
|
963
1000
|
}
|
|
964
1001
|
|
|
1002
|
+
# The sub rows of one phase, in the shape every host puts on its widget.
|
|
1003
|
+
# `sid` narrows to a single step, which is what a per-step mirror call needs.
|
|
1004
|
+
sub_rows() {
|
|
1005
|
+
local state="$1" pid="$2" sid="${3:-}"
|
|
1006
|
+
echo "$state" | jq -r --arg pid "$pid" --arg sid "$sid" --arg waiting "$(waiting_word)" '
|
|
1007
|
+
([.phases[] | select(.id == $pid)][0].subs) // []
|
|
1008
|
+
| .[]
|
|
1009
|
+
| select($sid == "" or (.id // "") == $sid)
|
|
1010
|
+
| " " + $pid + "." + (.id // "") + " " + (.name // "")
|
|
1011
|
+
+ (if ((.deps // []) | length) > 0
|
|
1012
|
+
then " (" + $waiting + ": " + ((.deps // []) | join(", ")) + ")"
|
|
1013
|
+
else "" end)'
|
|
1014
|
+
}
|
|
1015
|
+
|
|
965
1016
|
# The TaskCreate/TaskUpdate script for this host, in creation order.
|
|
966
1017
|
#
|
|
967
1018
|
# Creation order is the ONLY ordering the native widget has - it renders by the
|
|
@@ -971,14 +1022,20 @@ subjects() {
|
|
|
971
1022
|
# already does for a different reason.
|
|
972
1023
|
tiles_script() {
|
|
973
1024
|
need_jq
|
|
974
|
-
local new_only="${1:-}"
|
|
1025
|
+
local new_only="${1:-}" rebuild="${2:-}"
|
|
975
1026
|
local state; state=$(load_state)
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
1027
|
+
# A phase whose tasklist_id was never recorded has, as far as anything can
|
|
1028
|
+
# tell, no tile. With none recorded at all there is no list yet, so the whole
|
|
1029
|
+
# list is a first batch and nothing is rebuilt.
|
|
1030
|
+
local has_tiles
|
|
1031
|
+
has_tiles=$(echo "$state" | jq \
|
|
1032
|
+
'[.phases[]? | select(((.meta.tasklist_id // "") | tostring) != "")] | length')
|
|
1033
|
+
[ "${has_tiles:-0}" -gt 0 ] || rebuild=""
|
|
1034
|
+
|
|
1035
|
+
# Rows that arrive after the list exists have to be inserted, which the widget
|
|
1036
|
+
# cannot do, so the whole list is rebuilt. The rebuild wins over a narrowed
|
|
1037
|
+
# batch: appending to it would land the new rows after the last phase.
|
|
1038
|
+
[ -n "$rebuild" ] && new_only=""
|
|
982
1039
|
|
|
983
1040
|
if [ -n "$new_only" ]; then
|
|
984
1041
|
local pending_new
|
|
@@ -987,19 +1044,21 @@ tiles_script() {
|
|
|
987
1044
|
printf 'Every registered phase already has a tile - nothing to create.\n'
|
|
988
1045
|
return 0
|
|
989
1046
|
fi
|
|
990
|
-
printf 'REQUIRED - create one native tile per
|
|
1047
|
+
printf 'REQUIRED - create one native tile per ROW below, in this exact order.
|
|
991
1048
|
'
|
|
992
1049
|
printf 'Tiles already created keep their place; every phase here is numbered
|
|
993
1050
|
'
|
|
994
|
-
printf 'above them, so the widget stays in phase order.
|
|
1051
|
+
printf 'above them, so the widget stays in phase order. The indented rows are
|
|
1052
|
+
'
|
|
1053
|
+
printf 'the sub-steps of the phase above them and are tiles of their own.
|
|
995
1054
|
|
|
996
1055
|
'
|
|
997
1056
|
printf '%s\n' "$pending_new" | sed 's/^/ TaskCreate(subject: "/; s/$/")/'
|
|
998
1057
|
return 0
|
|
999
1058
|
fi
|
|
1000
1059
|
|
|
1001
|
-
if [ "$
|
|
1002
|
-
printf 'The tile list has
|
|
1060
|
+
if [ -n "$rebuild" ]; then
|
|
1061
|
+
printf 'The tile list has gained rows, and the widget orders by CREATION.
|
|
1003
1062
|
'
|
|
1004
1063
|
printf 'Delete every existing tile (TaskUpdate status="deleted"), then create
|
|
1005
1064
|
'
|
|
@@ -1009,11 +1068,15 @@ tiles_script() {
|
|
|
1009
1068
|
|
|
1010
1069
|
'
|
|
1011
1070
|
else
|
|
1012
|
-
printf 'REQUIRED - create one native tile per
|
|
1071
|
+
printf 'REQUIRED - create one native tile per ROW below, in this exact
|
|
1072
|
+
'
|
|
1073
|
+
printf 'order, BEFORE any TaskUpdate. The indented rows are the sub-steps of
|
|
1013
1074
|
'
|
|
1014
|
-
printf '
|
|
1075
|
+
printf 'the phase above them and are tiles of their own; the widget renders by
|
|
1015
1076
|
'
|
|
1016
|
-
printf 'phase number, so an out-of-order call scrambles
|
|
1077
|
+
printf 'creation order, not by phase number, so an out-of-order call scrambles
|
|
1078
|
+
'
|
|
1079
|
+
printf 'the stack.
|
|
1017
1080
|
|
|
1018
1081
|
'
|
|
1019
1082
|
fi
|
|
@@ -1029,12 +1092,13 @@ tiles_script() {
|
|
|
1029
1092
|
# executable and is not, which is worse than a line that admits what it needs.
|
|
1030
1093
|
local deps
|
|
1031
1094
|
deps=$(echo "$state" | jq -r '
|
|
1032
|
-
[.phases[]? | .subs[]?] as $all
|
|
1033
|
-
| $
|
|
1095
|
+
[.phases[]? | . as $p | (.subs[]? | . + {phase: $p.id})] as $all
|
|
1096
|
+
| def row($s): "<tile \" " + ($s.phase // "") + "." + ($s.id // "") + " " + ($s.name // "") + "\">";
|
|
1097
|
+
$all[] | select(((.deps // []) | length) > 0)
|
|
1034
1098
|
| . as $s
|
|
1035
|
-
| " TaskUpdate(
|
|
1099
|
+
| " TaskUpdate(" + row($s) + ", addBlockedBy: [" +
|
|
1036
1100
|
(($s.deps // [])
|
|
1037
|
-
| map(. as $d | (($all[] | select(.id == $d
|
|
1101
|
+
| map(. as $d | (($all[] | select(.id == $d and .phase == $s.phase) | row(.)) // $d))
|
|
1038
1102
|
| join(", ")) + "])"')
|
|
1039
1103
|
if [ -n "$deps" ]; then
|
|
1040
1104
|
printf '\nThen the dependencies, so the widget says WHY a step has not started.\n'
|
|
@@ -1044,6 +1108,29 @@ tiles_script() {
|
|
|
1044
1108
|
fi
|
|
1045
1109
|
}
|
|
1046
1110
|
|
|
1111
|
+
# The Codex plan payload: every row `subjects` prints, carrying the status the
|
|
1112
|
+
# tracker holds for it. The indented rows are plan steps like any other - the
|
|
1113
|
+
# plan tool has no nesting, so the phase number inside the text is the only
|
|
1114
|
+
# thing that says which phase a step belongs to. Codex knows three statuses, so
|
|
1115
|
+
# a failed or skipped row goes out as `completed` and the agent log carries why.
|
|
1116
|
+
codex_plan() {
|
|
1117
|
+
local state="$1" statuses
|
|
1118
|
+
statuses=$(echo "$state" | jq -r '
|
|
1119
|
+
.phases // []
|
|
1120
|
+
| sort_by(.id | (tonumber? // 9999))
|
|
1121
|
+
| .[]
|
|
1122
|
+
| select((.id // "") != "")
|
|
1123
|
+
| (.status // "pending"), ((.subs // [])[] | (.status // "pending"))')
|
|
1124
|
+
paste -d"$(printf '\037')" <(subjects) <(printf '%s\n' "$statuses") \
|
|
1125
|
+
| jq -Rn -c '[inputs | select(length > 0) | split("\u001f") | . as $r
|
|
1126
|
+
| {step: $r[0],
|
|
1127
|
+
status: (if $r[1] == "in_progress" then "in_progress"
|
|
1128
|
+
elif ($r[1] == "completed" or $r[1] == "failed" or $r[1] == "skipped")
|
|
1129
|
+
then "completed"
|
|
1130
|
+
else "pending" end)}]
|
|
1131
|
+
| {plan: .}'
|
|
1132
|
+
}
|
|
1133
|
+
|
|
1047
1134
|
render() {
|
|
1048
1135
|
need_jq
|
|
1049
1136
|
local state
|
|
@@ -1302,15 +1389,23 @@ case "$ACTION" in
|
|
|
1302
1389
|
need_jq
|
|
1303
1390
|
[ "$#" -ge 2 ] || { echo "add needs <phase_id> <name>" >&2; exit 64; }
|
|
1304
1391
|
PID="$1"; PNAME="$(decode_entities "$2")"
|
|
1392
|
+
# The phase arrives with its sub-steps already on it. A step registered from
|
|
1393
|
+
# the contract is a property of the phase set, and so reaches the widget
|
|
1394
|
+
# whether or not the phase later announces it; one a phase has to announce
|
|
1395
|
+
# before it exists reaches the widget only when that call is made.
|
|
1396
|
+
PSUBS=$(phase_steps "$PID:$PNAME" | jq -Rn \
|
|
1397
|
+
'[inputs | select(length > 0)]
|
|
1398
|
+
| to_entries
|
|
1399
|
+
| map({id: ((.key + 1) | tostring), name: .value, status: "pending", deps: []})')
|
|
1305
1400
|
acquire_state_lock
|
|
1306
1401
|
state=$(load_state)
|
|
1307
1402
|
# Idempotent: a phase id that already exists is a no-op (name, status, and
|
|
1308
1403
|
# token history are preserved). This is what lets continuation commands
|
|
1309
1404
|
# (/multi-agent:resume, /multi-agent:manual-test) re-declare their phase set against a
|
|
1310
1405
|
# pre-existing tracker without duplicating or resetting tiles.
|
|
1311
|
-
new=$(echo "$state" | jq --arg id "$PID" --arg name "$PNAME" '
|
|
1406
|
+
new=$(echo "$state" | jq --arg id "$PID" --arg name "$PNAME" --argjson subs "$PSUBS" '
|
|
1312
1407
|
if any(.phases[]?; .id == $id) then .
|
|
1313
|
-
else .phases += [{"id":$id,"name":$name,"status":"pending","subs"
|
|
1408
|
+
else .phases += [{"id":$id,"name":$name,"status":"pending","subs":$subs}]
|
|
1314
1409
|
end')
|
|
1315
1410
|
save_state "$new"
|
|
1316
1411
|
release_state_lock
|
|
@@ -1422,7 +1517,10 @@ $(printf '%s' "$PLAN_IN" | jq -r '
|
|
|
1422
1517
|
EOF
|
|
1423
1518
|
[ "$N" -gt 0 ] || { echo "phase-tracker: plan carried no tasks[]" >&2; exit 65; }
|
|
1424
1519
|
printf 'phase-tracker: %s plan step(s) attached to phase %s\n' "$N" "$PID"
|
|
1425
|
-
|
|
1520
|
+
# The steps arrive after the list exists, so the list is rebuilt - and
|
|
1521
|
+
# through the `tiles` action, so each host is told in its own calls rather
|
|
1522
|
+
# than handed Claude Code's.
|
|
1523
|
+
"$SELF_PATH" tiles --rebuild
|
|
1426
1524
|
;;
|
|
1427
1525
|
sub)
|
|
1428
1526
|
need_jq
|
|
@@ -1456,6 +1554,7 @@ EOF
|
|
|
1456
1554
|
emit_otel_span "phase.sub" "$PID" "$SNAME" \
|
|
1457
1555
|
"$(jq -nc --arg s "$SID" --arg st "$SSTATUS" '{sub_id:$s,status:$st}')"
|
|
1458
1556
|
render
|
|
1557
|
+
sub_next_hint "$PID" "$SID" "$SSTATUS"
|
|
1459
1558
|
;;
|
|
1460
1559
|
|
|
1461
1560
|
tokens)
|
|
@@ -1661,7 +1760,15 @@ EOF
|
|
|
1661
1760
|
tiles)
|
|
1662
1761
|
need_jq
|
|
1663
1762
|
tiles_new=""
|
|
1664
|
-
|
|
1763
|
+
tiles_rebuild=""
|
|
1764
|
+
while [ "$#" -gt 0 ]; do
|
|
1765
|
+
case "$1" in
|
|
1766
|
+
--new) tiles_new=1 ;;
|
|
1767
|
+
--rebuild) tiles_rebuild=1 ;;
|
|
1768
|
+
*) echo "tiles: unknown option $1" >&2; exit 64 ;;
|
|
1769
|
+
esac
|
|
1770
|
+
shift
|
|
1771
|
+
done
|
|
1665
1772
|
tiles_state=$(load_state)
|
|
1666
1773
|
tiles_count=$(echo "$tiles_state" | jq '[.phases[]?] | length')
|
|
1667
1774
|
[ "${tiles_count:-0}" -gt 0 ] || {
|
|
@@ -1684,7 +1791,7 @@ EOF
|
|
|
1684
1791
|
# tools it has. And the fallback is not enough on its own: a user looking
|
|
1685
1792
|
# at a missing widget needs the one command that brings it back, which is
|
|
1686
1793
|
# why the opt-in is printed next to it.
|
|
1687
|
-
tiles_script "$tiles_new"
|
|
1794
|
+
tiles_script "$tiles_new" "$tiles_rebuild"
|
|
1688
1795
|
echo
|
|
1689
1796
|
echo "At every phase boundary re-run \`phase-tracker.sh subjects <id>\` and"
|
|
1690
1797
|
echo "pass that line as the subject of the TaskUpdate. The subject is the only"
|
|
@@ -1709,8 +1816,9 @@ EOF
|
|
|
1709
1816
|
codex)
|
|
1710
1817
|
echo "REQUIRED - register the plan in ONE update_plan call with this step"
|
|
1711
1818
|
echo "list. update_plan takes the full list, not a delta, so every later"
|
|
1712
|
-
echo "boundary resends it with one step's status changed."
|
|
1713
|
-
echo "
|
|
1819
|
+
echo "boundary resends it with one step's status changed. The indented"
|
|
1820
|
+
echo "steps are the sub-steps of the phase above them and belong in it."
|
|
1821
|
+
codex_plan "$tiles_state"
|
|
1714
1822
|
;;
|
|
1715
1823
|
*)
|
|
1716
1824
|
echo "Copilot CLI has no native task widget: the bordered card IS the widget."
|
|
@@ -48,7 +48,7 @@ import { basename, dirname, join, resolve } from "node:path";
|
|
|
48
48
|
import { pathToFileURL } from "node:url";
|
|
49
49
|
|
|
50
50
|
import { ArgsError, parseArgs } from "../lib/args.mjs";
|
|
51
|
-
import {
|
|
51
|
+
import { resolveSecretAsync, selectAccount } from "../lib/service-account.mjs";
|
|
52
52
|
import { globalPref } from "../lib/prefs-value.mjs";
|
|
53
53
|
import { hostCommand, messages, outputLanguage } from "../lib/user-facing.mjs";
|
|
54
54
|
|
|
@@ -383,18 +383,25 @@ export function buildJql(team, presetId, days, extra, t = TEXT.en) {
|
|
|
383
383
|
// ---------------------------------------------------------------- Jira
|
|
384
384
|
|
|
385
385
|
function jiraHost(env, t) {
|
|
386
|
-
const
|
|
387
|
-
if (
|
|
388
|
-
const
|
|
389
|
-
|
|
386
|
+
const chosen = selectAccount({ service: "jira" }, { env });
|
|
387
|
+
if (!chosen.ok) throw new Refusal(t.noHost(hostCommand("setup")));
|
|
388
|
+
const base = chosen.account.baseUrl ?? `https://${chosen.account.hosts[0]}`;
|
|
389
|
+
if (!base) throw new Refusal(t.noHost(hostCommand("setup")));
|
|
390
|
+
return base;
|
|
390
391
|
}
|
|
391
392
|
|
|
392
393
|
function jiraClient(env, t) {
|
|
393
394
|
const host = jiraHost(env, t);
|
|
394
395
|
let token = null;
|
|
395
396
|
return async function request(path, method = "GET", body = undefined) {
|
|
396
|
-
if (!token)
|
|
397
|
-
|
|
397
|
+
if (!token) {
|
|
398
|
+
// The host this client was built for is the destination the token is
|
|
399
|
+
// asked for: one account answers both, so a token for another instance
|
|
400
|
+
// is a refusal here rather than a header on the way out.
|
|
401
|
+
const answer = await resolveSecretAsync({ service: "jira", url: host }, { env });
|
|
402
|
+
if (!answer.ok) throw new Refusal(t.noToken(hostCommand("setup")));
|
|
403
|
+
token = answer.secret;
|
|
404
|
+
}
|
|
398
405
|
const headers = { Authorization: `Bearer ${token}`, Accept: "application/json" };
|
|
399
406
|
if (body !== undefined) headers["Content-Type"] = "application/json";
|
|
400
407
|
const res = await fetch(host + path, {
|
|
@@ -47,6 +47,7 @@ import { fileURLToPath } from "node:url";
|
|
|
47
47
|
import { lockTimeoutFrom, withFileLockSync, writeJsonAtomicSync } from "../lib/json-file-lock.mjs";
|
|
48
48
|
import { fileSafeName } from "../lib/slug.mjs";
|
|
49
49
|
import { prefsPath } from "../lib/prefs-value.mjs";
|
|
50
|
+
import { itemNames, selectAccount } from "../lib/service-account.mjs";
|
|
50
51
|
import { ArgsError, parseArgs as parseArgv } from "../lib/args.mjs";
|
|
51
52
|
import { exitOnHelp } from "../lib/cli-help.mjs";
|
|
52
53
|
|
|
@@ -245,19 +246,21 @@ function httpsHost(remote) {
|
|
|
245
246
|
}
|
|
246
247
|
|
|
247
248
|
/**
|
|
248
|
-
* Write a confirmed product. A repository may name a credential only when
|
|
249
|
-
*
|
|
250
|
-
* `prefs.global.credentialHosts`,
|
|
251
|
-
* person present. The product map
|
|
252
|
-
*
|
|
253
|
-
* there would let any text that reached
|
|
249
|
+
* Write a confirmed product. A repository may name a credential only when the
|
|
250
|
+
* pairing already exists: an account that names it and covers the repository's
|
|
251
|
+
* https host, or that host listed for the key in `prefs.global.credentialHosts`,
|
|
252
|
+
* which `/multi-agent:setup` writes with the person present. The product map
|
|
253
|
+
* never creates a binding: the repo list is assembled from picker output and
|
|
254
|
+
* model-written files, and a binding made there would let any text that reached
|
|
255
|
+
* the planner send a token anywhere.
|
|
254
256
|
*/
|
|
255
257
|
const MAX_PRODUCT_REPOS = 20;
|
|
256
258
|
const CREDENTIAL_FIELDS = ["credential", "authScheme", "username"];
|
|
257
259
|
|
|
258
260
|
/**
|
|
259
261
|
* Why a repo entry may not carry its credential, or null when it may: the
|
|
260
|
-
* remote must be https and its host
|
|
262
|
+
* remote must be https and the key already paired with its host - by an
|
|
263
|
+
* account that names the key and covers the host, or by the key's own list in
|
|
261
264
|
* `prefs.global.credentialHosts`, which only setup writes. Checked on every
|
|
262
265
|
* entry a merge produces, so a credential kept from an earlier spelling never
|
|
263
266
|
* lands on a remote it was not bound for.
|
|
@@ -265,6 +268,7 @@ const CREDENTIAL_FIELDS = ["credential", "authScheme", "username"];
|
|
|
265
268
|
function credentialProblem(prefs, r) {
|
|
266
269
|
if (!r.credential) return null;
|
|
267
270
|
const host = httpsHost(r.remote);
|
|
271
|
+
if (host && accountCovers(prefs, r.credential, host)) return null;
|
|
268
272
|
const hosts = (prefs?.global?.credentialHosts?.[r.credential] || []).map((h) =>
|
|
269
273
|
String(h).toLowerCase(),
|
|
270
274
|
);
|
|
@@ -272,6 +276,21 @@ function credentialProblem(prefs, r) {
|
|
|
272
276
|
return `credential ${JSON.stringify(r.credential)} is not bound to ${host || r.remote}; bind it in prefs.global.credentialHosts with /multi-agent:setup hosts first`;
|
|
273
277
|
}
|
|
274
278
|
|
|
279
|
+
/**
|
|
280
|
+
* Whether an account this credential key names already reaches `host`.
|
|
281
|
+
*
|
|
282
|
+
* The key is the one a store read is made with, so it answers to an account by
|
|
283
|
+
* its id or by the item it holds. The account decides the destination: a key
|
|
284
|
+
* that names an account reaches what that account reaches and nothing else.
|
|
285
|
+
*/
|
|
286
|
+
function accountCovers(prefs, credential, host) {
|
|
287
|
+
const named = itemNames(prefs).filter((x) => x.accountId === credential || x.item === credential);
|
|
288
|
+
return named.some(
|
|
289
|
+
(x) =>
|
|
290
|
+
selectAccount({ service: x.service, accountId: x.accountId, host }, { prefs, env: {} }).ok,
|
|
291
|
+
);
|
|
292
|
+
}
|
|
293
|
+
|
|
275
294
|
export function learnProduct(prefs, projectKey, productName, repos) {
|
|
276
295
|
if (!productName || !/^[A-Za-z0-9._-]{1,64}$/.test(productName))
|
|
277
296
|
throw new Error("product name must be 1-64 letters, digits, . _ -");
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
#
|
|
4
4
|
# Every run persists a task log dir at
|
|
5
5
|
# $HOME/.claude/logs/multi-agent/<project>/<task>/
|
|
6
|
-
# holding agent-state.json, agent-log.md, tracker-state.json, otel-spans.jsonl
|
|
6
|
+
# holding agent-state.json, agent-log.md, tracker-state.json, otel-spans.jsonl
|
|
7
|
+
# or task-report.md.
|
|
7
8
|
# These accumulate forever. This prunes whole task dirs, with optional age /
|
|
8
9
|
# project / task filters.
|
|
9
10
|
#
|
|
@@ -133,7 +134,8 @@ fi
|
|
|
133
134
|
is_task_dir() {
|
|
134
135
|
local d="$1"
|
|
135
136
|
[ -f "$d/agent-state.json" ] || [ -f "$d/tracker-state.json" ] ||
|
|
136
|
-
[ -f "$d/agent-log.md" ] || [ -f "$d/otel-spans.jsonl" ]
|
|
137
|
+
[ -f "$d/agent-log.md" ] || [ -f "$d/otel-spans.jsonl" ] ||
|
|
138
|
+
[ -f "$d/task-report.md" ]
|
|
137
139
|
}
|
|
138
140
|
|
|
139
141
|
# Names promised to survive pruning. A directory carrying one of these names
|