reflex-agent 0.18.1 → 0.19.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/.next/BUILD_ID +1 -1
- package/.next/app-build-manifest.json +99 -100
- package/.next/app-path-routes-manifest.json +8 -8
- package/.next/build-manifest.json +5 -5
- package/.next/prerender-manifest.json +3 -3
- package/.next/react-loadable-manifest.json +1 -1
- package/.next/required-server-files.json +2 -1
- package/.next/server/app/_not-found/page.js +1 -1
- package/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/agents/[agentId]/page.js +2 -2
- package/.next/server/app/agents/[agentId]/page.js.nft.json +1 -1
- package/.next/server/app/agents/[agentId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/api/agents/[agentId]/respond/route.js +1 -1
- package/.next/server/app/api/agents/[agentId]/respond/route.js.nft.json +1 -1
- package/.next/server/app/api/agents/[agentId]/respond/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/images/[rootId]/[file]/route.js +1 -1
- package/.next/server/app/api/images/[rootId]/[file]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/oauth/callback/route.js +2 -2
- package/.next/server/app/api/oauth/callback/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/oauth/start/route.js +1 -1
- package/.next/server/app/api/oauth/start/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/roots/[id]/attachments/route.js +0 -0
- package/.next/server/app/api/roots/[id]/attachments/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/send/route.js +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/send/route.js.nft.json +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/send/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/stop/route.js +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/stop/route.js.nft.json +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/stop/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/stream/route.js +2 -2
- package/.next/server/app/api/roots/[id]/chat/[topicId]/stream/route.js.nft.json +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/stream/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/roots/[id]/dashboard/route.js +1 -1
- package/.next/server/app/api/roots/[id]/dashboard/route.js.nft.json +1 -1
- package/.next/server/app/api/roots/[id]/dashboard/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/roots/[id]/suggestions/route.js +1 -1
- package/.next/server/app/api/roots/[id]/suggestions/route.js.nft.json +1 -1
- package/.next/server/app/api/roots/[id]/suggestions/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/bundle.js/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/host/route.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/host/route.js.nft.json +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/host/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/host-api.mjs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/host-ui.mjs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/iframe/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/style.css/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/install-archive/route_client-reference-manifest.js +1 -1
- package/.next/server/app/audit/page.js +2 -2
- package/.next/server/app/audit/page.js.nft.json +1 -1
- package/.next/server/app/audit/page_client-reference-manifest.js +1 -1
- package/.next/server/app/dispatcher/page.js +2 -2
- package/.next/server/app/dispatcher/page.js.nft.json +1 -1
- package/.next/server/app/dispatcher/page_client-reference-manifest.js +1 -1
- package/.next/server/app/onboarding/page.js +3 -3
- package/.next/server/app/onboarding/page.js.nft.json +1 -1
- package/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
- package/.next/server/app/page.js +2 -2
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/[id]/chat/[topicId]/page.js +2 -2
- package/.next/server/app/roots/[id]/chat/[topicId]/page.js.nft.json +1 -1
- package/.next/server/app/roots/[id]/chat/[topicId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/[id]/kb/[...slug]/page.js +2 -2
- package/.next/server/app/roots/[id]/kb/[...slug]/page.js.nft.json +1 -1
- package/.next/server/app/roots/[id]/kb/[...slug]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/[id]/memory/page.js +1 -1
- package/.next/server/app/roots/[id]/memory/page.js.nft.json +1 -1
- package/.next/server/app/roots/[id]/memory/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/[id]/page.js +6 -6
- package/.next/server/app/roots/[id]/page.js.nft.json +1 -1
- package/.next/server/app/roots/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/[id]/workflows/[wfId]/page.js +2 -2
- package/.next/server/app/roots/[id]/workflows/[wfId]/page.js.nft.json +1 -1
- package/.next/server/app/roots/[id]/workflows/[wfId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/[id]/workflows/page.js +2 -2
- package/.next/server/app/roots/[id]/workflows/page.js.nft.json +1 -1
- package/.next/server/app/roots/[id]/workflows/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/new/page.js +4 -4
- package/.next/server/app/roots/new/page.js.nft.json +1 -1
- package/.next/server/app/roots/new/page_client-reference-manifest.js +1 -1
- package/.next/server/app/settings/page.js +5 -5
- package/.next/server/app/settings/page.js.nft.json +1 -1
- package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/server/app/share/[id]/file/page.js +2 -2
- package/.next/server/app/share/[id]/file/page.js.nft.json +1 -1
- package/.next/server/app/share/[id]/file/page_client-reference-manifest.js +1 -1
- package/.next/server/app/share/[id]/page.js +2 -2
- package/.next/server/app/share/[id]/page.js.nft.json +1 -1
- package/.next/server/app/share/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/utilities/[scope]/[id]/page.js +2 -2
- package/.next/server/app/utilities/[scope]/[id]/page.js.nft.json +1 -1
- package/.next/server/app/utilities/[scope]/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/utilities/page.js +2 -2
- package/.next/server/app/utilities/page.js.nft.json +1 -1
- package/.next/server/app/utilities/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +8 -8
- package/.next/server/chunks/{6435.js → 1088.js} +1 -1
- package/.next/server/chunks/1105.js +1 -1
- package/.next/server/chunks/1179.js +1 -0
- package/.next/server/chunks/1223.js +1 -1
- package/.next/server/chunks/1244.js +1 -1
- package/.next/server/chunks/1281.js +80 -0
- package/.next/server/chunks/1336.js +252 -0
- package/.next/server/chunks/1353.js +51 -0
- package/.next/server/chunks/1431.js +1 -0
- package/.next/server/chunks/146.js +2 -0
- package/.next/server/chunks/1491.js +79 -0
- package/.next/server/chunks/1496.js +148 -0
- package/.next/server/chunks/{9631.js → 1589.js} +2 -2
- package/.next/server/chunks/1623.js +1 -0
- package/.next/server/chunks/1862.js +77 -0
- package/.next/server/chunks/1888.js +1 -1
- package/.next/server/chunks/1908.js +1 -0
- package/.next/server/chunks/192.js +1 -0
- package/.next/server/chunks/2069.js +1 -0
- package/.next/server/chunks/2087.js +24 -0
- package/.next/server/chunks/209.js +1 -0
- package/.next/server/chunks/2115.js +77 -0
- package/.next/server/chunks/2232.js +80 -0
- package/.next/server/chunks/{4460.js → 2262.js} +2 -2
- package/.next/server/chunks/2280.js +1 -0
- package/.next/server/chunks/2433.js +1 -1
- package/.next/server/chunks/2485.js +3 -8
- package/.next/server/chunks/2503.js +1 -1
- package/.next/server/chunks/2539.js +93 -0
- package/.next/server/chunks/2764.js +80 -0
- package/.next/server/chunks/285.js +24 -75
- package/.next/server/chunks/2888.js +7 -0
- package/.next/server/chunks/302.js +1 -0
- package/.next/server/chunks/3029.js +36 -0
- package/.next/server/chunks/3110.js +0 -0
- package/.next/server/chunks/3117.js +1 -0
- package/.next/server/chunks/3258.js +23 -0
- package/.next/server/chunks/331.js +1 -0
- package/.next/server/chunks/3332.js +1 -1
- package/.next/server/chunks/{4251.js → 3474.js} +24 -25
- package/.next/server/chunks/3552.js +43 -0
- package/.next/server/chunks/3583.js +104 -0
- package/.next/server/chunks/3631.js +1 -0
- package/.next/server/chunks/3633.js +1 -0
- package/.next/server/chunks/383.js +1 -80
- package/.next/server/chunks/3834.js +1 -1
- package/.next/server/chunks/3953.js +1 -0
- package/.next/server/chunks/3992.js +1 -0
- package/.next/server/chunks/4013.js +1 -0
- package/.next/server/chunks/4031.js +3 -3
- package/.next/server/chunks/4119.js +1 -0
- package/.next/server/chunks/4230.js +12 -0
- package/.next/server/chunks/4250.js +1 -0
- package/.next/server/chunks/4294.js +1 -0
- package/.next/server/chunks/4312.js +1 -0
- package/.next/server/chunks/4342.js +1 -0
- package/.next/server/chunks/4360.js +1 -0
- package/.next/server/chunks/449.js +226 -0
- package/.next/server/chunks/4578.js +0 -0
- package/.next/server/chunks/4585.js +1 -0
- package/.next/server/chunks/4611.js +1 -1
- package/.next/server/chunks/4639.js +1 -0
- package/.next/server/chunks/4682.js +1 -0
- package/.next/server/chunks/4788.js +153 -0
- package/.next/server/chunks/4812.js +2 -2
- package/.next/server/chunks/4925.js +1 -1
- package/.next/server/chunks/4952.js +1 -0
- package/.next/server/chunks/4969.js +4 -0
- package/.next/server/chunks/4989.js +801 -0
- package/.next/server/chunks/5211.js +64 -0
- package/.next/server/chunks/5243.js +1 -1
- package/.next/server/chunks/5308.js +1 -0
- package/.next/server/chunks/5461.js +1 -0
- package/.next/server/chunks/5549.js +1 -0
- package/.next/server/chunks/5719.js +34 -0
- package/.next/server/chunks/5810.js +12 -0
- package/.next/server/chunks/5922.js +1 -0
- package/.next/server/chunks/6142.js +1 -1
- package/.next/server/chunks/6216.js +1 -1
- package/.next/server/chunks/6318.js +9 -0
- package/.next/server/chunks/6483.js +1 -1
- package/.next/server/chunks/6509.js +1 -0
- package/.next/server/chunks/6571.js +166 -0
- package/.next/server/chunks/660.js +1 -0
- package/.next/server/chunks/6692.js +1 -0
- package/.next/server/chunks/6730.js +1 -1
- package/.next/server/chunks/6852.js +1 -0
- package/.next/server/chunks/{9703.js → 6970.js} +1 -1
- package/.next/server/chunks/7007.js +1 -0
- package/.next/server/chunks/7188.js +1 -1
- package/.next/server/chunks/7220.js +1 -1
- package/.next/server/chunks/7228.js +1 -0
- package/.next/server/chunks/7244.js +1 -0
- package/.next/server/chunks/7373.js +90 -0
- package/.next/server/chunks/7430.js +1 -1
- package/.next/server/chunks/7523.js +1 -0
- package/.next/server/chunks/7576.js +1 -0
- package/.next/server/chunks/7742.js +7 -0
- package/.next/server/chunks/7811.js +215 -0
- package/.next/server/chunks/7885.js +1 -0
- package/.next/server/chunks/8032.js +3 -0
- package/.next/server/chunks/8095.js +24 -0
- package/.next/server/chunks/8129.js +5 -0
- package/.next/server/chunks/8294.js +1 -0
- package/.next/server/chunks/832.js +1 -0
- package/.next/server/chunks/8464.js +180 -0
- package/.next/server/chunks/8511.js +0 -0
- package/.next/server/chunks/8514.js +1 -1
- package/.next/server/chunks/8583.js +4 -0
- package/.next/server/chunks/8609.js +55 -0
- package/.next/server/chunks/8711.js +1 -0
- package/.next/server/chunks/8714.js +1 -0
- package/.next/server/chunks/8730.js +1 -0
- package/.next/server/chunks/8868.js +1 -0
- package/.next/server/chunks/9048.js +1 -0
- package/.next/server/chunks/9058.js +1 -0
- package/.next/server/chunks/9062.js +1 -0
- package/.next/server/chunks/9094.js +1 -0
- package/.next/server/chunks/9098.js +1 -1
- package/.next/server/chunks/9099.js +1 -0
- package/.next/server/chunks/9171.js +287 -0
- package/.next/server/chunks/9181.js +1 -0
- package/.next/server/chunks/9293.js +1 -1
- package/.next/server/chunks/9478.js +1 -0
- package/.next/server/chunks/9494.js +141 -0
- package/.next/server/chunks/952.js +1 -0
- package/.next/server/chunks/9600.js +1 -0
- package/.next/server/chunks/9607.js +29 -0
- package/.next/server/chunks/9653.js +115 -0
- package/.next/server/chunks/9784.js +1 -0
- package/.next/server/chunks/9798.js +1 -0
- package/.next/server/chunks/9990.js +1 -0
- package/.next/server/edge-instrumentation.js +2 -0
- package/.next/server/edge-instrumentation.js.map +1 -0
- package/.next/server/functions-config-manifest.json +2 -2
- package/.next/server/instrumentation.js +1 -0
- package/.next/server/instrumentation.js.nft.json +1 -0
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/middleware-manifest.json +6 -5
- package/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/pages/_error.js +3 -3
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/3363-f417b308a8cd156d.js +1 -0
- package/.next/static/chunks/3686-0107521d2c14950c.js +1 -0
- package/.next/static/chunks/3695-3576767108de7f38.js +1 -0
- package/.next/static/chunks/4108.19abaa6d618295ed.js +1 -0
- package/.next/static/chunks/5933-4013a6dab4565b5e.js +1 -0
- package/.next/static/chunks/7425-9684ea815b4b1731.js +1 -0
- package/.next/static/chunks/7552-def8a17828891c8c.js +1 -0
- package/.next/static/chunks/8776-2df966dd98c68fd7.js +1 -0
- package/.next/static/chunks/app/layout-baad68d32b917b8f.js +1 -0
- package/.next/static/chunks/app/onboarding/{page-25b3a1c1da972648.js → page-b1b1e6a4467ed781.js} +1 -1
- package/.next/static/chunks/app/page-556a2139313c3c71.js +1 -0
- package/.next/static/chunks/app/roots/[id]/chat/[topicId]/page-52223811258d07b2.js +1 -0
- package/.next/static/chunks/app/roots/[id]/kb/[...slug]/page-0df769f27549cd16.js +1 -0
- package/.next/static/chunks/app/roots/[id]/memory/{page-c69f17be3048bdc2.js → page-1f6bc3a624b141a5.js} +1 -1
- package/.next/static/chunks/app/roots/[id]/page-17493991b2d391b3.js +1 -0
- package/.next/static/chunks/app/roots/[id]/workflows/[wfId]/page-a21fe3541418a80a.js +1 -0
- package/.next/static/chunks/app/roots/[id]/workflows/{page-39f9bcc115ebee4b.js → page-0952e5fb53d53c3e.js} +1 -1
- package/.next/static/chunks/app/roots/new/page-4f571184c1856103.js +1 -0
- package/.next/static/chunks/app/settings/page-8c0ad1c1856da988.js +1 -0
- package/.next/static/chunks/app/share/[id]/page-b27a0bc7b9c6cda9.js +1 -0
- package/.next/static/chunks/app/utilities/[scope]/[id]/page-0fe4c377098064d5.js +1 -0
- package/.next/static/chunks/app/utilities/page-445933dcd5a500ae.js +1 -0
- package/.next/static/chunks/{webpack-648ac9036cb1b816.js → webpack-88066a85eb2d605f.js} +1 -1
- package/.next/trace +116 -90
- package/dist/lib/reflex/ids.js +66 -0
- package/dist/lib/reflex/ids.js.map +1 -0
- package/dist/lib/reflex/paths.js +26 -0
- package/dist/lib/reflex/paths.js.map +1 -1
- package/dist/lib/reflex/store/json-store.js +50 -0
- package/dist/lib/reflex/store/json-store.js.map +1 -0
- package/package.json +10 -6
- package/.next/server/chunks/133.js +0 -1
- package/.next/server/chunks/1358.js +0 -1
- package/.next/server/chunks/1525.js +0 -1
- package/.next/server/chunks/2787.js +0 -1
- package/.next/server/chunks/3240.js +0 -1
- package/.next/server/chunks/3295.js +0 -1
- package/.next/server/chunks/404.js +0 -3
- package/.next/server/chunks/4842.js +0 -1
- package/.next/server/chunks/5319.js +0 -1
- package/.next/server/chunks/5543.js +0 -1
- package/.next/server/chunks/569.js +0 -1
- package/.next/server/chunks/6217.js +0 -1
- package/.next/server/chunks/7229.js +0 -2
- package/.next/server/chunks/8124.js +0 -1
- package/.next/server/chunks/8576.js +0 -7
- package/.next/server/chunks/9186.js +0 -4
- package/.next/server/chunks/9809.js +0 -1
- package/.next/server/chunks/9835.js +0 -1
- package/.next/static/chunks/4035-c900a19ab709c489.js +0 -1
- package/.next/static/chunks/4108.2a1cd2be227d1db6.js +0 -1
- package/.next/static/chunks/5572-cc7066942d006956.js +0 -1
- package/.next/static/chunks/59-8d4a53ee7c914335.js +0 -1
- package/.next/static/chunks/6568-e4d2de23d9f8d347.js +0 -1
- package/.next/static/chunks/7343-d414cbf00d7903b3.js +0 -1
- package/.next/static/chunks/8523-ce9e5fd4102e0550.js +0 -1
- package/.next/static/chunks/8566-5d4c89b722d9cee1.js +0 -1
- package/.next/static/chunks/8775-890699c74c28df61.js +0 -1
- package/.next/static/chunks/app/layout-61561440bde8894f.js +0 -1
- package/.next/static/chunks/app/page-a73a8abd219d328f.js +0 -1
- package/.next/static/chunks/app/roots/[id]/chat/[topicId]/page-1c1825c48749b024.js +0 -1
- package/.next/static/chunks/app/roots/[id]/kb/[...slug]/page-aa97c0262e3f3a94.js +0 -1
- package/.next/static/chunks/app/roots/[id]/page-5385296d9e6fb5bd.js +0 -1
- package/.next/static/chunks/app/roots/[id]/workflows/[wfId]/page-3d141c8450f93771.js +0 -1
- package/.next/static/chunks/app/roots/new/page-be08d7bdb6d3ec29.js +0 -1
- package/.next/static/chunks/app/settings/page-1a56d55862b78015.js +0 -1
- package/.next/static/chunks/app/share/[id]/page-4713e54d2c21a7d8.js +0 -1
- package/.next/static/chunks/app/utilities/[scope]/[id]/page-749569080a03f192.js +0 -1
- package/.next/static/chunks/app/utilities/page-7ec6d0962a63b2cf.js +0 -1
- /package/.next/static/{wqvqGv9K0VMAHRhcQ6dS5 → EXoiX_YvMRCB6oNXqJnaz}/_buildManifest.js +0 -0
- /package/.next/static/{wqvqGv9K0VMAHRhcQ6dS5 → EXoiX_YvMRCB6oNXqJnaz}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical id / slug sanitizers for Reflex (north-star SpaceStore, Layer 1).
|
|
3
|
+
*
|
|
4
|
+
* Historically every store rolled its own. These are the SAME implementations,
|
|
5
|
+
* gathered in one place so the variants are named and discoverable. They are
|
|
6
|
+
* deliberately NOT collapsed into one parameterized function: the behaviors
|
|
7
|
+
* differ in subtle ways (allowed charset, ASCII vs unicode, length cap, whether
|
|
8
|
+
* existing dashes survive) and merging them would silently rename existing
|
|
9
|
+
* on-disk files. Cohesion of location, not of implementation.
|
|
10
|
+
*
|
|
11
|
+
* Pure, dependency-free (so it compiles cleanly under both the app and CLI
|
|
12
|
+
* tsconfigs and sits at the bottom of the import-direction graph).
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Strip everything except `[A-Za-z0-9_-]` (no replacement, no length cap).
|
|
16
|
+
* Topic ids — a filename must round-trip an externally supplied id without
|
|
17
|
+
* changing its length. (was: lib/server/topics.ts)
|
|
18
|
+
*/
|
|
19
|
+
export function sanitizeIdStrip(id) {
|
|
20
|
+
return id.replace(/[^A-Za-z0-9_-]/g, "");
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Replace disallowed chars with `-` and cap at 80. Widget + workflow ids
|
|
24
|
+
* (agent-authored, kebab-ish). (was: lib/server/widgets/store.ts,
|
|
25
|
+
* lib/server/workflows/store.ts — identical)
|
|
26
|
+
*/
|
|
27
|
+
export function sanitizeIdDash(id) {
|
|
28
|
+
return id.replace(/[^A-Za-z0-9_-]/g, "-").slice(0, 80);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* NFKD + lowercase ASCII slug, trimmed of leading/trailing dashes, capped at
|
|
32
|
+
* 60. Task ids. (was: lib/server/tasks/store.ts)
|
|
33
|
+
*/
|
|
34
|
+
export function slugify(s) {
|
|
35
|
+
return s
|
|
36
|
+
.normalize("NFKD")
|
|
37
|
+
.toLowerCase()
|
|
38
|
+
.replace(/[^a-z0-9]+/g, "-")
|
|
39
|
+
.replace(/^-+|-+$/g, "")
|
|
40
|
+
.slice(0, 60);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* NFKD + lowercase UNICODE-aware slug (keeps non-ASCII letters/numbers),
|
|
44
|
+
* trimmed, capped at 60. KB filenames. (was: lib/server/agents/kb-writer.ts)
|
|
45
|
+
*/
|
|
46
|
+
export function slugifyUnicode(s) {
|
|
47
|
+
return s
|
|
48
|
+
.normalize("NFKD")
|
|
49
|
+
.toLowerCase()
|
|
50
|
+
.replace(/[^\p{L}\p{N}]+/gu, "-")
|
|
51
|
+
.replace(/^-+|-+$/g, "")
|
|
52
|
+
.slice(0, 60);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Trim + lowercase, collapse to `[a-z0-9-]` (existing dashes preserved, no
|
|
56
|
+
* NFKD), trimmed, capped at 64. Skill handles. (was: lib/server/skills.ts)
|
|
57
|
+
*/
|
|
58
|
+
export function slugifyHandle(raw) {
|
|
59
|
+
return raw
|
|
60
|
+
.trim()
|
|
61
|
+
.toLowerCase()
|
|
62
|
+
.replace(/[^a-z0-9-]+/g, "-")
|
|
63
|
+
.replace(/^-+|-+$/g, "")
|
|
64
|
+
.slice(0, 64);
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=ids.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ids.js","sourceRoot":"","sources":["../../../lib/reflex/ids.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,EAAU;IACxC,OAAO,EAAE,CAAC,OAAO,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAC;AAC3C,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,EAAU;IACvC,OAAO,EAAE,CAAC,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AACzD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,OAAO,CAAC,CAAS;IAC/B,OAAO,CAAC;SACL,SAAS,CAAC,MAAM,CAAC;SACjB,WAAW,EAAE;SACb,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC;SAC3B,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC;SACvB,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAClB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,CAAS;IACtC,OAAO,CAAC;SACL,SAAS,CAAC,MAAM,CAAC;SACjB,WAAW,EAAE;SACb,OAAO,CAAC,kBAAkB,EAAE,GAAG,CAAC;SAChC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC;SACvB,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAClB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,GAAW;IACvC,OAAO,GAAG;SACP,IAAI,EAAE;SACN,WAAW,EAAE;SACb,OAAO,CAAC,cAAc,EAAE,GAAG,CAAC;SAC5B,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC;SACvB,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAClB,CAAC"}
|
package/dist/lib/reflex/paths.js
CHANGED
|
@@ -30,4 +30,30 @@ export function mirrorInReflex(root, relDir) {
|
|
|
30
30
|
export function subdirIndexPath(root, relDir) {
|
|
31
31
|
return path.join(mirrorInReflex(root, relDir), INDEX_MD);
|
|
32
32
|
}
|
|
33
|
+
// ---------------------------------------------------------------------------
|
|
34
|
+
// Per-Space (project) .reflex sub-locations. `reflexRoot()` is the SOLE place
|
|
35
|
+
// the literal ".reflex" appears — every store resolves its directory through
|
|
36
|
+
// these helpers, never by hand-joining ".reflex". (north-star SpaceStore)
|
|
37
|
+
/** Join segments under `<root>/.reflex/`. */
|
|
38
|
+
export function reflexSubpath(root, ...segs) {
|
|
39
|
+
return path.join(reflexRoot(root), ...segs);
|
|
40
|
+
}
|
|
41
|
+
export function topicsDir(root) {
|
|
42
|
+
return reflexSubpath(root, "topics");
|
|
43
|
+
}
|
|
44
|
+
export function widgetsDir(root) {
|
|
45
|
+
return reflexSubpath(root, "widgets");
|
|
46
|
+
}
|
|
47
|
+
export function workflowsDir(root) {
|
|
48
|
+
return reflexSubpath(root, "workflows");
|
|
49
|
+
}
|
|
50
|
+
export function memoryDir(root) {
|
|
51
|
+
return reflexSubpath(root, "memory");
|
|
52
|
+
}
|
|
53
|
+
export function projectSkillsDir(root) {
|
|
54
|
+
return reflexSubpath(root, "skills");
|
|
55
|
+
}
|
|
56
|
+
export function suggestionsFile(root) {
|
|
57
|
+
return reflexSubpath(root, "suggestions.json");
|
|
58
|
+
}
|
|
33
59
|
//# sourceMappingURL=paths.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../../lib/reflex/paths.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,MAAM,CAAC,MAAM,UAAU,GAAG,SAAS,CAAC;AACpC,MAAM,CAAC,MAAM,aAAa,GAAG,eAAe,CAAC;AAC7C,MAAM,CAAC,MAAM,aAAa,GAAG,aAAa,CAAC;AAC3C,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAAC;AAEnC,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC;IACnC,SAAS;IACT,MAAM;IACN,cAAc;IACd,WAAW;CACZ,CAAC,CAAC;AAEH,oCAAoC;AACpC,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAClD,0GAA0G;AAC1G,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,CAAC;AAEpC,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;AACrC,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,aAAa,CAAC,CAAC;AACpD,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,OAAO,IAAI,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;AACD,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,OAAO,aAAa,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { promises as fs } from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
const locks = (globalThis.__reflexJsonStoreLocks ??=
|
|
4
|
+
new Map());
|
|
5
|
+
/** Run `fn` after any in-flight write to `file` settles (success or failure). */
|
|
6
|
+
export function withFileLock(file, fn) {
|
|
7
|
+
const prev = locks.get(file) ?? Promise.resolve();
|
|
8
|
+
const next = prev.then(fn, fn);
|
|
9
|
+
// Track a non-throwing tail so a rejected write can't wedge the chain.
|
|
10
|
+
locks.set(file, next.then(noop, noop));
|
|
11
|
+
return next;
|
|
12
|
+
}
|
|
13
|
+
function noop() { }
|
|
14
|
+
function isNotFound(err) {
|
|
15
|
+
return (typeof err === "object" &&
|
|
16
|
+
err !== null &&
|
|
17
|
+
"code" in err &&
|
|
18
|
+
err.code === "ENOENT");
|
|
19
|
+
}
|
|
20
|
+
/** Read + JSON.parse a file, or `null` if it doesn't exist. Throws on other IO
|
|
21
|
+
* / parse errors so corruption is surfaced, not silently swallowed. */
|
|
22
|
+
export async function readJsonFile(file) {
|
|
23
|
+
let raw;
|
|
24
|
+
try {
|
|
25
|
+
raw = await fs.readFile(file, "utf8");
|
|
26
|
+
}
|
|
27
|
+
catch (err) {
|
|
28
|
+
if (isNotFound(err))
|
|
29
|
+
return null;
|
|
30
|
+
throw err;
|
|
31
|
+
}
|
|
32
|
+
return JSON.parse(raw);
|
|
33
|
+
}
|
|
34
|
+
/** Atomically write a value as pretty JSON (tmp + rename), serialized per file. */
|
|
35
|
+
export async function writeJsonFile(file, value, opts = {}) {
|
|
36
|
+
await withFileLock(file, async () => {
|
|
37
|
+
await fs.mkdir(path.dirname(file), { recursive: true });
|
|
38
|
+
const tmp = `${file}.tmp`; // unique under the per-file lock (one writer)
|
|
39
|
+
const body = JSON.stringify(value, null, 2) + "\n";
|
|
40
|
+
await fs.writeFile(tmp, body, {
|
|
41
|
+
encoding: "utf8",
|
|
42
|
+
...(opts.mode !== undefined ? { mode: opts.mode } : {}),
|
|
43
|
+
});
|
|
44
|
+
// Re-assert mode in case umask masked it on create.
|
|
45
|
+
if (opts.mode !== undefined)
|
|
46
|
+
await fs.chmod(tmp, opts.mode);
|
|
47
|
+
await fs.rename(tmp, file);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=json-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json-store.js","sourceRoot":"","sources":["../../../../lib/reflex/store/json-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,IAAI,MAAM,WAAW,CAAC;AAyB7B,MAAM,KAAK,GAAkC,CAAC,UAAU,CAAC,sBAAsB;IAC7E,IAAI,GAAG,EAAE,CAAC,CAAC;AAEb,iFAAiF;AACjF,MAAM,UAAU,YAAY,CAAI,IAAY,EAAE,EAAoB;IAChE,MAAM,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;IAClD,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;IAC/B,uEAAuE;IACvE,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;IACvC,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,IAAI,KAAU,CAAC;AAExB,SAAS,UAAU,CAAC,GAAY;IAC9B,OAAO,CACL,OAAO,GAAG,KAAK,QAAQ;QACvB,GAAG,KAAK,IAAI;QACZ,MAAM,IAAI,GAAG;QACZ,GAAwB,CAAC,IAAI,KAAK,QAAQ,CAC5C,CAAC;AAC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AM,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAC7B,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reflex-agent",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Local-first knowledge base built by an agent over a chosen directory.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "legostin",
|
|
8
|
-
"homepage": "https://github.com/
|
|
8
|
+
"homepage": "https://github.com/reflex-agent/reflex-agent#readme",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
|
-
"url": "git+https://github.com/
|
|
11
|
+
"url": "git+https://github.com/reflex-agent/reflex-agent.git"
|
|
12
12
|
},
|
|
13
13
|
"bugs": {
|
|
14
|
-
"url": "https://github.com/
|
|
14
|
+
"url": "https://github.com/reflex-agent/reflex-agent/issues"
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"bin": {
|
|
@@ -35,7 +35,10 @@
|
|
|
35
35
|
"build:cli": "tsc -p tsconfig.cli.json",
|
|
36
36
|
"typecheck": "tsc --noEmit && tsc -p tsconfig.cli.json --noEmit",
|
|
37
37
|
"prepack": "node -e \"require('fs').rmSync('.next/cache', { recursive: true, force: true })\"",
|
|
38
|
-
"prepublishOnly": "pnpm run build"
|
|
38
|
+
"prepublishOnly": "pnpm run build",
|
|
39
|
+
"test": "vitest run",
|
|
40
|
+
"test:watch": "vitest",
|
|
41
|
+
"lint:boundaries": "node scripts/check-boundaries.mjs"
|
|
39
42
|
},
|
|
40
43
|
"engines": {
|
|
41
44
|
"node": ">=20"
|
|
@@ -84,6 +87,7 @@
|
|
|
84
87
|
"@types/node": "^24",
|
|
85
88
|
"@types/react": "^19",
|
|
86
89
|
"@types/react-dom": "^19",
|
|
87
|
-
"typescript": "^6"
|
|
90
|
+
"typescript": "^6",
|
|
91
|
+
"vitest": "^4.1.7"
|
|
88
92
|
}
|
|
89
93
|
}
|