@pen.dev/cli 0.3.11 → 0.3.13
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/dist/index.mjs +3 -3
- package/dist/node_modules/@highagency/pencil-wasm/enums.gen.d.ts +5 -0
- package/dist/node_modules/@highagency/pencil-wasm/package.json +1 -1
- package/dist/node_modules/@highagency/pencil-wasm/pencil.d.ts +11 -6
- package/dist/node_modules/@highagency/pencil-wasm/pencil.js +1 -1
- package/dist/node_modules/@highagency/pencil-wasm/pencil.wasm +0 -0
- package/dist/out/mcp-server-darwin-arm64 +0 -0
- package/dist/out/mcp-server-darwin-x64 +0 -0
- package/dist/out/mcp-server-linux-arm64 +0 -0
- package/dist/out/mcp-server-linux-x64 +0 -0
- package/dist/out/mcp-server-windows-arm64.exe +0 -0
- package/dist/out/mcp-server-windows-x64.exe +0 -0
- package/dist/out/skills/pen-dev/pen-schema.md +2 -2
- package/dist/out/skills/pen-dev/scripts-and-shaders.md +13 -9
- package/package.json +3 -2
|
Binary file
|
|
@@ -34,7 +34,7 @@ export interface Position { x?: number; y?: number; }
|
|
|
34
34
|
export interface Size { width?: NumberOrVariable | SizingBehavior; height?: NumberOrVariable | SizingBehavior; }
|
|
35
35
|
/** Affine matrix [a, b, c, d, tx, ty]. */
|
|
36
36
|
export type AffineTransform = [number, number, number, number, number, number];
|
|
37
|
-
/** Override values for shader uniforms, keyed by uniform name. Uniforms annotated with `@resolution` or `@time` must not appear here. Allowed value shapes: number (float/int), boolean (bool), hex color string like `#RRGGBB[AA]` (color), array of 2-4 numbers (vec2/3/4), or a variable reference `$name` (numeric uniforms accept number variables; color uniforms accept color variables). */
|
|
37
|
+
/** Override values for shader uniforms, keyed by uniform name. Uniforms annotated with `@resolution` or `@time` must not appear here. Allowed value shapes: number (float/int), boolean (bool), hex color string like `#RRGGBB[AA]` (color), array of 2-4 numbers (vec2/3/4), image URL or `pencil:object`/`pencil:background` string (sampler2D), or a variable reference `$name` (numeric uniforms accept number variables; color uniforms accept color variables). */
|
|
38
38
|
export interface ShaderUniforms { [key: string]: number | boolean | string | number[]; }
|
|
39
39
|
export type BlendMode = 'normal' | 'darken' | 'multiply' | 'linearBurn' | 'colorBurn' | 'light' | 'screen' | 'linearDodge' | 'colorDodge' | 'overlay' | 'softLight' | 'hardLight' | 'difference' | 'exclusion' | 'hue' | 'saturation' | 'color' | 'luminosity';
|
|
40
40
|
export type Fill = ColorOrVariable | {
|
|
@@ -87,7 +87,7 @@ export interface CanHaveStroke {
|
|
|
87
87
|
strokeLinejoin?: "miter" | "bevel" | "round";
|
|
88
88
|
strokeAlignment?: "inner" | "center" | "outer";
|
|
89
89
|
}
|
|
90
|
-
export type Effect = /** Blurs the entire node. */ { enabled?: BooleanOrVariable; type: "blur"; radius?: NumberOrVariable } | /** Blurs the backdrop behind the node. */ { enabled?: BooleanOrVariable; type: "background_blur"; radius?: NumberOrVariable } | /** Inner or outer drop shadow. */ { type: "shadow"; enabled?: BooleanOrVariable; shadowType?: "inner" | "outer"; offset?: { x: NumberOrVariable; y: NumberOrVariable }; blur?: NumberOrVariable; color?: ColorOrVariable; blendMode?: BlendMode } | /** Post-processes the rendered node with a fragment shader. Same shader format as the shader fill. A `sampler2D` uniform
|
|
90
|
+
export type Effect = /** Blurs the entire node. */ { enabled?: BooleanOrVariable; type: "blur"; radius?: NumberOrVariable } | /** Blurs the backdrop behind the node. */ { enabled?: BooleanOrVariable; type: "background_blur"; radius?: NumberOrVariable } | /** Inner or outer drop shadow. */ { type: "shadow"; enabled?: BooleanOrVariable; shadowType?: "inner" | "outer"; offset?: { x: NumberOrVariable; y: NumberOrVariable }; blur?: NumberOrVariable; color?: ColorOrVariable; blendMode?: BlendMode } | /** Post-processes the rendered node with a fragment shader. Same shader format as the shader fill. A `sampler2D` uniform set to `pencil:object` is bound to the rendered node. `@resolution` is the size of the node's visual bounds. */ { type: "shader"; enabled?: BooleanOrVariable; url: string; uniforms?: ShaderUniforms };
|
|
91
91
|
export type Effects = Effect | Effect[];
|
|
92
92
|
export interface CanHaveEffects { effect?: Effects; }
|
|
93
93
|
export interface CanHaveGraphics extends CanHaveEffects, CanHaveStroke { fill?: Fills; }
|
|
@@ -48,7 +48,9 @@ The `shader` fill type can be used to create complex graphics effects using WebG
|
|
|
48
48
|
- Supported uniform types:
|
|
49
49
|
- float, int: as numbers
|
|
50
50
|
- vec2/3/4, ivec2/3/4: as arrays of numbers or "#RRGGBB" strings for colors
|
|
51
|
-
- sampler2D: as image URL strings
|
|
51
|
+
- sampler2D: as image URL strings (loaded as with UNPACK_FLIP_Y_WEBGL, so `texture2D(tex, gl_FragCoord.xy / resolution)` shows the image upright), or one of these special URLs:
|
|
52
|
+
- "pencil:object": the node's own rendering below the shader, over transparent: in a fill the fills under it (plus the node's effects drawn before fills, like shadows), in a stroke additionally all fills, in an effect every fill, stroke and earlier effect. Texels are premultiplied by alpha, like gl_FragColor; outside the node it is transparent.
|
|
53
|
+
- "pencil:background": the content rendered behind the node, with nothing of the node itself. Outside the node it mirrors. Offset/distort the sampling coordinate for refraction-like effects. Ideal for glass/frosted/refraction/magnifier effects. Prefer "pencil:background" over faking the background.
|
|
52
54
|
- Uniforms can be annotated with special comments:
|
|
53
55
|
- @color: marks vec3 or vec4 uniforms to use color picker controls.
|
|
54
56
|
- @default: sets the default value for the uniform.
|
|
@@ -56,8 +58,6 @@ The `shader` fill type can be used to create complex graphics effects using WebG
|
|
|
56
58
|
- @mouse: set to the mouse position in the same space as gl_FragCoord. For interactive effects.
|
|
57
59
|
- @time: set to the elapsed time in seconds. For animations.
|
|
58
60
|
- @sdf: a sampler2D set to an SDF texture of the node's shape (in a shader effect: of the rendered content). The r channel holds the signed distance in @resolution units (positive = inside). The gb channels hold the gradient of the distance field (direction of increasing distance), in texel space. Use gb instead of numerically differentiating the r channel!
|
|
59
|
-
- @content: a sampler2D set to the node's own rendering below the shader, over transparent: in a fill the fills under it (plus the node's effects drawn before fills, like shadows), in a stroke additionally all fills, in an effect every fill, stroke and earlier effect. Texels are premultiplied by alpha, like gl_FragColor; outside the node it is transparent.
|
|
60
|
-
- @backdrop: a sampler2D set to the content rendered behind the node, with nothing of the node itself. Outside the node it mirrors. Offset/distort the sampling coordinate for refraction-like effects. Ideal for glass/frosted/refraction/magnifier effects. Prefer @backdrop over faking the background.
|
|
61
61
|
- @mipmap: the texture will be mipmapped. Off by default. Turn it on when the sample coordinate varies smoothly (glass, refraction, blur); keep it off when it jumps between neighboring pixels (pixelation, mosaics, high-frequency turbulence).
|
|
62
62
|
- @min/@max: set the range of a uniform for better UI controls. Only applies to number uniforms.
|
|
63
63
|
- @range <min>, <max>: shorthand for @min and @max on the same line. Shows a slider in the UI.
|
|
@@ -97,19 +97,19 @@ void main() {
|
|
|
97
97
|
|
|
98
98
|
### Shader effects
|
|
99
99
|
|
|
100
|
-
A `shader` effect (`effect: { type: "shader", url, uniforms }`) post-processes the node: the node, its children and its other effects are rendered into the
|
|
100
|
+
A `shader` effect (`effect: { type: "shader", url, uniforms }`) post-processes the node: the node, its children and its other effects are rendered into the `pencil:object` texture, and the shader's output is drawn in place of the node. Use it for distortion, pixelation, color grading, glitch and similar effects on existing content. Use a shader fill when the shader generates the image itself. `pencil:object` and `pencil:background` mean the same in fills and effects, so a shader written for one works as the other; a `pencil:background` shader (glass, ripple, ...) refracts what is behind the node either way.
|
|
101
101
|
|
|
102
|
-
- `@resolution` and `gl_FragCoord` are the same as for a fill: the node's size and the node's own coordinates. The shader is run over the node's visual bounds (strokes, shadows, blur, unclipped children included), so there `gl_FragCoord` goes outside `0..@resolution`, and
|
|
103
|
-
- Multiple shader effects are chained in list order: each one's
|
|
102
|
+
- `@resolution` and `gl_FragCoord` are the same as for a fill: the node's size and the node's own coordinates. The shader is run over the node's visual bounds (strokes, shadows, blur, unclipped children included), so there `gl_FragCoord` goes outside `0..@resolution`, and `pencil:object`, `@sdf` and `pencil:background` cover those bounds too: uv outside `0..1` samples them.
|
|
103
|
+
- Multiple shader effects are chained in list order: each one's `pencil:object` is the output of the previous one.
|
|
104
104
|
- `@sdf` is the SDF of the content's alpha channel (edge at 50% alpha), so shadows, blurs and earlier shader effects on the node move the edge.
|
|
105
|
-
-
|
|
106
|
-
- Combine
|
|
105
|
+
- `pencil:object` is rendered over transparent, so blend modes inside the node only blend with the node's own content below them. A blend mode that reaches the bottom of the node (nothing opaque under it) blends with the scene when drawn normally, but not inside `pencil:object`.
|
|
106
|
+
- Combine `pencil:object` and `pencil:background`: distort the shape with `pencil:object` and refract `pencil:background` through the result for a glass effect on a distorted node.
|
|
107
107
|
|
|
108
108
|
```glsl
|
|
109
109
|
/** @resolution */
|
|
110
110
|
uniform vec2 u_resolution;
|
|
111
111
|
|
|
112
|
-
/** @
|
|
112
|
+
/** @label Content */
|
|
113
113
|
uniform sampler2D u_content;
|
|
114
114
|
|
|
115
115
|
/**
|
|
@@ -124,3 +124,7 @@ void main() {
|
|
|
124
124
|
gl_FragColor = texture2D(u_content, cell / u_resolution);
|
|
125
125
|
}
|
|
126
126
|
```
|
|
127
|
+
|
|
128
|
+
```json
|
|
129
|
+
{ "type": "shader", "url": "pixelate.glsl", "uniforms": { "u_content": "pencil:object" } }
|
|
130
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pen.dev/cli",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.13",
|
|
4
4
|
"description": "CLI tool for running the pen.dev AI agent manipulating .pen design files",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.mjs",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"license": "UNLICENSED",
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@anthropic-ai/claude-agent-sdk": "^0.3.293",
|
|
23
|
-
"@earendil-works/pi-coding-agent": "^1.0
|
|
23
|
+
"@earendil-works/pi-coding-agent": "^1.3.0",
|
|
24
24
|
"@inquirer/prompts": "^8.3.0",
|
|
25
25
|
"@jitl/quickjs-wasmfile-release-asyncify": "^0.32.0",
|
|
26
26
|
"@jitl/quickjs-wasmfile-release-sync": "^0.32.0",
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@ha/agent": "0.1.0",
|
|
36
36
|
"@ha/device-auth": "0.1.0",
|
|
37
|
+
"@ha/headless": "0.1.0",
|
|
37
38
|
"@ha/ipc": "0.1.0",
|
|
38
39
|
"@ha/mcp": "0.1.0",
|
|
39
40
|
"@ha/mcp-server": "0.1.0",
|