teamsmith 0.3.4 → 0.4.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/README.md +8 -8
- package/package.json +1 -1
- package/skills/teamsmith/CHANGELOG.md +40 -0
- package/skills/teamsmith/SKILL.md +83 -163
- package/skills/teamsmith/extension/team-notify.ts +1 -1
- package/skills/teamsmith/extension/team-reply.ts +105 -0
- package/skills/teamsmith/references/agent-adapters.md +1 -1
- package/skills/teamsmith/references/config.md +20 -11
- package/skills/teamsmith/references/migration.md +47 -3
- package/skills/teamsmith/references/protocol.md +64 -31
- package/skills/teamsmith/references/reminders.md +131 -0
- package/skills/teamsmith/references/troubleshooting.md +19 -5
- package/skills/teamsmith/references/workflows.md +18 -16
- package/skills/teamsmith/scripts/lib/cmd-agents.sh +77 -49
- package/skills/teamsmith/scripts/lib/cmd-project.sh +193 -21
- package/skills/teamsmith/scripts/lib/cmd-remind.sh +103 -0
- package/skills/teamsmith/scripts/lib/cmd-update.sh +7 -4
- package/skills/teamsmith/scripts/lib/common.sh +44 -4
- package/skills/teamsmith/scripts/lib/outbox.sh +72 -18
- package/skills/teamsmith/scripts/remind-store.mjs +529 -0
- package/skills/teamsmith/scripts/replies.mjs +9 -3
- package/skills/teamsmith/scripts/reply-capture.mjs +612 -0
- package/skills/teamsmith/scripts/state-authority.mjs +500 -0
- package/skills/teamsmith/scripts/strings/commands.tsv +2 -1
- package/skills/teamsmith/scripts/strings/help.en.tsv +16 -2
- package/skills/teamsmith/scripts/strings/help.zh.tsv +16 -2
- package/skills/teamsmith/scripts/team +1 -0
- package/skills/teamsmith/templates/AGENTS.section.md.tmpl +68 -123
- package/skills/teamsmith/templates/PROTOCOL.md.tmpl +48 -55
- package/skills/teamsmith/templates/pm-prompt.md.tmpl +126 -119
- package/skills/teamsmith/tests/checkout-shape-probe.sh +6 -5
- package/skills/teamsmith/tests/delivery-truth.sh +82 -47
- package/skills/teamsmith/tests/fixtures/delivery-truth-real/README.md +71 -23
- package/skills/teamsmith/tests/fixtures/delivery-truth-real/__pycache__/judge-second.cpython-313.pyc +0 -0
- package/skills/teamsmith/tests/fixtures/delivery-truth-real/judge-dirty-ab.py +143 -0
- package/skills/teamsmith/tests/fixtures/delivery-truth-real/judge-second.py +26 -9
- package/skills/teamsmith/tests/fixtures/delivery-truth-real/run-case.sh +92 -20
- package/skills/teamsmith/tests/fixtures/delivery-truth-real/scenario.sh +47 -3
- package/skills/teamsmith/tests/fixtures/reply-capture-provider.ts +76 -0
- package/skills/teamsmith/tests/flip-p410-order2.sh +205 -0
- package/skills/teamsmith/tests/frames/README.md +3 -1
- package/skills/teamsmith/tests/gate-guard.sh +20 -4
- package/skills/teamsmith/tests/help-surface.sh +60 -2
- package/skills/teamsmith/tests/install-shape.sh +312 -0
- package/skills/teamsmith/tests/key-replies-pty.sh +197 -21
- package/skills/teamsmith/tests/key-replies.sh +187 -68
- package/skills/teamsmith/tests/ledger-claim.sh +8 -6
- package/skills/teamsmith/tests/lib/box-judge.sh +2 -1
- package/skills/teamsmith/tests/lib/main-team-fingerprint.sh +104 -0
- package/skills/teamsmith/tests/lib/pm-window.sh +143 -0
- package/skills/teamsmith/tests/lib/reply-fixture.sh +7 -19
- package/skills/teamsmith/tests/lib/reply-guard.sh +188 -0
- package/skills/teamsmith/tests/lib/section-calls.pl +171 -0
- package/skills/teamsmith/tests/loop-inventory.tsv +7 -5
- package/skills/teamsmith/tests/meta-suite.sh +215 -0
- package/skills/teamsmith/tests/panel-b3-pty-mouse.py +154 -17
- package/skills/teamsmith/tests/panel-b3.sh +33 -4
- package/skills/teamsmith/tests/remind-cli.sh +574 -0
- package/skills/teamsmith/tests/reply-capture-real.mjs +360 -0
- package/skills/teamsmith/tests/reply-capture-real.sh +5 -0
- package/skills/teamsmith/tests/reply-capture.mjs +756 -0
- package/skills/teamsmith/tests/section-paths.tsv +40 -9
- package/skills/teamsmith/tests/section-select.sh +180 -26
- package/skills/teamsmith/tests/smoke.sh +1235 -238
- package/skills/teamsmith/tests/state-authority-node.mjs +42 -0
- package/skills/teamsmith/tests/state-authority.sh +629 -0
- package/skills/teamsmith/tests/workflow-entry.sh +123 -3
- package/skills/teamsmith-init/SKILL.md +1 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
# 由 scripts/team 与各 cmd-*.sh source;不要直接执行。
|
|
4
4
|
# 约定:所有函数名以 team_ 前缀;不依赖 jq / python / node。
|
|
5
5
|
|
|
6
|
-
TEAM_VERSION="0.
|
|
6
|
+
TEAM_VERSION="0.4.1"
|
|
7
7
|
|
|
8
8
|
# ---------------------------------------------------------------- 输出
|
|
9
9
|
if [ -t 1 ] && [ -z "${NO_COLOR:-}" ]; then
|
|
@@ -1642,6 +1642,43 @@ team_with_lock() ( # <resource> <command> [args...]
|
|
|
1642
1642
|
"$@"
|
|
1643
1643
|
)
|
|
1644
1644
|
|
|
1645
|
+
# ---------------------------------------------------------------- 项目状态权威(P406 · agent-self-reminder 1.1/1.2)
|
|
1646
|
+
# 一个状态根、一份版本化快照、一把 flock 事务锁:CLI / Pulse(Bash)与 Pi(Node)共用
|
|
1647
|
+
# scripts/state-authority.mjs 这一份实现。这里只做身份与入口 —— 锁、原子写、快照校验、错误语义
|
|
1648
|
+
# 全在助手里。**没有**不持锁的落回路径:缺 flock / 等锁超时 / 快照读不懂都是显式失败。
|
|
1649
|
+
#
|
|
1650
|
+
# 身份只认目录:继承的 TEAM_MAIN_ROOT 只有在与当前目录所属项目一致时才接受;不一致 → 拒绝
|
|
1651
|
+
# (不挑一个状态权威、也不把提醒/Standby 写进另一个项目)。状态根本身由项目自己的定位器钉住:
|
|
1652
|
+
# 首次使用写 <main>/.pi/team/reminder-locator.json,之后每次比对 —— 改 override 需要显式迁移。
|
|
1653
|
+
team_authority_main_root() { # → 本项目的物理主工作树(继承值必须与目录一致)
|
|
1654
|
+
local inherited="${TEAM_MAIN_ROOT:-}" dir_main main
|
|
1655
|
+
dir_main="$(team_main_root)" || dir_main="" # 留:不在 git 仓库里 = 空答案,下一行具名拒绝
|
|
1656
|
+
[ -n "$dir_main" ] || { team_err "state-authority:当前目录不在 git 工作树里,定不出项目主工作树"; return 1; }
|
|
1657
|
+
main="${inherited:-$dir_main}"
|
|
1658
|
+
if [ -n "$inherited" ] && [ "$(team_identity_norm_dir "$inherited")" != "$(team_identity_norm_dir "$dir_main")" ]; then
|
|
1659
|
+
team_err "state-authority:继承的 TEAM_MAIN_ROOT=$inherited 与当前目录所属项目($dir_main)不一致 —— 不挑一个状态权威;清掉继承值或 cd 到目标项目"
|
|
1660
|
+
return 1
|
|
1661
|
+
fi
|
|
1662
|
+
printf '%s\n' "$main"
|
|
1663
|
+
}
|
|
1664
|
+
team_authority_cli() { # <resolve|init|read|allocate> [参数];助手自己取 flock,这里只解析运行时
|
|
1665
|
+
local runner main state
|
|
1666
|
+
runner="$(team_js_runner)"
|
|
1667
|
+
[ -n "$runner" ] || { team_err "state-authority:缺 JS 运行时(node/bun/tsx 都解析不到)—— 装一个或设 TEAM_JS_BIN 指向绝对路径"; return 1; }
|
|
1668
|
+
main="$(team_authority_main_root)" || return 1
|
|
1669
|
+
state="${TEAM_STATE_DIR:-}"
|
|
1670
|
+
[ -n "$state" ] || { team_err "state-authority:TEAM_STATE_DIR 未解析(先 team_load_config)"; return 1; }
|
|
1671
|
+
"$runner" "${TEAM_SKILL_DIR:-$(team_skill_dir)}/scripts/state-authority.mjs" --cli "$main" "$state" "$@"
|
|
1672
|
+
}
|
|
1673
|
+
team_authority_state_root() { team_authority_cli resolve --print stateRoot; }
|
|
1674
|
+
team_authority_init() { team_authority_cli init; }
|
|
1675
|
+
team_authority_read() { team_authority_cli read; }
|
|
1676
|
+
team_authority_allocate() { # <reminder|batch|queue> → 分配到的序号(持久 high-water,不重用)
|
|
1677
|
+
local kind="${1:-}"
|
|
1678
|
+
[ -n "$kind" ] || { team_err "state-authority:allocate 需要序号类别(reminder|batch|queue)"; return 1; }
|
|
1679
|
+
team_authority_cli allocate "$kind" --print value
|
|
1680
|
+
}
|
|
1681
|
+
|
|
1645
1682
|
team_identity_snapshot() { # One bounded DATA snapshot, for worker and PM records.
|
|
1646
1683
|
local f="$1" data='' bytes
|
|
1647
1684
|
TEAM_IDENTITY_DATA=''; TEAM_IDENTITY_DIAGNOSTIC='missing identity record'
|
|
@@ -3237,7 +3274,7 @@ team_pm_abort_uncommitted() { # only the window started by this attempt
|
|
|
3237
3274
|
team_tmux_kill_window "$target" || { team_err "uncommitted PM stop failed: $target;检查保存的诊断"; return 1; }
|
|
3238
3275
|
}
|
|
3239
3276
|
|
|
3240
|
-
team_pm_pi_args() { # PM
|
|
3277
|
+
team_pm_pi_args() { # PM 定向加载 bg/inbox-watch/reply,不加载 notify;默认 -c 延续本目录上一个会话
|
|
3241
3278
|
team_pm_identity_guard || return 1
|
|
3242
3279
|
local model="$(team_pm_model_resolve)" args=()
|
|
3243
3280
|
args=(--provider "${model%%/*}" --model "${model#*/}")
|
|
@@ -3245,6 +3282,7 @@ team_pm_pi_args() { # PM 不加载 notify 扩展(它就是收件人),但
|
|
|
3245
3282
|
[ -d "$TEAM_SKILL_DIR" ] && args+=(-e "$TEAM_SKILL_DIR/extension/team-bg.ts")
|
|
3246
3283
|
# M30:PM 的收件箱监视唤醒(投递换道:pi 通道不再往输入框粘贴)
|
|
3247
3284
|
[ -d "$TEAM_SKILL_DIR" ] && args+=(-e "$TEAM_SKILL_DIR/extension/team-inbox-watch.ts")
|
|
3285
|
+
[ -d "$TEAM_SKILL_DIR" ] && args+=(-e "$TEAM_SKILL_DIR/extension/team-reply.ts")
|
|
3248
3286
|
[ -d "$TEAM_SKILL_DIR" ] && args+=(--skill "$TEAM_SKILL_DIR")
|
|
3249
3287
|
# 续跑参数(M8.1):TEAM_PM_SESSION_ID > 显式 TEAM_PM_RESUME_ARGS > 历史的 -c。
|
|
3250
3288
|
# 默认三个都空 = 与历史逐字节一致;显式配了 resume 参数就换掉默认的 -c(同一套键也服务于自定义 CLI)。
|
|
@@ -3533,8 +3571,10 @@ team_pm_launch_cmd() { # <prompt_file> <spawn_file> → respawn-pane 的 shell-c
|
|
|
3533
3571
|
if [ -z "$(team_trim "${TEAM_PM_CMD:-}")" ]; then
|
|
3534
3572
|
pi_bin="$(team_pm_bin_path)"
|
|
3535
3573
|
# M40:启动前先清洗身份 env(继承的 TEAM_* 一律清掉,只写本命令推导出的身份)
|
|
3536
|
-
printf '%s%
|
|
3537
|
-
"$(team_identity_env_prefix "$TEAM_MAIN_ROOT")" "$(team_tmux_shim_exports)"
|
|
3574
|
+
printf '%s%sexport TEAM_STATE_DIR=%q TEAM_CONFIG_FILE=%q TEAM_PM_WINDOW=%q; cd %q && printf "%%s\\n" $$ > %q && exec %q %s @%q' \
|
|
3575
|
+
"$(team_identity_env_prefix "$TEAM_MAIN_ROOT")" "$(team_tmux_shim_exports)" \
|
|
3576
|
+
"$TEAM_STATE_DIR" "${TEAM_CONFIG:-${TEAM_CONFIG_FILE:-}}" "$TEAM_PM_WINDOW" \
|
|
3577
|
+
"$TEAM_MAIN_ROOT" "$spawnfile" "$pi_bin" "$(team_pm_pi_args)" "$pf"
|
|
3538
3578
|
return 0
|
|
3539
3579
|
fi
|
|
3540
3580
|
expanded="$(team_agent_expand pm "$TEAM_PM_CMD" pm "${TEAM_PM_SESSION_ID:-}" \
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
# 投递 = 写 durable 收件箱 + 往 `state/inbox-watch/<key>.wake` 追加一行指针;会话里的扩展读到
|
|
15
15
|
# 就 `sendMessage(triggerTurn)` 唤醒 —— **一个键都不碰**。五次 draft-race 事故(D20/M17/M24/…)
|
|
16
16
|
# 的结论:框检测判不准「人的草稿 vs 我们刚贴进去的 payload」,所以 pi 通道换道而不是继续修。
|
|
17
|
-
# 粘贴路径(守卫 + 收回)保留给非 pi target
|
|
17
|
+
# 粘贴路径(守卫 + 收回)保留给非 pi target、没有可用 watcher 的默认 `say` 直投尝试,以及人的显式
|
|
18
|
+
# 逃生门(`outbox flush --now` / `draft send --now`)。
|
|
18
19
|
#
|
|
19
20
|
# 已知的诚实边界(写进 references/troubleshooting.md §3,不许静默):
|
|
20
21
|
# - 只有空白的草稿会被判成 EMPTY(光标相对检测法的实测盲区);
|
|
@@ -1661,13 +1662,16 @@ team_outbox_note() { # <ok|warn|plain> <文本>:--quiet 时整段静音(警
|
|
|
1661
1662
|
esac
|
|
1662
1663
|
}
|
|
1663
1664
|
|
|
1664
|
-
team_outbox_process_entry() { # <entry> [--now] [--no-verify]
|
|
1665
|
+
team_outbox_process_entry() { # <entry> [--now] [--no-verify] [--watch-only]
|
|
1665
1666
|
local e="$1"; shift
|
|
1666
|
-
local now=0 noverify=0
|
|
1667
|
+
local now=0 noverify=0 watch_only=0
|
|
1667
1668
|
while [ $# -gt 0 ]; do
|
|
1668
1669
|
case "$1" in
|
|
1669
1670
|
--now) now=1; shift ;;
|
|
1670
1671
|
--no-verify) noverify=1; shift ;;
|
|
1672
|
+
# P393 · 私有的一次性模式(只有「已选中监视通道的默认 say」会传):本次只走监视通道;
|
|
1673
|
+
# 路由消失/持久化失败就留下条目,绝不换道去打字。不进队头、不持久化、不影响后续普通排水。
|
|
1674
|
+
--watch-only) watch_only=1; shift ;;
|
|
1671
1675
|
*) shift ;;
|
|
1672
1676
|
esac
|
|
1673
1677
|
done
|
|
@@ -1731,6 +1735,17 @@ team_outbox_process_entry() { # <entry> [--now] [--no-verify]
|
|
|
1731
1735
|
fi
|
|
1732
1736
|
team_outbox_note warn "outbox:$(basename "$e") pi 通道投递失败(收件箱写不进去)→ 留在队列重试"
|
|
1733
1737
|
team_outbox_release "$e"
|
|
1738
|
+
TEAM_OUTBOX_CHANNEL="watch-pending"
|
|
1739
|
+
TEAM_OUTBOX_RESULT="queued"
|
|
1740
|
+
return 0
|
|
1741
|
+
fi
|
|
1742
|
+
|
|
1743
|
+
# P393:已选中的监视通道本次不可用(路由已消失)—— 条目留在队列、零按键;
|
|
1744
|
+
# 不落到下面的 EMPTY/BUSY 守卫,也不走 forced。后续普通排水仍是原来的受守卫排水。
|
|
1745
|
+
if [ "$watch_only" = "1" ]; then
|
|
1746
|
+
team_outbox_note warn "outbox:$(basename "$e") 已选中的监视通道路由已消失 → 留在队列(本次不打字)"
|
|
1747
|
+
team_outbox_release "$e"
|
|
1748
|
+
TEAM_OUTBOX_CHANNEL="watch-pending"
|
|
1734
1749
|
TEAM_OUTBOX_RESULT="queued"
|
|
1735
1750
|
return 0
|
|
1736
1751
|
fi
|
|
@@ -1946,7 +1961,10 @@ team_outbox_drain() { # [--now] [--quiet] [--max N] [--retry-impeded]
|
|
|
1946
1961
|
# 所有「往 TUI 输入框打字」的发送方都走这里。设置 TEAM_SEND_OUTCOME:
|
|
1947
1962
|
# delivered(已确认送达)|watched(pi 监视通道:已写收件箱 + 唤醒指针,输入框零按键)|queued(进队列了)
|
|
1948
1963
|
# |held(阻碍 hold:geometry-untrusted / queue-stalled,返回非 0)
|
|
1949
|
-
# |forced(--now
|
|
1964
|
+
# |forced(--now 或 kind=say 的默认直投:一次尝试,不是回执)
|
|
1965
|
+
# |offline-handled(say 的直投前检查已把消息落收件箱并解释原因)
|
|
1966
|
+
# |persist-failed(已选监视通道但队列条目写不进去:非零持久化错误)
|
|
1967
|
+
# |unknown-sent|unknown-failed|offline|duplicate
|
|
1950
1968
|
team_send_guarded() { # <target> <payload> <kind> [--from F] [--dedup K] [--inbox A] [--inbox-written A] [--now] [--no-verify] [--meeting-ledger V]
|
|
1951
1969
|
local target="$1" payload="$2" kind="$3"; shift 3
|
|
1952
1970
|
local from="-" dedup="" inbox="" inbox_written="" now=0 noverify=0 queue_offline=0 meeting_ledger=""
|
|
@@ -1966,11 +1984,40 @@ team_send_guarded() { # <target> <payload> <kind> [--from F] [--dedup K] [--inbo
|
|
|
1966
1984
|
TEAM_SEND_OUTCOME=""
|
|
1967
1985
|
TEAM_SEND_ENTRY=""
|
|
1968
1986
|
TEAM_SEND_REASON=""
|
|
1969
|
-
local entry="" rc=0 v=""
|
|
1987
|
+
local entry="" rc=0 v="" watch_route="" default_direct=0 watch_only=0
|
|
1970
1988
|
|
|
1971
|
-
|
|
1989
|
+
# M30 · pi 通道:目标装了 inbox-watch 扩展(活的注册)→ 不查输入框、不判 SHELL/NOPANE
|
|
1990
|
+
# (那些问题问的是「能不能打字」;pi 通道根本不打字),直接入队,投递由 process_entry 走收件箱 + spool。
|
|
1991
|
+
# P393:这一次查询同时就是 fresh `kind=say` 的路由选择(watch 优先)。
|
|
1992
|
+
[ "$now" = "1" ] || watch_route="$(team_inbox_watch_route "$target" 2>/dev/null || true)"
|
|
1993
|
+
|
|
1994
|
+
# P393 · 默认 say = 先 watch、没有可用 watcher 才走旧 forced 动作。
|
|
1995
|
+
# 意图只由**这次发送**的 kind=say 解释(不是新的 flag,也不进入队头/排水):
|
|
1996
|
+
# team_outbox_process_entry 不按 kind 强制,所以后续普通排水仍是受守卫的排水。
|
|
1997
|
+
# 目标资格检查(窗口/死 pane/空提示符)在决定直投的这一刻、按键之前做(team_say_prepare_direct)。
|
|
1998
|
+
if [ "$kind" = "say" ] && [ "$now" != "1" ] && [ -n "$inbox" ]; then
|
|
1999
|
+
if [ -z "$watch_route" ]; then
|
|
2000
|
+
local prep=0
|
|
2001
|
+
team_say_prepare_direct "$inbox" "$target" "$payload" || prep=$?
|
|
2002
|
+
case "$prep" in
|
|
2003
|
+
0) default_direct=1 ;;
|
|
2004
|
+
*) # 已经离线处理完(收件箱已写、原因已打印):不重复追加、不打字
|
|
2005
|
+
TEAM_SEND_OUTCOME="offline-handled"
|
|
2006
|
+
return 0 ;;
|
|
2007
|
+
esac
|
|
2008
|
+
else
|
|
2009
|
+
watch_only=1 # 已选中监视通道:这次即时处理只走监视通道,路由/持久化失败不换道
|
|
2010
|
+
fi
|
|
2011
|
+
fi
|
|
2012
|
+
|
|
2013
|
+
if [ "$now" = "1" ] || [ "$default_direct" = "1" ]; then
|
|
1972
2014
|
team_outbox_force_log "$target" "$kind" "$from"
|
|
1973
|
-
|
|
2015
|
+
if [ "$now" = "1" ]; then
|
|
2016
|
+
team_warn "--now:跳过守卫,直接往 $target 打字(今天的旧行为,已记入 outbox/forced.log)"
|
|
2017
|
+
else
|
|
2018
|
+
# 只由 kind=say 的默认直投走到这里:决不展示已退休的 flag,也不声称已确认送达。
|
|
2019
|
+
team_warn "say:没有可用的监视通道,直接往 $target 打字(立即尝试,未确认模型接收;已记入 outbox/forced.log)"
|
|
2020
|
+
fi
|
|
1974
2021
|
local before="" i after="" text
|
|
1975
2022
|
text="$(team_deliver_text "$target" "$payload")"
|
|
1976
2023
|
[ "$noverify" = "1" ] || before="$(team_pane_snapshot "$target")"
|
|
@@ -1997,10 +2044,7 @@ team_send_guarded() { # <target> <payload> <kind> [--from F] [--dedup K] [--inbo
|
|
|
1997
2044
|
elif [ -n "$inbox" ]; then enq+=(--inbox "$inbox"); fi
|
|
1998
2045
|
enq+=(--payload "$payload")
|
|
1999
2046
|
|
|
2000
|
-
# M30 · pi
|
|
2001
|
-
# (那些问题问的是「能不能打字」;pi 通道根本不打字),直接入队,投递由 process_entry 走收件箱 + spool。
|
|
2002
|
-
local watch_route=""
|
|
2003
|
-
[ "$now" = "1" ] || watch_route="$(team_inbox_watch_route "$target" 2>/dev/null || true)"
|
|
2047
|
+
# M30 · pi 通道:见上面的路由选择(watch_route 已在进入时查询过;显式 --now 不查)
|
|
2004
2048
|
if [ -n "$watch_route" ]; then
|
|
2005
2049
|
v="" # pi 通道:不打字,就不需要判 SHELL/NOPANE/BUSY
|
|
2006
2050
|
else
|
|
@@ -2044,13 +2088,19 @@ team_send_guarded() { # <target> <payload> <kind> [--from F] [--dedup K] [--inbo
|
|
|
2044
2088
|
TEAM_SEND_OUTCOME="duplicate"
|
|
2045
2089
|
return 0
|
|
2046
2090
|
fi
|
|
2047
|
-
[ -n "$entry" ] && [ -f "$entry" ] || {
|
|
2091
|
+
[ -n "$entry" ] && [ -f "$entry" ] || {
|
|
2092
|
+
# P393:已选中监视通道却连队列条目都建不起来 = 真实持久化失败。不许报 offline(那不是离线)、
|
|
2093
|
+
# 不许报 queued/收件箱成功,也不许因此改成盲直投 —— 调用方保持这个非零错误。
|
|
2094
|
+
if [ -n "$watch_route" ]; then
|
|
2095
|
+
TEAM_SEND_OUTCOME="persist-failed"
|
|
2096
|
+
return 1
|
|
2097
|
+
fi
|
|
2098
|
+
TEAM_SEND_OUTCOME="offline"; return 1; }
|
|
2048
2099
|
TEAM_SEND_ENTRY="$entry"
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
fi
|
|
2100
|
+
local pa=()
|
|
2101
|
+
[ "$watch_only" = "1" ] && pa+=(--watch-only)
|
|
2102
|
+
[ "$noverify" = "1" ] && pa+=(--no-verify)
|
|
2103
|
+
team_outbox_process_entry "$entry" ${pa[@]+"${pa[@]}"}
|
|
2054
2104
|
case "$TEAM_OUTBOX_RESULT" in
|
|
2055
2105
|
delivered)
|
|
2056
2106
|
if [ "$TEAM_OUTBOX_CHANNEL" = "watch" ]; then TEAM_SEND_OUTCOME="watched"
|
|
@@ -2064,7 +2114,11 @@ team_send_guarded() { # <target> <payload> <kind> [--from F] [--dedup K] [--inbo
|
|
|
2064
2114
|
return 1
|
|
2065
2115
|
fi
|
|
2066
2116
|
TEAM_SEND_OUTCOME="queued" ;;
|
|
2067
|
-
*)
|
|
2117
|
+
*)
|
|
2118
|
+
TEAM_SEND_OUTCOME="queued"
|
|
2119
|
+
# P393:监视通道在这次即时处理里没走完(路由消失/收件箱写不进去):条目留在队列,
|
|
2120
|
+
# 本次零按键;调用方的输出不能说成「目标有草稿」。
|
|
2121
|
+
[ "$TEAM_OUTBOX_CHANNEL" = "watch-pending" ] && TEAM_SEND_REASON="watch-pending" ;;
|
|
2068
2122
|
esac
|
|
2069
2123
|
return 0
|
|
2070
2124
|
}
|