agent-threader 2.0.5

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 (172) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +126 -0
  3. package/compiled/claude/agent-threader/SKILL.md +361 -0
  4. package/compiled/codex/agent-threader/SKILL.md +361 -0
  5. package/compiled/cursor/rules/agent-threader.mdc +367 -0
  6. package/compiled/cursor/skills/agent-threader/SKILL.md +361 -0
  7. package/compiled/opencode/agent-threader.md +361 -0
  8. package/compiled/windsurf/rules/agent-threader.md +361 -0
  9. package/compiled/windsurf/skills/agent-threader/SKILL.md +361 -0
  10. package/dist/cli/commands/doctor.d.ts +6 -0
  11. package/dist/cli/commands/doctor.d.ts.map +1 -0
  12. package/dist/cli/commands/doctor.js +7 -0
  13. package/dist/cli/commands/doctor.js.map +1 -0
  14. package/dist/cli/commands/explain-error.d.ts +12 -0
  15. package/dist/cli/commands/explain-error.d.ts.map +1 -0
  16. package/dist/cli/commands/explain-error.js +23 -0
  17. package/dist/cli/commands/explain-error.js.map +1 -0
  18. package/dist/cli/commands/init-state.d.ts +6 -0
  19. package/dist/cli/commands/init-state.d.ts.map +1 -0
  20. package/dist/cli/commands/init-state.js +10 -0
  21. package/dist/cli/commands/init-state.js.map +1 -0
  22. package/dist/cli/commands/logs.d.ts +6 -0
  23. package/dist/cli/commands/logs.d.ts.map +1 -0
  24. package/dist/cli/commands/logs.js +9 -0
  25. package/dist/cli/commands/logs.js.map +1 -0
  26. package/dist/cli/commands/parse-heal.d.ts +6 -0
  27. package/dist/cli/commands/parse-heal.d.ts.map +1 -0
  28. package/dist/cli/commands/parse-heal.js +5 -0
  29. package/dist/cli/commands/parse-heal.js.map +1 -0
  30. package/dist/cli/commands/parse-result.d.ts +6 -0
  31. package/dist/cli/commands/parse-result.d.ts.map +1 -0
  32. package/dist/cli/commands/parse-result.js +5 -0
  33. package/dist/cli/commands/parse-result.js.map +1 -0
  34. package/dist/cli/commands/status.d.ts +6 -0
  35. package/dist/cli/commands/status.d.ts.map +1 -0
  36. package/dist/cli/commands/status.js +5 -0
  37. package/dist/cli/commands/status.js.map +1 -0
  38. package/dist/cli/commands/validate-manifest.d.ts +6 -0
  39. package/dist/cli/commands/validate-manifest.d.ts.map +1 -0
  40. package/dist/cli/commands/validate-manifest.js +5 -0
  41. package/dist/cli/commands/validate-manifest.js.map +1 -0
  42. package/dist/cli/index.d.ts +6 -0
  43. package/dist/cli/index.d.ts.map +1 -0
  44. package/dist/cli/index.js +360 -0
  45. package/dist/cli/index.js.map +1 -0
  46. package/dist/cli/output-formatter.d.ts +6 -0
  47. package/dist/cli/output-formatter.d.ts.map +1 -0
  48. package/dist/cli/output-formatter.js +19 -0
  49. package/dist/cli/output-formatter.js.map +1 -0
  50. package/dist/index.d.ts +3 -0
  51. package/dist/index.d.ts.map +1 -0
  52. package/dist/index.js +5 -0
  53. package/dist/index.js.map +1 -0
  54. package/dist/lib/adapters/types.d.ts +40 -0
  55. package/dist/lib/adapters/types.d.ts.map +1 -0
  56. package/dist/lib/adapters/types.js +3 -0
  57. package/dist/lib/adapters/types.js.map +1 -0
  58. package/dist/lib/contracts/schema-validator.d.ts +15 -0
  59. package/dist/lib/contracts/schema-validator.d.ts.map +1 -0
  60. package/dist/lib/contracts/schema-validator.js +63 -0
  61. package/dist/lib/contracts/schema-validator.js.map +1 -0
  62. package/dist/lib/contracts/types.d.ts +91 -0
  63. package/dist/lib/contracts/types.d.ts.map +1 -0
  64. package/dist/lib/contracts/types.js +15 -0
  65. package/dist/lib/contracts/types.js.map +1 -0
  66. package/dist/lib/contracts/validate-manifest.d.ts +16 -0
  67. package/dist/lib/contracts/validate-manifest.d.ts.map +1 -0
  68. package/dist/lib/contracts/validate-manifest.js +123 -0
  69. package/dist/lib/contracts/validate-manifest.js.map +1 -0
  70. package/dist/lib/diagnostics/doctor.d.ts +17 -0
  71. package/dist/lib/diagnostics/doctor.d.ts.map +1 -0
  72. package/dist/lib/diagnostics/doctor.js +131 -0
  73. package/dist/lib/diagnostics/doctor.js.map +1 -0
  74. package/dist/lib/errors/explain-error.d.ts +10 -0
  75. package/dist/lib/errors/explain-error.d.ts.map +1 -0
  76. package/dist/lib/errors/explain-error.js +73 -0
  77. package/dist/lib/errors/explain-error.js.map +1 -0
  78. package/dist/lib/errors/types.d.ts +16 -0
  79. package/dist/lib/errors/types.d.ts.map +1 -0
  80. package/dist/lib/errors/types.js +50 -0
  81. package/dist/lib/errors/types.js.map +1 -0
  82. package/dist/lib/index.d.ts +29 -0
  83. package/dist/lib/index.d.ts.map +1 -0
  84. package/dist/lib/index.js +25 -0
  85. package/dist/lib/index.js.map +1 -0
  86. package/dist/lib/orchestrator/batch-strategy.d.ts +9 -0
  87. package/dist/lib/orchestrator/batch-strategy.d.ts.map +1 -0
  88. package/dist/lib/orchestrator/batch-strategy.js +34 -0
  89. package/dist/lib/orchestrator/batch-strategy.js.map +1 -0
  90. package/dist/lib/orchestrator/healing-policy.d.ts +47 -0
  91. package/dist/lib/orchestrator/healing-policy.d.ts.map +1 -0
  92. package/dist/lib/orchestrator/healing-policy.js +104 -0
  93. package/dist/lib/orchestrator/healing-policy.js.map +1 -0
  94. package/dist/lib/orchestrator/index.d.ts +11 -0
  95. package/dist/lib/orchestrator/index.d.ts.map +1 -0
  96. package/dist/lib/orchestrator/index.js +11 -0
  97. package/dist/lib/orchestrator/index.js.map +1 -0
  98. package/dist/lib/orchestrator/patch-validation.d.ts +9 -0
  99. package/dist/lib/orchestrator/patch-validation.d.ts.map +1 -0
  100. package/dist/lib/orchestrator/patch-validation.js +58 -0
  101. package/dist/lib/orchestrator/patch-validation.js.map +1 -0
  102. package/dist/lib/orchestrator/scheduling.d.ts +12 -0
  103. package/dist/lib/orchestrator/scheduling.d.ts.map +1 -0
  104. package/dist/lib/orchestrator/scheduling.js +74 -0
  105. package/dist/lib/orchestrator/scheduling.js.map +1 -0
  106. package/dist/lib/orchestrator/write-safety.d.ts +14 -0
  107. package/dist/lib/orchestrator/write-safety.d.ts.map +1 -0
  108. package/dist/lib/orchestrator/write-safety.js +44 -0
  109. package/dist/lib/orchestrator/write-safety.js.map +1 -0
  110. package/dist/lib/parser/parse-heal.d.ts +12 -0
  111. package/dist/lib/parser/parse-heal.d.ts.map +1 -0
  112. package/dist/lib/parser/parse-heal.js +9 -0
  113. package/dist/lib/parser/parse-heal.js.map +1 -0
  114. package/dist/lib/parser/parse-result.d.ts +12 -0
  115. package/dist/lib/parser/parse-result.d.ts.map +1 -0
  116. package/dist/lib/parser/parse-result.js +9 -0
  117. package/dist/lib/parser/parse-result.js.map +1 -0
  118. package/dist/lib/parser/parser.d.ts +8 -0
  119. package/dist/lib/parser/parser.d.ts.map +1 -0
  120. package/dist/lib/parser/parser.js +167 -0
  121. package/dist/lib/parser/parser.js.map +1 -0
  122. package/dist/lib/state/init-state.d.ts +15 -0
  123. package/dist/lib/state/init-state.d.ts.map +1 -0
  124. package/dist/lib/state/init-state.js +50 -0
  125. package/dist/lib/state/init-state.js.map +1 -0
  126. package/dist/lib/state/logs.d.ts +19 -0
  127. package/dist/lib/state/logs.d.ts.map +1 -0
  128. package/dist/lib/state/logs.js +25 -0
  129. package/dist/lib/state/logs.js.map +1 -0
  130. package/dist/lib/state/state.d.ts +7 -0
  131. package/dist/lib/state/state.d.ts.map +1 -0
  132. package/dist/lib/state/state.js +72 -0
  133. package/dist/lib/state/state.js.map +1 -0
  134. package/dist/lib/state/status.d.ts +22 -0
  135. package/dist/lib/state/status.d.ts.map +1 -0
  136. package/dist/lib/state/status.js +34 -0
  137. package/dist/lib/state/status.js.map +1 -0
  138. package/dist/lib/state/types.d.ts +55 -0
  139. package/dist/lib/state/types.d.ts.map +1 -0
  140. package/dist/lib/state/types.js +14 -0
  141. package/dist/lib/state/types.js.map +1 -0
  142. package/install-local.sh +239 -0
  143. package/install.sh +36 -0
  144. package/package.json +55 -0
  145. package/site/CNAME +1 -0
  146. package/site/index.html +141 -0
  147. package/site/install.sh +36 -0
  148. package/site/style.css +319 -0
  149. package/skill/SKILL.md +127 -0
  150. package/skill/SPEC.md +1189 -0
  151. package/skill/build/compile.mjs +237 -0
  152. package/skill/build/manifest.json +21 -0
  153. package/skill/fragments/common/model-selection.md +11 -0
  154. package/skill/fragments/common/portability-rules.md +16 -0
  155. package/skill/fragments/common/workflow.md +12 -0
  156. package/skill/fragments/domain/adapter-model.md +42 -0
  157. package/skill/fragments/domain/architecture-overview.md +36 -0
  158. package/skill/fragments/domain/contracts.md +31 -0
  159. package/skill/fragments/domain/pbh-healing.md +47 -0
  160. package/skill/fragments/domain/state-resume.md +34 -0
  161. package/skill/fragments/domain/verification-safety.md +33 -0
  162. package/skill/fragments/meta/schemas-reference.md +13 -0
  163. package/skill/fragments/meta/templates-reference.md +11 -0
  164. package/skill/schemas/heal_decision.v2.json +100 -0
  165. package/skill/schemas/manifest.v2.json +91 -0
  166. package/skill/schemas/state.v2.json +183 -0
  167. package/skill/schemas/task_result.v2.json +104 -0
  168. package/skill/schemas/verify_profile.v2.json +61 -0
  169. package/skill/skills/agent-threader/agent-threader.md +85 -0
  170. package/skill/templates/orchestrator.ts +38 -0
  171. package/skill/templates/parser.ts +384 -0
  172. package/skill/templates/types.ts +282 -0
