opencode-agent-flow 0.0.0-stage → 0.1.1
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/CHANGELOG.md +34 -0
- package/CONTRIBUTING.md +3 -0
- package/LICENSE +21 -0
- package/README.md +181 -2
- package/SECURITY.md +3 -0
- package/bin/cli.mjs +54 -0
- package/docs/architecture.md +58 -0
- package/docs/opencode-v2-api-notes.md +121 -0
- package/docs/screenshot.png +0 -0
- package/lib/demo.mjs +42 -0
- package/lib/privacy.mjs +9 -0
- package/lib/upstream.mjs +194 -0
- package/package.json +46 -4
- package/prices.json +10 -0
- package/public/app.js +223 -0
- package/public/flow-webgl.js +155 -0
- package/public/index.html +10 -0
- package/public/style.css +6 -0
- package/public/vendor/three/LICENSE +21 -0
- package/public/vendor/three/postprocessing/EffectComposer.js +363 -0
- package/public/vendor/three/postprocessing/MaskPass.js +195 -0
- package/public/vendor/three/postprocessing/OutputPass.js +139 -0
- package/public/vendor/three/postprocessing/Pass.js +191 -0
- package/public/vendor/three/postprocessing/RenderPass.js +183 -0
- package/public/vendor/three/postprocessing/ShaderPass.js +135 -0
- package/public/vendor/three/postprocessing/UnrealBloomPass.js +492 -0
- package/public/vendor/three/shaders/CopyShader.js +52 -0
- package/public/vendor/three/shaders/LuminosityHighPassShader.js +68 -0
- package/public/vendor/three/shaders/OutputShader.js +103 -0
- package/public/vendor/three/three.core.min.js +6 -0
- package/public/vendor/three/three.module.min.js +6 -0
- package/server.mjs +217 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Color
|
|
3
|
+
} from 'three';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @module LuminosityHighPassShader
|
|
7
|
+
* @three_import import { LuminosityHighPassShader } from 'three/addons/shaders/LuminosityHighPassShader.js';
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Luminosity high pass shader.
|
|
12
|
+
*
|
|
13
|
+
* @constant
|
|
14
|
+
* @type {ShaderMaterial~Shader}
|
|
15
|
+
*/
|
|
16
|
+
const LuminosityHighPassShader = {
|
|
17
|
+
|
|
18
|
+
name: 'LuminosityHighPassShader',
|
|
19
|
+
|
|
20
|
+
uniforms: {
|
|
21
|
+
|
|
22
|
+
'tDiffuse': { value: null },
|
|
23
|
+
'luminosityThreshold': { value: 1.0 },
|
|
24
|
+
'smoothWidth': { value: 1.0 },
|
|
25
|
+
'defaultColor': { value: new Color( 0x000000 ) },
|
|
26
|
+
'defaultOpacity': { value: 0.0 }
|
|
27
|
+
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
vertexShader: /* glsl */`
|
|
31
|
+
|
|
32
|
+
varying vec2 vUv;
|
|
33
|
+
|
|
34
|
+
void main() {
|
|
35
|
+
|
|
36
|
+
vUv = uv;
|
|
37
|
+
|
|
38
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
39
|
+
|
|
40
|
+
}`,
|
|
41
|
+
|
|
42
|
+
fragmentShader: /* glsl */`
|
|
43
|
+
|
|
44
|
+
uniform sampler2D tDiffuse;
|
|
45
|
+
uniform vec3 defaultColor;
|
|
46
|
+
uniform float defaultOpacity;
|
|
47
|
+
uniform float luminosityThreshold;
|
|
48
|
+
uniform float smoothWidth;
|
|
49
|
+
|
|
50
|
+
varying vec2 vUv;
|
|
51
|
+
|
|
52
|
+
void main() {
|
|
53
|
+
|
|
54
|
+
vec4 texel = texture2D( tDiffuse, vUv );
|
|
55
|
+
|
|
56
|
+
float v = luminance( texel.xyz );
|
|
57
|
+
|
|
58
|
+
vec4 outputColor = vec4( defaultColor.rgb, defaultOpacity );
|
|
59
|
+
|
|
60
|
+
float alpha = smoothstep( luminosityThreshold, luminosityThreshold + smoothWidth, v );
|
|
61
|
+
|
|
62
|
+
gl_FragColor = mix( outputColor, texel, alpha );
|
|
63
|
+
|
|
64
|
+
}`
|
|
65
|
+
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export { LuminosityHighPassShader };
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module OutputShader
|
|
3
|
+
* @three_import import { OutputShader } from 'three/addons/shaders/OutputShader.js';
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Performs tone mapping and color space conversion for
|
|
8
|
+
* FX workflows.
|
|
9
|
+
*
|
|
10
|
+
* Used by {@link OutputPass}.
|
|
11
|
+
*
|
|
12
|
+
* @constant
|
|
13
|
+
* @type {ShaderMaterial~Shader}
|
|
14
|
+
*/
|
|
15
|
+
const OutputShader = {
|
|
16
|
+
|
|
17
|
+
name: 'OutputShader',
|
|
18
|
+
|
|
19
|
+
uniforms: {
|
|
20
|
+
|
|
21
|
+
'tDiffuse': { value: null },
|
|
22
|
+
'toneMappingExposure': { value: 1 }
|
|
23
|
+
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
vertexShader: /* glsl */`
|
|
27
|
+
precision highp float;
|
|
28
|
+
|
|
29
|
+
uniform mat4 modelViewMatrix;
|
|
30
|
+
uniform mat4 projectionMatrix;
|
|
31
|
+
|
|
32
|
+
attribute vec3 position;
|
|
33
|
+
attribute vec2 uv;
|
|
34
|
+
|
|
35
|
+
varying vec2 vUv;
|
|
36
|
+
|
|
37
|
+
void main() {
|
|
38
|
+
|
|
39
|
+
vUv = uv;
|
|
40
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
41
|
+
|
|
42
|
+
}`,
|
|
43
|
+
|
|
44
|
+
fragmentShader: /* glsl */`
|
|
45
|
+
|
|
46
|
+
precision highp float;
|
|
47
|
+
|
|
48
|
+
uniform sampler2D tDiffuse;
|
|
49
|
+
|
|
50
|
+
#include <tonemapping_pars_fragment>
|
|
51
|
+
#include <colorspace_pars_fragment>
|
|
52
|
+
|
|
53
|
+
varying vec2 vUv;
|
|
54
|
+
|
|
55
|
+
void main() {
|
|
56
|
+
|
|
57
|
+
gl_FragColor = texture2D( tDiffuse, vUv );
|
|
58
|
+
|
|
59
|
+
// tone mapping
|
|
60
|
+
|
|
61
|
+
#ifdef LINEAR_TONE_MAPPING
|
|
62
|
+
|
|
63
|
+
gl_FragColor.rgb = LinearToneMapping( gl_FragColor.rgb );
|
|
64
|
+
|
|
65
|
+
#elif defined( REINHARD_TONE_MAPPING )
|
|
66
|
+
|
|
67
|
+
gl_FragColor.rgb = ReinhardToneMapping( gl_FragColor.rgb );
|
|
68
|
+
|
|
69
|
+
#elif defined( CINEON_TONE_MAPPING )
|
|
70
|
+
|
|
71
|
+
gl_FragColor.rgb = CineonToneMapping( gl_FragColor.rgb );
|
|
72
|
+
|
|
73
|
+
#elif defined( ACES_FILMIC_TONE_MAPPING )
|
|
74
|
+
|
|
75
|
+
gl_FragColor.rgb = ACESFilmicToneMapping( gl_FragColor.rgb );
|
|
76
|
+
|
|
77
|
+
#elif defined( AGX_TONE_MAPPING )
|
|
78
|
+
|
|
79
|
+
gl_FragColor.rgb = AgXToneMapping( gl_FragColor.rgb );
|
|
80
|
+
|
|
81
|
+
#elif defined( NEUTRAL_TONE_MAPPING )
|
|
82
|
+
|
|
83
|
+
gl_FragColor.rgb = NeutralToneMapping( gl_FragColor.rgb );
|
|
84
|
+
|
|
85
|
+
#elif defined( CUSTOM_TONE_MAPPING )
|
|
86
|
+
|
|
87
|
+
gl_FragColor.rgb = CustomToneMapping( gl_FragColor.rgb );
|
|
88
|
+
|
|
89
|
+
#endif
|
|
90
|
+
|
|
91
|
+
// color space
|
|
92
|
+
|
|
93
|
+
#ifdef SRGB_TRANSFER
|
|
94
|
+
|
|
95
|
+
gl_FragColor = sRGBTransferOETF( gl_FragColor );
|
|
96
|
+
|
|
97
|
+
#endif
|
|
98
|
+
|
|
99
|
+
}`
|
|
100
|
+
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export { OutputShader };
|