@supersoniks/concorde 4.9.9 → 4.9.92

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 (48) hide show
  1. package/build-infos.json +1 -1
  2. package/concorde-core.bundle.js +241 -241
  3. package/concorde-core.es.js +2931 -2851
  4. package/dist/concorde-core.bundle.js +241 -241
  5. package/dist/concorde-core.es.js +2931 -2851
  6. package/dist/js/core/decorators/api.js +146 -43
  7. package/dist/js/core/decorators/api.js.map +1 -1
  8. package/dist/js/decorators.js +4 -0
  9. package/dist/js/decorators.js.map +1 -1
  10. package/dist/types/core/decorators/api.d.ts +87 -60
  11. package/dist/types/core/decorators/api.d.ts.map +1 -1
  12. package/dist/types/decorators.d.ts +3 -1
  13. package/dist/types/decorators.d.ts.map +1 -1
  14. package/docs/assets/index-D2Q3JyQ6.css +1 -0
  15. package/docs/assets/{index-hElUgV9_.js → index-DURr6O71.js} +651 -736
  16. package/docs/crawl/docs/_decorators/get.html +89 -81
  17. package/docs/crawl/docs/_decorators/patch.html +43 -23
  18. package/docs/crawl/docs/_decorators/post.html +101 -72
  19. package/docs/crawl/docs/_decorators/put.html +44 -21
  20. package/docs/crawl/docs/_getting-started/ai-agents.html +45 -6
  21. package/docs/crawl/hubs/decorators.html +145 -70
  22. package/docs/crawl/hubs/remote-data.html +145 -70
  23. package/docs/index.html +2 -2
  24. package/docs/llms-full.txt +276 -147
  25. package/docs/llms.txt +4 -4
  26. package/docs/src/core/components/functional/queue/queue.md +0 -0
  27. package/docs/src/core/components/ui/button/button.md +0 -0
  28. package/docs/src/docs/_decorators/get.md +88 -80
  29. package/docs/src/docs/_decorators/patch.md +41 -25
  30. package/docs/src/docs/_decorators/post.md +104 -62
  31. package/docs/src/docs/_decorators/put.md +42 -24
  32. package/docs/src/docs/_getting-started/ai-agents.md +24 -4
  33. package/docs/src/docs/search/docs-search.json +182 -112
  34. package/docs/src/tsconfig.json +270 -267
  35. package/package.json +1 -1
  36. package/src/core/decorators/api.post.spec.ts +79 -1
  37. package/src/core/decorators/api.spec.ts +141 -1
  38. package/src/core/decorators/api.ts +330 -180
  39. package/src/decorators.ts +7 -0
  40. package/src/docs/_decorators/get.md +88 -80
  41. package/src/docs/_decorators/patch.md +41 -25
  42. package/src/docs/_decorators/post.md +104 -62
  43. package/src/docs/_decorators/put.md +42 -24
  44. package/src/docs/components/docs-demo-sources.ts +9 -14
  45. package/src/docs/example/decorators-demo-geo.ts +0 -21
  46. package/src/docs/example/decorators-demo-subscribe-publish-get-demos.ts +42 -133
  47. package/src/docs/search/docs-search.json +128 -133
  48. package/docs/assets/index-Bnp7gVaA.css +0 -1
@@ -3134,97 +3134,121 @@ Shared data: Sharing data.
3134
3134
 
3135
3135
  - URL: https://concorde.supersoniks.org/crawl/docs/_decorators/get.html
3136
3136
  - Doc ID: docs/_decorators/get
3137
- - Keywords: Concorde, supersoniks, docs/_decorators/get, get, @get, decorator, API.getDetailed, ApiResult | null, request, response, null, dataProvider(...), result, Endpoint, ApiResult
3137
+ - Keywords: Concorde, supersoniks, docs/_decorators/get, get, @get, decorator, ApiResult, undefined, payload.result, payload.response, payload.request,
3138
3138
 
