@rudderhq/server 0.2.0-canary.8 → 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 (199) hide show
  1. package/dist/bootstrap/register-api-routes.d.ts.map +1 -1
  2. package/dist/bootstrap/register-api-routes.js +2 -0
  3. package/dist/bootstrap/register-api-routes.js.map +1 -1
  4. package/dist/bundled-plugins/plugin-linear/dist/ui/index.js +8 -1
  5. package/dist/bundled-plugins/plugin-linear/dist/ui/index.js.map +2 -2
  6. package/dist/bundled-plugins/plugin-linear/dist/worker.js +124 -117
  7. package/dist/bundled-plugins/plugin-linear/dist/worker.js.map +3 -3
  8. package/dist/home-paths.d.ts +2 -0
  9. package/dist/home-paths.d.ts.map +1 -1
  10. package/dist/home-paths.js +6 -1
  11. package/dist/home-paths.js.map +1 -1
  12. package/dist/index.d.ts +11 -0
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/index.js +55 -2
  15. package/dist/index.js.map +1 -1
  16. package/dist/langfuse-transcript.d.ts.map +1 -1
  17. package/dist/langfuse-transcript.js +16 -2
  18. package/dist/langfuse-transcript.js.map +1 -1
  19. package/dist/middleware/auth.d.ts.map +1 -1
  20. package/dist/middleware/auth.js +54 -1
  21. package/dist/middleware/auth.js.map +1 -1
  22. package/dist/onboarding-assets/ceo/HEARTBEAT.md +8 -4
  23. package/dist/onboarding-assets/default/HEARTBEAT.md +7 -4
  24. package/dist/routes/agents.d.ts.map +1 -1
  25. package/dist/routes/agents.js +62 -3
  26. package/dist/routes/agents.js.map +1 -1
  27. package/dist/routes/approvals.d.ts.map +1 -1
  28. package/dist/routes/approvals.js +30 -1
  29. package/dist/routes/approvals.js.map +1 -1
  30. package/dist/routes/chats.d.ts.map +1 -1
  31. package/dist/routes/chats.js +343 -53
  32. package/dist/routes/chats.js.map +1 -1
  33. package/dist/routes/costs.d.ts.map +1 -1
  34. package/dist/routes/costs.js +20 -0
  35. package/dist/routes/costs.js.map +1 -1
  36. package/dist/routes/issues.d.ts.map +1 -1
  37. package/dist/routes/issues.js +229 -19
  38. package/dist/routes/issues.js.map +1 -1
  39. package/dist/routes/onboarding.d.ts +3 -0
  40. package/dist/routes/onboarding.d.ts.map +1 -0
  41. package/dist/routes/onboarding.js +545 -0
  42. package/dist/routes/onboarding.js.map +1 -0
  43. package/dist/routes/orgs.d.ts.map +1 -1
  44. package/dist/routes/orgs.js +22 -0
  45. package/dist/routes/orgs.js.map +1 -1
  46. package/dist/services/activity.d.ts.map +1 -1
  47. package/dist/services/activity.js +32 -1
  48. package/dist/services/activity.js.map +1 -1
  49. package/dist/services/agent-run-context.d.ts +1 -32
  50. package/dist/services/agent-run-context.d.ts.map +1 -1
  51. package/dist/services/agent-run-context.js +26 -128
  52. package/dist/services/agent-run-context.js.map +1 -1
  53. package/dist/services/agents.d.ts +26 -26
  54. package/dist/services/agents.d.ts.map +1 -1
  55. package/dist/services/agents.js +1 -42
  56. package/dist/services/agents.js.map +1 -1
  57. package/dist/services/assets.d.ts +2 -2
  58. package/dist/services/automations.d.ts +2 -2
  59. package/dist/services/calendar.d.ts +4 -4
  60. package/dist/services/chat-assistant.d.ts +12 -3
  61. package/dist/services/chat-assistant.d.ts.map +1 -1
  62. package/dist/services/chat-assistant.js +126 -99
  63. package/dist/services/chat-assistant.js.map +1 -1
  64. package/dist/services/chats.d.ts +88 -15
  65. package/dist/services/chats.d.ts.map +1 -1
  66. package/dist/services/chats.js +217 -14
  67. package/dist/services/chats.js.map +1 -1
  68. package/dist/services/costs.d.ts +21 -0
  69. package/dist/services/costs.d.ts.map +1 -1
  70. package/dist/services/costs.js +76 -2
  71. package/dist/services/costs.js.map +1 -1
  72. package/dist/services/finance.d.ts +2 -2
  73. package/dist/services/goals.d.ts +12 -12
  74. package/dist/services/instance-settings.d.ts.map +1 -1
  75. package/dist/services/instance-settings.js +25 -16
  76. package/dist/services/instance-settings.js.map +1 -1
  77. package/dist/services/issue-review-wakeup.d.ts +49 -1
  78. package/dist/services/issue-review-wakeup.d.ts.map +1 -1
  79. package/dist/services/issue-review-wakeup.js +39 -2
  80. package/dist/services/issue-review-wakeup.js.map +1 -1
  81. package/dist/services/issues.d.ts +2 -1
  82. package/dist/services/issues.d.ts.map +1 -1
  83. package/dist/services/issues.js +126 -5
  84. package/dist/services/issues.js.map +1 -1
  85. package/dist/services/knowledge-portability/organization-skills.d.ts +1 -0
  86. package/dist/services/knowledge-portability/organization-skills.d.ts.map +1 -1
  87. package/dist/services/knowledge-portability/organization-skills.js +3 -2
  88. package/dist/services/knowledge-portability/organization-skills.js.map +1 -1
  89. package/dist/services/messenger.d.ts +5 -0
  90. package/dist/services/messenger.d.ts.map +1 -1
  91. package/dist/services/messenger.js +165 -11
  92. package/dist/services/messenger.js.map +1 -1
  93. package/dist/services/organization-workspace-browser.d.ts.map +1 -1
  94. package/dist/services/organization-workspace-browser.js +64 -9
  95. package/dist/services/organization-workspace-browser.js.map +1 -1
  96. package/dist/services/orgs.d.ts +1 -13
  97. package/dist/services/orgs.d.ts.map +1 -1
  98. package/dist/services/orgs.js +0 -2
  99. package/dist/services/orgs.js.map +1 -1
  100. package/dist/services/plugin-registry.d.ts +4 -4
  101. package/dist/services/projects.d.ts +1 -1
  102. package/dist/services/runtime-kernel/heartbeat.d.ts.map +1 -1
  103. package/dist/services/runtime-kernel/heartbeat.js +567 -29
  104. package/dist/services/runtime-kernel/heartbeat.js.map +1 -1
  105. package/dist/services/secrets.d.ts +5 -5
  106. package/dist/services/workspace-backups.d.ts.map +1 -1
  107. package/dist/services/workspace-backups.js +6 -0
  108. package/dist/services/workspace-backups.js.map +1 -1
  109. package/dist/services/workspace-runtime.d.ts.map +1 -1
  110. package/dist/services/workspace-runtime.js +2 -0
  111. package/dist/services/workspace-runtime.js.map +1 -1
  112. package/package.json +13 -13
  113. package/resources/bundled-skills/rudder/SKILL.md +72 -7
  114. package/resources/bundled-skills/rudder/references/cli-reference.md +34 -9
  115. package/resources/bundled-skills/rudder/references/organization-skills.md +12 -7
  116. package/resources/bundled-skills/rudder-create-agent/references/cli-reference.md +1 -0
  117. package/skills/rudder/SKILL.md +72 -7
  118. package/skills/rudder/references/cli-reference.md +34 -9
  119. package/skills/rudder/references/organization-skills.md +12 -7
  120. package/skills/rudder-create-agent/references/cli-reference.md +1 -0
  121. package/ui-dist/assets/{_basePickBy-DfISC403.js → _basePickBy-3Hg7N37c.js} +1 -1
  122. package/ui-dist/assets/{_baseUniq-s98gUpgR.js → _baseUniq-Bvy8WJh0.js} +1 -1
  123. package/ui-dist/assets/{arc-CR17323Q.js → arc-DrmvGX4U.js} +1 -1
  124. package/ui-dist/assets/{architectureDiagram-2XIMDMQ5-BzXAflU_.js → architectureDiagram-2XIMDMQ5-vbevcV-8.js} +1 -1
  125. package/ui-dist/assets/{blockDiagram-WCTKOSBZ-8TtjJ3eI.js → blockDiagram-WCTKOSBZ-DvupMRN9.js} +1 -1
  126. package/ui-dist/assets/{c4Diagram-IC4MRINW-CpDAvPEk.js → c4Diagram-IC4MRINW-CbsNVA8e.js} +1 -1
  127. package/ui-dist/assets/channel-DhW0A-FV.js +1 -0
  128. package/ui-dist/assets/{chunk-4BX2VUAB-DH5y5IcG.js → chunk-4BX2VUAB-BL4OUqNV.js} +1 -1
  129. package/ui-dist/assets/{chunk-55IACEB6-HUQ0oHmD.js → chunk-55IACEB6-DFwq2ebc.js} +1 -1
  130. package/ui-dist/assets/{chunk-FMBD7UC4-B_Tmn_aT.js → chunk-FMBD7UC4-Cyl6kF9G.js} +1 -1
  131. package/ui-dist/assets/{chunk-JSJVCQXG-COsiBBS-.js → chunk-JSJVCQXG-v4mfLtsY.js} +1 -1
  132. package/ui-dist/assets/{chunk-KX2RTZJC-Cvg_71ig.js → chunk-KX2RTZJC-Bfg48g5k.js} +1 -1
  133. package/ui-dist/assets/{chunk-NQ4KR5QH-BEW2kuUb.js → chunk-NQ4KR5QH-BcSdbequ.js} +1 -1
  134. package/ui-dist/assets/{chunk-QZHKN3VN-Bna2V6NY.js → chunk-QZHKN3VN-BT8QI712.js} +1 -1
  135. package/ui-dist/assets/{chunk-WL4C6EOR-DZ8gtX-v.js → chunk-WL4C6EOR-CqH2or9g.js} +1 -1
  136. package/ui-dist/assets/classDiagram-VBA2DB6C-Bw6kzUsz.js +1 -0
  137. package/ui-dist/assets/classDiagram-v2-RAHNMMFH-Bw6kzUsz.js +1 -0
  138. package/ui-dist/assets/clone-Luak8Fsn.js +1 -0
  139. package/ui-dist/assets/{cose-bilkent-S5V4N54A-kr92BRef.js → cose-bilkent-S5V4N54A-CLH06Lnz.js} +1 -1
  140. package/ui-dist/assets/{dagre-KLK3FWXG-D_g61aoF.js → dagre-KLK3FWXG-DxNQPDBj.js} +1 -1
  141. package/ui-dist/assets/{diagram-E7M64L7V-1LfSj6n8.js → diagram-E7M64L7V-BOcSeWh0.js} +1 -1
  142. package/ui-dist/assets/{diagram-IFDJBPK2-DK364c5M.js → diagram-IFDJBPK2-DXyaFKVr.js} +1 -1
  143. package/ui-dist/assets/{diagram-P4PSJMXO-CIq22L7l.js → diagram-P4PSJMXO-DhY_ls3C.js} +1 -1
  144. package/ui-dist/assets/{erDiagram-INFDFZHY-C2QX1WzN.js → erDiagram-INFDFZHY-QtL5Yt_b.js} +1 -1
  145. package/ui-dist/assets/{flowDiagram-PKNHOUZH-BXk0KTTB.js → flowDiagram-PKNHOUZH-BYqyaowc.js} +1 -1
  146. package/ui-dist/assets/{ganttDiagram-A5KZAMGK-D75CuaPG.js → ganttDiagram-A5KZAMGK-D4xd7J_z.js} +1 -1
  147. package/ui-dist/assets/{gitGraphDiagram-K3NZZRJ6-C_SvdzO5.js → gitGraphDiagram-K3NZZRJ6-Co9xqKNH.js} +1 -1
  148. package/ui-dist/assets/{graph-DTC5egc-.js → graph-DEC7S98H.js} +1 -1
  149. package/ui-dist/assets/{index-CEKv8ksn.js → index-4_gJOU3u.js} +1 -1
  150. package/ui-dist/assets/{index-CSzr8t_E.js → index-B8QjK4Xd.js} +1 -1
  151. package/ui-dist/assets/index-BLDnKx7N.js +1478 -0
  152. package/ui-dist/assets/{index-CqKwXFnI.js → index-BX6QyxsL.js} +1 -1
  153. package/ui-dist/assets/{index-DmSssfNa.js → index-BZGiyL9p.js} +1 -1
  154. package/ui-dist/assets/{index-BLvouPW7.js → index-BelfAyHh.js} +1 -1
  155. package/ui-dist/assets/index-BisI78wU.css +1 -0
  156. package/ui-dist/assets/{index-BUyOio4T.js → index-Bm86s0IY.js} +1 -1
  157. package/ui-dist/assets/{index-DLL28Pwh.js → index-Bz0jEwWG.js} +1 -1
  158. package/ui-dist/assets/{index--j9y8Fm1.js → index-CFANc8oH.js} +1 -1
  159. package/ui-dist/assets/{index-CjmpD1gl.js → index-CIAMqUzr.js} +1 -1
  160. package/ui-dist/assets/{index-lXemkB72.js → index-ClrueuiI.js} +1 -1
  161. package/ui-dist/assets/{index-D9UMKH7j.js → index-CpxwEuIg.js} +1 -1
  162. package/ui-dist/assets/{index-BI5DxFdZ.js → index-D1ZkASZY.js} +1 -1
  163. package/ui-dist/assets/{index-BkXN5tcA.js → index-DUP0i_Iv.js} +1 -1
  164. package/ui-dist/assets/{index-Be2KDBoW.js → index-DawkXomB.js} +1 -1
  165. package/ui-dist/assets/{index-CO0DiQaO.js → index-DxchV0Z7.js} +1 -1
  166. package/ui-dist/assets/{index-Bk9vEAxA.js → index-Dzd88G_H.js} +1 -1
  167. package/ui-dist/assets/{index-CyIEQyck.js → index-SklGX83C.js} +1 -1
  168. package/ui-dist/assets/{index-DL9Ygef7.js → index-_xX3B4n0.js} +1 -1
  169. package/ui-dist/assets/{index-8HHVhW-a.js → index-bVqVfFu5.js} +1 -1
  170. package/ui-dist/assets/{index-Dl-MnVEo.js → index-eIjkqSkc.js} +1 -1
  171. package/ui-dist/assets/{index-CNkqdDmO.js → index-mIrYeZR2.js} +1 -1
  172. package/ui-dist/assets/{index-CXBstvbt.js → index-xg2FQeSA.js} +1 -1
  173. package/ui-dist/assets/{infoDiagram-LFFYTUFH-DN2iczkC.js → infoDiagram-LFFYTUFH-BQ0qsBJ6.js} +1 -1
  174. package/ui-dist/assets/{ishikawaDiagram-PHBUUO56--Ku5ltXY.js → ishikawaDiagram-PHBUUO56-B1u2RAnY.js} +1 -1
  175. package/ui-dist/assets/{journeyDiagram-4ABVD52K-9wOJKEaq.js → journeyDiagram-4ABVD52K-Dv5wJGwT.js} +1 -1
  176. package/ui-dist/assets/{kanban-definition-K7BYSVSG-joaPa9x3.js → kanban-definition-K7BYSVSG-CJOykCsT.js} +1 -1
  177. package/ui-dist/assets/{layout-bH9QuYBa.js → layout-BDcM6t-f.js} +1 -1
  178. package/ui-dist/assets/{linear-CnfJ09Re.js → linear-B9Sm5Y96.js} +1 -1
  179. package/ui-dist/assets/{mermaid.core-CYkJAFnD.js → mermaid.core-lZPaf_Ix.js} +4 -4
  180. package/ui-dist/assets/{mindmap-definition-YRQLILUH-BQyC_8UY.js → mindmap-definition-YRQLILUH-Cu4HfP8K.js} +1 -1
  181. package/ui-dist/assets/{pieDiagram-SKSYHLDU-ev5uLtwW.js → pieDiagram-SKSYHLDU-B_v-Vluc.js} +1 -1
  182. package/ui-dist/assets/{quadrantDiagram-337W2JSQ-CQoe3akb.js → quadrantDiagram-337W2JSQ-BU1ZwGcS.js} +1 -1
  183. package/ui-dist/assets/{requirementDiagram-Z7DCOOCP-C9fd5-6o.js → requirementDiagram-Z7DCOOCP-DBOqB50G.js} +1 -1
  184. package/ui-dist/assets/{sankeyDiagram-WA2Y5GQK-Dznsr9L_.js → sankeyDiagram-WA2Y5GQK-CsXDIOlq.js} +1 -1
  185. package/ui-dist/assets/{sequenceDiagram-2WXFIKYE-jL7GufkU.js → sequenceDiagram-2WXFIKYE-Cmgr7vKy.js} +1 -1
  186. package/ui-dist/assets/{stateDiagram-RAJIS63D-C_4YyDYV.js → stateDiagram-RAJIS63D-Bd0uRbWd.js} +1 -1
  187. package/ui-dist/assets/stateDiagram-v2-FVOUBMTO-qGaY7iN1.js +1 -0
  188. package/ui-dist/assets/{timeline-definition-YZTLITO2-D8jKeAEo.js → timeline-definition-YZTLITO2-B9OfCgYQ.js} +1 -1
  189. package/ui-dist/assets/{treemap-KZPCXAKY-CV4vBepp.js → treemap-KZPCXAKY-FWWMNo03.js} +1 -1
  190. package/ui-dist/assets/{vennDiagram-LZ73GAT5-DAk_ThVs.js → vennDiagram-LZ73GAT5-CGs3T7cn.js} +1 -1
  191. package/ui-dist/assets/{xychartDiagram-JWTSCODW-D8wg1dlm.js → xychartDiagram-JWTSCODW-BJ6DrP1k.js} +1 -1
  192. package/ui-dist/index.html +2 -2
  193. package/ui-dist/assets/channel-BDMh8XFu.js +0 -1
  194. package/ui-dist/assets/classDiagram-VBA2DB6C-B6kvnvP_.js +0 -1
  195. package/ui-dist/assets/classDiagram-v2-RAHNMMFH-B6kvnvP_.js +0 -1
  196. package/ui-dist/assets/clone-B5CU-MlO.js +0 -1
  197. package/ui-dist/assets/index-CLXVCM5X.js +0 -1434
  198. package/ui-dist/assets/index-DoUUx1qN.css +0 -1
  199. package/ui-dist/assets/stateDiagram-v2-FVOUBMTO-BAU1MhTJ.js +0 -1
