trellis 3.2.0 → 3.2.2

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 (258) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/README.md +61 -171
  3. package/dist/browser/index.d.ts +18 -0
  4. package/dist/browser/index.d.ts.map +1 -0
  5. package/dist/browser/index.js +95 -0
  6. package/dist/{chunk-3ETIIPPB.js → chunk-2W3MHTMG.js} +190 -27
  7. package/dist/{chunk-MBNBTJCR.js → chunk-6GEZ6DN5.js} +2 -2
  8. package/dist/chunk-7ZFRVCUE.js +211 -0
  9. package/dist/chunk-CAG4FULI.js +121 -0
  10. package/dist/{chunk-GD5QJXSS.js → chunk-FWRS4CSC.js} +2 -2
  11. package/dist/{chunk-36VSSTL7.js → chunk-GU374KWZ.js} +1 -1
  12. package/dist/{chunk-3GDRZTAW.js → chunk-H6JB3PZ3.js} +1 -1
  13. package/dist/{chunk-ZHVI7BQN.js → chunk-IZX2PLIB.js} +191 -28
  14. package/dist/chunk-J2TXUFCZ.js +289 -0
  15. package/dist/{chunk-BJ7EZ7FP.js → chunk-JHHEXEDM.js} +17 -0
  16. package/dist/{chunk-X762XWVC.js → chunk-KIJITUZB.js} +1 -1
  17. package/dist/{chunk-7WQGTFVJ.js → chunk-L5N5PR2S.js} +130 -75
  18. package/dist/{chunk-BXSTJVE3.js → chunk-N6MYZT4O.js} +2 -1
  19. package/dist/{chunk-KKDRMIV6.js → chunk-QB5ISE47.js} +1 -1
  20. package/dist/{chunk-HO4TURXW.js → chunk-S3XLFZ27.js} +28 -11
  21. package/dist/{chunk-BQBUVMRN.js → chunk-S6GBJ2ZB.js} +25 -14
  22. package/dist/{chunk-IUWVEEOX.js → chunk-SGMDTWJJ.js} +4 -0
  23. package/dist/{chunk-FZVCXDYW.js → chunk-UQISRW6T.js} +65 -12
  24. package/dist/{chunk-B3ZIFA2O.js → chunk-VBYUTRXX.js} +1 -1
  25. package/dist/cli/deploy-cli.d.ts +18 -0
  26. package/dist/cli/deploy-cli.d.ts.map +1 -0
  27. package/dist/cli/index.d.ts +1 -1
  28. package/dist/cli/index.d.ts.map +1 -1
  29. package/dist/cli/index.js +153 -100
  30. package/dist/client/index.browser.d.ts +29 -0
  31. package/dist/client/index.browser.d.ts.map +1 -0
  32. package/dist/client/index.browser.js +64 -0
  33. package/dist/client/index.js +10 -10
  34. package/dist/client/sdk.browser.d.ts +104 -0
  35. package/dist/client/sdk.browser.d.ts.map +1 -0
  36. package/dist/{sdk-LZ7W3EEY.js → client/sdk.browser.js} +2 -2
  37. package/dist/client/sdk.js +1 -1
  38. package/dist/core/index.js +6 -6
  39. package/dist/db/index.js +18 -18
  40. package/dist/db/inspector.js +6 -6
  41. package/dist/db/trellis.css +1 -1
  42. package/dist/decisions/index.js +2 -2
  43. package/dist/deploy-LQ7GUGJ5.js +9 -0
  44. package/dist/{deploy-66EC752W.js → deploy-YNVG5E4E.js} +1 -1
  45. package/dist/deploy-cli-24BCHAXY.js +67 -0
  46. package/dist/deploy-cli-C35HTITO.js +67 -0
  47. package/dist/embeddings/auto-embed.d.ts.map +1 -1
  48. package/dist/embeddings/index.js +1 -1
  49. package/dist/embeddings/store.d.ts.map +1 -1
  50. package/dist/engine.d.ts +27 -7
  51. package/dist/engine.d.ts.map +1 -1
  52. package/dist/index.js +6 -6
  53. package/dist/mcp/server.d.ts.map +1 -1
  54. package/dist/react/index.js +2 -2
  55. package/dist/react/schema-hooks.js +7 -7
  56. package/dist/{remote-manager-SG545WNY.js → remote-manager-ODE3T2KR.js} +5 -5
  57. package/dist/scaffold/seed.d.ts.map +1 -1
  58. package/dist/scaffold/write.d.ts +1 -1
  59. package/dist/scaffold/write.d.ts.map +1 -1
  60. package/dist/schema/index.js +4 -3
  61. package/dist/server/deploy-meta.d.ts +25 -0
  62. package/dist/server/deploy-meta.d.ts.map +1 -0
  63. package/dist/server/deploy.d.ts +7 -2
  64. package/dist/server/deploy.d.ts.map +1 -1
  65. package/dist/server/index.d.ts +5 -2
  66. package/dist/server/index.d.ts.map +1 -1
  67. package/dist/server/index.js +52 -18
  68. package/dist/server/realtime.d.ts +4 -1
  69. package/dist/server/realtime.d.ts.map +1 -1
  70. package/dist/server/server.d.ts +1 -0
  71. package/dist/server/server.d.ts.map +1 -1
  72. package/dist/server/sprites.d.ts +18 -1
  73. package/dist/server/sprites.d.ts.map +1 -1
  74. package/dist/server/tenancy.d.ts +4 -0
  75. package/dist/server/tenancy.d.ts.map +1 -1
  76. package/dist/server/usage-meter.d.ts +53 -0
  77. package/dist/server/usage-meter.d.ts.map +1 -0
  78. package/dist/{server-IGBIIJSF.js → server-MB3OPSPI.js} +6 -1
  79. package/dist/{server-BOH7M4TT.js → server-ZVWGLLRF.js} +7 -2
  80. package/dist/sprites-KQGTGM6W.js +27 -0
  81. package/dist/{tenancy-S676GLID.js → tenancy-NBLLGCNJ.js} +1 -1
  82. package/dist/{tenancy-OP34NFFS.js → tenancy-POMWQP6M.js} +5 -3
  83. package/dist/vcs/index.js +3 -3
  84. package/dist/vcs/types.d.ts +2 -0
  85. package/dist/vcs/types.d.ts.map +1 -1
  86. package/package.json +17 -6
  87. package/dist/better-sqlite-backend-PII64VE6.js +0 -159
  88. package/dist/better-sqlite-backend-VUBVQ7SN.js +0 -209
  89. package/dist/better-sqlite-backend-Y3AQN65E.js +0 -159
  90. package/dist/better-sqlite-backend-Y3M7DXOX.js +0 -159
  91. package/dist/boot-middleware-FJDGVUM4.js +0 -9
  92. package/dist/boot-middleware-MLJUTLUM.js +0 -9
  93. package/dist/boot-middleware-ZZPDZNYR.js +0 -9
  94. package/dist/chunk-276LKLZR.js +0 -359
  95. package/dist/chunk-2CX5UCRV.js +0 -111
  96. package/dist/chunk-2ESYSVXG.js +0 -48
  97. package/dist/chunk-2I5JU73Y.js +0 -340
  98. package/dist/chunk-2UNSRRNB.js +0 -171
  99. package/dist/chunk-335UEHQR.js +0 -907
  100. package/dist/chunk-4CF2L46N.js +0 -29
  101. package/dist/chunk-5CINODKT.js +0 -41
  102. package/dist/chunk-5ESGWJ5L.js +0 -45
  103. package/dist/chunk-5FGLQGMF.js +0 -1676
  104. package/dist/chunk-5IQZFITY.js +0 -357
  105. package/dist/chunk-5JWFAQDW.js +0 -150
  106. package/dist/chunk-62UHTVU3.js +0 -141
  107. package/dist/chunk-66UJQT2I.js +0 -35
  108. package/dist/chunk-6RNNVOAS.js +0 -355
  109. package/dist/chunk-6X23PZ6H.js +0 -969
  110. package/dist/chunk-7C7LL6MB.js +0 -315
  111. package/dist/chunk-7F4HM3JG.js +0 -394
  112. package/dist/chunk-7KJ7T4D3.js +0 -910
  113. package/dist/chunk-7QQQNUB5.js +0 -92
  114. package/dist/chunk-7QWJBS72.js +0 -946
  115. package/dist/chunk-7R36OZK3.js +0 -957
  116. package/dist/chunk-7UPKCOHE.js +0 -946
  117. package/dist/chunk-A3BONW34.js +0 -35
  118. package/dist/chunk-AHMDVHBL.js +0 -141
  119. package/dist/chunk-AW6A4OZY.js +0 -171
  120. package/dist/chunk-BJ5EKCJ5.js +0 -458
  121. package/dist/chunk-BRGYDO7D.js +0 -223
  122. package/dist/chunk-C5KPSEDN.js +0 -359
  123. package/dist/chunk-CCTNYTUC.js +0 -940
  124. package/dist/chunk-CYQ2OVD2.js +0 -35
  125. package/dist/chunk-DDAK7YOE.js +0 -299
  126. package/dist/chunk-DRILKBY6.js +0 -965
  127. package/dist/chunk-DXE24HNN.js +0 -45
  128. package/dist/chunk-E7ICUNW7.js +0 -945
  129. package/dist/chunk-EAL2PUOE.js +0 -10022
  130. package/dist/chunk-ELT7MLZB.js +0 -109
  131. package/dist/chunk-EWEIRF6G.js +0 -171
  132. package/dist/chunk-F5VDGQJC.js +0 -120
  133. package/dist/chunk-FCPL3IEQ.js +0 -98
  134. package/dist/chunk-FDPKYSV7.js +0 -96
  135. package/dist/chunk-FES3TC24.js +0 -171
  136. package/dist/chunk-FOWKR5TW.js +0 -129
  137. package/dist/chunk-G3XIHPSQ.js +0 -361
  138. package/dist/chunk-GKJLYLVU.js +0 -359
  139. package/dist/chunk-GNXHXNVQ.js +0 -113
  140. package/dist/chunk-GSR6ILTM.js +0 -277
  141. package/dist/chunk-GWRIMRSX.js +0 -45
  142. package/dist/chunk-H72UW2HJ.js +0 -45
  143. package/dist/chunk-HGI74PXB.js +0 -7417
  144. package/dist/chunk-HGRA37LO.js +0 -145
  145. package/dist/chunk-HXSRQO3L.js +0 -145
  146. package/dist/chunk-IG2X2BVO.js +0 -373
  147. package/dist/chunk-IIJVDD54.js +0 -373
  148. package/dist/chunk-IX4BBOIT.js +0 -394
  149. package/dist/chunk-IXU4RMQM.js +0 -349
  150. package/dist/chunk-J6OUIION.js +0 -857
  151. package/dist/chunk-K46RNFDE.js +0 -171
  152. package/dist/chunk-KAGU2XMY.js +0 -359
  153. package/dist/chunk-KCVYJNVX.js +0 -394
  154. package/dist/chunk-KYLIQ3YI.js +0 -399
  155. package/dist/chunk-KZYJJIRN.js +0 -946
  156. package/dist/chunk-LFOX744K.js +0 -96
  157. package/dist/chunk-LHOVJEWR.js +0 -7403
  158. package/dist/chunk-LOPXTPF3.js +0 -120
  159. package/dist/chunk-LZR3VIFU.js +0 -907
  160. package/dist/chunk-MCKGQKYU.js +0 -15
  161. package/dist/chunk-MU6EOS6F.js +0 -0
  162. package/dist/chunk-MWRQ2TXT.js +0 -357
  163. package/dist/chunk-NO73OK2I.js +0 -102
  164. package/dist/chunk-NPE2YJHK.js +0 -394
  165. package/dist/chunk-NSDXU6QX.js +0 -2213
  166. package/dist/chunk-NXIRDSZ6.js +0 -145
  167. package/dist/chunk-NZWFNHCS.js +0 -407
  168. package/dist/chunk-OB4CMMX6.js +0 -260
  169. package/dist/chunk-OBKU74FU.js +0 -7411
  170. package/dist/chunk-OQNDWRDE.js +0 -145
  171. package/dist/chunk-OVWAJMB6.js +0 -394
  172. package/dist/chunk-PDHLBTTD.js +0 -45
  173. package/dist/chunk-PEQNRKLG.js +0 -210
  174. package/dist/chunk-QERIS7QY.js +0 -7403
  175. package/dist/chunk-QHA2DM3C.js +0 -373
  176. package/dist/chunk-QLM4HSYC.js +0 -45
  177. package/dist/chunk-S2OT3TQJ.js +0 -283
  178. package/dist/chunk-S5PHSN5K.js +0 -907
  179. package/dist/chunk-SIAA4J6H.js +0 -21
  180. package/dist/chunk-SQBNLUIA.js +0 -171
  181. package/dist/chunk-STLN6A6B.js +0 -355
  182. package/dist/chunk-U7HV7GU2.js +0 -17
  183. package/dist/chunk-UGZHOGRA.js +0 -39
  184. package/dist/chunk-UICF66FS.js +0 -359
  185. package/dist/chunk-UK3EQREE.js +0 -1078
  186. package/dist/chunk-UPKPURVY.js +0 -394
  187. package/dist/chunk-URC74VCN.js +0 -959
  188. package/dist/chunk-V3G7Q3QQ.js +0 -102
  189. package/dist/chunk-VUJ6SA55.js +0 -303
  190. package/dist/chunk-VUJQLIML.js +0 -141
  191. package/dist/chunk-VWKLKLYB.js +0 -267
  192. package/dist/chunk-VYC3RZMK.js +0 -277
  193. package/dist/chunk-WMERMSWI.js +0 -154
  194. package/dist/chunk-WMR777PO.js +0 -2213
  195. package/dist/chunk-X46IECAC.js +0 -517
  196. package/dist/chunk-XEN3OEYY.js +0 -2234
  197. package/dist/chunk-XZQ66K7A.js +0 -124
  198. package/dist/chunk-YY3GF7DH.js +0 -7411
  199. package/dist/chunk-ZE5R3H4C.js +0 -907
  200. package/dist/chunk-ZMN5LUB7.js +0 -7411
  201. package/dist/chunk-ZUV4MD5U.js +0 -94
  202. package/dist/config-KMY6RRK3.js +0 -19
  203. package/dist/config-VDMK2DUJ.js +0 -19
  204. package/dist/deploy-SO7AFK6L.js +0 -9
  205. package/dist/engine-7GXBM4IT.js +0 -7
  206. package/dist/engine-NSR6BIF7.js +0 -7
  207. package/dist/factory-2P64OC7M.js +0 -34
  208. package/dist/factory-YP4ZZK5K.js +0 -34
  209. package/dist/import-AJLYHFIA.js +0 -10
  210. package/dist/launch-explorer-AI6L2AWJ.js +0 -91
  211. package/dist/query-GJL3CVGN.js +0 -31
  212. package/dist/query-MBJSK3EB.js +0 -31
  213. package/dist/query-TJHEVSKL.js +0 -31
  214. package/dist/query-WUIKOHPE.js +0 -524
  215. package/dist/remote-manager-BLJZ6KF6.js +0 -224
  216. package/dist/remote-manager-BPYE46SI.js +0 -223
  217. package/dist/remote-manager-FMESEAFA.js +0 -224
  218. package/dist/remote-manager-K2WZ5RHY.js +0 -223
  219. package/dist/remote-manager-SG5PQKCH.js +0 -224
  220. package/dist/remote-manager-WGP6MIQZ.js +0 -224
  221. package/dist/sdk-3KBB3E6V.js +0 -16
  222. package/dist/sdk-4ZQO6UTU.js +0 -16
  223. package/dist/sdk-6JA6GV3G.js +0 -16
  224. package/dist/sdk-6VTP5UTZ.js +0 -16
  225. package/dist/sdk-7VS6TYCD.js +0 -16
  226. package/dist/sdk-HQ3FTLRT.js +0 -16
  227. package/dist/sdk-HZ7NU3XE.js +0 -15
  228. package/dist/sdk-KBQE2OXT.js +0 -16
  229. package/dist/sdk-MSCDZ7JU.js +0 -15
  230. package/dist/sdk-WNZOGO3S.js +0 -15
  231. package/dist/sdk-YLV33ZCW.js +0 -9
  232. package/dist/sdk-ZSUD2LLJ.js +0 -16
  233. package/dist/server-AFXFFBWA.js +0 -11
  234. package/dist/server-AGHC4VUL.js +0 -11
  235. package/dist/server-DBUY2KY5.js +0 -11
  236. package/dist/server-GWBQJPRG.js +0 -11
  237. package/dist/server-JZZFULVU.js +0 -11
  238. package/dist/server-L5XAF4M5.js +0 -11
  239. package/dist/server-NYFUHANA.js +0 -12
  240. package/dist/server-OABUB2LO.js +0 -12
  241. package/dist/server-P2CKZWWV.js +0 -12
  242. package/dist/sprites-XVSMQLSI.js +0 -15
  243. package/dist/sql-wasm-FORCZFHZ.js +0 -2148
  244. package/dist/sql-wasm-JZH76RLO.js +0 -2148
  245. package/dist/sqljs-backend-CJQOIQYE.js +0 -266
  246. package/dist/sqljs-backend-KWXBUDUO.js +0 -266
  247. package/dist/state-demo.bundle.js +0 -1033
  248. package/dist/tenancy-CBWYEVUB.js +0 -11
  249. package/dist/tenancy-FO6WVYFN.js +0 -13
  250. package/dist/tenancy-FWDBESMX.js +0 -14
  251. package/dist/tenancy-HGPIS5QA.js +0 -13
  252. package/dist/tenancy-HXFALA37.js +0 -14
  253. package/dist/tenancy-V7ARWNNV.js +0 -14
  254. package/dist/tenancy-ZDN4GXK5.js +0 -13
  255. package/dist/tenancy-ZT5VMY7B.js +0 -14
  256. package/dist/vm-config-YZRJ3KUB.js +0 -21
  257. /package/dist/{chunk-2BRTCEHB.js → chunk-PZ4XYZ4J.js} +0 -0
  258. /package/dist/{chunk-EO3J7GRP.js → chunk-WXSWA3MV.js} +0 -0
