@sous-io/sous 0.1.1 → 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 (205) hide show
  1. package/README.md +115 -35
  2. package/bin/run.js +10 -1
  3. package/docs/markdown/README.md +27 -0
  4. package/docs/markdown/_sidebar.md +18 -0
  5. package/docs/markdown/commands.md +308 -0
  6. package/docs/markdown/config-discovery.md +74 -0
  7. package/docs/markdown/config-inspection.md +69 -0
  8. package/docs/markdown/config-layers.md +92 -0
  9. package/docs/markdown/config-variables.md +79 -0
  10. package/docs/markdown/configuration.md +71 -0
  11. package/docs/markdown/design-principles.md +59 -0
  12. package/docs/markdown/repositories-authoring.md +408 -0
  13. package/docs/markdown/repositories-consuming.md +580 -0
  14. package/docs/markdown/repositories-file-formats.md +1084 -0
  15. package/docs/markdown/repositories-variables.md +387 -0
  16. package/docs/markdown/repositories.md +303 -0
  17. package/docs/markdown/skill-categories.md +58 -0
  18. package/package.json +72 -8
  19. package/{shared-prompts/skills/sous-skills → recipes/core/sous-skills/skills}/about-agent-skills/SKILL.tpl.md +20 -20
  20. package/{shared-prompts/skills/sous-skills → recipes/core/sous-skills/skills}/about-agent-skills/examples/about-something.md +2 -2
  21. package/{shared-prompts/skills/sous-skills → recipes/core/sous-skills/skills}/about-agent-skills/examples/do-something.md +1 -1
  22. package/{shared-prompts/skills/sous-skills → recipes/core/sous-skills/skills}/about-agent-skills/references/advanced-patterns.md +6 -6
  23. package/{shared-prompts/skills/sous-skills → recipes/core/sous-skills/skills}/about-agent-skills/references/commands.md +5 -5
  24. package/{shared-prompts/skills/sous-skills → recipes/core/sous-skills/skills}/about-agent-skills/references/frontmatter.md +3 -3
  25. package/{shared-prompts/skills/sous-skills → recipes/core/sous-skills/skills}/about-liquid-templates/SKILL.tpl.md +40 -25
  26. package/recipes/core/sous-skills/skills/about-sous/SKILL.tpl.md +70 -0
  27. package/recipes/core/sous-skills/skills/about-sous-configuration/SKILL.tpl.md +75 -0
  28. package/{shared-prompts/skills/sous-skills → recipes/core/sous-skills/skills}/create-skill/SKILL.tpl.md +8 -9
  29. package/recipes/core/sous-skills/sous.recipe.yaml +45 -0
  30. package/sous.config.schema.json +337 -0
  31. package/src/base-command.ts +220 -67
  32. package/src/commands/build.ts +150 -73
  33. package/src/commands/clear.ts +23 -15
  34. package/src/commands/compile.ts +74 -16
  35. package/src/commands/config/get.ts +110 -0
  36. package/src/commands/config/show.ts +32 -0
  37. package/src/commands/config/validate.ts +53 -0
  38. package/src/commands/help.ts +46 -0
  39. package/src/commands/launch.ts +36 -14
  40. package/src/commands/lock/rebuild.ts +241 -0
  41. package/src/commands/lock/show.ts +115 -0
  42. package/src/commands/namespace/list.ts +117 -0
  43. package/src/commands/namespace/show.ts +110 -0
  44. package/src/commands/prune.ts +3 -11
  45. package/src/commands/recipe/list.ts +95 -0
  46. package/src/commands/recipe/show.ts +301 -0
  47. package/src/commands/repo/add.ts +145 -0
  48. package/src/commands/repo/gc.ts +172 -0
  49. package/src/commands/repo/init.ts +136 -0
  50. package/src/commands/repo/link.ts +500 -0
  51. package/src/commands/repo/list.ts +179 -0
  52. package/src/commands/repo/release.ts +619 -0
  53. package/src/commands/repo/remove.ts +193 -0
  54. package/src/commands/repo/search.ts +189 -0
  55. package/src/commands/repo/submit.ts +133 -0
  56. package/src/commands/repo/unlink.ts +147 -0
  57. package/src/commands/subscription/add.ts +285 -0
  58. package/src/commands/subscription/list.ts +129 -0
  59. package/src/commands/subscription/remove.ts +181 -0
  60. package/src/commands/vars/ask.ts +374 -0
  61. package/src/commands/vars/index.ts +79 -0
  62. package/src/commands/vars/list.ts +67 -0
  63. package/src/commands/vars/show.ts +77 -0
  64. package/src/config-command.ts +30 -0
  65. package/src/lib/build-service.ts +206 -54
  66. package/src/lib/config-discovery.ts +220 -27
  67. package/src/lib/config-inspect.ts +145 -0
  68. package/src/lib/config-kernel.mjs +377 -0
  69. package/src/lib/config-schema.ts +361 -0
  70. package/src/lib/env-file.ts +328 -0
  71. package/src/lib/env-local.ts +18 -1
  72. package/src/lib/errors.ts +32 -0
  73. package/src/lib/include-resolver.ts +108 -15
  74. package/src/lib/interactive.ts +165 -0
  75. package/src/lib/markdown-compiler.ts +118 -37
  76. package/src/lib/package-info.ts +25 -0
  77. package/src/lib/pid-service.ts +32 -21
  78. package/src/lib/refs/find.ts +589 -0
  79. package/src/lib/refs/index.ts +12 -0
  80. package/src/lib/refs/pick.ts +147 -0
  81. package/src/lib/refs/scopes.ts +61 -0
  82. package/src/lib/repos/catalog-display.ts +116 -0
  83. package/src/lib/repos/catalog-inputs.ts +160 -0
  84. package/src/lib/repos/catalog.ts +722 -0
  85. package/src/lib/repos/core-recipe.ts +105 -0
  86. package/src/lib/repos/defaults.ts +175 -0
  87. package/src/lib/repos/formats/common.ts +389 -0
  88. package/src/lib/repos/formats/index-file.ts +215 -0
  89. package/src/lib/repos/formats/links-map.ts +96 -0
  90. package/src/lib/repos/formats/lockfile.ts +167 -0
  91. package/src/lib/repos/formats/patterns.ts +57 -0
  92. package/src/lib/repos/formats/recipe-manifest.ts +395 -0
  93. package/src/lib/repos/formats/repo-manifest.ts +88 -0
  94. package/src/lib/repos/formats/store-entry.ts +84 -0
  95. package/src/lib/repos/freshness.ts +208 -0
  96. package/src/lib/repos/git-clone.ts +312 -0
  97. package/src/lib/repos/identity.ts +89 -0
  98. package/src/lib/repos/index.ts +58 -0
  99. package/src/lib/repos/links.ts +353 -0
  100. package/src/lib/repos/load-manifest.ts +236 -0
  101. package/src/lib/repos/lock-service.ts +453 -0
  102. package/src/lib/repos/locked-namespace-resolver.ts +90 -0
  103. package/src/lib/repos/locked-recipes.ts +254 -0
  104. package/src/lib/repos/managed-layer.ts +422 -0
  105. package/src/lib/repos/namespace-resolver.ts +370 -0
  106. package/src/lib/repos/providers/base.ts +206 -0
  107. package/src/lib/repos/providers/git.ts +233 -0
  108. package/src/lib/repos/providers/github.ts +294 -0
  109. package/src/lib/repos/providers/gitlab.ts +263 -0
  110. package/src/lib/repos/providers/http.ts +102 -0
  111. package/src/lib/repos/providers/index-cache.ts +382 -0
  112. package/src/lib/repos/providers/index.ts +106 -0
  113. package/src/lib/repos/providers/local.ts +391 -0
  114. package/src/lib/repos/providers/provider.ts +401 -0
  115. package/src/lib/repos/recipe-config-layers.ts +287 -0
  116. package/src/lib/repos/recipe-targets.ts +223 -0
  117. package/src/lib/repos/ref-search.ts +46 -0
  118. package/src/lib/repos/ref.ts +513 -0
  119. package/src/lib/repos/reference-report.ts +122 -0
  120. package/src/lib/repos/release/bump.ts +161 -0
  121. package/src/lib/repos/release/git-state.ts +305 -0
  122. package/src/lib/repos/release/index-builder.ts +635 -0
  123. package/src/lib/repos/release/index.ts +16 -0
  124. package/src/lib/repos/release/plan.ts +512 -0
  125. package/src/lib/repos/release/submit-service.ts +496 -0
  126. package/src/lib/repos/release/tags.ts +243 -0
  127. package/src/lib/repos/release/validate.ts +463 -0
  128. package/src/lib/repos/resolver.ts +789 -0
  129. package/src/lib/repos/scaffold/index.ts +238 -0
  130. package/src/lib/repos/scaffold/templates.ts +413 -0
  131. package/src/lib/repos/seed.ts +414 -0
  132. package/src/lib/repos/store/contract.ts +64 -0
  133. package/src/lib/repos/store/hash.ts +114 -0
  134. package/src/lib/repos/store/recipe-store.ts +599 -0
  135. package/src/lib/repos/store/settings.ts +58 -0
  136. package/src/lib/repos/subscription-service.ts +2678 -0
  137. package/src/lib/repos/trust.ts +447 -0
  138. package/src/lib/settings.ts +546 -189
  139. package/src/lib/sous-home.ts +104 -0
  140. package/src/lib/state.ts +52 -20
  141. package/src/lib/vars/ask.ts +1152 -0
  142. package/src/lib/vars/definition-source.ts +252 -0
  143. package/src/lib/vars/display.ts +233 -0
  144. package/src/lib/vars/index.ts +18 -0
  145. package/src/lib/vars/ladder.ts +282 -0
  146. package/src/lib/vars/mappings.ts +265 -0
  147. package/src/lib/vars/names.ts +94 -0
  148. package/src/lib/vars/preanswers.ts +395 -0
  149. package/src/lib/vars/question-plan.ts +218 -0
  150. package/src/lib/vars/report.ts +228 -0
  151. package/src/lib/vars/safe-regex.ts +235 -0
  152. package/src/lib/vars/validate.ts +312 -0
  153. package/src/lib/watch-loop.ts +148 -0
  154. package/src/templating/init-liquid-engine.ts +58 -16
  155. package/src/utils/choice-prompt.ts +143 -0
  156. package/src/utils/command-errors.ts +186 -0
  157. package/src/utils/command-help.ts +45 -0
  158. package/src/utils/confirm-prompt.ts +110 -0
  159. package/src/utils/flags.ts +153 -0
  160. package/src/utils/formatting.ts +540 -55
  161. package/src/utils/prompts.ts +35 -1
  162. package/src/utils/sous-directory.ts +245 -0
  163. package/src/utils/table.ts +603 -0
  164. package/src/utils/value-prompt.ts +119 -0
  165. package/shared-prompts/_partials/resume-task.md +0 -51
  166. package/shared-prompts/_partials/sub-agent-delegation.md +0 -32
  167. package/shared-prompts/_partials/update-task-file.md +0 -52
  168. package/shared-prompts/memories/automated-browser-tasks/INDEX.tpl.md +0 -52
  169. package/shared-prompts/skills/automated-browser-tasks/about-automated-browser-tasks/SKILL.tpl.md +0 -102
  170. package/shared-prompts/skills/automated-browser-tasks/about-automated-browser-tasks/examples/auth-failure-handling.mjs +0 -81
  171. package/shared-prompts/skills/automated-browser-tasks/about-automated-browser-tasks/examples/chained-workflow.mjs +0 -126
  172. package/shared-prompts/skills/automated-browser-tasks/about-automated-browser-tasks/examples/simple-fetch.mjs +0 -92
  173. package/shared-prompts/skills/automated-browser-tasks/about-automated-browser-tasks/references/architecture.md +0 -61
  174. package/shared-prompts/skills/automated-browser-tasks/about-automated-browser-tasks/references/auth-and-sessions.md +0 -65
  175. package/shared-prompts/skills/automated-browser-tasks/about-automated-browser-tasks/references/ctx-api.md +0 -96
  176. package/shared-prompts/skills/automated-browser-tasks/about-automated-browser-tasks/references/installation.md +0 -104
  177. package/shared-prompts/skills/automated-browser-tasks/about-automated-browser-tasks/references/script-conventions.md +0 -243
  178. package/shared-prompts/skills/automated-browser-tasks/about-automated-browser-tasks/scripts/chrome-state.mjs +0 -148
  179. package/shared-prompts/skills/automated-browser-tasks/about-automated-browser-tasks/scripts/debug.mjs +0 -383
  180. package/shared-prompts/skills/automated-browser-tasks/about-automated-browser-tasks/scripts/debug.spec.mjs +0 -267
  181. package/shared-prompts/skills/automated-browser-tasks/about-automated-browser-tasks/scripts/eslint.config.mjs +0 -56
  182. package/shared-prompts/skills/automated-browser-tasks/about-automated-browser-tasks/scripts/harness.mjs +0 -169
  183. package/shared-prompts/skills/automated-browser-tasks/about-automated-browser-tasks/scripts/keyring.mjs +0 -59
  184. package/shared-prompts/skills/automated-browser-tasks/about-automated-browser-tasks/scripts/logger.mjs +0 -25
  185. package/shared-prompts/skills/automated-browser-tasks/about-automated-browser-tasks/scripts/params.mjs +0 -140
  186. package/shared-prompts/skills/automated-browser-tasks/about-automated-browser-tasks/scripts/run.mjs +0 -140
  187. package/shared-prompts/skills/automated-browser-tasks/about-automated-browser-tasks/scripts/settings.tpl.mjs +0 -1
  188. package/shared-prompts/skills/automated-browser-tasks/about-automated-browser-tasks/scripts/utils.mjs +0 -185
  189. package/shared-prompts/skills/automated-browser-tasks/create-automated-browser-task/SKILL.tpl.md +0 -52
  190. package/shared-prompts/skills/automated-browser-tasks/running-automated-browser-tasks/SKILL.tpl.md +0 -59
  191. package/shared-prompts/skills/automated-browser-tasks/update-automated-browser-task/SKILL.tpl.md +0 -47
  192. package/shared-prompts/skills/control-flow/approve/SKILL.tpl.md +0 -26
  193. package/shared-prompts/skills/control-flow/opine/SKILL.tpl.md +0 -58
  194. package/shared-prompts/skills/control-flow/repeat/SKILL.tpl.md +0 -27
  195. package/shared-prompts/skills/control-flow/research/SKILL.tpl.md +0 -34
  196. package/shared-prompts/skills/sous-skills/about-sous/SKILL.tpl.md +0 -51
  197. package/shared-prompts/skills/task-files/about-task-files/SKILL.tpl.md +0 -122
  198. package/shared-prompts/skills/task-files/continue-task-in-new-branch/SKILL.tpl.md +0 -80
  199. package/shared-prompts/skills/task-files/go/SKILL.tpl.md +0 -14
  200. package/shared-prompts/skills/task-files/resume-task/SKILL.tpl.md +0 -13
  201. package/shared-prompts/skills/task-files/start-task/SKILL.tpl.md +0 -93
  202. package/shared-prompts/skills/task-files/update/SKILL.tpl.md +0 -14
  203. package/shared-prompts/skills/task-files/update-task-file/SKILL.tpl.md +0 -13
  204. /package/{shared-prompts/skills/sous-skills → recipes/core/sous-skills/skills}/about-agent-skills/references/substitutions.md +0 -0
  205. /package/{shared-prompts/skills/sous-skills → recipes/core/sous-skills/skills}/about-liquid-templates/references/liquid-filters.md +0 -0
