@made-by-moonlight/athene-core 0.9.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.
Files changed (285) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +241 -0
  3. package/dist/activity-events.d.ts +42 -0
  4. package/dist/activity-events.d.ts.map +1 -0
  5. package/dist/activity-events.js +192 -0
  6. package/dist/activity-events.js.map +1 -0
  7. package/dist/activity-log.d.ts +71 -0
  8. package/dist/activity-log.d.ts.map +1 -0
  9. package/dist/activity-log.js +203 -0
  10. package/dist/activity-log.js.map +1 -0
  11. package/dist/activity-signal.d.ts +20 -0
  12. package/dist/activity-signal.d.ts.map +1 -0
  13. package/dist/activity-signal.js +91 -0
  14. package/dist/activity-signal.js.map +1 -0
  15. package/dist/agent-report.d.ts +148 -0
  16. package/dist/agent-report.d.ts.map +1 -0
  17. package/dist/agent-report.js +516 -0
  18. package/dist/agent-report.js.map +1 -0
  19. package/dist/agent-selection.d.ts +31 -0
  20. package/dist/agent-selection.d.ts.map +1 -0
  21. package/dist/agent-selection.js +69 -0
  22. package/dist/agent-selection.js.map +1 -0
  23. package/dist/agent-workspace-hooks.d.ts +74 -0
  24. package/dist/agent-workspace-hooks.d.ts.map +1 -0
  25. package/dist/agent-workspace-hooks.js +988 -0
  26. package/dist/agent-workspace-hooks.js.map +1 -0
  27. package/dist/atomic-write.d.ts +6 -0
  28. package/dist/atomic-write.d.ts.map +1 -0
  29. package/dist/atomic-write.js +49 -0
  30. package/dist/atomic-write.js.map +1 -0
  31. package/dist/cleanup-stack.d.ts +37 -0
  32. package/dist/cleanup-stack.d.ts.map +1 -0
  33. package/dist/cleanup-stack.js +45 -0
  34. package/dist/cleanup-stack.js.map +1 -0
  35. package/dist/code-review-manager.d.ts +118 -0
  36. package/dist/code-review-manager.d.ts.map +1 -0
  37. package/dist/code-review-manager.js +719 -0
  38. package/dist/code-review-manager.js.map +1 -0
  39. package/dist/code-review-store.d.ts +114 -0
  40. package/dist/code-review-store.d.ts.map +1 -0
  41. package/dist/code-review-store.js +346 -0
  42. package/dist/code-review-store.js.map +1 -0
  43. package/dist/config-generator.d.ts +84 -0
  44. package/dist/config-generator.d.ts.map +1 -0
  45. package/dist/config-generator.js +295 -0
  46. package/dist/config-generator.js.map +1 -0
  47. package/dist/config.d.ts +55 -0
  48. package/dist/config.d.ts.map +1 -0
  49. package/dist/config.js +852 -0
  50. package/dist/config.js.map +1 -0
  51. package/dist/daemon-children.d.ts +55 -0
  52. package/dist/daemon-children.d.ts.map +1 -0
  53. package/dist/daemon-children.js +435 -0
  54. package/dist/daemon-children.js.map +1 -0
  55. package/dist/dashboard-notifications.d.ts +42 -0
  56. package/dist/dashboard-notifications.d.ts.map +1 -0
  57. package/dist/dashboard-notifications.js +123 -0
  58. package/dist/dashboard-notifications.js.map +1 -0
  59. package/dist/events-db.d.ts +39 -0
  60. package/dist/events-db.d.ts.map +1 -0
  61. package/dist/events-db.js +185 -0
  62. package/dist/events-db.js.map +1 -0
  63. package/dist/feature-flags.d.ts +2 -0
  64. package/dist/feature-flags.d.ts.map +1 -0
  65. package/dist/feature-flags.js +9 -0
  66. package/dist/feature-flags.js.map +1 -0
  67. package/dist/feedback-tools.d.ts +97 -0
  68. package/dist/feedback-tools.d.ts.map +1 -0
  69. package/dist/feedback-tools.js +161 -0
  70. package/dist/feedback-tools.js.map +1 -0
  71. package/dist/file-lock.d.ts +5 -0
  72. package/dist/file-lock.d.ts.map +1 -0
  73. package/dist/file-lock.js +59 -0
  74. package/dist/file-lock.js.map +1 -0
  75. package/dist/format-automated-comments.d.ts +18 -0
  76. package/dist/format-automated-comments.d.ts.map +1 -0
  77. package/dist/gh-trace.d.ts +57 -0
  78. package/dist/gh-trace.d.ts.map +1 -0
  79. package/dist/gh-trace.js +320 -0
  80. package/dist/gh-trace.js.map +1 -0
  81. package/dist/git-activity.d.ts +10 -0
  82. package/dist/git-activity.d.ts.map +1 -0
  83. package/dist/git-activity.js +30 -0
  84. package/dist/git-activity.js.map +1 -0
  85. package/dist/global-config.d.ts +1085 -0
  86. package/dist/global-config.d.ts.map +1 -0
  87. package/dist/global-config.js +1067 -0
  88. package/dist/global-config.js.map +1 -0
  89. package/dist/index.d.ts +91 -0
  90. package/dist/index.d.ts.map +1 -0
  91. package/dist/index.js +59 -0
  92. package/dist/index.js.map +1 -0
  93. package/dist/key-value.d.ts +7 -0
  94. package/dist/key-value.d.ts.map +1 -0
  95. package/dist/key-value.js +24 -0
  96. package/dist/key-value.js.map +1 -0
  97. package/dist/lifecycle-manager.d.ts +22 -0
  98. package/dist/lifecycle-manager.d.ts.map +1 -0
  99. package/dist/lifecycle-manager.js +2813 -0
  100. package/dist/lifecycle-manager.js.map +1 -0
  101. package/dist/lifecycle-state.d.ts +28 -0
  102. package/dist/lifecycle-state.d.ts.map +1 -0
  103. package/dist/lifecycle-state.js +446 -0
  104. package/dist/lifecycle-state.js.map +1 -0
  105. package/dist/lifecycle-status-decisions.d.ts +85 -0
  106. package/dist/lifecycle-status-decisions.d.ts.map +1 -0
  107. package/dist/lifecycle-status-decisions.js +262 -0
  108. package/dist/lifecycle-status-decisions.js.map +1 -0
  109. package/dist/lifecycle-transition.d.ts +81 -0
  110. package/dist/lifecycle-transition.d.ts.map +1 -0
  111. package/dist/lifecycle-transition.js +207 -0
  112. package/dist/lifecycle-transition.js.map +1 -0
  113. package/dist/metadata.d.ts +54 -0
  114. package/dist/metadata.d.ts.map +1 -0
  115. package/dist/metadata.js +484 -0
  116. package/dist/metadata.js.map +1 -0
  117. package/dist/migration/storage-v2.d.ts +76 -0
  118. package/dist/migration/storage-v2.d.ts.map +1 -0
  119. package/dist/migration/storage-v2.js +1614 -0
  120. package/dist/migration/storage-v2.js.map +1 -0
  121. package/dist/notification-data.d.ts +135 -0
  122. package/dist/notification-data.d.ts.map +1 -0
  123. package/dist/notification-data.js +204 -0
  124. package/dist/notification-data.js.map +1 -0
  125. package/dist/notification-observability.d.ts +21 -0
  126. package/dist/notification-observability.d.ts.map +1 -0
  127. package/dist/notification-observability.js +154 -0
  128. package/dist/notification-observability.js.map +1 -0
  129. package/dist/notifier-resolution.d.ts +14 -0
  130. package/dist/notifier-resolution.d.ts.map +1 -0
  131. package/dist/notifier-resolution.js +23 -0
  132. package/dist/notifier-resolution.js.map +1 -0
  133. package/dist/observability.d.ts +100 -0
  134. package/dist/observability.d.ts.map +1 -0
  135. package/dist/observability.js +535 -0
  136. package/dist/observability.js.map +1 -0
  137. package/dist/opencode-agents-md.d.ts +3 -0
  138. package/dist/opencode-agents-md.d.ts.map +1 -0
  139. package/dist/opencode-agents-md.js +40 -0
  140. package/dist/opencode-agents-md.js.map +1 -0
  141. package/dist/opencode-config.d.ts +2 -0
  142. package/dist/opencode-config.d.ts.map +1 -0
  143. package/dist/opencode-config.js +17 -0
  144. package/dist/opencode-config.js.map +1 -0
  145. package/dist/opencode-session-id.d.ts +2 -0
  146. package/dist/opencode-session-id.d.ts.map +1 -0
  147. package/dist/opencode-session-id.js +12 -0
  148. package/dist/opencode-session-id.js.map +1 -0
  149. package/dist/opencode-shared.d.ts +80 -0
  150. package/dist/opencode-shared.d.ts.map +1 -0
  151. package/dist/opencode-shared.js +202 -0
  152. package/dist/opencode-shared.js.map +1 -0
  153. package/dist/orchestrator-prompt.d.ts +19 -0
  154. package/dist/orchestrator-prompt.d.ts.map +1 -0
  155. package/dist/orchestrator-prompt.js +130 -0
  156. package/dist/orchestrator-prompt.js.map +1 -0
  157. package/dist/orchestrator-session-strategy.d.ts +5 -0
  158. package/dist/orchestrator-session-strategy.d.ts.map +1 -0
  159. package/dist/orchestrator-session-strategy.js +13 -0
  160. package/dist/orchestrator-session-strategy.js.map +1 -0
  161. package/dist/paths.d.ts +145 -0
  162. package/dist/paths.d.ts.map +1 -0
  163. package/dist/paths.js +288 -0
  164. package/dist/paths.js.map +1 -0
  165. package/dist/platform.d.ts +32 -0
  166. package/dist/platform.d.ts.map +1 -0
  167. package/dist/platform.js +211 -0
  168. package/dist/platform.js.map +1 -0
  169. package/dist/plugin-registry.d.ts +15 -0
  170. package/dist/plugin-registry.d.ts.map +1 -0
  171. package/dist/plugin-registry.js +499 -0
  172. package/dist/plugin-registry.js.map +1 -0
  173. package/dist/portfolio-projects.d.ts +7 -0
  174. package/dist/portfolio-projects.d.ts.map +1 -0
  175. package/dist/portfolio-projects.js +65 -0
  176. package/dist/portfolio-projects.js.map +1 -0
  177. package/dist/portfolio-registry.d.ts +42 -0
  178. package/dist/portfolio-registry.d.ts.map +1 -0
  179. package/dist/portfolio-registry.js +311 -0
  180. package/dist/portfolio-registry.js.map +1 -0
  181. package/dist/portfolio-routing.d.ts +5 -0
  182. package/dist/portfolio-routing.d.ts.map +1 -0
  183. package/dist/portfolio-routing.js +24 -0
  184. package/dist/portfolio-routing.js.map +1 -0
  185. package/dist/portfolio-session-service.d.ts +15 -0
  186. package/dist/portfolio-session-service.d.ts.map +1 -0
  187. package/dist/portfolio-session-service.js +206 -0
  188. package/dist/portfolio-session-service.js.map +1 -0
  189. package/dist/process-cache.d.ts +32 -0
  190. package/dist/process-cache.d.ts.map +1 -0
  191. package/dist/process-cache.js +44 -0
  192. package/dist/process-cache.js.map +1 -0
  193. package/dist/project-resolver.d.ts +5 -0
  194. package/dist/project-resolver.d.ts.map +1 -0
  195. package/dist/project-resolver.js +20 -0
  196. package/dist/project-resolver.js.map +1 -0
  197. package/dist/prompt-builder.d.ts +42 -0
  198. package/dist/prompt-builder.d.ts.map +1 -0
  199. package/dist/prompt-builder.js +182 -0
  200. package/dist/prompt-builder.js.map +1 -0
  201. package/dist/prompts/orchestrator.md.js +4 -0
  202. package/dist/prompts/orchestrator.md.js.map +1 -0
  203. package/dist/query-activity-events.d.ts +42 -0
  204. package/dist/query-activity-events.d.ts.map +1 -0
  205. package/dist/query-activity-events.js +170 -0
  206. package/dist/query-activity-events.js.map +1 -0
  207. package/dist/recovery/actions.d.ts +7 -0
  208. package/dist/recovery/actions.d.ts.map +1 -0
  209. package/dist/recovery/index.d.ts +8 -0
  210. package/dist/recovery/index.d.ts.map +1 -0
  211. package/dist/recovery/logger.d.ts +12 -0
  212. package/dist/recovery/logger.d.ts.map +1 -0
  213. package/dist/recovery/manager.d.ts +24 -0
  214. package/dist/recovery/manager.d.ts.map +1 -0
  215. package/dist/recovery/scanner.d.ts +11 -0
  216. package/dist/recovery/scanner.d.ts.map +1 -0
  217. package/dist/recovery/types.d.ts +170 -0
  218. package/dist/recovery/types.d.ts.map +1 -0
  219. package/dist/recovery/validator.d.ts +8 -0
  220. package/dist/recovery/validator.d.ts.map +1 -0
  221. package/dist/report-watcher.d.ts +93 -0
  222. package/dist/report-watcher.d.ts.map +1 -0
  223. package/dist/report-watcher.js +182 -0
  224. package/dist/report-watcher.js.map +1 -0
  225. package/dist/scm-webhook-utils.d.ts +6 -0
  226. package/dist/scm-webhook-utils.d.ts.map +1 -0
  227. package/dist/scm-webhook-utils.js +36 -0
  228. package/dist/scm-webhook-utils.js.map +1 -0
  229. package/dist/session-manager.d.ts +22 -0
  230. package/dist/session-manager.d.ts.map +1 -0
  231. package/dist/session-manager.js +3077 -0
  232. package/dist/session-manager.js.map +1 -0
  233. package/dist/spawn-target.d.ts +23 -0
  234. package/dist/spawn-target.d.ts.map +1 -0
  235. package/dist/spawn-target.js +39 -0
  236. package/dist/spawn-target.js.map +1 -0
  237. package/dist/storage-key.d.ts +9 -0
  238. package/dist/storage-key.d.ts.map +1 -0
  239. package/dist/storage-key.js +59 -0
  240. package/dist/storage-key.js.map +1 -0
  241. package/dist/tmux.d.ts +39 -0
  242. package/dist/tmux.d.ts.map +1 -0
  243. package/dist/tmux.js +141 -0
  244. package/dist/tmux.js.map +1 -0
  245. package/dist/types.d.ts +1496 -0
  246. package/dist/types.d.ts.map +1 -0
  247. package/dist/types.js +215 -0
  248. package/dist/types.js.map +1 -0
  249. package/dist/update-cache.d.ts +59 -0
  250. package/dist/update-cache.d.ts.map +1 -0
  251. package/dist/update-cache.js +77 -0
  252. package/dist/update-cache.js.map +1 -0
  253. package/dist/utils/metadata-flatten.d.ts +3 -0
  254. package/dist/utils/metadata-flatten.d.ts.map +1 -0
  255. package/dist/utils/metadata-flatten.js +18 -0
  256. package/dist/utils/metadata-flatten.js.map +1 -0
  257. package/dist/utils/pr.d.ts +7 -0
  258. package/dist/utils/pr.d.ts.map +1 -0
  259. package/dist/utils/pr.js +97 -0
  260. package/dist/utils/pr.js.map +1 -0
  261. package/dist/utils/session-from-metadata.d.ts +16 -0
  262. package/dist/utils/session-from-metadata.d.ts.map +1 -0
  263. package/dist/utils/session-from-metadata.js +87 -0
  264. package/dist/utils/session-from-metadata.js.map +1 -0
  265. package/dist/utils/session-id.d.ts +4 -0
  266. package/dist/utils/session-id.d.ts.map +1 -0
  267. package/dist/utils/session-id.js +9 -0
  268. package/dist/utils/session-id.js.map +1 -0
  269. package/dist/utils/validation.d.ts +9 -0
  270. package/dist/utils/validation.d.ts.map +1 -0
  271. package/dist/utils/validation.js +45 -0
  272. package/dist/utils/validation.js.map +1 -0
  273. package/dist/utils.d.ts +65 -0
  274. package/dist/utils.d.ts.map +1 -0
  275. package/dist/utils.js +189 -0
  276. package/dist/utils.js.map +1 -0
  277. package/dist/version-compare.d.ts +27 -0
  278. package/dist/version-compare.d.ts.map +1 -0
  279. package/dist/version-compare.js +121 -0
  280. package/dist/version-compare.js.map +1 -0
  281. package/dist/windows-pty-registry.d.ts +27 -0
  282. package/dist/windows-pty-registry.d.ts.map +1 -0
  283. package/dist/windows-pty-registry.js +109 -0
  284. package/dist/windows-pty-registry.js.map +1 -0
  285. package/package.json +110 -0
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Process-scoped async memoization for expensive checks shared across plugins.
3
+ *
4
+ * Use cases: prerequisite checks (binary present, auth valid) that multiple
5
+ * plugins want to perform but only need to actually run once per CLI
6
+ * invocation. Cache key chooses the dedup boundary — plugins that share a
7
+ * key share the result.
8
+ *
9
+ * Both successes and failures are cached: if a check fails the user must fix
10
+ * the underlying issue and re-run, so re-checking within the same process is
11
+ * pointless and would muddy the error stream with duplicate messages.
12
+ *
13
+ * **Key namespacing convention:**
14
+ *
15
+ * The cache is shared across every caller in the process, so two plugins
16
+ * passing the same key are explicitly opting into shared state. That is the
17
+ * intended use for cross-cutting checks like the `gh` CLI auth status (used
18
+ * by both `tracker-github` and `scm-github`).
19
+ *
20
+ * For plugin-internal caching (where you do *not* want sharing), namespace
21
+ * the key with your plugin name to avoid silent collisions:
22
+ * - shared cross-plugin check: `"gh-cli-auth"` (intentional sharing)
23
+ * - plugin-internal check: `"tracker-github:rate-limit-check"`
24
+ *
25
+ * If two plugins use the same key for semantically different work, callers
26
+ * will silently receive each other's resolved values — a debugging nightmare.
27
+ * When in doubt, namespace.
28
+ */
29
+ const cache = new Map();
30
+ function memoizeAsync(key, fn) {
31
+ let cached = cache.get(key);
32
+ if (!cached) {
33
+ cached = fn();
34
+ cache.set(key, cached);
35
+ }
36
+ return cached;
37
+ }
38
+ /** Test-only — clears the process cache. */
39
+ function _clearProcessCacheForTests() {
40
+ cache.clear();
41
+ }
42
+
43
+ export { _clearProcessCacheForTests, memoizeAsync };
44
+ //# sourceMappingURL=process-cache.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process-cache.js","sources":["../src/process-cache.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BG;AAEH,MAAM,KAAK,GAAG,IAAI,GAAG,EAA4B;AAE3C,SAAU,YAAY,CAAI,GAAW,EAAE,EAAoB,EAAA;IAC/D,IAAI,MAAM,GAAG,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC;IAC3B,IAAI,CAAC,MAAM,EAAE;QACX,MAAM,GAAG,EAAE,EAAE;AACb,QAAA,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC;IACxB;AACA,IAAA,OAAO,MAAoB;AAC7B;AAEA;SACgB,0BAA0B,GAAA;IACxC,KAAK,CAAC,KAAK,EAAE;AACf;;;;"}
@@ -0,0 +1,5 @@
1
+ import { type DegradedProjectEntry, type LoadedConfig, type ProjectConfig } from "./types.js";
2
+ import { type GlobalConfig } from "./global-config.js";
3
+ export declare function loadEffectiveProjectConfig(projectId: string, globalConfig: GlobalConfig, globalConfigPath?: string): ProjectConfig;
4
+ export declare function iterateAllProjects(config: LoadedConfig): Iterable<ProjectConfig | DegradedProjectEntry>;
5
+ //# sourceMappingURL=project-resolver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-resolver.d.ts","sourceRoot":"","sources":["../src/project-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,YAAY,EACjB,KAAK,aAAa,EACnB,MAAM,YAAY,CAAC;AACpB,OAAO,EAA0B,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAE/E,wBAAgB,0BAA0B,CACxC,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,YAAY,EAC1B,gBAAgB,CAAC,EAAE,MAAM,GACxB,aAAa,CASf;AAED,wBAAiB,kBAAkB,CACjC,MAAM,EAAE,YAAY,GACnB,QAAQ,CAAC,aAAa,GAAG,oBAAoB,CAAC,CAGhD"}
@@ -0,0 +1,20 @@
1
+ import { ProjectResolveError } from './types.js';
2
+ import { resolveProjectIdentity } from './global-config.js';
3
+
4
+ function loadEffectiveProjectConfig(projectId, globalConfig, globalConfigPath) {
5
+ const resolved = resolveProjectIdentity(projectId, globalConfig);
6
+ if (!resolved) {
7
+ throw new ProjectResolveError(projectId, `Unknown project: ${projectId}`);
8
+ }
9
+ if (typeof resolved.resolveError === "string" && resolved.resolveError.length > 0) {
10
+ throw new ProjectResolveError(projectId, resolved.resolveError, resolved.resolveErrorKind);
11
+ }
12
+ return resolved;
13
+ }
14
+ function* iterateAllProjects(config) {
15
+ yield* Object.values(config.projects);
16
+ yield* Object.values(config.degradedProjects);
17
+ }
18
+
19
+ export { iterateAllProjects, loadEffectiveProjectConfig };
20
+ //# sourceMappingURL=project-resolver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-resolver.js","sources":["../src/project-resolver.ts"],"sourcesContent":[null],"names":[],"mappings":";;;SAQgB,0BAA0B,CACxC,SAAiB,EACjB,YAA0B,EAC1B,gBAAyB,EAAA;IAEzB,MAAM,QAAQ,GAAG,sBAAsB,CAAC,SAAS,EAAE,YAA8B,CAAC;IAClF,IAAI,CAAC,QAAQ,EAAE;QACb,MAAM,IAAI,mBAAmB,CAAC,SAAS,EAAE,CAAA,iBAAA,EAAoB,SAAS,CAAA,CAAE,CAAC;IAC3E;AACA,IAAA,IAAI,OAAO,QAAQ,CAAC,YAAY,KAAK,QAAQ,IAAI,QAAQ,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE;AACjF,QAAA,MAAM,IAAI,mBAAmB,CAAC,SAAS,EAAE,QAAQ,CAAC,YAAY,EAAE,QAAQ,CAAC,gBAAgB,CAAC;IAC5F;AACA,IAAA,OAAO,QAAQ;AACjB;AAEM,UAAW,kBAAkB,CACjC,MAAoB,EAAA;IAEpB,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC;IACrC,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC;AAC/C;;;;"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Prompt Builder — composes layered prompts for agent sessions.
3
+ *
4
+ * Three layers:
5
+ * 1. BASE_AGENT_PROMPT — constant instructions about session lifecycle, git workflow, PR handling
6
+ * 2. Config-derived context — project name, repo, default branch, tracker info, reaction rules
7
+ * 3. User rules — inline agentRules and/or agentRulesFile content
8
+ *
9
+ * buildPrompt() returns the split between persistent system instructions and
10
+ * task-specific text so callers can route them to agents separately.
11
+ */
12
+ import type { ProjectConfig, SessionId } from "./types.js";
13
+ export declare const BASE_AGENT_PROMPT = "You are an AI coding agent managed by the Athene (ao).\n\n## Session Lifecycle\n- You are running inside a managed session. Focus on the assigned task.\n- When you finish your work, create a PR and push it. The orchestrator will handle CI monitoring and review routing.\n- If you're told to take over or continue work on an existing PR, run `athene session claim-pr <pr-number-or-url>` from inside this session before making changes.\n- If CI fails, the orchestrator will send you the failures \u2014 fix them and push again.\n- If reviewers request changes, the orchestrator will forward their comments \u2014 address each one, push fixes, and reply to the comments.\n\n## Reporting Progress to AO\nThe orchestrator infers your status from runtime signals, but explicit reports are always preferred \u2014 they are accurate and fresh. Run these commands from the session shell (AO_SESSION_ID is pre-set for you):\n\n- `athene acknowledge` \u2014 run once after reading the initial task so AO knows you picked it up.\n- `athene report working` \u2014 declare you are actively making progress (useful after pauses or long thinking blocks).\n- `athene report waiting` \u2014 you are blocked on something AO cannot unblock on its own (e.g. waiting for a human, external service).\n- `athene report needs-input` \u2014 you need a decision or info from the human before proceeding.\n- `athene report fixing-ci` \u2014 you are working specifically on making CI green again.\n- `athene report addressing-reviews` \u2014 you are working on reviewer-requested changes.\n- `athene report pr-created --pr-url <url>` / `draft-pr-created` / `ready-for-review` \u2014 declare PR workflow milestones as soon as you create or update the PR.\n- `athene report completed` \u2014 you finished non-coding research or analysis work that doesn't produce a PR.\n\nRules:\n- Do NOT self-report `done`, `terminated`, or terminal PR states like `merged`/`closed` \u2014 AO owns those transitions via SCM ground truth.\n- A fresh report is trusted over weak inference but runtime death, activity-based waiting_input, and SCM events (merged/closed PR, CI failure, reviews) still take precedence.\n- Use `--note \"<text>\"` to attach a short rationale when the state change is non-obvious.\n\n## Git Workflow\n- Always create a feature branch from the default branch (never commit directly to it).\n- Use conventional commit messages (feat:, fix:, chore:, etc.).\n- Push your branch and create a PR when the implementation is ready.\n- Keep PRs focused \u2014 one issue per PR.\n\n## PR Best Practices\n- Write a clear PR title and description explaining what changed and why.\n- Link the issue in the PR description so it auto-closes when merged.\n- If the repo has CI checks, make sure they pass before requesting review.\n- Respond to every review comment, even if just to acknowledge it.";
14
+ /** Trimmed base prompt for projects without a configured repo/remote. */
15
+ export declare const BASE_AGENT_PROMPT_NO_REPO = "You are an AI coding agent managed by the Athene (ao).\n\n## Session Lifecycle\n- You are running inside a managed session. Focus on the assigned task.\n- No remote repository is configured \u2014 work locally. PR, CI, and review features are unavailable.\n\n## Reporting Progress to AO\nExplicit reports help the orchestrator track your state accurately. Run these from the session shell (AO_SESSION_ID is pre-set):\n- `athene acknowledge` \u2014 run once after reading the initial task.\n- `athene report working` / `waiting` / `needs-input` \u2014 declare your current phase.\n- `athene report pr-created --pr-url <url>` or `draft-pr-created` / `ready-for-review` \u2014 declare non-terminal PR workflow events when relevant.\n- `athene report completed` \u2014 finish non-coding research or analysis work.\nDo NOT self-report `done` or `terminated` \u2014 AO owns those transitions.\n\n## Git Workflow\n- Always create a feature branch from the default branch (never commit directly to it).\n- Use conventional commit messages (feat:, fix:, chore:, etc.).";
16
+ export interface PromptBuildConfig {
17
+ /** The project config from the orchestrator config */
18
+ project: ProjectConfig;
19
+ /** The project ID (key in the projects map) */
20
+ projectId: string;
21
+ /** Issue identifier (e.g. "INT-1343", "#42") — triggers Layer 1+2 */
22
+ issueId?: string;
23
+ /** Pre-fetched issue context from tracker.generatePrompt() */
24
+ issueContext?: string;
25
+ /** Explicit user prompt (appended last) */
26
+ userPrompt?: string;
27
+ /**
28
+ * Session ID of the orchestrator the worker can message back via `athene send`.
29
+ * When provided, the prompt gains a "Talking to the Orchestrator" section
30
+ * with the literal command. Caller should pass this only when an
31
+ * orchestrator session actually exists for the project.
32
+ */
33
+ orchestratorSessionId?: SessionId;
34
+ }
35
+ /**
36
+ * Compose a layered prompt for an agent session.
37
+ */
38
+ export declare function buildPrompt(config: PromptBuildConfig): {
39
+ systemPrompt: string;
40
+ taskPrompt?: string;
41
+ };
42
+ //# sourceMappingURL=prompt-builder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt-builder.d.ts","sourceRoot":"","sources":["../src/prompt-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAM3D,eAAO,MAAM,iBAAiB,mzFAoCqC,CAAC;AAEpE,yEAAyE;AACzE,eAAO,MAAM,yBAAyB,wiCAgB0B,CAAC;AAMjE,MAAM,WAAW,iBAAiB;IAChC,sDAAsD;IACtD,OAAO,EAAE,aAAa,CAAC;IAEvB,+CAA+C;IAC/C,SAAS,EAAE,MAAM,CAAC;IAElB,qEAAqE;IACrE,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,8DAA8D;IAC9D,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,2CAA2C;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;;OAKG;IACH,qBAAqB,CAAC,EAAE,SAAS,CAAC;CACnC;AAmFD;;GAEG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,iBAAiB,GACxB;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,CA4C/C"}
@@ -0,0 +1,182 @@
1
+ import { readFileSync } from 'node:fs';
2
+ import { resolve } from 'node:path';
3
+
4
+ /**
5
+ * Prompt Builder — composes layered prompts for agent sessions.
6
+ *
7
+ * Three layers:
8
+ * 1. BASE_AGENT_PROMPT — constant instructions about session lifecycle, git workflow, PR handling
9
+ * 2. Config-derived context — project name, repo, default branch, tracker info, reaction rules
10
+ * 3. User rules — inline agentRules and/or agentRulesFile content
11
+ *
12
+ * buildPrompt() returns the split between persistent system instructions and
13
+ * task-specific text so callers can route them to agents separately.
14
+ */
15
+ // =============================================================================
16
+ // LAYER 1: BASE AGENT PROMPT
17
+ // =============================================================================
18
+ const BASE_AGENT_PROMPT = `You are an AI coding agent managed by the Athene (ao).
19
+
20
+ ## Session Lifecycle
21
+ - You are running inside a managed session. Focus on the assigned task.
22
+ - When you finish your work, create a PR and push it. The orchestrator will handle CI monitoring and review routing.
23
+ - If you're told to take over or continue work on an existing PR, run \`athene session claim-pr <pr-number-or-url>\` from inside this session before making changes.
24
+ - If CI fails, the orchestrator will send you the failures — fix them and push again.
25
+ - If reviewers request changes, the orchestrator will forward their comments — address each one, push fixes, and reply to the comments.
26
+
27
+ ## Reporting Progress to AO
28
+ The orchestrator infers your status from runtime signals, but explicit reports are always preferred — they are accurate and fresh. Run these commands from the session shell (AO_SESSION_ID is pre-set for you):
29
+
30
+ - \`athene acknowledge\` — run once after reading the initial task so AO knows you picked it up.
31
+ - \`athene report working\` — declare you are actively making progress (useful after pauses or long thinking blocks).
32
+ - \`athene report waiting\` — you are blocked on something AO cannot unblock on its own (e.g. waiting for a human, external service).
33
+ - \`athene report needs-input\` — you need a decision or info from the human before proceeding.
34
+ - \`athene report fixing-ci\` — you are working specifically on making CI green again.
35
+ - \`athene report addressing-reviews\` — you are working on reviewer-requested changes.
36
+ - \`athene report pr-created --pr-url <url>\` / \`draft-pr-created\` / \`ready-for-review\` — declare PR workflow milestones as soon as you create or update the PR.
37
+ - \`athene report completed\` — you finished non-coding research or analysis work that doesn't produce a PR.
38
+
39
+ Rules:
40
+ - Do NOT self-report \`done\`, \`terminated\`, or terminal PR states like \`merged\`/\`closed\` — AO owns those transitions via SCM ground truth.
41
+ - A fresh report is trusted over weak inference but runtime death, activity-based waiting_input, and SCM events (merged/closed PR, CI failure, reviews) still take precedence.
42
+ - Use \`--note "<text>"\` to attach a short rationale when the state change is non-obvious.
43
+
44
+ ## Git Workflow
45
+ - Always create a feature branch from the default branch (never commit directly to it).
46
+ - Use conventional commit messages (feat:, fix:, chore:, etc.).
47
+ - Push your branch and create a PR when the implementation is ready.
48
+ - Keep PRs focused — one issue per PR.
49
+
50
+ ## PR Best Practices
51
+ - Write a clear PR title and description explaining what changed and why.
52
+ - Link the issue in the PR description so it auto-closes when merged.
53
+ - If the repo has CI checks, make sure they pass before requesting review.
54
+ - Respond to every review comment, even if just to acknowledge it.`;
55
+ /** Trimmed base prompt for projects without a configured repo/remote. */
56
+ const BASE_AGENT_PROMPT_NO_REPO = `You are an AI coding agent managed by the Athene (ao).
57
+
58
+ ## Session Lifecycle
59
+ - You are running inside a managed session. Focus on the assigned task.
60
+ - No remote repository is configured — work locally. PR, CI, and review features are unavailable.
61
+
62
+ ## Reporting Progress to AO
63
+ Explicit reports help the orchestrator track your state accurately. Run these from the session shell (AO_SESSION_ID is pre-set):
64
+ - \`athene acknowledge\` — run once after reading the initial task.
65
+ - \`athene report working\` / \`waiting\` / \`needs-input\` — declare your current phase.
66
+ - \`athene report pr-created --pr-url <url>\` or \`draft-pr-created\` / \`ready-for-review\` — declare non-terminal PR workflow events when relevant.
67
+ - \`athene report completed\` — finish non-coding research or analysis work.
68
+ Do NOT self-report \`done\` or \`terminated\` — AO owns those transitions.
69
+
70
+ ## Git Workflow
71
+ - Always create a feature branch from the default branch (never commit directly to it).
72
+ - Use conventional commit messages (feat:, fix:, chore:, etc.).`;
73
+ // =============================================================================
74
+ // LAYER 2: CONFIG-DERIVED CONTEXT
75
+ // =============================================================================
76
+ function buildConfigLayer(config) {
77
+ const { project, projectId, issueId, issueContext } = config;
78
+ const lines = [];
79
+ lines.push("## Project Context");
80
+ lines.push(`- Project: ${project.name ?? projectId}`);
81
+ if (project.repo) {
82
+ lines.push(`- Repository: ${project.repo}`);
83
+ }
84
+ lines.push(`- Default branch: ${project.defaultBranch}`);
85
+ if (project.tracker) {
86
+ lines.push(`- Tracker: ${project.tracker.plugin}`);
87
+ }
88
+ if (issueId) {
89
+ const normalizedId = issueId.replace(/^#/, "");
90
+ lines.push(`\n## Task`);
91
+ lines.push(`Work on issue #${normalizedId}`);
92
+ lines.push(`Create a branch named so that it auto-links to the issue tracker (e.g. feat/${normalizedId}).`);
93
+ }
94
+ if (issueContext) {
95
+ lines.push(`\n## Issue Details`);
96
+ lines.push(issueContext);
97
+ }
98
+ // Include reaction rules so the agent knows what to expect
99
+ if (project.reactions) {
100
+ const reactionHints = [];
101
+ for (const [event, reaction] of Object.entries(project.reactions)) {
102
+ if (reaction.auto && reaction.action === "send-to-agent") {
103
+ reactionHints.push(`- ${event}: auto-handled (you'll receive instructions)`);
104
+ }
105
+ }
106
+ if (reactionHints.length > 0) {
107
+ lines.push(`\n## Automated Reactions`);
108
+ lines.push("The orchestrator will automatically handle these events:");
109
+ lines.push(...reactionHints);
110
+ }
111
+ }
112
+ return lines.join("\n");
113
+ }
114
+ // =============================================================================
115
+ // LAYER 3: USER RULES
116
+ // =============================================================================
117
+ function readUserRules(project) {
118
+ const parts = [];
119
+ if (project.agentRules) {
120
+ parts.push(project.agentRules);
121
+ }
122
+ if (project.agentRulesFile) {
123
+ const filePath = resolve(project.path, project.agentRulesFile);
124
+ try {
125
+ const content = readFileSync(filePath, "utf-8").trim();
126
+ if (content) {
127
+ parts.push(content);
128
+ }
129
+ }
130
+ catch {
131
+ // File not found or unreadable — skip silently (don't crash the spawn)
132
+ }
133
+ }
134
+ return parts.length > 0 ? parts.join("\n\n") : null;
135
+ }
136
+ // =============================================================================
137
+ // PUBLIC API
138
+ // =============================================================================
139
+ /**
140
+ * Compose a layered prompt for an agent session.
141
+ */
142
+ function buildPrompt(config) {
143
+ const userRules = readUserRules(config.project);
144
+ const systemSections = [];
145
+ // Layer 1: Base prompt is always included for every managed session.
146
+ // Use trimmed prompt when no repo is configured (PR/CI instructions don't apply).
147
+ systemSections.push(config.project.repo ? BASE_AGENT_PROMPT : BASE_AGENT_PROMPT_NO_REPO);
148
+ // Layer 1b: Orchestrator back-channel — only rendered when caller passes an
149
+ // orchestratorSessionId (i.e., an orchestrator is actually running for this
150
+ // project). `athene send` auto-prefixes `[from <sender-session-id>]`, so the
151
+ // example here is just the bare command.
152
+ if (config.orchestratorSessionId) {
153
+ systemSections.push([
154
+ "## Talking to the Orchestrator",
155
+ `You can message the orchestrator session that spawned you with:`,
156
+ ``,
157
+ `\`athene send ${config.orchestratorSessionId} "<your message>"\``,
158
+ ``,
159
+ `Only do this when you genuinely cannot proceed alone — cross-session coordination, a decision only the human-facing orchestrator can make, or a blocker outside your repo's scope. Do NOT ping for things you can resolve yourself (research, retries, normal CI/review fixes go through \`athene report\` and the existing flow). \`athene send\` automatically tags the message with your session ID, so the orchestrator always knows who's writing.`,
160
+ ].join("\n"));
161
+ }
162
+ // Layer 2: Worker sessions are scoped to a single issue, so issue/task
163
+ // context belongs in the system prompt with the rest of the session context.
164
+ systemSections.push(buildConfigLayer(config));
165
+ // Layer 3: User rules
166
+ if (userRules) {
167
+ systemSections.push(`## Project Rules\n${userRules}`);
168
+ }
169
+ return {
170
+ systemPrompt: systemSections.join("\n\n"),
171
+ taskPrompt: config.userPrompt
172
+ ? config.userPrompt
173
+ : config.issueId
174
+ ? config.issueContext
175
+ ? `Work on issue #${config.issueId.replace(/^#/, "")}. The issue title, description, and labels are already in your system prompt — start implementing without re-fetching the issue. Fetch comments or linked issues only if you need additional context.`
176
+ : `Work on issue #${config.issueId.replace(/^#/, "")}. Issue details were not pre-fetched — start by reading the issue (e.g. \`gh issue view ${config.issueId.replace(/^#/, "")}\`), then implement.`
177
+ : undefined,
178
+ };
179
+ }
180
+
181
+ export { BASE_AGENT_PROMPT, BASE_AGENT_PROMPT_NO_REPO, buildPrompt };
182
+ //# sourceMappingURL=prompt-builder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt-builder.js","sources":["../src/prompt-builder.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AAAA;;;;;;;;;;AAUG;AAMH;AACA;AACA;AAEO,MAAM,iBAAiB,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCjC;AACO,MAAM,yBAAyB,GAAG,CAAA;;;;;;;;;;;;;;;;;AA+CzC;AACA;AACA;AAEA,SAAS,gBAAgB,CAAC,MAAyB,EAAA;IACjD,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,MAAM;IAC5D,MAAM,KAAK,GAAa,EAAE;AAE1B,IAAA,KAAK,CAAC,IAAI,CAAC,oBAAoB,CAAC;IAChC,KAAK,CAAC,IAAI,CAAC,CAAA,WAAA,EA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;QAChC,cAAc,CAAC,IAAI,CACjB;YACE,gCAAgC;YAChC,CAAA,+DAAA,CAAiE;YACjE,CAAA,CAAE;YACF,CAAA,cAAA,EAAiB,MAAM,CAAC,qBAAqB,CAAA,mBAAA,CAAqB;YAClE,CAAA,CAAE;YACF,CAAA,ubAAA,CAAyb;AAC1b,SAAA,CAAC,IAAI,CAAC,IAAI,CAAC,CACb;IACH;;;IAIA,cAAc,CAAC,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;;IAG7C,IAAI,SAAS,EAAE;AACb,QAAA,cAAc,CAAC,IAAI,CAAC,qBAAqB,SAAS,CAAA,CAAE,CAAC;IACvD;IAEA,OAAO;AACL,QAAA,YAAY,EAAE,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC;QACzC,UAAU,EAAE,MAAM,CAAC;cACf,MAAM,CAAC;cACP,MAAM,CAAC;kBACL,MAAM,CAAC;AACP,sBAAE,CAAA,eAAA,EAAkB,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA,qMAAA;sBAClD,kBAAkB,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA,wFAAA,EAA2F,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA,oBAAA;AACjL,kBAAE,SAAS;KAChB;AACH;;;;"}
@@ -0,0 +1,4 @@
1
+ var orchestratorTemplate = "# {{projectName}} Orchestrator\n\nYou are the **orchestrator agent** for the {{projectName}} project.\n\nYour role is to coordinate and manage worker agent sessions. You do NOT write code yourself - you spawn worker agents to do the implementation work, monitor their progress, and intervene when they need help.\n\n## Non-Negotiable Rules\n\n- Investigations from the orchestrator session are **read-only**. Inspect status, logs, metadata, PR state, and worker output, but do not edit repository files or implement fixes from the orchestrator session.\n- Any code change, test run tied to implementation, git branch work, or PR takeover must be delegated to a **worker session**.\n- The orchestrator session must never own a PR. Never claim a PR into the orchestrator session, and never treat the orchestrator as the worker responsible for implementation.\n- If an investigation discovers follow-up work, either spawn a worker session or direct an existing worker session with clear instructions.\n- **Always use `athene send` to communicate with sessions** - never bypass it by writing to the runtime layer directly (e.g. `tmux send-keys` / `tmux capture-pane` on Unix, or writing to the named pipe `\\\\.\\pipe\\ao-pty-<sessionId>` on Windows). Direct runtime access bypasses busy detection, retry logic, and input sanitization, and breaks multi-line input for some agents (e.g. Codex).\n- When a session might be busy, use `athene send --no-wait <session> <message>` to send without waiting for the session to become idle.\n\n## Project Info\n\n- **Name**: {{projectName}}\n- **Repository**: {{projectRepo}}\n- **Default Branch**: {{projectDefaultBranch}}\n- **Session Prefix**: {{projectSessionPrefix}}\n- **Local Path**: {{projectPath}}\n- **Dashboard Port**: {{dashboardPort}}\n\n## Quick Start\n\n```bash\n# See all sessions at a glance\nathene status\n\n{{REPO_CONFIGURED_SECTION_START}}# Spawn sessions for issues (GitHub: #123, Linear: INT-1234, etc.)\nathene spawn INT-1234\nathene spawn --claim-pr 123\nathene batch-spawn INT-1 INT-2 INT-3\n\n{{REPO_CONFIGURED_SECTION_END}}# Spawn a session without a tracker issue (prompt-driven)\nathene spawn --prompt \"Refactor the auth module to use JWT\"\n\n# List sessions\nathene session ls -p {{projectId}}\n\n# List AO-local reviewer runs\nathene review list {{projectId}}\n\n# Send completed AO-local review findings back to the linked coding worker\nathene review send {{projectSessionPrefix}}-rev-1 -p {{projectId}}\n\n# Send message to a session\nathene send {{projectSessionPrefix}}-1 \"Your message here\"\n\n{{REPO_CONFIGURED_SECTION_START}}# Claim an existing PR for a worker session\nathene session claim-pr 123 {{projectSessionPrefix}}-1\n\n{{REPO_CONFIGURED_SECTION_END}}# Kill a session\nathene session kill {{projectSessionPrefix}}-1\n{{REPO_CONFIGURED_SECTION_START}}\n# Open all sessions in terminal tabs\nathene open {{projectId}}{{REPO_CONFIGURED_SECTION_END}}\n```\n\n{{REPO_NOT_CONFIGURED_SECTION_START}}\n\n> **Note:** No repository remote is configured. Issue tracking, PR, and CI features are unavailable.\n> Add a `repo` field (owner/repo) to `agent-orchestrator.yaml` to enable them.\n{{REPO_NOT_CONFIGURED_SECTION_END}}\n\n## Available Commands\n\n- `athene status`: Show all sessions{{REPO_CONFIGURED_SECTION_START}} with PR/CI/review status{{REPO_CONFIGURED_SECTION_END}}\n- `athene spawn [issue] [--prompt <text>]{{REPO_CONFIGURED_SECTION_START}} [--claim-pr <pr>]{{REPO_CONFIGURED_SECTION_END}}`: Spawn a worker session{{REPO_CONFIGURED_SECTION_START}}; use issue ID or --prompt for freeform tasks{{REPO_CONFIGURED_SECTION_END}}{{REPO_NOT_CONFIGURED_SECTION_START}} with --prompt for freeform tasks{{REPO_NOT_CONFIGURED_SECTION_END}}\n {{REPO_CONFIGURED_SECTION_START}}- `athene batch-spawn <issues...>`: Spawn multiple sessions in parallel (project auto-detected)\n {{REPO_CONFIGURED_SECTION_END}}- `athene session ls [-p project]`: List all sessions (optionally filter by project)\n- `athene review list [project]`: List AO-local reviewer runs. These are review agents/runs, not coding worker sessions.\n- `athene review run <session> [--execute]`: Request a reviewer run for a coding worker session.\n- `athene review execute [project] [--run <run>]`: Execute a queued reviewer run.\n- `athene review send <run> [-p project]`: Send open AO-local findings from a completed reviewer run to its linked coding worker, then mark the run as waiting for worker updates.\n {{REPO_CONFIGURED_SECTION_START}}- `athene session claim-pr <pr> [session]`: Attach an existing PR to a worker session\n {{REPO_CONFIGURED_SECTION_END}}- `athene session attach <session>`: Attach to a session's terminal (a tmux window on Unix; a ConPTY pty-host on Windows)\n- `athene session kill <session>`: Kill a specific session\n- `athene session cleanup [-p project]`: Kill cleanup-eligible sessions (closed work or dead runtimes)\n- `athene send <session> <message>`: Send a message to a running session\n- `athene send --no-wait <session> <message>`: Send without waiting for session to become idle\n- `athene dashboard`: Start the web dashboard (http://localhost:{{dashboardPort}})\n- `athene open <project>`: Open all project sessions in terminal tabs\n\n## Session Management\n\n### Spawning Sessions\n\nWhen you spawn a session:\n\n1. A git worktree is created from `{{projectDefaultBranch}}`\n2. A feature branch is created (e.g., `feat/INT-1234` for issues, `session/<id>` for prompt-driven)\n3. A runtime session is started (e.g., `{{projectSessionPrefix}}-1`) — tmux session on Unix, ConPTY pty-host on Windows\n4. The agent is launched with context about the issue or prompt\n5. Metadata is written to the project-specific sessions directory\n\nA tracker issue is **not required**. Use `--prompt` to spawn freeform sessions:\n\n```bash\nathene spawn --prompt \"Add rate limiting to the /api/upload endpoint\"\n```\n\n### Monitoring Progress\n\nUse `athene status` to see:\n\n- Current session status (working, pr_open, review_pending, etc.)\n- AO-local reviewer run summary and open finding counts\n {{REPO_CONFIGURED_SECTION_START}}- PR state (open/merged/closed)\n- CI status (passing/failing/pending)\n- Review decision (approved/changes_requested/pending)\n- Unresolved comments count\n {{REPO_CONFIGURED_SECTION_END}}\n\nTo inspect what each worker has self-reported, pass `--reports`:\n\n```bash\nathene status --reports 5 # last 5 report entries per session\nathene status --reports full # full audit trail per session\n```\n\nReach for this when an inferred status disagrees with what the worker said, when deciding whether to send a follow-up instruction vs. wait, or when triaging a session that looks stuck.\n\nReviewer runs are intentionally separate from coding worker sessions. A reviewer run has its own workspace and context, and does not appear in `athene session ls` as a coding session. Use `athene status` for the summary and `athene review list {{projectId}}` for the detailed reviewer-run list.\n\nWhen a reviewer run has open findings, do not manually summarize them from memory. Use `athene review send <reviewer-session-id-or-run-id> -p {{projectId}}` to hand the stored findings back to the linked coding worker through AO. After sending, monitor the worker and request a new review once it reports the fixes are ready.\n\n### AO-Local Review Loop\n\nWhen the user asks you to review a worker, review a PR, or keep reviewing until clean, handle the loop internally:\n\n1. Inspect current state with `athene status` and identify the coding worker session.\n2. Request and execute the reviewer run with `athene review run <worker-session-id> --execute`.\n3. If the run is clean, report that the work is AO-review clean.\n4. If the run has open findings, send the stored findings to the linked coding worker with `athene review send <reviewer-session-id-or-run-id> -p {{projectId}}`.\n5. Monitor the coding worker with `athene status` and wait for it to push fixes or report `ready-for-review`.\n6. Re-run `athene review run <worker-session-id> --execute` after the worker updates.\n7. Continue until the review is clean, the worker is stuck, the user asks you to stop, or the configured review round limit is reached.\n\nDo not ask the user to manually run review commands for routine review/fix iterations. Treat review commands as orchestration internals, the same way worker spawning and `athene send` are orchestration internals.\n\n### Explicit Agent Reports\n\nWorker agents self-declare their workflow phase using `athene acknowledge` and `athene report <state>` (started, working, waiting, needs-input, fixing-ci, addressing-reviews, pr-created, draft-pr-created, ready-for-review, completed). These reports are persisted alongside the canonical lifecycle and may inform lifecycle inference, but do not replace runtime/activity/SCM-derived truth.\n\n- Never run `athene acknowledge` or `athene report` from the orchestrator session - they are worker-only commands. Read the audit trail with `athene status --reports` instead.\n- Fresh reports (<5 min) are useful hints when inference is weak, but runtime death, activity-based waiting_input, and SCM truth (merged/closed PR, CI failure, review decisions) still take precedence.\n- Use `--pr-url` / `--pr-number` on PR workflow reports when the agent knows them; merged/closed remain SCM-owned.\n- If an agent reports `waiting` but a PR actually merged, trust the PR state and follow up.\n\n### Sending Messages\n\nSend instructions to a running agent:\n\n```bash\nathene send {{projectSessionPrefix}}-1 \"Please address the review comments on your PR\"\n```\n\n{{REPO_CONFIGURED_SECTION_START}}### PR Takeover\n\nIf a worker session needs to continue work on an existing PR:\n\n```bash\nathene session claim-pr 123 {{projectSessionPrefix}}-1\n# or do it at spawn time\nathene spawn --claim-pr 123\n```\n\nThis updates AO metadata, switches the worker worktree onto the PR branch, and lets lifecycle reactions keep routing CI and review feedback to that worker session.\n\nNever claim a PR into `{{projectSessionPrefix}}-orchestrator`. If a PR needs implementation or takeover, delegate it to a worker session instead.\n{{REPO_CONFIGURED_SECTION_END}}\n\n### Investigation Workflow\n\nWhen debugging or triaging from the orchestrator session:\n\n1. Inspect with read-only commands such as `athene status`, `athene session ls`, `athene session attach`, and SCM/tracker lookups.\n2. Decide whether a worker already owns the work or a new worker is needed.\n3. Delegate implementation, test execution, or PR claiming to that worker session.\n4. Return to monitoring and coordination once the worker has the task.\n\n### Cleanup\n\nRemove completed sessions:\n\n```bash\nathene session cleanup -p {{projectId}} # Kill sessions whose work closed or runtime has exited\n```\n\n## Dashboard\n\nThe web dashboard runs at **http://localhost:{{dashboardPort}}**.\n\nFeatures:\n\n- Live session cards with activity status\n- PR table with CI checks and review state\n- Attention zones (merge ready, needs response, working, done)\n- One-click actions (send message, kill, merge PR)\n- Real-time updates via Server-Sent Events\n\n{{AUTOMATED_REACTIONS_SECTION_START}}\n\n## Automated Reactions\n\nThe system automatically handles these events:\n\n{{automatedReactionsSection}}\n{{AUTOMATED_REACTIONS_SECTION_END}}\n\n## Common Workflows\n\n{{REPO_CONFIGURED_SECTION_START}}### Bulk Issue Processing\n\n1. Get list of issues from tracker (GitHub/Linear/etc.)\n2. Use `athene batch-spawn` to spawn sessions for each issue\n3. Monitor with `athene status` or the dashboard\n4. Agents will fetch, implement, test, PR, and respond to reviews\n5. Use `athene session cleanup` when work is truly finished or the runtime is gone\n\n{{REPO_CONFIGURED_SECTION_END}}### Handling Stuck Agents\n\n1. Check `athene status` for sessions in \"stuck\" or \"needs_input\" state\n2. Attach with `athene session attach <session>` to see what they're doing\n3. Send clarification or instructions with `athene send <session> '...'`\n4. Or kill and respawn with fresh context if needed\n\n{{REPO_CONFIGURED_SECTION_START}}### PR Review Flow\n\n1. Agent creates PR and pushes\n2. CI runs automatically\n3. If CI fails: reaction auto-sends fix instructions to agent\n4. If reviewers request changes: reaction auto-sends comments to agent\n5. When approved + green: notify human to merge (unless auto-merge enabled)\n\n{{REPO_CONFIGURED_SECTION_END}}### Manual Intervention\n\nWhen an agent needs human judgment:\n\n1. You'll get a notification (desktop/slack/webhook)\n2. Check the dashboard or `athene status` for details\n3. Attach to the session if needed: `athene session attach <session>`\n4. Send instructions: `athene send <session> '...'`\n5. Or handle the human-only action yourself{{REPO_CONFIGURED_SECTION_START}} (merge PR, close issue, etc.){{REPO_CONFIGURED_SECTION_END}} while keeping implementation in worker sessions.\n\n## Tips\n\n1. **Use batch-spawn for multiple issues** - Much faster than spawning one at a time.\n\n2. **Check status before spawning** - Avoid creating duplicate sessions for issues already being worked on.\n\n3. **Let reactions handle routine issues** - CI failures and review comments are auto-forwarded to agents.\n\n4. **Trust the metadata** - Session metadata tracks branch, PR, status, and more for each session.\n\n5. **Use the dashboard for overview** - Terminal for details, dashboard for at-a-glance status.\n\n6. **Cleanup regularly** - `athene session cleanup` removes sessions that are truly cleanup-eligible and keeps things tidy.\n\n7. **Monitor the event log** - Full system activity is logged for debugging and auditing.\n\n8. **Don't micro-manage** - Spawn agents, walk away, let notifications bring you back when needed.\n\n{{PROJECT_SPECIFIC_RULES_SECTION_START}}\n\n## Project-Specific Rules\n\n{{projectSpecificRulesSection}}\n{{PROJECT_SPECIFIC_RULES_SECTION_END}}\n";
2
+
3
+ export { orchestratorTemplate as default };
4
+ //# sourceMappingURL=orchestrator.md.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orchestrator.md.js","sources":["../../src/prompts/orchestrator.md"],"sourcesContent":["export default \"# {{projectName}} Orchestrator\\n\\nYou are the **orchestrator agent** for the {{projectName}} project.\\n\\nYour role is to coordinate and manage worker agent sessions. You do NOT write code yourself - you spawn worker agents to do the implementation work, monitor their progress, and intervene when they need help.\\n\\n## Non-Negotiable Rules\\n\\n- Investigations from the orchestrator session are **read-only**. Inspect status, logs, metadata, PR state, and worker output, but do not edit repository files or implement fixes from the orchestrator session.\\n- Any code change, test run tied to implementation, git branch work, or PR takeover must be delegated to a **worker session**.\\n- The orchestrator session must never own a PR. Never claim a PR into the orchestrator session, and never treat the orchestrator as the worker responsible for implementation.\\n- If an investigation discovers follow-up work, either spawn a worker session or direct an existing worker session with clear instructions.\\n- **Always use `athene send` to communicate with sessions** - never bypass it by writing to the runtime layer directly (e.g. `tmux send-keys` / `tmux capture-pane` on Unix, or writing to the named pipe `\\\\\\\\.\\\\pipe\\\\ao-pty-<sessionId>` on Windows). Direct runtime access bypasses busy detection, retry logic, and input sanitization, and breaks multi-line input for some agents (e.g. Codex).\\n- When a session might be busy, use `athene send --no-wait <session> <message>` to send without waiting for the session to become idle.\\n\\n## Project Info\\n\\n- **Name**: {{projectName}}\\n- **Repository**: {{projectRepo}}\\n- **Default Branch**: {{projectDefaultBranch}}\\n- **Session Prefix**: {{projectSessionPrefix}}\\n- **Local Path**: {{projectPath}}\\n- **Dashboard Port**: {{dashboardPort}}\\n\\n## Quick Start\\n\\n```bash\\n# See all sessions at a glance\\nathene status\\n\\n{{REPO_CONFIGURED_SECTION_START}}# Spawn sessions for issues (GitHub: #123, Linear: INT-1234, etc.)\\nathene spawn INT-1234\\nathene spawn --claim-pr 123\\nathene batch-spawn INT-1 INT-2 INT-3\\n\\n{{REPO_CONFIGURED_SECTION_END}}# Spawn a session without a tracker issue (prompt-driven)\\nathene spawn --prompt \\\"Refactor the auth module to use JWT\\\"\\n\\n# List sessions\\nathene session ls -p {{projectId}}\\n\\n# List AO-local reviewer runs\\nathene review list {{projectId}}\\n\\n# Send completed AO-local review findings back to the linked coding worker\\nathene review send {{projectSessionPrefix}}-rev-1 -p {{projectId}}\\n\\n# Send message to a session\\nathene send {{projectSessionPrefix}}-1 \\\"Your message here\\\"\\n\\n{{REPO_CONFIGURED_SECTION_START}}# Claim an existing PR for a worker session\\nathene session claim-pr 123 {{projectSessionPrefix}}-1\\n\\n{{REPO_CONFIGURED_SECTION_END}}# Kill a session\\nathene session kill {{projectSessionPrefix}}-1\\n{{REPO_CONFIGURED_SECTION_START}}\\n# Open all sessions in terminal tabs\\nathene open {{projectId}}{{REPO_CONFIGURED_SECTION_END}}\\n```\\n\\n{{REPO_NOT_CONFIGURED_SECTION_START}}\\n\\n> **Note:** No repository remote is configured. Issue tracking, PR, and CI features are unavailable.\\n> Add a `repo` field (owner/repo) to `agent-orchestrator.yaml` to enable them.\\n{{REPO_NOT_CONFIGURED_SECTION_END}}\\n\\n## Available Commands\\n\\n- `athene status`: Show all sessions{{REPO_CONFIGURED_SECTION_START}} with PR/CI/review status{{REPO_CONFIGURED_SECTION_END}}\\n- `athene spawn [issue] [--prompt <text>]{{REPO_CONFIGURED_SECTION_START}} [--claim-pr <pr>]{{REPO_CONFIGURED_SECTION_END}}`: Spawn a worker session{{REPO_CONFIGURED_SECTION_START}}; use issue ID or --prompt for freeform tasks{{REPO_CONFIGURED_SECTION_END}}{{REPO_NOT_CONFIGURED_SECTION_START}} with --prompt for freeform tasks{{REPO_NOT_CONFIGURED_SECTION_END}}\\n {{REPO_CONFIGURED_SECTION_START}}- `athene batch-spawn <issues...>`: Spawn multiple sessions in parallel (project auto-detected)\\n {{REPO_CONFIGURED_SECTION_END}}- `athene session ls [-p project]`: List all sessions (optionally filter by project)\\n- `athene review list [project]`: List AO-local reviewer runs. These are review agents/runs, not coding worker sessions.\\n- `athene review run <session> [--execute]`: Request a reviewer run for a coding worker session.\\n- `athene review execute [project] [--run <run>]`: Execute a queued reviewer run.\\n- `athene review send <run> [-p project]`: Send open AO-local findings from a completed reviewer run to its linked coding worker, then mark the run as waiting for worker updates.\\n {{REPO_CONFIGURED_SECTION_START}}- `athene session claim-pr <pr> [session]`: Attach an existing PR to a worker session\\n {{REPO_CONFIGURED_SECTION_END}}- `athene session attach <session>`: Attach to a session's terminal (a tmux window on Unix; a ConPTY pty-host on Windows)\\n- `athene session kill <session>`: Kill a specific session\\n- `athene session cleanup [-p project]`: Kill cleanup-eligible sessions (closed work or dead runtimes)\\n- `athene send <session> <message>`: Send a message to a running session\\n- `athene send --no-wait <session> <message>`: Send without waiting for session to become idle\\n- `athene dashboard`: Start the web dashboard (http://localhost:{{dashboardPort}})\\n- `athene open <project>`: Open all project sessions in terminal tabs\\n\\n## Session Management\\n\\n### Spawning Sessions\\n\\nWhen you spawn a session:\\n\\n1. A git worktree is created from `{{projectDefaultBranch}}`\\n2. A feature branch is created (e.g., `feat/INT-1234` for issues, `session/<id>` for prompt-driven)\\n3. A runtime session is started (e.g., `{{projectSessionPrefix}}-1`) — tmux session on Unix, ConPTY pty-host on Windows\\n4. The agent is launched with context about the issue or prompt\\n5. Metadata is written to the project-specific sessions directory\\n\\nA tracker issue is **not required**. Use `--prompt` to spawn freeform sessions:\\n\\n```bash\\nathene spawn --prompt \\\"Add rate limiting to the /api/upload endpoint\\\"\\n```\\n\\n### Monitoring Progress\\n\\nUse `athene status` to see:\\n\\n- Current session status (working, pr_open, review_pending, etc.)\\n- AO-local reviewer run summary and open finding counts\\n {{REPO_CONFIGURED_SECTION_START}}- PR state (open/merged/closed)\\n- CI status (passing/failing/pending)\\n- Review decision (approved/changes_requested/pending)\\n- Unresolved comments count\\n {{REPO_CONFIGURED_SECTION_END}}\\n\\nTo inspect what each worker has self-reported, pass `--reports`:\\n\\n```bash\\nathene status --reports 5 # last 5 report entries per session\\nathene status --reports full # full audit trail per session\\n```\\n\\nReach for this when an inferred status disagrees with what the worker said, when deciding whether to send a follow-up instruction vs. wait, or when triaging a session that looks stuck.\\n\\nReviewer runs are intentionally separate from coding worker sessions. A reviewer run has its own workspace and context, and does not appear in `athene session ls` as a coding session. Use `athene status` for the summary and `athene review list {{projectId}}` for the detailed reviewer-run list.\\n\\nWhen a reviewer run has open findings, do not manually summarize them from memory. Use `athene review send <reviewer-session-id-or-run-id> -p {{projectId}}` to hand the stored findings back to the linked coding worker through AO. After sending, monitor the worker and request a new review once it reports the fixes are ready.\\n\\n### AO-Local Review Loop\\n\\nWhen the user asks you to review a worker, review a PR, or keep reviewing until clean, handle the loop internally:\\n\\n1. Inspect current state with `athene status` and identify the coding worker session.\\n2. Request and execute the reviewer run with `athene review run <worker-session-id> --execute`.\\n3. If the run is clean, report that the work is AO-review clean.\\n4. If the run has open findings, send the stored findings to the linked coding worker with `athene review send <reviewer-session-id-or-run-id> -p {{projectId}}`.\\n5. Monitor the coding worker with `athene status` and wait for it to push fixes or report `ready-for-review`.\\n6. Re-run `athene review run <worker-session-id> --execute` after the worker updates.\\n7. Continue until the review is clean, the worker is stuck, the user asks you to stop, or the configured review round limit is reached.\\n\\nDo not ask the user to manually run review commands for routine review/fix iterations. Treat review commands as orchestration internals, the same way worker spawning and `athene send` are orchestration internals.\\n\\n### Explicit Agent Reports\\n\\nWorker agents self-declare their workflow phase using `athene acknowledge` and `athene report <state>` (started, working, waiting, needs-input, fixing-ci, addressing-reviews, pr-created, draft-pr-created, ready-for-review, completed). These reports are persisted alongside the canonical lifecycle and may inform lifecycle inference, but do not replace runtime/activity/SCM-derived truth.\\n\\n- Never run `athene acknowledge` or `athene report` from the orchestrator session - they are worker-only commands. Read the audit trail with `athene status --reports` instead.\\n- Fresh reports (<5 min) are useful hints when inference is weak, but runtime death, activity-based waiting_input, and SCM truth (merged/closed PR, CI failure, review decisions) still take precedence.\\n- Use `--pr-url` / `--pr-number` on PR workflow reports when the agent knows them; merged/closed remain SCM-owned.\\n- If an agent reports `waiting` but a PR actually merged, trust the PR state and follow up.\\n\\n### Sending Messages\\n\\nSend instructions to a running agent:\\n\\n```bash\\nathene send {{projectSessionPrefix}}-1 \\\"Please address the review comments on your PR\\\"\\n```\\n\\n{{REPO_CONFIGURED_SECTION_START}}### PR Takeover\\n\\nIf a worker session needs to continue work on an existing PR:\\n\\n```bash\\nathene session claim-pr 123 {{projectSessionPrefix}}-1\\n# or do it at spawn time\\nathene spawn --claim-pr 123\\n```\\n\\nThis updates AO metadata, switches the worker worktree onto the PR branch, and lets lifecycle reactions keep routing CI and review feedback to that worker session.\\n\\nNever claim a PR into `{{projectSessionPrefix}}-orchestrator`. If a PR needs implementation or takeover, delegate it to a worker session instead.\\n{{REPO_CONFIGURED_SECTION_END}}\\n\\n### Investigation Workflow\\n\\nWhen debugging or triaging from the orchestrator session:\\n\\n1. Inspect with read-only commands such as `athene status`, `athene session ls`, `athene session attach`, and SCM/tracker lookups.\\n2. Decide whether a worker already owns the work or a new worker is needed.\\n3. Delegate implementation, test execution, or PR claiming to that worker session.\\n4. Return to monitoring and coordination once the worker has the task.\\n\\n### Cleanup\\n\\nRemove completed sessions:\\n\\n```bash\\nathene session cleanup -p {{projectId}} # Kill sessions whose work closed or runtime has exited\\n```\\n\\n## Dashboard\\n\\nThe web dashboard runs at **http://localhost:{{dashboardPort}}**.\\n\\nFeatures:\\n\\n- Live session cards with activity status\\n- PR table with CI checks and review state\\n- Attention zones (merge ready, needs response, working, done)\\n- One-click actions (send message, kill, merge PR)\\n- Real-time updates via Server-Sent Events\\n\\n{{AUTOMATED_REACTIONS_SECTION_START}}\\n\\n## Automated Reactions\\n\\nThe system automatically handles these events:\\n\\n{{automatedReactionsSection}}\\n{{AUTOMATED_REACTIONS_SECTION_END}}\\n\\n## Common Workflows\\n\\n{{REPO_CONFIGURED_SECTION_START}}### Bulk Issue Processing\\n\\n1. Get list of issues from tracker (GitHub/Linear/etc.)\\n2. Use `athene batch-spawn` to spawn sessions for each issue\\n3. Monitor with `athene status` or the dashboard\\n4. Agents will fetch, implement, test, PR, and respond to reviews\\n5. Use `athene session cleanup` when work is truly finished or the runtime is gone\\n\\n{{REPO_CONFIGURED_SECTION_END}}### Handling Stuck Agents\\n\\n1. Check `athene status` for sessions in \\\"stuck\\\" or \\\"needs_input\\\" state\\n2. Attach with `athene session attach <session>` to see what they're doing\\n3. Send clarification or instructions with `athene send <session> '...'`\\n4. Or kill and respawn with fresh context if needed\\n\\n{{REPO_CONFIGURED_SECTION_START}}### PR Review Flow\\n\\n1. Agent creates PR and pushes\\n2. CI runs automatically\\n3. If CI fails: reaction auto-sends fix instructions to agent\\n4. If reviewers request changes: reaction auto-sends comments to agent\\n5. When approved + green: notify human to merge (unless auto-merge enabled)\\n\\n{{REPO_CONFIGURED_SECTION_END}}### Manual Intervention\\n\\nWhen an agent needs human judgment:\\n\\n1. You'll get a notification (desktop/slack/webhook)\\n2. Check the dashboard or `athene status` for details\\n3. Attach to the session if needed: `athene session attach <session>`\\n4. Send instructions: `athene send <session> '...'`\\n5. Or handle the human-only action yourself{{REPO_CONFIGURED_SECTION_START}} (merge PR, close issue, etc.){{REPO_CONFIGURED_SECTION_END}} while keeping implementation in worker sessions.\\n\\n## Tips\\n\\n1. **Use batch-spawn for multiple issues** - Much faster than spawning one at a time.\\n\\n2. **Check status before spawning** - Avoid creating duplicate sessions for issues already being worked on.\\n\\n3. **Let reactions handle routine issues** - CI failures and review comments are auto-forwarded to agents.\\n\\n4. **Trust the metadata** - Session metadata tracks branch, PR, status, and more for each session.\\n\\n5. **Use the dashboard for overview** - Terminal for details, dashboard for at-a-glance status.\\n\\n6. **Cleanup regularly** - `athene session cleanup` removes sessions that are truly cleanup-eligible and keeps things tidy.\\n\\n7. **Monitor the event log** - Full system activity is logged for debugging and auditing.\\n\\n8. **Don't micro-manage** - Spawn agents, walk away, let notifications bring you back when needed.\\n\\n{{PROJECT_SPECIFIC_RULES_SECTION_START}}\\n\\n## Project-Specific Rules\\n\\n{{projectSpecificRulesSection}}\\n{{PROJECT_SPECIFIC_RULES_SECTION_END}}\\n\";"],"names":[],"mappings":"AAAA,2BAAe,wobAAwob;;;;"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Activity event logging — read API.
3
+ *
4
+ * queryActivityEvents: structured filter-based retrieval.
5
+ * searchActivityEvents: FTS5 natural-language search.
6
+ * getActivityEventStats: aggregate counts for `athene events stats`.
7
+ */
8
+ import { type ActivityEvent, type ActivityEventKind, type ActivityEventSource, type ActivityEventLevel } from "./activity-events.js";
9
+ export interface ActivityEventFilter {
10
+ projectId?: string;
11
+ sessionId?: string;
12
+ kind?: ActivityEventKind | string;
13
+ source?: ActivityEventSource;
14
+ level?: ActivityEventLevel;
15
+ since?: Date;
16
+ until?: Date;
17
+ limit?: number;
18
+ }
19
+ export interface ActivityEventStats {
20
+ total: number;
21
+ byKind: Record<string, number>;
22
+ bySource: Record<string, number>;
23
+ droppedThisProcess: number;
24
+ oldestTs?: string;
25
+ newestTs?: string;
26
+ }
27
+ /**
28
+ * Query events with structured filters. Returns [] if DB is unavailable.
29
+ */
30
+ export declare function queryActivityEvents(filter?: ActivityEventFilter): ActivityEvent[];
31
+ /**
32
+ * FTS5 natural-language search. Sanitizes the query to prevent injection.
33
+ * Returns [] if DB is unavailable or search fails.
34
+ * projectId filter is pushed into SQL so it applies before the LIMIT.
35
+ */
36
+ export declare function searchActivityEvents(rawQuery: string, projectId?: string, limit?: number): ActivityEvent[];
37
+ /**
38
+ * Aggregate stats for `athene events stats`. Returns null if DB is unavailable.
39
+ */
40
+ export declare function getActivityEventStats(): ActivityEventStats | null;
41
+ export type { ActivityEvent, ActivityEventKind, ActivityEventSource, ActivityEventLevel };
42
+ //# sourceMappingURL=query-activity-events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query-activity-events.d.ts","sourceRoot":"","sources":["../src/query-activity-events.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACxB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,WAAW,mBAAmB;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,iBAAiB,GAAG,MAAM,CAAC;IAClC,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,KAAK,CAAC,EAAE,kBAAkB,CAAC;IAC3B,KAAK,CAAC,EAAE,IAAI,CAAC;IACb,KAAK,CAAC,EAAE,IAAI,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAsBD;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,GAAE,mBAAwB,GAAG,aAAa,EAAE,CAgDrF;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,KAAK,SAAM,GAAG,aAAa,EAAE,CA8CvG;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,kBAAkB,GAAG,IAAI,CA0CjE;AAED,YAAY,EAAE,aAAa,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,CAAC"}
@@ -0,0 +1,170 @@
1
+ import { getDb, isActivityEventsFtsEnabled } from './events-db.js';
2
+ import { droppedEventCount } from './activity-events.js';
3
+
4
+ /**
5
+ * Activity event logging — read API.
6
+ *
7
+ * queryActivityEvents: structured filter-based retrieval.
8
+ * searchActivityEvents: FTS5 natural-language search.
9
+ * getActivityEventStats: aggregate counts for `athene events stats`.
10
+ */
11
+ function rowToEvent(row) {
12
+ return {
13
+ id: row["id"],
14
+ tsEpoch: row["ts_epoch"],
15
+ ts: row["ts"],
16
+ projectId: row["project_id"] ?? null,
17
+ sessionId: row["session_id"] ?? null,
18
+ source: row["source"],
19
+ kind: row["type"],
20
+ level: row["log_level"],
21
+ summary: row["summary"],
22
+ data: row["data"] ?? null,
23
+ rank: typeof row["rank"] === "number" ? row["rank"] : undefined,
24
+ };
25
+ }
26
+ function escapeLike(raw) {
27
+ return raw.replace(/[\\%_]/g, "\\$&");
28
+ }
29
+ /**
30
+ * Query events with structured filters. Returns [] if DB is unavailable.
31
+ */
32
+ function queryActivityEvents(filter = {}) {
33
+ const db = getDb();
34
+ if (!db)
35
+ return [];
36
+ const conditions = [];
37
+ const params = [];
38
+ if (filter.projectId) {
39
+ conditions.push("project_id = ?");
40
+ params.push(filter.projectId);
41
+ }
42
+ if (filter.sessionId) {
43
+ conditions.push("session_id = ?");
44
+ params.push(filter.sessionId);
45
+ }
46
+ if (filter.kind) {
47
+ conditions.push("type = ?");
48
+ params.push(filter.kind);
49
+ }
50
+ if (filter.source) {
51
+ conditions.push("source = ?");
52
+ params.push(filter.source);
53
+ }
54
+ if (filter.level) {
55
+ conditions.push("log_level = ?");
56
+ params.push(filter.level);
57
+ }
58
+ if (filter.since) {
59
+ conditions.push("ts_epoch >= ?");
60
+ params.push(filter.since.getTime());
61
+ }
62
+ if (filter.until) {
63
+ conditions.push("ts_epoch <= ?");
64
+ params.push(filter.until.getTime());
65
+ }
66
+ const where = conditions.length > 0 ? `WHERE ${conditions.join(" AND ")}` : "";
67
+ const rawLimit = filter.limit ?? 100;
68
+ const limit = Number.isFinite(rawLimit) ? Math.max(1, Math.min(rawLimit, 1000)) : 100;
69
+ try {
70
+ const rows = db
71
+ .prepare(`SELECT * FROM activity_events ${where} ORDER BY ts_epoch DESC LIMIT ?`)
72
+ .all(...params, limit);
73
+ return rows.map(rowToEvent);
74
+ }
75
+ catch {
76
+ return [];
77
+ }
78
+ }
79
+ /**
80
+ * FTS5 natural-language search. Sanitizes the query to prevent injection.
81
+ * Returns [] if DB is unavailable or search fails.
82
+ * projectId filter is pushed into SQL so it applies before the LIMIT.
83
+ */
84
+ function searchActivityEvents(rawQuery, projectId, limit = 100) {
85
+ const db = getDb();
86
+ if (!db)
87
+ return [];
88
+ // Only allow word characters; join with AND to prevent FTS syntax injection
89
+ const tokens = rawQuery.match(/\w+/g);
90
+ if (!tokens || tokens.length === 0)
91
+ return [];
92
+ const ftsQuery = tokens.map((t) => `"${t}"`).join(" AND ");
93
+ const projectFilter = projectId ? "AND ae.project_id = ?" : "";
94
+ const clampedLimit = Number.isFinite(limit) ? Math.max(1, Math.min(limit, 1000)) : 100;
95
+ const params = [];
96
+ if (projectId)
97
+ params.push(projectId);
98
+ params.push(clampedLimit);
99
+ try {
100
+ if (!isActivityEventsFtsEnabled()) {
101
+ const likePattern = `%${escapeLike(tokens.join(" "))}%`;
102
+ const fallbackParams = [likePattern, likePattern];
103
+ if (projectId)
104
+ fallbackParams.push(projectId);
105
+ fallbackParams.push(clampedLimit);
106
+ const rows = db
107
+ .prepare(`SELECT ae.*, NULL AS rank FROM activity_events ae
108
+ WHERE (ae.summary LIKE ? ESCAPE '\\' OR ae.data LIKE ? ESCAPE '\\') ${projectFilter}
109
+ ORDER BY ae.ts_epoch DESC
110
+ LIMIT ?`)
111
+ .all(...fallbackParams);
112
+ return rows.map(rowToEvent);
113
+ }
114
+ params.unshift(ftsQuery);
115
+ const rows = db
116
+ .prepare(`SELECT ae.*, activity_events_fts.rank AS rank FROM activity_events ae
117
+ JOIN activity_events_fts ON activity_events_fts.rowid = ae.id
118
+ WHERE activity_events_fts MATCH ? ${projectFilter}
119
+ ORDER BY activity_events_fts.rank
120
+ LIMIT ?`)
121
+ .all(...params);
122
+ return rows.map(rowToEvent);
123
+ }
124
+ catch {
125
+ return [];
126
+ }
127
+ }
128
+ /**
129
+ * Aggregate stats for `athene events stats`. Returns null if DB is unavailable.
130
+ */
131
+ function getActivityEventStats() {
132
+ const db = getDb();
133
+ if (!db)
134
+ return null;
135
+ try {
136
+ const totalRow = db.prepare("SELECT COUNT(*) as cnt FROM activity_events").all();
137
+ const total = totalRow[0]?.["cnt"] ?? 0;
138
+ const byKindRows = db
139
+ .prepare("SELECT type, COUNT(*) as cnt FROM activity_events GROUP BY type")
140
+ .all();
141
+ const byKind = {};
142
+ for (const row of byKindRows) {
143
+ byKind[row["type"]] = row["cnt"];
144
+ }
145
+ const bySourceRows = db
146
+ .prepare("SELECT source, COUNT(*) as cnt FROM activity_events GROUP BY source")
147
+ .all();
148
+ const bySource = {};
149
+ for (const row of bySourceRows) {
150
+ bySource[row["source"]] = row["cnt"];
151
+ }
152
+ const rangeRow = db
153
+ .prepare("SELECT MIN(ts) as oldest, MAX(ts) as newest FROM activity_events")
154
+ .all();
155
+ return {
156
+ total,
157
+ byKind,
158
+ bySource,
159
+ droppedThisProcess: droppedEventCount(),
160
+ oldestTs: rangeRow[0]?.["oldest"] ?? undefined,
161
+ newestTs: rangeRow[0]?.["newest"] ?? undefined,
162
+ };
163
+ }
164
+ catch {
165
+ return null;
166
+ }
167
+ }
168
+
169
+ export { getActivityEventStats, queryActivityEvents, searchActivityEvents };
170
+ //# sourceMappingURL=query-activity-events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query-activity-events.js","sources":["../src/query-activity-events.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AAAA;;;;;;AAMG;AA+BH,SAAS,UAAU,CAAC,GAA4B,EAAA;IAC9C,OAAO;AACL,QAAA,EAAE,EAAE,GAAG,CAAC,IAAI,CAAW;AACvB,QAAA,OAAO,EAAE,GAAG,CAAC,UAAU,CAAW;AAClC,QAAA,EAAE,EAAE,GAAG,CAAC,IAAI,CAAW;AACvB,QAAA,SAAS,EAAG,GAAG,CAAC,YAAY,CAAmB,IAAI,IAAI;AACvD,QAAA,SAAS,EAAG,GAAG,CAAC,YAAY,CAAmB,IAAI,IAAI;AACvD,QAAA,MAAM,EAAE,GAAG,CAAC,QAAQ,CAAW;AAC/B,QAAA,IAAI,EAAE,GAAG,CAAC,MAAM,CAAW;AAC3B,QAAA,KAAK,EAAE,GAAG,CAAC,WAAW,CAAW;AACjC,QAAA,OAAO,EAAE,GAAG,CAAC,SAAS,CAAW;AACjC,QAAA,IAAI,EAAG,GAAG,CAAC,MAAM,CAAmB,IAAI,IAAI;AAC5C,QAAA,IAAI,EAAE,OAAO,GAAG,CAAC,MAAM,CAAC,KAAK,QAAQ,GAAI,GAAG,CAAC,MAAM,CAAY,GAAG,SAAS;KAC5E;AACH;AAEA,SAAS,UAAU,CAAC,GAAW,EAAA;IAC7B,OAAO,GAAG,CAAC,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC;AACvC;AAEA;;AAEG;AACG,SAAU,mBAAmB,CAAC,MAAA,GAA8B,EAAE,EAAA;AAClE,IAAA,MAAM,EAAE,GAAG,KAAK,EAAE;AAClB,IAAA,IAAI,CAAC,EAAE;AAAE,QAAA,OAAO,EAAE;IAElB,MAAM,UAAU,GAAa,EAAE;IAC/B,MAAM,MAAM,GAAc,EAAE;AA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,MAAM,KAAK,GAAI,QAAQ,CAAC,CAAC,CAAC,GAAG,KAAK,CAAY,IAAI,CAAC;QAEnD,MAAM,UAAU,GAAG;aAChB,OAAO,CAAC,iEAAiE;AACzE,aAAA,GAAG,EAA+B;QACrC,MAAM,MAAM,GAA2B,EAAE;AACzC,QAAA,KAAK,MAAM,GAAG,IAAI,UAAU,EAAE;YAC5B,MAAM,CAAC,GAAG,CAAC,MAAM,CAAW,CAAC,GAAG,GAAG,CAAC,KAAK,CAAW;QACtD;QAEA,MAAM,YAAY,GAAG;aAClB,OAAO,CAAC,qEAAqE;AAC7E,aAAA,GAAG,EAA+B;QACrC,MAAM,QAAQ,GAA2B,EAAE;AAC3C,QAAA,KAAK,MAAM,GAAG,IAAI,YAAY,EAAE;YAC9B,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAW,CAAC,GAAG,GAAG,CAAC,KAAK,CAAW;QAC1D;QAEA,MAAM,QAAQ,GAAG;aACd,OAAO,CAAC,kEAAkE;AAC1E,aAAA,GAAG,EAA+B;QAErC,OAAO;YACL,KAAK;YACL,MAAM;YACN,QAAQ;YACR,kBAAkB,EAAE,iBAAiB,EAAE;YACvC,QAAQ,EAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAmB,IAAI,SAAS;YACjE,QAAQ,EAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAmB,IAAI,SAAS;SAClE;IACH;AAAE,IAAA,MAAM;AACN,QAAA,OAAO,IAAI;IACb;AACF;;;;"}
@@ -0,0 +1,7 @@
1
+ import type { OrchestratorConfig, PluginRegistry } from "../types.js";
2
+ import type { RecoveryAssessment, RecoveryResult, RecoveryContext } from "./types.js";
3
+ export declare function recoverSession(assessment: RecoveryAssessment, config: OrchestratorConfig, registry: PluginRegistry, context: RecoveryContext): Promise<RecoveryResult>;
4
+ export declare function cleanupSession(assessment: RecoveryAssessment, config: OrchestratorConfig, registry: PluginRegistry, context: RecoveryContext): Promise<RecoveryResult>;
5
+ export declare function escalateSession(assessment: RecoveryAssessment, config: OrchestratorConfig, _registry: PluginRegistry, context: RecoveryContext): Promise<RecoveryResult>;
6
+ export declare function executeAction(assessment: RecoveryAssessment, config: OrchestratorConfig, registry: PluginRegistry, context: RecoveryContext): Promise<RecoveryResult>;
7
+ //# sourceMappingURL=actions.d.ts.map