@acryldev/harness-runtime 0.0.0-stage → 0.2.11

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 (167) hide show
  1. package/LICENSE +49 -0
  2. package/lib/index.mjs +5693 -0
  3. package/lib/index.mjs.map +1 -0
  4. package/lib/types/acryl-home.d.ts +81 -0
  5. package/lib/types/app/new-app.d.ts +65 -0
  6. package/lib/types/app/start-source.d.ts +47 -0
  7. package/lib/types/blueprint/blueprint.d.ts +74 -0
  8. package/lib/types/blueprint/brand-identity.d.ts +26 -0
  9. package/lib/types/blueprint/compose.d.ts +53 -0
  10. package/lib/types/blueprint/definition.d.ts +22 -0
  11. package/lib/types/blueprint/index.d.ts +7 -0
  12. package/lib/types/blueprint/manifest.d.ts +35 -0
  13. package/lib/types/blueprint/selection.d.ts +19 -0
  14. package/lib/types/cli-market-install.d.ts +97 -0
  15. package/lib/types/cli-market-plugins.d.ts +81 -0
  16. package/lib/types/coding-capabilities.d.ts +29 -0
  17. package/lib/types/durable-message.d.ts +18 -0
  18. package/lib/types/engine-dsh.d.ts +181 -0
  19. package/lib/types/engine-files.d.ts +8 -0
  20. package/lib/types/engine-host.d.ts +32 -0
  21. package/lib/types/engine-tools.d.ts +11 -0
  22. package/lib/types/index.d.ts +67 -0
  23. package/lib/types/instance/announce-self.d.ts +38 -0
  24. package/lib/types/instance/app-instance.d.ts +125 -0
  25. package/lib/types/instance/index.d.ts +6 -0
  26. package/lib/types/instance/offline-lock.d.ts +29 -0
  27. package/lib/types/instance/online-secret.d.ts +29 -0
  28. package/lib/types/instance/registry.d.ts +26 -0
  29. package/lib/types/instance/select.d.ts +43 -0
  30. package/lib/types/module-hooks.d.ts +19 -0
  31. package/lib/types/module-resolution.d.ts +31 -0
  32. package/lib/types/package-overlay.d.ts +41 -0
  33. package/lib/types/pinned-pnpm.d.ts +15 -0
  34. package/lib/types/plugin-acryl-workspace-status.d.ts +24 -0
  35. package/lib/types/plugin-doctor.d.ts +49 -0
  36. package/lib/types/plugin-lifecycle-state.d.ts +92 -0
  37. package/lib/types/plugin-lifecycle.d.ts +87 -0
  38. package/lib/types/profile-layout.d.ts +17 -0
  39. package/lib/types/profile-owner.d.ts +25 -0
  40. package/lib/types/profile-repair/backup.d.ts +37 -0
  41. package/lib/types/profile-repair/findings.d.ts +29 -0
  42. package/lib/types/profile-repair/index.d.ts +9 -0
  43. package/lib/types/profile-repair/inspector.d.ts +11 -0
  44. package/lib/types/profile-repair/repair.d.ts +38 -0
  45. package/lib/types/profile-resolution/moved-framework.d.ts +21 -0
  46. package/lib/types/profile-resolution/resolver.d.ts +41 -0
  47. package/lib/types/profile-resolution/service.d.ts +22 -0
  48. package/lib/types/prompt-budget.d.ts +44 -0
  49. package/lib/types/session-bridge.d.ts +57 -0
  50. package/lib/types/session-log-exporter.d.ts +31 -0
  51. package/lib/types/system-prompt-capture.d.ts +29 -0
  52. package/lib/types/web-favicon-data.d.ts +5 -0
  53. package/lib/types/web-favicon.d.ts +23 -0
  54. package/lib/types/web-market-install.d.ts +114 -0
  55. package/lib/types/web-market-plugins.d.ts +106 -0
  56. package/lib/types/web-port.d.ts +15 -0
  57. package/package.json +211 -3
  58. package/src/acryl-home.ts +103 -0
  59. package/src/app/new-app.ts +239 -0
  60. package/src/app/start-source.ts +110 -0
  61. package/src/blueprint/blueprint.ts +141 -0
  62. package/src/blueprint/brand-identity.ts +75 -0
  63. package/src/blueprint/compose.ts +222 -0
  64. package/src/blueprint/definition.ts +92 -0
  65. package/src/blueprint/index.ts +20 -0
  66. package/src/blueprint/manifest.ts +145 -0
  67. package/src/blueprint/selection.ts +74 -0
  68. package/src/cli-market-install.ts +181 -0
  69. package/src/cli-market-plugins.ts +176 -0
  70. package/src/coding-capabilities.ts +61 -0
  71. package/src/durable-message.ts +23 -0
  72. package/src/engine-dsh.ts +856 -0
  73. package/src/engine-files.ts +9 -0
  74. package/src/engine-host.ts +128 -0
  75. package/src/engine-tools.ts +26 -0
  76. package/src/index.ts +436 -0
  77. package/src/instance/announce-self.ts +88 -0
  78. package/src/instance/app-instance.ts +240 -0
  79. package/src/instance/index.ts +45 -0
  80. package/src/instance/offline-lock.ts +71 -0
  81. package/src/instance/online-secret.ts +55 -0
  82. package/src/instance/registry.ts +53 -0
  83. package/src/instance/select.ts +134 -0
  84. package/src/module-hooks.ts +41 -0
  85. package/src/module-resolution.ts +187 -0
  86. package/src/package-overlay.ts +160 -0
  87. package/src/pinned-pnpm.ts +67 -0
  88. package/src/plugin-acryl-workspace-status.ts +99 -0
  89. package/src/plugin-doctor.ts +141 -0
  90. package/src/plugin-lifecycle-state.ts +347 -0
  91. package/src/plugin-lifecycle.ts +223 -0
  92. package/src/profile-layout.ts +97 -0
  93. package/src/profile-owner.ts +52 -0
  94. package/src/profile-repair/backup.ts +119 -0
  95. package/src/profile-repair/findings.ts +43 -0
  96. package/src/profile-repair/index.ts +10 -0
  97. package/src/profile-repair/inspector.ts +156 -0
  98. package/src/profile-repair/repair.ts +137 -0
  99. package/src/profile-resolution/moved-framework.ts +64 -0
  100. package/src/profile-resolution/resolver.ts +876 -0
  101. package/src/profile-resolution/service.ts +99 -0
  102. package/src/prompt-budget.ts +118 -0
  103. package/src/session-bridge.ts +350 -0
  104. package/src/session-log-exporter.ts +68 -0
  105. package/src/system-prompt-capture.ts +99 -0
  106. package/src/web-favicon-data.ts +6 -0
  107. package/src/web-favicon.ts +43 -0
  108. package/src/web-market-install.ts +206 -0
  109. package/src/web-market-plugins.ts +215 -0
  110. package/src/web-port.ts +39 -0
  111. package/tests/account-callback.spec.ts +173 -0
  112. package/tests/acryl-home.spec.ts +39 -0
  113. package/tests/agent-self-hosting.spec.ts +101 -0
  114. package/tests/announce-self.spec.ts +84 -0
  115. package/tests/app-lifecycle.spec.ts +99 -0
  116. package/tests/blank-blueprint.spec.ts +110 -0
  117. package/tests/blueprint-definition.spec.ts +128 -0
  118. package/tests/blueprint.spec.ts +138 -0
  119. package/tests/bulkhead.spec.ts +187 -0
  120. package/tests/coding-vocabulary.spec.ts +15 -0
  121. package/tests/dump-system-prompt.spec.ts +65 -0
  122. package/tests/e2e-real-model.spec.ts +71 -0
  123. package/tests/e2e-restart-real-model.spec.ts +77 -0
  124. package/tests/engine-dsh.spec.ts +340 -0
  125. package/tests/engine-host-mount-root-include.spec.ts +118 -0
  126. package/tests/engine-host.spec.ts +176 -0
  127. package/tests/engine-optional.spec.ts +81 -0
  128. package/tests/extension-examples.spec.ts +261 -0
  129. package/tests/hooks-thread-stack.ts +27 -0
  130. package/tests/instance-patches.spec.ts +25 -0
  131. package/tests/instance.spec.ts +235 -0
  132. package/tests/live/community-plugins.spec.ts +83 -0
  133. package/tests/module-hooks.spec.ts +35 -0
  134. package/tests/module-resolution.spec.ts +265 -0
  135. package/tests/moved-framework.spec.ts +61 -0
  136. package/tests/new-app.spec.ts +132 -0
  137. package/tests/organizer-growth.spec.ts +117 -0
  138. package/tests/pinned-pnpm.spec.ts +34 -0
  139. package/tests/plugin-acryl-workspace-status.spec.ts +63 -0
  140. package/tests/plugin-context.spec.ts +640 -0
  141. package/tests/plugin-doctor.spec.ts +183 -0
  142. package/tests/plugin-enablement-one-store.spec.ts +130 -0
  143. package/tests/plugin-lifecycle-state.spec.ts +169 -0
  144. package/tests/profile-layout.spec.ts +58 -0
  145. package/tests/profile-owner.spec.ts +38 -0
  146. package/tests/profile-repair/profile-repair.spec.ts +231 -0
  147. package/tests/profile-resolution-port.spec.ts +30 -0
  148. package/tests/profile-resolution-service.spec.ts +273 -0
  149. package/tests/profile-resolution-swap.spec.ts +69 -0
  150. package/tests/profile-resolution.spec.ts +2535 -0
  151. package/tests/profile.spec.ts +70 -0
  152. package/tests/project-registry.spec.ts +81 -0
  153. package/tests/prompt-budget.spec.ts +58 -0
  154. package/tests/real-home-guard.spec.ts +178 -0
  155. package/tests/session-bridge.spec.ts +316 -0
  156. package/tests/start-source.spec.ts +65 -0
  157. package/tests/system-prompt-shape.spec.ts +95 -0
  158. package/tests/three-levels.spec.ts +84 -0
  159. package/tests/tool-gateway.spec.ts +116 -0
  160. package/tests/tool-schemas.spec.ts +41 -0
  161. package/tests/web-favicon.spec.ts +42 -0
  162. package/tests/web-port.spec.ts +38 -0
  163. package/tests/web-startup-hold.spec.ts +79 -0
  164. package/tsconfig.json +24 -0
  165. package/tsdown.config.ts +2 -0
  166. package/vitest.config.ts +18 -0
  167. package/README.md +0 -3