@@ -0,0 +1,545 @@
1
+ import { Router } from "express";
2
+ import { agentService, issueService, logActivity, organizationService, projectService } from "../services/index.js";
3
+ import { assertBoard, assertCompanyAccess, getActorInfo } from "./authz.js";
4
+ const ONBOARDING_PROJECT_NAME = "Getting Started";
5
+ const ONBOARDING_PROJECT_DESCRIPTION = `Learn how Rudder works by completing one guided collaboration loop.
6
+
7
+ This project is not a generic product tour. It teaches the core Rudder workflow:
8
+
9
+ chat → issue → agent execution → activity → review → context → real work.
10
+
11
+ Complete the core issues to experience the basic loop. Then use the next issues to bring real work and reusable context into Rudder.`;
12
+ const WELCOME_DESCRIPTION = `Welcome to Rudder.
13
+
14
+ Rudder is where you collaborate with agents the way you would work with a human team.
15
+
16
+ You are not just prompting a bot here. You are setting up a working relationship.
17
+
18
+ In Rudder:
19
+
20
+ - Chat is for quick questions, clarification, and routing.
21
+ - Issues are where durable work happens.
22
+ - Projects group related work.
23
+ - Agents have roles, responsibilities, and execution boundaries.
24
+ - Agents can build durable memory through shared context and instructions.
25
+ - Activity makes agent work visible.
26
+ - Reviews and comments keep feedback attached to the work.
27
+ - Reusable workflows help agents improve how they work with you over time.
28
+ - Goals explain why the work exists, but you do not need to define every goal on day one.
29
+
30
+ Start with the Getting Started project in the sidebar.
31
+
32
+ It will guide you through your first collaboration loop:
33
+
34
+ 1. Understand how Rudder work happens.
35
+ 2. Ask your agent one quick question.
36
+ 3. Create and run your first agent issue.
37
+ 4. Review the result and close the loop.
38
+ 5. Create a project and add shared resources.
39
+ 6. Add shared context.
40
+ 7. Bring one real task into Rudder.
41
+
42
+ No action is required on this welcome issue. Keep it as a quick reference while you learn how Rudder works.`;
43
+ const ONBOARDING_ISSUES = [
44
+ {
45
+ title: "👋 Welcome to Rudder — work with agents like a team",
46
+ status: "done",
47
+ priority: "high",
48
+ group: "welcome",
49
+ description: WELCOME_DESCRIPTION,
50
+ },
51
+ {
52
+ title: "1. Understand how Rudder work happens",
53
+ status: "todo",
54
+ priority: "high",
55
+ group: "core",
56
+ nextTitle: "2. Ask your agent one quick question",
57
+ description: `Rudder works best when each kind of work happens in the right place.
58
+
59
+ The main surfaces are Chat, Issues, Projects, and Activity.
60
+
61
+ Chat is for quick questions, clarification, and routing. Use it when you are still figuring out what you want, or when the request is too small to become durable work.
62
+
63
+ Issues are for work that should be tracked. Use an issue when something needs an owner, status, context, execution, review, or a durable result.
64
+
65
+ Projects group related issues. Use a project when several pieces of work belong together and you want to see their progress in one place.
66
+
67
+ Activity shows what happened. Use it to understand progress, failures, status changes, comments, and agent actions.
68
+
69
+ Try it now:
70
+
71
+ 1. Open Chat from the sidebar.
72
+ 2. Open Issues from the sidebar.
73
+ 3. Open this Getting Started project.
74
+ 4. Open the Activity section on this issue or another issue.
75
+ 5. Mark this issue as Done when you understand where each kind of work belongs.
76
+
77
+ You’ll know it worked when:
78
+
79
+ - You know when to use chat.
80
+ - You know why durable work should live on an issue.
81
+ - You know where project-level work is grouped.
82
+ - You know where to look when you want to understand what changed.
83
+
84
+ Next step: ask your agent one quick question.`,
85
+ },
86
+ {
87
+ title: "2. Ask your agent one quick question",
88
+ status: "todo",
89
+ priority: "high",
90
+ group: "core",
91
+ nextTitle: "3. Create and run your first agent issue",
92
+ chatPrompt: "What can you help me with in this workspace, and what is a good first issue for us to try in Rudder?",
93
+ description: `Start by talking to your agent before giving it durable work.
94
+
95
+ In human teams, you often ask a teammate a quick question before assigning them a full task. Rudder works the same way. Chat is the lightweight place to ask, clarify, and get oriented.
96
+
97
+ Try it now:
98
+
99
+ 1. Open Chat from the sidebar.
100
+ 2. Ask your first agent one simple question.
101
+
102
+ Good examples:
103
+
104
+ - “What can you help me with in this workspace?”
105
+ - “How should I give you a task in Rudder?”
106
+ - “What is a good first issue for us to try?”
107
+ - “What information do you need from me before you can work well?”
108
+
109
+ 3. Read the agent’s reply.
110
+ 4. Come back and mark this issue as Done.
111
+
112
+ If you do not have an active agent yet, create or activate your first agent before continuing.
113
+
114
+ You’ll know it worked when:
115
+
116
+ - Your agent replies in chat.
117
+ - You understand something about the agent’s role or how to work with it.
118
+ - You have experienced the difference between a quick chat and tracked work.
119
+
120
+ Next step: create and run your first agent issue.`,
121
+ },
122
+ {
123
+ title: "3. Create and run your first agent issue",
124
+ status: "todo",
125
+ priority: "high",
126
+ group: "core",
127
+ nextTitle: "4. Review the result and close the loop",
128
+ chatPrompt: "Help me turn this into a small first Rudder issue: Summarize how Rudder works in 5 bullets and suggest one useful next step for a new user.",
129
+ description: `Chat is useful for figuring things out. Issues are where work becomes durable.
130
+
131
+ A request should usually become an issue when it needs:
132
+
133
+ - an owner
134
+ - a status
135
+ - context that should not be lost
136
+ - agent execution
137
+ - review
138
+ - a clear result
139
+ - a follow-up path
140
+
141
+ Now create your first small agent issue.
142
+
143
+ Use your own request, or use this safe example:
144
+
145
+ “Summarize how Rudder works in 5 bullets and suggest one useful next step for a new user.”
146
+
147
+ Try it now:
148
+
149
+ 1. Create a new issue.
150
+ 2. Give it a clear title.
151
+ 3. Add a short description.
152
+ 4. Include the expected result.
153
+ 5. Assign it to your first agent.
154
+ 6. Leave reviewer blank for this first run unless you already know who should review it.
155
+ 7. Move it to Todo or another runnable state.
156
+ 8. Open the issue Activity section and watch what happens.
157
+
158
+ Use a low-risk task for this first run. Avoid tasks that need secrets, production access, irreversible actions, or external spending.
159
+
160
+ If you do not have an active agent yet, create or activate your first agent before continuing.
161
+
162
+ You’ll know it worked when:
163
+
164
+ - A new issue exists.
165
+ - It is assigned to your agent.
166
+ - The agent starts working or leaves activity.
167
+ - You can see the work happening on the issue.
168
+
169
+ Next step: review the result and close the loop.`,
170
+ },
171
+ {
172
+ title: "4. Review the result and close the loop",
173
+ status: "todo",
174
+ priority: "high",
175
+ group: "core",
176
+ nextTitle: "5. Create a project and add shared resources",
177
+ description: `Agent collaboration improves when feedback stays attached to the work.
178
+
179
+ In a human team, you rarely just receive work and walk away. You review it, ask for revisions, approve it, or create a follow-up. Rudder keeps that feedback loop on the issue so the context does not disappear.
180
+
181
+ Try it now:
182
+
183
+ 1. Open the issue your agent worked on.
184
+ 2. Read the result.
185
+ 3. Check the Activity section to understand what happened.
186
+ 4. Decide what to do next.
187
+
188
+ If the result is useful:
189
+
190
+ - Leave a short comment explaining what was useful.
191
+ - Move the issue to Done.
192
+
193
+ If the result needs revision:
194
+
195
+ - Leave a comment with specific feedback.
196
+ - Ask the agent to revise.
197
+ - Keep the issue open until the next result is reviewed.
198
+
199
+ If the work needs another step:
200
+
201
+ - Create a follow-up issue.
202
+ - Link it from the current issue.
203
+
204
+ You’ll know it worked when:
205
+
206
+ - The agent’s result has been reviewed.
207
+ - Your feedback is attached to the issue.
208
+ - The next step is clear.
209
+ - The issue is either Done or has a clear follow-up.
210
+
211
+ Next step: create a project and add shared resources.`,
212
+ },
213
+ {
214
+ title: "5. Create a project and add shared resources",
215
+ status: "todo",
216
+ priority: "high",
217
+ group: "core",
218
+ nextTitle: "6. Add shared context your agent should remember",
219
+ description: `Rudder gets more useful when work has a project home and agents can see the resources that matter.
220
+
221
+ Create a small project for the kind of work you want to move into Rudder, then add one resource or workspace note that an agent should be able to reference.
222
+
223
+ Try it now:
224
+
225
+ 1. Create a project for a real area of work.
226
+ 2. Add a short project description that explains what belongs there.
227
+ 3. Add one resource, file, or note that helps an agent understand the work.
228
+ 4. Open the project and confirm the resource is easy to find.
229
+ 5. Link or mention that project from a future issue.
230
+
231
+ Keep the project small. You are not designing the whole operating system yet; you are giving future agent work a useful home.
232
+
233
+ You’ll know it worked when:
234
+
235
+ - A project exists for real work.
236
+ - At least one useful resource or note is available.
237
+ - You know where future related issues should go.
238
+
239
+ Next step: add shared context your agent should remember.`,
240
+ },
241
+ {
242
+ title: "6. Add shared context your agent should remember",
243
+ status: "backlog",
244
+ priority: "medium",
245
+ group: "recommended",
246
+ nextTitle: "7. Bring one real task into Rudder",
247
+ description: `Good teammates remember the context they need to work well.
248
+
249
+ Agents should not need you to repeat the same background every time. Rudder should accumulate shared context across work, so future issues become easier to start and easier to review.
250
+
251
+ Use this issue to write down the basic information your agent should know about this workspace.
252
+
253
+ Try it now:
254
+
255
+ 1. Think about what your agent needed during the first issue.
256
+ 2. Identify one piece of context you do not want to repeat again.
257
+ 3. Add it to shared workspace context, knowledge, or an appropriate document.
258
+ 4. Mention or link that context from one future issue.
259
+
260
+ Useful context may include:
261
+
262
+ - what this workspace is for
263
+ - what product, company, or project you are working on
264
+ - what your agent should optimize for
265
+ - your preferred output style
266
+ - links, repos, files, or docs that matter
267
+ - constraints the agent should respect
268
+ - what “done” usually means
269
+ - things the agent should not do without approval
270
+
271
+ Keep it short and real. Do not try to document the whole workspace on day one.
272
+
273
+ You’ll know it worked when:
274
+
275
+ - There is at least one reusable context note.
276
+ - The context came from something you actually needed.
277
+ - You can point an agent to this context instead of re-explaining it.
278
+
279
+ Next step: bring one real task into Rudder.`,
280
+ },
281
+ {
282
+ title: "7. Bring one real task into Rudder",
283
+ status: "backlog",
284
+ priority: "high",
285
+ group: "recommended",
286
+ nextTitle: "8. Link this work to a goal",
287
+ description: `Now bring one real task into Rudder.
288
+
289
+ Choose something real, but keep it small. The goal is not to migrate your entire workflow at once. The goal is to let Rudder take responsibility for one piece of work and leave a result you can review.
290
+
291
+ Pick a task that is useful, safe for an agent to attempt, easy for you to review, and small enough to finish or make progress on today.
292
+
293
+ Try it now:
294
+
295
+ 1. Choose one real task from your current work.
296
+ 2. Create a new issue for it.
297
+ 3. Include what you want done, why it matters, relevant context, what a good result looks like, and what the agent should avoid.
298
+ 4. Attach or mention any relevant files, links, or context.
299
+ 5. Assign the issue to your agent when it is ready.
300
+ 6. Move it to Todo to start the work.
301
+
302
+ Good first real tasks:
303
+
304
+ - “Summarize this project and identify the next 3 issues.”
305
+ - “Review this document and suggest improvements.”
306
+ - “Turn these notes into an implementation plan.”
307
+ - “Inspect this bug report and propose likely causes.”
308
+ - “Draft a checklist for repeating this workflow.”
309
+
310
+ You’ll know it worked when:
311
+
312
+ - One real task exists as a Rudder issue.
313
+ - The issue has enough context for an agent to start.
314
+ - The task is assigned or ready to assign.
315
+ - You know what result you expect to review.
316
+
317
+ Next step: continue with the Advanced Getting Started issues when you are ready.`,
318
+ },
319
+ {
320
+ title: "8. Link this work to a goal",
321
+ status: "backlog",
322
+ priority: "medium",
323
+ group: "advanced",
324
+ nextTitle: "9. Capture one reusable workflow",
325
+ description: `Rudder work should eventually answer one question: why does this task exist?
326
+
327
+ You do not need to define a perfect company goal on day one. It is normal for goals to become clearer after you have run a few issues. But once real work starts moving, it should connect back to a larger direction.
328
+
329
+ Try it now:
330
+
331
+ 1. Open the real task you created.
332
+ 2. Ask: “What larger outcome does this support?”
333
+ 3. Create a simple goal, or choose an existing one.
334
+ 4. Link the issue or project to that goal.
335
+ 5. Leave a short note explaining why this work matters.
336
+
337
+ You’ll know it worked when at least one real issue is linked to a goal and the goal explains why the work matters.`,
338
+ },
339
+ {
340
+ title: "9. Capture one reusable workflow",
341
+ status: "backlog",
342
+ priority: "medium",
343
+ group: "advanced",
344
+ nextTitle: "10. Add a second agent with a different role",
345
+ description: `The best Rudder workflows compound over time.
346
+
347
+ After an agent completes a useful task, do not let the process disappear into a single comment thread. Capture the repeatable parts so future work can start faster and with better instructions.
348
+
349
+ Try it now:
350
+
351
+ 1. Pick one issue where the agent produced something useful.
352
+ 2. Look for the repeatable pattern: what input the agent needed, what steps it followed, what you reviewed, what should repeat, and what it should avoid.
353
+ 3. Write a short reusable workflow or checklist.
354
+ 4. Link it back to the original issue.
355
+ 5. Use it on one future issue.
356
+
357
+ This is one way agents self-iterate in Rudder: their future work improves because your feedback and reusable workflow context become part of the operating system.`,
358
+ },
359
+ {
360
+ title: "10. Add a second agent with a different role",
361
+ status: "backlog",
362
+ priority: "low",
363
+ group: "advanced",
364
+ nextTitle: "11. Set up a recurring loop or automation",
365
+ description: `Human teams work better when responsibilities are clear. Agent teams work the same way.
366
+
367
+ After your first agent has completed useful work, consider adding a second agent with a different role. Do not create another agent just to have more agents. Create one when the work would benefit from a separate responsibility.
368
+
369
+ Good second-agent roles include reviewer, researcher, planner, QA assistant, documentation assistant, release coordinator, or support triage agent.
370
+
371
+ You’ll know it worked when the second agent has a distinct role and at least one issue clearly belongs to that agent.`,
372
+ },
373
+ {
374
+ title: "11. Set up a recurring loop or automation",
375
+ status: "backlog",
376
+ priority: "low",
377
+ group: "advanced",
378
+ description: `Some work should not wait for you to remember it.
379
+
380
+ Once you have run a few issues manually, look for a recurring pattern. Rudder can help turn repeated work into a regular loop, heartbeat, or automation, while still keeping the result visible and reviewable.
381
+
382
+ Good recurring loops include weekly project summaries, daily issue triage, release readiness checks, inbox or blocker review, documentation freshness checks, and cost or activity summaries.
383
+
384
+ You’ll know it worked when one recurring loop exists, the cadence is clear, the expected output is clear, and the agent knows when to ask for review instead of acting silently.`,
385
+ },
386
+ ];
387
+ function issueRef(issue) {
388
+ return issue.identifier ?? issue.id;
389
+ }
390
+ function issueHref(issue, organizationPrefix) {
391
+ const routePrefix = organizationPrefix
392
+ ? `/${encodeURIComponent(organizationPrefix)}`
393
+ : "";
394
+ return `${routePrefix}/issues/${encodeURIComponent(issueRef(issue))}`;
395
+ }
396
+ function buildChatHref(input) {
397
+ const params = new URLSearchParams();
398
+ params.set("prefill", input.prompt);
399
+ params.set("projectId", input.projectId);
400
+ if (input.agentId) {
401
+ params.set("agentId", input.agentId);
402
+ }
403
+ const routePrefix = input.organizationPrefix
404
+ ? `/${encodeURIComponent(input.organizationPrefix)}`
405
+ : "";
406
+ return `${routePrefix}/messenger/chat?${params.toString()}`;
407
+ }
408
+ function appendActionLinks(template, description, input) {
409
+ const lines = [];
410
+ if (template.nextTitle) {
411
+ const nextIssue = input.issueByTitle.get(template.nextTitle);
412
+ if (nextIssue) {
413
+ lines.push(`Next issue: [${template.nextTitle}](${issueHref(nextIssue, input.organizationPrefix)}).`);
414
+ }
415
+ }
416
+ if (template.chatPrompt) {
417
+ lines.push(`Open chat ready to continue: [Start from this prompt](${buildChatHref({
418
+ prompt: template.chatPrompt,
419
+ projectId: input.projectId,
420
+ agentId: input.agentId,
421
+ organizationPrefix: input.organizationPrefix,
422
+ })}).`);
423
+ }
424
+ if (lines.length === 0)
425
+ return description;
426
+ return `${description.trim()}\n\n${lines.join("\n")}`;
427
+ }
428
+ export function onboardingRoutes(db) {
429
+ const router = Router();
430
+ const projects = projectService(db);
431
+ const issues = issueService(db);
432
+ const agents = agentService(db);
433
+ const organizations = organizationService(db);
434
+ router.post("/orgs/:orgId/onboarding/getting-started", async (req, res) => {
435
+ const orgId = req.params.orgId;
436
+ assertCompanyAccess(req, orgId);
437
+ assertBoard(req);
438
+ const actor = getActorInfo(req);
439
+ const operatorUserId = req.actor.userId ?? "local-board";
440
+ const includeTutorial = req.body?.includeTutorial !== false;
441
+ const organization = await organizations.getById(orgId);
442
+ if (!organization) {
443
+ res.status(404).json({ error: "Organization not found" });
444
+ return;
445
+ }
446
+ const existingProjects = await projects.list(orgId);
447
+ let project = existingProjects.find((entry) => !entry.archivedAt && entry.name === ONBOARDING_PROJECT_NAME);
448
+ let createdProject = false;
449
+ if (!project) {
450
+ project = await projects.create(orgId, {
451
+ name: ONBOARDING_PROJECT_NAME,
452
+ status: "planned",
453
+ description: ONBOARDING_PROJECT_DESCRIPTION,
454
+ });
455
+ createdProject = true;
456
+ await logActivity(db, {
457
+ orgId,
458
+ actorType: actor.actorType,
459
+ actorId: actor.actorId,
460
+ agentId: actor.agentId,
461
+ runId: actor.runId,
462
+ action: "project.created",
463
+ entityType: "project",
464
+ entityId: project.id,
465
+ details: { name: project.name },
466
+ });
467
+ }
468
+ const existingIssues = await issues.list(orgId, { projectId: project.id });
469
+ const issueByTitle = new Map(existingIssues.map((issue) => [issue.title, issue]));
470
+ const seededIssues = [];
471
+ let createdIssueCount = 0;
472
+ const activeAgents = await agents.list(orgId);
473
+ const firstAgentId = activeAgents[0]?.id ?? null;
474
+ const templates = includeTutorial
475
+ ? ONBOARDING_ISSUES
476
+ : ONBOARDING_ISSUES.filter((template) => template.group === "welcome");
477
+ for (const [index, template] of templates.entries()) {
478
+ let issue = issueByTitle.get(template.title);
479
+ if (!issue) {
480
+ issue = await issues.create(orgId, {
481
+ projectId: project.id,
482
+ title: template.title,
483
+ description: template.description,
484
+ status: template.status,
485
+ priority: template.priority,
486
+ assigneeUserId: operatorUserId,
487
+ createdByAgentId: actor.agentId,
488
+ createdByUserId: actor.actorType === "user" ? actor.actorId : null,
489
+ boardOrder: (index + 1) * 1000,
490
+ });
491
+ createdIssueCount += 1;
492
+ issueByTitle.set(template.title, issue);
493
+ await logActivity(db, {
494
+ orgId,
495
+ actorType: actor.actorType,
496
+ actorId: actor.actorId,
497
+ agentId: actor.agentId,
498
+ runId: actor.runId,
499
+ action: "issue.created",
500
+ entityType: "issue",
501
+ entityId: issue.id,
502
+ details: {
503
+ title: issue.title,
504
+ identifier: issue.identifier,
505
+ onboardingGroup: template.group,
506
+ },
507
+ });
508
+ }
509
+ if (template.group === "welcome") {
510
+ await issues.followIssue(orgId, issue.id, operatorUserId);
511
+ }
512
+ seededIssues.push(issue);
513
+ }
514
+ for (const template of templates) {
515
+ const issue = issueByTitle.get(template.title);
516
+ if (!issue)
517
+ continue;
518
+ const linkedDescription = appendActionLinks(template, template.description, {
519
+ projectId: project.id,
520
+ agentId: firstAgentId,
521
+ organizationPrefix: organization.issuePrefix,
522
+ issueByTitle,
523
+ });
524
+ if (issue.description !== linkedDescription) {
525
+ const updated = await issues.update(issue.id, { description: linkedDescription });
526
+ if (updated) {
527
+ issueByTitle.set(template.title, updated);
528
+ const seededIndex = seededIssues.findIndex((entry) => entry.id === issue.id);
529
+ if (seededIndex >= 0) {
530
+ seededIssues[seededIndex] = updated;
531
+ }
532
+ }
533
+ }
534
+ }
535
+ res.status(createdProject || createdIssueCount > 0 ? 201 : 200).json({
536
+ project,
537
+ issues: seededIssues,
538
+ createdProject,
539
+ createdIssueCount,
540
+ includeTutorial,
541
+ });
542
+ });
543
+ return router;
544
+ }
545
+ //# sourceMappingURL=onboarding.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"onboarding.js","sourceRoot":"","sources":["../../src/routes/onboarding.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEjC,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACpH,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE5E,MAAM,uBAAuB,GAAG,iBAAiB,CAAC;AAClD,MAAM,8BAA8B,GAAG;;;;;;qIAM8F,CAAC;AActI,MAAM,mBAAmB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4GA8BgF,CAAC;AAE7G,MAAM,iBAAiB,GAA8B;IACnD;QACE,KAAK,EAAE,qDAAqD;QAC5D,MAAM,EAAE,MAAM;QACd,QAAQ,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EAAE,CAAC;oBACZ,YAAY,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;oBAC1C,MAAM,WAAW,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,KAAK,CAAC,EAAE,CAAC,CAAC;oBAC7E,IAAI,WAAW,IAAI,CAAC,EAAE,CAAC;wBACrB,YAAY,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC;oBACtC,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;QAED,GAAG,CAAC,MAAM,CAAC,cAAc,IAAI,iBAAiB,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;YACnE,OAAO;YACP,MAAM,EAAE,YAAY;YACpB,cAAc;YACd,iBAAiB;YACjB,eAAe;SAChB,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"orgs.d.ts","sourceRoot":"","sources":["../../src/routes/orgs.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AA6BvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAG1D,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,EAAE,cAAc,8CAgnBlE"}
1
+ {"version":3,"file":"orgs.d.ts","sourceRoot":"","sources":["../../src/routes/orgs.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AA6BvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAG1D,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,EAAE,cAAc,8CAwoBlE"}
@@ -190,6 +190,28 @@ export function organizationRoutes(db, storage) {
190
190
  const result = await workspaceBrowser.readFile(orgId, filePath);
191
191
  res.json(result);
192
192
  });
