Commit c249bb0
authored
feat: add ability to attach source to an environment (#809)
Allows attaching environments to sources for all callers.
This introduces the distinction between a System Environment and User
Configuration to the system. These names might be stupid but they
attempt to get around the idea that Headers are more of an
implementation detail and the rules associated with how you merge these
things should be derived from their provenance rather than how they were
supplied.
We make some decisions. First off, we complect the call sites of tool
proxies by placing the onus of loading on them. This was more or less in
the name of purity of the tools proxy. But might be a mistake because it
forces the onus of reading system environments to a bunch of places in
our code base. It's possible it's a little bug-prone to do this nonsense
in a bunch of places.
The other decision, which I feel a little better about is to provide
both environments to each tool type and leave the responsibility of
merging them at the call site. Even though we aim for consistent
behavior (ie. preferring user config over system environment), leaving
the flexibility on how to merge each tool type seems healthy.
## UX
A dialog attached to source cards. Not good.
Affordance to access functionality is currently buried behind:
<img width="720" height="391" alt="image"
src="https://github.com/user-attachments/assets/fce5cd45-7b45-4485-a26a-346c44e817a5"
/>
The interface for attaching an environment is implemented in this modal:
<img width="779" height="356" alt="image"
src="https://github.com/user-attachments/assets/89de283e-d412-44a8-b15b-276002762419"
/>
* We use a combobox
* We try to preview what variables will be set to make more mistakes
more obvious
* Currently pretty ugly, but banking on the UX moving to a new location
shortly before I figure out a good hierarchy for presenting. Happy to
knock any quick fixes to make this present better if people feel
strongly
## Things to pay Attention To
* Moved sources components to new directory, but also changed the modal
paradigm (separate content components, used `zustand` for state
management)
* I ported all of the `Dialog`s and Dropdown Menu's to the moonshine
versions of those components. I couldn't visually tell the difference
and there were some really nasty interplay issues. Hoping this is a nice
stability move
## Considerations
* Might consider adding a confirmation button considering this action is
a pretty serious one
* UX is quite ugly at the moment. Preferring to follow up with a
dedicated sources page instead of burying behind a dialog
* Blocked on this moonshine PR:
speakeasy-api/moonshine#3191 parent 033e09c commit c249bb0
File tree
100 files changed
+27231
-14161
lines changed- .changeset
- .mise-tasks/infra
- .speakeasy
- client
- dashboard/src
- components
- functions
- sources
- ui
- pages
- deployments
- toolsets
- resources
- sources
- sdk
- .speakeasy
- docs
- models
- components
- operations
- sdks/environments
- src
- funcs
- lib
- models
- components
- operations
- react-query
- sdk
- server
- design/environments
- gen
- environments
- http
- auth/client
- cli/gram
- deployments/client
- domains/client
- environments
- client
- server
- features/client
- integrations/client
- keys/client
- logs/client
- mcp_metadata/client
- packages/client
- projects/client
- slack/client
- templates/client
- toolsets/client
- variations/client
- internal
- chat
- environments
- repo
- gateway
- instances
- mcp
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
100 files changed
+27231
-14161
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3002 | 3002 | | |
3003 | 3003 | | |
3004 | 3004 | | |
| 3005 | + | |
| 3006 | + | |
| 3007 | + | |
| 3008 | + | |
| 3009 | + | |
| 3010 | + | |
| 3011 | + | |
| 3012 | + | |
| 3013 | + | |
| 3014 | + | |
| 3015 | + | |
| 3016 | + | |
| 3017 | + | |
| 3018 | + | |
| 3019 | + | |
| 3020 | + | |
| 3021 | + | |
| 3022 | + | |
| 3023 | + | |
| 3024 | + | |
| 3025 | + | |
| 3026 | + | |
| 3027 | + | |
| 3028 | + | |
| 3029 | + | |
| 3030 | + | |
| 3031 | + | |
| 3032 | + | |
| 3033 | + | |
| 3034 | + | |
| 3035 | + | |
| 3036 | + | |
| 3037 | + | |
| 3038 | + | |
| 3039 | + | |
| 3040 | + | |
| 3041 | + | |
| 3042 | + | |
| 3043 | + | |
| 3044 | + | |
| 3045 | + | |
| 3046 | + | |
| 3047 | + | |
| 3048 | + | |
| 3049 | + | |
| 3050 | + | |
| 3051 | + | |
| 3052 | + | |
| 3053 | + | |
| 3054 | + | |
| 3055 | + | |
| 3056 | + | |
| 3057 | + | |
| 3058 | + | |
| 3059 | + | |
| 3060 | + | |
| 3061 | + | |
| 3062 | + | |
| 3063 | + | |
| 3064 | + | |
| 3065 | + | |
| 3066 | + | |
| 3067 | + | |
| 3068 | + | |
| 3069 | + | |
| 3070 | + | |
| 3071 | + | |
| 3072 | + | |
| 3073 | + | |
| 3074 | + | |
| 3075 | + | |
| 3076 | + | |
| 3077 | + | |
| 3078 | + | |
| 3079 | + | |
| 3080 | + | |
| 3081 | + | |
| 3082 | + | |
| 3083 | + | |
| 3084 | + | |
| 3085 | + | |
| 3086 | + | |
| 3087 | + | |
| 3088 | + | |
| 3089 | + | |
| 3090 | + | |
| 3091 | + | |
| 3092 | + | |
| 3093 | + | |
| 3094 | + | |
| 3095 | + | |
| 3096 | + | |
| 3097 | + | |
| 3098 | + | |
| 3099 | + | |
| 3100 | + | |
| 3101 | + | |
| 3102 | + | |
| 3103 | + | |
| 3104 | + | |
| 3105 | + | |
| 3106 | + | |
| 3107 | + | |
| 3108 | + | |
| 3109 | + | |
| 3110 | + | |
| 3111 | + | |
| 3112 | + | |
| 3113 | + | |
| 3114 | + | |
| 3115 | + | |
| 3116 | + | |
| 3117 | + | |
| 3118 | + | |
| 3119 | + | |
| 3120 | + | |
| 3121 | + | |
| 3122 | + | |
| 3123 | + | |
| 3124 | + | |
| 3125 | + | |
| 3126 | + | |
| 3127 | + | |
| 3128 | + | |
| 3129 | + | |
| 3130 | + | |
| 3131 | + | |
| 3132 | + | |
| 3133 | + | |
| 3134 | + | |
| 3135 | + | |
| 3136 | + | |
| 3137 | + | |
| 3138 | + | |
| 3139 | + | |
| 3140 | + | |
| 3141 | + | |
| 3142 | + | |
| 3143 | + | |
| 3144 | + | |
| 3145 | + | |
| 3146 | + | |
| 3147 | + | |
| 3148 | + | |
| 3149 | + | |
| 3150 | + | |
| 3151 | + | |
| 3152 | + | |
| 3153 | + | |
| 3154 | + | |
| 3155 | + | |
| 3156 | + | |
| 3157 | + | |
| 3158 | + | |
| 3159 | + | |
| 3160 | + | |
| 3161 | + | |
| 3162 | + | |
| 3163 | + | |
| 3164 | + | |
| 3165 | + | |
| 3166 | + | |
| 3167 | + | |
| 3168 | + | |
| 3169 | + | |
| 3170 | + | |
| 3171 | + | |
| 3172 | + | |
| 3173 | + | |
| 3174 | + | |
| 3175 | + | |
| 3176 | + | |
| 3177 | + | |
| 3178 | + | |
| 3179 | + | |
| 3180 | + | |
| 3181 | + | |
| 3182 | + | |
| 3183 | + | |
| 3184 | + | |
| 3185 | + | |
| 3186 | + | |
| 3187 | + | |
| 3188 | + | |
| 3189 | + | |
| 3190 | + | |
| 3191 | + | |
| 3192 | + | |
| 3193 | + | |
| 3194 | + | |
| 3195 | + | |
| 3196 | + | |
| 3197 | + | |
| 3198 | + | |
| 3199 | + | |
| 3200 | + | |
| 3201 | + | |
| 3202 | + | |
| 3203 | + | |
| 3204 | + | |
| 3205 | + | |
| 3206 | + | |
| 3207 | + | |
| 3208 | + | |
| 3209 | + | |
| 3210 | + | |
| 3211 | + | |
| 3212 | + | |
| 3213 | + | |
| 3214 | + | |
| 3215 | + | |
| 3216 | + | |
| 3217 | + | |
| 3218 | + | |
3005 | 3219 | | |
3006 | 3220 | | |
3007 | 3221 | | |
| |||
3092 | 3306 | | |
3093 | 3307 | | |
3094 | 3308 | | |
| 3309 | + | |
| 3310 | + | |
| 3311 | + | |
| 3312 | + | |
| 3313 | + | |
| 3314 | + | |
| 3315 | + | |
| 3316 | + | |
| 3317 | + | |
| 3318 | + | |
| 3319 | + | |
| 3320 | + | |
| 3321 | + | |
| 3322 | + | |
| 3323 | + | |
| 3324 | + | |
| 3325 | + | |
| 3326 | + | |
| 3327 | + | |
| 3328 | + | |
| 3329 | + | |
| 3330 | + | |
| 3331 | + | |
| 3332 | + | |
| 3333 | + | |
| 3334 | + | |
| 3335 | + | |
| 3336 | + | |
| 3337 | + | |
| 3338 | + | |
| 3339 | + | |
| 3340 | + | |
| 3341 | + | |
| 3342 | + | |
| 3343 | + | |
| 3344 | + | |
| 3345 | + | |
| 3346 | + | |
| 3347 | + | |
| 3348 | + | |
| 3349 | + | |
| 3350 | + | |
| 3351 | + | |
| 3352 | + | |
| 3353 | + | |
| 3354 | + | |
| 3355 | + | |
| 3356 | + | |
| 3357 | + | |
| 3358 | + | |
| 3359 | + | |
| 3360 | + | |
| 3361 | + | |
| 3362 | + | |
| 3363 | + | |
| 3364 | + | |
| 3365 | + | |
| 3366 | + | |
| 3367 | + | |
| 3368 | + | |
| 3369 | + | |
| 3370 | + | |
| 3371 | + | |
| 3372 | + | |
| 3373 | + | |
| 3374 | + | |
| 3375 | + | |
| 3376 | + | |
| 3377 | + | |
| 3378 | + | |
| 3379 | + | |
| 3380 | + | |
| 3381 | + | |
| 3382 | + | |
| 3383 | + | |
| 3384 | + | |
| 3385 | + | |
| 3386 | + | |
| 3387 | + | |
| 3388 | + | |
| 3389 | + | |
| 3390 | + | |
| 3391 | + | |
| 3392 | + | |
| 3393 | + | |
| 3394 | + | |
| 3395 | + | |
| 3396 | + | |
| 3397 | + | |
| 3398 | + | |
| 3399 | + | |
| 3400 | + | |
| 3401 | + | |
| 3402 | + | |
| 3403 | + | |
| 3404 | + | |
3095 | 3405 | | |
3096 | 3406 | | |
3097 | 3407 | | |
| |||
11115 | 11425 | | |
11116 | 11426 | | |
11117 | 11427 | | |
| 11428 | + | |
| 11429 | + | |
| 11430 | + | |
| 11431 | + | |
| 11432 | + | |
| 11433 | + | |
| 11434 | + | |
| 11435 | + | |
| 11436 | + | |
| 11437 | + | |
| 11438 | + | |
| 11439 | + | |
| 11440 | + | |
| 11441 | + | |
| 11442 | + | |
| 11443 | + | |
| 11444 | + | |
| 11445 | + | |
| 11446 | + | |
| 11447 | + | |
| 11448 | + | |
| 11449 | + | |
| 11450 | + | |
| 11451 | + | |
| 11452 | + | |
| 11453 | + | |
| 11454 | + | |
| 11455 | + | |
| 11456 | + | |
| 11457 | + | |
| 11458 | + | |
| 11459 | + | |
| 11460 | + | |
| 11461 | + | |
| 11462 | + | |
| 11463 | + | |
| 11464 | + | |
| 11465 | + | |
| 11466 | + | |
| 11467 | + | |
| 11468 | + | |
| 11469 | + | |
| 11470 | + | |
| 11471 | + | |
| 11472 | + | |
| 11473 | + | |
11118 | 11474 | | |
11119 | 11475 | | |
11120 | 11476 | | |
| |||
0 commit comments