pilotlynx 0.1.2 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. package/README.md +40 -40
  2. package/dist/agents/improve.agent.d.ts +42 -1
  3. package/dist/agents/improve.agent.js +102 -7
  4. package/dist/agents/improve.agent.js.map +1 -1
  5. package/dist/agents/run.agent.d.ts +0 -1
  6. package/dist/agents/run.agent.js +10 -7
  7. package/dist/agents/run.agent.js.map +1 -1
  8. package/dist/cli.js +8 -3
  9. package/dist/cli.js.map +1 -1
  10. package/dist/commands/audit.d.ts +2 -0
  11. package/dist/commands/audit.js +51 -0
  12. package/dist/commands/audit.js.map +1 -0
  13. package/dist/commands/eval.d.ts +2 -0
  14. package/dist/commands/eval.js +47 -0
  15. package/dist/commands/eval.js.map +1 -0
  16. package/dist/commands/improve.js +83 -5
  17. package/dist/commands/improve.js.map +1 -1
  18. package/dist/commands/init.js +17 -27
  19. package/dist/commands/init.js.map +1 -1
  20. package/dist/commands/insights.js +63 -0
  21. package/dist/commands/insights.js.map +1 -1
  22. package/dist/commands/logs.d.ts +1 -0
  23. package/dist/commands/logs.js +23 -1
  24. package/dist/commands/logs.js.map +1 -1
  25. package/dist/commands/relay.js +250 -124
  26. package/dist/commands/relay.js.map +1 -1
  27. package/dist/commands/run.js +21 -2
  28. package/dist/commands/run.js.map +1 -1
  29. package/dist/commands/schedule.js +7 -1
  30. package/dist/commands/schedule.js.map +1 -1
  31. package/dist/commands/status.js +9 -2
  32. package/dist/commands/status.js.map +1 -1
  33. package/dist/lib/agent-runner.d.ts +5 -1
  34. package/dist/lib/agent-runner.js +41 -1
  35. package/dist/lib/agent-runner.js.map +1 -1
  36. package/dist/lib/audit.d.ts +7 -0
  37. package/dist/lib/audit.js +63 -0
  38. package/dist/lib/audit.js.map +1 -0
  39. package/dist/lib/callbacks.d.ts +12 -1
  40. package/dist/lib/callbacks.js +147 -19
  41. package/dist/lib/callbacks.js.map +1 -1
  42. package/dist/lib/command-ops/doctor-ops.js +41 -6
  43. package/dist/lib/command-ops/doctor-ops.js.map +1 -1
  44. package/dist/lib/command-ops/eval-ops.d.ts +7 -0
  45. package/dist/lib/command-ops/eval-ops.js +111 -0
  46. package/dist/lib/command-ops/eval-ops.js.map +1 -0
  47. package/dist/lib/command-ops/improve-ops.d.ts +14 -1
  48. package/dist/lib/command-ops/improve-ops.js +369 -17
  49. package/dist/lib/command-ops/improve-ops.js.map +1 -1
  50. package/dist/lib/command-ops/run-ops.d.ts +8 -1
  51. package/dist/lib/command-ops/run-ops.js +25 -4
  52. package/dist/lib/command-ops/run-ops.js.map +1 -1
  53. package/dist/lib/command-ops/secrets-migration-ops.js +1 -1
  54. package/dist/lib/command-ops/secrets-migration-ops.js.map +1 -1
  55. package/dist/lib/command-ops/status-ops.d.ts +1 -0
  56. package/dist/lib/command-ops/status-ops.js +19 -7
  57. package/dist/lib/command-ops/status-ops.js.map +1 -1
  58. package/dist/lib/config.js +3 -3
  59. package/dist/lib/config.js.map +1 -1
  60. package/dist/lib/cron.d.ts +1 -1
  61. package/dist/lib/cron.js +2 -2
  62. package/dist/lib/cron.js.map +1 -1
  63. package/dist/lib/global-config.js +1 -1
  64. package/dist/lib/global-config.js.map +1 -1
  65. package/dist/lib/observation.d.ts +60 -2
  66. package/dist/lib/observation.js +261 -13
  67. package/dist/lib/observation.js.map +1 -1
  68. package/dist/lib/registry.d.ts +0 -1
  69. package/dist/lib/registry.js +1 -1
  70. package/dist/lib/registry.js.map +1 -1
  71. package/dist/lib/relay/admin.d.ts +29 -0
  72. package/dist/lib/relay/admin.js +176 -0
  73. package/dist/lib/relay/admin.js.map +1 -0
  74. package/dist/lib/relay/bindings.d.ts +8 -0
  75. package/dist/lib/relay/bindings.js +50 -0
  76. package/dist/lib/relay/bindings.js.map +1 -0
  77. package/dist/lib/relay/config.d.ts +3 -3
  78. package/dist/lib/relay/config.js +18 -10
  79. package/dist/lib/relay/config.js.map +1 -1
  80. package/dist/lib/relay/context.d.ts +31 -0
  81. package/dist/lib/relay/context.js +118 -0
  82. package/dist/lib/relay/context.js.map +1 -0
  83. package/dist/lib/relay/db.d.ts +38 -0
  84. package/dist/lib/relay/db.js +252 -0
  85. package/dist/lib/relay/db.js.map +1 -0
  86. package/dist/lib/relay/executor.d.ts +2 -0
  87. package/dist/lib/relay/executor.js +108 -0
  88. package/dist/lib/relay/executor.js.map +1 -0
  89. package/dist/lib/relay/feedback.d.ts +29 -0
  90. package/dist/lib/relay/feedback.js +142 -0
  91. package/dist/lib/relay/feedback.js.map +1 -0
  92. package/dist/lib/relay/notifier.d.ts +30 -0
  93. package/dist/lib/relay/notifier.js +78 -0
  94. package/dist/lib/relay/notifier.js.map +1 -0
  95. package/dist/lib/relay/notify.d.ts +3 -4
  96. package/dist/lib/relay/notify.js +43 -159
  97. package/dist/lib/relay/notify.js.map +1 -1
  98. package/dist/lib/relay/platform.d.ts +52 -0
  99. package/dist/lib/relay/platform.js +5 -0
  100. package/dist/lib/relay/platform.js.map +1 -0
  101. package/dist/lib/relay/platforms/slack.d.ts +37 -0
  102. package/dist/lib/relay/platforms/slack.js +240 -0
  103. package/dist/lib/relay/platforms/slack.js.map +1 -0
  104. package/dist/lib/relay/platforms/telegram.d.ts +29 -0
  105. package/dist/lib/relay/platforms/telegram.js +193 -0
  106. package/dist/lib/relay/platforms/telegram.js.map +1 -0
  107. package/dist/lib/relay/poster.d.ts +24 -0
  108. package/dist/lib/relay/poster.js +136 -0
  109. package/dist/lib/relay/poster.js.map +1 -0
  110. package/dist/lib/relay/queue.d.ts +18 -0
  111. package/dist/lib/relay/queue.js +85 -0
  112. package/dist/lib/relay/queue.js.map +1 -0
  113. package/dist/lib/relay/router.d.ts +25 -2
  114. package/dist/lib/relay/router.js +259 -168
  115. package/dist/lib/relay/router.js.map +1 -1
  116. package/dist/lib/relay/service.d.ts +31 -7
  117. package/dist/lib/relay/service.js +281 -200
  118. package/dist/lib/relay/service.js.map +1 -1
  119. package/dist/lib/relay/types.d.ts +189 -34
  120. package/dist/lib/relay/types.js +68 -28
  121. package/dist/lib/relay/types.js.map +1 -1
  122. package/dist/lib/sandbox.d.ts +9 -1
  123. package/dist/lib/sandbox.js +17 -2
  124. package/dist/lib/sandbox.js.map +1 -1
  125. package/dist/lib/schedule.d.ts +4 -5
  126. package/dist/lib/schedule.js +7 -8
  127. package/dist/lib/schedule.js.map +1 -1
  128. package/dist/lib/secrets.js +11 -1
  129. package/dist/lib/secrets.js.map +1 -1
  130. package/dist/lib/types.d.ts +80 -0
  131. package/dist/lib/types.js +9 -1
  132. package/dist/lib/types.js.map +1 -1
  133. package/package.json +18 -18
  134. package/prompts/improve.yaml +114 -6
  135. package/prompts/relay.yaml +29 -0
  136. package/prompts/run.yaml +36 -2
  137. package/template/CLAUDE.md +34 -5
  138. package/template/RUNBOOK.md +5 -5
  139. package/template/evals/sample.json +16 -0
  140. package/template/memory/MEMORY.md +6 -0
  141. package/template/memory/procedures/.gitkeep +0 -0
  142. package/template/schedule.yaml +1 -1
  143. package/template/workflows/daily_feedback.ts +78 -2
  144. package/template/workflows/project_review.ts +51 -2
  145. package/prompts/relay-chat.yaml +0 -24
