@spunto/build 0.3.0 → 0.4.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.
- package/README.md +51 -1
- package/package.json +27 -5
- package/src/agent-stream/agent-stream.ts +561 -0
- package/src/agent-stream/index.ts +42 -0
- package/src/agent-stream/model-window.ts +189 -0
- package/src/catalogs/index.ts +216 -0
- package/src/index.ts +4 -0
- package/src/script/index.ts +30 -0
- package/src/script/local-features.ts +39 -0
- package/src/script/setup-script.ts +1932 -0
- package/src/types/index.ts +68 -0
package/README.md
CHANGED
|
@@ -102,6 +102,52 @@ fields it has no feature for** — shared volumes are a Lite concept, the task s
|
|
|
102
102
|
both optional. Dropping a field the target cannot honour is the correct outcome; refusing the file
|
|
103
103
|
is not.
|
|
104
104
|
|
|
105
|
+
### `@spunto/build/script` — turning a project spec into the shell a worker runs
|
|
106
|
+
|
|
107
|
+
Four generators, one recipe: `buildImageScript` bakes the project image, `buildSetupScript` is the
|
|
108
|
+
first boot, `buildStartScript` is every boot, `buildWorkerScript` assembles the container CMD.
|
|
109
|
+
|
|
110
|
+
```ts
|
|
111
|
+
import { buildImageScript, IMAGE_RECIPE_VERSION } from "@spunto/build/script"
|
|
112
|
+
|
|
113
|
+
const { script, steps, hasDinD } = buildImageScript({ features, vscodeExtensions })
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
No filesystem, no clock: the one install script the platform ships itself is embedded as a string
|
|
117
|
+
(`local-features.ts`), and every path a generated script writes to comes from `./naming` rather
|
|
118
|
+
than a literal.
|
|
119
|
+
|
|
120
|
+
`buildContainerScript` and `buildSetupPlan` are shaped by one product's model — an agent that
|
|
121
|
+
orchestrates setup phase by phase instead of a container running one long CMD. They live here
|
|
122
|
+
because they share every helper in the file; splitting them out would fork the helpers, which is
|
|
123
|
+
the duplication this package exists to remove.
|
|
124
|
+
|
|
125
|
+
### `@spunto/build/catalogs` — what a project picker offers
|
|
126
|
+
|
|
127
|
+
`AVAILABLE_IMAGES`, `AVAILABLE_FEATURES`, `SUGGESTED_EXTENSIONS`. Data, but shared data: the two
|
|
128
|
+
hand-maintained copies had already drifted, one of them advertising Oh My Zsh in a feature the
|
|
129
|
+
image recipe explicitly disables.
|
|
130
|
+
|
|
131
|
+
Project *templates* are deliberately absent — one product's clone a starter repository and carry
|
|
132
|
+
onboarding-gallery presentation, the other's only configure an environment. They answer different
|
|
133
|
+
questions.
|
|
134
|
+
|
|
135
|
+
### `@spunto/build/types` — the shapes both schemas point at
|
|
136
|
+
|
|
137
|
+
`ProjectFeature`, `Repository`, `SetupStatus`. Declared here so each product's ORM can point its
|
|
138
|
+
JSON columns at them with `$type<…>()`, instead of a generator having to import a database schema.
|
|
139
|
+
`SetupStatus` is what a shell script writes into a container and a control plane reads back minutes
|
|
140
|
+
later: changing it is a migration, not an edit.
|
|
141
|
+
|
|
142
|
+
### `@spunto/build/agent-stream` — reading an agent session as it happens
|
|
143
|
+
|
|
144
|
+
One adapter per harness dialect, one vocabulary out. A CLI's JSON output is an output format, not
|
|
145
|
+
an API; adapters normalise into a small set of event types so stored history doesn't date the first
|
|
146
|
+
time a vendor reshuffles a field.
|
|
147
|
+
|
|
148
|
+
Here for the reason that inverts the rest of the package: **nothing has forked this yet.** Putting
|
|
149
|
+
it in the shared package now costs nothing and means the second product never writes its own.
|
|
150
|
+
|
|
105
151
|
## The rule
|
|
106
152
|
|
|
107
153
|
A module belongs in this package only if it imports **no** ORM schema, **no** HTTP framework, **no**
|
|
@@ -110,7 +156,11 @@ React, **no** `process.env`, and knows **nothing** about organizations, users or
|
|
|
110
156
|
`zod` is the one exception, and a deliberate one: `./spec` describes a file format that two
|
|
111
157
|
products have to validate identically, and re-deriving the same schema on each side is exactly the
|
|
112
158
|
duplication this package exists to remove. It is a **peer** dependency (`^4`), so a consumer's own
|
|
113
|
-
zod is the one used — which matters, since apps extend these schemas with their own.
|
|
159
|
+
zod is the one used — which matters, since apps extend these schemas with their own. And an
|
|
160
|
+
**optional** one, because a peer applies to the whole package while only `./spec` needs it: a
|
|
161
|
+
consumer that imports `./naming` or `./steps` and nothing else should not have a schema library
|
|
162
|
+
installed on its behalf. Import `./spec` without zod and resolution fails loudly, which is the
|
|
163
|
+
right trade for not taxing every other entry point.
|
|
114
164
|
|
|
115
165
|
Concretely: **no platform I/O**. No database, no Docker socket, no WebSocket. This package produces
|
|
116
166
|
strings and parses strings; its only network call is outbound HTTP to a public extension registry,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spunto/build",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Spunto's shared Build engine \u2014 the devcontainer image protocol and VS Code extension registry clients, with no database, no HTTP framework and no UI.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -31,22 +31,39 @@
|
|
|
31
31
|
"types": "./src/steps/index.ts",
|
|
32
32
|
"import": "./src/steps/index.ts"
|
|
33
33
|
},
|
|
34
|
-
"./extensions": {
|
|
35
|
-
"types": "./src/extensions/index.ts",
|
|
36
|
-
"import": "./src/extensions/index.ts"
|
|
37
|
-
},
|
|
38
34
|
"./naming": {
|
|
39
35
|
"types": "./src/naming/index.ts",
|
|
40
36
|
"import": "./src/naming/index.ts"
|
|
41
37
|
},
|
|
38
|
+
"./types": {
|
|
39
|
+
"types": "./src/types/index.ts",
|
|
40
|
+
"import": "./src/types/index.ts"
|
|
41
|
+
},
|
|
42
|
+
"./catalogs": {
|
|
43
|
+
"types": "./src/catalogs/index.ts",
|
|
44
|
+
"import": "./src/catalogs/index.ts"
|
|
45
|
+
},
|
|
46
|
+
"./extensions": {
|
|
47
|
+
"types": "./src/extensions/index.ts",
|
|
48
|
+
"import": "./src/extensions/index.ts"
|
|
49
|
+
},
|
|
42
50
|
"./spec": {
|
|
43
51
|
"types": "./src/spec/index.ts",
|
|
44
52
|
"import": "./src/spec/index.ts"
|
|
53
|
+
},
|
|
54
|
+
"./script": {
|
|
55
|
+
"types": "./src/script/index.ts",
|
|
56
|
+
"import": "./src/script/index.ts"
|
|
57
|
+
},
|
|
58
|
+
"./agent-stream": {
|
|
59
|
+
"types": "./src/agent-stream/index.ts",
|
|
60
|
+
"import": "./src/agent-stream/index.ts"
|
|
45
61
|
}
|
|
46
62
|
},
|
|
47
63
|
"files": [
|
|
48
64
|
"src",
|
|
49
65
|
"!src/**/*.test.ts",
|
|
66
|
+
"!src/**/__snapshots__",
|
|
50
67
|
"README.md"
|
|
51
68
|
],
|
|
52
69
|
"scripts": {
|
|
@@ -61,5 +78,10 @@
|
|
|
61
78
|
},
|
|
62
79
|
"peerDependencies": {
|
|
63
80
|
"zod": "^4"
|
|
81
|
+
},
|
|
82
|
+
"peerDependenciesMeta": {
|
|
83
|
+
"zod": {
|
|
84
|
+
"optional": true
|
|
85
|
+
}
|
|
64
86
|
}
|
|
65
87
|
}
|