@@ -0,0 +1,337 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "type": "object",
4
+ "properties": {
5
+ "$schema": {
6
+ "type": "string"
7
+ },
8
+ "version": {
9
+ "type": "number",
10
+ "const": 1
11
+ },
12
+ "_env": {
13
+ "type": "object",
14
+ "propertyNames": {
15
+ "type": "string"
16
+ },
17
+ "additionalProperties": {
18
+ "type": "string"
19
+ }
20
+ },
21
+ "_vars": {
22
+ "type": "object",
23
+ "propertyNames": {
24
+ "type": "string"
25
+ },
26
+ "additionalProperties": {
27
+ "type": "string"
28
+ }
29
+ },
30
+ "_aliases": {
31
+ "type": "object",
32
+ "propertyNames": {
33
+ "type": "string"
34
+ },
35
+ "additionalProperties": {
36
+ "anyOf": [
37
+ {
38
+ "type": "string"
39
+ },
40
+ {
41
+ "type": "array",
42
+ "items": {
43
+ "type": "string"
44
+ }
45
+ }
46
+ ]
47
+ }
48
+ },
49
+ "name": {
50
+ "type": "string"
51
+ },
52
+ "compilation": {
53
+ "type": "object",
54
+ "properties": {
55
+ "_vars": {
56
+ "type": "object",
57
+ "propertyNames": {
58
+ "type": "string"
59
+ },
60
+ "additionalProperties": {
61
+ "type": "string"
62
+ }
63
+ },
64
+ "includeSourceComments": {
65
+ "type": "boolean"
66
+ },
67
+ "targets": {
68
+ "type": "array",
69
+ "items": {
70
+ "type": "object",
71
+ "properties": {
72
+ "_vars": {
73
+ "type": "object",
74
+ "propertyNames": {
75
+ "type": "string"
76
+ },
77
+ "additionalProperties": {
78
+ "type": "string"
79
+ }
80
+ },
81
+ "entryPoint": {
82
+ "type": "string"
83
+ },
84
+ "entryGlob": {
85
+ "type": "string"
86
+ },
87
+ "globBase": {
88
+ "type": "string"
89
+ },
90
+ "generateRuntimeContext": {
91
+ "type": "boolean"
92
+ },
93
+ "outputs": {
94
+ "type": "array",
95
+ "items": {
96
+ "type": "object",
97
+ "properties": {
98
+ "_if": {
99
+ "type": "object",
100
+ "propertyNames": {
101
+ "type": "string"
102
+ },
103
+ "additionalProperties": {
104
+ "type": "object",
105
+ "properties": {
106
+ "eq": {
107
+ "type": "string"
108
+ }
109
+ },
110
+ "required": [
111
+ "eq"
112
+ ],
113
+ "additionalProperties": false
114
+ }
115
+ },
116
+ "_vars": {
117
+ "type": "object",
118
+ "propertyNames": {
119
+ "type": "string"
120
+ },
121
+ "additionalProperties": {
122
+ "type": "string"
123
+ }
124
+ },
125
+ "destinationFile": {
126
+ "type": "string"
127
+ },
128
+ "destinationDir": {
129
+ "type": "string"
130
+ }
131
+ },
132
+ "additionalProperties": false
133
+ }
134
+ }
135
+ },
136
+ "required": [
137
+ "outputs"
138
+ ],
139
+ "additionalProperties": false
140
+ }
141
+ }
142
+ },
143
+ "required": [
144
+ "targets"
145
+ ],
146
+ "additionalProperties": false
147
+ },
148
+ "runtimeContext": {
149
+ "type": "object",
150
+ "properties": {
151
+ "gitRoot": {
152
+ "type": "string"
153
+ },
154
+ "outputPath": {
155
+ "type": "string"
156
+ },
157
+ "taskFileRoot": {
158
+ "type": "string"
159
+ },
160
+ "branchPattern": {
161
+ "type": "string"
162
+ }
163
+ },
164
+ "required": [
165
+ "gitRoot",
166
+ "outputPath",
167
+ "taskFileRoot"
168
+ ],
169
+ "additionalProperties": false
170
+ },
171
+ "tools": {
172
+ "type": "object",
173
+ "propertyNames": {
174
+ "type": "string"
175
+ },
176
+ "additionalProperties": {
177
+ "type": "object",
178
+ "properties": {
179
+ "command": {
180
+ "type": "string"
181
+ },
182
+ "args": {
183
+ "type": "array",
184
+ "items": {
185
+ "type": "string"
186
+ }
187
+ },
188
+ "promptFile": {
189
+ "type": "string"
190
+ }
191
+ },
192
+ "required": [
193
+ "command"
194
+ ],
195
+ "additionalProperties": false
196
+ }
197
+ },
198
+ "repos": {
199
+ "type": "object",
200
+ "propertyNames": {
201
+ "type": "string",
202
+ "pattern": "^[a-z][a-z0-9-]*$"
203
+ },
204
+ "additionalProperties": {
205
+ "type": "object",
206
+ "properties": {
207
+ "url": {
208
+ "anyOf": [
209
+ {
210
+ "type": "string",
211
+ "format": "uri"
212
+ },
213
+ {
214
+ "type": "string",
215
+ "minLength": 1
216
+ }
217
+ ]
218
+ },
219
+ "enabled": {
220
+ "type": "boolean"
221
+ },
222
+ "provider": {
223
+ "type": "string",
224
+ "enum": [
225
+ "github",
226
+ "gitlab",
227
+ "local"
228
+ ]
229
+ },
230
+ "alwaysPull": {
231
+ "type": "boolean"
232
+ },
233
+ "addedAt": {
234
+ "type": "string"
235
+ },
236
+ "addedBy": {
237
+ "type": "string"
238
+ }
239
+ },
240
+ "required": [
241
+ "url"
242
+ ],
243
+ "additionalProperties": false
244
+ }
245
+ },
246
+ "subscriptions": {
247
+ "type": "object",
248
+ "propertyNames": {
249
+ "type": "string",
250
+ "pattern": "^[a-z][a-z0-9-]*(\\/[a-z][a-z0-9-]*)?$"
251
+ },
252
+ "additionalProperties": {
253
+ "type": "object",
254
+ "properties": {
255
+ "enabled": {
256
+ "type": "boolean"
257
+ },
258
+ "range": {
259
+ "type": "string"
260
+ },
261
+ "prerelease": {
262
+ "type": "boolean"
263
+ },
264
+ "alwaysPull": {
265
+ "type": "boolean"
266
+ },
267
+ "addedAt": {
268
+ "type": "string"
269
+ },
270
+ "addedBy": {
271
+ "type": "string"
272
+ }
273
+ },
274
+ "additionalProperties": false
275
+ }
276
+ },
277
+ "store": {
278
+ "type": "object",
279
+ "properties": {
280
+ "maxBytes": {
281
+ "type": "integer",
282
+ "exclusiveMinimum": 0,
283
+ "maximum": 9007199254740991
284
+ },
285
+ "freshnessSeconds": {
286
+ "type": "integer",
287
+ "minimum": 0,
288
+ "maximum": 9007199254740991
289
+ },
290
+ "watchPollSeconds": {
291
+ "type": "integer",
292
+ "minimum": 0,
293
+ "maximum": 9007199254740991
294
+ }
295
+ },
296
+ "additionalProperties": false
297
+ },
298
+ "recipeOutputs": {
299
+ "type": "object",
300
+ "properties": {
301
+ "skills": {
302
+ "type": "array",
303
+ "items": {
304
+ "type": "string"
305
+ }
306
+ },
307
+ "memories": {
308
+ "type": "array",
309
+ "items": {
310
+ "type": "string"
311
+ }
312
+ },
313
+ "prompts": {
314
+ "type": "array",
315
+ "items": {
316
+ "type": "string"
317
+ }
318
+ }
319
+ },
320
+ "additionalProperties": false
321
+ },
322
+ "varMappings": {
323
+ "type": "object",
324
+ "propertyNames": {
325
+ "type": "string",
326
+ "pattern": "^[A-Z][A-Z0-9_]*$"
327
+ },
328
+ "additionalProperties": {
329
+ "type": "string",
330
+ "pattern": "^([a-z][a-z0-9-]*:)?[a-z][a-z0-9-]*\\/[a-z][a-z0-9-]*\\/[a-z][a-zA-Z0-9]*$"
331
+ }
332
+ }
333
+ },
334
+ "additionalProperties": false,
335
+ "$id": "https://sous-io.github.io/sous/sous.config.schema.json",
336
+ "title": "Sous config"
337
+ }