193
+ router.get("/:orgId/workspace/file/content", async (req, res) => {
194
+ const orgId = req.params.orgId;
195
+ assertCompanyAccess(req, orgId);
196
+ if (req.actor.type !== "agent") {
197
+ assertBoard(req);
198
+ }
199
+ const filePath = typeof req.query.path === "string" ? req.query.path : "";
200
+ const workspaceFile = await workspaceBrowser.readAttachmentFile(orgId, filePath);
201
+ if (!workspaceFile.contentType.toLowerCase().startsWith("image/")) {
202
+ res.status(415).json({ error: "Workspace file is not an image preview" });
203
+ return;
204
+ }
205
+ res.setHeader("Content-Type", workspaceFile.contentType);
206
+ res.setHeader("Content-Length", String(workspaceFile.buffer.length));
207
+ res.setHeader("Cache-Control", "private, max-age=60");
208
+ res.setHeader("X-Content-Type-Options", "nosniff");
209
+ if (workspaceFile.contentType === "image/svg+xml") {
210
+ res.setHeader("Content-Security-Policy", "sandbox; default-src 'none'; img-src 'self' data:; style-src 'unsafe-inline'");
211
+ }
212
+ res.setHeader("Content-Disposition", `inline; filename="${workspaceFile.originalFilename.replaceAll("\"", "")}"`);
213
+ res.send(workspaceFile.buffer);
214
+ });
193
215
  router.patch("/:orgId/workspace/file", validate(updateOrganizationWorkspaceFileSchema), async (req, res) => {
194
216
  const orgId = req.params.orgId;
195
217
  assertCompanyAccess(req, orgId);