3139
- @get
3139
+ The first argument is always an
3140
+ [, serviceURL, refetch(component),
3140
3141
 
3141
- Loads data through API.getDetailed. The decorated property is ApiResult | null: request, response (or null for dataProvider(...) resolution without HTTP), and typed result.
3142
3142
 
3143
- Pass an Endpoint as the first argument. Import get and ApiResult from @supersoniks/concorde/decorators, and Endpoint from @supersoniks/concorde/utils/endpoint.
3144
3143
 
3145
- Configuration
3144
+ @get
3146
3145
 
3147
- - Default: HTML.getApiConfiguration(host) (ancestor serviceURL, etc.).
3148
- - Second argument: DataProviderKey — config is read from the publisher at the resolved path; internal mutations trigger another GET. See API configuration for mock demos.
3146
+ @get loads data and stores the result in an optional ApiResult property.
3147
+ The property is undefined until a result is available.
3149
3148
 
3150
- Dynamic path
3149
+ - payload.result: typed data;
3150
+ - payload.response: the HTTP response;
3151
+ - payload.request: the request that was sent.
3151
3152
 
3152
- ${prop} on the endpoint or config key is resolved on the host. While a placeholder is null or undefined, no GET runs. Optional skipEmptyPlaceholder: true also blocks "" (empty string only). Details: Dynamic path placeholders.
3153
+ Minimal usage
3153
3154
 
3154
- Options (GetOptions)
3155
+ const usersEndpoint = new Endpoint ("users");
3155
3156
 
3156
- Pass as the second argument (scoped config) or third (with a configuration key). Same shape as send decorators where applicable:
3157
+ @get(usersEndpoint)
3158
+ @state()
3159
+ payload?: ApiResult ;
3157
3160
 
3158
- | Option | Description |
3159
- |--------|-------------|
3160
- | skipEmptyPlaceholder | Treat "" as not ready (see Dynamic path). |
3161
- | refetchEveryMs | Automatic polling interval (ms). 0 or omitted = no polling. |
3162
- | triggerKey | DataProviderKey — PublisherManager.get(...).invalidate() on that publisher re-runs the GET. |
3161
+ The first argument is always an
3162
+ Endpoint . API configuration is read
3163
+ from the HTML scope (serviceURL, token, etc.), so the component is usually
3164
+ placed below an element that provides this configuration.
3163
3165
 
3164
- Manual refetch (triggerKey)
3166
+ Refetching a GET
3165
3167
 
3166
- Same pattern as @post: a publisher acts as a signal, independent of the response payload.
3168
+ From the component
3167
3169
 
3168
- import { get, type ApiResult } from "@supersoniks/concorde/decorators";
3169
- import { Endpoint } from "@supersoniks/concorde/utils/endpoint";
3170
- import { DataProviderKey } from "@supersoniks/concorde/dataProviderKey";
3171
- import { dp } from "@supersoniks/concorde/core/utils/PublisherProxy";
3170
+ Keep the decorator in a constant to access refetch(component). Refetch only
3171
+ targets the instance passed as the argument, even before it has received a
3172
+ result.
3172
3173
 
3173
- const geoCommunesEndpoint = new Endpoint (
3174
- "communes?limit=5&fields=nom,code",
3175
- );
3176
- const geoCommunesRefreshKey = new DataProviderKey (
3177
- "docsDemoGeoCommunesRefresh",
3178
- );
3174
+ const usersGet = get(new Endpoint ("users"));
3179
3175
 
3180
- @get(geoCommunesEndpoint, apiConfigurationKey, {
3181
- triggerKey: geoCommunesRefreshKey,
3182
- })
3176
+ @usersGet
3183
3177
  @state()
3184
- payload: ApiResult | null = null;
3178
+ payload?: ApiResult ;
3185
3179
 
3186
- // Same component or anywhere else:
3187
- dp(geoCommunesRefreshKey).invalidate();
3180
+ async refresh() {
3181
+ const payload = await usersGet.refetch(this);
3182
+ console.log(payload?.result);
3183
+ }
3188
3184
 
3189
- Prefer triggerKey over mutating the API configuration publisher when you only want to reload the same URL — no need to touch serviceURL, tokens, etc.
3185
+ refetch(component) returns a Promise | undefined> that resolves
3186
+ after the GET has completed.
3190
3187
 
3191
- The docs mock adds an X-Fetched-At response header on /docs-mock-api/geo/communes so live demos can show when the last fetch happened (response.headers.get("X-Fetched-At")).
3188
+ From a method decorator
3192
3189
 
3193
- When the GET runs again
3190
+ The refetch can decorate a local method. The default is after; if the
3191
+ method returns a Promise, the GET waits for its resolution. The decorated method
3192
+ call also waits for the refetch to complete.
3194
3193
 
3195
- - A referenced Lit property changes (endpoint path and/or config key contains ${...}).
3196
- - set on the active configuration publisher (onInternalMutation).
3197
- - triggerKey publisher invalidate().
3198
- - refetchEveryMs polling (after each successful fetch).
3194
+ import { refetch } from "@supersoniks/concorde/decorators";
3199
3195
 
3200
- Import
3196
+ @refetch(usersGet)
3197
+ async reload() {
3198
+ this.userId = "42";
3199
+ }
3201
3200
 
3202
- import { get, type ApiResult } from "@supersoniks/concorde/decorators";
3203
- import { Endpoint } from "@supersoniks/concorde/utils/endpoint";
3204
- import { DataProviderKey } from "@supersoniks/concorde/dataProviderKey";
3201
+ Use { when: "before" } when the GET must complete before the method runs:
3205
3202
 
3206
- Minimal example
3203
+ @refetch(usersGet, { when: "before" })
3204
+ reloadBefore() {
3205
+ // The refetch has completed before this method runs.
3206
+ }
3207
3207
 
3208
- Same demo service as sonic-queue (/docs-mock-api/geo/). Publisher setup lives in decorators-demo-geo.ts and decorators-demo-subscribe-publish-get-demos.ts.
3208
+ The method decorator adds an explicit trigger; changes to dynamic endpoint
3209
+ properties and configuration publishers keep their existing automatic behavior.
3209
3210
 
3210
- @get(new Endpoint ("users/${userId}"))
3211
- @state()
3212
- payload: ApiResult | null = null;
3211
+ Options (GetOptions)
3213
3212
 
3214
- Live demos
3213
+ Options are the second argument, or the third argument when an API
3214
+ configuration key is provided.
3215
3215
 
3216
- @get with triggerKey — refresh button + X-Fetched-At timestamp in the UI:
3216
+ - skipEmptyPlaceholder: blocks the GET when ${prop} is "".
3217
+ - refetchEveryMs: automatically runs the GET again after this interval
3218
+ (milliseconds). Omit the option, or use 0, to disable polling.
3219
+ - triggerKey: a publisher whose invalidate() runs the GET again.
3217
3220
 
3218
- Dynamic config and endpoint path. Manual refetch is triggered from a separate component (same triggerKey publisher):
3221
+ With a configuration key, use:
3219
3222
 
3220
- Scoped @get with @publish / @subscribe on the payload (see @publish and @subscribe) — wrap under an ancestor with serviceURL="/docs-mock-api/geo/":
3223
+ @get(usersEndpoint, apiConfigurationKey)
3221
3224
 
3222
- Stale responses are ignored if the path or generation changed before the request finished.
3225
+ When the GET runs again
3223
3226
 
3224
- See also
3227
+ - when the component connects and configuration is available;
3228
+ - when a property used in ${...} changes;
3229
+ - when a configuration publisher changes;
3230
+ - when the triggerKey publisher is invalidated;
3231
+ - after each response when refetchEveryMs is set.
3225
3232
 
3226
- - Dynamic path placeholders
3227
- - @post · @put · @patch — send decorators (same path rules)
3233
+ See Dynamic path placeholders for
3234
+ dynamic path details.
3235
+
3236
+ Import
3237
+
3238
+ import { get, type ApiResult } from "@supersoniks/concorde/decorators";
3239
+ import { DataProviderKey } from "@supersoniks/concorde/dataProviderKey";
3240
+ import { Endpoint } from "@supersoniks/concorde/utils/endpoint";
3241
+
3242
+ Demos
3243
+
3244
+ See @post,
3245
+ @put, and
3246
+ @patch for write operations.
3247
+
3248
+ Advanced
3249
+
3250
+ External invalidation is currently available through triggerKey; it is kept
3251
+ out of the main usage examples.
3228
3252
 
3229
3253
  ---
3230
3254
 
@@ -3731,44 +3755,60 @@ Notes
3731
3755
 
3732
3756
  - URL: https://concorde.supersoniks.org/crawl/docs/_decorators/patch.html
3733
3757
  - Doc ID: docs/_decorators/patch
3734
- - Keywords: Concorde, supersoniks, docs/_decorators/patch, patch, @patch, decorator, API.patchDetailed, ApiResult | null, request, response, result, Endpoint, DataProviderKey, ApiResult, @supersoniks/concorde/decorators
3758
+ - Keywords: Concorde, supersoniks, docs/_decorators/patch, patch, @patch, decorator, Endpoint, DataProviderKey, ApiResult, send(component),
3759
+
3760
+ , when: "before", autoPostOnBodyMutation: false, autoPostOnBodyMutation, skipIfBodyMissing
3735
3761
 
3736
3762
  @patch
3737
3763
 
3738
- Sends data through API.patchDetailed. Same model as @post: decorated property is ApiResult | null (request, response, result).
3764
+ @patch applies a partial update with the body from a publisher. It uses the
3765
+ same model as @post:
3766
+ Endpoint , DataProviderKey , ApiResult , options, and the
3767
+ send(component) handle.
3768
+
3769
+ Minimal usage
3739
3770
 
3740
- Pass an Endpoint and a DataProviderKey for the request body. Import patch and ApiResult from @supersoniks/concorde/decorators.
3771
+ const bodyKey = new DataProviderKey >("users.patch");
3772
+ const patchUser = patch(new Endpoint ("users/42"), bodyKey);
3741
3773
 
3742
- Configuration
3774
+ @patchUser
3775
+ @state()
3776
+ payload?: ApiResult ;
3743
3777
 
3744
- Same as @post / @get: scoped HTML.getApiConfiguration(host) or DataProviderKey as third argument.
3778
+ To run the operation again from the component:
3745
3779
 
3746
- Options (PatchOptions)
3780
+ async savePatch() {
3781
+ await patchUser.send(this);
3782
+ }
3747
3783
 
3748
- Same shape as PostOptions on @post (ApiSendOptions): refetchEveryMs, skipIfBodyMissing, autoPostOnBodyMutation, triggerKey, skipEmptyPlaceholder. See Dynamic path placeholders for ${sessionId} and empty-string behaviour.
3784
+ send(component) returns a Promise resolved after the PATCH completes. See
3785
+ @post for the method-decorator form and the
3786
+ when: "before" option.
3749
3787
 
3750
- Import
3788
+ The PATCH is also sent automatically when the body mutates, unless
3789
+ autoPostOnBodyMutation: false is set. The available options are described in
3790
+ @post:
3751
3791
 
3752
- import { patch, type ApiResult } from "@supersoniks/concorde/decorators";
3753
- import { Endpoint } from "@supersoniks/concorde/utils/endpoint";
3754
- import { DataProviderKey } from "@supersoniks/concorde/dataProviderKey";
3792
+ - autoPostOnBodyMutation
3793
+ - skipIfBodyMissing
3794
+ - refetchEveryMs
3795
+ - skipEmptyPlaceholder
3796
+ - triggerKey
3755
3797
 
3756
- Example
3798
+ Pass explicit API configuration as the third argument:
3757
3799
 
3758
- const patchBodyKey = new DataProviderKey<Partial<Resource>>("resourcePatch");
3800
+ @patch(endpoint, bodyKey, apiConfigurationKey)
3759
3801
 
3760
- @patch(
3761
- new Endpoint<Resource, { resourceId: string }>("resources/${resourceId}"),
3762
- patchBodyKey,
3763
- { skipEmptyPlaceholder: true },
3764
- )
3765
- @state()
3766
- payload?: ApiResult<Resource> | null;
3802
+ Import
3803
+
3804
+ import { patch, type ApiResult } from "@supersoniks/concorde/decorators";
3805
+ import { DataProviderKey } from "@supersoniks/concorde/dataProviderKey";
3806
+ import { Endpoint } from "@supersoniks/concorde/utils/endpoint";
3767
3807
 
3768
3808
  See also
3769
3809
 
3770
- - @post — POST (live demos)
3771
- - @put — full replacement (PUT)
3810
+ - @post — options and triggers
3811
+ - @put — full replacement
3772
3812
  - Dynamic path placeholders
3773
3813
 
3774
3814
  ---
@@ -3777,72 +3817,126 @@ See also
3777
3817
 
3778
3818
  - URL: https://concorde.supersoniks.org/crawl/docs/_decorators/post.html
3779
3819
  - Doc ID: docs/_decorators/post
3780
- - Keywords: Concorde, supersoniks, docs/_decorators/post, post, @post, decorator, API.postDetailed, ApiResult | null, request, response, result, Endpoint, DataProviderKey, ApiResult, @supersoniks/concorde/decorators
3820
+ - Keywords: Concorde, supersoniks, docs/_decorators/post, post, @post, decorator, ApiResult, undefined, Endpoint, DataProviderKey,
3821
+
3822
+ The current body is read from , send(component),
3823
+
3824
+ , returns a ,
3825
+
3826
+ Use
3781
3827
 
3782
3828
  @post
3783
3829
 
3784
- Sends data through API.postDetailed. The decorated property is ApiResult | null: request, response, and typed result.
3830
+ @post sends the contents of a publisher and stores the response in an
3831
+ optional ApiResult property. The property is undefined until a result
3832
+ is available.
3785
3833
 
3786
- Pass an Endpoint as the first argument and a DataProviderKey for the request body as the second. Import post and ApiResult from @supersoniks/concorde/decorators, and Endpoint from @supersoniks/concorde/utils/endpoint.
3834
+ Minimal usage
3787
3835
 
3788
- Configuration
3836
+ Pass an Endpoint and a DataProviderKey for the request body.
3789
3837
 
3790
- Same as @get: scoped HTML.getApiConfiguration(host) by default, or DataProviderKey as third argument. See API configuration for mock demos.
3838
+ const userBodyKey = new DataProviderKey ("users.form");
3839
+ const createUser = post(new Endpoint ("users"), userBodyKey);
3791
3840
 
3792
- Optional PostOptions (third or fourth argument)
3841
+ @createUser
3842
+ @state()
3843
+ payload?: ApiResult ;
3793
3844
 
3794
- | Option | Description |
3795
- |--------|-------------|
3796
- | refetchEveryMs | Re-post on an interval (ms). |
3797
- | skipIfBodyMissing | Skip when body publisher is null/undefined (default: true). |
3798
- | autoPostOnBodyMutation | Re-post when the body publisher mutates (default: true). false = manual via triggerKey.invalidate(). |
3799
- | skipEmptyPlaceholder | If true, a placeholder resolved to '' blocks the request (empty string only — not 0 or false). See Dynamic paths. |
3800
- | triggerKey | DataProviderKey — invalidate() re-runs the POST with the current body. |
3845
+ The current body is read from userBodyKey. By default, the POST is sent when
3846
+ the component connects and after each body mutation. Mutations in the same
3847
+ frame are coalesced into one request.
3801
3848
 
3802
- When the POST runs again
3849
+ API configuration is read from the HTML scope, as with
3850
+ @get.
3803
3851
 
3804
- - Body publisher onInternalMutation when autoPostOnBodyMutation is true (default). Plusieurs mutations synchrones dans la même frame sont regroupées en un seul POST via requestAnimationFrame.
3805
- - Endpoint path dependency changes (${sessionId} on the host).
3806
- - Configuration publisher mutation.
3807
- - triggerKey publisher invalidate().
3808
- - refetchEveryMs timer (if set).
3852
+ Sending the POST again
3809
3853
 
3810
- Import
3854
+ From the component
3811
3855
 
3812
- import { post, publish, type ApiResult } from "@supersoniks/concorde/decorators";
3813
- import { Endpoint } from "@supersoniks/concorde/utils/endpoint";
3814
- import { DataProviderKey } from "@supersoniks/concorde/dataProviderKey";
3856
+ Keep the decorator to access send(component). The body is read again when the
3857
+ operation runs.
3858
+
3859
+ async saveAgain() {
3860
+ const payload = await createUser.send(this);
3861
+ console.log(payload?.result);
3862
+ }
3815
3863
 
3816
- Minimal example
3864
+ send() returns a Promise | undefined> that resolves after the
3865
+ operation completes. It is useful for “Save” or “Retry” buttons and can repeat
3866
+ an operation with side effects.
3817
3867
 
3818
- Mock service: POST /docs-mock-api/api/register (same route as sonic-submit demos). Publisher setup lives in decorators-demo-post.ts.
3868
+ From a method decorator
3819
3869
 
3820
- const syncRequest = new DataProviderKey<SyncRequest>("syncRequest");
3821
- const syncTrigger = new DataProviderKey<number>("syncTrigger");
3870
+ The send action can decorate a local method. It runs after the method by
3871
+ default, waits for an eventual Promise to resolve, and the decorated method
3872
+ call waits for the send to complete:
3822
3873
 
3823
- @post(
3824
- new Endpoint<SyncResponse, { sessionId: string }>("sessions/${sessionId}/sync"),
3825
- syncRequest,
3826
- { triggerKey: syncTrigger },
3827
- )
3828
- @state()
3829
- payload?: ApiResult<SyncResponse> | null;
3874
+ import { send } from "@supersoniks/concorde/decorators";
3875
+
3876
+ @send(createUser)
3877
+ async save() {
3878
+ // Prepare local state or validate the form.
3879
+ }
3830
3880
 
3831
- Live demos
3881
+ Use { when: "before" } when the send must complete before the method runs:
3832
3882
 
3833
- Dynamic endpoint path — changing sessionId on the host re-runs the POST (POST /docs-mock-api/api/sessions/{id}/sync):
3883
+ @send(createUser, { when: "before" })
3884
+ saveBefore() {
3885
+ // The POST has completed before this method runs.
3886
+ }
3834
3887
 
3835
- @post + @publish on the same property (see @publish):
3888
+ The method decorator adds an explicit send. If the method also mutates the body
3889
+ publisher, set autoPostOnBodyMutation: false when the decorated method must
3890
+ be the only trigger.
3836
3891
 
3837
- Stale responses are ignored if the path or generation changed before the request finished.
3892
+ Options (PostOptions)
3838
3893
 
3839
- Note: plusieurs composants @post sur la même page qui partagent le même bodyKey enverront chacun une requête à chaque mutation du body — utiliser une clé par composant (voir les deux démos live ci-dessus).
3894
+ Options are the third argument, or the fourth argument when a configuration key
3895
+ is provided.
3840
3896
 
3841
- Path placeholders (${sessionId}, …): Dynamic path placeholders.
3897
+ - autoPostOnBodyMutation: send after a body mutation (default: true). Set
3898
+ it to false to use send().
3899
+ - skipIfBodyMissing: skip when the body is null or undefined (default:
3900
+ true).
3901
+ - refetchEveryMs: repeat the POST at this interval. Use it only when
3902
+ repeating the operation is intended.
3903
+ - skipEmptyPlaceholder: block the request when a ${...} placeholder is
3904
+ "".
3905
+ - triggerKey: a publisher whose invalidate() sends the POST again.
3842
3906
 
3843
- See also
3907
+ With a configuration key:
3908
+
3909
+ @post(endpoint, userBodyKey, apiConfigurationKey)
3910
+
3911
+ See Dynamic path placeholders for
3912
+ dynamic path details.
3913
+
3914
+ When the POST is sent
3915
+
3916
+ - when the component connects and the body and configuration are available;
3917
+ - after a body mutation, unless autoPostOnBodyMutation: false;
3918
+ - when a property used in ${...} changes;
3919
+ - when a configuration publisher changes;
3920
+ - when the triggerKey publisher is invalidated;
3921
+ - when send() is called;
3922
+ - after each response when refetchEveryMs is set.
3923
+
3924
+ Import
3925
+
3926
+ import { post, type ApiResult } from "@supersoniks/concorde/decorators";
3927
+ import { DataProviderKey } from "@supersoniks/concorde/dataProviderKey";
3928
+ import { Endpoint } from "@supersoniks/concorde/utils/endpoint";
3844
3929
 
3845
- - @put · @patch — same decorator model, PUT / PATCH via putDetailed / patchDetailed
3930
+ Demos
3931
+
3932
+ See @put and
3933
+ @patch: they use the same model with a
3934
+ different HTTP method.
3935
+
3936
+ Advanced
3937
+
3938
+ External invalidation is currently available through triggerKey; it is kept
3939
+ out of the main usage examples.
3846
3940
 
3847
3941
  ---
3848
3942
 
@@ -3897,43 +3991,61 @@ Dynamic paths use the same placeholder rules as @bind / @subscribe. Resolution a
3897
3991
 
3898
3992
  - URL: https://concorde.supersoniks.org/crawl/docs/_decorators/put.html
3899
3993
  - Doc ID: docs/_decorators/put
3900
- - Keywords: Concorde, supersoniks, docs/_decorators/put, put, @put, decorator, API.putDetailed, ApiResult | null, request, response, result, Endpoint, DataProviderKey, ApiResult, @supersoniks/concorde/decorators
3994
+ - Keywords: Concorde, supersoniks, docs/_decorators/put, put, @put, decorator, Endpoint, DataProviderKey, ApiResult, send(component),
3995
+
3996
+ , when: "before", autoPostOnBodyMutation: false, autoPostOnBodyMutation, skipIfBodyMissing
3901
3997
 
3902
3998
  @put
3903
3999
 
3904
- Sends data through API.putDetailed. Same model as @post: decorated property is ApiResult | null (request, response, result).
4000
+ @put replaces a resource with the body from a publisher. It uses exactly the
4001
+ same model as @post:
4002
+ Endpoint , DataProviderKey , ApiResult , options, and the
4003
+ send(component) handle.
3905
4004
 
3906
- Pass an Endpoint and a DataProviderKey for the request body. Import put and ApiResult from @supersoniks/concorde/decorators.
4005
+ Minimal usage
3907
4006
 
3908
- Configuration
4007
+ const bodyKey = new DataProviderKey ("users.form");
4008
+ const updateUser = put(new Endpoint ("users/42"), bodyKey);
3909
4009
 
3910
- Same as @post / @get: scoped HTML.getApiConfiguration(host) or DataProviderKey as third argument.
4010
+ @updateUser
4011
+ @state()
4012
+ payload?: ApiResult ;
3911
4013
 
3912
- Options (PutOptions)
4014
+ To run the operation again from the component:
3913
4015
 
3914
- Same shape as PostOptions on @post (ApiSendOptions): refetchEveryMs, skipIfBodyMissing, autoPostOnBodyMutation, triggerKey, skipEmptyPlaceholder. See Dynamic path placeholders for ${sessionId} and empty-string behaviour.
4016
+ async update() {
4017
+ await updateUser.send(this);
4018
+ }
3915
4019
 
3916
- Import
4020
+ send(component) returns a Promise resolved after the PUT completes. See
4021
+ @post for the method-decorator form and the
4022
+ when: "before" option.
3917
4023
 
3918
- import { put, type ApiResult } from "@supersoniks/concorde/decorators";
3919
- import { Endpoint } from "@supersoniks/concorde/utils/endpoint";
3920
- import { DataProviderKey } from "@supersoniks/concorde/dataProviderKey";
4024
+ The PUT is also sent automatically when the body mutates, unless
4025
+ autoPostOnBodyMutation: false is set. See
4026
+ @post for the option details:
3921
4027
 
3922
- Example
4028
+ - autoPostOnBodyMutation
4029
+ - skipIfBodyMissing
4030
+ - refetchEveryMs
4031
+ - skipEmptyPlaceholder
4032
+ - triggerKey
3923
4033
 
3924
- const bodyKey = new DataProviderKey<UpdatePayload>("resourceBody");
4034
+ Pass explicit API configuration as the third argument:
3925
4035
 
3926
- @put(new Endpoint<Resource, { resourceId: string }>("resources/${resourceId}"), bodyKey)
3927
- @state()
3928
- payload?: ApiResult<Resource> | null;
4036
+ @put(endpoint, bodyKey, apiConfigurationKey)
3929
4037
 
3930
- Changing resourceId on the host re-runs the PUT when the path becomes ready — see Dynamic path placeholders.
4038
+ Import
4039
+
4040
+ import { put, type ApiResult } from "@supersoniks/concorde/decorators";
4041
+ import { DataProviderKey } from "@supersoniks/concorde/dataProviderKey";
4042
+ import { Endpoint } from "@supersoniks/concorde/utils/endpoint";
3931
4043
 
3932
4044
  See also
3933
4045
 
3934
- - @post — POST (live demos, polling, @publish)
3935
- - @patch — partial update (PATCH)
3936
- - Endpoint · API configuration
4046
+ - @post — options and triggers
4047
+ - @patch — partial update
4048
+ - Dynamic path placeholders
3937
4049
 
3938
4050
  ---
3939
4051
 
@@ -4233,7 +4345,7 @@ See DataProviderKey, @subscribe, and the concorde-get-set-dp migration skill.
4233
4345
  - URL: https://concorde.supersoniks.org/crawl/docs/_getting-started/ai-agents.html
4234
4346
  - Doc ID: docs/_getting-started/ai-agents
4235
4347
  - Keywords: Concorde, supersoniks, docs/_getting-started/ai-agents, ai-agents, AI agents (skills & AGENTS.md), guide, AGENTS.md, yarn ai:sync, ai-init, yarn add @supersoniks/concorde, |
4236
- | Concorde repo (contributors) | , --merge-agents, --overlay , --cursor-only
4348
+ | Concorde repo (contributors) | , --skip-agents, --merge-agents, --force-agents
4237
4349
 
4238
4350
  AI agents (skills & AGENTS.md)
4239
4351
 
@@ -4259,16 +4371,33 @@ Useful flags
4259
4371
 
4260
4372
  | Flag | Effect |
4261
4373
  |------|--------|
4262
- | --merge-agents | Append to an existing AGENTS.md instead of replacing it |
4263
- | --overlay | Copy extra rules/skills from another layer (e.g. starter kit) |
4374
+ | --skip-agents | Never write AGENTS.md (skills / rules only) |
4375
+ | --merge-agents | Opt-in: keep the project preamble and append / refresh the Concorde block |
4376
+ | --force-agents | Opt-in: replace the whole AGENTS.md (destructive) |
4377
+ | --overlay | Extra rules/skills + optional AGENTS.concorde.md for project-only Concorde agent notes |
4264
4378
  | --cursor-only | Install only .cursor/skills and .cursor/rules |
4265
4379
  | --jetbrains-only | Install only .aiassistant/rules/ |
4266
4380
 
4381
+ AGENTS.md policy (non-invasive)
4382
+
4383
+ | Situation | Default |
4384
+ |-----------|---------|
4385
+ | No AGENTS.md | Create the Concorde guide |
4386
+ | File with | Refresh the managed zone only |
4387
+ | File without marker (project notes) | Left untouched — skills / rules are enough |
4388
+ | --merge-agents / --force-agents / --skip-agents | See flags above |
4389
+
4390
+ [optional project preamble — short, project-only]
4391
+
4392
+ [--- + overlay AGENTS.concorde.md]
4393
+
4394
+ Everything after is replaced on each ai-init run (idempotent). Do not paste a full copy of the Concorde guide above the marker — put project-specific notes in AGENTS.concorde.md (overlay). If the preamble duplicates package AGENTS.md, ai-init slims or drops it and prints a warning. Legacy filenames AGENTS.overlay.md / AGENTS.starter.md are still accepted with a deprecation warning.
4395
+
4267
4396
  What gets installed
4268
4397
 
4269
4398
  | Path | Role |
4270
4399
  |------|------|
4271
- | AGENTS.md | Project-level guide for agents (Concorde conventions) |
4400
+ | AGENTS.md | Created only if missing; existing project-owned files are left alone unless --merge-agents / --force-agents |
4272
4401
  | .cursor/skills/concorde/ | Core Lit + DataProvider patterns |
4273
4402
  | .cursor/skills/concorde-imports/ | Short @supersoniks/concorde/… import paths |
4274
4403
  | .cursor/skills/concorde-scope/ | serviceURL, formDataProvider, API configuration |
@@ -4282,7 +4411,7 @@ Workflow
4282
4411
 
4283
4412
  1. Starter project: Installation — yarn ai:sync is wired in the kit.
4284
4413
  2. Existing / manual Vite project: Manual installation, then ai-init after yarn add @supersoniks/concorde.
4285
- 3. Commit AGENTS.md, .cursor/, and .aiassistant/ if your team shares agent settings.
4414
+ 3. Commit .cursor/ and .aiassistant/ (and AGENTS.md only if you opted in / it was created) if your team shares agent settings.
4286
4415
  4. Re-run the same command when you bump @supersoniks/concorde to refresh skills from nodemodules/@supersoniks/concorde/ai/.
4287
4416
  5. In Cursor, skills under .cursor/skills/ are picked up automatically; mention a skill in chat for focused tasks (e.g. migration → concorde-get-set-dp).
4288
4417
 
package/docs/llms.txt CHANGED
@@ -71,13 +71,13 @@ Custom
71
71
  - [@ancestorAttribute](https://concorde.supersoniks.org/crawl/docs/_decorators/ancestor-attribute.html) (docs/_decorators/ancestor-attribute): The @ancestorAttribute decorator automatically injects the value of an ancestor's attribute into a class property at the time of connectedCallback.
72
72
  - [@autoSubscribe](https://concorde.supersoniks.org/crawl/docs/_decorators/auto-subscribe.html) (docs/_decorators/auto-subscribe): > Legacy: prefer @subscribe + DataProviderKey. Examples below may still show PublisherManager for existing codebases.
73
73
  - [@bind](https://concorde.supersoniks.org/crawl/docs/_decorators/bind.html) (docs/_decorators/bind): Binds a class property to a path in a publisher. The property updates when publisher data changes.
74
- - [@get](https://concorde.supersoniks.org/crawl/docs/_decorators/get.html) (docs/_decorators/get): Loads data through API.getDetailed. The decorated property is ApiResult<T> | null: request, response (or null for dataProvider(...) resolution without HTTP), and typed result.
74
+ - [@get](https://concorde.supersoniks.org/crawl/docs/_decorators/get.html) (docs/_decorators/get): @get loads data and stores the result in an optional ApiResult<T> property.
75
75
  - [@handle](https://concorde.supersoniks.org/crawl/docs/_decorators/handle.html) (docs/_decorators/handle): Typed callback on one or more DataProviderKey<T> paths: invokes the decorated method when a publisher assigns a value (calculations, side effects, updating other @state properties, etc.).
76
76
  - [@onAssign](https://concorde.supersoniks.org/crawl/docs/_decorators/on-assign.html) (docs/_decorators/on-assign): > New apps: use @handle with DataProviderKey (Data flow). @onAssign uses untyped string paths; it remains documented for existing codebases — see Migrating to @handle below.
77
- - [@patch](https://concorde.supersoniks.org/crawl/docs/_decorators/patch.html) (docs/_decorators/patch): Sends data through API.patchDetailed. Same model as @post: decorated property is ApiResult<T> | null (request, response, result).
78
- - [@post](https://concorde.supersoniks.org/crawl/docs/_decorators/post.html) (docs/_decorators/post): Sends data through API.postDetailed. The decorated property is ApiResult<T> | null: request, response, and typed result.
77
+ - [@patch](https://concorde.supersoniks.org/crawl/docs/_decorators/patch.html) (docs/_decorators/patch): @patch applies a partial update with the body from a publisher. It uses the
78
+ - [@post](https://concorde.supersoniks.org/crawl/docs/_decorators/post.html) (docs/_decorators/post): @post sends the contents of a publisher and stores the response in an
79
79
  - [@publish](https://concorde.supersoniks.org/crawl/docs/_decorators/publish.html) (docs/_decorators/publish): Write-only binding: assigning to the property publishes to the DataProviderKey path. No read subscription (inverse of @subscribe).
80
- - [@put](https://concorde.supersoniks.org/crawl/docs/_decorators/put.html) (docs/_decorators/put): Sends data through API.putDetailed. Same model as @post: decorated property is ApiResult<T> | null (request, response, result).
80
+ - [@put](https://concorde.supersoniks.org/crawl/docs/_decorators/put.html) (docs/_decorators/put): @put replaces a resource with the body from a publisher. It uses exactly the
81
81
  - [@subscribe](https://concorde.supersoniks.org/crawl/docs/_decorators/subscribe.html) (docs/_decorators/subscribe): Keeps a Lit property in sync with a read-only slice of the DataProvider store. You pass a DataProviderKey; when that path changes, the property updates and the component re-renders.
82
82
  - [@awaitConnectedAncestors and @dispatchConnectedEvent](https://concorde.supersoniks.org/crawl/docs/_decorators/wait-for-ancestors.html) (docs/_decorators/wait-for-ancestors): The @awaitConnectedAncestors and @dispatchConnectedEvent decorators delay a web component's initialization until its matching ancestors have executed their connectedCallback. This is when contextual e
83
83
  - [sub()](https://concorde.supersoniks.org/crawl/docs/_directives/sub.html) (docs/_directives/sub): Read-only Lit directive: displays the current DataProvider value and updates whenever it is assigned.
File without changes