package/package.json CHANGED
@@ -1,6 +1,214 @@
1
1
  {
2
2
  "name": "@acryldev/harness-runtime",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.2.11",
4
+ "description": "ACRYL's runtime around the DeepSeek Harness engine: resolves and composes each surface's profile (the harness plus every ACRYL plugin it runs - the composition root), the app instance and its homes, plugin lifecycle and doctor, the pinned pnpm, and the session bridge",
5
+ "private": false,
6
+ "license": "MIT",
7
+ "type": "module",
8
+ "main": "lib/index.mjs",
9
+ "types": "lib/types/index.d.ts",
10
+ "exports": {
11
+ ".": {
12
+ "types": "./lib/types/index.d.ts",
13
+ "default": "./lib/index.mjs"
14
+ }
15
+ },
16
+ "dependencies": {
17
+ "@deepseek-ai/cordis-plugin-group": "1.0.4",
18
+ "@deepseek-ai/cordis-plugin-hmr": "1.0.19",
19
+ "@deepseek-ai/cordis-plugin-include": "1.0.9",
20
+ "@deepseek-ai/cordis-plugin-loader": "1.0.5",
21
+ "@deepseek-ai/cordis-plugin-timer": "1.1.6",
22
+ "@deepseek-ai/dsh": "0.2.0-rc.2",
23
+ "@deepseek-ai/dsh-agent": "0.2.0-rc.2",
24
+ "@deepseek-ai/dsh-agent-default-model": "0.2.0-rc.2",
25
+ "@deepseek-ai/dsh-agent-instructions": "0.2.0-rc.2",
26
+ "@deepseek-ai/dsh-agent-loop": "0.2.0-rc.2",
27
+ "@deepseek-ai/dsh-agent-preset-registry": "0.2.0-rc.2",
28
+ "@deepseek-ai/dsh-anonymous-user-id": "0.2.0-rc.2",
29
+ "@deepseek-ai/dsh-api-gateway": "0.2.0-rc.2",
30
+ "@deepseek-ai/dsh-api-remotes": "0.2.0-rc.2",
31
+ "@deepseek-ai/dsh-app-boot": "0.2.0-rc.2",
32
+ "@deepseek-ai/dsh-atomic-write": "0.2.0-rc.2",
33
+ "@deepseek-ai/dsh-attachment": "0.2.0-rc.2",
34
+ "@deepseek-ai/dsh-attachment-local": "0.2.0-rc.2",
35
+ "@deepseek-ai/dsh-authorization": "0.2.0-rc.2",
36
+ "@deepseek-ai/dsh-base": "0.2.0-rc.2",
37
+ "@deepseek-ai/dsh-bash-local": "0.2.0-rc.2",
38
+ "@deepseek-ai/dsh-bash-sandbox": "0.2.0-rc.2",
39
+ "@deepseek-ai/dsh-brand": "0.2.0-rc.2",
40
+ "@deepseek-ai/dsh-client-connection": "0.2.0-rc.2",
41
+ "@deepseek-ai/dsh-client-locale": "0.2.0-rc.2",
42
+ "@deepseek-ai/dsh-client-modules": "0.2.0-rc.2",
43
+ "@deepseek-ai/dsh-client-ui-attachment": "0.2.0-rc.2",
44
+ "@deepseek-ai/dsh-client-ui-commands": "0.2.0-rc.2",
45
+ "@deepseek-ai/dsh-client-ui-conversation": "0.2.0-rc.2",
46
+ "@deepseek-ai/dsh-client-ui-directory-picker-browse": "0.2.0-rc.2",
47
+ "@deepseek-ai/dsh-client-ui-directory-picker-native": "0.2.0-rc.2",
48
+ "@deepseek-ai/dsh-client-ui-input-trigger": "0.2.0-rc.2",
49
+ "@deepseek-ai/dsh-client-ui-layout": "0.2.0-rc.2",
50
+ "@deepseek-ai/dsh-client-ui-primitives": "0.2.0-rc.2",
51
+ "@deepseek-ai/dsh-client-ui-renderer": "0.2.0-rc.2",
52
+ "@deepseek-ai/dsh-client-ui-settings": "0.2.0-rc.2",
53
+ "@deepseek-ai/dsh-client-ui-sidebar": "0.2.0-rc.2",
54
+ "@deepseek-ai/dsh-client-ui-slots": "0.2.0-rc.2",
55
+ "@deepseek-ai/dsh-client-ui-theme": "0.2.0-rc.2",
56
+ "@deepseek-ai/dsh-client-ui-tool": "0.2.0-rc.2",
57
+ "@deepseek-ai/dsh-client-ui-workspace": "0.2.0-rc.2",
58
+ "@deepseek-ai/dsh-cmdline": "0.2.0-rc.2",
59
+ "@deepseek-ai/dsh-command-compact": "0.2.0-rc.2",
60
+ "@deepseek-ai/dsh-command-feedback": "0.2.0-rc.2",
61
+ "@deepseek-ai/dsh-command-goal": "0.2.0-rc.2",
62
+ "@deepseek-ai/dsh-commands": "0.2.0-rc.2",
63
+ "@deepseek-ai/dsh-compaction": "0.2.0-rc.2",
64
+ "@deepseek-ai/dsh-compaction-basic": "0.2.0-rc.2",
65
+ "@deepseek-ai/dsh-compaction-tool-result-pruner": "0.2.0-rc.2",
66
+ "@deepseek-ai/dsh-cordis-client-runner": "0.2.0-rc.2",
67
+ "@deepseek-ai/dsh-cordis-host-runner": "0.2.0-rc.2",
68
+ "@deepseek-ai/dsh-credentials": "0.2.0-rc.2",
69
+ "@deepseek-ai/dsh-credentials-local": "0.2.0-rc.2",
70
+ "@deepseek-ai/dsh-file-reference": "0.2.0-rc.2",
71
+ "@deepseek-ai/dsh-fs": "0.2.0-rc.2",
72
+ "@deepseek-ai/dsh-fs-local": "0.2.0-rc.2",
73
+ "@deepseek-ai/dsh-fs-observation-policy": "0.2.0-rc.2",
74
+ "@deepseek-ai/dsh-fs-sandbox": "0.2.0-rc.2",
75
+ "@deepseek-ai/dsh-goal": "0.2.0-rc.2",
76
+ "@deepseek-ai/dsh-goal-round-driver": "0.2.0-rc.2",
77
+ "@deepseek-ai/dsh-home-paths": "0.2.0-rc.2",
78
+ "@deepseek-ai/dsh-host-directory-picker-browse": "0.2.0-rc.2",
79
+ "@deepseek-ai/dsh-host-directory-picker-native": "0.2.0-rc.2",
80
+ "@deepseek-ai/dsh-host-plugin-inventory": "0.2.0-rc.2",
81
+ "@deepseek-ai/dsh-host-webserver": "0.2.0-rc.2",
82
+ "@deepseek-ai/dsh-invariants": "0.2.0-rc.2",
83
+ "@deepseek-ai/dsh-jobs": "0.2.0-rc.2",
84
+ "@deepseek-ai/dsh-jobs-local": "0.2.0-rc.2",
85
+ "@deepseek-ai/dsh-launch-environment": "0.2.0-rc.2",
86
+ "@deepseek-ai/dsh-llm": "0.2.0-rc.2",
87
+ "@deepseek-ai/dsh-llm-deepseek": "0.2.0-rc.2",
88
+ "@deepseek-ai/dsh-llm-pi-ai": "0.2.0-rc.2",
89
+ "@deepseek-ai/dsh-llm-retry": "0.2.0-rc.2",
90
+ "@deepseek-ai/dsh-message-feedback": "0.2.0-rc.2",
91
+ "@deepseek-ai/dsh-output-retention": "0.2.0-rc.2",
92
+ "@deepseek-ai/dsh-permission-presets": "0.2.0-rc.2",
93
+ "@deepseek-ai/dsh-plan-mode": "0.2.0-rc.2",
94
+ "@deepseek-ai/dsh-ptc-runtime": "0.2.0-rc.2",
95
+ "@deepseek-ai/dsh-pwsh-local": "0.2.0-rc.2",
96
+ "@deepseek-ai/dsh-pwsh-sandbox": "0.2.0-rc.2",
97
+ "@deepseek-ai/dsh-repeat-tool-reminder": "0.2.0-rc.2",
98
+ "@deepseek-ai/dsh-sandbox": "0.2.0-rc.2",
99
+ "@deepseek-ai/dsh-sandbox-local": "0.2.0-rc.2",
100
+ "@deepseek-ai/dsh-sandbox-policy": "0.2.0-rc.2",
101
+ "@deepseek-ai/dsh-sandbox-windows-acl": "0.2.0-rc.2",
102
+ "@deepseek-ai/dsh-scope": "0.2.0-rc.2",
103
+ "@deepseek-ai/dsh-session": "0.2.0-rc.2",
104
+ "@deepseek-ai/dsh-session-checkpoint-policy": "0.2.0-rc.2",
105
+ "@deepseek-ai/dsh-session-persistence": "0.2.0-rc.2",
106
+ "@deepseek-ai/dsh-session-persistence-jsonl": "0.2.0-rc.2",
107
+ "@deepseek-ai/dsh-session-projection": "0.2.0-rc.2",
108
+ "@deepseek-ai/dsh-session-query": "0.2.0-rc.2",
109
+ "@deepseek-ai/dsh-session-query-sqlite": "0.2.0-rc.2",
110
+ "@deepseek-ai/dsh-session-reference": "0.2.0-rc.2",
111
+ "@deepseek-ai/dsh-session-stats": "0.2.0-rc.2",
112
+ "@deepseek-ai/dsh-session-telemetry": "0.2.0-rc.2",
113
+ "@deepseek-ai/dsh-session-telemetry-otel": "0.2.0-rc.2",
114
+ "@deepseek-ai/dsh-session-title": "0.2.0-rc.2",
115
+ "@deepseek-ai/dsh-session-title-first-prompt-llm": "0.2.0-rc.2",
116
+ "@deepseek-ai/dsh-session-title-llm": "0.2.0-rc.2",
117
+ "@deepseek-ai/dsh-settings": "0.2.0-rc.2",
118
+ "@deepseek-ai/dsh-shell": "0.2.0-rc.2",
119
+ "@deepseek-ai/dsh-shell-env": "0.2.0-rc.2",
120
+ "@deepseek-ai/dsh-skill": "0.2.0-rc.2",
121
+ "@deepseek-ai/dsh-skill-badge": "0.2.0-rc.2",
122
+ "@deepseek-ai/dsh-skill-filesystem": "0.2.0-rc.2",
123
+ "@deepseek-ai/dsh-spill": "0.2.0-rc.2",
124
+ "@deepseek-ai/dsh-spill-local": "0.2.0-rc.2",
125
+ "@deepseek-ai/dsh-spill-policy": "0.2.0-rc.2",
126
+ "@deepseek-ai/dsh-storage": "0.2.0-rc.2",
127
+ "@deepseek-ai/dsh-storage-domain": "0.2.0-rc.2",
128
+ "@deepseek-ai/dsh-subagent": "0.2.0-rc.2",
129
+ "@deepseek-ai/dsh-subagent-fork-in-process": "0.2.0-rc.2",
130
+ "@deepseek-ai/dsh-subagent-in-process-driver": "0.2.0-rc.2",
131
+ "@deepseek-ai/dsh-subagent-spawn-in-process": "0.2.0-rc.2",
132
+ "@deepseek-ai/dsh-subprocess": "0.2.0-rc.2",
133
+ "@deepseek-ai/dsh-subprocess-local": "0.2.0-rc.2",
134
+ "@deepseek-ai/dsh-system-prompt": "0.2.0-rc.2",
135
+ "@deepseek-ai/dsh-terminal": "0.2.0-rc.2",
136
+ "@deepseek-ai/dsh-timeout": "0.2.0-rc.2",
137
+ "@deepseek-ai/dsh-token-meter": "0.2.0-rc.2",
138
+ "@deepseek-ai/dsh-tool-bash": "0.2.0-rc.2",
139
+ "@deepseek-ai/dsh-tool-call-timeout-policy": "0.2.0-rc.2",
140
+ "@deepseek-ai/dsh-tool-fs": "0.2.0-rc.2",
141
+ "@deepseek-ai/dsh-tool-fs-search": "0.2.0-rc.2",
142
+ "@deepseek-ai/dsh-tool-goal": "0.2.0-rc.2",
143
+ "@deepseek-ai/dsh-tool-jobs": "0.2.0-rc.2",
144
+ "@deepseek-ai/dsh-tool-pwsh": "0.2.0-rc.2",
145
+ "@deepseek-ai/dsh-tool-ralph": "0.2.0-rc.2",
146
+ "@deepseek-ai/dsh-tool-skill": "0.2.0-rc.2",
147
+ "@deepseek-ai/dsh-tool-str-replace-editor": "0.2.0-rc.2",
148
+ "@deepseek-ai/dsh-tool-subagent": "0.2.0-rc.2",
149
+ "@deepseek-ai/dsh-tool-subagent-control": "0.2.0-rc.2",
150
+ "@deepseek-ai/dsh-tool-todo": "0.2.0-rc.2",
151
+ "@deepseek-ai/dsh-tool-web": "0.2.0-rc.2",
152
+ "@deepseek-ai/dsh-tool-workflow": "0.2.0-rc.2",
153
+ "@deepseek-ai/dsh-tools": "0.2.0-rc.2",
154
+ "@deepseek-ai/dsh-typert-loader": "0.2.0-rc.2",
155
+ "@deepseek-ai/dsh-typert-protocol": "0.2.0-rc.2",
156
+ "@deepseek-ai/dsh-typert-registry": "0.2.0-rc.2",
157
+ "@deepseek-ai/dsh-user-approval": "0.2.0-rc.2",
158
+ "@deepseek-ai/dsh-user-questions": "0.2.0-rc.2",
159
+ "@deepseek-ai/dsh-web": "0.2.0-rc.2",
160
+ "@deepseek-ai/dsh-web-app": "0.2.0-rc.2",
161
+ "@deepseek-ai/dsh-web-search-deepseek": "0.2.0-rc.2",
162
+ "@deepseek-ai/dsh-workflow": "0.2.0-rc.2",
163
+ "@deepseek-ai/dsh-workflow-ptc": "0.2.0-rc.2",
164
+ "@deepseek-ai/schemastery": "~3.18.4",
165
+ "@acryldev/blends-core": "0.6.0",
166
+ "@acryldev/plugin-hub-core": "0.2.2",
167
+ "@acryldev/control": "0.3.0",
168
+ "@acryldev/web": "0.3.0",
169
+ "@acryldev/blends": "^1.7.1",
170
+ "adm-zip": "^0.6.1",
171
+ "koffi": "3.1.5",
172
+ "pnpm": "11.11.0",
173
+ "react": "18.3.1",
174
+ "resolve.exports": "^2.0.3",
175
+ "semver": "^7.8.5",
176
+ "yaml": "^2.9.0"
177
+ },
178
+ "devDependencies": {
179
+ "@deepseek-ai/cordis": "4.0.4",
180
+ "@types/js-yaml": "^4.0.9",
181
+ "@types/node": "^22.20.0",
182
+ "@types/semver": "^7.7.1",
183
+ "tsdown": "0.22.2",
184
+ "typescript": "6.0.3",
185
+ "vitest": "4.1.11",
186
+ "@acryldev/coding-capabilities": "0.1.0",
187
+ "@acryldev/sign-in": "0.2.0",
188
+ "@acryldev/plugin-admin": "0.2.0",
189
+ "@acryldev/workspace": "0.2.0",
190
+ "@acryldev/plugin-context": "0.1.0"
191
+ },
192
+ "peerDependencies": {
193
+ "@deepseek-ai/cordis": "4.0.4"
194
+ },
195
+ "publishConfig": {
196
+ "access": "public"
197
+ },
198
+ "repository": {
199
+ "type": "git",
200
+ "url": "git+https://github.com/acryldev/acryl.git",
201
+ "directory": "runtime/harness-runtime"
202
+ },
203
+ "homepage": "https://github.com/acryldev/acryl/tree/main/runtime/harness-runtime#readme",
204
+ "bugs": {
205
+ "url": "https://github.com/acryldev/acryl/issues"
206
+ },
207
+ "scripts": {
208
+ "build": "tsdown && tsc -p tsconfig.json --emitDeclarationOnly",
209
+ "typecheck": "pnpm --filter @acryldev/blends-core run build && tsc -p tsconfig.json --noEmit",
210
+ "test": "pnpm --filter @acryldev/blends-core run build && vitest run",
211
+ "deps": "pnpm --filter \"@acryldev/harness-runtime^...\" run build",
212
+ "check": "pnpm run deps && pnpm run build && tsc -p tsconfig.json --noEmit && vitest run"
213
+ }
6
214
  }
