nodal-agents 0.9.8 → 0.9.9
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/cli.js +948 -424
- package/docs-index.json +12 -4
- package/migrations/0153_entities_sandbox.sql +19 -0
- package/migrations/0154_file_move_rules.sql +21 -0
- package/migrations/0155_deliverable_removed.sql +20 -0
- package/migrations/meta/_journal.json +21 -0
- package/package.json +2 -1
- package/runner.js +31660 -12406
- package/web/.next/BUILD_ID +1 -1
- package/web/.next/app-path-routes-manifest.json +3 -3
- package/web/.next/build-manifest.json +2 -2
- package/web/.next/prerender-manifest.json +3 -3
- package/web/.next/server/app/(dashboard)/agents/[id]/channels/page.js +1 -1
- package/web/.next/server/app/(dashboard)/agents/[id]/channels/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/agents/[id]/edit/page.js +4 -4
- package/web/.next/server/app/(dashboard)/agents/[id]/edit/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/agents/[id]/telegram/page.js +1 -1
- package/web/.next/server/app/(dashboard)/agents/[id]/telegram/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/agents/page.js +1 -1
- package/web/.next/server/app/(dashboard)/agents/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/approvals/page.js +1 -1
- package/web/.next/server/app/(dashboard)/approvals/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/automations/[id]/page.js +1 -1
- package/web/.next/server/app/(dashboard)/automations/[id]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/automations/page.js +1 -1
- package/web/.next/server/app/(dashboard)/automations/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/chat/[id]/page.js +1 -1
- package/web/.next/server/app/(dashboard)/chat/[id]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/chat/page.js +1 -1
- package/web/.next/server/app/(dashboard)/chat/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/chat/runs/[id]/page.js +1 -1
- package/web/.next/server/app/(dashboard)/chat/runs/[id]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/code/[id]/page.js +1 -1
- package/web/.next/server/app/(dashboard)/code/[id]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/code/page.js +1 -1
- package/web/.next/server/app/(dashboard)/code/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/connectors/page.js +1 -1
- package/web/.next/server/app/(dashboard)/connectors/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/credentials/page.js +1 -1
- package/web/.next/server/app/(dashboard)/credentials/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/dashboard/page.js +1 -1
- package/web/.next/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/jobs/[id]/page.js +1 -1
- package/web/.next/server/app/(dashboard)/jobs/[id]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/jobs/page.js +1 -1
- package/web/.next/server/app/(dashboard)/jobs/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/learned-skills/page.js +1 -1
- package/web/.next/server/app/(dashboard)/learned-skills/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/llm-providers/page.js +1 -1
- package/web/.next/server/app/(dashboard)/llm-providers/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/logs/page.js +1 -1
- package/web/.next/server/app/(dashboard)/logs/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/mcp/page.js +1 -1
- package/web/.next/server/app/(dashboard)/mcp/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/memories/page.js +1 -1
- package/web/.next/server/app/(dashboard)/memories/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/page.js +1 -1
- package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/runs/[id]/page.js +1 -1
- package/web/.next/server/app/(dashboard)/runs/[id]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/scheduled/[id]/page.js +1 -1
- package/web/.next/server/app/(dashboard)/scheduled/[id]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/scheduled/page.js +1 -1
- package/web/.next/server/app/(dashboard)/scheduled/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/settings/page.js +1 -1
- package/web/.next/server/app/(dashboard)/settings/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/settings/root-context/page.js +1 -1
- package/web/.next/server/app/(dashboard)/settings/root-context/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/skills/[id]/edit/page.js +1 -1
- package/web/.next/server/app/(dashboard)/skills/[id]/edit/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/skills/new/page.js +1 -1
- package/web/.next/server/app/(dashboard)/skills/new/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/skills/page.js +1 -1
- package/web/.next/server/app/(dashboard)/skills/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/spaces/[id]/files/page.js +1 -1
- package/web/.next/server/app/(dashboard)/spaces/[id]/files/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/spaces/[id]/page.js +1 -1
- package/web/.next/server/app/(dashboard)/spaces/[id]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/spaces/page.js +1 -1
- package/web/.next/server/app/(dashboard)/spaces/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/_global-error.html +1 -1
- package/web/.next/server/app/_global-error.rsc +2 -2
- package/web/.next/server/app/_global-error.segments/_full.segment.rsc +2 -2
- package/web/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +2 -2
- package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/_not-found.html +1 -1
- package/web/.next/server/app/_not-found.rsc +3 -3
- package/web/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
- package/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +3 -3
- package/web/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/web/.next/server/app/api/approvals/[id]/attachments/[position]/route.js +1 -1
- package/web/.next/server/app/api/chat/live/route.js +2 -2
- package/web/.next/server/app/api/chat/stop/route.js +1 -1
- package/web/.next/server/app/api/chat/stream/route.js +1 -1
- package/web/.next/server/app/api/health/route.js +1 -1
- package/web/.next/server/app/api/oauth/[provider]/callback/route.js +1 -1
- package/web/.next/server/app/api/oauth/[provider]/start/route.js +1 -1
- package/web/.next/server/app/api/runs/[jobId]/media/route.js +1 -1
- package/web/.next/server/app/login/page.js +1 -1
- package/web/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/onboarding/page.js +2 -2
- package/web/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app-paths-manifest.json +3 -3
- package/web/.next/server/chunks/1281.js +1 -0
- package/web/.next/server/chunks/1535.js +1 -0
- package/web/.next/server/chunks/1649.js +1 -0
- package/web/.next/server/chunks/1938.js +1 -0
- package/web/.next/server/chunks/2732.js +1 -0
- package/web/.next/server/chunks/3459.js +1 -0
- package/web/.next/server/chunks/3479.js +1 -0
- package/web/.next/server/chunks/356.js +220 -202
- package/web/.next/server/chunks/3648.js +4 -4
- package/web/.next/server/chunks/3796.js +1 -0
- package/web/.next/server/chunks/4047.js +1 -0
- package/web/.next/server/chunks/4141.js +1 -0
- package/web/.next/server/chunks/4174.js +1 -1
- package/web/.next/server/chunks/4679.js +3 -0
- package/web/.next/server/chunks/468.js +1 -1
- package/web/.next/server/chunks/5147.js +1 -1
- package/web/.next/server/chunks/5150.js +1 -0
- package/web/.next/server/chunks/516.js +293 -275
- package/web/.next/server/chunks/5162.js +5 -5
- package/web/.next/server/chunks/552.js +1 -0
- package/web/.next/server/chunks/{7175.js → 6615.js} +1 -1
- package/web/.next/server/chunks/6785.js +1 -0
- package/web/.next/server/chunks/7214.js +4 -0
- package/web/.next/server/chunks/7557.js +1 -0
- package/web/.next/server/chunks/7588.js +1 -0
- package/web/.next/server/chunks/{8459.js → 8294.js} +41 -23
- package/web/.next/server/chunks/8501.js +1 -1
- package/web/.next/server/chunks/9020.js +1 -0
- package/web/.next/server/chunks/9046.js +1 -0
- package/web/.next/server/chunks/9116.js +1 -0
- package/web/.next/server/chunks/9156.js +1 -1
- package/web/.next/server/chunks/9422.js +1 -0
- package/web/.next/server/chunks/9478.js +1 -0
- package/web/.next/server/chunks/9825.js +1 -0
- package/web/.next/server/middleware-build-manifest.js +1 -1
- package/web/.next/server/middleware.js +8 -8
- package/web/.next/server/pages/404.html +1 -1
- package/web/.next/server/pages/500.html +1 -1
- package/web/.next/server/server-reference-manifest.js +1 -1
- package/web/.next/server/server-reference-manifest.json +1 -1
- package/web/.next/static/chunks/1105-c1af5f935c1b296b.js +1 -0
- package/web/.next/static/chunks/1323-ce46401bde642586.js +1 -0
- package/web/.next/static/chunks/1605-42d5f7214a636e07.js +1 -0
- package/web/.next/static/chunks/1882-1e0d8fba6f060be9.js +1 -0
- package/web/.next/static/chunks/2022-2d187a4632a2981a.js +1 -0
- package/web/.next/static/chunks/{2254-244287cb1e60aa30.js → 2254-6f5c7336b4fa87a1.js} +1 -1
- package/web/.next/static/chunks/2270-18b227cf4fc86ac6.js +1 -0
- package/web/.next/static/chunks/2577-4a8d5e545dd2fee1.js +1 -0
- package/web/.next/static/chunks/2678-08cea573703e895b.js +1 -0
- package/web/.next/static/chunks/3704-114879d418666c0e.js +1 -0
- package/web/.next/static/chunks/3717-373fccf7f94111d0.js +1 -0
- package/web/.next/static/chunks/4118-11396743a0188ca9.js +1 -0
- package/web/.next/static/chunks/4249-eb20c0f688a69b50.js +1 -0
- package/web/.next/static/chunks/4969-d5f2aed2d0be914a.js +3 -0
- package/web/.next/static/chunks/50-034012e4ba71168c.js +1 -0
- package/web/.next/static/chunks/{403-8cc5d1aea6b6f523.js → 5424-a38bf5b5306554d6.js} +41 -23
- package/web/.next/static/chunks/{5483-fca4ffcb3f85c6fb.js → 5483-61e5edbac084e20b.js} +1 -1
- package/web/.next/static/chunks/5669-4fee99f5eb855265.js +1 -0
- package/web/.next/static/chunks/6120-8c09a4c542c0f01c.js +1 -0
- package/web/.next/static/chunks/624-36d4d653a97b44c1.js +1 -0
- package/web/.next/static/chunks/6991-c7cc499c3261a834.js +1 -0
- package/web/.next/static/chunks/7194-ff0a83a29cf904f4.js +1 -0
- package/web/.next/static/chunks/7968-01e43e08b068c63e.js +1 -0
- package/web/.next/static/chunks/{8-c335caa6caeb049d.js → 8-1a1f63cae3bf00df.js} +1 -1
- package/web/.next/static/chunks/8192-c401a8362827171e.js +1 -0
- package/web/.next/static/chunks/8285-9aafccfab5abd67a.js +1 -0
- package/web/.next/static/chunks/8289-6ae585768f8b7580.js +1 -0
- package/web/.next/static/chunks/8771-896952a0838e213d.js +1 -0
- package/web/.next/static/chunks/896-51e1fc2dedeb5132.js +1 -0
- package/web/.next/static/chunks/9328-3ee5fc554371e418.js +1 -0
- package/web/.next/static/chunks/9761-20181ee3d10195b1.js +1 -0
- package/web/.next/static/chunks/app/(dashboard)/agents/[id]/edit/page-c5d6aeb2d8b715f3.js +6 -0
- package/web/.next/static/chunks/app/(dashboard)/agents/page-fc50102f2b386f63.js +1 -0
- package/web/.next/static/chunks/app/(dashboard)/approvals/page-f8799ac53a8e83f5.js +1 -0
- package/web/.next/static/chunks/app/(dashboard)/automations/[id]/{page-eb929411b2171a23.js → page-82fbd60536376a75.js} +1 -1
- package/web/.next/static/chunks/app/(dashboard)/automations/{page-6afc0d482c90a382.js → page-eedff94de6964aaa.js} +1 -1
- package/web/.next/static/chunks/app/(dashboard)/chat/[id]/{page-a73977a452da0942.js → page-223822224161efb3.js} +1 -1
- package/web/.next/static/chunks/app/(dashboard)/chat/page-8f94f090ac8191e9.js +1 -0
- package/web/.next/static/chunks/app/(dashboard)/chat/runs/[id]/{page-44d486f5a33c884a.js → page-781c3053fac080da.js} +1 -1
- package/web/.next/static/chunks/app/(dashboard)/code/[id]/page-8860c74bbdc52c6e.js +1 -0
- package/web/.next/static/chunks/app/(dashboard)/connectors/page-3f3ce0ffc04c5e63.js +1 -0
- package/web/.next/static/chunks/app/(dashboard)/credentials/{page-d886eee303b1c88b.js → page-69cd2f02924392b7.js} +1 -1
- package/web/.next/static/chunks/app/(dashboard)/dashboard/{page-d384d390d1d45dd2.js → page-d551da63bf4acf25.js} +1 -1
- package/web/.next/static/chunks/app/(dashboard)/jobs/[id]/{page-44d486f5a33c884a.js → page-781c3053fac080da.js} +1 -1
- package/web/.next/static/chunks/app/(dashboard)/layout-1dde3c5433b9d173.js +1 -0
- package/web/.next/static/chunks/app/(dashboard)/learned-skills/page-29c7563b2f8237f1.js +1 -0
- package/web/.next/static/chunks/app/(dashboard)/llm-providers/page-04592013264bdff4.js +1 -0
- package/web/.next/static/chunks/app/(dashboard)/logs/page-86c7bcb74c266a8b.js +1 -0
- package/web/.next/static/chunks/app/(dashboard)/mcp/page-3b31d1f65a63e1f4.js +1 -0
- package/web/.next/static/chunks/app/(dashboard)/memories/page-bb6caeb225265767.js +1 -0
- package/web/.next/static/chunks/app/(dashboard)/page-359187b8a486ee44.js +1 -0
- package/web/.next/static/chunks/app/(dashboard)/runs/[id]/{page-169cf48cbb8ea17a.js → page-936209e46471e13b.js} +1 -1
- package/web/.next/static/chunks/app/(dashboard)/settings/page-6523b24563af92c5.js +1 -0
- package/web/.next/static/chunks/app/(dashboard)/settings/root-context/page-e683a45124a95aa4.js +1 -0
- package/web/.next/static/chunks/app/(dashboard)/skills/[id]/edit/page-b78284a7211c0bed.js +1 -0
- package/web/.next/static/chunks/app/(dashboard)/skills/new/page-974d0bd639ccfbd4.js +1 -0
- package/web/.next/static/chunks/app/(dashboard)/skills/page-ebce6ad6d7354904.js +1 -0
- package/web/.next/static/chunks/app/(dashboard)/spaces/[id]/files/page-672fa57ff2d0daf8.js +1 -0
- package/web/.next/static/chunks/app/(dashboard)/spaces/[id]/page-de24ced3b47d7f4a.js +1 -0
- package/web/.next/static/chunks/app/(dashboard)/spaces/page-36a70bb29b6d1f8d.js +1 -0
- package/web/.next/static/chunks/app/login/{page-79fcac673d72b0fd.js → page-b0775ccf523650f0.js} +1 -1
- package/web/.next/static/chunks/app/onboarding/{page-5858f9892207b18a.js → page-553c81401b58b054.js} +2 -2
- package/web/.next/static/css/b8481b898c3a79c7.css +3 -0
- package/web/.next/server/chunks/1167.js +0 -1
- package/web/.next/server/chunks/1793.js +0 -1
- package/web/.next/server/chunks/2170.js +0 -1
- package/web/.next/server/chunks/2355.js +0 -1
- package/web/.next/server/chunks/2534.js +0 -3
- package/web/.next/server/chunks/2933.js +0 -1
- package/web/.next/server/chunks/3077.js +0 -1
- package/web/.next/server/chunks/3599.js +0 -4
- package/web/.next/server/chunks/3664.js +0 -1
- package/web/.next/server/chunks/4106.js +0 -1
- package/web/.next/server/chunks/4237.js +0 -1
- package/web/.next/server/chunks/4654.js +0 -1
- package/web/.next/server/chunks/5610.js +0 -1
- package/web/.next/server/chunks/5930.js +0 -1
- package/web/.next/server/chunks/6144.js +0 -1
- package/web/.next/server/chunks/6781.js +0 -1
- package/web/.next/server/chunks/7809.js +0 -1
- package/web/.next/server/chunks/7994.js +0 -1
- package/web/.next/server/chunks/8288.js +0 -1
- package/web/.next/server/chunks/9325.js +0 -1
- package/web/.next/static/chunks/1153-386588d6c10108e5.js +0 -1
- package/web/.next/static/chunks/1667-e023e17c2be3ed41.js +0 -1
- package/web/.next/static/chunks/2678-635d3af351339d1f.js +0 -1
- package/web/.next/static/chunks/2951-ee159473d73f5be5.js +0 -1
- package/web/.next/static/chunks/2954-b611ccbad1ef70cf.js +0 -1
- package/web/.next/static/chunks/3132-f944b689e991fbce.js +0 -1
- package/web/.next/static/chunks/4550-716cd6fed1cc7a54.js +0 -1
- package/web/.next/static/chunks/4607-ad1fd257b797fe78.js +0 -1
- package/web/.next/static/chunks/5669-e4d547f642ab32e8.js +0 -1
- package/web/.next/static/chunks/5749-b46ac9048f508063.js +0 -1
- package/web/.next/static/chunks/5827-f55dce3b90513313.js +0 -1
- package/web/.next/static/chunks/5929-e2e3d4690150d133.js +0 -3
- package/web/.next/static/chunks/6202-bdb913d6c5729177.js +0 -1
- package/web/.next/static/chunks/6629-5ce8f59300ab248d.js +0 -1
- package/web/.next/static/chunks/7142-37b5c11e90611e54.js +0 -1
- package/web/.next/static/chunks/7500-2ebf7578d223c72d.js +0 -1
- package/web/.next/static/chunks/8192-85b1ee6b79af9ddd.js +0 -1
- package/web/.next/static/chunks/8289-b436be9516a52c35.js +0 -1
- package/web/.next/static/chunks/896-88675ac01deb45b9.js +0 -1
- package/web/.next/static/chunks/9191-da199e6c1a2df5a2.js +0 -1
- package/web/.next/static/chunks/922-d9f162dc10e61549.js +0 -1
- package/web/.next/static/chunks/9893-f06fa3569fc9c655.js +0 -1
- package/web/.next/static/chunks/app/(dashboard)/agents/[id]/edit/page-b4a0ee7f715424b7.js +0 -6
- package/web/.next/static/chunks/app/(dashboard)/agents/page-0d05ae18a23fbe70.js +0 -1
- package/web/.next/static/chunks/app/(dashboard)/approvals/page-42ce87d37fbbfd31.js +0 -1
- package/web/.next/static/chunks/app/(dashboard)/chat/page-b72eb7cb4575bfc4.js +0 -1
- package/web/.next/static/chunks/app/(dashboard)/code/[id]/page-c946b09a99d83939.js +0 -1
- package/web/.next/static/chunks/app/(dashboard)/connectors/page-82cfdf4faf030549.js +0 -1
- package/web/.next/static/chunks/app/(dashboard)/layout-81d588404476fb84.js +0 -1
- package/web/.next/static/chunks/app/(dashboard)/learned-skills/page-877d7331ac159cad.js +0 -1
- package/web/.next/static/chunks/app/(dashboard)/llm-providers/page-c1fd6d3c56bd3749.js +0 -1
- package/web/.next/static/chunks/app/(dashboard)/logs/page-666c5eaaf9cbe0cc.js +0 -1
- package/web/.next/static/chunks/app/(dashboard)/mcp/page-b05555fed8b3f328.js +0 -1
- package/web/.next/static/chunks/app/(dashboard)/memories/page-fe510ed812a53403.js +0 -1
- package/web/.next/static/chunks/app/(dashboard)/page-8f27b94f359b813e.js +0 -1
- package/web/.next/static/chunks/app/(dashboard)/settings/page-0dfc73d4d668e38c.js +0 -1
- package/web/.next/static/chunks/app/(dashboard)/settings/root-context/page-db23dbdabd589b11.js +0 -1
- package/web/.next/static/chunks/app/(dashboard)/skills/[id]/edit/page-f3371b2f685ed6cb.js +0 -1
- package/web/.next/static/chunks/app/(dashboard)/skills/new/page-e43cd1e0846cd2cb.js +0 -1
- package/web/.next/static/chunks/app/(dashboard)/skills/page-defcc71a6665e8d1.js +0 -1
- package/web/.next/static/chunks/app/(dashboard)/spaces/[id]/files/page-f4458150c0c18635.js +0 -1
- package/web/.next/static/chunks/app/(dashboard)/spaces/[id]/page-4748d928bee78320.js +0 -1
- package/web/.next/static/chunks/app/(dashboard)/spaces/page-14f7a0e714864f62.js +0 -1
- package/web/.next/static/css/166435fb30d0aff7.css +0 -3
- /package/web/.next/static/{2KQpMG2FdMFsbpyPeGkUA → 0TrtJ91HpKl3KQHHmWTc9}/_buildManifest.js +0 -0
- /package/web/.next/static/{2KQpMG2FdMFsbpyPeGkUA → 0TrtJ91HpKl3KQHHmWTc9}/_ssgManifest.js +0 -0
package/cli.js
CHANGED
|
@@ -12493,6 +12493,9 @@ var init_types2 = __esm({
|
|
|
12493
12493
|
|
|
12494
12494
|
// ../../packages/shared/src/enums.ts
|
|
12495
12495
|
import { z as z3 } from "zod";
|
|
12496
|
+
function isTerminalJobStatus(status) {
|
|
12497
|
+
return TERMINAL_STATUSES.includes(status);
|
|
12498
|
+
}
|
|
12496
12499
|
var JOB_CHANNELS, JobChannelSchema, JOB_STATUSES, JobStatusSchema, TERMINAL_STATUSES, LIVE_JOB_STATUSES, TASK_STATUSES, TaskStatusSchema, TASK_PRIORITIES, TaskPrioritySchema, AGENT_ROLES, AgentRoleSchema, ORCHESTRATOR_MODES, OrchestratorModeSchema, CONNECTOR_AUTH_TYPES, ConnectorAuthTypeSchema, APPROVAL_STATUSES, ApprovalStatusSchema, APPROVAL_RULE_ACTIONS, ApprovalRuleActionSchema, MEMORY_CATEGORIES, MemoryCategorySchema, MEMORY_SOURCES, MemorySourceSchema, MEMORY_LAYERS, MemoryLayerSchema, SCHEDULE_TYPES, ScheduleTypeSchema, SCHEDULE_LAST_STATUSES, ScheduleLastStatusSchema, ENTITY_MEMBER_ROLES, EntityMemberRoleSchema, ENTITY_INDUSTRIES, EntityIndustrySchema, OPERATION_RISK_LEVELS, OperationRiskLevelSchema, TOOL_CARDS, ToolCardSchema, MCP_TRANSPORTS, McpTransportSchema;
|
|
12497
12500
|
var init_enums = __esm({
|
|
12498
12501
|
"../../packages/shared/src/enums.ts"() {
|
|
@@ -12664,7 +12667,12 @@ var init_tool_cards = __esm({
|
|
|
12664
12667
|
files: z4.array(
|
|
12665
12668
|
z4.object({
|
|
12666
12669
|
path: text2(CARD_LABEL_MAX),
|
|
12667
|
-
action: z4.enum(["created", "modified", "written", "listed"]),
|
|
12670
|
+
action: z4.enum(["created", "modified", "written", "listed", "moved", "copied"]),
|
|
12671
|
+
/**
|
|
12672
|
+
* Où était le fichier, pour `moved` et `copied` (#879) : `path` est
|
|
12673
|
+
* où il se trouve maintenant. Absent pour tout autre geste.
|
|
12674
|
+
*/
|
|
12675
|
+
from: text2(CARD_LABEL_MAX).optional(),
|
|
12668
12676
|
bytes: z4.number().int().nonnegative().optional(),
|
|
12669
12677
|
/** Ce que l'outil dit de ce fichier (« 3 lignes ajoutées · feuille Data »). */
|
|
12670
12678
|
detail: text2(CARD_LABEL_MAX).optional(),
|
|
@@ -13915,7 +13923,7 @@ function findModelCatalogEntry(provider, modelId) {
|
|
|
13915
13923
|
const same = entries.filter((e) => modelIdKey(e.modelId) === key);
|
|
13916
13924
|
return same.length === 1 ? same[0] : void 0;
|
|
13917
13925
|
}
|
|
13918
|
-
var MODEL_CATALOG, VISION_MODEL_IDS, VISION_MODEL_KEYS, CATALOG_MODEL_KEYS;
|
|
13926
|
+
var MODEL_CATALOG, VISION_MODEL_IDS, PDF_MODEL_IDS, VISION_MODEL_KEYS, PDF_MODEL_KEYS, CATALOG_MODEL_KEYS;
|
|
13919
13927
|
var init_model_catalog = __esm({
|
|
13920
13928
|
"../../packages/shared/src/model-catalog.ts"() {
|
|
13921
13929
|
"use strict";
|
|
@@ -14335,6 +14343,7 @@ var init_model_catalog = __esm({
|
|
|
14335
14343
|
label: "Claude Opus 5",
|
|
14336
14344
|
capabilities: {
|
|
14337
14345
|
tools: true,
|
|
14346
|
+
cacheControl: true,
|
|
14338
14347
|
reasoningControl: { kind: "effort", levels: ["low", "medium", "high", "max"] }
|
|
14339
14348
|
},
|
|
14340
14349
|
contextWindow: 1e6,
|
|
@@ -14350,6 +14359,7 @@ var init_model_catalog = __esm({
|
|
|
14350
14359
|
label: "Claude Sonnet 5",
|
|
14351
14360
|
capabilities: {
|
|
14352
14361
|
tools: true,
|
|
14362
|
+
cacheControl: true,
|
|
14353
14363
|
reasoningControl: { kind: "effort", levels: ["low", "medium", "high", "max"] }
|
|
14354
14364
|
},
|
|
14355
14365
|
contextWindow: 1e6,
|
|
@@ -14365,6 +14375,7 @@ var init_model_catalog = __esm({
|
|
|
14365
14375
|
label: "Claude Fable 5",
|
|
14366
14376
|
capabilities: {
|
|
14367
14377
|
tools: true,
|
|
14378
|
+
cacheControl: true,
|
|
14368
14379
|
reasoningControl: { kind: "effort", levels: ["low", "medium", "high", "max"] }
|
|
14369
14380
|
},
|
|
14370
14381
|
contextWindow: 1e6,
|
|
@@ -14388,6 +14399,7 @@ var init_model_catalog = __esm({
|
|
|
14388
14399
|
label: "Claude Fable 5.1",
|
|
14389
14400
|
capabilities: {
|
|
14390
14401
|
tools: true,
|
|
14402
|
+
cacheControl: true,
|
|
14391
14403
|
reasoningControl: {
|
|
14392
14404
|
kind: "effort",
|
|
14393
14405
|
levels: ["low", "medium", "high", "max"],
|
|
@@ -14412,6 +14424,7 @@ var init_model_catalog = __esm({
|
|
|
14412
14424
|
label: "Claude Sonnet 5.5",
|
|
14413
14425
|
capabilities: {
|
|
14414
14426
|
tools: true,
|
|
14427
|
+
cacheControl: true,
|
|
14415
14428
|
reasoningControl: {
|
|
14416
14429
|
kind: "effort",
|
|
14417
14430
|
levels: ["low", "medium", "high", "max"],
|
|
@@ -14440,6 +14453,7 @@ var init_model_catalog = __esm({
|
|
|
14440
14453
|
label: "Claude Haiku 5.5",
|
|
14441
14454
|
capabilities: {
|
|
14442
14455
|
tools: true,
|
|
14456
|
+
cacheControl: true,
|
|
14443
14457
|
reasoningControl: { kind: "effort", levels: ["low", "medium", "high", "max"] }
|
|
14444
14458
|
},
|
|
14445
14459
|
contextWindow: 1e6,
|
|
@@ -14604,6 +14618,7 @@ var init_model_catalog = __esm({
|
|
|
14604
14618
|
label: "Claude Haiku 4.5",
|
|
14605
14619
|
capabilities: {
|
|
14606
14620
|
tools: true,
|
|
14621
|
+
cacheControl: true,
|
|
14607
14622
|
reasoningControl: { kind: "effort", levels: ["low", "medium", "high", "max"] }
|
|
14608
14623
|
},
|
|
14609
14624
|
contextWindow: 2e5,
|
|
@@ -14621,6 +14636,7 @@ var init_model_catalog = __esm({
|
|
|
14621
14636
|
label: "Claude Opus 4.7",
|
|
14622
14637
|
capabilities: {
|
|
14623
14638
|
tools: true,
|
|
14639
|
+
cacheControl: true,
|
|
14624
14640
|
reasoningControl: { kind: "effort", levels: ["low", "medium", "high", "max"] }
|
|
14625
14641
|
},
|
|
14626
14642
|
contextWindow: 1e6,
|
|
@@ -14636,6 +14652,7 @@ var init_model_catalog = __esm({
|
|
|
14636
14652
|
label: "Claude Opus 4.8",
|
|
14637
14653
|
capabilities: {
|
|
14638
14654
|
tools: true,
|
|
14655
|
+
cacheControl: true,
|
|
14639
14656
|
reasoningControl: { kind: "effort", levels: ["low", "medium", "high", "max"] }
|
|
14640
14657
|
},
|
|
14641
14658
|
contextWindow: 1e6,
|
|
@@ -14651,6 +14668,7 @@ var init_model_catalog = __esm({
|
|
|
14651
14668
|
label: "Claude Sonnet 4.6",
|
|
14652
14669
|
capabilities: {
|
|
14653
14670
|
tools: true,
|
|
14671
|
+
cacheControl: true,
|
|
14654
14672
|
reasoningControl: { kind: "effort", levels: ["low", "medium", "high", "max"] }
|
|
14655
14673
|
},
|
|
14656
14674
|
contextWindow: 1e6,
|
|
@@ -15433,10 +15451,52 @@ var init_model_catalog = __esm({
|
|
|
15433
15451
|
"kimi-k2.7-code",
|
|
15434
15452
|
"kimi-k3"
|
|
15435
15453
|
]);
|
|
15454
|
+
PDF_MODEL_IDS = /* @__PURE__ */ new Set([
|
|
15455
|
+
"claude-opus-5",
|
|
15456
|
+
"claude-sonnet-5",
|
|
15457
|
+
"claude-fable-5",
|
|
15458
|
+
"claude-opus-4-8",
|
|
15459
|
+
"claude-sonnet-4-6",
|
|
15460
|
+
"claude-haiku-4-5-20251001",
|
|
15461
|
+
"gemini-3.7-flash",
|
|
15462
|
+
"gemini-3.5-flash",
|
|
15463
|
+
"gemini-3.1-pro-preview",
|
|
15464
|
+
"mistral-large-latest",
|
|
15465
|
+
"anthropic/claude-opus-5",
|
|
15466
|
+
"anthropic/claude-sonnet-5",
|
|
15467
|
+
"anthropic/claude-fable-5",
|
|
15468
|
+
"anthropic/claude-fable-5.1",
|
|
15469
|
+
"anthropic/claude-sonnet-5.5",
|
|
15470
|
+
"anthropic/claude-haiku-5.5",
|
|
15471
|
+
"openai/gpt-5.6-luna",
|
|
15472
|
+
"openai/gpt-5.6-luna-pro",
|
|
15473
|
+
"openai/gpt-5.6-terra-pro",
|
|
15474
|
+
"openai/gpt-5.6-terra",
|
|
15475
|
+
"openai/gpt-5.6-sol",
|
|
15476
|
+
"openai/gpt-5.6-sol-pro",
|
|
15477
|
+
"openai/gpt-6-astra",
|
|
15478
|
+
"openai/gpt-6-astra-pro",
|
|
15479
|
+
"anthropic/claude-haiku-4.5",
|
|
15480
|
+
"anthropic/claude-opus-4.7",
|
|
15481
|
+
"anthropic/claude-opus-4.8",
|
|
15482
|
+
"anthropic/claude-sonnet-4.6",
|
|
15483
|
+
"google/gemini-3.1-flash-lite-preview",
|
|
15484
|
+
"google/gemini-3.1-pro-preview",
|
|
15485
|
+
"google/gemini-3.5-flash",
|
|
15486
|
+
"google/gemini-3.6-flash",
|
|
15487
|
+
"google/gemini-3.7-flash",
|
|
15488
|
+
"x-ai/grok-4.5",
|
|
15489
|
+
"x-ai/grok-4.6",
|
|
15490
|
+
"x-ai/grok-4.7"
|
|
15491
|
+
]);
|
|
15436
15492
|
for (const entries of Object.values(MODEL_CATALOG)) {
|
|
15437
|
-
for (const e of entries)
|
|
15493
|
+
for (const e of entries) {
|
|
15494
|
+
e.capabilities.vision = VISION_MODEL_IDS.has(e.modelId);
|
|
15495
|
+
e.capabilities.pdf = PDF_MODEL_IDS.has(e.modelId);
|
|
15496
|
+
}
|
|
15438
15497
|
}
|
|
15439
15498
|
VISION_MODEL_KEYS = new Set([...VISION_MODEL_IDS].map(modelIdKey));
|
|
15499
|
+
PDF_MODEL_KEYS = new Set([...PDF_MODEL_IDS].map(modelIdKey));
|
|
15440
15500
|
CATALOG_MODEL_KEYS = new Set(
|
|
15441
15501
|
Object.values(MODEL_CATALOG).flatMap((entries) => entries.map((e) => modelIdKey(e.modelId)))
|
|
15442
15502
|
);
|
|
@@ -17922,6 +17982,22 @@ var init_approval_tool_default = __esm({
|
|
|
17922
17982
|
}
|
|
17923
17983
|
});
|
|
17924
17984
|
|
|
17985
|
+
// ../../packages/shared/src/readonly-preset.ts
|
|
17986
|
+
var READONLY_PRESET_TOOLS;
|
|
17987
|
+
var init_readonly_preset = __esm({
|
|
17988
|
+
"../../packages/shared/src/readonly-preset.ts"() {
|
|
17989
|
+
"use strict";
|
|
17990
|
+
READONLY_PRESET_TOOLS = [
|
|
17991
|
+
"file_write",
|
|
17992
|
+
"file_edit",
|
|
17993
|
+
"file_move",
|
|
17994
|
+
"skill_file_write",
|
|
17995
|
+
"run_command",
|
|
17996
|
+
"run_skill_script"
|
|
17997
|
+
];
|
|
17998
|
+
}
|
|
17999
|
+
});
|
|
18000
|
+
|
|
17925
18001
|
// ../../packages/shared/src/question-answer.ts
|
|
17926
18002
|
var init_question_answer = __esm({
|
|
17927
18003
|
"../../packages/shared/src/question-answer.ts"() {
|
|
@@ -18309,6 +18385,8 @@ var init_verification_surfaces = __esm({
|
|
|
18309
18385
|
fileOps: [
|
|
18310
18386
|
"file_write",
|
|
18311
18387
|
"file_edit",
|
|
18388
|
+
// Déplacer ou copier un fichier (#879) : il en crée un, et en retire un.
|
|
18389
|
+
"file_move",
|
|
18312
18390
|
"docx_create",
|
|
18313
18391
|
"docx_append_paragraphs",
|
|
18314
18392
|
"docx_replace_text",
|
|
@@ -18338,6 +18416,105 @@ var init_verification_surfaces = __esm({
|
|
|
18338
18416
|
}
|
|
18339
18417
|
});
|
|
18340
18418
|
|
|
18419
|
+
// ../../packages/shared/src/sandbox-settings.ts
|
|
18420
|
+
import { z as z27 } from "zod";
|
|
18421
|
+
function parseSandboxFolders(raw) {
|
|
18422
|
+
const parsed = SandboxFoldersSchema.safeParse(raw);
|
|
18423
|
+
if (!parsed.success) {
|
|
18424
|
+
throw new Error(
|
|
18425
|
+
`${SANDBOX_SETTINGS_UNREADABLE}: sandbox_folders ${parsed.error.issues.map((i) => `${i.path.join(".") || "(root)"} ${i.message}`).join("; ")}`
|
|
18426
|
+
);
|
|
18427
|
+
}
|
|
18428
|
+
return parsed.data;
|
|
18429
|
+
}
|
|
18430
|
+
var SandboxFoldersSchema, DEFAULT_WORKSPACE_SANDBOX, SANDBOX_SETTINGS_UNREADABLE, SandboxStatusSchema, ALLOWED_FOLDER_SOURCES, COMMANDS_PLACEMENTS, SandboxAgentSchema, SandboxStateSchema;
|
|
18431
|
+
var init_sandbox_settings = __esm({
|
|
18432
|
+
"../../packages/shared/src/sandbox-settings.ts"() {
|
|
18433
|
+
"use strict";
|
|
18434
|
+
SandboxFoldersSchema = z27.object({
|
|
18435
|
+
/** Les dossiers ajoutés, chemins absolus, dans l'ordre de l'ajout. */
|
|
18436
|
+
added: z27.array(z27.string().min(1)),
|
|
18437
|
+
/** Les dossiers DÉTECTÉS que l'utilisateur a retirés, chemins absolus. */
|
|
18438
|
+
removed: z27.array(z27.string().min(1))
|
|
18439
|
+
}).strict();
|
|
18440
|
+
DEFAULT_WORKSPACE_SANDBOX = Object.freeze({
|
|
18441
|
+
enabled: true,
|
|
18442
|
+
folders: Object.freeze({ added: [], removed: [] })
|
|
18443
|
+
});
|
|
18444
|
+
SANDBOX_SETTINGS_UNREADABLE = "SANDBOX_SETTINGS_UNREADABLE";
|
|
18445
|
+
SandboxStatusSchema = z27.discriminatedUnion("state", [
|
|
18446
|
+
z27.object({
|
|
18447
|
+
state: z27.literal("available"),
|
|
18448
|
+
backend: z27.string(),
|
|
18449
|
+
/** Chaque limite commence par son code stable (`SANDBOX_…: …`). */
|
|
18450
|
+
limits: z27.array(z27.string()).optional()
|
|
18451
|
+
}),
|
|
18452
|
+
z27.object({
|
|
18453
|
+
state: z27.literal("unavailable"),
|
|
18454
|
+
code: z27.string(),
|
|
18455
|
+
/** La raison telle que le backend ou l'OS l'a donnée : une donnée, citée. */
|
|
18456
|
+
reason: z27.string()
|
|
18457
|
+
})
|
|
18458
|
+
]);
|
|
18459
|
+
ALLOWED_FOLDER_SOURCES = [
|
|
18460
|
+
"tool-cache",
|
|
18461
|
+
"comfyui",
|
|
18462
|
+
"ollama",
|
|
18463
|
+
"huggingface",
|
|
18464
|
+
"docker",
|
|
18465
|
+
"user"
|
|
18466
|
+
];
|
|
18467
|
+
COMMANDS_PLACEMENTS = ["sandbox", "outside", "unknown"];
|
|
18468
|
+
SandboxAgentSchema = z27.object({
|
|
18469
|
+
id: z27.string(),
|
|
18470
|
+
name: z27.string(),
|
|
18471
|
+
/** La valeur de `agents.runtime` (`nodal`, `claude-code`, `codex`…). */
|
|
18472
|
+
runtime: z27.string(),
|
|
18473
|
+
commands: z27.enum(COMMANDS_PLACEMENTS)
|
|
18474
|
+
});
|
|
18475
|
+
SandboxStateSchema = z27.object({
|
|
18476
|
+
/** Le système du runner (`win32`, `darwin`, `linux`…). */
|
|
18477
|
+
platform: z27.string(),
|
|
18478
|
+
status: SandboxStatusSchema,
|
|
18479
|
+
/** L'interrupteur de l'espace. */
|
|
18480
|
+
enabled: z27.boolean(),
|
|
18481
|
+
/** Les dossiers permis, composés (détectés − retirés + ajoutés), chacun avec son état. */
|
|
18482
|
+
allowedFolders: z27.array(
|
|
18483
|
+
z27.object({
|
|
18484
|
+
path: z27.string(),
|
|
18485
|
+
source: z27.enum(ALLOWED_FOLDER_SOURCES),
|
|
18486
|
+
state: z27.enum(["allowed", "removed", "missing", "refused"])
|
|
18487
|
+
})
|
|
18488
|
+
),
|
|
18489
|
+
/**
|
|
18490
|
+
* Les dossiers des agents actifs, UN par dossier réel (le même dossier
|
|
18491
|
+
* attaché à deux agents n'apparaît qu'une fois, avec les deux), dans l'ordre
|
|
18492
|
+
* de leur premier agent. Le regroupement est fait par le runner, qui sait
|
|
18493
|
+
* comparer deux chemins sur ce système.
|
|
18494
|
+
*/
|
|
18495
|
+
agentFolders: z27.array(z27.object({ path: z27.string(), agents: z27.array(SandboxAgentSchema) })),
|
|
18496
|
+
/** Les agents actifs sans dossier à eux : ils n'écrivent que dans le dossier partagé. */
|
|
18497
|
+
agentsWithoutFolder: z27.array(SandboxAgentSchema),
|
|
18498
|
+
/** Le dossier partagé de l'espace, que tout agent écrit ; `null` s'il n'a pas pu être créé. */
|
|
18499
|
+
sharedFolder: z27.string().nullable(),
|
|
18500
|
+
/**
|
|
18501
|
+
* Combien de dossiers DISTINCTS une commande confinée peut écrire : les
|
|
18502
|
+
* dossiers des agents, le partagé, et les dossiers permis à l'état `allowed`
|
|
18503
|
+
* — hors le dossier attaché à une demande et le temporaire de chaque run, qui
|
|
18504
|
+
* n'existent que pendant un run.
|
|
18505
|
+
*/
|
|
18506
|
+
writableFolderCount: z27.number().int().nonnegative(),
|
|
18507
|
+
/** Les dossiers de données de Nodal qu'une commande confinée ne lit pas. */
|
|
18508
|
+
readRefused: z27.array(z27.string()),
|
|
18509
|
+
/** Les ports de Nodal refusés par le proxy, ou le code qui dit qu'ils sont inconnus. */
|
|
18510
|
+
network: z27.union([
|
|
18511
|
+
z27.object({ deniedPorts: z27.array(z27.number().int()) }),
|
|
18512
|
+
z27.object({ code: z27.string(), reason: z27.string() })
|
|
18513
|
+
])
|
|
18514
|
+
});
|
|
18515
|
+
}
|
|
18516
|
+
});
|
|
18517
|
+
|
|
18341
18518
|
// ../../packages/shared/src/fragment-diff.ts
|
|
18342
18519
|
var init_fragment_diff = __esm({
|
|
18343
18520
|
"../../packages/shared/src/fragment-diff.ts"() {
|
|
@@ -18570,6 +18747,7 @@ var init_src2 = __esm({
|
|
|
18570
18747
|
init_approval_explain();
|
|
18571
18748
|
init_approval_rules_chain();
|
|
18572
18749
|
init_approval_tool_default();
|
|
18750
|
+
init_readonly_preset();
|
|
18573
18751
|
init_question_answer();
|
|
18574
18752
|
init_elicitation();
|
|
18575
18753
|
init_elicitation_card();
|
|
@@ -18596,6 +18774,7 @@ var init_src2 = __esm({
|
|
|
18596
18774
|
init_verification();
|
|
18597
18775
|
init_verification_manifest();
|
|
18598
18776
|
init_verification_surfaces();
|
|
18777
|
+
init_sandbox_settings();
|
|
18599
18778
|
init_fragment_diff();
|
|
18600
18779
|
init_failure_codes();
|
|
18601
18780
|
init_job_result_kind();
|
|
@@ -18783,7 +18962,20 @@ var init_entities = __esm({
|
|
|
18783
18962
|
* Combien d'heures un run peut TOURNER (attentes exclues), puis il est
|
|
18784
18963
|
* arrêté avec ce qu'il a déjà écrit (issue #442). `0` = aucune limite.
|
|
18785
18964
|
*/
|
|
18786
|
-
maxRunHours: real("max_run_hours").notNull().default(0)
|
|
18965
|
+
maxRunHours: real("max_run_hours").notNull().default(0),
|
|
18966
|
+
/**
|
|
18967
|
+
* L'interrupteur du bac à sable de l'espace (#876, migration 0153).
|
|
18968
|
+
* Allumé par défaut. Coupé, les commandes de l'espace tournent sans
|
|
18969
|
+
* confinement, chaque résultat le disant (`SANDBOX_DISABLED`). Relu par le
|
|
18970
|
+
* runner à chaque lancement (`readWorkspaceSandbox`).
|
|
18971
|
+
*/
|
|
18972
|
+
sandboxEnabled: boolean("sandbox_enabled").notNull().default(true),
|
|
18973
|
+
/**
|
|
18974
|
+
* Les gestes de l'utilisateur sur les dossiers permis (#876) : ses ajouts
|
|
18975
|
+
* et les dossiers détectés qu'il a retirés, jamais la liste calculée. Lu
|
|
18976
|
+
* par `parseSandboxFolders` (@nodal-agents/shared).
|
|
18977
|
+
*/
|
|
18978
|
+
sandboxFolders: jsonb("sandbox_folders").notNull().default(sql`'{"added":[],"removed":[]}'::jsonb`)
|
|
18787
18979
|
},
|
|
18788
18980
|
(table) => [
|
|
18789
18981
|
check(
|
|
@@ -21412,6 +21604,25 @@ var init_verification2 = __esm({
|
|
|
21412
21604
|
* promesse ne se présume pas.
|
|
21413
21605
|
*/
|
|
21414
21606
|
declared: boolean("declared").notNull().default(false),
|
|
21607
|
+
/**
|
|
21608
|
+
* Un appel de CE job a-t-il RETIRÉ ce livrable du disque ? (issue #916,
|
|
21609
|
+
* migration 0155)
|
|
21610
|
+
*
|
|
21611
|
+
* Posé par le seam d'exécution sur une transition CONSTATÉE autour d'un
|
|
21612
|
+
* appel du job : l'adresse était là avant, elle n'y est plus après. Levé
|
|
21613
|
+
* par la transition inverse. Jamais déduit : un fichier qui disparaît hors
|
|
21614
|
+
* des appels du job garde `false`, et sa preuve reste `exists` — rouge.
|
|
21615
|
+
* Seule une ligne retirée ET déclarée déplacée (`moved_to_key`) est
|
|
21616
|
+
* prouvée par son absence (`apps/runner/src/verification/removed.ts`).
|
|
21617
|
+
*/
|
|
21618
|
+
removed: boolean("removed").notNull().default(false),
|
|
21619
|
+
/**
|
|
21620
|
+
* La clé de la destination où l'appel qui a retiré ce livrable l'avait
|
|
21621
|
+
* DÉCLARÉ déplacé (`MutationTarget.movesTo`), quand elle retrouve une ligne
|
|
21622
|
+
* d'état du même job (issue #916, migration 0155). NULL pour tout autre
|
|
21623
|
+
* retrait : la preuve reste `exists`, rouge.
|
|
21624
|
+
*/
|
|
21625
|
+
movedToKey: text("moved_to_key"),
|
|
21415
21626
|
/** DecisionStatus — l'état lisible affiché à l'owner. */
|
|
21416
21627
|
decisionStatus: text("decision_status").notNull(),
|
|
21417
21628
|
/** Empreinte de la dernière commande de preuve exécutée (diagnostic, pas le hash d'approbation). */
|
|
@@ -22391,6 +22602,23 @@ var init_designated_chat = __esm({
|
|
|
22391
22602
|
}
|
|
22392
22603
|
});
|
|
22393
22604
|
|
|
22605
|
+
// ../../packages/db/src/queries/workspace-scope.ts
|
|
22606
|
+
async function workspaceOfScope(db, scope) {
|
|
22607
|
+
if (scope.entityId) return scope.entityId;
|
|
22608
|
+
if (scope.agentId) {
|
|
22609
|
+
const [agent] = await db.select({ entityId: agents.entityId }).from(agents).where(eq(agents.id, scope.agentId)).limit(1);
|
|
22610
|
+
if (agent?.entityId) return agent.entityId;
|
|
22611
|
+
}
|
|
22612
|
+
return null;
|
|
22613
|
+
}
|
|
22614
|
+
var init_workspace_scope = __esm({
|
|
22615
|
+
"../../packages/db/src/queries/workspace-scope.ts"() {
|
|
22616
|
+
"use strict";
|
|
22617
|
+
init_drizzle_orm();
|
|
22618
|
+
init_schema2();
|
|
22619
|
+
}
|
|
22620
|
+
});
|
|
22621
|
+
|
|
22394
22622
|
// ../../packages/db/src/queries/conversation-handles.ts
|
|
22395
22623
|
import { randomBytes as randomBytes3 } from "crypto";
|
|
22396
22624
|
function newHandle() {
|
|
@@ -22508,11 +22736,8 @@ async function knownConversationIds(db, entityId) {
|
|
|
22508
22736
|
return known;
|
|
22509
22737
|
}
|
|
22510
22738
|
async function workspaceOf(db, scope) {
|
|
22511
|
-
|
|
22512
|
-
if (
|
|
22513
|
-
const [agent] = await db.select({ entityId: agents.entityId }).from(agents).where(eq(agents.id, scope.agentId)).limit(1);
|
|
22514
|
-
if (agent?.entityId) return agent.entityId;
|
|
22515
|
-
}
|
|
22739
|
+
const entityId = await workspaceOfScope(db, scope);
|
|
22740
|
+
if (entityId) return entityId;
|
|
22516
22741
|
throw new ConversationScopeUnknownError(scope.subject ?? "a text for a model");
|
|
22517
22742
|
}
|
|
22518
22743
|
async function conversationIdsAsHandles(db, scope, value) {
|
|
@@ -22550,6 +22775,7 @@ var init_conversation_handles2 = __esm({
|
|
|
22550
22775
|
init_channel_allowed_conversations();
|
|
22551
22776
|
init_telegram_allowed_chats();
|
|
22552
22777
|
init_agents();
|
|
22778
|
+
init_workspace_scope();
|
|
22553
22779
|
HANDLE_ALPHABET = "abcdefghijklmnopqrstuvwxyz234567";
|
|
22554
22780
|
HANDLE_LENGTH = 10;
|
|
22555
22781
|
ConversationScopeUnknownError = class extends Error {
|
|
@@ -23001,19 +23227,12 @@ async function setReadOnlyPresetRepo(db, entityId, agentId, enabled) {
|
|
|
23001
23227
|
)
|
|
23002
23228
|
);
|
|
23003
23229
|
}
|
|
23004
|
-
var READONLY_PRESET_TOOLS;
|
|
23005
23230
|
var init_approval_rules = __esm({
|
|
23006
23231
|
"../../packages/db/src/repos/approval-rules.ts"() {
|
|
23007
23232
|
"use strict";
|
|
23008
23233
|
init_drizzle_orm();
|
|
23234
|
+
init_src2();
|
|
23009
23235
|
init_approvals();
|
|
23010
|
-
READONLY_PRESET_TOOLS = [
|
|
23011
|
-
"file_write",
|
|
23012
|
-
"file_edit",
|
|
23013
|
-
"skill_file_write",
|
|
23014
|
-
"run_command",
|
|
23015
|
-
"run_skill_script"
|
|
23016
|
-
];
|
|
23017
23236
|
}
|
|
23018
23237
|
});
|
|
23019
23238
|
|
|
@@ -23210,6 +23429,79 @@ var init_run_cost = __esm({
|
|
|
23210
23429
|
}
|
|
23211
23430
|
});
|
|
23212
23431
|
|
|
23432
|
+
// ../../packages/db/src/repos/run-state.ts
|
|
23433
|
+
function isLive(status) {
|
|
23434
|
+
return status === null || !isTerminalJobStatus(status);
|
|
23435
|
+
}
|
|
23436
|
+
async function readRunState(db, entityId, headJobId) {
|
|
23437
|
+
const [head] = await db.select({ status: agentJobs.status, result: agentJobs.result, error: agentJobs.error }).from(agentJobs).where(and(eq(agentJobs.id, headJobId), eq(agentJobs.entityId, entityId))).limit(1);
|
|
23438
|
+
if (!head) return null;
|
|
23439
|
+
const treeIds = await descendRunTree(db, entityId, [headJobId]);
|
|
23440
|
+
const tree = await db.select({ id: agentJobs.id, status: agentJobs.status }).from(agentJobs).where(and(eq(agentJobs.entityId, entityId), inArray(agentJobs.id, treeIds)));
|
|
23441
|
+
const liveJobIds = tree.filter((j) => isLive(j.status)).map((j) => j.id);
|
|
23442
|
+
const pending = liveJobIds.length === 0 ? [] : await db.select({
|
|
23443
|
+
requestId: approvalRequests.id,
|
|
23444
|
+
jobId: approvalRequests.jobId,
|
|
23445
|
+
kind: approvalRequests.kind,
|
|
23446
|
+
toolName: approvalRequests.toolName,
|
|
23447
|
+
toolInput: approvalRequests.toolInput,
|
|
23448
|
+
requestedAt: approvalRequests.requestedAt
|
|
23449
|
+
}).from(approvalRequests).where(
|
|
23450
|
+
and(
|
|
23451
|
+
eq(approvalRequests.entityId, entityId),
|
|
23452
|
+
inArray(approvalRequests.jobId, liveJobIds),
|
|
23453
|
+
eq(approvalRequests.status, "pending")
|
|
23454
|
+
)
|
|
23455
|
+
).orderBy(approvalsOldestFirst);
|
|
23456
|
+
const deliverables = await db.select({
|
|
23457
|
+
jobId: jobDeliverableVerificationState.jobId,
|
|
23458
|
+
canonicalKey: jobDeliverableVerificationState.canonicalKey,
|
|
23459
|
+
displayPath: jobDeliverableVerificationState.displayPathSnapshot,
|
|
23460
|
+
type: jobDeliverableVerificationState.deliverableType,
|
|
23461
|
+
declared: jobDeliverableVerificationState.declared,
|
|
23462
|
+
verification: jobDeliverableVerificationState.decisionStatus
|
|
23463
|
+
}).from(jobDeliverableVerificationState).where(
|
|
23464
|
+
and(
|
|
23465
|
+
inArray(jobDeliverableVerificationState.jobId, treeIds),
|
|
23466
|
+
eq(jobDeliverableVerificationState.addressed, true)
|
|
23467
|
+
)
|
|
23468
|
+
).orderBy(
|
|
23469
|
+
asc(jobDeliverableVerificationState.updatedAt),
|
|
23470
|
+
asc(jobDeliverableVerificationState.id)
|
|
23471
|
+
);
|
|
23472
|
+
const status = liveJobIds.length > 0 ? pending.length > 0 ? "waiting_for_person" : "running" : head.status;
|
|
23473
|
+
return {
|
|
23474
|
+
headJobId,
|
|
23475
|
+
headStatus: head.status,
|
|
23476
|
+
status,
|
|
23477
|
+
result: head.result,
|
|
23478
|
+
error: head.error,
|
|
23479
|
+
liveJobIds,
|
|
23480
|
+
pendingRequests: pending.map((r) => ({
|
|
23481
|
+
...r,
|
|
23482
|
+
requestedAt: r.requestedAt ? r.requestedAt.toISOString() : null
|
|
23483
|
+
})),
|
|
23484
|
+
deliverables: deliverables.map((d) => ({
|
|
23485
|
+
jobId: d.jobId,
|
|
23486
|
+
path: d.displayPath ?? d.canonicalKey,
|
|
23487
|
+
type: d.type,
|
|
23488
|
+
declared: d.declared,
|
|
23489
|
+
verification: d.verification
|
|
23490
|
+
}))
|
|
23491
|
+
};
|
|
23492
|
+
}
|
|
23493
|
+
var init_run_state = __esm({
|
|
23494
|
+
"../../packages/db/src/repos/run-state.ts"() {
|
|
23495
|
+
"use strict";
|
|
23496
|
+
init_drizzle_orm();
|
|
23497
|
+
init_src2();
|
|
23498
|
+
init_jobs();
|
|
23499
|
+
init_approvals();
|
|
23500
|
+
init_verification2();
|
|
23501
|
+
init_run_tree();
|
|
23502
|
+
}
|
|
23503
|
+
});
|
|
23504
|
+
|
|
23213
23505
|
// ../../packages/db/src/repos/agent-mcp-servers.ts
|
|
23214
23506
|
async function attachMcpServerToAgent(db, input) {
|
|
23215
23507
|
const { entityId, agentId, mcpServerId, enabledTools } = input;
|
|
@@ -23653,6 +23945,87 @@ var init_verification_surfaces2 = __esm({
|
|
|
23653
23945
|
}
|
|
23654
23946
|
});
|
|
23655
23947
|
|
|
23948
|
+
// ../../packages/db/src/repos/workspace-sandbox.ts
|
|
23949
|
+
async function readWorkspaceSandbox(db, entityId) {
|
|
23950
|
+
return readSandboxRow(db, entityId, false);
|
|
23951
|
+
}
|
|
23952
|
+
async function readSandboxRow(db, entityId, lock) {
|
|
23953
|
+
let row;
|
|
23954
|
+
try {
|
|
23955
|
+
const query = db.select({ enabled: entities.sandboxEnabled, folders: entities.sandboxFolders }).from(entities).where(eq(entities.id, entityId)).limit(1);
|
|
23956
|
+
[row] = await (lock ? query.for("update") : query);
|
|
23957
|
+
} catch (err) {
|
|
23958
|
+
throw new Error(
|
|
23959
|
+
`${SANDBOX_SETTINGS_UNREADABLE}: the workspace settings could not be read (${err instanceof Error ? err.message : String(err)})`,
|
|
23960
|
+
{ cause: err }
|
|
23961
|
+
);
|
|
23962
|
+
}
|
|
23963
|
+
if (!row) throw new Error(`${SANDBOX_SETTINGS_UNREADABLE}: workspace ${entityId} not found`);
|
|
23964
|
+
if (typeof row.enabled !== "boolean") {
|
|
23965
|
+
throw new Error(`${SANDBOX_SETTINGS_UNREADABLE}: sandbox_enabled is not a boolean`);
|
|
23966
|
+
}
|
|
23967
|
+
return { enabled: row.enabled, folders: parseSandboxFolders(row.folders) };
|
|
23968
|
+
}
|
|
23969
|
+
function workspaceSandboxReader(db, workspace) {
|
|
23970
|
+
return async () => {
|
|
23971
|
+
const entityId = typeof workspace === "string" ? workspace : await workspaceOfScope(db, workspace);
|
|
23972
|
+
if (!entityId) {
|
|
23973
|
+
throw new Error(
|
|
23974
|
+
`${SANDBOX_SETTINGS_UNREADABLE}: agent ${typeof workspace === "string" ? "" : workspace.agentId ?? ""} belongs to no workspace`
|
|
23975
|
+
);
|
|
23976
|
+
}
|
|
23977
|
+
return readWorkspaceSandbox(db, entityId);
|
|
23978
|
+
};
|
|
23979
|
+
}
|
|
23980
|
+
async function setWorkspaceSandboxEnabled(db, entityId, enabled) {
|
|
23981
|
+
await db.update(entities).set({ sandboxEnabled: enabled, updatedAt: /* @__PURE__ */ new Date() }).where(eq(entities.id, entityId));
|
|
23982
|
+
}
|
|
23983
|
+
function applySandboxFolderGesture(folders, gesture, folderKey2) {
|
|
23984
|
+
const k = folderKey2(gesture.path);
|
|
23985
|
+
const has = (list) => list.some((p) => folderKey2(p) === k);
|
|
23986
|
+
const without = (list) => list.filter((p) => folderKey2(p) !== k);
|
|
23987
|
+
switch (gesture.op) {
|
|
23988
|
+
case "add":
|
|
23989
|
+
if (has(folders.removed)) {
|
|
23990
|
+
return { folders: { ...folders, removed: without(folders.removed) }, outcome: "restored" };
|
|
23991
|
+
}
|
|
23992
|
+
if (has(folders.added)) return { folders, outcome: "already-allowed" };
|
|
23993
|
+
if (gesture.awaitsConfirmation) return { folders, outcome: "needs-confirmation" };
|
|
23994
|
+
return { folders: { ...folders, added: [...folders.added, gesture.path] }, outcome: "added" };
|
|
23995
|
+
case "remove":
|
|
23996
|
+
if (has(folders.added)) {
|
|
23997
|
+
return { folders: { ...folders, added: without(folders.added) }, outcome: "forgotten" };
|
|
23998
|
+
}
|
|
23999
|
+
if (has(folders.removed)) return { folders, outcome: "unchanged" };
|
|
24000
|
+
return {
|
|
24001
|
+
folders: { ...folders, removed: [...folders.removed, gesture.path] },
|
|
24002
|
+
outcome: "removed"
|
|
24003
|
+
};
|
|
24004
|
+
case "restore":
|
|
24005
|
+
if (!has(folders.removed)) return { folders, outcome: "unchanged" };
|
|
24006
|
+
return { folders: { ...folders, removed: without(folders.removed) }, outcome: "restored" };
|
|
24007
|
+
}
|
|
24008
|
+
}
|
|
24009
|
+
async function changeWorkspaceSandboxFolders(db, entityId, gesture, folderKey2) {
|
|
24010
|
+
return db.transaction(async (tx) => {
|
|
24011
|
+
const current = await readSandboxRow(tx, entityId, true);
|
|
24012
|
+
const next = applySandboxFolderGesture(current.folders, gesture, folderKey2);
|
|
24013
|
+
if (next.folders !== current.folders) {
|
|
24014
|
+
await tx.update(entities).set({ sandboxFolders: parseSandboxFolders(next.folders), updatedAt: /* @__PURE__ */ new Date() }).where(eq(entities.id, entityId));
|
|
24015
|
+
}
|
|
24016
|
+
return next.outcome;
|
|
24017
|
+
});
|
|
24018
|
+
}
|
|
24019
|
+
var init_workspace_sandbox = __esm({
|
|
24020
|
+
"../../packages/db/src/repos/workspace-sandbox.ts"() {
|
|
24021
|
+
"use strict";
|
|
24022
|
+
init_drizzle_orm();
|
|
24023
|
+
init_src2();
|
|
24024
|
+
init_workspace_scope();
|
|
24025
|
+
init_schema2();
|
|
24026
|
+
}
|
|
24027
|
+
});
|
|
24028
|
+
|
|
23656
24029
|
// ../../packages/db/src/repos/member-workspaces.ts
|
|
23657
24030
|
async function listMemberWorkspaces(db, opts = {}) {
|
|
23658
24031
|
const where = opts.withRootAgent ? and(hasMember(db), isNotNull(entities.rootAgentId)) : hasMember(db);
|
|
@@ -24255,6 +24628,7 @@ __export(src_exports, {
|
|
|
24255
24628
|
agents: () => agents,
|
|
24256
24629
|
and: () => and,
|
|
24257
24630
|
appSettings: () => appSettings,
|
|
24631
|
+
applySandboxFolderGesture: () => applySandboxFolderGesture,
|
|
24258
24632
|
approvalCardMessages: () => approvalCardMessages,
|
|
24259
24633
|
approvalRequestAttachments: () => approvalRequestAttachments,
|
|
24260
24634
|
approvalRequests: () => approvalRequests,
|
|
@@ -24270,6 +24644,7 @@ __export(src_exports, {
|
|
|
24270
24644
|
avg: () => avg,
|
|
24271
24645
|
budgetReached: () => budgetReached,
|
|
24272
24646
|
cancelJobTree: () => cancelJobTree,
|
|
24647
|
+
changeWorkspaceSandboxFolders: () => changeWorkspaceSandboxFolders,
|
|
24273
24648
|
channelAllowedConversations: () => channelAllowedConversations,
|
|
24274
24649
|
channelBindings: () => channelBindings,
|
|
24275
24650
|
chatMessages: () => chatMessages,
|
|
@@ -24305,6 +24680,7 @@ __export(src_exports, {
|
|
|
24305
24680
|
decryptMcpServerEnv: () => decryptMcpServerEnv,
|
|
24306
24681
|
deliverToConversationJob: () => deliverToConversationJob,
|
|
24307
24682
|
desc: () => desc,
|
|
24683
|
+
descendRunTree: () => descendRunTree,
|
|
24308
24684
|
designateChat: () => designateChat,
|
|
24309
24685
|
drainJobInbox: () => drainJobInbox,
|
|
24310
24686
|
dropApprovalRulesForDetachedSkill: () => dropApprovalRulesForDetachedSkill,
|
|
@@ -24366,7 +24742,9 @@ __export(src_exports, {
|
|
|
24366
24742
|
readAgentBudgetState: () => readAgentBudgetState,
|
|
24367
24743
|
readAgentSpend: () => readAgentSpend,
|
|
24368
24744
|
readRunCost: () => readRunCost,
|
|
24745
|
+
readRunState: () => readRunState,
|
|
24369
24746
|
readScheduleState: () => readScheduleState,
|
|
24747
|
+
readWorkspaceSandbox: () => readWorkspaceSandbox,
|
|
24370
24748
|
recordApprovalCardMessage: () => recordApprovalCardMessage,
|
|
24371
24749
|
recordClaim: () => recordClaim,
|
|
24372
24750
|
refreshAndPersistCredential: () => refreshAndPersistCredential,
|
|
@@ -24379,6 +24757,7 @@ __export(src_exports, {
|
|
|
24379
24757
|
resolveOwnerConversation: () => resolveOwnerConversation,
|
|
24380
24758
|
resolveScheduleNotifyChat: () => resolveScheduleNotifyChat,
|
|
24381
24759
|
resolveSkillIdsBySlug: () => resolveSkillIdsBySlug,
|
|
24760
|
+
runHeadOf: () => runHeadOf,
|
|
24382
24761
|
runSpentUsd: () => runSpentUsd,
|
|
24383
24762
|
scheduleState: () => scheduleState,
|
|
24384
24763
|
sessions: () => sessions,
|
|
@@ -24395,6 +24774,7 @@ __export(src_exports, {
|
|
|
24395
24774
|
setRunCommandRuleRepo: () => setRunCommandRuleRepo,
|
|
24396
24775
|
setSkillFilesWritable: () => setSkillFilesWritable,
|
|
24397
24776
|
setSkillScriptsAuthorized: () => setSkillScriptsAuthorized,
|
|
24777
|
+
setWorkspaceSandboxEnabled: () => setWorkspaceSandboxEnabled,
|
|
24398
24778
|
showConversationsTo: () => showConversationsTo,
|
|
24399
24779
|
skillConnectors: () => skillConnectors,
|
|
24400
24780
|
skillVersions: () => skillVersions,
|
|
@@ -24418,6 +24798,8 @@ __export(src_exports, {
|
|
|
24418
24798
|
withTransaction: () => withTransaction,
|
|
24419
24799
|
withinRunScope: () => withinRunScope,
|
|
24420
24800
|
workspaceLocks: () => workspaceLocks,
|
|
24801
|
+
workspaceOfScope: () => workspaceOfScope,
|
|
24802
|
+
workspaceSandboxReader: () => workspaceSandboxReader,
|
|
24421
24803
|
workspaceSlug: () => workspaceSlug,
|
|
24422
24804
|
writeScheduleState: () => writeScheduleState,
|
|
24423
24805
|
writeToRunHeadInbox: () => writeToRunHeadInbox
|
|
@@ -24432,6 +24814,7 @@ var init_src4 = __esm({
|
|
|
24432
24814
|
init_master_key_guard();
|
|
24433
24815
|
init_designated_chat();
|
|
24434
24816
|
init_conversation_handles2();
|
|
24817
|
+
init_workspace_scope();
|
|
24435
24818
|
init_cli_sessions();
|
|
24436
24819
|
init_telegram_allowed();
|
|
24437
24820
|
init_skill_approval_rules();
|
|
@@ -24445,6 +24828,8 @@ var init_src4 = __esm({
|
|
|
24445
24828
|
init_connectors2();
|
|
24446
24829
|
init_agent_workspaces2();
|
|
24447
24830
|
init_run_cost();
|
|
24831
|
+
init_run_tree();
|
|
24832
|
+
init_run_state();
|
|
24448
24833
|
init_agent_mcp_servers();
|
|
24449
24834
|
init_skills2();
|
|
24450
24835
|
init_retention();
|
|
@@ -24452,6 +24837,7 @@ var init_src4 = __esm({
|
|
|
24452
24837
|
init_schedule_state2();
|
|
24453
24838
|
init_app_settings2();
|
|
24454
24839
|
init_verification_surfaces2();
|
|
24840
|
+
init_workspace_sandbox();
|
|
24455
24841
|
init_member_workspaces();
|
|
24456
24842
|
init_approval_cards();
|
|
24457
24843
|
init_conversation_runs();
|
|
@@ -28109,7 +28495,7 @@ var init_src6 = __esm({
|
|
|
28109
28495
|
// ../../packages/sandbox/src/policy.ts
|
|
28110
28496
|
import { existsSync as existsSync15, mkdirSync as mkdirSync7, readdirSync as readdirSync5, readFileSync as readFileSync11, realpathSync as realpathSync2, statSync as statSync5 } from "fs";
|
|
28111
28497
|
import { homedir as homedir4 } from "os";
|
|
28112
|
-
import { isAbsolute, join as join17, resolve as resolve4, sep } from "path";
|
|
28498
|
+
import { isAbsolute, join as join17, posix as posix3, resolve as resolve4, sep, win32 as win323 } from "path";
|
|
28113
28499
|
function nodalDeniedEndpoints(env = process.env) {
|
|
28114
28500
|
const ports = /* @__PURE__ */ new Set();
|
|
28115
28501
|
const required = (name) => {
|
|
@@ -28138,6 +28524,19 @@ function nodalDeniedEndpoints(env = process.env) {
|
|
|
28138
28524
|
return [...ports].map((port) => ({ port }));
|
|
28139
28525
|
}
|
|
28140
28526
|
function sandboxDeniedPaths(mustReach, machine = thisMachine()) {
|
|
28527
|
+
const { homes, moved } = nodalDataLocations(machine);
|
|
28528
|
+
for (const home of homes.values()) {
|
|
28529
|
+
if (!existsSync15(home)) continue;
|
|
28530
|
+
const reach = mustReach.find((r) => pathKey(r) === pathKey(home));
|
|
28531
|
+
if (reach !== void 0) throw new NodalHomeReachError(reach);
|
|
28532
|
+
}
|
|
28533
|
+
const denied = [
|
|
28534
|
+
...[...homes.values()].flatMap((home) => deniedChildrenOf(home, mustReach)),
|
|
28535
|
+
...[...moved.values()].flatMap((entry) => deniedMovedEntry(entry, mustReach))
|
|
28536
|
+
];
|
|
28537
|
+
return [...new Set(denied)];
|
|
28538
|
+
}
|
|
28539
|
+
function nodalDataLocations(machine) {
|
|
28141
28540
|
const current = nodalInstanceRecord(machine.env, machine.home, machine.platform);
|
|
28142
28541
|
const instances = [
|
|
28143
28542
|
{ home: current.home, moved: Object.values(current.entries) },
|
|
@@ -28150,21 +28549,14 @@ function sandboxDeniedPaths(mustReach, machine = thisMachine()) {
|
|
|
28150
28549
|
const homes = /* @__PURE__ */ new Map();
|
|
28151
28550
|
const moved = /* @__PURE__ */ new Map();
|
|
28152
28551
|
for (const i of instances) {
|
|
28153
|
-
homes.set(
|
|
28552
|
+
homes.set(keyOn(i.home, machine.platform), i.home);
|
|
28154
28553
|
for (const entry of i.moved) {
|
|
28155
|
-
if (!
|
|
28554
|
+
if (!withinOn(entry, i.home, machine.platform)) {
|
|
28555
|
+
moved.set(keyOn(entry, machine.platform), entry);
|
|
28556
|
+
}
|
|
28156
28557
|
}
|
|
28157
28558
|
}
|
|
28158
|
-
|
|
28159
|
-
if (!existsSync15(home)) continue;
|
|
28160
|
-
const reach = mustReach.find((r) => pathKey(r) === pathKey(home));
|
|
28161
|
-
if (reach !== void 0) throw new NodalHomeReachError(reach);
|
|
28162
|
-
}
|
|
28163
|
-
const denied = [
|
|
28164
|
-
...[...homes.values()].flatMap((home) => deniedChildrenOf(home, mustReach)),
|
|
28165
|
-
...[...moved.values()].flatMap((entry) => deniedMovedEntry(entry, mustReach))
|
|
28166
|
-
];
|
|
28167
|
-
return [...new Set(denied)];
|
|
28559
|
+
return { homes, moved };
|
|
28168
28560
|
}
|
|
28169
28561
|
function real2(path) {
|
|
28170
28562
|
try {
|
|
@@ -28173,14 +28565,27 @@ function real2(path) {
|
|
|
28173
28565
|
return resolve4(path);
|
|
28174
28566
|
}
|
|
28175
28567
|
}
|
|
28568
|
+
function pathOf(platform) {
|
|
28569
|
+
return platform === "win32" ? win323 : posix3;
|
|
28570
|
+
}
|
|
28571
|
+
function absOn(path, platform) {
|
|
28572
|
+
return platform === process.platform ? real2(path) : pathOf(platform).resolve(path);
|
|
28573
|
+
}
|
|
28574
|
+
function keyOn(path, platform) {
|
|
28575
|
+
const r = absOn(path, platform);
|
|
28576
|
+
return platform === "win32" ? r.toLowerCase() : r;
|
|
28577
|
+
}
|
|
28578
|
+
function withinOn(child, parent, platform) {
|
|
28579
|
+
const c = keyOn(child, platform);
|
|
28580
|
+
const p = keyOn(parent, platform);
|
|
28581
|
+
const s = pathOf(platform).sep;
|
|
28582
|
+
return c === p || c.startsWith(p.endsWith(s) ? p : p + s);
|
|
28583
|
+
}
|
|
28176
28584
|
function pathKey(path) {
|
|
28177
|
-
|
|
28178
|
-
return process.platform === "win32" ? r.toLowerCase() : r;
|
|
28585
|
+
return keyOn(path, process.platform);
|
|
28179
28586
|
}
|
|
28180
28587
|
function isWithin(child, parent) {
|
|
28181
|
-
|
|
28182
|
-
const p = pathKey(parent);
|
|
28183
|
-
return c === p || c.startsWith(p.endsWith(sep) ? p : p + sep);
|
|
28588
|
+
return withinOn(child, parent, process.platform);
|
|
28184
28589
|
}
|
|
28185
28590
|
function deniedMovedEntry(entry, mustReach) {
|
|
28186
28591
|
if (!existsSync15(entry)) return [];
|
|
@@ -28216,12 +28621,13 @@ function deniedChildrenOf(dataDir, mustReach) {
|
|
|
28216
28621
|
}
|
|
28217
28622
|
return children.filter((c) => !needed.has(cmp(c))).map((c) => join17(data, c));
|
|
28218
28623
|
}
|
|
28219
|
-
var NodalPortsUnknown, SCHEME_DEFAULT_PORT, NodalHomeReachError, thisMachine;
|
|
28624
|
+
var noWorkspaceSandbox, NodalPortsUnknown, SCHEME_DEFAULT_PORT, NodalHomeReachError, thisMachine;
|
|
28220
28625
|
var init_policy = __esm({
|
|
28221
28626
|
"../../packages/sandbox/src/policy.ts"() {
|
|
28222
28627
|
"use strict";
|
|
28223
28628
|
init_nodal_home();
|
|
28224
28629
|
init_nodal_instances();
|
|
28630
|
+
noWorkspaceSandbox = () => Promise.resolve({ enabled: true, folders: { added: [], removed: [] } });
|
|
28225
28631
|
NodalPortsUnknown = class extends Error {
|
|
28226
28632
|
code = "SANDBOX_NODAL_PORTS_UNKNOWN";
|
|
28227
28633
|
constructor(reason) {
|
|
@@ -28234,14 +28640,16 @@ var init_policy = __esm({
|
|
|
28234
28640
|
"postgresql:": 5432
|
|
28235
28641
|
};
|
|
28236
28642
|
NodalHomeReachError = class extends Error {
|
|
28237
|
-
constructor(path) {
|
|
28643
|
+
constructor(path, within = path) {
|
|
28238
28644
|
super(
|
|
28239
|
-
`SANDBOX_REACH_IS_NODAL_HOME: ${path} is the home folder of a Nodal instance. A confined command cannot work in it without reading that instance\u2019s secrets. Point the workspace at a folder of its own, or move that instance (NODALAI_HOME)
|
|
28645
|
+
(pathKey(path) === pathKey(within) ? `SANDBOX_REACH_IS_NODAL_HOME: ${path} is the home folder of a Nodal instance. ` : `SANDBOX_REACH_IS_NODAL_HOME: ${path} is inside ${within}, the data of a Nodal instance. `) + "A confined command cannot work in it without reading that instance\u2019s secrets. Point the workspace at a folder of its own, or move that instance (NODALAI_HOME)."
|
|
28240
28646
|
);
|
|
28241
28647
|
this.path = path;
|
|
28648
|
+
this.within = within;
|
|
28242
28649
|
this.name = "NodalHomeReachError";
|
|
28243
28650
|
}
|
|
28244
28651
|
path;
|
|
28652
|
+
within;
|
|
28245
28653
|
code = "SANDBOX_REACH_IS_NODAL_HOME";
|
|
28246
28654
|
};
|
|
28247
28655
|
thisMachine = () => ({
|
|
@@ -30511,7 +30919,7 @@ var init_job_scope = __esm({
|
|
|
30511
30919
|
});
|
|
30512
30920
|
|
|
30513
30921
|
// ../../packages/sandbox/src/refused-writes.ts
|
|
30514
|
-
import { posix as
|
|
30922
|
+
import { posix as posix4, win32 as win324 } from "path";
|
|
30515
30923
|
var init_refused_writes = __esm({
|
|
30516
30924
|
"../../packages/sandbox/src/refused-writes.ts"() {
|
|
30517
30925
|
"use strict";
|
|
@@ -30529,19 +30937,21 @@ function nodalProgramsSandbox() {
|
|
|
30529
30937
|
}
|
|
30530
30938
|
);
|
|
30531
30939
|
}
|
|
30532
|
-
async function openNodalPrograms(
|
|
30940
|
+
async function openNodalPrograms(opts) {
|
|
30941
|
+
const sandbox = opts.sandbox ?? nodalProgramsSandbox();
|
|
30533
30942
|
const status = await sandbox.status();
|
|
30534
|
-
|
|
30943
|
+
const settings = await opts.workspace();
|
|
30944
|
+
if (status.state !== "available" || !sandbox.backend || !settings.enabled) {
|
|
30535
30945
|
return { ...hostPrograms, confined: false, close: async () => void 0 };
|
|
30536
30946
|
}
|
|
30537
30947
|
const scope = new JobProcessScope(`nodal-programs-${++sessions2}`, sandbox);
|
|
30538
|
-
const spawn6 = async (file, args,
|
|
30539
|
-
const env =
|
|
30540
|
-
const container = await scope.container(
|
|
30948
|
+
const spawn6 = async (file, args, opts2) => {
|
|
30949
|
+
const env = opts2.env ?? process.env;
|
|
30950
|
+
const container = await scope.container(opts2.writableRoots, env, opts2.readableRoots);
|
|
30541
30951
|
const p = await container.start({
|
|
30542
30952
|
target: { file, args: [...args] },
|
|
30543
30953
|
// Le dossier de départ doit être lisible DANS le conteneur.
|
|
30544
|
-
cwd:
|
|
30954
|
+
cwd: opts2.cwd ?? opts2.readableRoots[0] ?? opts2.writableRoots[0] ?? tmpdir2(),
|
|
30545
30955
|
env
|
|
30546
30956
|
});
|
|
30547
30957
|
if (!p.stdout || !p.stderr) throw new Error(`NODAL_PROGRAM_NO_PIPES: ${file}`);
|
|
@@ -30555,12 +30965,12 @@ async function openNodalPrograms(sandbox = nodalProgramsSandbox()) {
|
|
|
30555
30965
|
return {
|
|
30556
30966
|
confined: true,
|
|
30557
30967
|
spawn: spawn6,
|
|
30558
|
-
execFile: (file, args,
|
|
30968
|
+
execFile: (file, args, opts2) => execOver(spawn6, file, args, opts2),
|
|
30559
30969
|
close: () => scope.close()
|
|
30560
30970
|
};
|
|
30561
30971
|
}
|
|
30562
|
-
async function withNodalPrograms(fn,
|
|
30563
|
-
const programs2 = await openNodalPrograms(
|
|
30972
|
+
async function withNodalPrograms(fn, opts) {
|
|
30973
|
+
const programs2 = await openNodalPrograms(opts);
|
|
30564
30974
|
try {
|
|
30565
30975
|
return await fn(programs2);
|
|
30566
30976
|
} finally {
|
|
@@ -30743,7 +31153,8 @@ async function runCheckpointsRestore(sha, workspace) {
|
|
|
30743
31153
|
}
|
|
30744
31154
|
console.log(chalk6.yellow(`Restoring ${match.sha.slice(0, 8)} \u2014 ${match.label}`));
|
|
30745
31155
|
const res = await withNodalPrograms(
|
|
30746
|
-
(programs2) => restoreCheckpoint(checkpointsRoot(), ws, match.sha, programs2)
|
|
31156
|
+
(programs2) => restoreCheckpoint(checkpointsRoot(), ws, match.sha, programs2),
|
|
31157
|
+
{ workspace: noWorkspaceSandbox }
|
|
30747
31158
|
);
|
|
30748
31159
|
console.log(chalk6.green(` Restored ${ws}`));
|
|
30749
31160
|
console.log(chalk6.gray(` ${CHECKPOINT_COVERAGE_NOTE}`));
|
|
@@ -30932,7 +31343,7 @@ var init_zod_compat = __esm({
|
|
|
30932
31343
|
});
|
|
30933
31344
|
|
|
30934
31345
|
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.1_zod@4.6.7/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
|
|
30935
|
-
import * as
|
|
31346
|
+
import * as z28 from "zod/v4";
|
|
30936
31347
|
function assertCompleteRequestPrompt(request) {
|
|
30937
31348
|
if (request.params.ref.type !== "ref/prompt") {
|
|
30938
31349
|
throw new TypeError(`Expected CompleteRequestPrompt, but got ${request.params.ref.type}`);
|
|
@@ -30953,26 +31364,26 @@ var init_types4 = __esm({
|
|
|
30953
31364
|
SUPPORTED_PROTOCOL_VERSIONS = [LATEST_PROTOCOL_VERSION, "2025-06-18", "2025-03-26", "2024-11-05", "2024-10-07"];
|
|
30954
31365
|
RELATED_TASK_META_KEY = "io.modelcontextprotocol/related-task";
|
|
30955
31366
|
JSONRPC_VERSION = "2.0";
|
|
30956
|
-
AssertObjectSchema =
|
|
30957
|
-
ProgressTokenSchema =
|
|
30958
|
-
CursorSchema =
|
|
30959
|
-
TaskCreationParamsSchema =
|
|
31367
|
+
AssertObjectSchema = z28.custom((v) => v !== null && (typeof v === "object" || typeof v === "function"));
|
|
31368
|
+
ProgressTokenSchema = z28.union([z28.string(), z28.number().int()]);
|
|
31369
|
+
CursorSchema = z28.string();
|
|
31370
|
+
TaskCreationParamsSchema = z28.looseObject({
|
|
30960
31371
|
/**
|
|
30961
31372
|
* Requested duration in milliseconds to retain task from creation.
|
|
30962
31373
|
*/
|
|
30963
|
-
ttl:
|
|
31374
|
+
ttl: z28.number().optional(),
|
|
30964
31375
|
/**
|
|
30965
31376
|
* Time in milliseconds to wait between task status requests.
|
|
30966
31377
|
*/
|
|
30967
|
-
pollInterval:
|
|
31378
|
+
pollInterval: z28.number().optional()
|
|
30968
31379
|
});
|
|
30969
|
-
TaskMetadataSchema =
|
|
30970
|
-
ttl:
|
|
31380
|
+
TaskMetadataSchema = z28.object({
|
|
31381
|
+
ttl: z28.number().optional()
|
|
30971
31382
|
});
|
|
30972
|
-
RelatedTaskMetadataSchema =
|
|
30973
|
-
taskId:
|
|
31383
|
+
RelatedTaskMetadataSchema = z28.object({
|
|
31384
|
+
taskId: z28.string()
|
|
30974
31385
|
});
|
|
30975
|
-
RequestMetaSchema =
|
|
31386
|
+
RequestMetaSchema = z28.looseObject({
|
|
30976
31387
|
/**
|
|
30977
31388
|
* If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.
|
|
30978
31389
|
*/
|
|
@@ -30982,7 +31393,7 @@ var init_types4 = __esm({
|
|
|
30982
31393
|
*/
|
|
30983
31394
|
[RELATED_TASK_META_KEY]: RelatedTaskMetadataSchema.optional()
|
|
30984
31395
|
});
|
|
30985
|
-
BaseRequestParamsSchema =
|
|
31396
|
+
BaseRequestParamsSchema = z28.object({
|
|
30986
31397
|
/**
|
|
30987
31398
|
* See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage.
|
|
30988
31399
|
*/
|
|
@@ -31000,42 +31411,42 @@ var init_types4 = __esm({
|
|
|
31000
31411
|
task: TaskMetadataSchema.optional()
|
|
31001
31412
|
});
|
|
31002
31413
|
isTaskAugmentedRequestParams = (value) => TaskAugmentedRequestParamsSchema.safeParse(value).success;
|
|
31003
|
-
RequestSchema =
|
|
31004
|
-
method:
|
|
31414
|
+
RequestSchema = z28.object({
|
|
31415
|
+
method: z28.string(),
|
|
31005
31416
|
params: BaseRequestParamsSchema.loose().optional()
|
|
31006
31417
|
});
|
|
31007
|
-
NotificationsParamsSchema =
|
|
31418
|
+
NotificationsParamsSchema = z28.object({
|
|
31008
31419
|
/**
|
|
31009
31420
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
31010
31421
|
* for notes on _meta usage.
|
|
31011
31422
|
*/
|
|
31012
31423
|
_meta: RequestMetaSchema.optional()
|
|
31013
31424
|
});
|
|
31014
|
-
NotificationSchema =
|
|
31015
|
-
method:
|
|
31425
|
+
NotificationSchema = z28.object({
|
|
31426
|
+
method: z28.string(),
|
|
31016
31427
|
params: NotificationsParamsSchema.loose().optional()
|
|
31017
31428
|
});
|
|
31018
|
-
ResultSchema =
|
|
31429
|
+
ResultSchema = z28.looseObject({
|
|
31019
31430
|
/**
|
|
31020
31431
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
31021
31432
|
* for notes on _meta usage.
|
|
31022
31433
|
*/
|
|
31023
31434
|
_meta: RequestMetaSchema.optional()
|
|
31024
31435
|
});
|
|
31025
|
-
RequestIdSchema =
|
|
31026
|
-
JSONRPCRequestSchema =
|
|
31027
|
-
jsonrpc:
|
|
31436
|
+
RequestIdSchema = z28.union([z28.string(), z28.number().int()]);
|
|
31437
|
+
JSONRPCRequestSchema = z28.object({
|
|
31438
|
+
jsonrpc: z28.literal(JSONRPC_VERSION),
|
|
31028
31439
|
id: RequestIdSchema,
|
|
31029
31440
|
...RequestSchema.shape
|
|
31030
31441
|
}).strict();
|
|
31031
31442
|
isJSONRPCRequest = (value) => JSONRPCRequestSchema.safeParse(value).success;
|
|
31032
|
-
JSONRPCNotificationSchema =
|
|
31033
|
-
jsonrpc:
|
|
31443
|
+
JSONRPCNotificationSchema = z28.object({
|
|
31444
|
+
jsonrpc: z28.literal(JSONRPC_VERSION),
|
|
31034
31445
|
...NotificationSchema.shape
|
|
31035
31446
|
}).strict();
|
|
31036
31447
|
isJSONRPCNotification = (value) => JSONRPCNotificationSchema.safeParse(value).success;
|
|
31037
|
-
JSONRPCResultResponseSchema =
|
|
31038
|
-
jsonrpc:
|
|
31448
|
+
JSONRPCResultResponseSchema = z28.object({
|
|
31449
|
+
jsonrpc: z28.literal(JSONRPC_VERSION),
|
|
31039
31450
|
id: RequestIdSchema,
|
|
31040
31451
|
result: ResultSchema
|
|
31041
31452
|
}).strict();
|
|
@@ -31050,32 +31461,32 @@ var init_types4 = __esm({
|
|
|
31050
31461
|
ErrorCode2[ErrorCode2["InternalError"] = -32603] = "InternalError";
|
|
31051
31462
|
ErrorCode2[ErrorCode2["UrlElicitationRequired"] = -32042] = "UrlElicitationRequired";
|
|
31052
31463
|
})(ErrorCode || (ErrorCode = {}));
|
|
31053
|
-
JSONRPCErrorResponseSchema =
|
|
31054
|
-
jsonrpc:
|
|
31464
|
+
JSONRPCErrorResponseSchema = z28.object({
|
|
31465
|
+
jsonrpc: z28.literal(JSONRPC_VERSION),
|
|
31055
31466
|
id: RequestIdSchema.optional(),
|
|
31056
|
-
error:
|
|
31467
|
+
error: z28.object({
|
|
31057
31468
|
/**
|
|
31058
31469
|
* The error type that occurred.
|
|
31059
31470
|
*/
|
|
31060
|
-
code:
|
|
31471
|
+
code: z28.number().int(),
|
|
31061
31472
|
/**
|
|
31062
31473
|
* A short description of the error. The message SHOULD be limited to a concise single sentence.
|
|
31063
31474
|
*/
|
|
31064
|
-
message:
|
|
31475
|
+
message: z28.string(),
|
|
31065
31476
|
/**
|
|
31066
31477
|
* Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.).
|
|
31067
31478
|
*/
|
|
31068
|
-
data:
|
|
31479
|
+
data: z28.unknown().optional()
|
|
31069
31480
|
})
|
|
31070
31481
|
}).strict();
|
|
31071
31482
|
isJSONRPCErrorResponse = (value) => JSONRPCErrorResponseSchema.safeParse(value).success;
|
|
31072
|
-
JSONRPCMessageSchema =
|
|
31483
|
+
JSONRPCMessageSchema = z28.union([
|
|
31073
31484
|
JSONRPCRequestSchema,
|
|
31074
31485
|
JSONRPCNotificationSchema,
|
|
31075
31486
|
JSONRPCResultResponseSchema,
|
|
31076
31487
|
JSONRPCErrorResponseSchema
|
|
31077
31488
|
]);
|
|
31078
|
-
JSONRPCResponseSchema =
|
|
31489
|
+
JSONRPCResponseSchema = z28.union([JSONRPCResultResponseSchema, JSONRPCErrorResponseSchema]);
|
|
31079
31490
|
EmptyResultSchema = ResultSchema.strict();
|
|
31080
31491
|
CancelledNotificationParamsSchema = NotificationsParamsSchema.extend({
|
|
31081
31492
|
/**
|
|
@@ -31087,28 +31498,28 @@ var init_types4 = __esm({
|
|
|
31087
31498
|
/**
|
|
31088
31499
|
* An optional string describing the reason for the cancellation. This MAY be logged or presented to the user.
|
|
31089
31500
|
*/
|
|
31090
|
-
reason:
|
|
31501
|
+
reason: z28.string().optional()
|
|
31091
31502
|
});
|
|
31092
31503
|
CancelledNotificationSchema = NotificationSchema.extend({
|
|
31093
|
-
method:
|
|
31504
|
+
method: z28.literal("notifications/cancelled"),
|
|
31094
31505
|
params: CancelledNotificationParamsSchema
|
|
31095
31506
|
});
|
|
31096
|
-
IconSchema =
|
|
31507
|
+
IconSchema = z28.object({
|
|
31097
31508
|
/**
|
|
31098
31509
|
* URL or data URI for the icon.
|
|
31099
31510
|
*/
|
|
31100
|
-
src:
|
|
31511
|
+
src: z28.string(),
|
|
31101
31512
|
/**
|
|
31102
31513
|
* Optional MIME type for the icon.
|
|
31103
31514
|
*/
|
|
31104
|
-
mimeType:
|
|
31515
|
+
mimeType: z28.string().optional(),
|
|
31105
31516
|
/**
|
|
31106
31517
|
* Optional array of strings that specify sizes at which the icon can be used.
|
|
31107
31518
|
* Each string should be in WxH format (e.g., `"48x48"`, `"96x96"`) or `"any"` for scalable formats like SVG.
|
|
31108
31519
|
*
|
|
31109
31520
|
* If not provided, the client should assume that the icon can be used at any size.
|
|
31110
31521
|
*/
|
|
31111
|
-
sizes:
|
|
31522
|
+
sizes: z28.array(z28.string()).optional(),
|
|
31112
31523
|
/**
|
|
31113
31524
|
* Optional specifier for the theme this icon is designed for. `light` indicates
|
|
31114
31525
|
* the icon is designed to be used with a light background, and `dark` indicates
|
|
@@ -31116,9 +31527,9 @@ var init_types4 = __esm({
|
|
|
31116
31527
|
*
|
|
31117
31528
|
* If not provided, the client should assume the icon can be used with any theme.
|
|
31118
31529
|
*/
|
|
31119
|
-
theme:
|
|
31530
|
+
theme: z28.enum(["light", "dark"]).optional()
|
|
31120
31531
|
});
|
|
31121
|
-
IconsSchema =
|
|
31532
|
+
IconsSchema = z28.object({
|
|
31122
31533
|
/**
|
|
31123
31534
|
* Optional set of sized icons that the client can display in a user interface.
|
|
31124
31535
|
*
|
|
@@ -31130,11 +31541,11 @@ var init_types4 = __esm({
|
|
|
31130
31541
|
* - `image/svg+xml` - SVG images (scalable but requires security precautions)
|
|
31131
31542
|
* - `image/webp` - WebP images (modern, efficient format)
|
|
31132
31543
|
*/
|
|
31133
|
-
icons:
|
|
31544
|
+
icons: z28.array(IconSchema).optional()
|
|
31134
31545
|
});
|
|
31135
|
-
BaseMetadataSchema =
|
|
31546
|
+
BaseMetadataSchema = z28.object({
|
|
31136
31547
|
/** Intended for programmatic or logical use, but used as a display name in past specs or fallback */
|
|
31137
|
-
name:
|
|
31548
|
+
name: z28.string(),
|
|
31138
31549
|
/**
|
|
31139
31550
|
* Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
|
|
31140
31551
|
* even by those unfamiliar with domain-specific terminology.
|
|
@@ -31143,16 +31554,16 @@ var init_types4 = __esm({
|
|
|
31143
31554
|
* where `annotations.title` should be given precedence over using `name`,
|
|
31144
31555
|
* if present).
|
|
31145
31556
|
*/
|
|
31146
|
-
title:
|
|
31557
|
+
title: z28.string().optional()
|
|
31147
31558
|
});
|
|
31148
31559
|
ImplementationSchema = BaseMetadataSchema.extend({
|
|
31149
31560
|
...BaseMetadataSchema.shape,
|
|
31150
31561
|
...IconsSchema.shape,
|
|
31151
|
-
version:
|
|
31562
|
+
version: z28.string(),
|
|
31152
31563
|
/**
|
|
31153
31564
|
* An optional URL of the website for this implementation.
|
|
31154
31565
|
*/
|
|
31155
|
-
websiteUrl:
|
|
31566
|
+
websiteUrl: z28.string().optional(),
|
|
31156
31567
|
/**
|
|
31157
31568
|
* An optional human-readable description of what this implementation does.
|
|
31158
31569
|
*
|
|
@@ -31160,23 +31571,23 @@ var init_types4 = __esm({
|
|
|
31160
31571
|
* and capabilities. For example, a server might describe the types of resources
|
|
31161
31572
|
* or tools it provides, while a client might describe its intended use case.
|
|
31162
31573
|
*/
|
|
31163
|
-
description:
|
|
31574
|
+
description: z28.string().optional()
|
|
31164
31575
|
});
|
|
31165
|
-
FormElicitationCapabilitySchema =
|
|
31166
|
-
applyDefaults:
|
|
31167
|
-
}),
|
|
31168
|
-
ElicitationCapabilitySchema =
|
|
31576
|
+
FormElicitationCapabilitySchema = z28.intersection(z28.object({
|
|
31577
|
+
applyDefaults: z28.boolean().optional()
|
|
31578
|
+
}), z28.record(z28.string(), z28.unknown()));
|
|
31579
|
+
ElicitationCapabilitySchema = z28.preprocess((value) => {
|
|
31169
31580
|
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
31170
31581
|
if (Object.keys(value).length === 0) {
|
|
31171
31582
|
return { form: {} };
|
|
31172
31583
|
}
|
|
31173
31584
|
}
|
|
31174
31585
|
return value;
|
|
31175
|
-
},
|
|
31586
|
+
}, z28.intersection(z28.object({
|
|
31176
31587
|
form: FormElicitationCapabilitySchema.optional(),
|
|
31177
31588
|
url: AssertObjectSchema.optional()
|
|
31178
|
-
}),
|
|
31179
|
-
ClientTasksCapabilitySchema =
|
|
31589
|
+
}), z28.record(z28.string(), z28.unknown()).optional()));
|
|
31590
|
+
ClientTasksCapabilitySchema = z28.looseObject({
|
|
31180
31591
|
/**
|
|
31181
31592
|
* Present if the client supports listing tasks.
|
|
31182
31593
|
*/
|
|
@@ -31188,22 +31599,22 @@ var init_types4 = __esm({
|
|
|
31188
31599
|
/**
|
|
31189
31600
|
* Capabilities for task creation on specific request types.
|
|
31190
31601
|
*/
|
|
31191
|
-
requests:
|
|
31602
|
+
requests: z28.looseObject({
|
|
31192
31603
|
/**
|
|
31193
31604
|
* Task support for sampling requests.
|
|
31194
31605
|
*/
|
|
31195
|
-
sampling:
|
|
31606
|
+
sampling: z28.looseObject({
|
|
31196
31607
|
createMessage: AssertObjectSchema.optional()
|
|
31197
31608
|
}).optional(),
|
|
31198
31609
|
/**
|
|
31199
31610
|
* Task support for elicitation requests.
|
|
31200
31611
|
*/
|
|
31201
|
-
elicitation:
|
|
31612
|
+
elicitation: z28.looseObject({
|
|
31202
31613
|
create: AssertObjectSchema.optional()
|
|
31203
31614
|
}).optional()
|
|
31204
31615
|
}).optional()
|
|
31205
31616
|
});
|
|
31206
|
-
ServerTasksCapabilitySchema =
|
|
31617
|
+
ServerTasksCapabilitySchema = z28.looseObject({
|
|
31207
31618
|
/**
|
|
31208
31619
|
* Present if the server supports listing tasks.
|
|
31209
31620
|
*/
|
|
@@ -31215,24 +31626,24 @@ var init_types4 = __esm({
|
|
|
31215
31626
|
/**
|
|
31216
31627
|
* Capabilities for task creation on specific request types.
|
|
31217
31628
|
*/
|
|
31218
|
-
requests:
|
|
31629
|
+
requests: z28.looseObject({
|
|
31219
31630
|
/**
|
|
31220
31631
|
* Task support for tool requests.
|
|
31221
31632
|
*/
|
|
31222
|
-
tools:
|
|
31633
|
+
tools: z28.looseObject({
|
|
31223
31634
|
call: AssertObjectSchema.optional()
|
|
31224
31635
|
}).optional()
|
|
31225
31636
|
}).optional()
|
|
31226
31637
|
});
|
|
31227
|
-
ClientCapabilitiesSchema =
|
|
31638
|
+
ClientCapabilitiesSchema = z28.object({
|
|
31228
31639
|
/**
|
|
31229
31640
|
* Experimental, non-standard capabilities that the client supports.
|
|
31230
31641
|
*/
|
|
31231
|
-
experimental:
|
|
31642
|
+
experimental: z28.record(z28.string(), AssertObjectSchema).optional(),
|
|
31232
31643
|
/**
|
|
31233
31644
|
* Present if the client supports sampling from an LLM.
|
|
31234
31645
|
*/
|
|
31235
|
-
sampling:
|
|
31646
|
+
sampling: z28.object({
|
|
31236
31647
|
/**
|
|
31237
31648
|
* Present if the client supports context inclusion via includeContext parameter.
|
|
31238
31649
|
* If not declared, servers SHOULD only use `includeContext: "none"` (or omit it).
|
|
@@ -31250,11 +31661,11 @@ var init_types4 = __esm({
|
|
|
31250
31661
|
/**
|
|
31251
31662
|
* Present if the client supports listing roots.
|
|
31252
31663
|
*/
|
|
31253
|
-
roots:
|
|
31664
|
+
roots: z28.object({
|
|
31254
31665
|
/**
|
|
31255
31666
|
* Whether the client supports issuing notifications for changes to the roots list.
|
|
31256
31667
|
*/
|
|
31257
|
-
listChanged:
|
|
31668
|
+
listChanged: z28.boolean().optional()
|
|
31258
31669
|
}).optional(),
|
|
31259
31670
|
/**
|
|
31260
31671
|
* Present if the client supports task creation.
|
|
@@ -31263,25 +31674,25 @@ var init_types4 = __esm({
|
|
|
31263
31674
|
/**
|
|
31264
31675
|
* Extensions that the client supports. Keys are extension identifiers (vendor-prefix/extension-name).
|
|
31265
31676
|
*/
|
|
31266
|
-
extensions:
|
|
31677
|
+
extensions: z28.record(z28.string(), AssertObjectSchema).optional()
|
|
31267
31678
|
});
|
|
31268
31679
|
InitializeRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
31269
31680
|
/**
|
|
31270
31681
|
* The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well.
|
|
31271
31682
|
*/
|
|
31272
|
-
protocolVersion:
|
|
31683
|
+
protocolVersion: z28.string(),
|
|
31273
31684
|
capabilities: ClientCapabilitiesSchema,
|
|
31274
31685
|
clientInfo: ImplementationSchema
|
|
31275
31686
|
});
|
|
31276
31687
|
InitializeRequestSchema = RequestSchema.extend({
|
|
31277
|
-
method:
|
|
31688
|
+
method: z28.literal("initialize"),
|
|
31278
31689
|
params: InitializeRequestParamsSchema
|
|
31279
31690
|
});
|
|
31280
|
-
ServerCapabilitiesSchema =
|
|
31691
|
+
ServerCapabilitiesSchema = z28.object({
|
|
31281
31692
|
/**
|
|
31282
31693
|
* Experimental, non-standard capabilities that the server supports.
|
|
31283
31694
|
*/
|
|
31284
|
-
experimental:
|
|
31695
|
+
experimental: z28.record(z28.string(), AssertObjectSchema).optional(),
|
|
31285
31696
|
/**
|
|
31286
31697
|
* Present if the server supports sending log messages to the client.
|
|
31287
31698
|
*/
|
|
@@ -31293,33 +31704,33 @@ var init_types4 = __esm({
|
|
|
31293
31704
|
/**
|
|
31294
31705
|
* Present if the server offers any prompt templates.
|
|
31295
31706
|
*/
|
|
31296
|
-
prompts:
|
|
31707
|
+
prompts: z28.object({
|
|
31297
31708
|
/**
|
|
31298
31709
|
* Whether this server supports issuing notifications for changes to the prompt list.
|
|
31299
31710
|
*/
|
|
31300
|
-
listChanged:
|
|
31711
|
+
listChanged: z28.boolean().optional()
|
|
31301
31712
|
}).optional(),
|
|
31302
31713
|
/**
|
|
31303
31714
|
* Present if the server offers any resources to read.
|
|
31304
31715
|
*/
|
|
31305
|
-
resources:
|
|
31716
|
+
resources: z28.object({
|
|
31306
31717
|
/**
|
|
31307
31718
|
* Whether this server supports clients subscribing to resource updates.
|
|
31308
31719
|
*/
|
|
31309
|
-
subscribe:
|
|
31720
|
+
subscribe: z28.boolean().optional(),
|
|
31310
31721
|
/**
|
|
31311
31722
|
* Whether this server supports issuing notifications for changes to the resource list.
|
|
31312
31723
|
*/
|
|
31313
|
-
listChanged:
|
|
31724
|
+
listChanged: z28.boolean().optional()
|
|
31314
31725
|
}).optional(),
|
|
31315
31726
|
/**
|
|
31316
31727
|
* Present if the server offers any tools to call.
|
|
31317
31728
|
*/
|
|
31318
|
-
tools:
|
|
31729
|
+
tools: z28.object({
|
|
31319
31730
|
/**
|
|
31320
31731
|
* Whether this server supports issuing notifications for changes to the tool list.
|
|
31321
31732
|
*/
|
|
31322
|
-
listChanged:
|
|
31733
|
+
listChanged: z28.boolean().optional()
|
|
31323
31734
|
}).optional(),
|
|
31324
31735
|
/**
|
|
31325
31736
|
* Present if the server supports task creation.
|
|
@@ -31328,13 +31739,13 @@ var init_types4 = __esm({
|
|
|
31328
31739
|
/**
|
|
31329
31740
|
* Extensions that the server supports. Keys are extension identifiers (vendor-prefix/extension-name).
|
|
31330
31741
|
*/
|
|
31331
|
-
extensions:
|
|
31742
|
+
extensions: z28.record(z28.string(), AssertObjectSchema).optional()
|
|
31332
31743
|
});
|
|
31333
31744
|
InitializeResultSchema = ResultSchema.extend({
|
|
31334
31745
|
/**
|
|
31335
31746
|
* The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect.
|
|
31336
31747
|
*/
|
|
31337
|
-
protocolVersion:
|
|
31748
|
+
protocolVersion: z28.string(),
|
|
31338
31749
|
capabilities: ServerCapabilitiesSchema,
|
|
31339
31750
|
serverInfo: ImplementationSchema,
|
|
31340
31751
|
/**
|
|
@@ -31342,31 +31753,31 @@ var init_types4 = __esm({
|
|
|
31342
31753
|
*
|
|
31343
31754
|
* This can be used by clients to improve the LLM's understanding of available tools, resources, etc. It can be thought of like a "hint" to the model. For example, this information MAY be added to the system prompt.
|
|
31344
31755
|
*/
|
|
31345
|
-
instructions:
|
|
31756
|
+
instructions: z28.string().optional()
|
|
31346
31757
|
});
|
|
31347
31758
|
InitializedNotificationSchema = NotificationSchema.extend({
|
|
31348
|
-
method:
|
|
31759
|
+
method: z28.literal("notifications/initialized"),
|
|
31349
31760
|
params: NotificationsParamsSchema.optional()
|
|
31350
31761
|
});
|
|
31351
31762
|
PingRequestSchema = RequestSchema.extend({
|
|
31352
|
-
method:
|
|
31763
|
+
method: z28.literal("ping"),
|
|
31353
31764
|
params: BaseRequestParamsSchema.optional()
|
|
31354
31765
|
});
|
|
31355
|
-
ProgressSchema =
|
|
31766
|
+
ProgressSchema = z28.object({
|
|
31356
31767
|
/**
|
|
31357
31768
|
* The progress thus far. This should increase every time progress is made, even if the total is unknown.
|
|
31358
31769
|
*/
|
|
31359
|
-
progress:
|
|
31770
|
+
progress: z28.number(),
|
|
31360
31771
|
/**
|
|
31361
31772
|
* Total number of items to process (or total progress required), if known.
|
|
31362
31773
|
*/
|
|
31363
|
-
total:
|
|
31774
|
+
total: z28.optional(z28.number()),
|
|
31364
31775
|
/**
|
|
31365
31776
|
* An optional message describing the current progress.
|
|
31366
31777
|
*/
|
|
31367
|
-
message:
|
|
31778
|
+
message: z28.optional(z28.string())
|
|
31368
31779
|
});
|
|
31369
|
-
ProgressNotificationParamsSchema =
|
|
31780
|
+
ProgressNotificationParamsSchema = z28.object({
|
|
31370
31781
|
...NotificationsParamsSchema.shape,
|
|
31371
31782
|
...ProgressSchema.shape,
|
|
31372
31783
|
/**
|
|
@@ -31375,7 +31786,7 @@ var init_types4 = __esm({
|
|
|
31375
31786
|
progressToken: ProgressTokenSchema
|
|
31376
31787
|
});
|
|
31377
31788
|
ProgressNotificationSchema = NotificationSchema.extend({
|
|
31378
|
-
method:
|
|
31789
|
+
method: z28.literal("notifications/progress"),
|
|
31379
31790
|
params: ProgressNotificationParamsSchema
|
|
31380
31791
|
});
|
|
31381
31792
|
PaginatedRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
@@ -31395,86 +31806,86 @@ var init_types4 = __esm({
|
|
|
31395
31806
|
*/
|
|
31396
31807
|
nextCursor: CursorSchema.optional()
|
|
31397
31808
|
});
|
|
31398
|
-
TaskStatusSchema2 =
|
|
31399
|
-
TaskSchema =
|
|
31400
|
-
taskId:
|
|
31809
|
+
TaskStatusSchema2 = z28.enum(["working", "input_required", "completed", "failed", "cancelled"]);
|
|
31810
|
+
TaskSchema = z28.object({
|
|
31811
|
+
taskId: z28.string(),
|
|
31401
31812
|
status: TaskStatusSchema2,
|
|
31402
31813
|
/**
|
|
31403
31814
|
* Time in milliseconds to keep task results available after completion.
|
|
31404
31815
|
* If null, the task has unlimited lifetime until manually cleaned up.
|
|
31405
31816
|
*/
|
|
31406
|
-
ttl:
|
|
31817
|
+
ttl: z28.union([z28.number(), z28.null()]),
|
|
31407
31818
|
/**
|
|
31408
31819
|
* ISO 8601 timestamp when the task was created.
|
|
31409
31820
|
*/
|
|
31410
|
-
createdAt:
|
|
31821
|
+
createdAt: z28.string(),
|
|
31411
31822
|
/**
|
|
31412
31823
|
* ISO 8601 timestamp when the task was last updated.
|
|
31413
31824
|
*/
|
|
31414
|
-
lastUpdatedAt:
|
|
31415
|
-
pollInterval:
|
|
31825
|
+
lastUpdatedAt: z28.string(),
|
|
31826
|
+
pollInterval: z28.optional(z28.number()),
|
|
31416
31827
|
/**
|
|
31417
31828
|
* Optional diagnostic message for failed tasks or other status information.
|
|
31418
31829
|
*/
|
|
31419
|
-
statusMessage:
|
|
31830
|
+
statusMessage: z28.optional(z28.string())
|
|
31420
31831
|
});
|
|
31421
31832
|
CreateTaskResultSchema = ResultSchema.extend({
|
|
31422
31833
|
task: TaskSchema
|
|
31423
31834
|
});
|
|
31424
31835
|
TaskStatusNotificationParamsSchema = NotificationsParamsSchema.merge(TaskSchema);
|
|
31425
31836
|
TaskStatusNotificationSchema = NotificationSchema.extend({
|
|
31426
|
-
method:
|
|
31837
|
+
method: z28.literal("notifications/tasks/status"),
|
|
31427
31838
|
params: TaskStatusNotificationParamsSchema
|
|
31428
31839
|
});
|
|
31429
31840
|
GetTaskRequestSchema = RequestSchema.extend({
|
|
31430
|
-
method:
|
|
31841
|
+
method: z28.literal("tasks/get"),
|
|
31431
31842
|
params: BaseRequestParamsSchema.extend({
|
|
31432
|
-
taskId:
|
|
31843
|
+
taskId: z28.string()
|
|
31433
31844
|
})
|
|
31434
31845
|
});
|
|
31435
31846
|
GetTaskResultSchema = ResultSchema.merge(TaskSchema);
|
|
31436
31847
|
GetTaskPayloadRequestSchema = RequestSchema.extend({
|
|
31437
|
-
method:
|
|
31848
|
+
method: z28.literal("tasks/result"),
|
|
31438
31849
|
params: BaseRequestParamsSchema.extend({
|
|
31439
|
-
taskId:
|
|
31850
|
+
taskId: z28.string()
|
|
31440
31851
|
})
|
|
31441
31852
|
});
|
|
31442
31853
|
GetTaskPayloadResultSchema = ResultSchema.loose();
|
|
31443
31854
|
ListTasksRequestSchema = PaginatedRequestSchema.extend({
|
|
31444
|
-
method:
|
|
31855
|
+
method: z28.literal("tasks/list")
|
|
31445
31856
|
});
|
|
31446
31857
|
ListTasksResultSchema = PaginatedResultSchema.extend({
|
|
31447
|
-
tasks:
|
|
31858
|
+
tasks: z28.array(TaskSchema)
|
|
31448
31859
|
});
|
|
31449
31860
|
CancelTaskRequestSchema = RequestSchema.extend({
|
|
31450
|
-
method:
|
|
31861
|
+
method: z28.literal("tasks/cancel"),
|
|
31451
31862
|
params: BaseRequestParamsSchema.extend({
|
|
31452
|
-
taskId:
|
|
31863
|
+
taskId: z28.string()
|
|
31453
31864
|
})
|
|
31454
31865
|
});
|
|
31455
31866
|
CancelTaskResultSchema = ResultSchema.merge(TaskSchema);
|
|
31456
|
-
ResourceContentsSchema =
|
|
31867
|
+
ResourceContentsSchema = z28.object({
|
|
31457
31868
|
/**
|
|
31458
31869
|
* The URI of this resource.
|
|
31459
31870
|
*/
|
|
31460
|
-
uri:
|
|
31871
|
+
uri: z28.string(),
|
|
31461
31872
|
/**
|
|
31462
31873
|
* The MIME type of this resource, if known.
|
|
31463
31874
|
*/
|
|
31464
|
-
mimeType:
|
|
31875
|
+
mimeType: z28.optional(z28.string()),
|
|
31465
31876
|
/**
|
|
31466
31877
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
31467
31878
|
* for notes on _meta usage.
|
|
31468
31879
|
*/
|
|
31469
|
-
_meta:
|
|
31880
|
+
_meta: z28.record(z28.string(), z28.unknown()).optional()
|
|
31470
31881
|
});
|
|
31471
31882
|
TextResourceContentsSchema = ResourceContentsSchema.extend({
|
|
31472
31883
|
/**
|
|
31473
31884
|
* The text of the item. This must only be set if the item can actually be represented as text (not binary data).
|
|
31474
31885
|
*/
|
|
31475
|
-
text:
|
|
31886
|
+
text: z28.string()
|
|
31476
31887
|
});
|
|
31477
|
-
Base64Schema =
|
|
31888
|
+
Base64Schema = z28.string().refine((val) => {
|
|
31478
31889
|
try {
|
|
31479
31890
|
atob(val);
|
|
31480
31891
|
return true;
|
|
@@ -31488,44 +31899,44 @@ var init_types4 = __esm({
|
|
|
31488
31899
|
*/
|
|
31489
31900
|
blob: Base64Schema
|
|
31490
31901
|
});
|
|
31491
|
-
RoleSchema =
|
|
31492
|
-
AnnotationsSchema =
|
|
31902
|
+
RoleSchema = z28.enum(["user", "assistant"]);
|
|
31903
|
+
AnnotationsSchema = z28.object({
|
|
31493
31904
|
/**
|
|
31494
31905
|
* Intended audience(s) for the resource.
|
|
31495
31906
|
*/
|
|
31496
|
-
audience:
|
|
31907
|
+
audience: z28.array(RoleSchema).optional(),
|
|
31497
31908
|
/**
|
|
31498
31909
|
* Importance hint for the resource, from 0 (least) to 1 (most).
|
|
31499
31910
|
*/
|
|
31500
|
-
priority:
|
|
31911
|
+
priority: z28.number().min(0).max(1).optional(),
|
|
31501
31912
|
/**
|
|
31502
31913
|
* ISO 8601 timestamp for the most recent modification.
|
|
31503
31914
|
*/
|
|
31504
|
-
lastModified:
|
|
31915
|
+
lastModified: z28.iso.datetime({ offset: true }).optional()
|
|
31505
31916
|
});
|
|
31506
|
-
ResourceSchema =
|
|
31917
|
+
ResourceSchema = z28.object({
|
|
31507
31918
|
...BaseMetadataSchema.shape,
|
|
31508
31919
|
...IconsSchema.shape,
|
|
31509
31920
|
/**
|
|
31510
31921
|
* The URI of this resource.
|
|
31511
31922
|
*/
|
|
31512
|
-
uri:
|
|
31923
|
+
uri: z28.string(),
|
|
31513
31924
|
/**
|
|
31514
31925
|
* A description of what this resource represents.
|
|
31515
31926
|
*
|
|
31516
31927
|
* This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model.
|
|
31517
31928
|
*/
|
|
31518
|
-
description:
|
|
31929
|
+
description: z28.optional(z28.string()),
|
|
31519
31930
|
/**
|
|
31520
31931
|
* The MIME type of this resource, if known.
|
|
31521
31932
|
*/
|
|
31522
|
-
mimeType:
|
|
31933
|
+
mimeType: z28.optional(z28.string()),
|
|
31523
31934
|
/**
|
|
31524
31935
|
* The size of the raw resource content, in bytes (i.e., before base64 encoding or any tokenization), if known.
|
|
31525
31936
|
*
|
|
31526
31937
|
* This can be used by Hosts to display file sizes and estimate context window usage.
|
|
31527
31938
|
*/
|
|
31528
|
-
size:
|
|
31939
|
+
size: z28.optional(z28.number()),
|
|
31529
31940
|
/**
|
|
31530
31941
|
* Optional annotations for the client.
|
|
31531
31942
|
*/
|
|
@@ -31534,25 +31945,25 @@ var init_types4 = __esm({
|
|
|
31534
31945
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
31535
31946
|
* for notes on _meta usage.
|
|
31536
31947
|
*/
|
|
31537
|
-
_meta:
|
|
31948
|
+
_meta: z28.optional(z28.looseObject({}))
|
|
31538
31949
|
});
|
|
31539
|
-
ResourceTemplateSchema =
|
|
31950
|
+
ResourceTemplateSchema = z28.object({
|
|
31540
31951
|
...BaseMetadataSchema.shape,
|
|
31541
31952
|
...IconsSchema.shape,
|
|
31542
31953
|
/**
|
|
31543
31954
|
* A URI template (according to RFC 6570) that can be used to construct resource URIs.
|
|
31544
31955
|
*/
|
|
31545
|
-
uriTemplate:
|
|
31956
|
+
uriTemplate: z28.string(),
|
|
31546
31957
|
/**
|
|
31547
31958
|
* A description of what this template is for.
|
|
31548
31959
|
*
|
|
31549
31960
|
* This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model.
|
|
31550
31961
|
*/
|
|
31551
|
-
description:
|
|
31962
|
+
description: z28.optional(z28.string()),
|
|
31552
31963
|
/**
|
|
31553
31964
|
* The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type.
|
|
31554
31965
|
*/
|
|
31555
|
-
mimeType:
|
|
31966
|
+
mimeType: z28.optional(z28.string()),
|
|
31556
31967
|
/**
|
|
31557
31968
|
* Optional annotations for the client.
|
|
31558
31969
|
*/
|
|
@@ -31561,19 +31972,19 @@ var init_types4 = __esm({
|
|
|
31561
31972
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
31562
31973
|
* for notes on _meta usage.
|
|
31563
31974
|
*/
|
|
31564
|
-
_meta:
|
|
31975
|
+
_meta: z28.optional(z28.looseObject({}))
|
|
31565
31976
|
});
|
|
31566
31977
|
ListResourcesRequestSchema = PaginatedRequestSchema.extend({
|
|
31567
|
-
method:
|
|
31978
|
+
method: z28.literal("resources/list")
|
|
31568
31979
|
});
|
|
31569
31980
|
ListResourcesResultSchema = PaginatedResultSchema.extend({
|
|
31570
|
-
resources:
|
|
31981
|
+
resources: z28.array(ResourceSchema)
|
|
31571
31982
|
});
|
|
31572
31983
|
ListResourceTemplatesRequestSchema = PaginatedRequestSchema.extend({
|
|
31573
|
-
method:
|
|
31984
|
+
method: z28.literal("resources/templates/list")
|
|
31574
31985
|
});
|
|
31575
31986
|
ListResourceTemplatesResultSchema = PaginatedResultSchema.extend({
|
|
31576
|
-
resourceTemplates:
|
|
31987
|
+
resourceTemplates: z28.array(ResourceTemplateSchema)
|
|
31577
31988
|
});
|
|
31578
31989
|
ResourceRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
31579
31990
|
/**
|
|
@@ -31581,97 +31992,97 @@ var init_types4 = __esm({
|
|
|
31581
31992
|
*
|
|
31582
31993
|
* @format uri
|
|
31583
31994
|
*/
|
|
31584
|
-
uri:
|
|
31995
|
+
uri: z28.string()
|
|
31585
31996
|
});
|
|
31586
31997
|
ReadResourceRequestParamsSchema = ResourceRequestParamsSchema;
|
|
31587
31998
|
ReadResourceRequestSchema = RequestSchema.extend({
|
|
31588
|
-
method:
|
|
31999
|
+
method: z28.literal("resources/read"),
|
|
31589
32000
|
params: ReadResourceRequestParamsSchema
|
|
31590
32001
|
});
|
|
31591
32002
|
ReadResourceResultSchema = ResultSchema.extend({
|
|
31592
|
-
contents:
|
|
32003
|
+
contents: z28.array(z28.union([TextResourceContentsSchema, BlobResourceContentsSchema]))
|
|
31593
32004
|
});
|
|
31594
32005
|
ResourceListChangedNotificationSchema = NotificationSchema.extend({
|
|
31595
|
-
method:
|
|
32006
|
+
method: z28.literal("notifications/resources/list_changed"),
|
|
31596
32007
|
params: NotificationsParamsSchema.optional()
|
|
31597
32008
|
});
|
|
31598
32009
|
SubscribeRequestParamsSchema = ResourceRequestParamsSchema;
|
|
31599
32010
|
SubscribeRequestSchema = RequestSchema.extend({
|
|
31600
|
-
method:
|
|
32011
|
+
method: z28.literal("resources/subscribe"),
|
|
31601
32012
|
params: SubscribeRequestParamsSchema
|
|
31602
32013
|
});
|
|
31603
32014
|
UnsubscribeRequestParamsSchema = ResourceRequestParamsSchema;
|
|
31604
32015
|
UnsubscribeRequestSchema = RequestSchema.extend({
|
|
31605
|
-
method:
|
|
32016
|
+
method: z28.literal("resources/unsubscribe"),
|
|
31606
32017
|
params: UnsubscribeRequestParamsSchema
|
|
31607
32018
|
});
|
|
31608
32019
|
ResourceUpdatedNotificationParamsSchema = NotificationsParamsSchema.extend({
|
|
31609
32020
|
/**
|
|
31610
32021
|
* The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to.
|
|
31611
32022
|
*/
|
|
31612
|
-
uri:
|
|
32023
|
+
uri: z28.string()
|
|
31613
32024
|
});
|
|
31614
32025
|
ResourceUpdatedNotificationSchema = NotificationSchema.extend({
|
|
31615
|
-
method:
|
|
32026
|
+
method: z28.literal("notifications/resources/updated"),
|
|
31616
32027
|
params: ResourceUpdatedNotificationParamsSchema
|
|
31617
32028
|
});
|
|
31618
|
-
PromptArgumentSchema =
|
|
32029
|
+
PromptArgumentSchema = z28.object({
|
|
31619
32030
|
/**
|
|
31620
32031
|
* The name of the argument.
|
|
31621
32032
|
*/
|
|
31622
|
-
name:
|
|
32033
|
+
name: z28.string(),
|
|
31623
32034
|
/**
|
|
31624
32035
|
* A human-readable description of the argument.
|
|
31625
32036
|
*/
|
|
31626
|
-
description:
|
|
32037
|
+
description: z28.optional(z28.string()),
|
|
31627
32038
|
/**
|
|
31628
32039
|
* Whether this argument must be provided.
|
|
31629
32040
|
*/
|
|
31630
|
-
required:
|
|
32041
|
+
required: z28.optional(z28.boolean())
|
|
31631
32042
|
});
|
|
31632
|
-
PromptSchema =
|
|
32043
|
+
PromptSchema = z28.object({
|
|
31633
32044
|
...BaseMetadataSchema.shape,
|
|
31634
32045
|
...IconsSchema.shape,
|
|
31635
32046
|
/**
|
|
31636
32047
|
* An optional description of what this prompt provides
|
|
31637
32048
|
*/
|
|
31638
|
-
description:
|
|
32049
|
+
description: z28.optional(z28.string()),
|
|
31639
32050
|
/**
|
|
31640
32051
|
* A list of arguments to use for templating the prompt.
|
|
31641
32052
|
*/
|
|
31642
|
-
arguments:
|
|
32053
|
+
arguments: z28.optional(z28.array(PromptArgumentSchema)),
|
|
31643
32054
|
/**
|
|
31644
32055
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
31645
32056
|
* for notes on _meta usage.
|
|
31646
32057
|
*/
|
|
31647
|
-
_meta:
|
|
32058
|
+
_meta: z28.optional(z28.looseObject({}))
|
|
31648
32059
|
});
|
|
31649
32060
|
ListPromptsRequestSchema = PaginatedRequestSchema.extend({
|
|
31650
|
-
method:
|
|
32061
|
+
method: z28.literal("prompts/list")
|
|
31651
32062
|
});
|
|
31652
32063
|
ListPromptsResultSchema = PaginatedResultSchema.extend({
|
|
31653
|
-
prompts:
|
|
32064
|
+
prompts: z28.array(PromptSchema)
|
|
31654
32065
|
});
|
|
31655
32066
|
GetPromptRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
31656
32067
|
/**
|
|
31657
32068
|
* The name of the prompt or prompt template.
|
|
31658
32069
|
*/
|
|
31659
|
-
name:
|
|
32070
|
+
name: z28.string(),
|
|
31660
32071
|
/**
|
|
31661
32072
|
* Arguments to use for templating the prompt.
|
|
31662
32073
|
*/
|
|
31663
|
-
arguments:
|
|
32074
|
+
arguments: z28.record(z28.string(), z28.string()).optional()
|
|
31664
32075
|
});
|
|
31665
32076
|
GetPromptRequestSchema = RequestSchema.extend({
|
|
31666
|
-
method:
|
|
32077
|
+
method: z28.literal("prompts/get"),
|
|
31667
32078
|
params: GetPromptRequestParamsSchema
|
|
31668
32079
|
});
|
|
31669
|
-
TextContentSchema =
|
|
31670
|
-
type:
|
|
32080
|
+
TextContentSchema = z28.object({
|
|
32081
|
+
type: z28.literal("text"),
|
|
31671
32082
|
/**
|
|
31672
32083
|
* The text content of the message.
|
|
31673
32084
|
*/
|
|
31674
|
-
text:
|
|
32085
|
+
text: z28.string(),
|
|
31675
32086
|
/**
|
|
31676
32087
|
* Optional annotations for the client.
|
|
31677
32088
|
*/
|
|
@@ -31680,10 +32091,10 @@ var init_types4 = __esm({
|
|
|
31680
32091
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
31681
32092
|
* for notes on _meta usage.
|
|
31682
32093
|
*/
|
|
31683
|
-
_meta:
|
|
32094
|
+
_meta: z28.record(z28.string(), z28.unknown()).optional()
|
|
31684
32095
|
});
|
|
31685
|
-
ImageContentSchema =
|
|
31686
|
-
type:
|
|
32096
|
+
ImageContentSchema = z28.object({
|
|
32097
|
+
type: z28.literal("image"),
|
|
31687
32098
|
/**
|
|
31688
32099
|
* The base64-encoded image data.
|
|
31689
32100
|
*/
|
|
@@ -31691,7 +32102,7 @@ var init_types4 = __esm({
|
|
|
31691
32102
|
/**
|
|
31692
32103
|
* The MIME type of the image. Different providers may support different image types.
|
|
31693
32104
|
*/
|
|
31694
|
-
mimeType:
|
|
32105
|
+
mimeType: z28.string(),
|
|
31695
32106
|
/**
|
|
31696
32107
|
* Optional annotations for the client.
|
|
31697
32108
|
*/
|
|
@@ -31700,10 +32111,10 @@ var init_types4 = __esm({
|
|
|
31700
32111
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
31701
32112
|
* for notes on _meta usage.
|
|
31702
32113
|
*/
|
|
31703
|
-
_meta:
|
|
32114
|
+
_meta: z28.record(z28.string(), z28.unknown()).optional()
|
|
31704
32115
|
});
|
|
31705
|
-
AudioContentSchema =
|
|
31706
|
-
type:
|
|
32116
|
+
AudioContentSchema = z28.object({
|
|
32117
|
+
type: z28.literal("audio"),
|
|
31707
32118
|
/**
|
|
31708
32119
|
* The base64-encoded audio data.
|
|
31709
32120
|
*/
|
|
@@ -31711,7 +32122,7 @@ var init_types4 = __esm({
|
|
|
31711
32122
|
/**
|
|
31712
32123
|
* The MIME type of the audio. Different providers may support different audio types.
|
|
31713
32124
|
*/
|
|
31714
|
-
mimeType:
|
|
32125
|
+
mimeType: z28.string(),
|
|
31715
32126
|
/**
|
|
31716
32127
|
* Optional annotations for the client.
|
|
31717
32128
|
*/
|
|
@@ -31720,34 +32131,34 @@ var init_types4 = __esm({
|
|
|
31720
32131
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
31721
32132
|
* for notes on _meta usage.
|
|
31722
32133
|
*/
|
|
31723
|
-
_meta:
|
|
32134
|
+
_meta: z28.record(z28.string(), z28.unknown()).optional()
|
|
31724
32135
|
});
|
|
31725
|
-
ToolUseContentSchema =
|
|
31726
|
-
type:
|
|
32136
|
+
ToolUseContentSchema = z28.object({
|
|
32137
|
+
type: z28.literal("tool_use"),
|
|
31727
32138
|
/**
|
|
31728
32139
|
* The name of the tool to invoke.
|
|
31729
32140
|
* Must match a tool name from the request's tools array.
|
|
31730
32141
|
*/
|
|
31731
|
-
name:
|
|
32142
|
+
name: z28.string(),
|
|
31732
32143
|
/**
|
|
31733
32144
|
* Unique identifier for this tool call.
|
|
31734
32145
|
* Used to correlate with ToolResultContent in subsequent messages.
|
|
31735
32146
|
*/
|
|
31736
|
-
id:
|
|
32147
|
+
id: z28.string(),
|
|
31737
32148
|
/**
|
|
31738
32149
|
* Arguments to pass to the tool.
|
|
31739
32150
|
* Must conform to the tool's inputSchema.
|
|
31740
32151
|
*/
|
|
31741
|
-
input:
|
|
32152
|
+
input: z28.record(z28.string(), z28.unknown()),
|
|
31742
32153
|
/**
|
|
31743
32154
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
31744
32155
|
* for notes on _meta usage.
|
|
31745
32156
|
*/
|
|
31746
|
-
_meta:
|
|
32157
|
+
_meta: z28.record(z28.string(), z28.unknown()).optional()
|
|
31747
32158
|
});
|
|
31748
|
-
EmbeddedResourceSchema =
|
|
31749
|
-
type:
|
|
31750
|
-
resource:
|
|
32159
|
+
EmbeddedResourceSchema = z28.object({
|
|
32160
|
+
type: z28.literal("resource"),
|
|
32161
|
+
resource: z28.union([TextResourceContentsSchema, BlobResourceContentsSchema]),
|
|
31751
32162
|
/**
|
|
31752
32163
|
* Optional annotations for the client.
|
|
31753
32164
|
*/
|
|
@@ -31756,19 +32167,19 @@ var init_types4 = __esm({
|
|
|
31756
32167
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
31757
32168
|
* for notes on _meta usage.
|
|
31758
32169
|
*/
|
|
31759
|
-
_meta:
|
|
32170
|
+
_meta: z28.record(z28.string(), z28.unknown()).optional()
|
|
31760
32171
|
});
|
|
31761
32172
|
ResourceLinkSchema = ResourceSchema.extend({
|
|
31762
|
-
type:
|
|
32173
|
+
type: z28.literal("resource_link")
|
|
31763
32174
|
});
|
|
31764
|
-
ContentBlockSchema =
|
|
32175
|
+
ContentBlockSchema = z28.union([
|
|
31765
32176
|
TextContentSchema,
|
|
31766
32177
|
ImageContentSchema,
|
|
31767
32178
|
AudioContentSchema,
|
|
31768
32179
|
ResourceLinkSchema,
|
|
31769
32180
|
EmbeddedResourceSchema
|
|
31770
32181
|
]);
|
|
31771
|
-
PromptMessageSchema =
|
|
32182
|
+
PromptMessageSchema = z28.object({
|
|
31772
32183
|
role: RoleSchema,
|
|
31773
32184
|
content: ContentBlockSchema
|
|
31774
32185
|
});
|
|
@@ -31776,24 +32187,24 @@ var init_types4 = __esm({
|
|
|
31776
32187
|
/**
|
|
31777
32188
|
* An optional description for the prompt.
|
|
31778
32189
|
*/
|
|
31779
|
-
description:
|
|
31780
|
-
messages:
|
|
32190
|
+
description: z28.string().optional(),
|
|
32191
|
+
messages: z28.array(PromptMessageSchema)
|
|
31781
32192
|
});
|
|
31782
32193
|
PromptListChangedNotificationSchema = NotificationSchema.extend({
|
|
31783
|
-
method:
|
|
32194
|
+
method: z28.literal("notifications/prompts/list_changed"),
|
|
31784
32195
|
params: NotificationsParamsSchema.optional()
|
|
31785
32196
|
});
|
|
31786
|
-
ToolAnnotationsSchema =
|
|
32197
|
+
ToolAnnotationsSchema = z28.object({
|
|
31787
32198
|
/**
|
|
31788
32199
|
* A human-readable title for the tool.
|
|
31789
32200
|
*/
|
|
31790
|
-
title:
|
|
32201
|
+
title: z28.string().optional(),
|
|
31791
32202
|
/**
|
|
31792
32203
|
* If true, the tool does not modify its environment.
|
|
31793
32204
|
*
|
|
31794
32205
|
* Default: false
|
|
31795
32206
|
*/
|
|
31796
|
-
readOnlyHint:
|
|
32207
|
+
readOnlyHint: z28.boolean().optional(),
|
|
31797
32208
|
/**
|
|
31798
32209
|
* If true, the tool may perform destructive updates to its environment.
|
|
31799
32210
|
* If false, the tool performs only additive updates.
|
|
@@ -31802,7 +32213,7 @@ var init_types4 = __esm({
|
|
|
31802
32213
|
*
|
|
31803
32214
|
* Default: true
|
|
31804
32215
|
*/
|
|
31805
|
-
destructiveHint:
|
|
32216
|
+
destructiveHint: z28.boolean().optional(),
|
|
31806
32217
|
/**
|
|
31807
32218
|
* If true, calling the tool repeatedly with the same arguments
|
|
31808
32219
|
* will have no additional effect on the its environment.
|
|
@@ -31811,7 +32222,7 @@ var init_types4 = __esm({
|
|
|
31811
32222
|
*
|
|
31812
32223
|
* Default: false
|
|
31813
32224
|
*/
|
|
31814
|
-
idempotentHint:
|
|
32225
|
+
idempotentHint: z28.boolean().optional(),
|
|
31815
32226
|
/**
|
|
31816
32227
|
* If true, this tool may interact with an "open world" of external
|
|
31817
32228
|
* entities. If false, the tool's domain of interaction is closed.
|
|
@@ -31820,9 +32231,9 @@ var init_types4 = __esm({
|
|
|
31820
32231
|
*
|
|
31821
32232
|
* Default: true
|
|
31822
32233
|
*/
|
|
31823
|
-
openWorldHint:
|
|
32234
|
+
openWorldHint: z28.boolean().optional()
|
|
31824
32235
|
});
|
|
31825
|
-
ToolExecutionSchema =
|
|
32236
|
+
ToolExecutionSchema = z28.object({
|
|
31826
32237
|
/**
|
|
31827
32238
|
* Indicates the tool's preference for task-augmented execution.
|
|
31828
32239
|
* - "required": Clients MUST invoke the tool as a task
|
|
@@ -31831,34 +32242,34 @@ var init_types4 = __esm({
|
|
|
31831
32242
|
*
|
|
31832
32243
|
* If not present, defaults to "forbidden".
|
|
31833
32244
|
*/
|
|
31834
|
-
taskSupport:
|
|
32245
|
+
taskSupport: z28.enum(["required", "optional", "forbidden"]).optional()
|
|
31835
32246
|
});
|
|
31836
|
-
ToolSchema =
|
|
32247
|
+
ToolSchema = z28.object({
|
|
31837
32248
|
...BaseMetadataSchema.shape,
|
|
31838
32249
|
...IconsSchema.shape,
|
|
31839
32250
|
/**
|
|
31840
32251
|
* A human-readable description of the tool.
|
|
31841
32252
|
*/
|
|
31842
|
-
description:
|
|
32253
|
+
description: z28.string().optional(),
|
|
31843
32254
|
/**
|
|
31844
32255
|
* A JSON Schema 2020-12 object defining the expected parameters for the tool.
|
|
31845
32256
|
* Must have type: 'object' at the root level per MCP spec.
|
|
31846
32257
|
*/
|
|
31847
|
-
inputSchema:
|
|
31848
|
-
type:
|
|
31849
|
-
properties:
|
|
31850
|
-
required:
|
|
31851
|
-
}).catchall(
|
|
32258
|
+
inputSchema: z28.object({
|
|
32259
|
+
type: z28.literal("object"),
|
|
32260
|
+
properties: z28.record(z28.string(), AssertObjectSchema).optional(),
|
|
32261
|
+
required: z28.array(z28.string()).optional()
|
|
32262
|
+
}).catchall(z28.unknown()),
|
|
31852
32263
|
/**
|
|
31853
32264
|
* An optional JSON Schema 2020-12 object defining the structure of the tool's output
|
|
31854
32265
|
* returned in the structuredContent field of a CallToolResult.
|
|
31855
32266
|
* Must have type: 'object' at the root level per MCP spec.
|
|
31856
32267
|
*/
|
|
31857
|
-
outputSchema:
|
|
31858
|
-
type:
|
|
31859
|
-
properties:
|
|
31860
|
-
required:
|
|
31861
|
-
}).catchall(
|
|
32268
|
+
outputSchema: z28.object({
|
|
32269
|
+
type: z28.literal("object"),
|
|
32270
|
+
properties: z28.record(z28.string(), AssertObjectSchema).optional(),
|
|
32271
|
+
required: z28.array(z28.string()).optional()
|
|
32272
|
+
}).catchall(z28.unknown()).optional(),
|
|
31862
32273
|
/**
|
|
31863
32274
|
* Optional additional tool information.
|
|
31864
32275
|
*/
|
|
@@ -31871,13 +32282,13 @@ var init_types4 = __esm({
|
|
|
31871
32282
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
31872
32283
|
* for notes on _meta usage.
|
|
31873
32284
|
*/
|
|
31874
|
-
_meta:
|
|
32285
|
+
_meta: z28.record(z28.string(), z28.unknown()).optional()
|
|
31875
32286
|
});
|
|
31876
32287
|
ListToolsRequestSchema = PaginatedRequestSchema.extend({
|
|
31877
|
-
method:
|
|
32288
|
+
method: z28.literal("tools/list")
|
|
31878
32289
|
});
|
|
31879
32290
|
ListToolsResultSchema = PaginatedResultSchema.extend({
|
|
31880
|
-
tools:
|
|
32291
|
+
tools: z28.array(ToolSchema)
|
|
31881
32292
|
});
|
|
31882
32293
|
CallToolResultSchema = ResultSchema.extend({
|
|
31883
32294
|
/**
|
|
@@ -31886,13 +32297,13 @@ var init_types4 = __esm({
|
|
|
31886
32297
|
* If the Tool does not define an outputSchema, this field MUST be present in the result.
|
|
31887
32298
|
* For backwards compatibility, this field is always present, but it may be empty.
|
|
31888
32299
|
*/
|
|
31889
|
-
content:
|
|
32300
|
+
content: z28.array(ContentBlockSchema).default([]),
|
|
31890
32301
|
/**
|
|
31891
32302
|
* An object containing structured tool output.
|
|
31892
32303
|
*
|
|
31893
32304
|
* If the Tool defines an outputSchema, this field MUST be present in the result, and contain a JSON object that matches the schema.
|
|
31894
32305
|
*/
|
|
31895
|
-
structuredContent:
|
|
32306
|
+
structuredContent: z28.record(z28.string(), z28.unknown()).optional(),
|
|
31896
32307
|
/**
|
|
31897
32308
|
* Whether the tool call ended in an error.
|
|
31898
32309
|
*
|
|
@@ -31907,30 +32318,30 @@ var init_types4 = __esm({
|
|
|
31907
32318
|
* server does not support tool calls, or any other exceptional conditions,
|
|
31908
32319
|
* should be reported as an MCP error response.
|
|
31909
32320
|
*/
|
|
31910
|
-
isError:
|
|
32321
|
+
isError: z28.boolean().optional()
|
|
31911
32322
|
});
|
|
31912
32323
|
CompatibilityCallToolResultSchema = CallToolResultSchema.or(ResultSchema.extend({
|
|
31913
|
-
toolResult:
|
|
32324
|
+
toolResult: z28.unknown()
|
|
31914
32325
|
}));
|
|
31915
32326
|
CallToolRequestParamsSchema = TaskAugmentedRequestParamsSchema.extend({
|
|
31916
32327
|
/**
|
|
31917
32328
|
* The name of the tool to call.
|
|
31918
32329
|
*/
|
|
31919
|
-
name:
|
|
32330
|
+
name: z28.string(),
|
|
31920
32331
|
/**
|
|
31921
32332
|
* Arguments to pass to the tool.
|
|
31922
32333
|
*/
|
|
31923
|
-
arguments:
|
|
32334
|
+
arguments: z28.record(z28.string(), z28.unknown()).optional()
|
|
31924
32335
|
});
|
|
31925
32336
|
CallToolRequestSchema = RequestSchema.extend({
|
|
31926
|
-
method:
|
|
32337
|
+
method: z28.literal("tools/call"),
|
|
31927
32338
|
params: CallToolRequestParamsSchema
|
|
31928
32339
|
});
|
|
31929
32340
|
ToolListChangedNotificationSchema = NotificationSchema.extend({
|
|
31930
|
-
method:
|
|
32341
|
+
method: z28.literal("notifications/tools/list_changed"),
|
|
31931
32342
|
params: NotificationsParamsSchema.optional()
|
|
31932
32343
|
});
|
|
31933
|
-
ListChangedOptionsBaseSchema =
|
|
32344
|
+
ListChangedOptionsBaseSchema = z28.object({
|
|
31934
32345
|
/**
|
|
31935
32346
|
* If true, the list will be refreshed automatically when a list changed notification is received.
|
|
31936
32347
|
* The callback will be called with the updated list.
|
|
@@ -31939,7 +32350,7 @@ var init_types4 = __esm({
|
|
|
31939
32350
|
*
|
|
31940
32351
|
* @default true
|
|
31941
32352
|
*/
|
|
31942
|
-
autoRefresh:
|
|
32353
|
+
autoRefresh: z28.boolean().default(true),
|
|
31943
32354
|
/**
|
|
31944
32355
|
* Debounce time in milliseconds for list changed notification processing.
|
|
31945
32356
|
*
|
|
@@ -31948,9 +32359,9 @@ var init_types4 = __esm({
|
|
|
31948
32359
|
*
|
|
31949
32360
|
* @default 300
|
|
31950
32361
|
*/
|
|
31951
|
-
debounceMs:
|
|
32362
|
+
debounceMs: z28.number().int().nonnegative().default(300)
|
|
31952
32363
|
});
|
|
31953
|
-
LoggingLevelSchema =
|
|
32364
|
+
LoggingLevelSchema = z28.enum(["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]);
|
|
31954
32365
|
SetLevelRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
31955
32366
|
/**
|
|
31956
32367
|
* The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/logging/message.
|
|
@@ -31958,7 +32369,7 @@ var init_types4 = __esm({
|
|
|
31958
32369
|
level: LoggingLevelSchema
|
|
31959
32370
|
});
|
|
31960
32371
|
SetLevelRequestSchema = RequestSchema.extend({
|
|
31961
|
-
method:
|
|
32372
|
+
method: z28.literal("logging/setLevel"),
|
|
31962
32373
|
params: SetLevelRequestParamsSchema
|
|
31963
32374
|
});
|
|
31964
32375
|
LoggingMessageNotificationParamsSchema = NotificationsParamsSchema.extend({
|
|
@@ -31969,80 +32380,80 @@ var init_types4 = __esm({
|
|
|
31969
32380
|
/**
|
|
31970
32381
|
* An optional name of the logger issuing this message.
|
|
31971
32382
|
*/
|
|
31972
|
-
logger:
|
|
32383
|
+
logger: z28.string().optional(),
|
|
31973
32384
|
/**
|
|
31974
32385
|
* The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here.
|
|
31975
32386
|
*/
|
|
31976
|
-
data:
|
|
32387
|
+
data: z28.unknown()
|
|
31977
32388
|
});
|
|
31978
32389
|
LoggingMessageNotificationSchema = NotificationSchema.extend({
|
|
31979
|
-
method:
|
|
32390
|
+
method: z28.literal("notifications/message"),
|
|
31980
32391
|
params: LoggingMessageNotificationParamsSchema
|
|
31981
32392
|
});
|
|
31982
|
-
ModelHintSchema =
|
|
32393
|
+
ModelHintSchema = z28.object({
|
|
31983
32394
|
/**
|
|
31984
32395
|
* A hint for a model name.
|
|
31985
32396
|
*/
|
|
31986
|
-
name:
|
|
32397
|
+
name: z28.string().optional()
|
|
31987
32398
|
});
|
|
31988
|
-
ModelPreferencesSchema =
|
|
32399
|
+
ModelPreferencesSchema = z28.object({
|
|
31989
32400
|
/**
|
|
31990
32401
|
* Optional hints to use for model selection.
|
|
31991
32402
|
*/
|
|
31992
|
-
hints:
|
|
32403
|
+
hints: z28.array(ModelHintSchema).optional(),
|
|
31993
32404
|
/**
|
|
31994
32405
|
* How much to prioritize cost when selecting a model.
|
|
31995
32406
|
*/
|
|
31996
|
-
costPriority:
|
|
32407
|
+
costPriority: z28.number().min(0).max(1).optional(),
|
|
31997
32408
|
/**
|
|
31998
32409
|
* How much to prioritize sampling speed (latency) when selecting a model.
|
|
31999
32410
|
*/
|
|
32000
|
-
speedPriority:
|
|
32411
|
+
speedPriority: z28.number().min(0).max(1).optional(),
|
|
32001
32412
|
/**
|
|
32002
32413
|
* How much to prioritize intelligence and capabilities when selecting a model.
|
|
32003
32414
|
*/
|
|
32004
|
-
intelligencePriority:
|
|
32415
|
+
intelligencePriority: z28.number().min(0).max(1).optional()
|
|
32005
32416
|
});
|
|
32006
|
-
ToolChoiceSchema =
|
|
32417
|
+
ToolChoiceSchema = z28.object({
|
|
32007
32418
|
/**
|
|
32008
32419
|
* Controls when tools are used:
|
|
32009
32420
|
* - "auto": Model decides whether to use tools (default)
|
|
32010
32421
|
* - "required": Model MUST use at least one tool before completing
|
|
32011
32422
|
* - "none": Model MUST NOT use any tools
|
|
32012
32423
|
*/
|
|
32013
|
-
mode:
|
|
32424
|
+
mode: z28.enum(["auto", "required", "none"]).optional()
|
|
32014
32425
|
});
|
|
32015
|
-
ToolResultContentSchema =
|
|
32016
|
-
type:
|
|
32017
|
-
toolUseId:
|
|
32018
|
-
content:
|
|
32019
|
-
structuredContent:
|
|
32020
|
-
isError:
|
|
32426
|
+
ToolResultContentSchema = z28.object({
|
|
32427
|
+
type: z28.literal("tool_result"),
|
|
32428
|
+
toolUseId: z28.string().describe("The unique identifier for the corresponding tool call."),
|
|
32429
|
+
content: z28.array(ContentBlockSchema).default([]),
|
|
32430
|
+
structuredContent: z28.object({}).loose().optional(),
|
|
32431
|
+
isError: z28.boolean().optional(),
|
|
32021
32432
|
/**
|
|
32022
32433
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
32023
32434
|
* for notes on _meta usage.
|
|
32024
32435
|
*/
|
|
32025
|
-
_meta:
|
|
32436
|
+
_meta: z28.record(z28.string(), z28.unknown()).optional()
|
|
32026
32437
|
});
|
|
32027
|
-
SamplingContentSchema =
|
|
32028
|
-
SamplingMessageContentBlockSchema =
|
|
32438
|
+
SamplingContentSchema = z28.discriminatedUnion("type", [TextContentSchema, ImageContentSchema, AudioContentSchema]);
|
|
32439
|
+
SamplingMessageContentBlockSchema = z28.discriminatedUnion("type", [
|
|
32029
32440
|
TextContentSchema,
|
|
32030
32441
|
ImageContentSchema,
|
|
32031
32442
|
AudioContentSchema,
|
|
32032
32443
|
ToolUseContentSchema,
|
|
32033
32444
|
ToolResultContentSchema
|
|
32034
32445
|
]);
|
|
32035
|
-
SamplingMessageSchema =
|
|
32446
|
+
SamplingMessageSchema = z28.object({
|
|
32036
32447
|
role: RoleSchema,
|
|
32037
|
-
content:
|
|
32448
|
+
content: z28.union([SamplingMessageContentBlockSchema, z28.array(SamplingMessageContentBlockSchema)]),
|
|
32038
32449
|
/**
|
|
32039
32450
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
32040
32451
|
* for notes on _meta usage.
|
|
32041
32452
|
*/
|
|
32042
|
-
_meta:
|
|
32453
|
+
_meta: z28.record(z28.string(), z28.unknown()).optional()
|
|
32043
32454
|
});
|
|
32044
32455
|
CreateMessageRequestParamsSchema = TaskAugmentedRequestParamsSchema.extend({
|
|
32045
|
-
messages:
|
|
32456
|
+
messages: z28.array(SamplingMessageSchema),
|
|
32046
32457
|
/**
|
|
32047
32458
|
* The server's preferences for which model to select. The client MAY modify or omit this request.
|
|
32048
32459
|
*/
|
|
@@ -32050,7 +32461,7 @@ var init_types4 = __esm({
|
|
|
32050
32461
|
/**
|
|
32051
32462
|
* An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt.
|
|
32052
32463
|
*/
|
|
32053
|
-
systemPrompt:
|
|
32464
|
+
systemPrompt: z28.string().optional(),
|
|
32054
32465
|
/**
|
|
32055
32466
|
* A request to include context from one or more MCP servers (including the caller), to be attached to the prompt.
|
|
32056
32467
|
* The client MAY ignore this request.
|
|
@@ -32058,15 +32469,15 @@ var init_types4 = __esm({
|
|
|
32058
32469
|
* Default is "none". Values "thisServer" and "allServers" are soft-deprecated. Servers SHOULD only use these values if the client
|
|
32059
32470
|
* declares ClientCapabilities.sampling.context. These values may be removed in future spec releases.
|
|
32060
32471
|
*/
|
|
32061
|
-
includeContext:
|
|
32062
|
-
temperature:
|
|
32472
|
+
includeContext: z28.enum(["none", "thisServer", "allServers"]).optional(),
|
|
32473
|
+
temperature: z28.number().optional(),
|
|
32063
32474
|
/**
|
|
32064
32475
|
* The requested maximum number of tokens to sample (to prevent runaway completions).
|
|
32065
32476
|
*
|
|
32066
32477
|
* The client MAY choose to sample fewer tokens than the requested maximum.
|
|
32067
32478
|
*/
|
|
32068
|
-
maxTokens:
|
|
32069
|
-
stopSequences:
|
|
32479
|
+
maxTokens: z28.number().int(),
|
|
32480
|
+
stopSequences: z28.array(z28.string()).optional(),
|
|
32070
32481
|
/**
|
|
32071
32482
|
* Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific.
|
|
32072
32483
|
*/
|
|
@@ -32075,7 +32486,7 @@ var init_types4 = __esm({
|
|
|
32075
32486
|
* Tools that the model may use during generation.
|
|
32076
32487
|
* The client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared.
|
|
32077
32488
|
*/
|
|
32078
|
-
tools:
|
|
32489
|
+
tools: z28.array(ToolSchema).optional(),
|
|
32079
32490
|
/**
|
|
32080
32491
|
* Controls how the model uses tools.
|
|
32081
32492
|
* The client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared.
|
|
@@ -32084,14 +32495,14 @@ var init_types4 = __esm({
|
|
|
32084
32495
|
toolChoice: ToolChoiceSchema.optional()
|
|
32085
32496
|
});
|
|
32086
32497
|
CreateMessageRequestSchema = RequestSchema.extend({
|
|
32087
|
-
method:
|
|
32498
|
+
method: z28.literal("sampling/createMessage"),
|
|
32088
32499
|
params: CreateMessageRequestParamsSchema
|
|
32089
32500
|
});
|
|
32090
32501
|
CreateMessageResultSchema = ResultSchema.extend({
|
|
32091
32502
|
/**
|
|
32092
32503
|
* The name of the model that generated the message.
|
|
32093
32504
|
*/
|
|
32094
|
-
model:
|
|
32505
|
+
model: z28.string(),
|
|
32095
32506
|
/**
|
|
32096
32507
|
* The reason why sampling stopped, if known.
|
|
32097
32508
|
*
|
|
@@ -32102,7 +32513,7 @@ var init_types4 = __esm({
|
|
|
32102
32513
|
*
|
|
32103
32514
|
* This field is an open string to allow for provider-specific stop reasons.
|
|
32104
32515
|
*/
|
|
32105
|
-
stopReason:
|
|
32516
|
+
stopReason: z28.optional(z28.enum(["endTurn", "stopSequence", "maxTokens"]).or(z28.string())),
|
|
32106
32517
|
role: RoleSchema,
|
|
32107
32518
|
/**
|
|
32108
32519
|
* Response content. Single content block (text, image, or audio).
|
|
@@ -32113,7 +32524,7 @@ var init_types4 = __esm({
|
|
|
32113
32524
|
/**
|
|
32114
32525
|
* The name of the model that generated the message.
|
|
32115
32526
|
*/
|
|
32116
|
-
model:
|
|
32527
|
+
model: z28.string(),
|
|
32117
32528
|
/**
|
|
32118
32529
|
* The reason why sampling stopped, if known.
|
|
32119
32530
|
*
|
|
@@ -32125,144 +32536,144 @@ var init_types4 = __esm({
|
|
|
32125
32536
|
*
|
|
32126
32537
|
* This field is an open string to allow for provider-specific stop reasons.
|
|
32127
32538
|
*/
|
|
32128
|
-
stopReason:
|
|
32539
|
+
stopReason: z28.optional(z28.enum(["endTurn", "stopSequence", "maxTokens", "toolUse"]).or(z28.string())),
|
|
32129
32540
|
role: RoleSchema,
|
|
32130
32541
|
/**
|
|
32131
32542
|
* Response content. May be a single block or array. May include ToolUseContent if stopReason is "toolUse".
|
|
32132
32543
|
*/
|
|
32133
|
-
content:
|
|
32544
|
+
content: z28.union([SamplingMessageContentBlockSchema, z28.array(SamplingMessageContentBlockSchema)])
|
|
32134
32545
|
});
|
|
32135
|
-
BooleanSchemaSchema =
|
|
32136
|
-
type:
|
|
32137
|
-
title:
|
|
32138
|
-
description:
|
|
32139
|
-
default:
|
|
32546
|
+
BooleanSchemaSchema = z28.object({
|
|
32547
|
+
type: z28.literal("boolean"),
|
|
32548
|
+
title: z28.string().optional(),
|
|
32549
|
+
description: z28.string().optional(),
|
|
32550
|
+
default: z28.boolean().optional()
|
|
32140
32551
|
});
|
|
32141
|
-
StringSchemaSchema =
|
|
32142
|
-
type:
|
|
32143
|
-
title:
|
|
32144
|
-
description:
|
|
32145
|
-
minLength:
|
|
32146
|
-
maxLength:
|
|
32147
|
-
format:
|
|
32148
|
-
default:
|
|
32552
|
+
StringSchemaSchema = z28.object({
|
|
32553
|
+
type: z28.literal("string"),
|
|
32554
|
+
title: z28.string().optional(),
|
|
32555
|
+
description: z28.string().optional(),
|
|
32556
|
+
minLength: z28.number().optional(),
|
|
32557
|
+
maxLength: z28.number().optional(),
|
|
32558
|
+
format: z28.enum(["email", "uri", "date", "date-time"]).optional(),
|
|
32559
|
+
default: z28.string().optional()
|
|
32149
32560
|
});
|
|
32150
|
-
NumberSchemaSchema =
|
|
32151
|
-
type:
|
|
32152
|
-
title:
|
|
32153
|
-
description:
|
|
32154
|
-
minimum:
|
|
32155
|
-
maximum:
|
|
32156
|
-
default:
|
|
32561
|
+
NumberSchemaSchema = z28.object({
|
|
32562
|
+
type: z28.enum(["number", "integer"]),
|
|
32563
|
+
title: z28.string().optional(),
|
|
32564
|
+
description: z28.string().optional(),
|
|
32565
|
+
minimum: z28.number().optional(),
|
|
32566
|
+
maximum: z28.number().optional(),
|
|
32567
|
+
default: z28.number().optional()
|
|
32157
32568
|
});
|
|
32158
|
-
UntitledSingleSelectEnumSchemaSchema =
|
|
32159
|
-
type:
|
|
32160
|
-
title:
|
|
32161
|
-
description:
|
|
32162
|
-
enum:
|
|
32163
|
-
default:
|
|
32569
|
+
UntitledSingleSelectEnumSchemaSchema = z28.object({
|
|
32570
|
+
type: z28.literal("string"),
|
|
32571
|
+
title: z28.string().optional(),
|
|
32572
|
+
description: z28.string().optional(),
|
|
32573
|
+
enum: z28.array(z28.string()),
|
|
32574
|
+
default: z28.string().optional()
|
|
32164
32575
|
});
|
|
32165
|
-
TitledSingleSelectEnumSchemaSchema =
|
|
32166
|
-
type:
|
|
32167
|
-
title:
|
|
32168
|
-
description:
|
|
32169
|
-
oneOf:
|
|
32170
|
-
const:
|
|
32171
|
-
title:
|
|
32576
|
+
TitledSingleSelectEnumSchemaSchema = z28.object({
|
|
32577
|
+
type: z28.literal("string"),
|
|
32578
|
+
title: z28.string().optional(),
|
|
32579
|
+
description: z28.string().optional(),
|
|
32580
|
+
oneOf: z28.array(z28.object({
|
|
32581
|
+
const: z28.string(),
|
|
32582
|
+
title: z28.string()
|
|
32172
32583
|
})),
|
|
32173
|
-
default:
|
|
32584
|
+
default: z28.string().optional()
|
|
32174
32585
|
});
|
|
32175
|
-
LegacyTitledEnumSchemaSchema =
|
|
32176
|
-
type:
|
|
32177
|
-
title:
|
|
32178
|
-
description:
|
|
32179
|
-
enum:
|
|
32180
|
-
enumNames:
|
|
32181
|
-
default:
|
|
32586
|
+
LegacyTitledEnumSchemaSchema = z28.object({
|
|
32587
|
+
type: z28.literal("string"),
|
|
32588
|
+
title: z28.string().optional(),
|
|
32589
|
+
description: z28.string().optional(),
|
|
32590
|
+
enum: z28.array(z28.string()),
|
|
32591
|
+
enumNames: z28.array(z28.string()).optional(),
|
|
32592
|
+
default: z28.string().optional()
|
|
32182
32593
|
});
|
|
32183
|
-
SingleSelectEnumSchemaSchema =
|
|
32184
|
-
UntitledMultiSelectEnumSchemaSchema =
|
|
32185
|
-
type:
|
|
32186
|
-
title:
|
|
32187
|
-
description:
|
|
32188
|
-
minItems:
|
|
32189
|
-
maxItems:
|
|
32190
|
-
items:
|
|
32191
|
-
type:
|
|
32192
|
-
enum:
|
|
32594
|
+
SingleSelectEnumSchemaSchema = z28.union([UntitledSingleSelectEnumSchemaSchema, TitledSingleSelectEnumSchemaSchema]);
|
|
32595
|
+
UntitledMultiSelectEnumSchemaSchema = z28.object({
|
|
32596
|
+
type: z28.literal("array"),
|
|
32597
|
+
title: z28.string().optional(),
|
|
32598
|
+
description: z28.string().optional(),
|
|
32599
|
+
minItems: z28.number().optional(),
|
|
32600
|
+
maxItems: z28.number().optional(),
|
|
32601
|
+
items: z28.object({
|
|
32602
|
+
type: z28.literal("string"),
|
|
32603
|
+
enum: z28.array(z28.string())
|
|
32193
32604
|
}),
|
|
32194
|
-
default:
|
|
32605
|
+
default: z28.array(z28.string()).optional()
|
|
32195
32606
|
});
|
|
32196
|
-
TitledMultiSelectEnumSchemaSchema =
|
|
32197
|
-
type:
|
|
32198
|
-
title:
|
|
32199
|
-
description:
|
|
32200
|
-
minItems:
|
|
32201
|
-
maxItems:
|
|
32202
|
-
items:
|
|
32203
|
-
anyOf:
|
|
32204
|
-
const:
|
|
32205
|
-
title:
|
|
32607
|
+
TitledMultiSelectEnumSchemaSchema = z28.object({
|
|
32608
|
+
type: z28.literal("array"),
|
|
32609
|
+
title: z28.string().optional(),
|
|
32610
|
+
description: z28.string().optional(),
|
|
32611
|
+
minItems: z28.number().optional(),
|
|
32612
|
+
maxItems: z28.number().optional(),
|
|
32613
|
+
items: z28.object({
|
|
32614
|
+
anyOf: z28.array(z28.object({
|
|
32615
|
+
const: z28.string(),
|
|
32616
|
+
title: z28.string()
|
|
32206
32617
|
}))
|
|
32207
32618
|
}),
|
|
32208
|
-
default:
|
|
32619
|
+
default: z28.array(z28.string()).optional()
|
|
32209
32620
|
});
|
|
32210
|
-
MultiSelectEnumSchemaSchema =
|
|
32211
|
-
EnumSchemaSchema =
|
|
32212
|
-
PrimitiveSchemaDefinitionSchema =
|
|
32621
|
+
MultiSelectEnumSchemaSchema = z28.union([UntitledMultiSelectEnumSchemaSchema, TitledMultiSelectEnumSchemaSchema]);
|
|
32622
|
+
EnumSchemaSchema = z28.union([LegacyTitledEnumSchemaSchema, SingleSelectEnumSchemaSchema, MultiSelectEnumSchemaSchema]);
|
|
32623
|
+
PrimitiveSchemaDefinitionSchema = z28.union([EnumSchemaSchema, BooleanSchemaSchema, StringSchemaSchema, NumberSchemaSchema]);
|
|
32213
32624
|
ElicitRequestFormParamsSchema = TaskAugmentedRequestParamsSchema.extend({
|
|
32214
32625
|
/**
|
|
32215
32626
|
* The elicitation mode.
|
|
32216
32627
|
*
|
|
32217
32628
|
* Optional for backward compatibility. Clients MUST treat missing mode as "form".
|
|
32218
32629
|
*/
|
|
32219
|
-
mode:
|
|
32630
|
+
mode: z28.literal("form").optional(),
|
|
32220
32631
|
/**
|
|
32221
32632
|
* The message to present to the user describing what information is being requested.
|
|
32222
32633
|
*/
|
|
32223
|
-
message:
|
|
32634
|
+
message: z28.string(),
|
|
32224
32635
|
/**
|
|
32225
32636
|
* A restricted subset of JSON Schema.
|
|
32226
32637
|
* Only top-level properties are allowed, without nesting.
|
|
32227
32638
|
*/
|
|
32228
|
-
requestedSchema:
|
|
32229
|
-
type:
|
|
32230
|
-
properties:
|
|
32231
|
-
required:
|
|
32639
|
+
requestedSchema: z28.object({
|
|
32640
|
+
type: z28.literal("object"),
|
|
32641
|
+
properties: z28.record(z28.string(), PrimitiveSchemaDefinitionSchema),
|
|
32642
|
+
required: z28.array(z28.string()).optional()
|
|
32232
32643
|
})
|
|
32233
32644
|
});
|
|
32234
32645
|
ElicitRequestURLParamsSchema = TaskAugmentedRequestParamsSchema.extend({
|
|
32235
32646
|
/**
|
|
32236
32647
|
* The elicitation mode.
|
|
32237
32648
|
*/
|
|
32238
|
-
mode:
|
|
32649
|
+
mode: z28.literal("url"),
|
|
32239
32650
|
/**
|
|
32240
32651
|
* The message to present to the user explaining why the interaction is needed.
|
|
32241
32652
|
*/
|
|
32242
|
-
message:
|
|
32653
|
+
message: z28.string(),
|
|
32243
32654
|
/**
|
|
32244
32655
|
* The ID of the elicitation, which must be unique within the context of the server.
|
|
32245
32656
|
* The client MUST treat this ID as an opaque value.
|
|
32246
32657
|
*/
|
|
32247
|
-
elicitationId:
|
|
32658
|
+
elicitationId: z28.string(),
|
|
32248
32659
|
/**
|
|
32249
32660
|
* The URL that the user should navigate to.
|
|
32250
32661
|
*/
|
|
32251
|
-
url:
|
|
32662
|
+
url: z28.string().url()
|
|
32252
32663
|
});
|
|
32253
|
-
ElicitRequestParamsSchema =
|
|
32664
|
+
ElicitRequestParamsSchema = z28.union([ElicitRequestFormParamsSchema, ElicitRequestURLParamsSchema]);
|
|
32254
32665
|
ElicitRequestSchema = RequestSchema.extend({
|
|
32255
|
-
method:
|
|
32666
|
+
method: z28.literal("elicitation/create"),
|
|
32256
32667
|
params: ElicitRequestParamsSchema
|
|
32257
32668
|
});
|
|
32258
32669
|
ElicitationCompleteNotificationParamsSchema = NotificationsParamsSchema.extend({
|
|
32259
32670
|
/**
|
|
32260
32671
|
* The ID of the elicitation that completed.
|
|
32261
32672
|
*/
|
|
32262
|
-
elicitationId:
|
|
32673
|
+
elicitationId: z28.string()
|
|
32263
32674
|
});
|
|
32264
32675
|
ElicitationCompleteNotificationSchema = NotificationSchema.extend({
|
|
32265
|
-
method:
|
|
32676
|
+
method: z28.literal("notifications/elicitation/complete"),
|
|
32266
32677
|
params: ElicitationCompleteNotificationParamsSchema
|
|
32267
32678
|
});
|
|
32268
32679
|
ElicitResultSchema = ResultSchema.extend({
|
|
@@ -32272,98 +32683,98 @@ var init_types4 = __esm({
|
|
|
32272
32683
|
* - "decline": User explicitly decline the action
|
|
32273
32684
|
* - "cancel": User dismissed without making an explicit choice
|
|
32274
32685
|
*/
|
|
32275
|
-
action:
|
|
32686
|
+
action: z28.enum(["accept", "decline", "cancel"]),
|
|
32276
32687
|
/**
|
|
32277
32688
|
* The submitted form data, only present when action is "accept".
|
|
32278
32689
|
* Contains values matching the requested schema.
|
|
32279
32690
|
* Per MCP spec, content is "typically omitted" for decline/cancel actions.
|
|
32280
32691
|
* We normalize null to undefined for leniency while maintaining type compatibility.
|
|
32281
32692
|
*/
|
|
32282
|
-
content:
|
|
32693
|
+
content: z28.preprocess((val) => val === null ? void 0 : val, z28.record(z28.string(), z28.union([z28.string(), z28.number(), z28.boolean(), z28.array(z28.string())])).optional())
|
|
32283
32694
|
});
|
|
32284
|
-
ResourceTemplateReferenceSchema =
|
|
32285
|
-
type:
|
|
32695
|
+
ResourceTemplateReferenceSchema = z28.object({
|
|
32696
|
+
type: z28.literal("ref/resource"),
|
|
32286
32697
|
/**
|
|
32287
32698
|
* The URI or URI template of the resource.
|
|
32288
32699
|
*/
|
|
32289
|
-
uri:
|
|
32700
|
+
uri: z28.string()
|
|
32290
32701
|
});
|
|
32291
|
-
PromptReferenceSchema =
|
|
32292
|
-
type:
|
|
32702
|
+
PromptReferenceSchema = z28.object({
|
|
32703
|
+
type: z28.literal("ref/prompt"),
|
|
32293
32704
|
/**
|
|
32294
32705
|
* The name of the prompt or prompt template
|
|
32295
32706
|
*/
|
|
32296
|
-
name:
|
|
32707
|
+
name: z28.string()
|
|
32297
32708
|
});
|
|
32298
32709
|
CompleteRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
32299
|
-
ref:
|
|
32710
|
+
ref: z28.union([PromptReferenceSchema, ResourceTemplateReferenceSchema]),
|
|
32300
32711
|
/**
|
|
32301
32712
|
* The argument's information
|
|
32302
32713
|
*/
|
|
32303
|
-
argument:
|
|
32714
|
+
argument: z28.object({
|
|
32304
32715
|
/**
|
|
32305
32716
|
* The name of the argument
|
|
32306
32717
|
*/
|
|
32307
|
-
name:
|
|
32718
|
+
name: z28.string(),
|
|
32308
32719
|
/**
|
|
32309
32720
|
* The value of the argument to use for completion matching.
|
|
32310
32721
|
*/
|
|
32311
|
-
value:
|
|
32722
|
+
value: z28.string()
|
|
32312
32723
|
}),
|
|
32313
|
-
context:
|
|
32724
|
+
context: z28.object({
|
|
32314
32725
|
/**
|
|
32315
32726
|
* Previously-resolved variables in a URI template or prompt.
|
|
32316
32727
|
*/
|
|
32317
|
-
arguments:
|
|
32728
|
+
arguments: z28.record(z28.string(), z28.string()).optional()
|
|
32318
32729
|
}).optional()
|
|
32319
32730
|
});
|
|
32320
32731
|
CompleteRequestSchema = RequestSchema.extend({
|
|
32321
|
-
method:
|
|
32732
|
+
method: z28.literal("completion/complete"),
|
|
32322
32733
|
params: CompleteRequestParamsSchema
|
|
32323
32734
|
});
|
|
32324
32735
|
CompleteResultSchema = ResultSchema.extend({
|
|
32325
|
-
completion:
|
|
32736
|
+
completion: z28.looseObject({
|
|
32326
32737
|
/**
|
|
32327
32738
|
* An array of completion values. Must not exceed 100 items.
|
|
32328
32739
|
*/
|
|
32329
|
-
values:
|
|
32740
|
+
values: z28.array(z28.string()).max(100),
|
|
32330
32741
|
/**
|
|
32331
32742
|
* The total number of completion options available. This can exceed the number of values actually sent in the response.
|
|
32332
32743
|
*/
|
|
32333
|
-
total:
|
|
32744
|
+
total: z28.optional(z28.number().int()),
|
|
32334
32745
|
/**
|
|
32335
32746
|
* Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown.
|
|
32336
32747
|
*/
|
|
32337
|
-
hasMore:
|
|
32748
|
+
hasMore: z28.optional(z28.boolean())
|
|
32338
32749
|
})
|
|
32339
32750
|
});
|
|
32340
|
-
RootSchema =
|
|
32751
|
+
RootSchema = z28.object({
|
|
32341
32752
|
/**
|
|
32342
32753
|
* The URI identifying the root. This *must* start with file:// for now.
|
|
32343
32754
|
*/
|
|
32344
|
-
uri:
|
|
32755
|
+
uri: z28.string().startsWith("file://"),
|
|
32345
32756
|
/**
|
|
32346
32757
|
* An optional name for the root.
|
|
32347
32758
|
*/
|
|
32348
|
-
name:
|
|
32759
|
+
name: z28.string().optional(),
|
|
32349
32760
|
/**
|
|
32350
32761
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
32351
32762
|
* for notes on _meta usage.
|
|
32352
32763
|
*/
|
|
32353
|
-
_meta:
|
|
32764
|
+
_meta: z28.record(z28.string(), z28.unknown()).optional()
|
|
32354
32765
|
});
|
|
32355
32766
|
ListRootsRequestSchema = RequestSchema.extend({
|
|
32356
|
-
method:
|
|
32767
|
+
method: z28.literal("roots/list"),
|
|
32357
32768
|
params: BaseRequestParamsSchema.optional()
|
|
32358
32769
|
});
|
|
32359
32770
|
ListRootsResultSchema = ResultSchema.extend({
|
|
32360
|
-
roots:
|
|
32771
|
+
roots: z28.array(RootSchema)
|
|
32361
32772
|
});
|
|
32362
32773
|
RootsListChangedNotificationSchema = NotificationSchema.extend({
|
|
32363
|
-
method:
|
|
32774
|
+
method: z28.literal("notifications/roots/list_changed"),
|
|
32364
32775
|
params: NotificationsParamsSchema.optional()
|
|
32365
32776
|
});
|
|
32366
|
-
ClientRequestSchema =
|
|
32777
|
+
ClientRequestSchema = z28.union([
|
|
32367
32778
|
PingRequestSchema,
|
|
32368
32779
|
InitializeRequestSchema,
|
|
32369
32780
|
CompleteRequestSchema,
|
|
@@ -32382,14 +32793,14 @@ var init_types4 = __esm({
|
|
|
32382
32793
|
ListTasksRequestSchema,
|
|
32383
32794
|
CancelTaskRequestSchema
|
|
32384
32795
|
]);
|
|
32385
|
-
ClientNotificationSchema =
|
|
32796
|
+
ClientNotificationSchema = z28.union([
|
|
32386
32797
|
CancelledNotificationSchema,
|
|
32387
32798
|
ProgressNotificationSchema,
|
|
32388
32799
|
InitializedNotificationSchema,
|
|
32389
32800
|
RootsListChangedNotificationSchema,
|
|
32390
32801
|
TaskStatusNotificationSchema
|
|
32391
32802
|
]);
|
|
32392
|
-
ClientResultSchema =
|
|
32803
|
+
ClientResultSchema = z28.union([
|
|
32393
32804
|
EmptyResultSchema,
|
|
32394
32805
|
CreateMessageResultSchema,
|
|
32395
32806
|
CreateMessageResultWithToolsSchema,
|
|
@@ -32399,7 +32810,7 @@ var init_types4 = __esm({
|
|
|
32399
32810
|
ListTasksResultSchema,
|
|
32400
32811
|
CreateTaskResultSchema
|
|
32401
32812
|
]);
|
|
32402
|
-
ServerRequestSchema =
|
|
32813
|
+
ServerRequestSchema = z28.union([
|
|
32403
32814
|
PingRequestSchema,
|
|
32404
32815
|
CreateMessageRequestSchema,
|
|
32405
32816
|
ElicitRequestSchema,
|
|
@@ -32409,7 +32820,7 @@ var init_types4 = __esm({
|
|
|
32409
32820
|
ListTasksRequestSchema,
|
|
32410
32821
|
CancelTaskRequestSchema
|
|
32411
32822
|
]);
|
|
32412
|
-
ServerNotificationSchema =
|
|
32823
|
+
ServerNotificationSchema = z28.union([
|
|
32413
32824
|
CancelledNotificationSchema,
|
|
32414
32825
|
ProgressNotificationSchema,
|
|
32415
32826
|
LoggingMessageNotificationSchema,
|
|
@@ -32420,7 +32831,7 @@ var init_types4 = __esm({
|
|
|
32420
32831
|
TaskStatusNotificationSchema,
|
|
32421
32832
|
ElicitationCompleteNotificationSchema
|
|
32422
32833
|
]);
|
|
32423
|
-
ServerResultSchema =
|
|
32834
|
+
ServerResultSchema = z28.union([
|
|
32424
32835
|
EmptyResultSchema,
|
|
32425
32836
|
InitializeResultSchema,
|
|
32426
32837
|
CompleteResultSchema,
|
|
@@ -44076,13 +44487,13 @@ var init_stdio2 = __esm({
|
|
|
44076
44487
|
});
|
|
44077
44488
|
|
|
44078
44489
|
// ../../packages/mcp-server/src/tools.ts
|
|
44079
|
-
import { z as
|
|
44080
|
-
var runTaskInputSchema, RUN_TASK_DESCRIPTION;
|
|
44490
|
+
import { z as z29 } from "zod";
|
|
44491
|
+
var runTaskInputSchema, RUN_TASK_DESCRIPTION, GET_TASK_MAX_WAIT_SECONDS, getTaskInputSchema, GET_TASK_DESCRIPTION;
|
|
44081
44492
|
var init_tools = __esm({
|
|
44082
44493
|
"../../packages/mcp-server/src/tools.ts"() {
|
|
44083
44494
|
"use strict";
|
|
44084
44495
|
init_src2();
|
|
44085
|
-
runTaskInputSchema =
|
|
44496
|
+
runTaskInputSchema = z29.object({
|
|
44086
44497
|
// LE contrat partage du slug (shared/agent-slug.ts) — la review a montre
|
|
44087
44498
|
// que trois definitions divergentes rendaient un agent valide inciblable.
|
|
44088
44499
|
agent: AgentSlugSchema.optional().describe(
|
|
@@ -44095,17 +44506,92 @@ var init_tools = __esm({
|
|
|
44095
44506
|
// pour un autre espace que celui que l'appelant attend. C'est la prévention
|
|
44096
44507
|
// dont un appelant a besoin quand son épinglage peut casser (le banc des
|
|
44097
44508
|
// workflows : un essai ne doit jamais être créé hors de l'espace banc).
|
|
44098
|
-
expectedWorkspaceId:
|
|
44509
|
+
expectedWorkspaceId: z29.string().uuid().optional().describe(
|
|
44099
44510
|
"Optional ASSERTION, never a choice: the id of the workspace the job must be created in. When this server speaks for another workspace, run_task refuses before creating anything (mcp_workspace_mismatch). It cannot move a job: the workspace is always the one of the agent this server was launched for."
|
|
44100
44511
|
),
|
|
44101
|
-
caller:
|
|
44512
|
+
caller: z29.string().min(1).max(120).regex(/^[\w .:@/-]+$/, "caller must be a plain label (letters, digits, spaces, .:@/-_ only)").optional().describe(
|
|
44102
44513
|
'Optional label naming WHO is asking (e.g. "agent-dev-a", "quentin-terminal"). Purely declarative \u2014 recorded as provenance on the job, shown on the Runs page, and NEVER used for authorization: the job runs under the rules of the agent this server was launched for, whatever this says.'
|
|
44103
44514
|
),
|
|
44104
|
-
instruction:
|
|
44515
|
+
instruction: z29.string().min(1).max(16e3).describe(
|
|
44105
44516
|
"La demande, en clair et auto-suffisante : l'agent qui l'ex\xE9cute ne voit RIEN de cette session MCP. Il travaille avec ses propres outils, skills et sous-agents, sous ses propres r\xE8gles d approbation."
|
|
44106
44517
|
)
|
|
44107
44518
|
});
|
|
44108
|
-
RUN_TASK_DESCRIPTION = "Hand a request to this Nodal agent. Creates a TRACKED JOB the agent runs with its full toolset \u2014 connectors, skills, delegation to its team \u2014 under its own approval rules and budgets. Returns the job id immediately; the work itself runs asynchronously
|
|
44519
|
+
RUN_TASK_DESCRIPTION = "Hand a request to this Nodal agent. Creates a TRACKED JOB the agent runs with its full toolset \u2014 connectors, skills, delegation to its team \u2014 under its own approval rules and budgets. Returns the job id immediately; the work itself runs asynchronously. To get the answer, call `get_task` with that jobId (optionally with waitSeconds to wait for it). State the request faithfully and self-contained: the agent sees nothing of this MCP session.";
|
|
44520
|
+
GET_TASK_MAX_WAIT_SECONDS = 60;
|
|
44521
|
+
getTaskInputSchema = z29.object({
|
|
44522
|
+
jobId: z29.string().uuid().describe("The jobId that run_task returned. Only jobs this MCP server created can be read."),
|
|
44523
|
+
waitSeconds: z29.number().int().min(0).max(GET_TASK_MAX_WAIT_SECONDS).optional().describe(
|
|
44524
|
+
`Optional, 0 to ${GET_TASK_MAX_WAIT_SECONDS}. Wait up to this many seconds for the job to finish or to need a person, and return as soon as it does. Omit or 0 to read the current state at once.`
|
|
44525
|
+
)
|
|
44526
|
+
});
|
|
44527
|
+
GET_TASK_DESCRIPTION = "Read back a job that run_task created on this server: its status, the agent\u2019s result, its deliverables, and anything waiting for a person. Read-only. status is the state of the whole run, delegated work included: running, waiting_for_person (an approval or a question to answer on the Nodal dashboard; see waitingForPerson), completed, failed or cancelled. result is the agent\u2019s own answer, set once the run is over. Pass waitSeconds to wait for the run to finish or to need a person instead of polling.";
|
|
44528
|
+
}
|
|
44529
|
+
});
|
|
44530
|
+
|
|
44531
|
+
// ../../packages/mcp-server/src/get-task.ts
|
|
44532
|
+
function jobNotFound(jobId) {
|
|
44533
|
+
return new Error(
|
|
44534
|
+
`mcp_job_not_found: no job with id ${jobId} was created by this MCP server's workspace.`
|
|
44535
|
+
);
|
|
44536
|
+
}
|
|
44537
|
+
async function readMcpRun(db, entityId, jobId) {
|
|
44538
|
+
const [own] = await db.select({ id: agentJobs.id }).from(agentJobs).where(
|
|
44539
|
+
and(eq(agentJobs.id, jobId), eq(agentJobs.entityId, entityId), eq(agentJobs.channel, "mcp"))
|
|
44540
|
+
).limit(1);
|
|
44541
|
+
if (!own) return null;
|
|
44542
|
+
return readRunState(db, entityId, jobId);
|
|
44543
|
+
}
|
|
44544
|
+
function isSettled(state) {
|
|
44545
|
+
return state.status !== "running";
|
|
44546
|
+
}
|
|
44547
|
+
function pause(ms, signal) {
|
|
44548
|
+
return new Promise((resolve6) => {
|
|
44549
|
+
if (signal?.aborted) return resolve6();
|
|
44550
|
+
const done = () => {
|
|
44551
|
+
clearTimeout(timer2);
|
|
44552
|
+
signal?.removeEventListener("abort", done);
|
|
44553
|
+
resolve6();
|
|
44554
|
+
};
|
|
44555
|
+
const timer2 = setTimeout(done, ms);
|
|
44556
|
+
signal?.addEventListener("abort", done, { once: true });
|
|
44557
|
+
});
|
|
44558
|
+
}
|
|
44559
|
+
async function waitForRun(read, settled, opts) {
|
|
44560
|
+
const now = opts.now ?? Date.now;
|
|
44561
|
+
const deadline = now() + opts.waitMs;
|
|
44562
|
+
for (; ; ) {
|
|
44563
|
+
const state = await read();
|
|
44564
|
+
const left = deadline - now();
|
|
44565
|
+
if (settled(state) || opts.signal?.aborted || left <= 0) return state;
|
|
44566
|
+
await pause(Math.min(opts.pollMs, left), opts.signal);
|
|
44567
|
+
}
|
|
44568
|
+
}
|
|
44569
|
+
function getTaskReply(jobId, state) {
|
|
44570
|
+
return {
|
|
44571
|
+
jobId,
|
|
44572
|
+
status: state.status,
|
|
44573
|
+
jobStatus: state.headStatus,
|
|
44574
|
+
result: state.result,
|
|
44575
|
+
error: state.error,
|
|
44576
|
+
liveJobs: state.liveJobIds.length,
|
|
44577
|
+
deliverables: state.deliverables,
|
|
44578
|
+
waitingForPerson: state.pendingRequests.map((r) => ({
|
|
44579
|
+
requestId: r.requestId,
|
|
44580
|
+
jobId: r.jobId,
|
|
44581
|
+
kind: r.kind,
|
|
44582
|
+
toolName: r.toolName,
|
|
44583
|
+
about: r.toolInput,
|
|
44584
|
+
requestedAt: r.requestedAt,
|
|
44585
|
+
answerOn: "dashboard"
|
|
44586
|
+
}))
|
|
44587
|
+
};
|
|
44588
|
+
}
|
|
44589
|
+
var GET_TASK_POLL_MS;
|
|
44590
|
+
var init_get_task = __esm({
|
|
44591
|
+
"../../packages/mcp-server/src/get-task.ts"() {
|
|
44592
|
+
"use strict";
|
|
44593
|
+
init_src4();
|
|
44594
|
+
GET_TASK_POLL_MS = 1e3;
|
|
44109
44595
|
}
|
|
44110
44596
|
});
|
|
44111
44597
|
|
|
@@ -44295,7 +44781,7 @@ async function buildNodalMcpServer(opts) {
|
|
|
44295
44781
|
text: JSON.stringify({
|
|
44296
44782
|
jobId: job?.id,
|
|
44297
44783
|
status: "pending",
|
|
44298
|
-
note: "The job runs asynchronously under the agent\u2019s own rules
|
|
44784
|
+
note: "The job runs asynchronously under the agent\u2019s own rules. Call get_task with this jobId to get its result."
|
|
44299
44785
|
})
|
|
44300
44786
|
}
|
|
44301
44787
|
]
|
|
@@ -44313,6 +44799,43 @@ async function buildNodalMcpServer(opts) {
|
|
|
44313
44799
|
}
|
|
44314
44800
|
}
|
|
44315
44801
|
);
|
|
44802
|
+
server.registerTool(
|
|
44803
|
+
"get_task",
|
|
44804
|
+
{
|
|
44805
|
+
description: GET_TASK_DESCRIPTION,
|
|
44806
|
+
inputSchema: getTaskInputSchema.shape,
|
|
44807
|
+
annotations: { readOnlyHint: true }
|
|
44808
|
+
},
|
|
44809
|
+
async (args, extra) => {
|
|
44810
|
+
try {
|
|
44811
|
+
const { jobId, waitSeconds } = getTaskInputSchema.parse(args);
|
|
44812
|
+
await assertMcpEnabled(opts.db, entityId);
|
|
44813
|
+
const read = async () => {
|
|
44814
|
+
const state2 = await readMcpRun(opts.db, entityId, jobId);
|
|
44815
|
+
if (state2 === null) throw jobNotFound(jobId);
|
|
44816
|
+
return state2;
|
|
44817
|
+
};
|
|
44818
|
+
const state = await waitForRun(read, isSettled, {
|
|
44819
|
+
waitMs: (waitSeconds ?? 0) * 1e3,
|
|
44820
|
+
pollMs: GET_TASK_POLL_MS,
|
|
44821
|
+
signal: extra.signal
|
|
44822
|
+
});
|
|
44823
|
+
return {
|
|
44824
|
+
content: [{ type: "text", text: JSON.stringify(getTaskReply(jobId, state)) }]
|
|
44825
|
+
};
|
|
44826
|
+
} catch (err) {
|
|
44827
|
+
return {
|
|
44828
|
+
isError: true,
|
|
44829
|
+
content: [
|
|
44830
|
+
{
|
|
44831
|
+
type: "text",
|
|
44832
|
+
text: err instanceof Error ? err.message : String(err)
|
|
44833
|
+
}
|
|
44834
|
+
]
|
|
44835
|
+
};
|
|
44836
|
+
}
|
|
44837
|
+
}
|
|
44838
|
+
);
|
|
44316
44839
|
return server;
|
|
44317
44840
|
}
|
|
44318
44841
|
async function startNodalMcpServer(opts) {
|
|
@@ -44334,6 +44857,7 @@ var init_server3 = __esm({
|
|
|
44334
44857
|
init_src4();
|
|
44335
44858
|
init_src2();
|
|
44336
44859
|
init_tools();
|
|
44860
|
+
init_get_task();
|
|
44337
44861
|
DEFAULT_MAX_JOBS_IN_FLIGHT = MCP_MAX_JOBS_IN_FLIGHT;
|
|
44338
44862
|
EN_COURS = ["pending", "processing", "awaiting_approval", "awaiting_delegation"];
|
|
44339
44863
|
}
|