@@ -1,3 +1,10 @@
1
+ import {
2
+ getDecision,
3
+ getDecisionChain,
4
+ init_decisions,
5
+ queryDecisions,
6
+ recordDecision
7
+ } from "./chunk-GU374KWZ.js";
1
8
  import {
2
9
  EAVStore,
3
10
  init_eav_store
@@ -59,18 +66,11 @@ import {
59
66
  unblockIssue,
60
67
  updateIssue,
61
68
  updateLaneHead
62
- } from "./chunk-B3ZIFA2O.js";
63
- import {
64
- getDecision,
65
- getDecisionChain,
66
- init_decisions,
67
- queryDecisions,
68
- recordDecision
69
- } from "./chunk-36VSSTL7.js";
69
+ } from "./chunk-VBYUTRXX.js";
70
70
  import {
71
71
  DEFAULT_CONFIG,
72
72
  init_types
73
- } from "./chunk-BXSTJVE3.js";
73
+ } from "./chunk-N6MYZT4O.js";
74
74
  import {
75
75
  createVcsOp,
76
76
  init_ops,
@@ -743,7 +743,7 @@ function writeTrellisHooks(rootPath, ide) {
743
743
  renderCyclePlanningScript(),
744
744
  "utf-8"
745
745
  );
746
- const adapterName = ide === "windsurf" ? "cascade-adapter.sh" : `${ide}-adapter.sh`;
746
+ const adapterName = `${ide}-adapter.sh`;
747
747
  writeFileSync2(
748
748
  join4(adaptersDir, adapterName),
749
749
  renderAdapterScript(ide),
@@ -757,10 +757,10 @@ function writeTrellisHooks(rootPath, ide) {
757
757
  "utf-8"
758
758
  );
759
759
  break;
760
- case "windsurf":
760
+ case "devin":
761
761
  writeFileSync2(
762
- join4(rootPath, ".windsurf", "hooks.json"),
763
- JSON.stringify(renderWindsurfHooksConfig(), null, 2),
762
+ join4(rootPath, ".devin", "hooks.json"),
763
+ JSON.stringify(renderDevinHooksConfig(), null, 2),
764
764
  "utf-8"
765
765
  );
766
766
  break;
@@ -968,13 +968,13 @@ You are working in a Trellis-tracked repository. See \`.trellis/agents/AGENTS.md
968
968
  *Auto-generated by Trellis. Run \`trellis seed\` to refresh context.*
969
969
  `;
970
970
  }
971
- function renderWindsurfRules(input) {
971
+ function renderDevinRules(input) {
972
972
  const projectName = input.context.name ?? "this project";
973
973
  const domain = input.context.domain ?? "general";
974
974
  const eco = input.context.ecosystem ?? "unknown";
975
975
  const framework = input.framework && input.framework !== "none" ? input.framework : "vanilla";
976
976
  const plugins = input.plugins.length > 0 ? input.plugins.map((p) => `- ${p}`).join("\n") : "(none selected)";
977
- return `# Windsurf Rules for ${projectName}
977
+ return `# Devin Rules for ${projectName}
978
978
 
979
979
  > Generated by \`trellis init\`
980
980
 
@@ -1122,7 +1122,7 @@ if [ -f ".trellis/config.json" ]; then
1122
1122
  EOF
1123
1123
  ;;
1124
1124
  *)
1125
- # Default stdout for Cursor/Windsurf/Claude
1125
+ # Default stdout for Cursor/Devin/Claude
1126
1126
  echo ""
1127
1127
  echo "\u{1F33F} Trellis Context ($ORIGIN):"
1128
1128
  echo " Recent memories: $(echo "$CONTEXT_OUTPUT" | jq -r '.entities | length' 2>/dev/null || echo "0")"
@@ -1332,7 +1332,7 @@ EOF
1332
1332
  fi
1333
1333
  ;;
1334
1334
  *)
1335
- # Default stdout for Cursor/Windsurf/Claude
1335
+ # Default stdout for Cursor/Devin/Claude
1336
1336
  if [ \${#RECOMMENDATIONS[@]} -gt 0 ]; then
1337
1337
  echo ""
1338
1338
  echo "\u{1F33F} Trellis Session Summary ($ORIGIN):"
@@ -1387,17 +1387,17 @@ case "$EVENT_TYPE" in
1387
1387
  exit 1
1388
1388
  ;;
1389
1389
  esac`;
1390
- case "windsurf":
1390
+ case "devin":
1391
1391
  return `#!/usr/bin/env bash
1392
- # Windsurf Cascade adapter for Trellis harness
1393
- # Translates Cascade events to normalized contract
1392
+ # Devin adapter for Trellis harness
1393
+ # Translates Devin events to normalized contract
1394
1394
  set -euo pipefail
1395
1395
 
1396
1396
  # Import desk root detection
1397
1397
  source "$(dirname "$0")/../desk-root.sh"
1398
1398
 
1399
1399
  # Set origin
1400
- export TRELLIS_ORIGIN="windsurf"
1400
+ export TRELLIS_ORIGIN="devin"
1401
1401
  export TRELLIS_DESK_ROOT="$PWD"
1402
1402
 
1403
1403
  # Route based on event type
@@ -1596,9 +1596,7 @@ function renderCursorHooksConfig() {
1596
1596
  return {
1597
1597
  version: 1,
1598
1598
  hooks: {
1599
- sessionStart: [
1600
- { command: hookCmd("session-start"), timeout: 15 }
1601
- ],
1599
+ sessionStart: [{ command: hookCmd("session-start"), timeout: 15 }],
1602
1600
  postToolUse: [{ command: hookCmd("post-tool-use"), timeout: 10 }],
1603
1601
  afterShellExecution: [{ command: hookCmd("after-shell"), timeout: 10 }],
1604
1602
  afterMCPExecution: [{ command: hookCmd("after-mcp"), timeout: 10 }],
@@ -1607,24 +1605,24 @@ function renderCursorHooksConfig() {
1607
1605
  }
1608
1606
  };
1609
1607
  }
1610
- function renderWindsurfHooksConfig() {
1608
+ function renderDevinHooksConfig() {
1611
1609
  return {
1612
1610
  hooks: {
1613
1611
  pre_user_prompt: [
1614
1612
  {
1615
- command: "bash .cursor/hooks/adapters/cascade-adapter.sh pre-prompt",
1613
+ command: "bash .cursor/hooks/adapters/devin-adapter.sh pre-prompt",
1616
1614
  show_output: true
1617
1615
  }
1618
1616
  ],
1619
1617
  post_write_code: [
1620
1618
  {
1621
- command: "bash .cursor/hooks/adapters/cascade-adapter.sh post-tool",
1619
+ command: "bash .cursor/hooks/adapters/devin-adapter.sh post-tool",
1622
1620
  show_output: false
1623
1621
  }
1624
1622
  ],
1625
1623
  post_cascade_response: [
1626
1624
  {
1627
- command: "bash .cursor/hooks/adapters/cascade-adapter.sh post-response",
1625
+ command: "bash .cursor/hooks/adapters/devin-adapter.sh post-response",
1628
1626
  show_output: true
1629
1627
  }
1630
1628
  ]
@@ -1747,7 +1745,7 @@ function renderGeminiHooksConfig() {
1747
1745
  type: "command",
1748
1746
  command: "bash .cursor/hooks/adapters/gemini-adapter.sh before-agent",
1749
1747
  timeout: 15e3,
1750
- description: "Mirror Windsurf pre_user_prompt desk context refresh"
1748
+ description: "Mirror Devin pre_user_prompt desk context refresh"
1751
1749
  }
1752
1750
  ]
1753
1751
  }
@@ -1809,18 +1807,18 @@ function writeIdeScaffold(rootPath, input) {
1809
1807
  }
1810
1808
  break;
1811
1809
  }
1812
- case "windsurf": {
1813
- const windsurfDir = join4(rootPath, ".windsurf");
1814
- if (!existsSync3(windsurfDir)) {
1815
- mkdirSync2(windsurfDir, { recursive: true });
1810
+ case "devin": {
1811
+ const devinDir = join4(rootPath, ".devin");
1812
+ if (!existsSync3(devinDir)) {
1813
+ mkdirSync2(devinDir, { recursive: true });
1816
1814
  }
1817
1815
  writeFileSync2(
1818
- join4(windsurfDir, "rules.md"),
1819
- renderWindsurfRules(fullInput),
1816
+ join4(devinDir, "rules.md"),
1817
+ renderDevinRules(fullInput),
1820
1818
  "utf-8"
1821
1819
  );
1822
1820
  if (footprint === "full") {
1823
- writeTrellisHooks(rootPath, "windsurf");
1821
+ writeTrellisHooks(rootPath, "devin");
1824
1822
  }
1825
1823
  break;
1826
1824
  }
@@ -6051,7 +6049,7 @@ var init_engine = __esm({
6051
6049
  "vcs:issueBlock",
6052
6050
  "vcs:issueUnblock"
6053
6051
  ]);
6054
- TrellisVcsEngine = class {
6052
+ TrellisVcsEngine = class _TrellisVcsEngine {
6055
6053
  config;
6056
6054
  store;
6057
6055
  opLog;
@@ -6080,44 +6078,41 @@ var init_engine = __esm({
6080
6078
  ignorePatterns: mergedIgnore,
6081
6079
  debounceMs: opts.debounceMs ?? DEFAULT_CONFIG.debounceMs,
6082
6080
  defaultBranch: opts.defaultBranch ?? DEFAULT_CONFIG.defaultBranch,
6083
- dbPath: opts.dbPath ?? DEFAULT_CONFIG.dbPath
6081
+ dbPath: opts.dbPath ?? DEFAULT_CONFIG.dbPath,
6082
+ indexWorkspace: opts.indexWorkspace ?? DEFAULT_CONFIG.indexWorkspace
6084
6083
  };
6085
6084
  this.agentId = opts.agentId ?? `agent:${process.env.USER ?? "unknown"}`;
6086
6085
  this.store = new EAVStore();
6087
6086
  this.opLog = opts.opLog ?? new JsonOpLog(join5(this.config.rootPath, ".trellis", "ops.json"));
6088
6087
  }
6089
- // -------------------------------------------------------------------------
6090
- // Lifecycle
6091
- // -------------------------------------------------------------------------
6092
- /**
6093
- * Initialize a new TrellisVCS repo. Creates .trellis/ directory and config.
6094
- */
6095
- async initRepo(opts) {
6096
- ensureTrellisGitignoreEntry(this.config.rootPath);
6097
- const trellisDir = join5(this.config.rootPath, ".trellis");
6098
- if (!existsSync4(trellisDir)) {
6099
- mkdirSync3(trellisDir, { recursive: true });
6088
+ readPersistedConfig() {
6089
+ const configPath = join5(this.config.rootPath, ".trellis", "config.json");
6090
+ if (!existsSync4(configPath)) return null;
6091
+ try {
6092
+ return JSON.parse(readFileSync4(configPath, "utf-8"));
6093
+ } catch {
6094
+ return null;
6100
6095
  }
6101
- this._blobStore = new BlobStore(trellisDir);
6102
- const configPath = join5(trellisDir, "config.json");
6096
+ }
6097
+ writePersistedConfig(createdAt) {
6098
+ const existing = this.readPersistedConfig();
6103
6099
  const persistedConfig = {
6104
6100
  rootPath: this.config.rootPath,
6105
6101
  ignorePatterns: this.config.ignorePatterns,
6106
6102
  debounceMs: this.config.debounceMs,
6107
6103
  defaultBranch: this.config.defaultBranch,
6104
+ indexWorkspace: this.config.indexWorkspace,
6108
6105
  agentId: this.agentId,
6109
- createdAt: (/* @__PURE__ */ new Date()).toISOString()
6106
+ createdAt: createdAt ?? existing?.createdAt ?? (/* @__PURE__ */ new Date()).toISOString()
6110
6107
  };
6108
+ const configPath = join5(this.config.rootPath, ".trellis", "config.json");
6111
6109
  writeFileSync3(configPath, JSON.stringify(persistedConfig, null, 2));
6112
- this.opLog.load();
6113
- const branchOp = await createVcsOp("vcs:branchCreate", {
6114
- agentId: this.agentId,
6115
- previousHash: this.opLog.getLastOp()?.hash,
6116
- vcs: {
6117
- branchName: this.config.defaultBranch
6118
- }
6119
- });
6120
- await this.applyOp(branchOp);
6110
+ return persistedConfig;
6111
+ }
6112
+ async indexExistingFiles(opts) {
6113
+ if (!this._blobStore) {
6114
+ this._blobStore = new BlobStore(join5(this.config.rootPath, ".trellis"));
6115
+ }
6121
6116
  const scanner = new FileWatcher({
6122
6117
  rootPath: this.config.rootPath,
6123
6118
  ignorePatterns: [...this.config.ignorePatterns, ".trellis"],
@@ -6125,7 +6120,7 @@ var init_engine = __esm({
6125
6120
  onEvent: () => {
6126
6121
  }
6127
6122
  });
6128
- const events = await scanner.scan({
6123
+ const scanEvents = await scanner.scan({
6129
6124
  onProgress: (progress) => {
6130
6125
  if (progress.phase === "done") {
6131
6126
  return;
@@ -6138,13 +6133,15 @@ var init_engine = __esm({
6138
6133
  });
6139
6134
  }
6140
6135
  });
6141
- let opsCreated = 1;
6136
+ const trackedPaths = new Set(this.trackedFiles().map((f) => f.path));
6137
+ const events = scanEvents.filter((event) => !trackedPaths.has(event.path));
6142
6138
  opts?.onProgress?.({
6143
6139
  phase: "recording",
6144
6140
  current: 0,
6145
6141
  total: events.length,
6146
6142
  message: `Scanning ${events.length} initial file operations\u2026`
6147
6143
  });
6144
+ let opsCreated = 0;
6148
6145
  for (const event of events) {
6149
6146
  if (event.contentHash) {
6150
6147
  try {
@@ -6165,16 +6162,52 @@ var init_engine = __esm({
6165
6162
  });
6166
6163
  await this.applyOp(op);
6167
6164
  opsCreated++;
6168
- const scannedFiles = opsCreated - 1;
6169
- if (scannedFiles % 25 === 0 || scannedFiles === events.length) {
6165
+ if (opsCreated % 25 === 0 || opsCreated === events.length) {
6170
6166
  opts?.onProgress?.({
6171
6167
  phase: "recording",
6172
- current: scannedFiles,
6168
+ current: opsCreated,
6173
6169
  total: events.length,
6174
- message: `Scanned ${scannedFiles}/${events.length} initial file ops`
6170
+ message: `Scanned ${opsCreated}/${events.length} initial file ops`
6175
6171
  });
6176
6172
  }
6177
6173
  }
6174
+ return {
6175
+ opsCreated,
6176
+ filesIndexed: events.length
6177
+ };
6178
+ }
6179
+ // -------------------------------------------------------------------------
6180
+ // Lifecycle
6181
+ // -------------------------------------------------------------------------
6182
+ /**
6183
+ * Initialize a new TrellisVCS repo. Creates .trellis/ directory and config.
6184
+ */
6185
+ async initRepo(opts) {
6186
+ const indexWorkspace = opts?.indexWorkspace ?? this.config.indexWorkspace;
6187
+ this.config.indexWorkspace = indexWorkspace;
6188
+ ensureTrellisGitignoreEntry(this.config.rootPath);
6189
+ const trellisDir = join5(this.config.rootPath, ".trellis");
6190
+ if (!existsSync4(trellisDir)) {
6191
+ mkdirSync3(trellisDir, { recursive: true });
6192
+ }
6193
+ this._blobStore = new BlobStore(trellisDir);
6194
+ this.writePersistedConfig();
6195
+ this.opLog.load();
6196
+ const branchOp = await createVcsOp("vcs:branchCreate", {
6197
+ agentId: this.agentId,
6198
+ previousHash: this.opLog.getLastOp()?.hash,
6199
+ vcs: {
6200
+ branchName: this.config.defaultBranch
6201
+ }
6202
+ });
6203
+ await this.applyOp(branchOp);
6204
+ let opsCreated = 1;
6205
+ let filesIndexed = 0;
6206
+ if (indexWorkspace) {
6207
+ const indexed = await this.indexExistingFiles(opts);
6208
+ opsCreated += indexed.opsCreated;
6209
+ filesIndexed = indexed.filesIndexed;
6210
+ }
6178
6211
  await this.flushAutoCheckpoint();
6179
6212
  opts?.onProgress?.({
6180
6213
  phase: "scaffolding",
@@ -6183,7 +6216,7 @@ var init_engine = __esm({
6183
6216
  message: "Inferring project context\u2026"
6184
6217
  });
6185
6218
  const context = await inferProjectContext(this.config.rootPath, {
6186
- precomputedFileCount: events.length
6219
+ precomputedFileCount: filesIndexed
6187
6220
  });
6188
6221
  const profile = loadProfile();
6189
6222
  writeAgentScaffold(this.config.rootPath, { profile, context });
@@ -6191,9 +6224,9 @@ var init_engine = __esm({
6191
6224
  phase: "done",
6192
6225
  current: opsCreated,
6193
6226
  total: opsCreated,
6194
- message: `Initialized repository with ${opsCreated} operations`
6227
+ message: indexWorkspace ? `Initialized repository with ${opsCreated} operations` : "Initialized minimal repository without workspace indexing"
6195
6228
  });
6196
- return { opsCreated, context };
6229
+ return { opsCreated, filesIndexed, indexWorkspace, context };
6197
6230
  }
6198
6231
  /**
6199
6232
  * Open an existing TrellisVCS repo. Loads ops and replays into EAV store.
@@ -6202,10 +6235,8 @@ var init_engine = __esm({
6202
6235
  this.opLog.load();
6203
6236
  const trellisDir = join5(this.config.rootPath, ".trellis");
6204
6237
  this._blobStore = new BlobStore(trellisDir);
6205
- const configPath = join5(this.config.rootPath, ".trellis", "config.json");
6206
- if (existsSync4(configPath)) {
6207
- const raw = readFileSync4(configPath, "utf-8");
6208
- const persisted = JSON.parse(raw);
6238
+ const persisted = this.readPersistedConfig();
6239
+ if (persisted) {
6209
6240
  this.agentId = persisted.agentId;
6210
6241
  const filePatterns = readIgnorePatterns(this.config.rootPath);
6211
6242
  this.config.ignorePatterns = [
@@ -6213,6 +6244,7 @@ var init_engine = __esm({
6213
6244
  ];
6214
6245
  this.config.debounceMs = persisted.debounceMs;
6215
6246
  this.config.defaultBranch = persisted.defaultBranch;
6247
+ this.config.indexWorkspace = persisted.indexWorkspace ?? DEFAULT_CONFIG.indexWorkspace;
6216
6248
  }
6217
6249
  this.loadCurrentBranch();
6218
6250
  const integrationOps = this.opLog.readAll();
@@ -6224,10 +6256,29 @@ var init_engine = __esm({
6224
6256
  opsReplayed: this.materializationStats.integrationOpsReplayed + laneReplayed
6225
6257
  };
6226
6258
  }
6259
+ /**
6260
+ * Index all untracked files currently on disk into the Trellis graph.
6261
+ */
6262
+ async indexWorkspace(opts) {
6263
+ if (!_TrellisVcsEngine.isRepo(this.config.rootPath)) {
6264
+ throw new Error(
6265
+ `Not a Trellis workspace: ${this.config.rootPath}. Run trellis init first.`
6266
+ );
6267
+ }
6268
+ if (this.getOpCount() === 0) {
6269
+ this.open();
6270
+ }
6271
+ const result = await this.indexExistingFiles(opts);
6272
+ await this.flushAutoCheckpoint();
6273
+ this.config.indexWorkspace = true;
6274
+ this.writePersistedConfig();
6275
+ return result;
6276
+ }
6227
6277
  /**
6228
6278
  * Start watching the filesystem for changes.
6229
6279
  */
6230
- watch() {
6280
+ watch(opts) {
6281
+ const reconcileExisting = opts?.reconcileExisting ?? this.config.indexWorkspace;
6231
6282
  this.ingestion = new Ingestion({
6232
6283
  agentId: this.agentId,
6233
6284
  lastOpHash: this.getActiveJournal().getLastOp()?.hash,
@@ -6249,6 +6300,10 @@ var init_engine = __esm({
6249
6300
  await this.ingestion.process(event);
6250
6301
  }
6251
6302
  });
6303
+ if (!reconcileExisting) {
6304
+ this.watcher.start();
6305
+ return;
6306
+ }
6252
6307
  this.watcher.scan().then(async (scanEvents) => {
6253
6308
  const trackedPaths = new Set(this.trackedFiles().map((f) => f.path));
6254
6309
  for (const event of scanEvents) {
@@ -47,7 +47,8 @@ var init_types = __esm({
47
47
  ],
48
48
  debounceMs: 300,
49
49
  defaultBranch: "main",
50
- dbPath: ".trellis/trellis.db"
50
+ dbPath: ".trellis/trellis.db",
51
+ indexWorkspace: true
51
52
  };
52
53
  }
53
54
  });
@@ -330,7 +330,7 @@ var TrellisDb = class _TrellisDb {
330
330
  async _getPool() {
331
331
  if (this._pool) return this._pool;
332
332
  if (!this._poolPromise) {
333
- this._poolPromise = import("./tenancy-S676GLID.js").then(({ TenantPool }) => {
333
+ this._poolPromise = import("./tenancy-POMWQP6M.js").then(({ TenantPool }) => {
334
334
  const path = this.opts.path;
335
335
  this._pool = new TenantPool(path);
336
336
  return this._pool;
@@ -197,6 +197,7 @@ CREATE INDEX IF NOT EXISTS idx_chunks_file ON chunks(file_path);
197
197
  const fs = __require("fs");
198
198
  const path = __require("path");
199
199
  const data = this.db.export();
200
+ this.prepareStatements();
200
201
  fs.mkdirSync(path.dirname(this.dbPath), { recursive: true });
201
202
  const tmp = `${this.dbPath}.tmp`;
202
203
  fs.writeFileSync(tmp, Buffer.from(data));
@@ -245,7 +246,10 @@ CREATE INDEX IF NOT EXISTS idx_chunks_file ON chunks(file_path);
245
246
  $updatedAt: record.updatedAt
246
247
  });
247
248
  this.stmts.upsertChunk.reset();
248
- this.stmts.upsertVector.run({ $id: record.id, $embedding: embeddingBlob });
249
+ this.stmts.upsertVector.run({
250
+ $id: record.id,
251
+ $embedding: embeddingBlob
252
+ });
249
253
  this.stmts.upsertVector.reset();
250
254
  this.db.run("COMMIT");
251
255
  } catch (e) {
@@ -272,7 +276,10 @@ CREATE INDEX IF NOT EXISTS idx_chunks_file ON chunks(file_path);
272
276
  $updatedAt: record.updatedAt
273
277
  });
274
278
  this.stmts.upsertChunk.reset();
275
- this.stmts.upsertVector.run({ $id: record.id, $embedding: embeddingBlob });
279
+ this.stmts.upsertVector.run({
280
+ $id: record.id,
281
+ $embedding: embeddingBlob
282
+ });
276
283
  this.stmts.upsertVector.reset();
277
284
  }
278
285
  this.db.run("COMMIT");
@@ -877,7 +884,9 @@ function entitySummaryText(entityId, facts, links) {
877
884
  const type = facts.find((f) => f.a === "type")?.v ?? "Entity";
878
885
  const name = facts.find((f) => f.a === "name" || f.a === "title")?.v ?? entityId;
879
886
  const parts = [`${type}: ${name} (${entityId})`];
880
- const attrs = facts.filter((f) => !["type", "name", "title", "createdAt", "updatedAt"].includes(f.a));
887
+ const attrs = facts.filter(
888
+ (f) => !["type", "name", "title", "createdAt", "updatedAt"].includes(f.a)
889
+ );
881
890
  if (attrs.length > 0) {
882
891
  parts.push(attrs.map((f) => ` ${f.a} = ${f.v}`).join("\n"));
883
892
  }
@@ -909,19 +918,23 @@ async function _processOp(op, store, embedFn, embedIndividual) {
909
918
  const now = (/* @__PURE__ */ new Date()).toISOString();
910
919
  const entityIds = /* @__PURE__ */ new Set();
911
920
  if (op.facts) for (const f of op.facts) entityIds.add(f.e);
912
- if (op.links) for (const l of op.links) {
913
- entityIds.add(l.e1);
914
- entityIds.add(l.e2);
915
- }
921
+ if (op.links)
922
+ for (const l of op.links) {
923
+ entityIds.add(l.e1);
924
+ entityIds.add(l.e2);
925
+ }
916
926
  if (op.deleteFacts) for (const f of op.deleteFacts) entityIds.add(f.e);
917
- if (op.deleteLinks) for (const l of op.deleteLinks) {
918
- entityIds.add(l.e1);
919
- entityIds.add(l.e2);
920
- }
927
+ if (op.deleteLinks)
928
+ for (const l of op.deleteLinks) {
929
+ entityIds.add(l.e1);
930
+ entityIds.add(l.e2);
931
+ }
932
+ let mutated = false;
921
933
  if (op.deleteFacts || op.deleteLinks) {
922
934
  for (const eid of entityIds) {
923
935
  store.deleteByEntity(eid);
924
936
  }
937
+ mutated = true;
925
938
  }
926
939
  if (op.facts && op.facts.length > 0) {
927
940
  const factsByEntity = /* @__PURE__ */ new Map();
@@ -977,8 +990,12 @@ async function _processOp(op, store, embedFn, embedIndividual) {
977
990
  }
978
991
  if (records.length > 0) {
979
992
  store.upsertBatch(records);
993
+ mutated = true;
980
994
  }
981
995
  }
996
+ if (mutated) {
997
+ store.flush();
998
+ }
982
999
  }
983
1000
  async function buildRAGContext(query, vectorStore, embedFn = embed, options) {
984
1001
  const maxChunks = options?.maxChunks ?? 10;
@@ -4,7 +4,7 @@ import {
4
4
  init_profile,
5
5
  init_write,
6
6
  loadProfile
7
- } from "./chunk-7WQGTFVJ.js";
7
+ } from "./chunk-L5N5PR2S.js";
8
8
 
9
9
  // src/scaffold/seed.ts
10
10
  init_profile();
@@ -36,11 +36,7 @@ async function seedContext(opts) {
36
36
  confidence: context.confidence,
37
37
  lastSeed: timestamp
38
38
  };
39
- writeFileSync(
40
- agentContextPath,
41
- JSON.stringify(config, null, 2),
42
- "utf-8"
43
- );
39
+ writeFileSync(agentContextPath, JSON.stringify(config, null, 2), "utf-8");
44
40
  filesUpdated.push(".trellis/agents/agent-context.json");
45
41
  }
46
42
  }
@@ -48,25 +44,40 @@ async function seedContext(opts) {
48
44
  case "cursor": {
49
45
  const cursorRulesPath = join(rootPath, ".cursor", "rules.md");
50
46
  if (existsSync(cursorRulesPath) || force) {
51
- const content = renderSeedIdeRules(profile, context, "cursor", timestamp);
47
+ const content = renderSeedIdeRules(
48
+ profile,
49
+ context,
50
+ "cursor",
51
+ timestamp
52
+ );
52
53
  writeFileSync(cursorRulesPath, content, "utf-8");
53
54
  filesUpdated.push(".cursor/rules.md");
54
55
  }
55
56
  break;
56
57
  }
57
- case "windsurf": {
58
- const windsurfRulesPath = join(rootPath, ".windsurf", "rules.md");
59
- if (existsSync(windsurfRulesPath) || force) {
60
- const content = renderSeedIdeRules(profile, context, "windsurf", timestamp);
61
- writeFileSync(windsurfRulesPath, content, "utf-8");
62
- filesUpdated.push(".windsurf/rules.md");
58
+ case "devin": {
59
+ const devinRulesPath = join(rootPath, ".devin", "rules.md");
60
+ if (existsSync(devinRulesPath) || force) {
61
+ const content = renderSeedIdeRules(
62
+ profile,
63
+ context,
64
+ "devin",
65
+ timestamp
66
+ );
67
+ writeFileSync(devinRulesPath, content, "utf-8");
68
+ filesUpdated.push(".devin/rules.md");
63
69
  }
64
70
  break;
65
71
  }
66
72
  case "claude": {
67
73
  const claudeSettingsPath = join(rootPath, ".claude", "settings.md");
68
74
  if (existsSync(claudeSettingsPath) || force) {
69
- const content = renderSeedIdeRules(profile, context, "claude", timestamp);
75
+ const content = renderSeedIdeRules(
76
+ profile,
77
+ context,
78
+ "claude",
79
+ timestamp
80
+ );
70
81
  writeFileSync(claudeSettingsPath, content, "utf-8");
71
82
  filesUpdated.push(".claude/settings.md");
72
83
  }
@@ -94,6 +94,10 @@ var TenantPool = class {
94
94
  }
95
95
  this.pool.clear();
96
96
  }
97
+ /** Absolute path to the tenant data directory. */
98
+ dataPath() {
99
+ return this.dbPath;
100
+ }
97
101
  /**
98
102
  * Return the SQLite file path for a given tenant.
99
103
  */