@@ -12,8 +12,57 @@ interface WorkflowResult {
12
12
  }
13
13
 
14
14
  /**
15
- * Produces a short project-scoped status update.
16
- * Reads PROJECT_BRIEF.md, RUNBOOK.md, and memory/ to summarize current state.
15
+ * Project Review Workflow Health Report Generator
16
+ *
17
+ * Produces a structured project health report by examining the project's current state.
18
+ * Writes the report to `artifacts/review-YYYY-MM-DD.md`.
19
+ *
20
+ * ## What to Examine
21
+ *
22
+ * ### 1. Project Configuration Health
23
+ * - Read `PROJECT_BRIEF.md` — is it filled in or still template defaults?
24
+ * - Read `CLAUDE.md` — are there project-specific rules beyond the template?
25
+ * - Read `RUNBOOK.md` — are operational procedures documented?
26
+ * - Check `.mcp.json` — are MCP servers configured?
27
+ *
28
+ * ### 2. Skill Inventory
29
+ * - Glob `.claude/skills/*.md` — list all skills
30
+ * - For each skill: name, brief description, estimated relevance
31
+ * - Flag skills that may be outdated or overlapping
32
+ *
33
+ * ### 3. Rule Inventory
34
+ * - Glob `.claude/rules/*.md` — list all rules
35
+ * - Check for conflicting rules
36
+ * - Flag overly vague rules that aren't actionable
37
+ *
38
+ * ### 4. Memory Health
39
+ * - Read `memory/MEMORY.md` — count entries per section
40
+ * - Flag if memory is empty (no learnings captured)
41
+ * - Flag if memory has no recent entries (stale project)
42
+ *
43
+ * ### 5. Workflow Status
44
+ * - Glob `workflows/*.ts` — list available workflows
45
+ * - Read recent logs from `logs/` (last 5 entries)
46
+ * - Calculate: success rate, average cost, failure patterns
47
+ *
48
+ * ### 6. Shared Pattern Adoption
49
+ * - If `shared/docs/patterns/` is accessible, check which patterns apply to this project
50
+ * - Report which applicable patterns are adopted vs. not adopted
51
+ *
52
+ * ### 7. Anti-Pattern Compliance
53
+ * - If `shared/docs/anti-patterns/` is accessible, check for violations
54
+ * - Report any code or configuration matching known anti-patterns
55
+ *
56
+ * ### 8. Cost Trends
57
+ * - Analyze log entries for cost data (costUsd field)
58
+ * - Calculate: total spend, average per workflow, trend direction
59
+ * - Flag anomalies (sudden cost spikes or drops)
60
+ *
61
+ * ## Output Format
62
+ * Write the report to `artifacts/review-YYYY-MM-DD.md` with sections matching the above.
63
+ * Include a summary section at the top with overall health score (healthy/needs-attention/critical).
64
+ *
65
+ * Also produce a brief summary in the workflow result for the orchestrator.
17
66
  */
18
67
  export async function run(config: WorkflowConfig): Promise<WorkflowResult> {
19
68
  return {
@@ -1,24 +0,0 @@
1
- prompts:
2
- chat_default: |
3
- You are the relay chat agent for the "{{project}}" project.
4
-
5
- The user sent this message via Telegram:
6
- {{userMessage}}
7
-
8
- Recent conversation history:
9
- {{conversationContext}}
10
-
11
- You have read-only access to the project files. Answer the user's question
12
- about the project — its code, configuration, workflows, memory, or logs.
13
-
14
- If you cannot answer from the available files, say so clearly.
15
- Keep replies concise (under 1000 characters when possible) since they go to a chat interface.
16
-
17
- Return your response as JSON: {"reply": "your message here"}
18
-
19
- systemPrompts:
20
- chat_default: |
21
- You are a project assistant with read-only access to a software project.
22
- You can read files, search for patterns, and browse the project structure.
23
- You cannot modify any files. Keep responses concise for chat delivery.
24
- Never reveal secrets, API keys, or .env file contents.