@ianwremmel/dispatch 0.32.1-bootstrap.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/.claude-plugin/plugin.json +59 -0
- package/.mcp.json +8 -0
- package/LICENSE +21 -0
- package/README.md +93 -0
- package/agents/.gitkeep +0 -0
- package/agents/build-graph.md +99 -0
- package/agents/milestone-reviewer.md +50 -0
- package/agents/pr-worker.md +172 -0
- package/agents/ticket-worker.md +97 -0
- package/bin/dispatch +101 -0
- package/bin/dispatch-mcp +19 -0
- package/bin/pr-status +931 -0
- package/commands/.gitkeep +0 -0
- package/commands/orchestrate.md +6 -0
- package/hooks/.gitkeep +0 -0
- package/hooks/claim-guard.mts +98 -0
- package/hooks/hooks.json +15 -0
- package/package.json +46 -0
- package/skills/.gitkeep +0 -0
- package/skills/land/SKILL.md +238 -0
- package/skills/land/credentials-dedicated.md +33 -0
- package/skills/land/credentials-shared.md +76 -0
- package/skills/land/mode-solo.md +76 -0
- package/skills/land/mode-team.md +103 -0
- package/skills/land/reference.md +152 -0
- package/skills/land/ticket.md +94 -0
- package/skills/orchestrate/SKILL.md +87 -0
- package/skills/tracker-adapter-linear/SKILL.md +142 -0
- package/src/commands/CLAUDE.md +12 -0
- package/src/commands/claim/check.mts +88 -0
- package/src/commands/claim/guard.mts +95 -0
- package/src/commands/claim/status.mts +49 -0
- package/src/commands/edge/add.mts +44 -0
- package/src/commands/edge/rm.mts +44 -0
- package/src/commands/edge/set.mts +56 -0
- package/src/commands/greet.mts +34 -0
- package/src/commands/mcp/ack.mts +43 -0
- package/src/commands/mcp/ping.mts +61 -0
- package/src/commands/mcp/status.mts +89 -0
- package/src/commands/mcp.mts +155 -0
- package/src/commands/milestone/rm.mts +35 -0
- package/src/commands/milestone/set.mts +49 -0
- package/src/commands/outcome/rm.mts +36 -0
- package/src/commands/outcome/set.mts +86 -0
- package/src/commands/pr/rm.mts +33 -0
- package/src/commands/pr/set.mts +110 -0
- package/src/commands/pr/yield.mts +114 -0
- package/src/commands/project/rm.mts +33 -0
- package/src/commands/project/set.mts +50 -0
- package/src/commands/queue.mts +41 -0
- package/src/commands/refresh/done.mts +42 -0
- package/src/commands/refresh/status.mts +40 -0
- package/src/commands/refresh.mts +56 -0
- package/src/commands/review/record.mts +46 -0
- package/src/commands/review/release.mts +49 -0
- package/src/commands/status.mts +85 -0
- package/src/commands/ticket/missing.mts +31 -0
- package/src/commands/ticket/rm.mts +33 -0
- package/src/commands/ticket/set.mts +134 -0
- package/src/commands/worker/rm.mts +46 -0
- package/src/commands/worker/set.mts +63 -0
- package/src/lib/cli/CLAUDE.md +13 -0
- package/src/lib/cli/cli.mts +226 -0
- package/src/lib/cli/index.mts +1 -0
- package/src/lib/command/CLAUDE.md +26 -0
- package/src/lib/command/__fixtures__/bad-export/oops.mts +1 -0
- package/src/lib/command/__fixtures__/bad-name/mismatch.mts +19 -0
- package/src/lib/command/__fixtures__/commands/cli-only.mts +20 -0
- package/src/lib/command/__fixtures__/commands/greet.mts +39 -0
- package/src/lib/command/__fixtures__/commands/math/add.mts +32 -0
- package/src/lib/command/__fixtures__/commands/mcp-only.mts +20 -0
- package/src/lib/command/__fixtures__/commands/needs-token.mts +19 -0
- package/src/lib/command/__fixtures__/commands/store/get.mts +26 -0
- package/src/lib/command/__fixtures__/commands/store.mts +26 -0
- package/src/lib/command/abstract-command.mts +104 -0
- package/src/lib/command/discovery.mts +100 -0
- package/src/lib/command/env.mts +19 -0
- package/src/lib/command/index.mts +6 -0
- package/src/lib/command/parse.mts +64 -0
- package/src/lib/command/test-support.mts +81 -0
- package/src/lib/command/transports.mts +17 -0
- package/src/lib/command/types.mts +53 -0
- package/src/lib/db/CLAUDE.md +13 -0
- package/src/lib/db/database.mts +160 -0
- package/src/lib/db/index.mts +4 -0
- package/src/lib/db/schema.mts +195 -0
- package/src/lib/db/time.mts +24 -0
- package/src/lib/db/with-database.mts +56 -0
- package/src/lib/errors/CLAUDE.md +18 -0
- package/src/lib/errors/command-error.mts +13 -0
- package/src/lib/errors/data-error.mts +12 -0
- package/src/lib/errors/definition-error.mts +6 -0
- package/src/lib/errors/dispatch-error.mts +27 -0
- package/src/lib/errors/ensure.mts +22 -0
- package/src/lib/errors/environment-error.mts +7 -0
- package/src/lib/errors/index.mts +8 -0
- package/src/lib/errors/json-rpc-error.mts +18 -0
- package/src/lib/errors/usage-error.mts +7 -0
- package/src/lib/graph/CLAUDE.md +17 -0
- package/src/lib/graph/anomalies.mts +110 -0
- package/src/lib/graph/derive.mts +96 -0
- package/src/lib/graph/index.mts +26 -0
- package/src/lib/graph/pipeline.mts +410 -0
- package/src/lib/graph/queries.mts +207 -0
- package/src/lib/graph/rows.mts +99 -0
- package/src/lib/graph/types.mts +137 -0
- package/src/lib/liveness/CLAUDE.md +14 -0
- package/src/lib/liveness/index.mts +10 -0
- package/src/lib/liveness/liveness.mts +147 -0
- package/src/lib/liveness/retire.mts +63 -0
- package/src/lib/logger/CLAUDE.md +12 -0
- package/src/lib/logger/index.mts +2 -0
- package/src/lib/logger/logger.mts +58 -0
- package/src/lib/logger/stream-sink.mts +23 -0
- package/src/lib/mcp/CLAUDE.md +21 -0
- package/src/lib/mcp/channel.mts +41 -0
- package/src/lib/mcp/dispatch.mts +60 -0
- package/src/lib/mcp/drain.mts +83 -0
- package/src/lib/mcp/index.mts +5 -0
- package/src/lib/mcp/mcp.mts +267 -0
- package/src/lib/mcp/tools.mts +77 -0
- package/src/lib/model/CLAUDE.md +8 -0
- package/src/lib/model/index.mts +3 -0
- package/src/lib/model/repo-caps.mts +95 -0
- package/src/lib/model/status.mts +91 -0
- package/src/lib/model/types.mts +83 -0
- package/src/lib/refresh/index.mts +2 -0
- package/src/lib/refresh/placeholders.mts +43 -0
- package/src/lib/refresh/refresh-service.mts +203 -0
- package/src/lib/schedule/CLAUDE.md +18 -0
- package/src/lib/schedule/caps.mts +113 -0
- package/src/lib/schedule/correlate.mts +69 -0
- package/src/lib/schedule/index.mts +7 -0
- package/src/lib/schedule/scheduler.mts +355 -0
- package/src/lib/schedule/tick.mts +266 -0
- package/src/lib/stores/CLAUDE.md +24 -0
- package/src/lib/stores/coordination.mts +359 -0
- package/src/lib/stores/cursor.mts +41 -0
- package/src/lib/stores/edge.mts +138 -0
- package/src/lib/stores/fetch-request.mts +346 -0
- package/src/lib/stores/index.mts +19 -0
- package/src/lib/stores/materialize.mts +69 -0
- package/src/lib/stores/milestone.mts +74 -0
- package/src/lib/stores/notice.mts +57 -0
- package/src/lib/stores/policy.mts +48 -0
- package/src/lib/stores/pr-event.mts +94 -0
- package/src/lib/stores/pr.mts +167 -0
- package/src/lib/stores/project.mts +79 -0
- package/src/lib/stores/refresh.mts +197 -0
- package/src/lib/stores/review.mts +113 -0
- package/src/lib/stores/session.mts +170 -0
- package/src/lib/stores/ticket.mts +246 -0
- package/src/lib/stores/watch.mts +360 -0
- package/src/lib/stores/worker.mts +121 -0
- package/src/lib/watch/adopt.mts +151 -0
- package/src/lib/watch/arm.mts +48 -0
- package/src/lib/watch/cadence.mts +45 -0
- package/src/lib/watch/diff.mts +274 -0
- package/src/lib/watch/index.mts +11 -0
- package/src/lib/watch/marker.mts +24 -0
- package/src/lib/watch/payload.mts +56 -0
- package/src/lib/watch/poll.mts +87 -0
- package/src/lib/watch/render.mts +61 -0
- package/src/lib/watch/snapshot.mts +312 -0
- package/src/main.mts +18 -0
package/bin/dispatch
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# dispatch — entry point for the plugin's TypeScript CLI.
|
|
3
|
+
#
|
|
4
|
+
# Usage: dispatch [--log-level <level>] <command> [args...]
|
|
5
|
+
#
|
|
6
|
+
# The plugin's bin/ directory is on PATH inside Claude Code, so skills can call
|
|
7
|
+
# `dispatch <command>` directly. This wrapper exists to fail with a legible
|
|
8
|
+
# message instead of a Node syntax error when the host's Node is missing or too
|
|
9
|
+
# old: the CLI ships as unbuilt .mts and relies on native type stripping, which
|
|
10
|
+
# older Node does not enable by default. MIN_NODE_VERSION is the floor the repo
|
|
11
|
+
# builds and tests against, not the earliest Node that could run the CLI.
|
|
12
|
+
#
|
|
13
|
+
# Set DISPATCH_NODE to run against a specific Node binary. The wrapper's own
|
|
14
|
+
# records honor DISPATCH_LOG_LEVEL (the CLI's --log-level flag is parsed later,
|
|
15
|
+
# by the CLI itself). Set DISPATCH_ENTRY to run a different entry point through
|
|
16
|
+
# the same version gate — the MCP server (`src/main.mts`) is one: `bin/dispatch-mcp`
|
|
17
|
+
# sets it and execs this wrapper, so the server's spawn clears the same floor
|
|
18
|
+
# without living behind `dispatch <command>`.
|
|
19
|
+
|
|
20
|
+
set -euo pipefail
|
|
21
|
+
|
|
22
|
+
readonly MIN_NODE_VERSION='24.18.0'
|
|
23
|
+
readonly LOG_LEVEL="${DISPATCH_LOG_LEVEL:-info}"
|
|
24
|
+
|
|
25
|
+
here="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
|
|
26
|
+
readonly here
|
|
27
|
+
readonly cli="${DISPATCH_ENTRY:-${here}/../src/main.mts}"
|
|
28
|
+
|
|
29
|
+
# Wrapper diagnostics are logfmt on stderr, matching the CLI's own records.
|
|
30
|
+
# Values containing spaces must arrive already quoted by the caller.
|
|
31
|
+
log_debug() {
|
|
32
|
+
[[ "$LOG_LEVEL" == 'debug' ]] || return 0
|
|
33
|
+
printf 'ts=%s level=debug component=dispatch-wrapper' \
|
|
34
|
+
"$(date -u '+%Y-%m-%dT%H:%M:%SZ')" >&2
|
|
35
|
+
printf ' %s' "$@" >&2
|
|
36
|
+
printf '\n' >&2
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
# Failures a caller must act on are plain text, not logfmt.
|
|
40
|
+
die() {
|
|
41
|
+
printf 'error: %s\n' "$1" >&2
|
|
42
|
+
exit "${2:-1}"
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
# True iff $1 sorts before $2 as a dotted numeric version. Missing components
|
|
46
|
+
# read as 0, so 24.18 == 24.18.0.
|
|
47
|
+
version_lt() {
|
|
48
|
+
local IFS='.'
|
|
49
|
+
local -a lhs rhs
|
|
50
|
+
read -r -a lhs <<<"$1"
|
|
51
|
+
read -r -a rhs <<<"$2"
|
|
52
|
+
|
|
53
|
+
local i l r
|
|
54
|
+
for i in 0 1 2; do
|
|
55
|
+
l="${lhs[i]:-0}"
|
|
56
|
+
r="${rhs[i]:-0}"
|
|
57
|
+
if ((10#$l < 10#$r)); then return 0; fi
|
|
58
|
+
if ((10#$l > 10#$r)); then return 1; fi
|
|
59
|
+
done
|
|
60
|
+
return 1
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
node_bin="${DISPATCH_NODE:-node}"
|
|
64
|
+
|
|
65
|
+
if ! node_path="$(command -v -- "$node_bin" 2>/dev/null)"; then
|
|
66
|
+
die "node not found (looked for '${node_bin}'). dispatch requires Node.js >= ${MIN_NODE_VERSION}: https://nodejs.org" 127
|
|
67
|
+
fi
|
|
68
|
+
|
|
69
|
+
if ! node_version_raw="$("$node_path" --version 2>/dev/null)"; then
|
|
70
|
+
die "'${node_path}' is not runnable as node ('--version' failed)." 127
|
|
71
|
+
fi
|
|
72
|
+
|
|
73
|
+
# v24.18.0 -> 24.18.0; v25.0.0-nightly20260101 -> 25.0.0 + prerelease
|
|
74
|
+
node_version="${node_version_raw#v}"
|
|
75
|
+
node_prerelease='false'
|
|
76
|
+
if [[ "$node_version" == *-* ]]; then
|
|
77
|
+
node_prerelease='true'
|
|
78
|
+
node_version="${node_version%%-*}"
|
|
79
|
+
fi
|
|
80
|
+
|
|
81
|
+
if [[ ! "$node_version" =~ ^[0-9]+(\.[0-9]+)*$ ]]; then
|
|
82
|
+
die "could not read a version from '${node_path} --version' (got '${node_version_raw}')."
|
|
83
|
+
fi
|
|
84
|
+
|
|
85
|
+
# A prerelease sorts before its own release (24.18.0-rc.1 < 24.18.0), so it only
|
|
86
|
+
# clears the gate when its numbers are strictly above the minimum.
|
|
87
|
+
too_old='false'
|
|
88
|
+
if version_lt "$node_version" "$MIN_NODE_VERSION"; then
|
|
89
|
+
too_old='true'
|
|
90
|
+
elif [[ "$node_prerelease" == 'true' ]] && ! version_lt "$MIN_NODE_VERSION" "$node_version"; then
|
|
91
|
+
too_old='true'
|
|
92
|
+
fi
|
|
93
|
+
|
|
94
|
+
if [[ "$too_old" == 'true' ]]; then
|
|
95
|
+
die "node ${node_version_raw} (${node_path}) is too old. dispatch requires Node.js >= ${MIN_NODE_VERSION}, which runs TypeScript sources natively."
|
|
96
|
+
fi
|
|
97
|
+
|
|
98
|
+
log_debug 'msg="node resolved"' "node_bin=${node_path}" "node_version=${node_version}" "min_node_version=${MIN_NODE_VERSION}"
|
|
99
|
+
log_debug 'msg="exec cli"' "cli=${cli}" "argc=$#"
|
|
100
|
+
|
|
101
|
+
exec "$node_path" "$cli" "$@"
|
package/bin/dispatch-mcp
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# dispatch-mcp — the MCP server entry point declared in .mcp.json.
|
|
3
|
+
#
|
|
4
|
+
# Usage: dispatch-mcp [args...]
|
|
5
|
+
#
|
|
6
|
+
# The server lives at src/main.mts, which is not the entry `dispatch` runs by
|
|
7
|
+
# default, and the MCP loader's handling of a server's `env` block is not
|
|
8
|
+
# specified — an environment it replaces rather than merges would leave
|
|
9
|
+
# bin/dispatch without a PATH to find node on. So the entry is set here, and the
|
|
10
|
+
# exec goes through bin/dispatch to keep the Node version gate in the path.
|
|
11
|
+
|
|
12
|
+
set -euo pipefail
|
|
13
|
+
|
|
14
|
+
here="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
|
|
15
|
+
readonly here
|
|
16
|
+
|
|
17
|
+
export DISPATCH_ENTRY="${here}/../src/main.mts"
|
|
18
|
+
|
|
19
|
+
exec "${here}/dispatch" mcp "$@"
|