@@ -0,0 +1,239 @@
1
+ #!/usr/bin/env bash
2
+ # install-local.sh -- Build and install skills + companion CLI from a local clone
3
+ # Run once from the project root: bash install-local.sh [--claude] [--cursor] [--windsurf] [--opencode] [--codex] [--all]
4
+ # No flags = auto-detect installed tools
5
+
6
+ set -e
7
+
8
+ PROJECT_NAME="${AGENT_THREADER_PACKAGE_NAME:-agent-threader}"
9
+ CLI_BIN_NAME="agent-threader"
10
+ MANAGED_MARKER="managed_by: agent-threader"
11
+ SKILLS=("agent-threader")
12
+
13
+ SKILL_DIR="$(cd "$(dirname "$0")" && pwd)"
14
+
15
+ CLAUDE_SKILLS_DIR="$HOME/.claude/skills"
16
+ CURSOR_RULES_DIR="$HOME/.cursor/rules"
17
+ CURSOR_SKILLS_DIR="$HOME/.cursor/skills"
18
+ WINDSURF_RULES_DIR="$HOME/.windsurf/rules"
19
+ WINDSURF_SKILLS_DIR="$HOME/.codeium/windsurf/skills"
20
+ OPENCODE_AGENTS_DIR="$HOME/.config/opencode/agents"
21
+ CODEX_HOME_DIR="${CODEX_HOME:-$HOME/.codex}"
22
+ CODEX_SKILLS_DIR="$CODEX_HOME_DIR/skills"
23
+
24
+ cleanup_managed() {
25
+ local dir="$1"
26
+ [[ -d "$dir" ]] || return 0
27
+ grep -rl "$MANAGED_MARKER" "$dir" 2>/dev/null | while read -r f; do
28
+ rm -f "$f"
29
+ local parent; parent="$(dirname "$f")"
30
+ [[ "$parent" != "$dir" ]] && rmdir "$parent" 2>/dev/null || true
31
+ echo " Removed: $f"
32
+ done
33
+ }
34
+
35
+ COMPILED_DIR="$SKILL_DIR/compiled"
36
+
37
+ install_claude() {
38
+ local skill_name="$1"
39
+ local src="$COMPILED_DIR/claude/${skill_name}/SKILL.md"
40
+ local dest_dir="$CLAUDE_SKILLS_DIR/${skill_name}"
41
+ mkdir -p "$dest_dir"
42
+ cp "$src" "$dest_dir/SKILL.md"
43
+ echo " Claude: $dest_dir/SKILL.md"
44
+ }
45
+
46
+ install_cursor() {
47
+ local skill_name="$1"
48
+ local src="$COMPILED_DIR/cursor/rules/${skill_name}.mdc"
49
+ mkdir -p "$CURSOR_RULES_DIR"
50
+ cp "$src" "$CURSOR_RULES_DIR/${skill_name}.mdc"
51
+ echo " Cursor (rule): $CURSOR_RULES_DIR/${skill_name}.mdc"
52
+ local src2="$COMPILED_DIR/cursor/skills/${skill_name}/SKILL.md"
53
+ local dest_dir="$CURSOR_SKILLS_DIR/${skill_name}"
54
+ mkdir -p "$dest_dir"
55
+ cp "$src2" "$dest_dir/SKILL.md"
56
+ echo " Cursor (skill): $dest_dir/SKILL.md"
57
+ }
58
+
59
+ install_windsurf() {
60
+ local skill_name="$1"
61
+ local src="$COMPILED_DIR/windsurf/rules/${skill_name}.md"
62
+ mkdir -p "$WINDSURF_RULES_DIR"
63
+ cp "$src" "$WINDSURF_RULES_DIR/${skill_name}.md"
64
+ echo " Windsurf (rule): $WINDSURF_RULES_DIR/${skill_name}.md"
65
+ local src2="$COMPILED_DIR/windsurf/skills/${skill_name}/SKILL.md"
66
+ local dest_dir="$WINDSURF_SKILLS_DIR/${skill_name}"
67
+ mkdir -p "$dest_dir"
68
+ cp "$src2" "$dest_dir/SKILL.md"
69
+ echo " Windsurf (skill): $dest_dir/SKILL.md"
70
+ }
71
+
72
+ install_opencode() {
73
+ local skill_name="$1"
74
+ local src="$COMPILED_DIR/opencode/${skill_name}.md"
75
+ mkdir -p "$OPENCODE_AGENTS_DIR"
76
+ cp "$src" "$OPENCODE_AGENTS_DIR/${skill_name}.md"
77
+ echo " OpenCode: $OPENCODE_AGENTS_DIR/${skill_name}.md"
78
+ }
79
+
80
+ install_codex() {
81
+ local skill_name="$1"
82
+ local src="$COMPILED_DIR/codex/${skill_name}/SKILL.md"
83
+ local dest_dir="$CODEX_SKILLS_DIR/${skill_name}"
84
+ mkdir -p "$dest_dir"
85
+ cp "$src" "$dest_dir/SKILL.md"
86
+ echo " Codex: $dest_dir/SKILL.md"
87
+ }
88
+
89
+ uninstall_claude() { for skill in "${SKILLS[@]}"; do rm -rf "$CLAUDE_SKILLS_DIR/$skill"; done; echo " Claude: removed"; }
90
+ uninstall_cursor() { for skill in "${SKILLS[@]}"; do rm -f "$CURSOR_RULES_DIR/${skill}.mdc"; rm -rf "$CURSOR_SKILLS_DIR/$skill"; done; echo " Cursor: removed"; }
91
+ uninstall_windsurf() { for skill in "${SKILLS[@]}"; do rm -f "$WINDSURF_RULES_DIR/${skill}.md"; rm -rf "$WINDSURF_SKILLS_DIR/$skill"; done; echo " Windsurf: removed"; }
92
+ uninstall_opencode() { for skill in "${SKILLS[@]}"; do rm -f "$OPENCODE_AGENTS_DIR/${skill}.md"; done; echo " OpenCode: removed"; }
93
+ uninstall_codex() { for skill in "${SKILLS[@]}"; do rm -rf "$CODEX_SKILLS_DIR/$skill"; done; echo " Codex: removed"; }
94
+
95
+ detect_editors() {
96
+ local detected=()
97
+ [[ -d "$HOME/.claude" ]] && detected+=("claude")
98
+ [[ -d "$HOME/.cursor" ]] && detected+=("cursor")
99
+ [[ -d "$HOME/.windsurf" || -d "$HOME/.codeium/windsurf" ]] && detected+=("windsurf")
100
+ [[ -d "$HOME/.config/opencode" || -d "$HOME/.opencode" ]] && detected+=("opencode")
101
+ [[ -n "${CODEX_HOME:-}" || -d "$CODEX_HOME_DIR" ]] && detected+=("codex")
102
+ echo "${detected[@]}"
103
+ }
104
+
105
+ TARGETS=()
106
+ DO_BUILD=true
107
+ DO_UNINSTALL=false
108
+ DO_COMPILE_ONLY=false
109
+
110
+ while [[ $# -gt 0 ]]; do
111
+ case "$1" in
112
+ --claude) TARGETS+=("claude"); shift ;;
113
+ --cursor) TARGETS+=("cursor"); shift ;;
114
+ --windsurf) TARGETS+=("windsurf"); shift ;;
115
+ --opencode) TARGETS+=("opencode"); shift ;;
116
+ --codex) TARGETS+=("codex"); shift ;;
117
+ --all) TARGETS=("claude" "cursor" "windsurf" "opencode" "codex"); shift ;;
118
+ --skills-only) DO_BUILD=false; shift ;;
119
+ --uninstall) DO_UNINSTALL=true; shift ;;
120
+ --compile-only) DO_COMPILE_ONLY=true; shift ;;
121
+ --help|-h)
122
+ echo "Usage: bash install-local.sh [options]"
123
+ echo ""
124
+ echo "Options:"
125
+ echo " --claude Install skills for Claude Code"
126
+ echo " --cursor Install skills for Cursor"
127
+ echo " --windsurf Install skills for Windsurf"
128
+ echo " --opencode Install skills for OpenCode"
129
+ echo " --codex Install skills for Codex"
130
+ echo " --all Install for all five tools"
131
+ echo " --skills-only Skip npm install/build/link (just copy skills)"
132
+ echo " --uninstall Remove installed skills from target tools"
133
+ echo " --compile-only Generate compiled/ output directory (no install)"
134
+ echo " -h, --help Show this help"
135
+ echo ""
136
+ echo "No flags = auto-detect installed tools."
137
+ exit 0
138
+ ;;
139
+ *)
140
+ echo "Unknown option: $1"
141
+ echo "Run: bash install-local.sh --help"
142
+ exit 1
143
+ ;;
144
+ esac
145
+ done
146
+
147
+ if [[ "$DO_COMPILE_ONLY" == true ]]; then
148
+ echo "==> Delegating to compile.mjs..."
149
+ node "$SKILL_DIR/skill/build/compile.mjs"
150
+ exit $?
151
+ fi
152
+
153
+ if [[ ${#TARGETS[@]} -eq 0 ]]; then
154
+ read -ra TARGETS <<< "$(detect_editors)"
155
+ fi
156
+
157
+ if [[ ${#TARGETS[@]} -eq 0 ]]; then
158
+ echo "ERROR: No supported tools detected. Use --claude, --cursor, --windsurf, --opencode, or --codex."
159
+ exit 1
160
+ fi
161
+
162
+ if [[ "$DO_UNINSTALL" == true ]]; then
163
+ echo "==> Uninstalling $PROJECT_NAME"
164
+ echo " Targets: ${TARGETS[*]}"
165
+ echo ""
166
+ for target in "${TARGETS[@]}"; do
167
+ "uninstall_${target}"
168
+ done
169
+
170
+ echo "--> Removing $CLI_BIN_NAME CLI..."
171
+ npm unlink "$PROJECT_NAME" 2>/dev/null || true
172
+ hash -r 2>/dev/null || true
173
+ if command -v "$CLI_BIN_NAME" &>/dev/null; then
174
+ echo " WARNING: $CLI_BIN_NAME still in PATH at $(which "$CLI_BIN_NAME")"
175
+ else
176
+ echo " $CLI_BIN_NAME removed"
177
+ fi
178
+
179
+ echo ""
180
+ echo "==> Done. Skills and CLI removed."
181
+ exit 0
182
+ fi
183
+
184
+ echo "==> $PROJECT_NAME setup"
185
+ echo " Project: $SKILL_DIR"
186
+ echo " Targets: ${TARGETS[*]}"
187
+ echo ""
188
+
189
+ if [[ "$DO_BUILD" == true ]]; then
190
+ echo "--> Installing dependencies..."
191
+ npm install
192
+
193
+ echo "--> Cleaning previous build..."
194
+ rm -rf "$SKILL_DIR/dist"
195
+
196
+ echo "--> Building TypeScript..."
197
+ npm run build
198
+ chmod +x "$SKILL_DIR/dist/cli/index.js"
199
+
200
+ echo "--> Compiling skills..."
201
+ npm run compile
202
+
203
+ echo "--> Installing $CLI_BIN_NAME CLI globally..."
204
+ npm link
205
+
206
+ NPM_BIN="$(npm prefix -g)/bin"
207
+ if [[ -x "$NPM_BIN/$CLI_BIN_NAME" ]]; then
208
+ echo " $CLI_BIN_NAME: $NPM_BIN/$CLI_BIN_NAME"
209
+ echo " version: $("$NPM_BIN/$CLI_BIN_NAME" --version 2>/dev/null || echo 'unknown')"
210
+ else
211
+ echo " WARNING: $CLI_BIN_NAME not found in $NPM_BIN after npm link."
212
+ echo " Try running: npm link"
213
+ fi
214
+ fi
215
+
216
+ echo "--> Cleaning stale $PROJECT_NAME files..."
217
+ for target in "${TARGETS[@]}"; do
218
+ case "$target" in
219
+ claude) cleanup_managed "$CLAUDE_SKILLS_DIR" ;;
220
+ cursor) cleanup_managed "$CURSOR_RULES_DIR"; cleanup_managed "$CURSOR_SKILLS_DIR" ;;
221
+ windsurf) cleanup_managed "$WINDSURF_RULES_DIR"; cleanup_managed "$WINDSURF_SKILLS_DIR" ;;
222
+ opencode) cleanup_managed "$OPENCODE_AGENTS_DIR" ;;
223
+ codex) cleanup_managed "$CODEX_SKILLS_DIR" ;;
224
+ esac
225
+ done
226
+
227
+ echo "--> Installing skills..."
228
+ for skill in "${SKILLS[@]}"; do
229
+ echo " ${skill}:"
230
+ for target in "${TARGETS[@]}"; do
231
+ "install_${target}" "$skill"
232
+ done
233
+ done
234
+
235
+ echo ""
236
+ echo "==> Done."
237
+ echo ""
238
+ echo "Skills installed for: ${TARGETS[*]}"
239
+ echo "CLI available as: $CLI_BIN_NAME"
package/install.sh ADDED
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env bash
2
+ # install.sh -- Bootstrap installer for the published agent-threader package
3
+ # Usage: bash <(curl -fsSL https://agentthreader.com/install.sh) [--claude] [--cursor] [--windsurf] [--opencode] [--codex] [--all]
4
+
5
+ set -euo pipefail
6
+
7
+ PROJECT_NAME="${AGENT_THREADER_PACKAGE_NAME:-agent-threader}"
8
+ PROJECT_VERSION="${AGENT_THREADER_PACKAGE_VERSION:-latest}"
9
+ CLI_BIN_NAME="agent-threader"
10
+ PACKAGE_SPEC="${PROJECT_NAME}@${PROJECT_VERSION}"
11
+ INSTALLER_ARGS=("$@")
12
+
13
+ if ! command -v npm >/dev/null 2>&1; then
14
+ echo "ERROR: npm is required but was not found in PATH."
15
+ exit 1
16
+ fi
17
+
18
+ echo "==> Bootstrapping ${PACKAGE_SPEC}"
19
+ echo "--> Installing ${PACKAGE_SPEC} globally..."
20
+ npm install -g "$PACKAGE_SPEC"
21
+
22
+ NPM_ROOT="$(npm root -g)"
23
+ PACKAGE_DIR="$NPM_ROOT/$PROJECT_NAME"
24
+ LOCAL_INSTALLER="$PACKAGE_DIR/install-local.sh"
25
+
26
+ if [[ ! -f "$LOCAL_INSTALLER" ]]; then
27
+ echo "ERROR: Could not find install-local.sh in $PACKAGE_DIR"
28
+ exit 1
29
+ fi
30
+
31
+ echo "--> Delegating to local installer..."
32
+ bash "$LOCAL_INSTALLER" --skills-only "${INSTALLER_ARGS[@]}"
33
+
34
+ echo ""
35
+ echo "==> Done."
36
+ echo "CLI available as: $CLI_BIN_NAME"
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "agent-threader",
3
+ "version": "2.0.5",
4
+ "description": "AgentThreader -- skill + companion CLI for manifest-driven agentic CLI orchestration with structured contracts, resumable state, and bounded self-healing",
5
+ "type": "module",
6
+ "bin": {
7
+ "agent-threader": "dist/cli/index.js"
8
+ },
9
+ "main": "./dist/index.js",
10
+ "types": "./dist/index.d.ts",
11
+ "exports": {
12
+ ".": {
13
+ "import": "./dist/index.js",
14
+ "types": "./dist/index.d.ts"
15
+ }
16
+ },
17
+ "files": [
18
+ "dist",
19
+ "compiled",
20
+ "skill",
21
+ "site",
22
+ "README.md",
23
+ "install.sh",
24
+ "install-local.sh"
25
+ ],
26
+ "scripts": {
27
+ "build": "tsc -p tsconfig.build.json",
28
+ "test": "vitest run",
29
+ "test:watch": "vitest",
30
+ "lint": "eslint src",
31
+ "typecheck": "tsc --noEmit",
32
+ "setup": "bash install-local.sh",
33
+ "setup:all": "bash install-local.sh --all",
34
+ "install-skills": "bash install-local.sh --skills-only",
35
+ "uninstall-skills": "bash install-local.sh --uninstall",
36
+ "compile": "node skill/build/compile.mjs",
37
+ "compile:validate": "node skill/build/compile.mjs --validate",
38
+ "compile:watch": "node skill/build/compile.mjs --watch"
39
+ },
40
+ "dependencies": {
41
+ "ajv": "^8.17.0",
42
+ "chalk": "^5.3.0",
43
+ "commander": "^11.0.0"
44
+ },
45
+ "devDependencies": {
46
+ "@types/node": "^20.10.0",
47
+ "typescript": "^5.3.0",
48
+ "eslint": "^9.0.0",
49
+ "typescript-eslint": "^8.0.0",
50
+ "vitest": "^3.1.0"
51
+ },
52
+ "engines": {
53
+ "node": ">=18.0.0"
54
+ }
55
+ }
package/site/CNAME ADDED
@@ -0,0 +1 @@
1
+ agentthreader.com
@@ -0,0 +1,141 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>AgentThreader</title>
7
+ <meta name="description" content="Manifest-driven agentic CLI orchestration with structured contracts, resumable state, and bounded self-healing." />
8
+ <link rel="stylesheet" href="/style.css" />
9
+ </head>
10
+ <body>
11
+ <div class="page">
12
+ <header class="hero">
13
+ <div class="container">
14
+ <h1 class="logo">Agent<span class="accent">Threader</span></h1>
15
+ <p class="tagline">Manifest-driven agentic CLI orchestration</p>
16
+ <p class="subtitle">Structured contracts. Resumable state. Bounded self-healing.</p>
17
+ <div class="cta-row">
18
+ <a href="https://github.com/barretts/AgentThreader" class="btn btn-primary">View on GitHub</a>
19
+ <a href="#install" class="btn btn-secondary">Install</a>
20
+ </div>
21
+ </div>
22
+ </header>
23
+
24
+ <section id="features" class="features">
25
+ <div class="container">
26
+ <h2>How It Works</h2>
27
+ <div class="grid">
28
+ <div class="card">
29
+ <div class="card-icon">1</div>
30
+ <h3>Declare Work</h3>
31
+ <p>Define tasks, dependencies, timeouts, and verification profiles in a <code>manifest.v2</code> JSON file.</p>
32
+ </div>
33
+ <div class="card">
34
+ <div class="card-icon">2</div>
35
+ <h3>Thread Agents</h3>
36
+ <p>The orchestrator schedules tasks through CLI adapters with dependency-aware ordering and resumable execution state.</p>
37
+ </div>
38
+ <div class="card">
39
+ <div class="card-icon">3</div>
40
+ <h3>Verify &amp; Checkpoint</h3>
41
+ <p>Every result is parsed, schema-validated, and verified before state is committed. Atomic writes keep resume safe.</p>
42
+ </div>
43
+ <div class="card">
44
+ <div class="card-icon">4</div>
45
+ <h3>Self-Heal</h3>
46
+ <p>Bounded healing logic diagnoses failures, patches prompts, and retries without letting the run spiral.</p>
47
+ </div>
48
+ </div>
49
+ </div>
50
+ </section>
51
+
52
+ <section class="contracts">
53
+ <div class="container">
54
+ <h2>v2 Contract Stack</h2>
55
+ <div class="contract-grid">
56
+ <div class="contract-item">
57
+ <code>manifest.v2</code>
58
+ <span>Task declarations</span>
59
+ </div>
60
+ <div class="contract-item">
61
+ <code>task_result.v2</code>
62
+ <span>Worker output</span>
63
+ </div>
64
+ <div class="contract-item">
65
+ <code>heal_decision.v2</code>
66
+ <span>Healer output</span>
67
+ </div>
68
+ <div class="contract-item">
69
+ <code>state.v2</code>
70
+ <span>Run state</span>
71
+ </div>
72
+ <div class="contract-item">
73
+ <code>verify_profile.v2</code>
74
+ <span>Verification steps</span>
75
+ </div>
76
+ </div>
77
+ </div>
78
+ </section>
79
+
80
+ <section class="cli-section">
81
+ <div class="container">
82
+ <h2>Companion CLI</h2>
83
+ <div class="terminal">
84
+ <div class="terminal-bar">
85
+ <span class="dot red"></span>
86
+ <span class="dot yellow"></span>
87
+ <span class="dot green"></span>
88
+ </div>
89
+ <pre><code><span class="prompt">$</span> agent-threader validate-manifest manifest.json
90
+ <span class="success">Valid manifest: 12 tasks</span>
91
+ <span class="dim">Dependency order: WP-001 -&gt; WP-003 -&gt; WP-002 -&gt; ...</span>
92
+
93
+ <span class="prompt">$</span> agent-threader init-state manifest.json
94
+ <span class="success">State initialized: .agentic/state.json</span>
95
+ <span class="dim"> Run ID: run-2026-04-02</span>
96
+ <span class="dim"> Tasks: 12</span>
97
+ <span class="dim"> Heal: auto</span>
98
+
99
+ <span class="prompt">$</span> agent-threader status
100
+ <span class="bold">Run run-2026-04-02: RUNNING</span>
101
+ <span class="dim"> DONE 8</span>
102
+ <span class="dim"> RUNNING 2</span>
103
+ <span class="dim"> PENDING 2</span></code></pre>
104
+ </div>
105
+ </div>
106
+ </section>
107
+
108
+ <section id="install" class="install-section">
109
+ <div class="container">
110
+ <h2>Quick Start</h2>
111
+ <div class="terminal">
112
+ <div class="terminal-bar">
113
+ <span class="dot red"></span>
114
+ <span class="dot yellow"></span>
115
+ <span class="dot green"></span>
116
+ </div>
117
+ <pre><code><span class="prompt">$</span> bash &lt;(curl -fsSL https://agentthreader.com/install.sh) --all
118
+ <span class="dim">==&gt; Bootstrapping agent-threader@latest</span>
119
+ <span class="dim">--&gt; Installing agent-threader@latest globally...</span>
120
+ <span class="dim">--&gt; Delegating to local installer...</span>
121
+ <span class="success">==&gt; Done.</span>
122
+
123
+ <span class="prompt">$</span> npx --yes agent-threader@latest --help</code></pre>
124
+ </div>
125
+ <p class="install-note">The hosted bootstrap script installs the published package, then delegates to the packaged <code>install-local.sh</code> to copy compiled skills into your detected tools.</p>
126
+ <p class="install-note">Release automation uses <code>AGENT_TOKEN</code> for release commit/tag push and <code>AGENT_NPM_TOKEN</code> for npm publish.</p>
127
+ <div class="install-links">
128
+ <a href="/install.sh" class="text-link">View install.sh</a>
129
+ <a href="https://github.com/barretts/AgentThreader" class="text-link">Repository</a>
130
+ </div>
131
+ </div>
132
+ </section>
133
+
134
+ <footer>
135
+ <div class="container">
136
+ <p>MIT License &middot; <a href="https://github.com/barretts/AgentThreader">github.com/barretts/AgentThreader</a></p>
137
+ </div>
138
+ </footer>
139
+ </div>
140
+ </body>
141
+ </html>
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env bash
2
+ # install.sh -- Bootstrap installer for the published agent-threader package
3
+ # Usage: bash <(curl -fsSL https://agentthreader.com/install.sh) [--claude] [--cursor] [--windsurf] [--opencode] [--codex] [--all]
4
+
5
+ set -euo pipefail
6
+
7
+ PROJECT_NAME="${AGENT_THREADER_PACKAGE_NAME:-agent-threader}"
8
+ PROJECT_VERSION="${AGENT_THREADER_PACKAGE_VERSION:-latest}"
9
+ CLI_BIN_NAME="agent-threader"
10
+ PACKAGE_SPEC="${PROJECT_NAME}@${PROJECT_VERSION}"
11
+ INSTALLER_ARGS=("$@")
12
+
13
+ if ! command -v npm >/dev/null 2>&1; then
14
+ echo "ERROR: npm is required but was not found in PATH."
15
+ exit 1
16
+ fi
17
+
18
+ echo "==> Bootstrapping ${PACKAGE_SPEC}"
19
+ echo "--> Installing ${PACKAGE_SPEC} globally..."
20
+ npm install -g "$PACKAGE_SPEC"
21
+
22
+ NPM_ROOT="$(npm root -g)"
23
+ PACKAGE_DIR="$NPM_ROOT/$PROJECT_NAME"
24
+ LOCAL_INSTALLER="$PACKAGE_DIR/install-local.sh"
25
+
26
+ if [[ ! -f "$LOCAL_INSTALLER" ]]; then
27
+ echo "ERROR: Could not find install-local.sh in $PACKAGE_DIR"
28
+ exit 1
29
+ fi
30
+
31
+ echo "--> Delegating to local installer..."
32
+ bash "$LOCAL_INSTALLER" --skills-only "${INSTALLER_ARGS[@]}"
33
+
34
+ echo ""
35
+ echo "==> Done."
36
+ echo "CLI available as: $CLI_BIN_NAME"