@@ -0,0 +1,103 @@
1
+ /**
2
+ * ACRYL's own data root, nested one level above the DSH engine home it
3
+ * composes.
4
+ *
5
+ * The stock DSH Desktop app (from dshdesktop.com) uses plain `~/.dsh`, and so
6
+ * did every ACRYL surface until now — sharing that root made the two
7
+ * genuinely different products silently share credentials/settings/sessions,
8
+ * which is both confusing and useless for comparing ACRYL against a stock
9
+ * DSH Desktop install side by side. ACRYL now owns `~/.acryl` and nests each
10
+ * engine's artifacts under it by engine name:
11
+ *
12
+ * ```txt
13
+ * ~/.acryl/ ACRYL's own root — everything not engine-specific
14
+ * ~/.acryl/.dsh/ the DSH engine home (what DSH_HOME resolves to)
15
+ * ~/.acryl/.pi/ reserved for a future pi.dev engine
16
+ * ```
17
+ *
18
+ * `$ACRYL_HOME`, if a caller has set it, is authoritative: it is the
19
+ * product-level root, so the DSH engine home becomes `<ACRYL_HOME>/.dsh`
20
+ * regardless of any ambient `$DSH_HOME`. That is what makes
21
+ * `ACRYL_HOME=/tmp/x acryl ...` a complete isolation switch. When
22
+ * `$ACRYL_HOME` is unset, an explicit `$DSH_HOME` is still honored, and with
23
+ * neither set the default is `<~/.acryl>/.dsh` rather than the harness's own
24
+ * bare `~/.dsh`.
25
+ *
26
+ * @module @acryldev/harness-runtime/acryl-home
27
+ */
28
+
29
+ import { developmentInstance, instanceEnvironment, osHomeDirectory, selectInstance } from './instance/index.ts'
30
+
31
+ /** ACRYL's own root directory name under the OS home. */
32
+ export const ACRYL_HOME_DIR_NAME = '.acryl'
33
+
34
+ /** The DSH engine's directory name, nested under ACRYL's root. */
35
+ export const ACRYL_DSH_ENGINE_DIR_NAME = '.dsh'
36
+
37
+
38
+ /** ACRYL's own root — `~/.acryl` unless `$ACRYL_HOME` overrides it. */
39
+ export function resolveAcrylHome(env: Record<string, string | undefined> = process.env): string {
40
+ // Delegates to the one selector (instance/select.ts). A legacy DSH_HOME now also moves the ACRYL home (its parent when it is named `.dsh`), so state that
41
+ // lives beside the engine home (the pinned pnpm shim, global extensions) is isolated with it instead of landing in the shared ~/.acryl.
42
+ return selectInstance({ env }).home
43
+ }
44
+
45
+ /**
46
+ * The DSH engine home ACRYL boots against. Precedence, highest first:
47
+ *
48
+ * 1. `$ACRYL_HOME` set -> `<acrylHome>/.dsh`. ACRYL is the product that owns
49
+ * the root and engines nest inside it, so pinning ACRYL's root is a
50
+ * **complete** isolation switch.
51
+ * 2. `$DSH_HOME` set (and `$ACRYL_HOME` unset) -> that value, for callers
52
+ * pointing ACRYL at an existing DSH home.
53
+ * 3. Neither -> `<~/.acryl>/.dsh`, never the harness's own bare `~/.dsh`.
54
+ *
55
+ * An ambient `$DSH_HOME` must NOT outrank an explicit `$ACRYL_HOME`. That
56
+ * ordering used to invert these, which made isolation silently unenforceable:
57
+ * `DSH_HOME` is commonly exported in a developer shell (and set by the DSH
58
+ * Desktop app), so `ACRYL_HOME=/tmp/x` would read and write the operator's
59
+ * real `~/.dsh` unchanged - credentials, sessions and all. A cold-start or
60
+ * clean-room test written that way passes while never being isolated.
61
+ */
62
+ export function resolveAcrylDshHome(env: Record<string, string | undefined> = process.env): string {
63
+ return selectInstance({ env }).dshHome
64
+ }
65
+
66
+ /**
67
+ * The isolated local-dev DSH home (`~/.acryl-dev/.dsh`) — a third root,
68
+ * deliberately sibling to (not nested inside) both `resolveAcrylDshHome`'s
69
+ * packaged-install default (`~/.acryl/.dsh`) and the stock DSH Desktop's
70
+ * plain `~/.dsh`, so a dev run never collides with either.
71
+ *
72
+ * `scripts/dev-local.mjs` at the repo root is this value's one canonical,
73
+ * hand-written definition (it runs before any workspace package builds, so
74
+ * it cannot import this module) and is what actually sets `$DSH_HOME` for
75
+ * `pnpm run dev`. Every *other* desktop dev-mode entry point - `apps/
76
+ * acryl-desktop/scripts/launch-dev.mjs`, `verify-loader-boot.mjs`,
77
+ * `verify-profile-boot.mjs` - runs strictly after that package already
78
+ * built, so they import this exported copy instead of re-deriving it, and
79
+ * default `$DSH_HOME` to it when unset. That is what makes running the
80
+ * desktop package's own script directly (`pnpm --filter acryl-desktop run
81
+ * dev`, bypassing the root orchestrator) resolve the identical isolated
82
+ * home rather than silently falling back to `resolveAcrylDshHome`'s
83
+ * packaged-install default - a real, reproduced footgun (2026-09-14) that
84
+ * this function exists to close for good.
85
+ */
86
+ export const ACRYL_DEV_HOME_DIR_NAME = '.acryl-dev'
87
+
88
+ /** The isolated local-dev DSH home - see {@link ACRYL_DEV_HOME_DIR_NAME}'s doc comment. */
89
+ export function resolveAcrylDevDshHome(): string {
90
+ return developmentInstance(osHomeDirectory()).dshHome
91
+ }
92
+
93
+ /**
94
+ * Default `$DSH_HOME` (in-place, on the given env) to the isolated
95
+ * local-dev home when neither `$ACRYL_HOME` nor `$DSH_HOME` is already set.
96
+ * Call this once, at the very top of a desktop dev-mode script, before
97
+ * anything else reads the environment.
98
+ */
99
+ export function applyIsolatedDevHomeDefault(env: Record<string, string | undefined> = process.env): void {
100
+ // Nothing chosen yet (the default instance): become the isolated development app, the same family `scripts/dev-local.mjs` launches.
101
+ if (selectInstance({ env }).kind !== 'default') return
102
+ Object.assign(env, instanceEnvironment(developmentInstance(osHomeDirectory())))
103
+ }
@@ -0,0 +1,239 @@
1
+ /**
2
+ * `acryl new <dir>`: create an ACRYL Blends app, the way `rails new` creates a Rails app. Convention over configuration: every app has the same shape, so
3
+ * the builder inside it (the agent) and every tool know where everything is without being told.
4
+ *
5
+ * <app>/blend.yaml what the app is: a Blends manifest (name, brand, the Blueprint it grew from) commit
6
+ * <app>/plugins/ the app's own plugins; the agent inside builds them here; they load at every start commit (not plugins/.store/)
7
+ * <app>/AGENTS.md the conventions, read by the agent inside at the start of every session commit
8
+ * <app>/bin/acryl start it: bin/acryl web | desktop | cli
9
+ * <app>/.dsh/ what the runtime keeps (sessions, settings, profile) ignored
10
+ * <app>/desktop-data/ the desktop window's own data (window state, storage, logs, crash evidence) ignored
11
+ *
12
+ * The app folder is the app's ACRYL home, so an app is self-contained like a container: it can be copied, committed, run beside any other app and deleted
13
+ * without touching anything else. It is the user's project from the first second: nothing in it is ACRYL-branded, it gets its own git repository, and its
14
+ * license is the user's choice (closed source and commercial included; the framework and the harness it uses are MIT). Pure file planning plus one write boundary.
15
+ *
16
+ * @module @acryldev/harness-runtime/app/new-app
17
+ */
18
+
19
+ import { spawnSync } from 'node:child_process'
20
+ import { chmodSync, cpSync, existsSync, mkdirSync, readdirSync, writeFileSync } from 'node:fs'
21
+ import { basename, dirname, join, resolve } from 'node:path'
22
+ import { manifestDigest } from '@acryldev/blends-core'
23
+ import { HOME_PLUGINS_FOLDER, STORE_FOLDER } from '@acryldev/plugin-hub-core'
24
+ import { isMap, isSeq, parseDocument, stringify } from 'yaml'
25
+ import { brandIdentity, type BrandIdentity } from '../blueprint/brand-identity.ts'
26
+ import { builtInCatalog, type Blueprint } from '../blueprint/blueprint.ts'
27
+ import { appManifest } from '../blueprint/manifest.ts'
28
+
29
+ export const APP_MANIFEST_FILE = 'blend.yaml'
30
+ export const APP_PLUGINS_DIR = HOME_PLUGINS_FOLDER
31
+
32
+ const APP_NAME = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/u
33
+
34
+ export class NewAppError extends Error {
35
+ constructor(message: string) {
36
+ super(message)
37
+ this.name = 'NewAppError'
38
+ }
39
+ }
40
+
41
+ export interface NewAppOptions {
42
+ /** Display name; defaults to the folder name. */
43
+ readonly title?: string
44
+ /** Blueprint the app grows from; `acryl.blank` by default. */
45
+ readonly blueprint?: string
46
+ readonly brand?: Partial<Omit<BrandIdentity, 'name'>>
47
+ /** Absolute path of the launcher `bin/acryl` hands off to (the framework's `scripts/blank.mjs`). */
48
+ readonly launcher: string
49
+ /**
50
+ * Create the app from an existing app or captured Blend (its `blend.yaml`, and its `blend.lock.json` when it has one) instead of a Blueprint: the new
51
+ * app keeps what the source grew (rows, brand, lineage) under its own name and id. Its `plugins/` are copied by `writeNewApp`.
52
+ */
53
+ readonly from?: { readonly manifestText: string, readonly lockText?: string }
54
+ }
55
+
56
+ export interface PlannedApp {
57
+ readonly root: string
58
+ readonly name: string
59
+ readonly blueprint: Blueprint
60
+ readonly files: Readonly<Record<string, string>>
61
+ }
62
+
63
+ /** Pure: everything `acryl new` would write, by relative path. */
64
+ export function planNewApp(dir: string, options: NewAppOptions): PlannedApp {
65
+ const root = resolve(dir)
66
+ const name = basename(root)
67
+ if (!APP_NAME.test(name) || name.length > 32) throw new NewAppError(`an app folder name is lowercase letters, digits and dashes (at most 32), got ${JSON.stringify(name)}`)
68
+ const blueprintId = options.blueprint ?? 'acryl.blank'
69
+ const blueprint = builtInCatalog().get(blueprintId)
70
+ if (blueprint === undefined) throw new NewAppError(`unknown blueprint ${JSON.stringify(blueprintId)}; known: ${builtInCatalog().list().map(entry => entry.id).join(', ')}`)
71
+ const title = options.title?.trim() || name
72
+ const brand = brandIdentity({ ...(blueprint.brand.kind === 'custom' ? blueprint.brand.identity : {}), ...options.brand, name: title })
73
+ const derived = options.from === undefined ? undefined : fromExistingApp(options.from, `app.${name}`, title, options.brand)
74
+ const manifestText = derived?.manifestText
75
+ ?? `# ${title}: what this app is (name, brand, what it grew from). Edit it and restart. Format: blends.acryl.dev/v1alpha1.\n${stringify(appManifest({ id: `app.${name}`, name: title, blueprint, brand }), { lineWidth: 0 })}`
76
+ const files: Record<string, string> = {
77
+ [APP_MANIFEST_FILE]: manifestText,
78
+ ...(derived?.lockText === undefined ? {} : { 'blend.lock.json': derived.lockText }),
79
+ ...(derived?.starter === undefined ? {} : { [`blueprints/${derived.starter.id}.yaml`]: derived.starter.text }),
80
+ ...(derived?.notice === undefined ? {} : { 'THIRD-PARTY.md': derived.notice }),
81
+ [`${APP_PLUGINS_DIR}/README.md`]: `# plugins\n\nThis app's own plugins, one folder each. The agent inside the app builds them here when you ask for something\n("add a to-do list"), and every folder here loads when the app starts. Delete a folder to remove that plugin.\n`,
82
+ 'AGENTS.md': agentsMd(title),
83
+ 'bin/acryl': `#!/usr/bin/env bash\n# Start ${title}: bin/acryl web | desktop | cli (flags: --port 3105)\nset -euo pipefail\napp="$(cd "$(dirname "$0")/.." && pwd)"\nexec node ${JSON.stringify(options.launcher)} "\${1:-web}" --dir "$app" "\${@:2}"\n`,
84
+ // The plugin store (`plugins/.store/`) is runtime data like `.dsh/`: pulled plugins are reproduced from the Blend's lock; the app's own plugins beside it are committed.
85
+ '.gitignore': `# what the runtime keeps for this app\n.dsh/\ninstance.json\ndesktop-data/\n${APP_PLUGINS_DIR}/${STORE_FOLDER}/\n`,
86
+ '.github/workflows/app.yml': appWorkflow(title),
87
+ 'README.md': `# ${title}
88
+
89
+ \`\`\`bash
90
+ bin/acryl web # or desktop, cli
91
+ \`\`\`
92
+
93
+ Tell the assistant inside what to build; it adds plugins to \`plugins/\` while the app runs. \`blend.yaml\` is the app's definition (name, brand,
94
+ what it grew from). Runtime data stays in \`.dsh/\` and is not committed. The app has its own port and its own window, so it runs beside any other.
95
+
96
+ ## License
97
+
98
+ This project is yours: license it however you want, including closed source. It runs on the ACRYL Blends framework and DeepSeek Harness, both MIT
99
+ licensed; if you distribute a copy of the framework (for example a carried \`runtime/\`), keep their license notices with it.
100
+ `,
101
+ }
102
+ return { root, name, blueprint, files }
103
+ }
104
+
105
+ /**
106
+ * A new project from an existing starter or project (the three levels: the blank canvas, a Blueprint starter kit, a project). The source's rows, brand
107
+ * colors and plugins are kept; the identity becomes the new project's, which is the user's own work: private and Proprietary until they say otherwise.
108
+ *
109
+ * from a starter (kind: Blueprint, spec.extends) -> a Blend whose lineage names the starter; the starter is kept in blueprints/<id>.yaml
110
+ * from a project (kind: Blend, spec.lineage) -> a Blend with the same lineage; the source's blueprints/ travel with it
111
+ *
112
+ * Comments are kept, and the lock is re-pinned to the new definition with the format's digest (local module digests stay valid: plugins/ is copied as is).
113
+ */
114
+ function fromExistingApp(source: { readonly manifestText: string, readonly lockText?: string }, id: string, title: string, brand: Partial<Omit<BrandIdentity, 'name'>> | undefined): { manifestText: string, lockText?: string, starter?: { id: string, text: string }, notice?: string } {
115
+ const document = parseDocument(source.manifestText)
116
+ const parsed = document.toJS() as { kind?: unknown, metadata?: { id?: unknown, version?: unknown, license?: unknown, name?: unknown }, spec?: { lineage?: { blueprint?: unknown }, extends?: unknown } } | null
117
+ const sourceId = typeof parsed?.metadata?.id === 'string' ? parsed.metadata.id : undefined
118
+ const sourceVersion = typeof parsed?.metadata?.version === 'string' ? parsed.metadata.version : '0.1.0'
119
+ let starter: { id: string, text: string } | undefined
120
+ if (parsed?.kind === 'Blueprint' && sourceId !== undefined && builtInCatalog().get(sourceId) === undefined) {
121
+ if (typeof parsed.spec?.extends !== 'string') throw new NewAppError(`the starter ${sourceId} names no parent (spec.extends)`)
122
+ starter = { id: sourceId, text: source.manifestText }
123
+ document.set('kind', 'Blend')
124
+ document.deleteIn(['spec', 'extends'])
125
+ document.setIn(['spec', 'lineage'], document.createNode({ blueprint: sourceId, blueprintVersion: sourceVersion }))
126
+ } else if (parsed?.kind !== 'Blend' || typeof parsed.spec?.lineage?.blueprint !== 'string') {
127
+ throw new NewAppError('--from needs a starter (kind: Blueprint with spec.extends) or a project (kind: Blend with spec.lineage)')
128
+ }
129
+ document.setIn(['metadata', 'id'], id)
130
+ document.setIn(['metadata', 'name'], title)
131
+ document.setIn(['metadata', 'description'], `${title}, created from ${sourceId ?? 'another app'}.`)
132
+ document.setIn(['metadata', 'license'], 'Proprietary')
133
+ document.setIn(['metadata', 'visibility'], 'private')
134
+ const rows = document.getIn(['spec', 'rows'])
135
+ if (isSeq(rows)) {
136
+ for (const row of rows.items) {
137
+ if (isMap(row) && row.get('name') === '@acryldev/brand') {
138
+ row.setIn(['config', 'name'], title)
139
+ for (const [key, value] of Object.entries(brand ?? {})) if (value !== undefined) row.setIn(['config', key], value)
140
+ }
141
+ }
142
+ }
143
+ // The source's comments are kept; the header names the app it describes, so it takes the new app's name. Before the lock digests the text.
144
+ const manifestText = String(document).replace(/^# .*?: what this app is/u, `# ${title}: what this app is`)
145
+ const sourceLicense = typeof parsed.metadata?.license === 'string' ? parsed.metadata.license : undefined
146
+ // The source's code (its plugins) keeps its own license: its notice travels with the copy.
147
+ const notice = sourceLicense === undefined || sourceLicense === 'Proprietary' ? undefined
148
+ : `# Third-party code\n\nThis project was created from ${sourceId ?? 'another app'}${typeof parsed.metadata?.name === 'string' ? ` (${parsed.metadata.name})` : ''}, licensed ${sourceLicense}. Code copied from it into\nplugins/ remains under that license; keep this notice, and the source's license text where it requires one, with any copy you distribute.\n`
149
+ const extra = { ...(starter === undefined ? {} : { starter }), ...(notice === undefined ? {} : { notice }) }
150
+ if (source.lockText === undefined) return { manifestText, ...extra }
151
+ const lock = JSON.parse(source.lockText) as { origin?: Record<string, unknown> }
152
+ lock.origin = { ...lock.origin, id, kind: 'Blend', digest: manifestDigest(manifestText) }
153
+ return { manifestText, lockText: `${JSON.stringify(lock, null, 2)}\n`, ...extra }
154
+ }
155
+
156
+ /**
157
+ * CI from the first commit (spec 036, T019): on every push and pull request the app definition must validate the way the engine and the registry validate it,
158
+ * and no tracked file may hold a secret (the same check \`acryl save\` runs, so a key committed outside ACRYL is caught too). Pinned to the published tools.
159
+ */
160
+ function appWorkflow(title: string): string {
161
+ return `name: ${JSON.stringify(title)}
162
+
163
+ on:
164
+ push:
165
+ pull_request:
166
+
167
+ permissions:
168
+ contents: read
169
+
170
+ jobs:
171
+ check:
172
+ runs-on: ubuntu-latest
173
+ steps:
174
+ - uses: actions/checkout@v4
175
+ - uses: actions/setup-node@v4
176
+ with:
177
+ node-version: 24
178
+ - name: The app definition is valid
179
+ run: npx --yes --package @acryldev/blends-core@0.1 blends-validate blend.yaml
180
+ - name: No secrets in the repository
181
+ run: npx --yes --package @acryldev/app-persistence@0.1 acryl-secret-check .
182
+ `
183
+ }
184
+
185
+ function agentsMd(title: string): string {
186
+ return `# ${title}: conventions for the builder inside
187
+
188
+ You are the builder inside ${title}. The user asks for what they want; you build it here, as plugins, while the app runs. The project and its git repository
189
+ belong to the user: commit with clear messages when a change works and the user agrees, never push unless asked.
190
+
191
+ - **Where things go.** Every capability you add is one plugin in \`plugins/<name>/\` of this app (the app's own folder, which is its ACRYL home). Install it with
192
+ \`acryl_install_plugin\` using its absolute path; it goes live without a restart and loads at every start. Never put the app's plugins anywhere else.
193
+ - **What the app is.** \`blend.yaml\` is the app's definition (name, brand, the Blueprint it grew from). Change the brand there when the user asks to rename or restyle the app.
194
+ - **Data.** A plugin keeps its data in the app folder (\`data/<plugin>.json\`) or in the project the user opens, never inside its own code folder.
195
+ - **Capture.** \`/blend snapshot\` records what the app has become so it can be re-created; publishing is the user's decision.
196
+ - **How.** Your ACRYL plugin docs (in your system prompt) have a routed doc and a verified example for every kind of plugin; read the nearest one before writing.
197
+ `
198
+ }
199
+
200
+ /** Write the app. The folder must not exist or must be empty: `new` never overwrites. `runtimeDir` hands the app its own Web runtime (see below). */
201
+ /** A file of the launcher an app carries: copied from the framework, or written with the given content. */
202
+ export type LauncherFile = { readonly from: string } | { readonly content: string }
203
+
204
+ export function writeNewApp(planned: PlannedApp, options: { readonly runtimeDir?: string, readonly launcherFiles?: Readonly<Record<string, LauncherFile>>, readonly git?: boolean, readonly pluginsFrom?: string, readonly blueprintsFrom?: string } = {}): { readonly git: 'initialized' | 'skipped' | 'unavailable' } {
205
+ if (existsSync(planned.root) && readdirSync(planned.root).length > 0) throw new NewAppError(`${planned.root} is not empty; acryl new only creates a new app`)
206
+ if (options.runtimeDir !== undefined && !existsSync(join(options.runtimeDir, 'lib', 'bin.js'))) throw new NewAppError(`${options.runtimeDir} is not an ACRYL Web runtime (no lib/bin.js)`)
207
+ for (const [relative, content] of Object.entries(planned.files)) {
208
+ const target = join(planned.root, relative)
209
+ mkdirSync(dirname(target), { recursive: true })
210
+ writeFileSync(target, content)
211
+ }
212
+ chmodSync(join(planned.root, 'bin', 'acryl'), 0o755)
213
+ // An app created from another brings that app's own plugins, verbatim so the lock's digests still hold (never its node_modules or git history).
214
+ // The starters the source itself grew from travel with it, so the whole chain back to a built-in Blueprint resolves in the new app.
215
+ if (options.blueprintsFrom !== undefined && existsSync(options.blueprintsFrom)) {
216
+ cpSync(options.blueprintsFrom, join(planned.root, 'blueprints'), { recursive: true, force: false, errorOnExist: false })
217
+ }
218
+ if (options.pluginsFrom !== undefined && existsSync(options.pluginsFrom)) {
219
+ // The source app's own plugins, not its store: pulled plugins are runtime data, reproduced from the lock.
220
+ cpSync(options.pluginsFrom, join(planned.root, APP_PLUGINS_DIR), { recursive: true, filter: source => !['node_modules', '.git', STORE_FOLDER].includes(basename(source)) })
221
+ }
222
+ if (options.runtimeDir !== undefined) {
223
+ // The app carries its own runtime: it then starts with nothing of the framework but Node. Symlinks stay relative to the copy.
224
+ cpSync(options.runtimeDir, join(planned.root, 'runtime'), { recursive: true, verbatimSymlinks: true })
225
+ for (const [relative, file] of Object.entries(options.launcherFiles ?? {})) {
226
+ const target = join(planned.root, '.app', relative)
227
+ mkdirSync(dirname(target), { recursive: true })
228
+ if ('from' in file) cpSync(file.from, target)
229
+ else writeFileSync(target, file.content)
230
+ }
231
+ writeFileSync(join(planned.root, 'bin', 'acryl'), `#!/usr/bin/env bash\n# Start this app: bin/acryl web\nset -euo pipefail\napp="$(cd "$(dirname "$0")/.." && pwd)"\nexec node "$app/.app/launch.mjs" "\${1:-web}" --dir "$app" "\${@:2}"\n`)
232
+ chmodSync(join(planned.root, 'bin', 'acryl'), 0o755)
233
+ }
234
+ // Like `rails new`: the app starts as its own repository (no commit is made for the user). The carried runtime is large and rebuildable, so it is not tracked.
235
+ if (options.git === false) return { git: 'skipped' }
236
+ if (options.runtimeDir !== undefined) writeFileSync(join(planned.root, '.gitignore'), `${planned.files['.gitignore'] ?? ''}runtime/\n`)
237
+ const init = spawnSync('git', ['init', '--quiet', planned.root], { stdio: 'ignore' })
238
+ return { git: init.status === 0 ? 'initialized' : 'unavailable' }
239
+ }