nodal-agents 0.8.8 → 0.8.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 +2106 -839
- package/migrations/0088_code_projects_project_key.sql +152 -0
- package/migrations/0089_verification_state_and_runs.sql +86 -0
- package/migrations/0090_job_deliveries_and_finalizing.sql +61 -0
- package/migrations/0091_verification_surfaces.sql +24 -0
- package/migrations/0092_tool_calls_card.sql +27 -0
- package/migrations/0093_project_registry.sql +71 -0
- package/migrations/0094_conversations_all_channels.sql +78 -0
- package/migrations/0095_tool_calls_risk_level.sql +28 -0
- package/migrations/0096_conversation_titles_prefix.sql +18 -0
- package/migrations/0097_conversations_origin_project.sql +33 -0
- package/migrations/0098_approval_requests_question.sql +35 -0
- package/migrations/0099_job_checkpoints.sql +40 -0
- package/migrations/0100_llm_calls_conversation.sql +29 -0
- package/migrations/0101_schedule_state.sql +15 -0
- package/migrations/0102_verify_source.sql +20 -0
- package/migrations/0103_deliverable_addressed.sql +14 -0
- package/migrations/0104_deliverable_produced.sql +43 -0
- package/migrations/0105_conversations_thread_id_tiebreak.sql +24 -0
- package/migrations/0106_conversations_listable_chats.sql +28 -0
- package/migrations/meta/_journal.json +133 -0
- package/node_modules/jszip/.github/FUNDING.yml +1 -0
- package/node_modules/jszip/.github/actions/setup/action.yml +23 -0
- package/node_modules/jszip/.github/workflows/benchmark.yml +38 -0
- package/node_modules/jszip/.github/workflows/main.yml +55 -0
- package/node_modules/jszip/CHANGES.md +6 -0
- package/node_modules/jszip/dist/jszip.js +28 -19
- package/node_modules/jszip/dist/jszip.min.js +2 -2
- package/node_modules/jszip/index.d.ts +14 -0
- package/node_modules/jszip/lib/index.js +1 -1
- package/node_modules/jszip/lib/utils.js +26 -17
- package/node_modules/jszip/package.json +2 -2
- package/package.json +1 -1
- package/runner.js +10893 -5598
- package/web/.next/BUILD_ID +1 -1
- package/web/.next/app-path-routes-manifest.json +10 -4
- package/web/.next/build-manifest.json +2 -2
- package/web/.next/prerender-manifest.json +3 -3
- package/web/.next/routes-manifest.json +44 -0
- 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/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 -0
- package/web/.next/server/app/(dashboard)/chat/[id]/page_client-reference-manifest.js +1 -0
- 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)/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)/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 -3
- package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/scheduled/[id]/page.js +1 -0
- package/web/.next/server/app/(dashboard)/scheduled/[id]/page_client-reference-manifest.js +1 -0
- package/web/.next/server/app/(dashboard)/scheduled/page.js +1 -0
- package/web/.next/server/app/(dashboard)/scheduled/page_client-reference-manifest.js +1 -0
- 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 -0
- package/web/.next/server/app/(dashboard)/spaces/[id]/files/page_client-reference-manifest.js +1 -0
- package/web/.next/server/app/(dashboard)/spaces/[id]/page.js +1 -0
- package/web/.next/server/app/(dashboard)/spaces/[id]/page_client-reference-manifest.js +1 -0
- package/web/.next/server/app/(dashboard)/spaces/page.js +1 -0
- package/web/.next/server/app/(dashboard)/spaces/page_client-reference-manifest.js +1 -0
- package/web/.next/server/app/_global-error/page.js +2 -2
- 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.js +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/auth/[...all]/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/auth/callback/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 +10 -4
- package/web/.next/server/chunks/{5384.js → 1195.js} +1 -1
- package/web/.next/server/chunks/1505.js +3 -0
- package/web/.next/server/chunks/210.js +1 -1
- package/web/.next/server/chunks/231.js +960 -0
- package/web/.next/server/chunks/2520.js +638 -0
- package/web/.next/server/chunks/2719.js +1 -0
- package/web/.next/server/chunks/3188.js +1 -1
- package/web/.next/server/chunks/3234.js +1 -0
- package/web/.next/server/chunks/3373.js +1751 -0
- package/web/.next/server/chunks/3483.js +1 -0
- package/web/.next/server/chunks/353.js +1 -0
- package/web/.next/server/chunks/3532.js +3 -3
- package/web/.next/server/chunks/3583.js +1 -0
- package/web/.next/server/chunks/3598.js +1 -0
- package/web/.next/server/chunks/42.js +3 -2
- package/web/.next/server/chunks/4483.js +5 -0
- package/web/.next/server/chunks/5020.js +1 -0
- package/web/.next/server/chunks/{4270.js → 5326.js} +1 -1
- package/web/.next/server/chunks/5329.js +1 -0
- package/web/.next/server/chunks/5767.js +1 -0
- package/web/.next/server/chunks/{6484.js → 6031.js} +11 -11
- package/web/.next/server/chunks/{8191.js → 6551.js} +6 -6
- package/web/.next/server/chunks/7048.js +1 -1
- package/web/.next/server/chunks/7534.js +1 -0
- package/web/.next/server/chunks/7742.js +3 -0
- package/web/.next/server/chunks/8100.js +1 -0
- package/web/.next/server/chunks/8192.js +1 -0
- package/web/.next/server/chunks/914.js +1 -0
- package/web/.next/server/chunks/9141.js +1 -0
- package/web/.next/server/chunks/9637.js +1 -0
- package/web/.next/server/chunks/9717.js +1 -0
- package/web/.next/server/chunks/9949.js +113 -108
- package/web/.next/server/middleware-build-manifest.js +1 -1
- package/web/.next/server/middleware.js +86 -85
- 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/1511-40fdd3a3ee3f16ff.js +62 -0
- package/web/.next/static/chunks/2740-f54bfb8e5897a7fc.js +1 -0
- package/web/.next/static/chunks/3024-0a4647e55c953355.js +1 -0
- package/web/.next/static/chunks/3482-bd1a620e6c049e5f.js +1 -0
- package/web/.next/static/chunks/3537-ff81db1218230c28.js +1 -0
- package/web/.next/static/chunks/4452-06cb3d9dec478edf.js +1 -0
- package/web/.next/static/chunks/4453-46acd5937930cda5.js +1 -0
- package/web/.next/static/chunks/5034-7816e7ad05216095.js +1 -0
- package/web/.next/static/chunks/5189-94cbddf56c4af9db.js +1 -0
- package/web/.next/static/chunks/5386-f067c56f0ed0afd3.js +1 -0
- package/web/.next/static/chunks/5392-add2f6eb8ec3cc3d.js +1 -0
- package/web/.next/static/chunks/6646-21e7105302193b0e.js +1 -0
- package/web/.next/static/chunks/704-0a3bf99b751ca9ab.js +1 -0
- package/web/.next/static/chunks/{4983-0817f327404f56d6.js → 7899-86451335c9854645.js} +1 -1
- package/web/.next/static/chunks/7904-f76ecb7fb0ab1b3e.js +1 -0
- package/web/.next/static/chunks/814-f9f47760e39196f7.js +1 -0
- package/web/.next/static/chunks/{9871-b6e683d2943b5846.js → 8288-46c8ea403691cbd8.js} +3 -3
- package/web/.next/static/chunks/{3451-58a5c57e79371ae4.js → 8551-0843f388c81ecc4b.js} +12 -12
- package/web/.next/static/chunks/{6430-9bf51e6009aa016c.js → 9834-d29a136a5b3b9cda.js} +1 -1
- package/web/.next/static/chunks/{9927-c71650de8073ad68.js → 9927-c5951099612edcfb.js} +1 -1
- package/web/.next/static/chunks/app/(dashboard)/agents/[id]/edit/page-0e0a349399606e8b.js +6 -0
- package/web/.next/static/chunks/app/(dashboard)/agents/page-6a8dc12dab1f2874.js +1 -0
- package/web/.next/static/chunks/app/(dashboard)/approvals/page-db286cc0a738971b.js +1 -0
- package/web/.next/static/chunks/app/(dashboard)/automations/{page-0e724dfa1716a937.js → page-c5b1e906f5cb0fe4.js} +1 -1
- package/web/.next/static/chunks/app/(dashboard)/chat/[id]/page-ddb150b1540988ef.js +1 -0
- package/web/.next/static/chunks/app/(dashboard)/chat/page-22788334e4244f90.js +1 -0
- package/web/.next/static/chunks/app/(dashboard)/code/[id]/page-44f81c95fb5e9692.js +1 -0
- package/web/.next/static/chunks/app/(dashboard)/code/page-1571073f95522746.js +1 -0
- package/web/.next/static/chunks/app/(dashboard)/connectors/page-949c964856b89951.js +1 -0
- package/web/.next/static/chunks/app/(dashboard)/credentials/page-9fcbcdd2448c1991.js +1 -0
- package/web/.next/static/chunks/app/(dashboard)/jobs/[id]/{page-1719a805a2e39ccc.js → page-a431b6b1b9f6fea7.js} +1 -1
- package/web/.next/static/chunks/app/(dashboard)/jobs/page-c2822831e76daf0c.js +1 -0
- package/web/.next/static/chunks/app/(dashboard)/layout-ef725b83f773ce1b.js +1 -0
- package/web/.next/static/chunks/app/(dashboard)/learned-skills/page-77a8fdd2d5e31e66.js +1 -0
- package/web/.next/static/chunks/app/(dashboard)/llm-providers/page-a5399e46d3a46a96.js +1 -0
- package/web/.next/static/chunks/app/(dashboard)/logs/page-9a887fc28ea3b341.js +1 -0
- package/web/.next/static/chunks/app/(dashboard)/mcp/page-d38ced6b48036c96.js +1 -0
- package/web/.next/static/chunks/app/(dashboard)/memories/page-e8ae3c3c0d80b98f.js +1 -0
- package/web/.next/static/chunks/app/(dashboard)/{page-70ea130d3de66e30.js → page-c7fe8cb11a48378f.js} +1 -1
- package/web/.next/static/chunks/app/(dashboard)/scheduled/[id]/page-da3e335c850aac91.js +1 -0
- package/web/.next/static/chunks/app/(dashboard)/scheduled/page-ddfb22d775c36de6.js +1 -0
- package/web/.next/static/chunks/app/(dashboard)/settings/page-1d22f35fbd41c4c8.js +1 -0
- package/web/.next/static/chunks/app/(dashboard)/settings/root-context/page-d2e259fd4c3d09b0.js +1 -0
- package/web/.next/static/chunks/app/(dashboard)/skills/[id]/edit/page-6709a7b491ae41fd.js +1 -0
- package/web/.next/static/chunks/app/(dashboard)/skills/new/page-5d98e96847c72eb5.js +1 -0
- package/web/.next/static/chunks/app/(dashboard)/skills/page-c8b3805c9a058b07.js +1 -0
- package/web/.next/static/chunks/app/(dashboard)/spaces/[id]/files/page-2f444597fa0abf62.js +1 -0
- package/web/.next/static/chunks/app/(dashboard)/spaces/[id]/page-1c2b118f4ef10f7b.js +1 -0
- package/web/.next/static/chunks/app/(dashboard)/spaces/page-2d1554b9266429de.js +1 -0
- package/web/.next/static/chunks/app/login/page-d40c57350fe5366f.js +1 -0
- package/web/.next/static/chunks/app/onboarding/{page-0ec8d988ee84bdb1.js → page-79a89445432931ef.js} +2 -2
- package/web/.next/static/css/537b435215d30466.css +3 -0
- package/web/.next/static/vp639cRRGWy7XZlwOEsL8/_buildManifest.js +1 -0
- package/migrations/meta/0000_snapshot.json +0 -3957
- package/migrations/meta/0001_snapshot.json +0 -3977
- package/migrations/meta/0002_snapshot.json +0 -4210
- package/migrations/meta/0003_snapshot.json +0 -4216
- package/migrations/meta/0004_snapshot.json +0 -4237
- package/migrations/meta/0005_snapshot.json +0 -4244
- package/migrations/meta/0006_snapshot.json +0 -4330
- package/migrations/meta/0007_snapshot.json +0 -4330
- package/migrations/meta/0008_snapshot.json +0 -4447
- package/migrations/meta/0009_snapshot.json +0 -4454
- package/migrations/meta/0010_snapshot.json +0 -4460
- package/node_modules/jszip/.github/workflows/pr.yaml +0 -58
- package/node_modules/jszip/.jekyll-metadata +0 -0
- package/node_modules/jszip/.travis.yml +0 -17
- package/node_modules/jszip/deps.js +0 -37
- package/node_modules/jszip/graph.svg +0 -601
- package/web/.next/server/chunks/1126.js +0 -1
- package/web/.next/server/chunks/1721.js +0 -1749
- package/web/.next/server/chunks/1824.js +0 -1
- package/web/.next/server/chunks/196.js +0 -1
- package/web/.next/server/chunks/2009.js +0 -1
- package/web/.next/server/chunks/3927.js +0 -1597
- package/web/.next/server/chunks/7915.js +0 -1
- package/web/.next/server/chunks/8447.js +0 -1
- package/web/.next/server/chunks/9476.js +0 -3
- package/web/.next/static/Ox1nSNbTz9Sz93pV6rEcD/_buildManifest.js +0 -1
- package/web/.next/static/chunks/2695-c710d6d4159ad588.js +0 -1
- package/web/.next/static/chunks/3511-971821e07fddb07b.js +0 -1
- package/web/.next/static/chunks/391-5597e5c2315d62ea.js +0 -1
- package/web/.next/static/chunks/5034-e249414dc457d97d.js +0 -1
- package/web/.next/static/chunks/5392-a040bb5e5c53c285.js +0 -1
- package/web/.next/static/chunks/6646-35d756ba2c002ecf.js +0 -1
- package/web/.next/static/chunks/6824-b8a8f305cdeb3338.js +0 -1
- package/web/.next/static/chunks/6967-3b77488c4b708136.js +0 -1
- package/web/.next/static/chunks/7755-074e21da9c0d0361.js +0 -62
- package/web/.next/static/chunks/7859-daaeaf73805dc5da.js +0 -1
- package/web/.next/static/chunks/8589-e31c5e7f6d10b92b.js +0 -1
- package/web/.next/static/chunks/9416-391f60c712340297.js +0 -1
- package/web/.next/static/chunks/app/(dashboard)/agents/[id]/edit/page-dd6460b3a050ddf7.js +0 -6
- package/web/.next/static/chunks/app/(dashboard)/agents/page-04ac243f09f1f620.js +0 -1
- package/web/.next/static/chunks/app/(dashboard)/approvals/page-dfd4cf86827c0aed.js +0 -1
- package/web/.next/static/chunks/app/(dashboard)/chat/page-041eedb2e6cf29fb.js +0 -1
- package/web/.next/static/chunks/app/(dashboard)/code/[id]/page-bed8be1148fb7d1d.js +0 -1
- package/web/.next/static/chunks/app/(dashboard)/code/page-ac3a349d07d95fd9.js +0 -1
- package/web/.next/static/chunks/app/(dashboard)/connectors/page-0f39f3e59541badf.js +0 -1
- package/web/.next/static/chunks/app/(dashboard)/credentials/page-761b5f92e7617412.js +0 -1
- package/web/.next/static/chunks/app/(dashboard)/jobs/page-129c4cd41458438a.js +0 -1
- package/web/.next/static/chunks/app/(dashboard)/layout-1602118a43db0d42.js +0 -1
- package/web/.next/static/chunks/app/(dashboard)/learned-skills/page-16a376c609001dd2.js +0 -1
- package/web/.next/static/chunks/app/(dashboard)/llm-providers/page-7bd5a6f909d8a136.js +0 -1
- package/web/.next/static/chunks/app/(dashboard)/logs/page-a2d32cf8ffa4d4a6.js +0 -1
- package/web/.next/static/chunks/app/(dashboard)/mcp/page-86fac62ecfc87b98.js +0 -1
- package/web/.next/static/chunks/app/(dashboard)/memories/page-bd61659f6bbccb21.js +0 -1
- package/web/.next/static/chunks/app/(dashboard)/settings/page-2fec30e99b307637.js +0 -1
- package/web/.next/static/chunks/app/(dashboard)/settings/root-context/page-5a7dae2d7e9ce07f.js +0 -1
- package/web/.next/static/chunks/app/(dashboard)/skills/[id]/edit/page-c22bde781a44b751.js +0 -1
- package/web/.next/static/chunks/app/(dashboard)/skills/new/page-0e8b89dc355078a8.js +0 -1
- package/web/.next/static/chunks/app/(dashboard)/skills/page-93884e1ef158297f.js +0 -1
- package/web/.next/static/chunks/app/login/page-7303a5eca7eeb19b.js +0 -1
- package/web/.next/static/css/be2ece2e5b18d112.css +0 -3
- /package/web/.next/static/{Ox1nSNbTz9Sz93pV6rEcD → vp639cRRGWy7XZlwOEsL8}/_ssgManifest.js +0 -0
package/cli.js
CHANGED
|
@@ -11205,7 +11205,7 @@ var init_types2 = __esm({
|
|
|
11205
11205
|
|
|
11206
11206
|
// ../../packages/shared/src/enums.ts
|
|
11207
11207
|
import { z as z2 } from "zod";
|
|
11208
|
-
var JOB_CHANNELS, JobChannelSchema, JOB_STATUSES, JobStatusSchema, 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, MCP_TRANSPORTS, McpTransportSchema;
|
|
11208
|
+
var JOB_CHANNELS, JobChannelSchema, JOB_STATUSES, JobStatusSchema, 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;
|
|
11209
11209
|
var init_enums = __esm({
|
|
11210
11210
|
"../../packages/shared/src/enums.ts"() {
|
|
11211
11211
|
"use strict";
|
|
@@ -11270,56 +11270,258 @@ var init_enums = __esm({
|
|
|
11270
11270
|
EntityIndustrySchema = z2.enum(ENTITY_INDUSTRIES);
|
|
11271
11271
|
OPERATION_RISK_LEVELS = ["read", "write", "destructive"];
|
|
11272
11272
|
OperationRiskLevelSchema = z2.enum(OPERATION_RISK_LEVELS);
|
|
11273
|
+
TOOL_CARDS = [
|
|
11274
|
+
"text",
|
|
11275
|
+
"read",
|
|
11276
|
+
"search",
|
|
11277
|
+
"files",
|
|
11278
|
+
"table",
|
|
11279
|
+
"terminal",
|
|
11280
|
+
"sent",
|
|
11281
|
+
"checks",
|
|
11282
|
+
"question",
|
|
11283
|
+
"delegation",
|
|
11284
|
+
"generic"
|
|
11285
|
+
];
|
|
11286
|
+
ToolCardSchema = z2.enum(TOOL_CARDS);
|
|
11273
11287
|
MCP_TRANSPORTS = ["http", "stdio"];
|
|
11274
11288
|
McpTransportSchema = z2.enum(MCP_TRANSPORTS);
|
|
11275
11289
|
}
|
|
11276
11290
|
});
|
|
11277
11291
|
|
|
11278
|
-
// ../../packages/shared/src/
|
|
11292
|
+
// ../../packages/shared/src/tool-cards.ts
|
|
11279
11293
|
import { z as z3 } from "zod";
|
|
11294
|
+
var CARD_TEXT_MAX, CARD_EXCERPT_MAX, CARD_LABEL_MAX, CARD_ITEMS_MAX, CARD_ROWS_MAX, CARD_COLS_MAX, CARD_CELL_MAX, text2, TextCardSchema, ReadCardSchema, SearchCardSchema, TableEntrySchema, FilesCardSchema, TableCardSchema, TerminalCardSchema, SentCardSchema, ChecksCardSchema, DelegationCardSchema, QuestionCardSchema, GenericCardSchema, ToolCardPayloadSchema, CARDS_NEEDING_PRESENTER;
|
|
11295
|
+
var init_tool_cards = __esm({
|
|
11296
|
+
"../../packages/shared/src/tool-cards.ts"() {
|
|
11297
|
+
"use strict";
|
|
11298
|
+
init_enums();
|
|
11299
|
+
CARD_TEXT_MAX = 4e3;
|
|
11300
|
+
CARD_EXCERPT_MAX = 2e3;
|
|
11301
|
+
CARD_LABEL_MAX = 400;
|
|
11302
|
+
CARD_ITEMS_MAX = 50;
|
|
11303
|
+
CARD_ROWS_MAX = 50;
|
|
11304
|
+
CARD_COLS_MAX = 20;
|
|
11305
|
+
CARD_CELL_MAX = 200;
|
|
11306
|
+
text2 = (max2) => z3.string().max(max2);
|
|
11307
|
+
TextCardSchema = z3.object({
|
|
11308
|
+
card: z3.literal("text"),
|
|
11309
|
+
text: text2(CARD_TEXT_MAX),
|
|
11310
|
+
/**
|
|
11311
|
+
* Présent et vrai UNIQUEMENT quand ce texte est la raison d'un ÉCHEC posé
|
|
11312
|
+
* sous une carte structurée (`failureText`). Jamais `false` : un succès n'a
|
|
11313
|
+
* pas ce champ. C'est ce discriminant que `presentToolResult` exige pour
|
|
11314
|
+
* admettre un `text` là où une autre carte était déclarée (revue passe 14).
|
|
11315
|
+
*/
|
|
11316
|
+
failure: z3.literal(true).optional(),
|
|
11317
|
+
/** Le texte a été coupé au plafond — absent quand il est entier. */
|
|
11318
|
+
truncated: z3.boolean().optional()
|
|
11319
|
+
});
|
|
11320
|
+
ReadCardSchema = z3.object({
|
|
11321
|
+
card: z3.literal("read"),
|
|
11322
|
+
/** Chemin ou nom de la chose lue ; null quand la sortie ne le porte pas. */
|
|
11323
|
+
path: z3.string().nullable(),
|
|
11324
|
+
excerpt: text2(CARD_EXCERPT_MAX),
|
|
11325
|
+
/** Longueur du contenu lu, en caractères — l'extrait en montre une partie. */
|
|
11326
|
+
chars: z3.number().int().nonnegative(),
|
|
11327
|
+
truncated: z3.boolean(),
|
|
11328
|
+
/** Nombre de lignes, paragraphes ou diapositives, selon la nature du document. */
|
|
11329
|
+
sections: z3.number().int().nonnegative().optional()
|
|
11330
|
+
});
|
|
11331
|
+
SearchCardSchema = z3.object({
|
|
11332
|
+
card: z3.literal("search"),
|
|
11333
|
+
query: text2(CARD_LABEL_MAX),
|
|
11334
|
+
hits: z3.array(
|
|
11335
|
+
z3.object({
|
|
11336
|
+
title: text2(CARD_LABEL_MAX),
|
|
11337
|
+
/** URL, chemin, cellule, identifiant — ce qui permet d'y retourner. */
|
|
11338
|
+
ref: text2(CARD_LABEL_MAX).optional(),
|
|
11339
|
+
snippet: text2(CARD_LABEL_MAX).optional()
|
|
11340
|
+
})
|
|
11341
|
+
).max(CARD_ITEMS_MAX),
|
|
11342
|
+
total: z3.number().int().nonnegative(),
|
|
11343
|
+
truncated: z3.boolean()
|
|
11344
|
+
});
|
|
11345
|
+
TableEntrySchema = z3.object({
|
|
11346
|
+
name: text2(CARD_LABEL_MAX).optional(),
|
|
11347
|
+
columns: z3.array(text2(CARD_CELL_MAX)).max(CARD_COLS_MAX),
|
|
11348
|
+
/**
|
|
11349
|
+
* `columns` : les colonnes ci-dessus SONT l'en-tête. `unknown` :
|
|
11350
|
+
* personne ne sait si la première ligne est un en-tête (un classeur lu
|
|
11351
|
+
* tel quel) — le rendu ne le devine pas, il le dit ou le demande (P8).
|
|
11352
|
+
*/
|
|
11353
|
+
header: z3.enum(["columns", "unknown"]),
|
|
11354
|
+
rows: z3.array(z3.array(z3.union([text2(CARD_CELL_MAX), z3.number(), z3.null()])).max(CARD_COLS_MAX)).max(CARD_ROWS_MAX),
|
|
11355
|
+
/** Nombre de lignes réel — `rows` en montre au plus CARD_ROWS_MAX. */
|
|
11356
|
+
total: z3.number().int().nonnegative(),
|
|
11357
|
+
truncated: z3.boolean(),
|
|
11358
|
+
/** Au moins une cellule a été coupée au plafond CARD_CELL_MAX. */
|
|
11359
|
+
clipped: z3.boolean(),
|
|
11360
|
+
/**
|
|
11361
|
+
* Nombre de colonnes réel — la table en montre au plus CARD_COLS_MAX. Absent
|
|
11362
|
+
* sur les lignes écrites avant ce plafond : l'écran ne dit alors rien de la
|
|
11363
|
+
* largeur, il ne la devine pas.
|
|
11364
|
+
*/
|
|
11365
|
+
columnsTotal: z3.number().int().nonnegative().optional()
|
|
11366
|
+
});
|
|
11367
|
+
FilesCardSchema = z3.object({
|
|
11368
|
+
card: z3.literal("files"),
|
|
11369
|
+
files: z3.array(
|
|
11370
|
+
z3.object({
|
|
11371
|
+
path: text2(CARD_LABEL_MAX),
|
|
11372
|
+
action: z3.enum(["created", "modified", "written", "listed"]),
|
|
11373
|
+
bytes: z3.number().int().nonnegative().optional(),
|
|
11374
|
+
/** Ce que l'outil dit de ce fichier (« 3 lignes ajoutées · feuille Data »). */
|
|
11375
|
+
detail: text2(CARD_LABEL_MAX).optional(),
|
|
11376
|
+
/**
|
|
11377
|
+
* P12 — ce que le fichier CONTIENT maintenant, quand l'outil le sait :
|
|
11378
|
+
* les premières lignes de la feuille qu'il vient d'écrire. Même forme
|
|
11379
|
+
* qu'une table, donc mêmes plafonds et même rendu. Absent partout où
|
|
11380
|
+
* l'outil n'a pas de tableau à montrer (un `.docx`, une liste de
|
|
11381
|
+
* fichiers) — l'écran ne le fabrique jamais.
|
|
11382
|
+
*/
|
|
11383
|
+
preview: TableEntrySchema.optional(),
|
|
11384
|
+
/**
|
|
11385
|
+
* P12 — la clé canonique du livrable que ce fichier EST, exactement
|
|
11386
|
+
* celle sous laquelle `job_deliverable_verification_state` range son
|
|
11387
|
+
* état : la clé du chemin rebasé sur la racine LEXICALE de l'espace
|
|
11388
|
+
* de travail, pas celle du chemin réel (revue Codex PR #46, passe 46 :
|
|
11389
|
+
* sous une jonction, `projectKey(realpath)` ne retrouvait aucune
|
|
11390
|
+
* ligne). Écrite par l'outil, qui seul sait où il a écrit ; l'écran
|
|
11391
|
+
* s'en sert pour retrouver l'état de vérification du document, jamais
|
|
11392
|
+
* pour l'afficher. Absente ⇒ l'écran ne dit rien de la vérification,
|
|
11393
|
+
* il n'en invente pas (invariant #4).
|
|
11394
|
+
*/
|
|
11395
|
+
deliverableKey: text2(CARD_LABEL_MAX).optional()
|
|
11396
|
+
})
|
|
11397
|
+
).max(CARD_ITEMS_MAX),
|
|
11398
|
+
total: z3.number().int().nonnegative(),
|
|
11399
|
+
truncated: z3.boolean()
|
|
11400
|
+
});
|
|
11401
|
+
TableCardSchema = z3.object({
|
|
11402
|
+
card: z3.literal("table"),
|
|
11403
|
+
tables: z3.array(TableEntrySchema).min(1)
|
|
11404
|
+
});
|
|
11405
|
+
TerminalCardSchema = z3.object({
|
|
11406
|
+
card: z3.literal("terminal"),
|
|
11407
|
+
command: text2(CARD_EXCERPT_MAX),
|
|
11408
|
+
exitCode: z3.number().int().nullable(),
|
|
11409
|
+
timedOut: z3.boolean(),
|
|
11410
|
+
stdoutTail: text2(CARD_EXCERPT_MAX),
|
|
11411
|
+
/** La sortie était plus longue que ce qui est gardé — la fin est là, pas le début. */
|
|
11412
|
+
stdoutTruncated: z3.boolean(),
|
|
11413
|
+
stderrTail: text2(CARD_EXCERPT_MAX),
|
|
11414
|
+
stderrTruncated: z3.boolean(),
|
|
11415
|
+
cwd: text2(CARD_LABEL_MAX).optional()
|
|
11416
|
+
});
|
|
11417
|
+
SentCardSchema = z3.object({
|
|
11418
|
+
card: z3.literal("sent"),
|
|
11419
|
+
channel: text2(CARD_LABEL_MAX),
|
|
11420
|
+
kind: z3.enum(["message", "file", "image", "video", "audio", "voice", "dashboard"]),
|
|
11421
|
+
/** Le destinataire tel que l'outil le connaît (chat, salon), s'il le sait. */
|
|
11422
|
+
target: text2(CARD_LABEL_MAX).optional(),
|
|
11423
|
+
filename: text2(CARD_LABEL_MAX).optional(),
|
|
11424
|
+
bytes: z3.number().int().nonnegative().optional()
|
|
11425
|
+
});
|
|
11426
|
+
ChecksCardSchema = z3.object({
|
|
11427
|
+
card: z3.literal("checks"),
|
|
11428
|
+
verdict: z3.enum(["pass", "fail"]),
|
|
11429
|
+
summary: text2(CARD_TEXT_MAX),
|
|
11430
|
+
items: z3.array(
|
|
11431
|
+
z3.object({
|
|
11432
|
+
label: text2(CARD_LABEL_MAX),
|
|
11433
|
+
ok: z3.boolean(),
|
|
11434
|
+
ref: text2(CARD_LABEL_MAX).optional(),
|
|
11435
|
+
severity: text2(CARD_LABEL_MAX).optional()
|
|
11436
|
+
})
|
|
11437
|
+
).max(CARD_ITEMS_MAX),
|
|
11438
|
+
total: z3.number().int().nonnegative()
|
|
11439
|
+
});
|
|
11440
|
+
DelegationCardSchema = z3.object({
|
|
11441
|
+
card: z3.literal("delegation"),
|
|
11442
|
+
/** Qui a travaillé : un agent, un fournisseur de CLI. */
|
|
11443
|
+
to: text2(CARD_LABEL_MAX),
|
|
11444
|
+
task: text2(CARD_EXCERPT_MAX),
|
|
11445
|
+
ok: z3.boolean(),
|
|
11446
|
+
resultText: text2(CARD_TEXT_MAX).nullable(),
|
|
11447
|
+
error: text2(CARD_LABEL_MAX).nullable(),
|
|
11448
|
+
durationMs: z3.number().int().nonnegative().nullable(),
|
|
11449
|
+
costUsd: z3.number().nullable(),
|
|
11450
|
+
sessionId: text2(CARD_LABEL_MAX).nullable().optional()
|
|
11451
|
+
});
|
|
11452
|
+
QuestionCardSchema = z3.object({
|
|
11453
|
+
card: z3.literal("question"),
|
|
11454
|
+
prompt: text2(CARD_TEXT_MAX),
|
|
11455
|
+
options: z3.array(text2(CARD_LABEL_MAX)).optional(),
|
|
11456
|
+
answer: text2(CARD_LABEL_MAX).nullable().optional()
|
|
11457
|
+
});
|
|
11458
|
+
GenericCardSchema = z3.object({
|
|
11459
|
+
card: z3.literal("generic")
|
|
11460
|
+
});
|
|
11461
|
+
ToolCardPayloadSchema = z3.discriminatedUnion("card", [
|
|
11462
|
+
TextCardSchema,
|
|
11463
|
+
ReadCardSchema,
|
|
11464
|
+
SearchCardSchema,
|
|
11465
|
+
FilesCardSchema,
|
|
11466
|
+
TableCardSchema,
|
|
11467
|
+
TerminalCardSchema,
|
|
11468
|
+
SentCardSchema,
|
|
11469
|
+
ChecksCardSchema,
|
|
11470
|
+
DelegationCardSchema,
|
|
11471
|
+
QuestionCardSchema,
|
|
11472
|
+
GenericCardSchema
|
|
11473
|
+
]);
|
|
11474
|
+
CARDS_NEEDING_PRESENTER = TOOL_CARDS.filter(
|
|
11475
|
+
(c) => c !== "text" && c !== "generic"
|
|
11476
|
+
);
|
|
11477
|
+
}
|
|
11478
|
+
});
|
|
11479
|
+
|
|
11480
|
+
// ../../packages/shared/src/ids.ts
|
|
11481
|
+
import { z as z4 } from "zod";
|
|
11280
11482
|
var EntityIdSchema, UserIdSchema, AgentIdSchema, JobIdSchema, TaskIdSchema, ConnectorIdSchema, SkillIdSchema, ToolCallIdSchema, ApprovalRequestIdSchema, ApprovalRuleIdSchema, MemoryIdSchema, WebhookTriggerIdSchema, ScheduleIdSchema, McpServerIdSchema, PluginIdSchema, LlmKeyIdSchema;
|
|
11281
11483
|
var init_ids = __esm({
|
|
11282
11484
|
"../../packages/shared/src/ids.ts"() {
|
|
11283
11485
|
"use strict";
|
|
11284
|
-
EntityIdSchema =
|
|
11285
|
-
UserIdSchema =
|
|
11286
|
-
AgentIdSchema =
|
|
11287
|
-
JobIdSchema =
|
|
11288
|
-
TaskIdSchema =
|
|
11289
|
-
ConnectorIdSchema =
|
|
11290
|
-
SkillIdSchema =
|
|
11291
|
-
ToolCallIdSchema =
|
|
11292
|
-
ApprovalRequestIdSchema =
|
|
11293
|
-
ApprovalRuleIdSchema =
|
|
11294
|
-
MemoryIdSchema =
|
|
11295
|
-
WebhookTriggerIdSchema =
|
|
11296
|
-
ScheduleIdSchema =
|
|
11297
|
-
McpServerIdSchema =
|
|
11298
|
-
PluginIdSchema =
|
|
11299
|
-
LlmKeyIdSchema =
|
|
11486
|
+
EntityIdSchema = z4.string().guid().brand();
|
|
11487
|
+
UserIdSchema = z4.string().guid().brand();
|
|
11488
|
+
AgentIdSchema = z4.string().guid().brand();
|
|
11489
|
+
JobIdSchema = z4.string().guid().brand();
|
|
11490
|
+
TaskIdSchema = z4.string().guid().brand();
|
|
11491
|
+
ConnectorIdSchema = z4.string().guid().brand();
|
|
11492
|
+
SkillIdSchema = z4.string().guid().brand();
|
|
11493
|
+
ToolCallIdSchema = z4.string().guid().brand();
|
|
11494
|
+
ApprovalRequestIdSchema = z4.string().guid().brand();
|
|
11495
|
+
ApprovalRuleIdSchema = z4.string().guid().brand();
|
|
11496
|
+
MemoryIdSchema = z4.string().guid().brand();
|
|
11497
|
+
WebhookTriggerIdSchema = z4.string().guid().brand();
|
|
11498
|
+
ScheduleIdSchema = z4.string().guid().brand();
|
|
11499
|
+
McpServerIdSchema = z4.string().guid().brand();
|
|
11500
|
+
PluginIdSchema = z4.string().guid().brand();
|
|
11501
|
+
LlmKeyIdSchema = z4.string().guid().brand();
|
|
11300
11502
|
}
|
|
11301
11503
|
});
|
|
11302
11504
|
|
|
11303
11505
|
// ../../packages/shared/src/entities/entity.ts
|
|
11304
|
-
import { z as
|
|
11506
|
+
import { z as z5 } from "zod";
|
|
11305
11507
|
var EntitySchema, EntityInsertSchema, EntityMemberSchema, EntityMemberInsertSchema;
|
|
11306
11508
|
var init_entity2 = __esm({
|
|
11307
11509
|
"../../packages/shared/src/entities/entity.ts"() {
|
|
11308
11510
|
"use strict";
|
|
11309
11511
|
init_enums();
|
|
11310
11512
|
init_enums();
|
|
11311
|
-
EntitySchema =
|
|
11312
|
-
id:
|
|
11313
|
-
user_id:
|
|
11314
|
-
name:
|
|
11315
|
-
slug:
|
|
11316
|
-
description:
|
|
11317
|
-
icon:
|
|
11513
|
+
EntitySchema = z5.object({
|
|
11514
|
+
id: z5.string().guid(),
|
|
11515
|
+
user_id: z5.string().guid(),
|
|
11516
|
+
name: z5.string().min(1).max(120),
|
|
11517
|
+
slug: z5.string().min(1).max(80).regex(/^[a-z0-9-]+$/),
|
|
11518
|
+
description: z5.string().max(500).nullable(),
|
|
11519
|
+
icon: z5.string().max(4),
|
|
11318
11520
|
industry: EntityIndustrySchema.nullable(),
|
|
11319
|
-
goal:
|
|
11320
|
-
mcp_token:
|
|
11321
|
-
created_at:
|
|
11322
|
-
updated_at:
|
|
11521
|
+
goal: z5.string().max(1e3).nullable(),
|
|
11522
|
+
mcp_token: z5.string().guid().nullable(),
|
|
11523
|
+
created_at: z5.string().datetime(),
|
|
11524
|
+
updated_at: z5.string().datetime()
|
|
11323
11525
|
}).strict();
|
|
11324
11526
|
EntityInsertSchema = EntitySchema.omit({
|
|
11325
11527
|
id: true,
|
|
@@ -11327,17 +11529,17 @@ var init_entity2 = __esm({
|
|
|
11327
11529
|
created_at: true,
|
|
11328
11530
|
updated_at: true
|
|
11329
11531
|
}).extend({
|
|
11330
|
-
description:
|
|
11331
|
-
icon:
|
|
11532
|
+
description: z5.string().max(500).nullable().optional(),
|
|
11533
|
+
icon: z5.string().max(4).default("\u{1F3E2}"),
|
|
11332
11534
|
industry: EntityIndustrySchema.nullable().optional(),
|
|
11333
|
-
goal:
|
|
11535
|
+
goal: z5.string().max(1e3).nullable().optional()
|
|
11334
11536
|
});
|
|
11335
|
-
EntityMemberSchema =
|
|
11336
|
-
id:
|
|
11337
|
-
entity_id:
|
|
11338
|
-
user_id:
|
|
11537
|
+
EntityMemberSchema = z5.object({
|
|
11538
|
+
id: z5.string().guid(),
|
|
11539
|
+
entity_id: z5.string().guid(),
|
|
11540
|
+
user_id: z5.string().guid(),
|
|
11339
11541
|
role: EntityMemberRoleSchema,
|
|
11340
|
-
created_at:
|
|
11542
|
+
created_at: z5.string().datetime()
|
|
11341
11543
|
}).strict();
|
|
11342
11544
|
EntityMemberInsertSchema = EntityMemberSchema.omit({
|
|
11343
11545
|
id: true,
|
|
@@ -11349,61 +11551,61 @@ var init_entity2 = __esm({
|
|
|
11349
11551
|
});
|
|
11350
11552
|
|
|
11351
11553
|
// ../../packages/shared/src/entities/user.ts
|
|
11352
|
-
import { z as
|
|
11554
|
+
import { z as z6 } from "zod";
|
|
11353
11555
|
var UserProfileSchema, UserProfileInsertSchema;
|
|
11354
11556
|
var init_user = __esm({
|
|
11355
11557
|
"../../packages/shared/src/entities/user.ts"() {
|
|
11356
11558
|
"use strict";
|
|
11357
|
-
UserProfileSchema =
|
|
11358
|
-
user_id:
|
|
11359
|
-
display_name:
|
|
11360
|
-
avatar_url:
|
|
11361
|
-
timezone:
|
|
11362
|
-
locale:
|
|
11363
|
-
created_at:
|
|
11364
|
-
updated_at:
|
|
11559
|
+
UserProfileSchema = z6.object({
|
|
11560
|
+
user_id: z6.string().guid(),
|
|
11561
|
+
display_name: z6.string().max(120).nullable(),
|
|
11562
|
+
avatar_url: z6.string().max(500).nullable(),
|
|
11563
|
+
timezone: z6.string().max(80),
|
|
11564
|
+
locale: z6.string().max(10),
|
|
11565
|
+
created_at: z6.string().datetime(),
|
|
11566
|
+
updated_at: z6.string().datetime()
|
|
11365
11567
|
}).strict();
|
|
11366
11568
|
UserProfileInsertSchema = UserProfileSchema.omit({
|
|
11367
11569
|
created_at: true,
|
|
11368
11570
|
updated_at: true
|
|
11369
11571
|
}).extend({
|
|
11370
|
-
display_name:
|
|
11371
|
-
avatar_url:
|
|
11372
|
-
timezone:
|
|
11373
|
-
locale:
|
|
11572
|
+
display_name: z6.string().max(120).nullable().optional(),
|
|
11573
|
+
avatar_url: z6.string().max(500).nullable().optional(),
|
|
11574
|
+
timezone: z6.string().max(80).default("UTC"),
|
|
11575
|
+
locale: z6.string().max(10).default("en")
|
|
11374
11576
|
});
|
|
11375
11577
|
}
|
|
11376
11578
|
});
|
|
11377
11579
|
|
|
11378
11580
|
// ../../packages/shared/src/entities/agent.ts
|
|
11379
|
-
import { z as
|
|
11581
|
+
import { z as z7 } from "zod";
|
|
11380
11582
|
var AgentSchema, AgentInsertSchema;
|
|
11381
11583
|
var init_agent = __esm({
|
|
11382
11584
|
"../../packages/shared/src/entities/agent.ts"() {
|
|
11383
11585
|
"use strict";
|
|
11384
11586
|
init_enums();
|
|
11385
|
-
AgentSchema =
|
|
11386
|
-
id:
|
|
11387
|
-
entity_id:
|
|
11388
|
-
name:
|
|
11389
|
-
slug:
|
|
11390
|
-
personality:
|
|
11391
|
-
model:
|
|
11392
|
-
active:
|
|
11393
|
-
is_default:
|
|
11587
|
+
AgentSchema = z7.object({
|
|
11588
|
+
id: z7.string().guid(),
|
|
11589
|
+
entity_id: z7.string().guid().nullable(),
|
|
11590
|
+
name: z7.string().min(1).max(120),
|
|
11591
|
+
slug: z7.string().min(1).max(80).regex(/^[a-z0-9-]+$/),
|
|
11592
|
+
personality: z7.string().min(1),
|
|
11593
|
+
model: z7.string().min(1),
|
|
11594
|
+
active: z7.boolean(),
|
|
11595
|
+
is_default: z7.boolean(),
|
|
11394
11596
|
role: AgentRoleSchema,
|
|
11395
11597
|
orchestrator_mode: OrchestratorModeSchema.nullable(),
|
|
11396
|
-
telegram_bot_token:
|
|
11397
|
-
telegram_bot_username:
|
|
11398
|
-
telegram_offset:
|
|
11399
|
-
capabilities:
|
|
11400
|
-
task_context_template:
|
|
11401
|
-
avatar_url:
|
|
11402
|
-
system_agent:
|
|
11598
|
+
telegram_bot_token: z7.string().nullable(),
|
|
11599
|
+
telegram_bot_username: z7.string().nullable(),
|
|
11600
|
+
telegram_offset: z7.number().int().nonnegative().nullable(),
|
|
11601
|
+
capabilities: z7.array(z7.string()),
|
|
11602
|
+
task_context_template: z7.string().nullable(),
|
|
11603
|
+
avatar_url: z7.string().nullable(),
|
|
11604
|
+
system_agent: z7.boolean(),
|
|
11403
11605
|
// 0 = unlimited per DB comment
|
|
11404
|
-
max_tokens_per_job:
|
|
11405
|
-
created_at:
|
|
11406
|
-
updated_at:
|
|
11606
|
+
max_tokens_per_job: z7.number().int().min(0),
|
|
11607
|
+
created_at: z7.string().datetime(),
|
|
11608
|
+
updated_at: z7.string().datetime()
|
|
11407
11609
|
}).strict();
|
|
11408
11610
|
AgentInsertSchema = AgentSchema.omit({
|
|
11409
11611
|
id: true,
|
|
@@ -11413,59 +11615,59 @@ var init_agent = __esm({
|
|
|
11413
11615
|
capabilities: true,
|
|
11414
11616
|
system_agent: true
|
|
11415
11617
|
}).extend({
|
|
11416
|
-
active:
|
|
11417
|
-
is_default:
|
|
11618
|
+
active: z7.boolean().default(true),
|
|
11619
|
+
is_default: z7.boolean().default(false),
|
|
11418
11620
|
role: AgentRoleSchema.default("agent"),
|
|
11419
11621
|
orchestrator_mode: OrchestratorModeSchema.nullable().optional(),
|
|
11420
|
-
telegram_bot_token:
|
|
11421
|
-
telegram_bot_username:
|
|
11422
|
-
task_context_template:
|
|
11423
|
-
avatar_url:
|
|
11424
|
-
max_tokens_per_job:
|
|
11622
|
+
telegram_bot_token: z7.string().nullable().optional(),
|
|
11623
|
+
telegram_bot_username: z7.string().nullable().optional(),
|
|
11624
|
+
task_context_template: z7.string().nullable().optional(),
|
|
11625
|
+
avatar_url: z7.string().nullable().optional(),
|
|
11626
|
+
max_tokens_per_job: z7.number().int().min(0).max(5e5).default(0)
|
|
11425
11627
|
});
|
|
11426
11628
|
}
|
|
11427
11629
|
});
|
|
11428
11630
|
|
|
11429
11631
|
// ../../packages/shared/src/entities/job.ts
|
|
11430
|
-
import { z as
|
|
11632
|
+
import { z as z8 } from "zod";
|
|
11431
11633
|
var ChainCountSchema, DelegationDepthSchema, AgentJobSchema, AgentJobInsertSchema;
|
|
11432
11634
|
var init_job = __esm({
|
|
11433
11635
|
"../../packages/shared/src/entities/job.ts"() {
|
|
11434
11636
|
"use strict";
|
|
11435
11637
|
init_enums();
|
|
11436
|
-
ChainCountSchema =
|
|
11437
|
-
DelegationDepthSchema =
|
|
11438
|
-
AgentJobSchema =
|
|
11439
|
-
id:
|
|
11440
|
-
entity_id:
|
|
11441
|
-
agent_id:
|
|
11638
|
+
ChainCountSchema = z8.number().int().min(0);
|
|
11639
|
+
DelegationDepthSchema = z8.number().int().min(0);
|
|
11640
|
+
AgentJobSchema = z8.object({
|
|
11641
|
+
id: z8.string().guid(),
|
|
11642
|
+
entity_id: z8.string().guid().nullable(),
|
|
11643
|
+
agent_id: z8.string().guid().nullable(),
|
|
11442
11644
|
status: JobStatusSchema,
|
|
11443
11645
|
channel: JobChannelSchema,
|
|
11444
|
-
task:
|
|
11445
|
-
original_task:
|
|
11446
|
-
chat_id:
|
|
11646
|
+
task: z8.string().min(1),
|
|
11647
|
+
original_task: z8.string().nullable(),
|
|
11648
|
+
chat_id: z8.string().nullable(),
|
|
11447
11649
|
// Groups jobs from the same conversational thread (migration 0059) — see
|
|
11448
11650
|
// apps/runner/src/job/conversation-id.ts for the stamping rule. Null for
|
|
11449
11651
|
// non-conversational jobs (cron/schedule/webhook with no parent).
|
|
11450
|
-
conversation_id:
|
|
11451
|
-
system_prompt:
|
|
11452
|
-
messages:
|
|
11453
|
-
tools_used:
|
|
11454
|
-
turn:
|
|
11455
|
-
result:
|
|
11456
|
-
error:
|
|
11652
|
+
conversation_id: z8.string().guid().nullable(),
|
|
11653
|
+
system_prompt: z8.string().nullable(),
|
|
11654
|
+
messages: z8.array(z8.record(z8.string(), z8.unknown())),
|
|
11655
|
+
tools_used: z8.array(z8.string()),
|
|
11656
|
+
turn: z8.number().int().min(0),
|
|
11657
|
+
result: z8.string().nullable(),
|
|
11658
|
+
error: z8.string().nullable(),
|
|
11457
11659
|
chain_count: ChainCountSchema,
|
|
11458
|
-
request_id:
|
|
11459
|
-
parent_job_id:
|
|
11460
|
-
parent_request_id:
|
|
11461
|
-
total_duration_ms:
|
|
11462
|
-
input_tokens:
|
|
11463
|
-
output_tokens:
|
|
11660
|
+
request_id: z8.string().nullable(),
|
|
11661
|
+
parent_job_id: z8.string().guid().nullable(),
|
|
11662
|
+
parent_request_id: z8.string().nullable(),
|
|
11663
|
+
total_duration_ms: z8.number().int().min(0),
|
|
11664
|
+
input_tokens: z8.number().int().min(0),
|
|
11665
|
+
output_tokens: z8.number().int().min(0),
|
|
11464
11666
|
delegation_depth: DelegationDepthSchema,
|
|
11465
|
-
pending_delegation:
|
|
11466
|
-
completed_at:
|
|
11467
|
-
created_at:
|
|
11468
|
-
updated_at:
|
|
11667
|
+
pending_delegation: z8.record(z8.string(), z8.unknown()).nullable(),
|
|
11668
|
+
completed_at: z8.string().datetime().nullable(),
|
|
11669
|
+
created_at: z8.string().datetime(),
|
|
11670
|
+
updated_at: z8.string().datetime()
|
|
11469
11671
|
}).strict();
|
|
11470
11672
|
AgentJobInsertSchema = AgentJobSchema.omit({
|
|
11471
11673
|
id: true,
|
|
@@ -11486,12 +11688,12 @@ var init_job = __esm({
|
|
|
11486
11688
|
parent_request_id: true
|
|
11487
11689
|
}).extend({
|
|
11488
11690
|
status: JobStatusSchema.default("pending"),
|
|
11489
|
-
original_task:
|
|
11490
|
-
chat_id:
|
|
11491
|
-
conversation_id:
|
|
11492
|
-
system_prompt:
|
|
11493
|
-
request_id:
|
|
11494
|
-
parent_job_id:
|
|
11691
|
+
original_task: z8.string().nullable().optional(),
|
|
11692
|
+
chat_id: z8.string().nullable().optional(),
|
|
11693
|
+
conversation_id: z8.string().guid().nullable().optional(),
|
|
11694
|
+
system_prompt: z8.string().nullable().optional(),
|
|
11695
|
+
request_id: z8.string().nullable().optional(),
|
|
11696
|
+
parent_job_id: z8.string().guid().nullable().optional()
|
|
11495
11697
|
});
|
|
11496
11698
|
}
|
|
11497
11699
|
});
|
|
@@ -11529,37 +11731,37 @@ var init_job_classification = __esm({
|
|
|
11529
11731
|
});
|
|
11530
11732
|
|
|
11531
11733
|
// ../../packages/shared/src/entities/task.ts
|
|
11532
|
-
import { z as
|
|
11734
|
+
import { z as z9 } from "zod";
|
|
11533
11735
|
var TaskDescriptionSchema, TaskTitleSchema, AgentTaskSchema, AgentTaskInsertSchema;
|
|
11534
11736
|
var init_task = __esm({
|
|
11535
11737
|
"../../packages/shared/src/entities/task.ts"() {
|
|
11536
11738
|
"use strict";
|
|
11537
11739
|
init_enums();
|
|
11538
|
-
TaskDescriptionSchema =
|
|
11539
|
-
TaskTitleSchema =
|
|
11540
|
-
AgentTaskSchema =
|
|
11541
|
-
id:
|
|
11542
|
-
entity_id:
|
|
11543
|
-
orchestrator_id:
|
|
11740
|
+
TaskDescriptionSchema = z9.string().max(2e3).nullable();
|
|
11741
|
+
TaskTitleSchema = z9.string().min(1).max(200);
|
|
11742
|
+
AgentTaskSchema = z9.object({
|
|
11743
|
+
id: z9.string().guid(),
|
|
11744
|
+
entity_id: z9.string().guid(),
|
|
11745
|
+
orchestrator_id: z9.string().guid(),
|
|
11544
11746
|
title: TaskTitleSchema,
|
|
11545
11747
|
description: TaskDescriptionSchema,
|
|
11546
11748
|
status: TaskStatusSchema,
|
|
11547
11749
|
priority: TaskPrioritySchema,
|
|
11548
|
-
job_id:
|
|
11549
|
-
result:
|
|
11550
|
-
created_by_agent_id:
|
|
11551
|
-
assigned_agent_id:
|
|
11552
|
-
input_tokens:
|
|
11553
|
-
output_tokens:
|
|
11554
|
-
cost_usd:
|
|
11750
|
+
job_id: z9.string().guid().nullable(),
|
|
11751
|
+
result: z9.string().nullable(),
|
|
11752
|
+
created_by_agent_id: z9.string().guid().nullable(),
|
|
11753
|
+
assigned_agent_id: z9.string().guid().nullable(),
|
|
11754
|
+
input_tokens: z9.number().int().min(0),
|
|
11755
|
+
output_tokens: z9.number().int().min(0),
|
|
11756
|
+
cost_usd: z9.number().min(0),
|
|
11555
11757
|
// Array of task UUIDs this task depends on — all must be 'done' before this runs
|
|
11556
|
-
depends_on:
|
|
11557
|
-
context:
|
|
11558
|
-
root_job_id:
|
|
11559
|
-
locked_at:
|
|
11560
|
-
locked_by:
|
|
11561
|
-
created_at:
|
|
11562
|
-
updated_at:
|
|
11758
|
+
depends_on: z9.array(z9.string().guid()),
|
|
11759
|
+
context: z9.record(z9.string(), z9.unknown()),
|
|
11760
|
+
root_job_id: z9.string().guid().nullable(),
|
|
11761
|
+
locked_at: z9.string().datetime().nullable(),
|
|
11762
|
+
locked_by: z9.string().nullable(),
|
|
11763
|
+
created_at: z9.string().datetime(),
|
|
11764
|
+
updated_at: z9.string().datetime()
|
|
11563
11765
|
}).strict();
|
|
11564
11766
|
AgentTaskInsertSchema = AgentTaskSchema.omit({
|
|
11565
11767
|
id: true,
|
|
@@ -11581,15 +11783,15 @@ var init_task = __esm({
|
|
|
11581
11783
|
status: TaskStatusSchema.default("todo"),
|
|
11582
11784
|
priority: TaskPrioritySchema.default("medium"),
|
|
11583
11785
|
description: TaskDescriptionSchema.optional(),
|
|
11584
|
-
depends_on:
|
|
11585
|
-
context:
|
|
11586
|
-
root_job_id:
|
|
11786
|
+
depends_on: z9.array(z9.string().guid()).default([]),
|
|
11787
|
+
context: z9.record(z9.string(), z9.unknown()).default({}),
|
|
11788
|
+
root_job_id: z9.string().guid().nullable().optional()
|
|
11587
11789
|
});
|
|
11588
11790
|
}
|
|
11589
11791
|
});
|
|
11590
11792
|
|
|
11591
11793
|
// ../../packages/shared/src/entities/credential.ts
|
|
11592
|
-
import { z as
|
|
11794
|
+
import { z as z10 } from "zod";
|
|
11593
11795
|
var CREDENTIAL_TYPES, CredentialSchema, GoogleOauthPayloadSchema;
|
|
11594
11796
|
var init_credential = __esm({
|
|
11595
11797
|
"../../packages/shared/src/entities/credential.ts"() {
|
|
@@ -11600,119 +11802,119 @@ var init_credential = __esm({
|
|
|
11600
11802
|
"airtable-oauth",
|
|
11601
11803
|
"microsoft-oauth"
|
|
11602
11804
|
];
|
|
11603
|
-
CredentialSchema =
|
|
11604
|
-
id:
|
|
11605
|
-
owner_user_id:
|
|
11606
|
-
name:
|
|
11607
|
-
type:
|
|
11608
|
-
payload:
|
|
11805
|
+
CredentialSchema = z10.object({
|
|
11806
|
+
id: z10.string().guid(),
|
|
11807
|
+
owner_user_id: z10.string().guid(),
|
|
11808
|
+
name: z10.string().min(1),
|
|
11809
|
+
type: z10.enum(CREDENTIAL_TYPES),
|
|
11810
|
+
payload: z10.string(),
|
|
11609
11811
|
// encrypted blob; never decoded at this layer
|
|
11610
|
-
created_at:
|
|
11611
|
-
updated_at:
|
|
11812
|
+
created_at: z10.date().nullable(),
|
|
11813
|
+
updated_at: z10.date().nullable()
|
|
11612
11814
|
});
|
|
11613
|
-
GoogleOauthPayloadSchema =
|
|
11614
|
-
clientId:
|
|
11615
|
-
clientSecret:
|
|
11616
|
-
refreshToken:
|
|
11617
|
-
accessToken:
|
|
11618
|
-
expiresAt:
|
|
11815
|
+
GoogleOauthPayloadSchema = z10.object({
|
|
11816
|
+
clientId: z10.string(),
|
|
11817
|
+
clientSecret: z10.string(),
|
|
11818
|
+
refreshToken: z10.string().nullable(),
|
|
11819
|
+
accessToken: z10.string(),
|
|
11820
|
+
expiresAt: z10.string().nullable(),
|
|
11619
11821
|
// ISO 8601
|
|
11620
|
-
scopes:
|
|
11822
|
+
scopes: z10.string(),
|
|
11621
11823
|
// space-separated
|
|
11622
|
-
accountName:
|
|
11623
|
-
tokenUrl:
|
|
11824
|
+
accountName: z10.string(),
|
|
11825
|
+
tokenUrl: z10.string().url()
|
|
11624
11826
|
});
|
|
11625
11827
|
}
|
|
11626
11828
|
});
|
|
11627
11829
|
|
|
11628
11830
|
// ../../packages/shared/src/entities/connector.ts
|
|
11629
|
-
import { z as
|
|
11831
|
+
import { z as z11 } from "zod";
|
|
11630
11832
|
var ConnectorSchema, ConnectorInsertSchema;
|
|
11631
11833
|
var init_connector = __esm({
|
|
11632
11834
|
"../../packages/shared/src/entities/connector.ts"() {
|
|
11633
11835
|
"use strict";
|
|
11634
11836
|
init_enums();
|
|
11635
|
-
ConnectorSchema =
|
|
11636
|
-
id:
|
|
11637
|
-
entity_id:
|
|
11638
|
-
name:
|
|
11639
|
-
slug:
|
|
11640
|
-
base_url:
|
|
11837
|
+
ConnectorSchema = z11.object({
|
|
11838
|
+
id: z11.string().guid(),
|
|
11839
|
+
entity_id: z11.string().guid().nullable(),
|
|
11840
|
+
name: z11.string().min(1).max(120),
|
|
11841
|
+
slug: z11.string().min(1).max(80).regex(/^[a-z0-9-]+$/),
|
|
11842
|
+
base_url: z11.string().nullable(),
|
|
11641
11843
|
// audit#2026-07-07 SEC-5: this comment used to claim pgp_sym_encrypt (pgcrypto),
|
|
11642
11844
|
// which is not used anywhere. Real encryption is application-level AES-256-GCM
|
|
11643
11845
|
// via @nodal-agents/secrets before the value ever reaches the DB; raw value never returned.
|
|
11644
|
-
api_key:
|
|
11645
|
-
active:
|
|
11846
|
+
api_key: z11.string().nullable(),
|
|
11847
|
+
active: z11.boolean(),
|
|
11646
11848
|
auth_type: ConnectorAuthTypeSchema,
|
|
11647
11849
|
// FK to credentials table — null for api_key connectors
|
|
11648
|
-
credential_id:
|
|
11649
|
-
created_at:
|
|
11650
|
-
updated_at:
|
|
11850
|
+
credential_id: z11.string().guid().nullable(),
|
|
11851
|
+
created_at: z11.string().datetime(),
|
|
11852
|
+
updated_at: z11.string().datetime()
|
|
11651
11853
|
}).strict();
|
|
11652
11854
|
ConnectorInsertSchema = ConnectorSchema.omit({
|
|
11653
11855
|
id: true,
|
|
11654
11856
|
created_at: true,
|
|
11655
11857
|
updated_at: true
|
|
11656
11858
|
}).extend({
|
|
11657
|
-
active:
|
|
11859
|
+
active: z11.boolean().default(true),
|
|
11658
11860
|
auth_type: ConnectorAuthTypeSchema.default("api_key"),
|
|
11659
|
-
base_url:
|
|
11660
|
-
api_key:
|
|
11661
|
-
credential_id:
|
|
11861
|
+
base_url: z11.string().nullable().optional(),
|
|
11862
|
+
api_key: z11.string().nullable().optional(),
|
|
11863
|
+
credential_id: z11.string().guid().nullable().optional()
|
|
11662
11864
|
});
|
|
11663
11865
|
}
|
|
11664
11866
|
});
|
|
11665
11867
|
|
|
11666
11868
|
// ../../packages/shared/src/entities/tool-call.ts
|
|
11667
|
-
import { z as
|
|
11869
|
+
import { z as z12 } from "zod";
|
|
11668
11870
|
var ToolCallSchema, ToolCallInsertSchema;
|
|
11669
11871
|
var init_tool_call = __esm({
|
|
11670
11872
|
"../../packages/shared/src/entities/tool-call.ts"() {
|
|
11671
11873
|
"use strict";
|
|
11672
|
-
ToolCallSchema =
|
|
11673
|
-
id:
|
|
11674
|
-
entity_id:
|
|
11675
|
-
job_id:
|
|
11676
|
-
tool_name:
|
|
11677
|
-
tool_input:
|
|
11678
|
-
tool_output:
|
|
11679
|
-
duration_ms:
|
|
11680
|
-
turn:
|
|
11681
|
-
created_at:
|
|
11874
|
+
ToolCallSchema = z12.object({
|
|
11875
|
+
id: z12.string().guid(),
|
|
11876
|
+
entity_id: z12.string().guid().nullable(),
|
|
11877
|
+
job_id: z12.string().guid().nullable(),
|
|
11878
|
+
tool_name: z12.string().min(1),
|
|
11879
|
+
tool_input: z12.record(z12.string(), z12.unknown()).nullable(),
|
|
11880
|
+
tool_output: z12.string().nullable(),
|
|
11881
|
+
duration_ms: z12.number().int().min(0).nullable(),
|
|
11882
|
+
turn: z12.number().int().min(0).nullable(),
|
|
11883
|
+
created_at: z12.string().datetime()
|
|
11682
11884
|
}).strict();
|
|
11683
11885
|
ToolCallInsertSchema = ToolCallSchema.omit({
|
|
11684
11886
|
id: true,
|
|
11685
11887
|
created_at: true
|
|
11686
11888
|
}).extend({
|
|
11687
|
-
tool_input:
|
|
11688
|
-
tool_output:
|
|
11689
|
-
duration_ms:
|
|
11690
|
-
turn:
|
|
11889
|
+
tool_input: z12.record(z12.string(), z12.unknown()).nullable().optional(),
|
|
11890
|
+
tool_output: z12.string().nullable().optional(),
|
|
11891
|
+
duration_ms: z12.number().int().min(0).nullable().optional(),
|
|
11892
|
+
turn: z12.number().int().min(0).nullable().optional()
|
|
11691
11893
|
});
|
|
11692
11894
|
}
|
|
11693
11895
|
});
|
|
11694
11896
|
|
|
11695
11897
|
// ../../packages/shared/src/entities/approval.ts
|
|
11696
|
-
import { z as
|
|
11898
|
+
import { z as z13 } from "zod";
|
|
11697
11899
|
var ApprovalRequestSchema, ApprovalRequestInsertSchema, ApprovalRuleSchema, ApprovalRuleInsertSchema;
|
|
11698
11900
|
var init_approval = __esm({
|
|
11699
11901
|
"../../packages/shared/src/entities/approval.ts"() {
|
|
11700
11902
|
"use strict";
|
|
11701
11903
|
init_enums();
|
|
11702
|
-
ApprovalRequestSchema =
|
|
11703
|
-
id:
|
|
11704
|
-
entity_id:
|
|
11705
|
-
job_id:
|
|
11706
|
-
agent_id:
|
|
11707
|
-
tool_name:
|
|
11708
|
-
tool_input:
|
|
11904
|
+
ApprovalRequestSchema = z13.object({
|
|
11905
|
+
id: z13.string().guid(),
|
|
11906
|
+
entity_id: z13.string().guid().nullable(),
|
|
11907
|
+
job_id: z13.string().guid(),
|
|
11908
|
+
agent_id: z13.string().guid().nullable(),
|
|
11909
|
+
tool_name: z13.string().min(1),
|
|
11910
|
+
tool_input: z13.record(z13.string(), z13.unknown()),
|
|
11709
11911
|
status: ApprovalStatusSchema,
|
|
11710
|
-
requested_at:
|
|
11711
|
-
resolved_at:
|
|
11712
|
-
resolved_by:
|
|
11912
|
+
requested_at: z13.string().datetime(),
|
|
11913
|
+
resolved_at: z13.string().datetime().nullable(),
|
|
11914
|
+
resolved_by: z13.string().nullable(),
|
|
11713
11915
|
// default: requested_at + 1 hour
|
|
11714
|
-
expires_at:
|
|
11715
|
-
notes:
|
|
11916
|
+
expires_at: z13.string().datetime().nullable(),
|
|
11917
|
+
notes: z13.string().nullable()
|
|
11716
11918
|
}).strict();
|
|
11717
11919
|
ApprovalRequestInsertSchema = ApprovalRequestSchema.omit({
|
|
11718
11920
|
id: true,
|
|
@@ -11722,60 +11924,60 @@ var init_approval = __esm({
|
|
|
11722
11924
|
expires_at: true
|
|
11723
11925
|
}).extend({
|
|
11724
11926
|
status: ApprovalStatusSchema.default("pending"),
|
|
11725
|
-
notes:
|
|
11927
|
+
notes: z13.string().nullable().optional()
|
|
11726
11928
|
});
|
|
11727
|
-
ApprovalRuleSchema =
|
|
11728
|
-
id:
|
|
11729
|
-
entity_id:
|
|
11730
|
-
agent_id:
|
|
11731
|
-
tool_name:
|
|
11929
|
+
ApprovalRuleSchema = z13.object({
|
|
11930
|
+
id: z13.string().guid(),
|
|
11931
|
+
entity_id: z13.string().guid().nullable(),
|
|
11932
|
+
agent_id: z13.string().guid().nullable(),
|
|
11933
|
+
tool_name: z13.string().min(1),
|
|
11732
11934
|
action: ApprovalRuleActionSchema,
|
|
11733
|
-
condition_json:
|
|
11734
|
-
created_at:
|
|
11735
|
-
updated_at:
|
|
11935
|
+
condition_json: z13.record(z13.string(), z13.unknown()),
|
|
11936
|
+
created_at: z13.string().datetime(),
|
|
11937
|
+
updated_at: z13.string().datetime()
|
|
11736
11938
|
}).strict();
|
|
11737
11939
|
ApprovalRuleInsertSchema = ApprovalRuleSchema.omit({
|
|
11738
11940
|
id: true,
|
|
11739
11941
|
created_at: true,
|
|
11740
11942
|
updated_at: true
|
|
11741
11943
|
}).extend({
|
|
11742
|
-
agent_id:
|
|
11743
|
-
condition_json:
|
|
11944
|
+
agent_id: z13.string().guid().nullable().optional(),
|
|
11945
|
+
condition_json: z13.record(z13.string(), z13.unknown()).default({})
|
|
11744
11946
|
});
|
|
11745
11947
|
}
|
|
11746
11948
|
});
|
|
11747
11949
|
|
|
11748
11950
|
// ../../packages/shared/src/entities/memory.ts
|
|
11749
|
-
import { z as
|
|
11951
|
+
import { z as z14 } from "zod";
|
|
11750
11952
|
var ImportanceSchema, AgentMemorySchema, AgentMemoryInsertSchema;
|
|
11751
11953
|
var init_memory = __esm({
|
|
11752
11954
|
"../../packages/shared/src/entities/memory.ts"() {
|
|
11753
11955
|
"use strict";
|
|
11754
11956
|
init_enums();
|
|
11755
|
-
ImportanceSchema =
|
|
11756
|
-
AgentMemorySchema =
|
|
11757
|
-
id:
|
|
11758
|
-
entity_id:
|
|
11759
|
-
agent_id:
|
|
11760
|
-
fact:
|
|
11957
|
+
ImportanceSchema = z14.number().int().min(1).max(5);
|
|
11958
|
+
AgentMemorySchema = z14.object({
|
|
11959
|
+
id: z14.string().guid(),
|
|
11960
|
+
entity_id: z14.string().guid().nullable(),
|
|
11961
|
+
agent_id: z14.string().guid().nullable(),
|
|
11962
|
+
fact: z14.string().min(1),
|
|
11761
11963
|
category: MemoryCategorySchema,
|
|
11762
11964
|
importance: ImportanceSchema,
|
|
11763
11965
|
source: MemorySourceSchema,
|
|
11764
|
-
skill_tags:
|
|
11966
|
+
skill_tags: z14.array(z14.string().max(60)),
|
|
11765
11967
|
memory_layer: MemoryLayerSchema.nullable(),
|
|
11766
11968
|
// temporal validity window
|
|
11767
|
-
valid_from:
|
|
11768
|
-
valid_to:
|
|
11769
|
-
fact_hash:
|
|
11770
|
-
archived:
|
|
11969
|
+
valid_from: z14.string().datetime().nullable(),
|
|
11970
|
+
valid_to: z14.string().datetime().nullable(),
|
|
11971
|
+
fact_hash: z14.string().nullable(),
|
|
11972
|
+
archived: z14.boolean(),
|
|
11771
11973
|
// User override lock (migration 0053) — when true, the curator refuses to
|
|
11772
11974
|
// re-score importance for this fact. Defaulted so rows/objects predating
|
|
11773
11975
|
// the column still parse.
|
|
11774
|
-
importance_locked:
|
|
11775
|
-
last_accessed_at:
|
|
11776
|
-
access_count:
|
|
11777
|
-
created_at:
|
|
11778
|
-
updated_at:
|
|
11976
|
+
importance_locked: z14.boolean().default(false),
|
|
11977
|
+
last_accessed_at: z14.string().datetime().nullable(),
|
|
11978
|
+
access_count: z14.number().int().min(0),
|
|
11979
|
+
created_at: z14.string().datetime(),
|
|
11980
|
+
updated_at: z14.string().datetime()
|
|
11779
11981
|
}).strict();
|
|
11780
11982
|
AgentMemoryInsertSchema = AgentMemorySchema.omit({
|
|
11781
11983
|
id: true,
|
|
@@ -11789,35 +11991,35 @@ var init_memory = __esm({
|
|
|
11789
11991
|
valid_from: true,
|
|
11790
11992
|
valid_to: true
|
|
11791
11993
|
}).extend({
|
|
11792
|
-
agent_id:
|
|
11994
|
+
agent_id: z14.string().guid().nullable().optional(),
|
|
11793
11995
|
category: MemoryCategorySchema.default("context"),
|
|
11794
11996
|
importance: ImportanceSchema.default(3),
|
|
11795
11997
|
source: MemorySourceSchema.default("manual"),
|
|
11796
|
-
skill_tags:
|
|
11998
|
+
skill_tags: z14.array(z14.string().max(60)).max(20).default([]),
|
|
11797
11999
|
memory_layer: MemoryLayerSchema.nullable().optional()
|
|
11798
12000
|
});
|
|
11799
12001
|
}
|
|
11800
12002
|
});
|
|
11801
12003
|
|
|
11802
12004
|
// ../../packages/shared/src/entities/webhook-trigger.ts
|
|
11803
|
-
import { z as
|
|
12005
|
+
import { z as z15 } from "zod";
|
|
11804
12006
|
var WebhookTriggerSchema, WebhookTriggerInsertSchema;
|
|
11805
12007
|
var init_webhook_trigger = __esm({
|
|
11806
12008
|
"../../packages/shared/src/entities/webhook-trigger.ts"() {
|
|
11807
12009
|
"use strict";
|
|
11808
|
-
WebhookTriggerSchema =
|
|
11809
|
-
id:
|
|
11810
|
-
entity_id:
|
|
11811
|
-
agent_id:
|
|
11812
|
-
name:
|
|
11813
|
-
slug:
|
|
11814
|
-
task_template:
|
|
11815
|
-
active:
|
|
11816
|
-
secret:
|
|
11817
|
-
last_triggered_at:
|
|
11818
|
-
trigger_count:
|
|
11819
|
-
created_at:
|
|
11820
|
-
updated_at:
|
|
12010
|
+
WebhookTriggerSchema = z15.object({
|
|
12011
|
+
id: z15.string().guid(),
|
|
12012
|
+
entity_id: z15.string().guid().nullable(),
|
|
12013
|
+
agent_id: z15.string().guid().nullable(),
|
|
12014
|
+
name: z15.string().min(1).max(120),
|
|
12015
|
+
slug: z15.string().min(1).max(80).regex(/^[a-z0-9-]+$/),
|
|
12016
|
+
task_template: z15.string().min(1),
|
|
12017
|
+
active: z15.boolean(),
|
|
12018
|
+
secret: z15.string().nullable(),
|
|
12019
|
+
last_triggered_at: z15.string().datetime().nullable(),
|
|
12020
|
+
trigger_count: z15.number().int().min(0),
|
|
12021
|
+
created_at: z15.string().datetime(),
|
|
12022
|
+
updated_at: z15.string().datetime()
|
|
11821
12023
|
}).strict();
|
|
11822
12024
|
WebhookTriggerInsertSchema = WebhookTriggerSchema.omit({
|
|
11823
12025
|
id: true,
|
|
@@ -11827,103 +12029,103 @@ var init_webhook_trigger = __esm({
|
|
|
11827
12029
|
last_triggered_at: true,
|
|
11828
12030
|
trigger_count: true
|
|
11829
12031
|
}).extend({
|
|
11830
|
-
active:
|
|
12032
|
+
active: z15.boolean().default(true)
|
|
11831
12033
|
});
|
|
11832
12034
|
}
|
|
11833
12035
|
});
|
|
11834
12036
|
|
|
11835
12037
|
// ../../packages/shared/src/entities/skill.ts
|
|
11836
|
-
import { z as
|
|
12038
|
+
import { z as z16 } from "zod";
|
|
11837
12039
|
var SkillOperationSchema, SkillRequiredConfigSchema, AgentSkillSchema, AgentSkillInsertSchema, AgentSkillAssignmentSchema, AgentSkillAssignmentInsertSchema;
|
|
11838
12040
|
var init_skill = __esm({
|
|
11839
12041
|
"../../packages/shared/src/entities/skill.ts"() {
|
|
11840
12042
|
"use strict";
|
|
11841
12043
|
init_enums();
|
|
11842
|
-
SkillOperationSchema =
|
|
11843
|
-
name:
|
|
11844
|
-
slug:
|
|
12044
|
+
SkillOperationSchema = z16.object({
|
|
12045
|
+
name: z16.string().min(1),
|
|
12046
|
+
slug: z16.string().min(1).regex(/^[a-z0-9-]+$/),
|
|
11845
12047
|
risk: OperationRiskLevelSchema,
|
|
11846
|
-
requires_approval:
|
|
12048
|
+
requires_approval: z16.boolean()
|
|
11847
12049
|
}).strict();
|
|
11848
|
-
SkillRequiredConfigSchema =
|
|
11849
|
-
label:
|
|
11850
|
-
description:
|
|
11851
|
-
type:
|
|
11852
|
-
value:
|
|
11853
|
-
critical:
|
|
12050
|
+
SkillRequiredConfigSchema = z16.object({
|
|
12051
|
+
label: z16.string().min(1),
|
|
12052
|
+
description: z16.string().min(1),
|
|
12053
|
+
type: z16.enum(["connector_slug", "manual"]),
|
|
12054
|
+
value: z16.string().optional(),
|
|
12055
|
+
critical: z16.boolean()
|
|
11854
12056
|
}).strict();
|
|
11855
|
-
AgentSkillSchema =
|
|
11856
|
-
id:
|
|
11857
|
-
entity_id:
|
|
11858
|
-
name:
|
|
11859
|
-
slug:
|
|
11860
|
-
content:
|
|
11861
|
-
active:
|
|
11862
|
-
description:
|
|
11863
|
-
default_content:
|
|
11864
|
-
content_overridden:
|
|
11865
|
-
required_config:
|
|
11866
|
-
operations:
|
|
11867
|
-
required_builtins:
|
|
11868
|
-
created_at:
|
|
11869
|
-
updated_at:
|
|
12057
|
+
AgentSkillSchema = z16.object({
|
|
12058
|
+
id: z16.string().guid(),
|
|
12059
|
+
entity_id: z16.string().guid().nullable(),
|
|
12060
|
+
name: z16.string().min(1).max(120),
|
|
12061
|
+
slug: z16.string().min(1).max(80).regex(/^[a-z0-9-]+$/),
|
|
12062
|
+
content: z16.string().min(1),
|
|
12063
|
+
active: z16.boolean(),
|
|
12064
|
+
description: z16.string().max(300).nullable(),
|
|
12065
|
+
default_content: z16.string().nullable(),
|
|
12066
|
+
content_overridden: z16.boolean(),
|
|
12067
|
+
required_config: z16.array(SkillRequiredConfigSchema),
|
|
12068
|
+
operations: z16.array(SkillOperationSchema),
|
|
12069
|
+
required_builtins: z16.array(z16.string()),
|
|
12070
|
+
created_at: z16.string().datetime(),
|
|
12071
|
+
updated_at: z16.string().datetime()
|
|
11870
12072
|
}).strict();
|
|
11871
12073
|
AgentSkillInsertSchema = AgentSkillSchema.omit({
|
|
11872
12074
|
id: true,
|
|
11873
12075
|
created_at: true,
|
|
11874
12076
|
updated_at: true
|
|
11875
12077
|
}).extend({
|
|
11876
|
-
active:
|
|
11877
|
-
description:
|
|
11878
|
-
default_content:
|
|
11879
|
-
content_overridden:
|
|
11880
|
-
required_config:
|
|
11881
|
-
operations:
|
|
11882
|
-
required_builtins:
|
|
12078
|
+
active: z16.boolean().default(true),
|
|
12079
|
+
description: z16.string().max(300).nullable().optional(),
|
|
12080
|
+
default_content: z16.string().nullable().optional(),
|
|
12081
|
+
content_overridden: z16.boolean().default(false),
|
|
12082
|
+
required_config: z16.array(SkillRequiredConfigSchema).default([]),
|
|
12083
|
+
operations: z16.array(SkillOperationSchema).default([]),
|
|
12084
|
+
required_builtins: z16.array(z16.string()).default([])
|
|
11883
12085
|
});
|
|
11884
|
-
AgentSkillAssignmentSchema =
|
|
11885
|
-
id:
|
|
11886
|
-
entity_id:
|
|
11887
|
-
agent_id:
|
|
11888
|
-
skill_id:
|
|
11889
|
-
use_custom_instructions:
|
|
12086
|
+
AgentSkillAssignmentSchema = z16.object({
|
|
12087
|
+
id: z16.string().guid(),
|
|
12088
|
+
entity_id: z16.string().guid(),
|
|
12089
|
+
agent_id: z16.string().guid(),
|
|
12090
|
+
skill_id: z16.string().guid(),
|
|
12091
|
+
use_custom_instructions: z16.boolean(),
|
|
11890
12092
|
// NULL = all operations enabled; [] = none enabled
|
|
11891
|
-
enabled_operations:
|
|
11892
|
-
created_at:
|
|
12093
|
+
enabled_operations: z16.array(z16.string()).nullable(),
|
|
12094
|
+
created_at: z16.string().datetime()
|
|
11893
12095
|
}).strict();
|
|
11894
12096
|
AgentSkillAssignmentInsertSchema = AgentSkillAssignmentSchema.omit({
|
|
11895
12097
|
id: true,
|
|
11896
12098
|
created_at: true
|
|
11897
12099
|
}).extend({
|
|
11898
|
-
use_custom_instructions:
|
|
11899
|
-
enabled_operations:
|
|
12100
|
+
use_custom_instructions: z16.boolean().default(false),
|
|
12101
|
+
enabled_operations: z16.array(z16.string()).nullable().optional()
|
|
11900
12102
|
});
|
|
11901
12103
|
}
|
|
11902
12104
|
});
|
|
11903
12105
|
|
|
11904
12106
|
// ../../packages/shared/src/entities/schedule.ts
|
|
11905
|
-
import { z as
|
|
12107
|
+
import { z as z17 } from "zod";
|
|
11906
12108
|
var AgentScheduleSchema, AgentScheduleInsertSchema;
|
|
11907
12109
|
var init_schedule = __esm({
|
|
11908
12110
|
"../../packages/shared/src/entities/schedule.ts"() {
|
|
11909
12111
|
"use strict";
|
|
11910
12112
|
init_enums();
|
|
11911
|
-
AgentScheduleSchema =
|
|
11912
|
-
id:
|
|
11913
|
-
entity_id:
|
|
11914
|
-
agent_id:
|
|
12113
|
+
AgentScheduleSchema = z17.object({
|
|
12114
|
+
id: z17.string().guid(),
|
|
12115
|
+
entity_id: z17.string().guid().nullable(),
|
|
12116
|
+
agent_id: z17.string().guid(),
|
|
11915
12117
|
type: ScheduleTypeSchema,
|
|
11916
|
-
name:
|
|
11917
|
-
cron_expr:
|
|
11918
|
-
task:
|
|
11919
|
-
objectives:
|
|
11920
|
-
active:
|
|
11921
|
-
last_run:
|
|
11922
|
-
next_run:
|
|
12118
|
+
name: z17.string().min(1).max(120),
|
|
12119
|
+
cron_expr: z17.string().min(1),
|
|
12120
|
+
task: z17.string().nullable(),
|
|
12121
|
+
objectives: z17.string().nullable(),
|
|
12122
|
+
active: z17.boolean(),
|
|
12123
|
+
last_run: z17.string().datetime().nullable(),
|
|
12124
|
+
next_run: z17.string().datetime().nullable(),
|
|
11923
12125
|
last_status: ScheduleLastStatusSchema.nullable(),
|
|
11924
|
-
chat_id:
|
|
11925
|
-
created_at:
|
|
11926
|
-
updated_at:
|
|
12126
|
+
chat_id: z17.string().nullable(),
|
|
12127
|
+
created_at: z17.string().datetime(),
|
|
12128
|
+
updated_at: z17.string().datetime()
|
|
11927
12129
|
}).strict();
|
|
11928
12130
|
AgentScheduleInsertSchema = AgentScheduleSchema.omit({
|
|
11929
12131
|
id: true,
|
|
@@ -11934,123 +12136,123 @@ var init_schedule = __esm({
|
|
|
11934
12136
|
last_status: true
|
|
11935
12137
|
}).extend({
|
|
11936
12138
|
type: ScheduleTypeSchema.default("cron"),
|
|
11937
|
-
active:
|
|
11938
|
-
task:
|
|
11939
|
-
objectives:
|
|
11940
|
-
chat_id:
|
|
12139
|
+
active: z17.boolean().default(true),
|
|
12140
|
+
task: z17.string().nullable().optional(),
|
|
12141
|
+
objectives: z17.string().nullable().optional(),
|
|
12142
|
+
chat_id: z17.string().nullable().optional()
|
|
11941
12143
|
});
|
|
11942
12144
|
}
|
|
11943
12145
|
});
|
|
11944
12146
|
|
|
11945
12147
|
// ../../packages/shared/src/entities/llm-key.ts
|
|
11946
|
-
import { z as
|
|
12148
|
+
import { z as z18 } from "zod";
|
|
11947
12149
|
var EntityLlmKeySchema, EntityLlmKeyInsertSchema;
|
|
11948
12150
|
var init_llm_key = __esm({
|
|
11949
12151
|
"../../packages/shared/src/entities/llm-key.ts"() {
|
|
11950
12152
|
"use strict";
|
|
11951
|
-
EntityLlmKeySchema =
|
|
11952
|
-
id:
|
|
11953
|
-
entity_id:
|
|
11954
|
-
provider:
|
|
12153
|
+
EntityLlmKeySchema = z18.object({
|
|
12154
|
+
id: z18.string().guid(),
|
|
12155
|
+
entity_id: z18.string().guid(),
|
|
12156
|
+
provider: z18.string().min(1),
|
|
11955
12157
|
// api_key stored encrypted in DB; empty string = not yet set
|
|
11956
|
-
api_key:
|
|
11957
|
-
base_url:
|
|
11958
|
-
nickname:
|
|
11959
|
-
is_active:
|
|
11960
|
-
created_at:
|
|
11961
|
-
updated_at:
|
|
12158
|
+
api_key: z18.string(),
|
|
12159
|
+
base_url: z18.string().nullable(),
|
|
12160
|
+
nickname: z18.string().max(80).nullable(),
|
|
12161
|
+
is_active: z18.boolean(),
|
|
12162
|
+
created_at: z18.string().datetime(),
|
|
12163
|
+
updated_at: z18.string().datetime()
|
|
11962
12164
|
}).strict();
|
|
11963
12165
|
EntityLlmKeyInsertSchema = EntityLlmKeySchema.omit({
|
|
11964
12166
|
id: true,
|
|
11965
12167
|
created_at: true,
|
|
11966
12168
|
updated_at: true
|
|
11967
12169
|
}).extend({
|
|
11968
|
-
api_key:
|
|
11969
|
-
base_url:
|
|
11970
|
-
nickname:
|
|
11971
|
-
is_active:
|
|
12170
|
+
api_key: z18.string().default(""),
|
|
12171
|
+
base_url: z18.string().nullable().optional(),
|
|
12172
|
+
nickname: z18.string().max(80).nullable().optional(),
|
|
12173
|
+
is_active: z18.boolean().default(true)
|
|
11972
12174
|
});
|
|
11973
12175
|
}
|
|
11974
12176
|
});
|
|
11975
12177
|
|
|
11976
12178
|
// ../../packages/shared/src/entities/channel-binding.ts
|
|
11977
|
-
import { z as
|
|
12179
|
+
import { z as z19 } from "zod";
|
|
11978
12180
|
var CHANNELS, ChannelSchema, ChannelBotIdentitySchema, ChannelBindingSchema, ChannelBindingInsertSchema;
|
|
11979
12181
|
var init_channel_binding = __esm({
|
|
11980
12182
|
"../../packages/shared/src/entities/channel-binding.ts"() {
|
|
11981
12183
|
"use strict";
|
|
11982
12184
|
CHANNELS = ["telegram", "discord", "slack", "whatsapp"];
|
|
11983
|
-
ChannelSchema =
|
|
11984
|
-
ChannelBotIdentitySchema =
|
|
11985
|
-
id:
|
|
11986
|
-
username:
|
|
11987
|
-
displayName:
|
|
12185
|
+
ChannelSchema = z19.enum(CHANNELS);
|
|
12186
|
+
ChannelBotIdentitySchema = z19.object({
|
|
12187
|
+
id: z19.string().optional(),
|
|
12188
|
+
username: z19.string().optional(),
|
|
12189
|
+
displayName: z19.string().optional()
|
|
11988
12190
|
}).strict();
|
|
11989
|
-
ChannelBindingSchema =
|
|
11990
|
-
id:
|
|
11991
|
-
entity_id:
|
|
11992
|
-
agent_id:
|
|
12191
|
+
ChannelBindingSchema = z19.object({
|
|
12192
|
+
id: z19.string().guid(),
|
|
12193
|
+
entity_id: z19.string().guid().nullable(),
|
|
12194
|
+
agent_id: z19.string().guid(),
|
|
11993
12195
|
channel: ChannelSchema,
|
|
11994
12196
|
// Opaque ciphertext (or plaintext JSON during the S2 back-fill — see
|
|
11995
12197
|
// migration 0064). Encryption happens at the writer layer;
|
|
11996
12198
|
// @nodal-agents/db never imports @nodal-agents/secrets, so this column is
|
|
11997
12199
|
// untyped text here.
|
|
11998
|
-
credentials:
|
|
12200
|
+
credentials: z19.string(),
|
|
11999
12201
|
bot_identity: ChannelBotIdentitySchema.nullable(),
|
|
12000
|
-
cursor:
|
|
12001
|
-
enabled:
|
|
12002
|
-
created_at:
|
|
12003
|
-
updated_at:
|
|
12202
|
+
cursor: z19.string().nullable(),
|
|
12203
|
+
enabled: z19.boolean(),
|
|
12204
|
+
created_at: z19.string().datetime(),
|
|
12205
|
+
updated_at: z19.string().datetime()
|
|
12004
12206
|
}).strict();
|
|
12005
12207
|
ChannelBindingInsertSchema = ChannelBindingSchema.omit({
|
|
12006
12208
|
id: true,
|
|
12007
12209
|
created_at: true,
|
|
12008
12210
|
updated_at: true
|
|
12009
12211
|
}).extend({
|
|
12010
|
-
entity_id:
|
|
12212
|
+
entity_id: z19.string().guid().nullable().optional(),
|
|
12011
12213
|
bot_identity: ChannelBotIdentitySchema.nullable().optional(),
|
|
12012
|
-
cursor:
|
|
12013
|
-
enabled:
|
|
12214
|
+
cursor: z19.string().nullable().optional(),
|
|
12215
|
+
enabled: z19.boolean().default(true)
|
|
12014
12216
|
});
|
|
12015
12217
|
}
|
|
12016
12218
|
});
|
|
12017
12219
|
|
|
12018
12220
|
// ../../packages/shared/src/entities/channel-allowed-conversation.ts
|
|
12019
|
-
import { z as
|
|
12221
|
+
import { z as z20 } from "zod";
|
|
12020
12222
|
var CONVERSATION_KINDS, ConversationKindSchema, CHANNEL_CONVERSATION_ROLES, ChannelConversationRoleSchema, CHANNEL_CONVERSATION_STATUSES, ChannelConversationStatusSchema, ChannelAllowedConversationSchema, ChannelAllowedConversationInsertSchema;
|
|
12021
12223
|
var init_channel_allowed_conversation = __esm({
|
|
12022
12224
|
"../../packages/shared/src/entities/channel-allowed-conversation.ts"() {
|
|
12023
12225
|
"use strict";
|
|
12024
12226
|
init_channel_binding();
|
|
12025
12227
|
CONVERSATION_KINDS = ["private", "group", "channel", "thread"];
|
|
12026
|
-
ConversationKindSchema =
|
|
12228
|
+
ConversationKindSchema = z20.enum(CONVERSATION_KINDS);
|
|
12027
12229
|
CHANNEL_CONVERSATION_ROLES = ["owner", "member"];
|
|
12028
|
-
ChannelConversationRoleSchema =
|
|
12230
|
+
ChannelConversationRoleSchema = z20.enum(CHANNEL_CONVERSATION_ROLES);
|
|
12029
12231
|
CHANNEL_CONVERSATION_STATUSES = ["active", "pending"];
|
|
12030
|
-
ChannelConversationStatusSchema =
|
|
12031
|
-
ChannelAllowedConversationSchema =
|
|
12032
|
-
id:
|
|
12033
|
-
entity_id:
|
|
12034
|
-
agent_id:
|
|
12232
|
+
ChannelConversationStatusSchema = z20.enum(CHANNEL_CONVERSATION_STATUSES);
|
|
12233
|
+
ChannelAllowedConversationSchema = z20.object({
|
|
12234
|
+
id: z20.string().guid(),
|
|
12235
|
+
entity_id: z20.string().guid().nullable(),
|
|
12236
|
+
agent_id: z20.string().guid(),
|
|
12035
12237
|
channel: ChannelSchema,
|
|
12036
|
-
conversation_id:
|
|
12238
|
+
conversation_id: z20.string(),
|
|
12037
12239
|
kind: ConversationKindSchema,
|
|
12038
12240
|
role: ChannelConversationRoleSchema,
|
|
12039
12241
|
status: ChannelConversationStatusSchema,
|
|
12040
|
-
requester_name:
|
|
12041
|
-
created_at:
|
|
12042
|
-
updated_at:
|
|
12242
|
+
requester_name: z20.string().nullable(),
|
|
12243
|
+
created_at: z20.string().datetime(),
|
|
12244
|
+
updated_at: z20.string().datetime()
|
|
12043
12245
|
}).strict();
|
|
12044
12246
|
ChannelAllowedConversationInsertSchema = ChannelAllowedConversationSchema.omit({
|
|
12045
12247
|
id: true,
|
|
12046
12248
|
created_at: true,
|
|
12047
12249
|
updated_at: true
|
|
12048
12250
|
}).extend({
|
|
12049
|
-
entity_id:
|
|
12251
|
+
entity_id: z20.string().guid().nullable().optional(),
|
|
12050
12252
|
kind: ConversationKindSchema.default("private"),
|
|
12051
12253
|
role: ChannelConversationRoleSchema.default("member"),
|
|
12052
12254
|
status: ChannelConversationStatusSchema.default("pending"),
|
|
12053
|
-
requester_name:
|
|
12255
|
+
requester_name: z20.string().nullable().optional()
|
|
12054
12256
|
});
|
|
12055
12257
|
}
|
|
12056
12258
|
});
|
|
@@ -12277,24 +12479,24 @@ var init_providers = __esm({
|
|
|
12277
12479
|
});
|
|
12278
12480
|
|
|
12279
12481
|
// ../../packages/shared/src/root-agent.ts
|
|
12280
|
-
import { z as
|
|
12482
|
+
import { z as z21 } from "zod";
|
|
12281
12483
|
var AutonomyLevelSchema, RootGrantsSchema, INITIAL_AUTO_ROOT_GRANTS;
|
|
12282
12484
|
var init_root_agent = __esm({
|
|
12283
12485
|
"../../packages/shared/src/root-agent.ts"() {
|
|
12284
12486
|
"use strict";
|
|
12285
|
-
AutonomyLevelSchema =
|
|
12286
|
-
RootGrantsSchema =
|
|
12287
|
-
createAgent:
|
|
12288
|
-
updateAgent:
|
|
12289
|
-
attachAgent:
|
|
12290
|
-
createSkill:
|
|
12291
|
-
updateSkill:
|
|
12292
|
-
assignSkill:
|
|
12293
|
-
createMcp:
|
|
12294
|
-
attachMcp:
|
|
12295
|
-
createConnector:
|
|
12296
|
-
attachConnector:
|
|
12297
|
-
manageSchedules:
|
|
12487
|
+
AutonomyLevelSchema = z21.enum(["propose_confirm", "destructive_gate", "fully_autonomous"]);
|
|
12488
|
+
RootGrantsSchema = z21.object({
|
|
12489
|
+
createAgent: z21.boolean(),
|
|
12490
|
+
updateAgent: z21.boolean(),
|
|
12491
|
+
attachAgent: z21.boolean(),
|
|
12492
|
+
createSkill: z21.boolean(),
|
|
12493
|
+
updateSkill: z21.boolean(),
|
|
12494
|
+
assignSkill: z21.boolean(),
|
|
12495
|
+
createMcp: z21.boolean(),
|
|
12496
|
+
attachMcp: z21.boolean(),
|
|
12497
|
+
createConnector: z21.boolean(),
|
|
12498
|
+
attachConnector: z21.boolean(),
|
|
12499
|
+
manageSchedules: z21.boolean(),
|
|
12298
12500
|
autonomy: AutonomyLevelSchema
|
|
12299
12501
|
});
|
|
12300
12502
|
INITIAL_AUTO_ROOT_GRANTS = {
|
|
@@ -12405,7 +12607,11 @@ var init_model_catalog = __esm({
|
|
|
12405
12607
|
}
|
|
12406
12608
|
},
|
|
12407
12609
|
contextWindow: 1048576,
|
|
12408
|
-
pricing: {
|
|
12610
|
+
pricing: {
|
|
12611
|
+
inputPerMillionUsd: 0.3,
|
|
12612
|
+
outputPerMillionUsd: 1.2,
|
|
12613
|
+
cacheReadPerMillionUsd: 0.06
|
|
12614
|
+
}
|
|
12409
12615
|
},
|
|
12410
12616
|
{
|
|
12411
12617
|
modelId: "MiniMax-M2.7",
|
|
@@ -12413,7 +12619,11 @@ var init_model_catalog = __esm({
|
|
|
12413
12619
|
// Latest M2-series — non-reasoning per MiniMax docs.
|
|
12414
12620
|
capabilities: { tools: true, forcedToolChoice: false },
|
|
12415
12621
|
contextWindow: 2e5,
|
|
12416
|
-
pricing: {
|
|
12622
|
+
pricing: {
|
|
12623
|
+
inputPerMillionUsd: 0.3,
|
|
12624
|
+
outputPerMillionUsd: 1.2,
|
|
12625
|
+
cacheReadPerMillionUsd: 0.06
|
|
12626
|
+
}
|
|
12417
12627
|
},
|
|
12418
12628
|
{
|
|
12419
12629
|
modelId: "MiniMax-M2",
|
|
@@ -12421,7 +12631,10 @@ var init_model_catalog = __esm({
|
|
|
12421
12631
|
// Stable previous-generation baseline — non-reasoning.
|
|
12422
12632
|
capabilities: { tools: true, forcedToolChoice: false },
|
|
12423
12633
|
contextWindow: 2e5,
|
|
12424
|
-
pricing: {
|
|
12634
|
+
pricing: {
|
|
12635
|
+
inputPerMillionUsd: 0.255,
|
|
12636
|
+
outputPerMillionUsd: 1.02
|
|
12637
|
+
}
|
|
12425
12638
|
}
|
|
12426
12639
|
],
|
|
12427
12640
|
// ─── Native Moonshot / Kimi (api.moonshot.ai/v1) ────────────────────────────
|
|
@@ -12449,7 +12662,11 @@ var init_model_catalog = __esm({
|
|
|
12449
12662
|
reasoningControl: { kind: "onoff", mandatory: true }
|
|
12450
12663
|
},
|
|
12451
12664
|
contextWindow: 262144,
|
|
12452
|
-
pricing: {
|
|
12665
|
+
pricing: {
|
|
12666
|
+
inputPerMillionUsd: 0.95,
|
|
12667
|
+
outputPerMillionUsd: 4,
|
|
12668
|
+
cacheReadPerMillionUsd: 0.16
|
|
12669
|
+
}
|
|
12453
12670
|
},
|
|
12454
12671
|
{
|
|
12455
12672
|
modelId: "kimi-k2.7-code",
|
|
@@ -12461,7 +12678,11 @@ var init_model_catalog = __esm({
|
|
|
12461
12678
|
reasoningControl: { kind: "onoff", mandatory: true }
|
|
12462
12679
|
},
|
|
12463
12680
|
contextWindow: 262144,
|
|
12464
|
-
pricing: {
|
|
12681
|
+
pricing: {
|
|
12682
|
+
inputPerMillionUsd: 0.7,
|
|
12683
|
+
outputPerMillionUsd: 3.5,
|
|
12684
|
+
cacheReadPerMillionUsd: 0.18
|
|
12685
|
+
}
|
|
12465
12686
|
},
|
|
12466
12687
|
{
|
|
12467
12688
|
modelId: "kimi-k3",
|
|
@@ -12480,7 +12701,11 @@ var init_model_catalog = __esm({
|
|
|
12480
12701
|
reasoningControl: { kind: "effort", levels: ["max"], mandatory: true }
|
|
12481
12702
|
},
|
|
12482
12703
|
contextWindow: 1048576,
|
|
12483
|
-
pricing: {
|
|
12704
|
+
pricing: {
|
|
12705
|
+
inputPerMillionUsd: 3,
|
|
12706
|
+
outputPerMillionUsd: 15,
|
|
12707
|
+
cacheReadPerMillionUsd: 0.3
|
|
12708
|
+
}
|
|
12484
12709
|
}
|
|
12485
12710
|
],
|
|
12486
12711
|
// Anthropic — every current Claude supports extended thinking. Auto (no
|
|
@@ -12502,7 +12727,12 @@ var init_model_catalog = __esm({
|
|
|
12502
12727
|
reasoningControl: { kind: "adaptive-effort", levels: ["low", "medium", "high", "max"] }
|
|
12503
12728
|
},
|
|
12504
12729
|
contextWindow: 1e6,
|
|
12505
|
-
pricing: {
|
|
12730
|
+
pricing: {
|
|
12731
|
+
inputPerMillionUsd: 5,
|
|
12732
|
+
outputPerMillionUsd: 25,
|
|
12733
|
+
cacheReadPerMillionUsd: 0.5,
|
|
12734
|
+
cacheWritePerMillionUsd: 6.25
|
|
12735
|
+
}
|
|
12506
12736
|
},
|
|
12507
12737
|
{
|
|
12508
12738
|
modelId: "claude-sonnet-5",
|
|
@@ -12514,7 +12744,12 @@ var init_model_catalog = __esm({
|
|
|
12514
12744
|
reasoningControl: { kind: "adaptive-effort", levels: ["low", "medium", "high", "max"] }
|
|
12515
12745
|
},
|
|
12516
12746
|
contextWindow: 1e6,
|
|
12517
|
-
pricing: {
|
|
12747
|
+
pricing: {
|
|
12748
|
+
inputPerMillionUsd: 2,
|
|
12749
|
+
outputPerMillionUsd: 10,
|
|
12750
|
+
cacheReadPerMillionUsd: 0.2,
|
|
12751
|
+
cacheWritePerMillionUsd: 2.5
|
|
12752
|
+
}
|
|
12518
12753
|
},
|
|
12519
12754
|
{
|
|
12520
12755
|
modelId: "claude-fable-5",
|
|
@@ -12526,7 +12761,12 @@ var init_model_catalog = __esm({
|
|
|
12526
12761
|
reasoningControl: { kind: "adaptive-effort", levels: ["low", "medium", "high", "max"] }
|
|
12527
12762
|
},
|
|
12528
12763
|
contextWindow: 1e6,
|
|
12529
|
-
pricing: {
|
|
12764
|
+
pricing: {
|
|
12765
|
+
inputPerMillionUsd: 10,
|
|
12766
|
+
outputPerMillionUsd: 50,
|
|
12767
|
+
cacheReadPerMillionUsd: 1,
|
|
12768
|
+
cacheWritePerMillionUsd: 12.5
|
|
12769
|
+
}
|
|
12530
12770
|
},
|
|
12531
12771
|
{
|
|
12532
12772
|
modelId: "claude-opus-4-8",
|
|
@@ -12538,7 +12778,12 @@ var init_model_catalog = __esm({
|
|
|
12538
12778
|
reasoningControl: { kind: "adaptive-effort", levels: ["low", "medium", "high", "max"] }
|
|
12539
12779
|
},
|
|
12540
12780
|
contextWindow: 2e5,
|
|
12541
|
-
pricing: {
|
|
12781
|
+
pricing: {
|
|
12782
|
+
inputPerMillionUsd: 5,
|
|
12783
|
+
outputPerMillionUsd: 25,
|
|
12784
|
+
cacheReadPerMillionUsd: 0.5,
|
|
12785
|
+
cacheWritePerMillionUsd: 6.25
|
|
12786
|
+
}
|
|
12542
12787
|
},
|
|
12543
12788
|
{
|
|
12544
12789
|
modelId: "claude-sonnet-4-6",
|
|
@@ -12550,7 +12795,12 @@ var init_model_catalog = __esm({
|
|
|
12550
12795
|
reasoningControl: { kind: "adaptive-effort", levels: ["low", "medium", "high", "max"] }
|
|
12551
12796
|
},
|
|
12552
12797
|
contextWindow: 2e5,
|
|
12553
|
-
pricing: {
|
|
12798
|
+
pricing: {
|
|
12799
|
+
inputPerMillionUsd: 3,
|
|
12800
|
+
outputPerMillionUsd: 15,
|
|
12801
|
+
cacheReadPerMillionUsd: 0.3,
|
|
12802
|
+
cacheWritePerMillionUsd: 3.75
|
|
12803
|
+
}
|
|
12554
12804
|
},
|
|
12555
12805
|
{
|
|
12556
12806
|
modelId: "claude-haiku-4-5-20251001",
|
|
@@ -12565,7 +12815,12 @@ var init_model_catalog = __esm({
|
|
|
12565
12815
|
}
|
|
12566
12816
|
},
|
|
12567
12817
|
contextWindow: 2e5,
|
|
12568
|
-
pricing: {
|
|
12818
|
+
pricing: {
|
|
12819
|
+
inputPerMillionUsd: 1,
|
|
12820
|
+
outputPerMillionUsd: 5,
|
|
12821
|
+
cacheReadPerMillionUsd: 0.1,
|
|
12822
|
+
cacheWritePerMillionUsd: 1.25
|
|
12823
|
+
}
|
|
12569
12824
|
}
|
|
12570
12825
|
],
|
|
12571
12826
|
// OpenAI — GPT-5 line takes `reasoning_effort`. Auto = today's behavior
|
|
@@ -12582,7 +12837,11 @@ var init_model_catalog = __esm({
|
|
|
12582
12837
|
reasoningControl: { kind: "effort", levels: ["low", "medium", "high"], mandatory: true }
|
|
12583
12838
|
},
|
|
12584
12839
|
contextWindow: 4e5,
|
|
12585
|
-
pricing: {
|
|
12840
|
+
pricing: {
|
|
12841
|
+
inputPerMillionUsd: 1.25,
|
|
12842
|
+
outputPerMillionUsd: 10,
|
|
12843
|
+
cacheReadPerMillionUsd: 0.125
|
|
12844
|
+
}
|
|
12586
12845
|
},
|
|
12587
12846
|
{
|
|
12588
12847
|
modelId: "gpt-5-mini",
|
|
@@ -12594,7 +12853,11 @@ var init_model_catalog = __esm({
|
|
|
12594
12853
|
reasoningControl: { kind: "effort", levels: ["low", "medium", "high"], mandatory: true }
|
|
12595
12854
|
},
|
|
12596
12855
|
contextWindow: 4e5,
|
|
12597
|
-
pricing: {
|
|
12856
|
+
pricing: {
|
|
12857
|
+
inputPerMillionUsd: 0.25,
|
|
12858
|
+
outputPerMillionUsd: 2,
|
|
12859
|
+
cacheReadPerMillionUsd: 0.025
|
|
12860
|
+
}
|
|
12598
12861
|
}
|
|
12599
12862
|
],
|
|
12600
12863
|
// ─── Native Google (generativelanguage.googleapis.com) ──────────────────────
|
|
@@ -12634,7 +12897,12 @@ var init_model_catalog = __esm({
|
|
|
12634
12897
|
reasoningControl: { kind: "effort", levels: ["low", "medium", "high"], mandatory: true }
|
|
12635
12898
|
},
|
|
12636
12899
|
contextWindow: 1048576,
|
|
12637
|
-
pricing: {
|
|
12900
|
+
pricing: {
|
|
12901
|
+
inputPerMillionUsd: 0.75,
|
|
12902
|
+
outputPerMillionUsd: 3.75,
|
|
12903
|
+
cacheReadPerMillionUsd: 0.075,
|
|
12904
|
+
cacheWritePerMillionUsd: 0.0416667
|
|
12905
|
+
}
|
|
12638
12906
|
},
|
|
12639
12907
|
{
|
|
12640
12908
|
modelId: "gemini-3.5-flash",
|
|
@@ -12646,7 +12914,12 @@ var init_model_catalog = __esm({
|
|
|
12646
12914
|
reasoningControl: { kind: "effort", levels: ["low", "medium", "high"], mandatory: true }
|
|
12647
12915
|
},
|
|
12648
12916
|
contextWindow: 1048576,
|
|
12649
|
-
pricing: {
|
|
12917
|
+
pricing: {
|
|
12918
|
+
inputPerMillionUsd: 1.5,
|
|
12919
|
+
outputPerMillionUsd: 9,
|
|
12920
|
+
cacheReadPerMillionUsd: 0.15,
|
|
12921
|
+
cacheWritePerMillionUsd: 0.0833333
|
|
12922
|
+
}
|
|
12650
12923
|
},
|
|
12651
12924
|
{
|
|
12652
12925
|
modelId: "gemini-3.1-pro-preview",
|
|
@@ -12658,7 +12931,12 @@ var init_model_catalog = __esm({
|
|
|
12658
12931
|
reasoningControl: { kind: "effort", levels: ["low", "medium", "high"], mandatory: true }
|
|
12659
12932
|
},
|
|
12660
12933
|
contextWindow: 1048576,
|
|
12661
|
-
pricing: {
|
|
12934
|
+
pricing: {
|
|
12935
|
+
inputPerMillionUsd: 2,
|
|
12936
|
+
outputPerMillionUsd: 12,
|
|
12937
|
+
cacheReadPerMillionUsd: 0.2,
|
|
12938
|
+
cacheWritePerMillionUsd: 0.375
|
|
12939
|
+
}
|
|
12662
12940
|
}
|
|
12663
12941
|
],
|
|
12664
12942
|
// The two entries below are the catalog's only remaining unpriced models, and
|
|
@@ -12706,7 +12984,12 @@ var init_model_catalog = __esm({
|
|
|
12706
12984
|
reasoningControl: { kind: "effort", levels: ["low", "medium", "high", "max"] }
|
|
12707
12985
|
},
|
|
12708
12986
|
contextWindow: 1e6,
|
|
12709
|
-
pricing: {
|
|
12987
|
+
pricing: {
|
|
12988
|
+
inputPerMillionUsd: 5,
|
|
12989
|
+
outputPerMillionUsd: 25,
|
|
12990
|
+
cacheReadPerMillionUsd: 0.5,
|
|
12991
|
+
cacheWritePerMillionUsd: 6.25
|
|
12992
|
+
}
|
|
12710
12993
|
},
|
|
12711
12994
|
{
|
|
12712
12995
|
modelId: "anthropic/claude-opus-5-fast",
|
|
@@ -12728,7 +13011,12 @@ var init_model_catalog = __esm({
|
|
|
12728
13011
|
reasoningControl: { kind: "effort", levels: ["low", "medium", "high", "max"] }
|
|
12729
13012
|
},
|
|
12730
13013
|
contextWindow: 1e6,
|
|
12731
|
-
pricing: {
|
|
13014
|
+
pricing: {
|
|
13015
|
+
inputPerMillionUsd: 2,
|
|
13016
|
+
outputPerMillionUsd: 10,
|
|
13017
|
+
cacheReadPerMillionUsd: 0.2,
|
|
13018
|
+
cacheWritePerMillionUsd: 2.5
|
|
13019
|
+
}
|
|
12732
13020
|
},
|
|
12733
13021
|
{
|
|
12734
13022
|
modelId: "anthropic/claude-fable-5",
|
|
@@ -12739,7 +13027,12 @@ var init_model_catalog = __esm({
|
|
|
12739
13027
|
reasoningControl: { kind: "effort", levels: ["low", "medium", "high", "max"] }
|
|
12740
13028
|
},
|
|
12741
13029
|
contextWindow: 1e6,
|
|
12742
|
-
pricing: {
|
|
13030
|
+
pricing: {
|
|
13031
|
+
inputPerMillionUsd: 10,
|
|
13032
|
+
outputPerMillionUsd: 50,
|
|
13033
|
+
cacheReadPerMillionUsd: 1,
|
|
13034
|
+
cacheWritePerMillionUsd: 12.5
|
|
13035
|
+
}
|
|
12743
13036
|
},
|
|
12744
13037
|
// ─── OpenAI ───────────────────────────────────────────────────────────────
|
|
12745
13038
|
// OpenAI was absent from the OpenRouter list entirely — not a curation
|
|
@@ -12754,7 +13047,12 @@ var init_model_catalog = __esm({
|
|
|
12754
13047
|
reasoningControl: { kind: "effort", levels: ["low", "medium", "high", "max"] }
|
|
12755
13048
|
},
|
|
12756
13049
|
contextWindow: 105e4,
|
|
12757
|
-
pricing: {
|
|
13050
|
+
pricing: {
|
|
13051
|
+
inputPerMillionUsd: 0.2,
|
|
13052
|
+
outputPerMillionUsd: 1.2,
|
|
13053
|
+
cacheReadPerMillionUsd: 0.02,
|
|
13054
|
+
cacheWritePerMillionUsd: 0.25
|
|
13055
|
+
}
|
|
12758
13056
|
},
|
|
12759
13057
|
{
|
|
12760
13058
|
modelId: "openai/gpt-5.6-luna-pro",
|
|
@@ -12765,7 +13063,12 @@ var init_model_catalog = __esm({
|
|
|
12765
13063
|
reasoningControl: { kind: "effort", levels: ["low", "medium", "high", "max"] }
|
|
12766
13064
|
},
|
|
12767
13065
|
contextWindow: 105e4,
|
|
12768
|
-
pricing: {
|
|
13066
|
+
pricing: {
|
|
13067
|
+
inputPerMillionUsd: 0.2,
|
|
13068
|
+
outputPerMillionUsd: 1.2,
|
|
13069
|
+
cacheReadPerMillionUsd: 0.02,
|
|
13070
|
+
cacheWritePerMillionUsd: 0.25
|
|
13071
|
+
}
|
|
12769
13072
|
},
|
|
12770
13073
|
{
|
|
12771
13074
|
modelId: "openai/gpt-5.6-terra-pro",
|
|
@@ -12776,7 +13079,12 @@ var init_model_catalog = __esm({
|
|
|
12776
13079
|
reasoningControl: { kind: "effort", levels: ["low", "medium", "high", "max"] }
|
|
12777
13080
|
},
|
|
12778
13081
|
contextWindow: 105e4,
|
|
12779
|
-
pricing: {
|
|
13082
|
+
pricing: {
|
|
13083
|
+
inputPerMillionUsd: 2,
|
|
13084
|
+
outputPerMillionUsd: 12,
|
|
13085
|
+
cacheReadPerMillionUsd: 0.2,
|
|
13086
|
+
cacheWritePerMillionUsd: 2.5
|
|
13087
|
+
}
|
|
12780
13088
|
},
|
|
12781
13089
|
// Anthropic — reasoningControl WITHOUT the `reasoning` flag, on purpose:
|
|
12782
13090
|
// the flag would flip openrouter.ts's always-on default injection; here
|
|
@@ -12791,7 +13099,12 @@ var init_model_catalog = __esm({
|
|
|
12791
13099
|
reasoningControl: { kind: "effort", levels: ["low", "medium", "high", "max"] }
|
|
12792
13100
|
},
|
|
12793
13101
|
contextWindow: 2e5,
|
|
12794
|
-
pricing: {
|
|
13102
|
+
pricing: {
|
|
13103
|
+
inputPerMillionUsd: 1,
|
|
13104
|
+
outputPerMillionUsd: 5,
|
|
13105
|
+
cacheReadPerMillionUsd: 0.1,
|
|
13106
|
+
cacheWritePerMillionUsd: 1.25
|
|
13107
|
+
}
|
|
12795
13108
|
},
|
|
12796
13109
|
{
|
|
12797
13110
|
modelId: "anthropic/claude-opus-4.7",
|
|
@@ -12802,7 +13115,12 @@ var init_model_catalog = __esm({
|
|
|
12802
13115
|
reasoningControl: { kind: "effort", levels: ["low", "medium", "high", "max"] }
|
|
12803
13116
|
},
|
|
12804
13117
|
contextWindow: 1e6,
|
|
12805
|
-
pricing: {
|
|
13118
|
+
pricing: {
|
|
13119
|
+
inputPerMillionUsd: 5,
|
|
13120
|
+
outputPerMillionUsd: 25,
|
|
13121
|
+
cacheReadPerMillionUsd: 0.5,
|
|
13122
|
+
cacheWritePerMillionUsd: 6.25
|
|
13123
|
+
}
|
|
12806
13124
|
},
|
|
12807
13125
|
{
|
|
12808
13126
|
modelId: "anthropic/claude-opus-4.7-fast",
|
|
@@ -12824,7 +13142,12 @@ var init_model_catalog = __esm({
|
|
|
12824
13142
|
reasoningControl: { kind: "effort", levels: ["low", "medium", "high", "max"] }
|
|
12825
13143
|
},
|
|
12826
13144
|
contextWindow: 1e6,
|
|
12827
|
-
pricing: {
|
|
13145
|
+
pricing: {
|
|
13146
|
+
inputPerMillionUsd: 5,
|
|
13147
|
+
outputPerMillionUsd: 25,
|
|
13148
|
+
cacheReadPerMillionUsd: 0.5,
|
|
13149
|
+
cacheWritePerMillionUsd: 6.25
|
|
13150
|
+
}
|
|
12828
13151
|
},
|
|
12829
13152
|
{
|
|
12830
13153
|
modelId: "anthropic/claude-opus-4.8-fast",
|
|
@@ -12846,7 +13169,12 @@ var init_model_catalog = __esm({
|
|
|
12846
13169
|
reasoningControl: { kind: "effort", levels: ["low", "medium", "high", "max"] }
|
|
12847
13170
|
},
|
|
12848
13171
|
contextWindow: 1e6,
|
|
12849
|
-
pricing: {
|
|
13172
|
+
pricing: {
|
|
13173
|
+
inputPerMillionUsd: 3,
|
|
13174
|
+
outputPerMillionUsd: 15,
|
|
13175
|
+
cacheReadPerMillionUsd: 0.3,
|
|
13176
|
+
cacheWritePerMillionUsd: 3.75
|
|
13177
|
+
}
|
|
12850
13178
|
},
|
|
12851
13179
|
// DeepSeek
|
|
12852
13180
|
{
|
|
@@ -12854,7 +13182,11 @@ var init_model_catalog = __esm({
|
|
|
12854
13182
|
label: "DeepSeek V3.2",
|
|
12855
13183
|
capabilities: { tools: true, forcedToolChoice: true },
|
|
12856
13184
|
contextWindow: 131072,
|
|
12857
|
-
pricing: {
|
|
13185
|
+
pricing: {
|
|
13186
|
+
inputPerMillionUsd: 0.269,
|
|
13187
|
+
outputPerMillionUsd: 0.4,
|
|
13188
|
+
cacheReadPerMillionUsd: 0.1345
|
|
13189
|
+
}
|
|
12858
13190
|
},
|
|
12859
13191
|
{
|
|
12860
13192
|
modelId: "deepseek/deepseek-v4-flash",
|
|
@@ -12873,7 +13205,11 @@ var init_model_catalog = __esm({
|
|
|
12873
13205
|
},
|
|
12874
13206
|
contextWindow: 1048576,
|
|
12875
13207
|
providerOrder: ["deepseek"],
|
|
12876
|
-
pricing: {
|
|
13208
|
+
pricing: {
|
|
13209
|
+
inputPerMillionUsd: 0.08246,
|
|
13210
|
+
outputPerMillionUsd: 0.16492,
|
|
13211
|
+
cacheReadPerMillionUsd: 0.016492
|
|
13212
|
+
}
|
|
12877
13213
|
},
|
|
12878
13214
|
{
|
|
12879
13215
|
// Dated snapshot of V4 Flash, and currently the cheapest tool-capable
|
|
@@ -12888,7 +13224,11 @@ var init_model_catalog = __esm({
|
|
|
12888
13224
|
reasoningControl: { kind: "effort", levels: ["low", "medium", "high", "max"] }
|
|
12889
13225
|
},
|
|
12890
13226
|
contextWindow: 1048576,
|
|
12891
|
-
pricing: {
|
|
13227
|
+
pricing: {
|
|
13228
|
+
inputPerMillionUsd: 0.065,
|
|
13229
|
+
outputPerMillionUsd: 0.18,
|
|
13230
|
+
cacheReadPerMillionUsd: 0.016
|
|
13231
|
+
},
|
|
12892
13232
|
providerOrder: ["deepseek"]
|
|
12893
13233
|
},
|
|
12894
13234
|
{
|
|
@@ -12904,7 +13244,11 @@ var init_model_catalog = __esm({
|
|
|
12904
13244
|
},
|
|
12905
13245
|
contextWindow: 1048576,
|
|
12906
13246
|
providerOrder: ["deepseek"],
|
|
12907
|
-
pricing: {
|
|
13247
|
+
pricing: {
|
|
13248
|
+
inputPerMillionUsd: 0.778824,
|
|
13249
|
+
outputPerMillionUsd: 1.55765,
|
|
13250
|
+
cacheReadPerMillionUsd: 0.064902
|
|
13251
|
+
}
|
|
12908
13252
|
},
|
|
12909
13253
|
// Google — all three are thinking models on OpenRouter (supported_parameters
|
|
12910
13254
|
// includes "reasoning", verified via openrouter.ai/google/… 2026-07-12).
|
|
@@ -12926,7 +13270,12 @@ var init_model_catalog = __esm({
|
|
|
12926
13270
|
reasoningControl: { kind: "effort", levels: ["low", "medium", "high", "max"] }
|
|
12927
13271
|
},
|
|
12928
13272
|
contextWindow: 1048576,
|
|
12929
|
-
pricing: {
|
|
13273
|
+
pricing: {
|
|
13274
|
+
inputPerMillionUsd: 0.25,
|
|
13275
|
+
outputPerMillionUsd: 1.5,
|
|
13276
|
+
cacheReadPerMillionUsd: 0.025,
|
|
13277
|
+
cacheWritePerMillionUsd: 0.0833333
|
|
13278
|
+
}
|
|
12930
13279
|
},
|
|
12931
13280
|
{
|
|
12932
13281
|
modelId: "google/gemini-3.1-pro-preview",
|
|
@@ -12940,7 +13289,12 @@ var init_model_catalog = __esm({
|
|
|
12940
13289
|
reasoningControl: { kind: "effort", levels: ["low", "medium", "high", "max"] }
|
|
12941
13290
|
},
|
|
12942
13291
|
contextWindow: 1048576,
|
|
12943
|
-
pricing: {
|
|
13292
|
+
pricing: {
|
|
13293
|
+
inputPerMillionUsd: 2,
|
|
13294
|
+
outputPerMillionUsd: 12,
|
|
13295
|
+
cacheReadPerMillionUsd: 0.2,
|
|
13296
|
+
cacheWritePerMillionUsd: 0.375
|
|
13297
|
+
}
|
|
12944
13298
|
},
|
|
12945
13299
|
{
|
|
12946
13300
|
modelId: "google/gemini-3.5-flash",
|
|
@@ -12954,7 +13308,12 @@ var init_model_catalog = __esm({
|
|
|
12954
13308
|
reasoningControl: { kind: "effort", levels: ["low", "medium", "high", "max"] }
|
|
12955
13309
|
},
|
|
12956
13310
|
contextWindow: 1048576,
|
|
12957
|
-
pricing: {
|
|
13311
|
+
pricing: {
|
|
13312
|
+
inputPerMillionUsd: 1.5,
|
|
13313
|
+
outputPerMillionUsd: 9,
|
|
13314
|
+
cacheReadPerMillionUsd: 0.15,
|
|
13315
|
+
cacheWritePerMillionUsd: 0.0833333
|
|
13316
|
+
}
|
|
12958
13317
|
},
|
|
12959
13318
|
{
|
|
12960
13319
|
// Price corrected 2026-08-22 from GET /api/v1/models (0.00000075 /
|
|
@@ -12985,7 +13344,12 @@ var init_model_catalog = __esm({
|
|
|
12985
13344
|
reasoningControl: { kind: "effort", levels: ["low", "medium", "high"], mandatory: true }
|
|
12986
13345
|
},
|
|
12987
13346
|
contextWindow: 1048576,
|
|
12988
|
-
pricing: {
|
|
13347
|
+
pricing: {
|
|
13348
|
+
inputPerMillionUsd: 0.75,
|
|
13349
|
+
outputPerMillionUsd: 3.75,
|
|
13350
|
+
cacheReadPerMillionUsd: 0.075,
|
|
13351
|
+
cacheWritePerMillionUsd: 0.0416667
|
|
13352
|
+
}
|
|
12989
13353
|
},
|
|
12990
13354
|
{
|
|
12991
13355
|
// The OpenRouter twin of the native entry above. forcedToolChoice stays
|
|
@@ -13014,14 +13378,23 @@ var init_model_catalog = __esm({
|
|
|
13014
13378
|
reasoningControl: { kind: "effort", levels: ["low", "medium", "high"], mandatory: true }
|
|
13015
13379
|
},
|
|
13016
13380
|
contextWindow: 1048576,
|
|
13017
|
-
pricing: {
|
|
13381
|
+
pricing: {
|
|
13382
|
+
inputPerMillionUsd: 0.75,
|
|
13383
|
+
outputPerMillionUsd: 3.75,
|
|
13384
|
+
cacheReadPerMillionUsd: 0.075,
|
|
13385
|
+
cacheWritePerMillionUsd: 0.0416667
|
|
13386
|
+
}
|
|
13018
13387
|
},
|
|
13019
13388
|
{
|
|
13020
13389
|
modelId: "google/gemma-4-31b-it",
|
|
13021
13390
|
label: "Gemma 4 31B-IT",
|
|
13022
13391
|
capabilities: { tools: true, forcedToolChoice: true },
|
|
13023
13392
|
contextWindow: 262144,
|
|
13024
|
-
pricing: {
|
|
13393
|
+
pricing: {
|
|
13394
|
+
inputPerMillionUsd: 0.09,
|
|
13395
|
+
outputPerMillionUsd: 0.34,
|
|
13396
|
+
cacheReadPerMillionUsd: 0.05
|
|
13397
|
+
}
|
|
13025
13398
|
},
|
|
13026
13399
|
// MiniMax
|
|
13027
13400
|
{
|
|
@@ -13038,7 +13411,11 @@ var init_model_catalog = __esm({
|
|
|
13038
13411
|
reasoningControl: { kind: "effort", levels: ["low", "medium", "high", "max"] }
|
|
13039
13412
|
},
|
|
13040
13413
|
contextWindow: 1048576,
|
|
13041
|
-
pricing: {
|
|
13414
|
+
pricing: {
|
|
13415
|
+
inputPerMillionUsd: 0.3,
|
|
13416
|
+
outputPerMillionUsd: 1.2,
|
|
13417
|
+
cacheReadPerMillionUsd: 0.06
|
|
13418
|
+
}
|
|
13042
13419
|
},
|
|
13043
13420
|
// Z.ai (GLM)
|
|
13044
13421
|
{
|
|
@@ -13061,7 +13438,11 @@ var init_model_catalog = __esm({
|
|
|
13061
13438
|
}
|
|
13062
13439
|
},
|
|
13063
13440
|
contextWindow: 1048576,
|
|
13064
|
-
pricing: {
|
|
13441
|
+
pricing: {
|
|
13442
|
+
inputPerMillionUsd: 0.966,
|
|
13443
|
+
outputPerMillionUsd: 3.036,
|
|
13444
|
+
cacheReadPerMillionUsd: 0.1932
|
|
13445
|
+
}
|
|
13065
13446
|
},
|
|
13066
13447
|
{
|
|
13067
13448
|
modelId: "z-ai/glm-5.3",
|
|
@@ -13083,7 +13464,11 @@ var init_model_catalog = __esm({
|
|
|
13083
13464
|
}
|
|
13084
13465
|
},
|
|
13085
13466
|
contextWindow: 1048576,
|
|
13086
|
-
pricing: {
|
|
13467
|
+
pricing: {
|
|
13468
|
+
inputPerMillionUsd: 1.4,
|
|
13469
|
+
outputPerMillionUsd: 4.4,
|
|
13470
|
+
cacheReadPerMillionUsd: 0.14
|
|
13471
|
+
}
|
|
13087
13472
|
},
|
|
13088
13473
|
{
|
|
13089
13474
|
modelId: "z-ai/glm-5.3-flash",
|
|
@@ -13110,7 +13495,11 @@ var init_model_catalog = __esm({
|
|
|
13110
13495
|
}
|
|
13111
13496
|
},
|
|
13112
13497
|
contextWindow: 1310720,
|
|
13113
|
-
pricing: {
|
|
13498
|
+
pricing: {
|
|
13499
|
+
inputPerMillionUsd: 0.075,
|
|
13500
|
+
outputPerMillionUsd: 0.25,
|
|
13501
|
+
cacheReadPerMillionUsd: 0.015
|
|
13502
|
+
}
|
|
13114
13503
|
},
|
|
13115
13504
|
// Moonshot (Kimi)
|
|
13116
13505
|
{
|
|
@@ -13135,7 +13524,11 @@ var init_model_catalog = __esm({
|
|
|
13135
13524
|
}
|
|
13136
13525
|
},
|
|
13137
13526
|
contextWindow: 262144,
|
|
13138
|
-
pricing: {
|
|
13527
|
+
pricing: {
|
|
13528
|
+
inputPerMillionUsd: 0.95,
|
|
13529
|
+
outputPerMillionUsd: 4,
|
|
13530
|
+
cacheReadPerMillionUsd: 0.16
|
|
13531
|
+
}
|
|
13139
13532
|
},
|
|
13140
13533
|
{
|
|
13141
13534
|
modelId: "moonshotai/kimi-k2.7-code",
|
|
@@ -13155,7 +13548,11 @@ var init_model_catalog = __esm({
|
|
|
13155
13548
|
}
|
|
13156
13549
|
},
|
|
13157
13550
|
contextWindow: 262144,
|
|
13158
|
-
pricing: {
|
|
13551
|
+
pricing: {
|
|
13552
|
+
inputPerMillionUsd: 0.66,
|
|
13553
|
+
outputPerMillionUsd: 3.4,
|
|
13554
|
+
cacheReadPerMillionUsd: 0.18
|
|
13555
|
+
}
|
|
13159
13556
|
},
|
|
13160
13557
|
// xAI — grok-4.5 verified via OpenRouter /api/v1/models (2026-07-20):
|
|
13161
13558
|
// 500K context, text+image, tools + tool_choice + reasoning params.
|
|
@@ -13176,7 +13573,11 @@ var init_model_catalog = __esm({
|
|
|
13176
13573
|
}
|
|
13177
13574
|
},
|
|
13178
13575
|
contextWindow: 5e5,
|
|
13179
|
-
pricing: {
|
|
13576
|
+
pricing: {
|
|
13577
|
+
inputPerMillionUsd: 2,
|
|
13578
|
+
outputPerMillionUsd: 6,
|
|
13579
|
+
cacheReadPerMillionUsd: 0.3
|
|
13580
|
+
}
|
|
13180
13581
|
},
|
|
13181
13582
|
// Qwen — both verified via OpenRouter /api/v1/models (2026-07-20): 1M
|
|
13182
13583
|
// context, tools + tool_choice + reasoning params (no native
|
|
@@ -13206,7 +13607,12 @@ var init_model_catalog = __esm({
|
|
|
13206
13607
|
reasoningControl: { kind: "effort", levels: ["low", "medium", "high", "max"] }
|
|
13207
13608
|
},
|
|
13208
13609
|
contextWindow: 1048576,
|
|
13209
|
-
pricing: {
|
|
13610
|
+
pricing: {
|
|
13611
|
+
inputPerMillionUsd: 1.475,
|
|
13612
|
+
outputPerMillionUsd: 4.425,
|
|
13613
|
+
cacheReadPerMillionUsd: 0.295,
|
|
13614
|
+
cacheWritePerMillionUsd: 1.84375
|
|
13615
|
+
}
|
|
13210
13616
|
},
|
|
13211
13617
|
{
|
|
13212
13618
|
modelId: "qwen/qwen3.7-plus",
|
|
@@ -13217,7 +13623,12 @@ var init_model_catalog = __esm({
|
|
|
13217
13623
|
reasoningControl: { kind: "effort", levels: ["low", "medium", "high", "max"] }
|
|
13218
13624
|
},
|
|
13219
13625
|
contextWindow: 1048576,
|
|
13220
|
-
pricing: {
|
|
13626
|
+
pricing: {
|
|
13627
|
+
inputPerMillionUsd: 0.32,
|
|
13628
|
+
outputPerMillionUsd: 1.28,
|
|
13629
|
+
cacheReadPerMillionUsd: 0.064,
|
|
13630
|
+
cacheWritePerMillionUsd: 0.4
|
|
13631
|
+
}
|
|
13221
13632
|
},
|
|
13222
13633
|
{
|
|
13223
13634
|
modelId: "moonshotai/kimi-k3",
|
|
@@ -13239,7 +13650,11 @@ var init_model_catalog = __esm({
|
|
|
13239
13650
|
}
|
|
13240
13651
|
},
|
|
13241
13652
|
contextWindow: 1048576,
|
|
13242
|
-
pricing: {
|
|
13653
|
+
pricing: {
|
|
13654
|
+
inputPerMillionUsd: 3,
|
|
13655
|
+
outputPerMillionUsd: 15,
|
|
13656
|
+
cacheReadPerMillionUsd: 0.3
|
|
13657
|
+
}
|
|
13243
13658
|
}
|
|
13244
13659
|
]
|
|
13245
13660
|
};
|
|
@@ -13361,24 +13776,252 @@ var init_redact_transcript = __esm({
|
|
|
13361
13776
|
});
|
|
13362
13777
|
|
|
13363
13778
|
// ../../packages/shared/src/agent-slug.ts
|
|
13364
|
-
import { z as
|
|
13779
|
+
import { z as z22 } from "zod";
|
|
13365
13780
|
var AGENT_SLUG_MAX, AgentSlugSchema;
|
|
13366
13781
|
var init_agent_slug = __esm({
|
|
13367
13782
|
"../../packages/shared/src/agent-slug.ts"() {
|
|
13368
13783
|
"use strict";
|
|
13369
13784
|
AGENT_SLUG_MAX = 80;
|
|
13370
|
-
AgentSlugSchema =
|
|
13785
|
+
AgentSlugSchema = z22.string().min(1).max(AGENT_SLUG_MAX).regex(
|
|
13371
13786
|
/^[a-z0-9][a-z0-9-]*$/,
|
|
13372
13787
|
"Slug must be lowercase alphanumeric with hyphens, and must not start with a hyphen."
|
|
13373
13788
|
);
|
|
13374
13789
|
}
|
|
13375
13790
|
});
|
|
13376
13791
|
|
|
13792
|
+
// ../../packages/shared/src/project-key.ts
|
|
13793
|
+
var init_project_key = __esm({
|
|
13794
|
+
"../../packages/shared/src/project-key.ts"() {
|
|
13795
|
+
"use strict";
|
|
13796
|
+
}
|
|
13797
|
+
});
|
|
13798
|
+
|
|
13799
|
+
// ../../packages/shared/src/group-prefix.ts
|
|
13800
|
+
var init_group_prefix = __esm({
|
|
13801
|
+
"../../packages/shared/src/group-prefix.ts"() {
|
|
13802
|
+
"use strict";
|
|
13803
|
+
}
|
|
13804
|
+
});
|
|
13805
|
+
|
|
13806
|
+
// ../../packages/shared/src/project-roots.ts
|
|
13807
|
+
var init_project_roots = __esm({
|
|
13808
|
+
"../../packages/shared/src/project-roots.ts"() {
|
|
13809
|
+
"use strict";
|
|
13810
|
+
init_project_key();
|
|
13811
|
+
}
|
|
13812
|
+
});
|
|
13813
|
+
|
|
13814
|
+
// ../../packages/shared/src/project-subfolder.ts
|
|
13815
|
+
var init_project_subfolder = __esm({
|
|
13816
|
+
"../../packages/shared/src/project-subfolder.ts"() {
|
|
13817
|
+
"use strict";
|
|
13818
|
+
init_project_key();
|
|
13819
|
+
}
|
|
13820
|
+
});
|
|
13821
|
+
|
|
13822
|
+
// ../../packages/shared/src/types/verification.ts
|
|
13823
|
+
import { z as z23 } from "zod";
|
|
13824
|
+
var DELIVERABLE_TYPES, DeliverableTypeSchema, DECISION_STATUSES, DecisionStatusSchema, ATOMIC_OUTCOMES, AtomicOutcomeSchema, RUN_VERDICTS, RunVerdictSchema, VerifyCommandSchema, VERIFY_COMMANDS_MAX, VerifyCommandsSchema;
|
|
13825
|
+
var init_verification = __esm({
|
|
13826
|
+
"../../packages/shared/src/types/verification.ts"() {
|
|
13827
|
+
"use strict";
|
|
13828
|
+
DELIVERABLE_TYPES = [
|
|
13829
|
+
"code_project",
|
|
13830
|
+
"office_file",
|
|
13831
|
+
"document",
|
|
13832
|
+
"outbound_action",
|
|
13833
|
+
"other"
|
|
13834
|
+
];
|
|
13835
|
+
DeliverableTypeSchema = z23.enum(DELIVERABLE_TYPES);
|
|
13836
|
+
DECISION_STATUSES = [
|
|
13837
|
+
"dirty",
|
|
13838
|
+
"green",
|
|
13839
|
+
"red",
|
|
13840
|
+
"pending_approval",
|
|
13841
|
+
"not_configured",
|
|
13842
|
+
"infra_error"
|
|
13843
|
+
];
|
|
13844
|
+
DecisionStatusSchema = z23.enum(DECISION_STATUSES);
|
|
13845
|
+
ATOMIC_OUTCOMES = [
|
|
13846
|
+
"prepared",
|
|
13847
|
+
"attempted",
|
|
13848
|
+
"confirmed",
|
|
13849
|
+
"rejected",
|
|
13850
|
+
"outcome_unknown"
|
|
13851
|
+
];
|
|
13852
|
+
AtomicOutcomeSchema = z23.enum(ATOMIC_OUTCOMES);
|
|
13853
|
+
RUN_VERDICTS = ["green", "red", "infra_error"];
|
|
13854
|
+
RunVerdictSchema = z23.enum(RUN_VERDICTS);
|
|
13855
|
+
VerifyCommandSchema = z23.object({
|
|
13856
|
+
command: z23.string().trim().min(1).max(2e3),
|
|
13857
|
+
timeoutSeconds: z23.number().int().min(1).max(3600)
|
|
13858
|
+
});
|
|
13859
|
+
VERIFY_COMMANDS_MAX = 5;
|
|
13860
|
+
VerifyCommandsSchema = z23.array(VerifyCommandSchema).min(1).max(VERIFY_COMMANDS_MAX);
|
|
13861
|
+
}
|
|
13862
|
+
});
|
|
13863
|
+
|
|
13864
|
+
// ../../packages/shared/src/verify-command-discovery.ts
|
|
13865
|
+
var init_verify_command_discovery = __esm({
|
|
13866
|
+
"../../packages/shared/src/verify-command-discovery.ts"() {
|
|
13867
|
+
"use strict";
|
|
13868
|
+
init_verification();
|
|
13869
|
+
}
|
|
13870
|
+
});
|
|
13871
|
+
|
|
13872
|
+
// ../../packages/shared/src/verification-manifest.ts
|
|
13873
|
+
var K;
|
|
13874
|
+
var init_verification_manifest = __esm({
|
|
13875
|
+
"../../packages/shared/src/verification-manifest.ts"() {
|
|
13876
|
+
"use strict";
|
|
13877
|
+
K = new Uint32Array([
|
|
13878
|
+
1116352408,
|
|
13879
|
+
1899447441,
|
|
13880
|
+
3049323471,
|
|
13881
|
+
3921009573,
|
|
13882
|
+
961987163,
|
|
13883
|
+
1508970993,
|
|
13884
|
+
2453635748,
|
|
13885
|
+
2870763221,
|
|
13886
|
+
3624381080,
|
|
13887
|
+
310598401,
|
|
13888
|
+
607225278,
|
|
13889
|
+
1426881987,
|
|
13890
|
+
1925078388,
|
|
13891
|
+
2162078206,
|
|
13892
|
+
2614888103,
|
|
13893
|
+
3248222580,
|
|
13894
|
+
3835390401,
|
|
13895
|
+
4022224774,
|
|
13896
|
+
264347078,
|
|
13897
|
+
604807628,
|
|
13898
|
+
770255983,
|
|
13899
|
+
1249150122,
|
|
13900
|
+
1555081692,
|
|
13901
|
+
1996064986,
|
|
13902
|
+
2554220882,
|
|
13903
|
+
2821834349,
|
|
13904
|
+
2952996808,
|
|
13905
|
+
3210313671,
|
|
13906
|
+
3336571891,
|
|
13907
|
+
3584528711,
|
|
13908
|
+
113926993,
|
|
13909
|
+
338241895,
|
|
13910
|
+
666307205,
|
|
13911
|
+
773529912,
|
|
13912
|
+
1294757372,
|
|
13913
|
+
1396182291,
|
|
13914
|
+
1695183700,
|
|
13915
|
+
1986661051,
|
|
13916
|
+
2177026350,
|
|
13917
|
+
2456956037,
|
|
13918
|
+
2730485921,
|
|
13919
|
+
2820302411,
|
|
13920
|
+
3259730800,
|
|
13921
|
+
3345764771,
|
|
13922
|
+
3516065817,
|
|
13923
|
+
3600352804,
|
|
13924
|
+
4094571909,
|
|
13925
|
+
275423344,
|
|
13926
|
+
430227734,
|
|
13927
|
+
506948616,
|
|
13928
|
+
659060556,
|
|
13929
|
+
883997877,
|
|
13930
|
+
958139571,
|
|
13931
|
+
1322822218,
|
|
13932
|
+
1537002063,
|
|
13933
|
+
1747873779,
|
|
13934
|
+
1955562222,
|
|
13935
|
+
2024104815,
|
|
13936
|
+
2227730452,
|
|
13937
|
+
2361852424,
|
|
13938
|
+
2428436474,
|
|
13939
|
+
2756734187,
|
|
13940
|
+
3204031479,
|
|
13941
|
+
3329325298
|
|
13942
|
+
]);
|
|
13943
|
+
}
|
|
13944
|
+
});
|
|
13945
|
+
|
|
13946
|
+
// ../../packages/shared/src/verification-surfaces.ts
|
|
13947
|
+
import { z as z24 } from "zod";
|
|
13948
|
+
function parseVerificationSurfaces(raw) {
|
|
13949
|
+
const strict = VerificationSurfacesSchema.safeParse(raw);
|
|
13950
|
+
if (strict.success) return strict.data;
|
|
13951
|
+
const src = raw !== null && typeof raw === "object" && !Array.isArray(raw) ? raw : {};
|
|
13952
|
+
const pick = (key) => typeof src[key] === "boolean" ? src[key] : DEFAULT_VERIFICATION_SURFACES[key];
|
|
13953
|
+
return {
|
|
13954
|
+
codeTask: pick("codeTask"),
|
|
13955
|
+
cliRuntime: pick("cliRuntime"),
|
|
13956
|
+
fileOps: pick("fileOps"),
|
|
13957
|
+
shell: pick("shell")
|
|
13958
|
+
};
|
|
13959
|
+
}
|
|
13960
|
+
var VerificationSurfacesSchema, DEFAULT_VERIFICATION_SURFACES, VERIFICATION_SURFACE_TOOLS;
|
|
13961
|
+
var init_verification_surfaces = __esm({
|
|
13962
|
+
"../../packages/shared/src/verification-surfaces.ts"() {
|
|
13963
|
+
"use strict";
|
|
13964
|
+
VerificationSurfacesSchema = z24.object({
|
|
13965
|
+
codeTask: z24.boolean(),
|
|
13966
|
+
cliRuntime: z24.boolean(),
|
|
13967
|
+
fileOps: z24.boolean(),
|
|
13968
|
+
shell: z24.boolean()
|
|
13969
|
+
});
|
|
13970
|
+
DEFAULT_VERIFICATION_SURFACES = Object.freeze({
|
|
13971
|
+
codeTask: true,
|
|
13972
|
+
cliRuntime: true,
|
|
13973
|
+
fileOps: true,
|
|
13974
|
+
shell: true
|
|
13975
|
+
});
|
|
13976
|
+
VERIFICATION_SURFACE_TOOLS = Object.freeze({
|
|
13977
|
+
codeTask: ["code_task"],
|
|
13978
|
+
cliRuntime: [],
|
|
13979
|
+
// Les outils Office ÉCRIVENT des fichiers du workspace (revue Codex PR #46 :
|
|
13980
|
+
// ils contournaient l'intention faute de marqueur) — ce sont des outils
|
|
13981
|
+
// fichiers, sur la même surface. Les lecteurs (`*_read`, `xlsx_find_cells`)
|
|
13982
|
+
// n'y sont pas : ils ne mutent rien.
|
|
13983
|
+
fileOps: [
|
|
13984
|
+
"file_write",
|
|
13985
|
+
"file_edit",
|
|
13986
|
+
"docx_create",
|
|
13987
|
+
"docx_append_paragraphs",
|
|
13988
|
+
"docx_replace_text",
|
|
13989
|
+
"pptx_create",
|
|
13990
|
+
"pptx_append_slides",
|
|
13991
|
+
"pptx_replace_text",
|
|
13992
|
+
"xlsx_set_cell",
|
|
13993
|
+
"xlsx_set_range",
|
|
13994
|
+
"xlsx_append_rows",
|
|
13995
|
+
"xlsx_add_sheet",
|
|
13996
|
+
"xlsx_create",
|
|
13997
|
+
"xlsx_delete_rows",
|
|
13998
|
+
"xlsx_format_range",
|
|
13999
|
+
"xlsx_insert_rows",
|
|
14000
|
+
"xlsx_insert_columns",
|
|
14001
|
+
"xlsx_delete_columns",
|
|
14002
|
+
"xlsx_merge_cells",
|
|
14003
|
+
"xlsx_unmerge_cells",
|
|
14004
|
+
"xlsx_set_column_widths",
|
|
14005
|
+
"xlsx_freeze_panes"
|
|
14006
|
+
],
|
|
14007
|
+
shell: ["run_command", "run_skill_script"]
|
|
14008
|
+
});
|
|
14009
|
+
}
|
|
14010
|
+
});
|
|
14011
|
+
|
|
14012
|
+
// ../../packages/shared/src/fragment-diff.ts
|
|
14013
|
+
var init_fragment_diff = __esm({
|
|
14014
|
+
"../../packages/shared/src/fragment-diff.ts"() {
|
|
14015
|
+
"use strict";
|
|
14016
|
+
}
|
|
14017
|
+
});
|
|
14018
|
+
|
|
13377
14019
|
// ../../packages/shared/src/index.ts
|
|
13378
14020
|
var init_src2 = __esm({
|
|
13379
14021
|
"../../packages/shared/src/index.ts"() {
|
|
13380
14022
|
"use strict";
|
|
13381
14023
|
init_enums();
|
|
14024
|
+
init_tool_cards();
|
|
13382
14025
|
init_ids();
|
|
13383
14026
|
init_entity2();
|
|
13384
14027
|
init_user();
|
|
@@ -13414,6 +14057,15 @@ var init_src2 = __esm({
|
|
|
13414
14057
|
init_redact_transcript();
|
|
13415
14058
|
init_agent_slug();
|
|
13416
14059
|
init_catastrophic_command();
|
|
14060
|
+
init_project_key();
|
|
14061
|
+
init_group_prefix();
|
|
14062
|
+
init_project_roots();
|
|
14063
|
+
init_project_subfolder();
|
|
14064
|
+
init_verify_command_discovery();
|
|
14065
|
+
init_verification();
|
|
14066
|
+
init_verification_manifest();
|
|
14067
|
+
init_verification_surfaces();
|
|
14068
|
+
init_fragment_diff();
|
|
13417
14069
|
}
|
|
13418
14070
|
});
|
|
13419
14071
|
|
|
@@ -13551,7 +14203,15 @@ var init_entities = __esm({
|
|
|
13551
14203
|
* installe. Verifie au demarrage du serveur ET a chaque appel — couper
|
|
13552
14204
|
* l'interrupteur coupe les clients deja connectes.
|
|
13553
14205
|
*/
|
|
13554
|
-
mcpServerEnabled: boolean("mcp_server_enabled").notNull().default(false)
|
|
14206
|
+
mcpServerEnabled: boolean("mcp_server_enabled").notNull().default(false),
|
|
14207
|
+
/**
|
|
14208
|
+
* Les surfaces sous vérification (D8, plan « Vérifier & Corriger »,
|
|
14209
|
+
* migration 0091) : jsonb lu par parseVerificationSurfaces() de
|
|
14210
|
+
* @nodal-agents/shared. `'{}'` est VOULU — le défaut « toutes activées »
|
|
14211
|
+
* vit dans le parseur, jamais deviné par un backfill (même leçon que
|
|
14212
|
+
* 0084 : un réglage est un geste, pas un état inventé).
|
|
14213
|
+
*/
|
|
14214
|
+
verificationSurfaces: jsonb("verification_surfaces").notNull().default(sql`'{}'::jsonb`)
|
|
13555
14215
|
},
|
|
13556
14216
|
(table) => [
|
|
13557
14217
|
uniqueIndex("entities_mcp_token_idx").on(table.mcpToken),
|
|
@@ -13878,15 +14538,23 @@ var init_jobs = __esm({
|
|
|
13878
14538
|
originalTask: text("original_task"),
|
|
13879
14539
|
chatId: text("chat_id"),
|
|
13880
14540
|
/**
|
|
13881
|
-
*
|
|
13882
|
-
*
|
|
13883
|
-
*
|
|
13884
|
-
*
|
|
13885
|
-
*
|
|
13886
|
-
*
|
|
13887
|
-
*
|
|
13888
|
-
*
|
|
13889
|
-
*
|
|
14541
|
+
* La conversation dont ce job est un tour (migration 0059, redéfinie par
|
|
14542
|
+
* 0094 — P6). Ce n'est plus un uuid frappé à la volée : depuis P6, la
|
|
14543
|
+
* valeur RÉFÉRENCE une ligne `conversations`, et l'identité d'un fil est
|
|
14544
|
+
* « une conversation par chat, jusqu'à ce que l'utilisateur en ouvre une
|
|
14545
|
+
* autre » (`/new` dans un canal, le « + » du dashboard) — plus la règle du
|
|
14546
|
+
* SILENCE de 4 h, qui ne survit que comme budget de relecture dans
|
|
14547
|
+
* thread-history.ts. Posée à la création par
|
|
14548
|
+
* apps/runner/src/job/conversation-id.ts ; les enfants (délégation,
|
|
14549
|
+
* task-board) héritent de la valeur de leur créateur ; rien d'autre ne la
|
|
14550
|
+
* mute après l'insert. NULL pour un job non conversationnel (cron,
|
|
14551
|
+
* webhook, sans parent).
|
|
14552
|
+
*
|
|
14553
|
+
* PAS DE CLÉ ÉTRANGÈRE, délibérément (0094) : 95 jobs de la base dev
|
|
14554
|
+
* portent un uuid dont la conversation a été supprimée par l'utilisateur,
|
|
14555
|
+
* et une FK les ramènerait à NULL — la page Runs perdrait le seul
|
|
14556
|
+
* regroupement que cette colonne sert à faire. L'identité vaut pour
|
|
14557
|
+
* l'avenir ; un ancien uuid orphelin reste tel quel.
|
|
13890
14558
|
*/
|
|
13891
14559
|
conversationId: uuid("conversation_id"),
|
|
13892
14560
|
/**
|
|
@@ -13971,6 +14639,39 @@ var init_jobs = __esm({
|
|
|
13971
14639
|
*/
|
|
13972
14640
|
lastFailedDelegationSlug: text("last_failed_delegation_slug"),
|
|
13973
14641
|
pendingDelegation: jsonb("pending_delegation"),
|
|
14642
|
+
/**
|
|
14643
|
+
* Marks a root job as being finalized RIGHT NOW by the delivery cron
|
|
14644
|
+
* (migration 0090, plan « Vérifier & Corriger »). Set at claim time (the
|
|
14645
|
+
* same instant the cron reserves the job for its finalization phase, in
|
|
14646
|
+
* place of the earlier read-then-write race), cleared when finalization
|
|
14647
|
+
* ends (success or failure). Lets a second concurrent tick recognize a
|
|
14648
|
+
* job already being finalized and skip it, instead of racing the first
|
|
14649
|
+
* tick to the terminal write. NULL outside a finalization window.
|
|
14650
|
+
*/
|
|
14651
|
+
finalizingAt: timestamp("finalizing_at", { withTimezone: true }),
|
|
14652
|
+
/**
|
|
14653
|
+
* La trace FIGÉE des surfaces décochées au moment où ce run a tourné (D8,
|
|
14654
|
+
* migration 0091) — un ensemble de clés VerificationSurfaceKey, chacune
|
|
14655
|
+
* appendée une fois par le helper d'intention. Le détail d'un run dit
|
|
14656
|
+
* « surface hors vérification » depuis CETTE colonne, jamais depuis le
|
|
14657
|
+
* réglage courant de l'espace : si l'owner recoche demain, les runs d'hier
|
|
14658
|
+
* doivent toujours raconter ce qui s'est passé hier.
|
|
14659
|
+
*/
|
|
14660
|
+
verificationSkippedSurfaces: jsonb("verification_skipped_surfaces").notNull().default(sql`'[]'::jsonb`),
|
|
14661
|
+
/**
|
|
14662
|
+
* Le projet ENREGISTRÉ auquel ce travail s'est rattaché (0093, P5).
|
|
14663
|
+
*
|
|
14664
|
+
* Posé UNE SEULE FOIS, par `attachProductionToProject` : le premier projet
|
|
14665
|
+
* touché gagne, et l'`UPDATE … WHERE project_id IS NULL` fait cette règle
|
|
14666
|
+
* sans lecture préalable. NULL tant qu'aucune production n'est tombée dans
|
|
14667
|
+
* un projet déclaré — le rattachement est un registre, jamais une garde.
|
|
14668
|
+
*
|
|
14669
|
+
* Pas de `.references()` ici, comme `parent_job_id` juste au-dessus : la FK
|
|
14670
|
+
* (ON DELETE SET NULL vers code_projects) est posée par la migration. La
|
|
14671
|
+
* déclarer côté Drizzle ferait un cycle d'import avec code-projects.ts, qui
|
|
14672
|
+
* référence déjà agent_jobs pour `registered_job_id`.
|
|
14673
|
+
*/
|
|
14674
|
+
projectId: uuid("project_id"),
|
|
13974
14675
|
completedAt: timestamp("completed_at", { withTimezone: true }),
|
|
13975
14676
|
createdAt: timestamp("created_at", { withTimezone: true }).defaultNow(),
|
|
13976
14677
|
updatedAt: timestamp("updated_at", { withTimezone: true }).defaultNow()
|
|
@@ -14005,6 +14706,10 @@ var init_jobs = __esm({
|
|
|
14005
14706
|
// (schedule_id + created_at range SUM) had no usable index and seq-scanned
|
|
14006
14707
|
// the whole table. The (schedule_id, created_at) prefix serves both.
|
|
14007
14708
|
index("idx_agent_jobs_schedule_created").on(table.scheduleId, table.createdAt),
|
|
14709
|
+
// 0093 : « les travaux de ce projet » (compte et dernière activité de la
|
|
14710
|
+
// liste des projets) — partiel, la colonne reste NULL sur l'immense
|
|
14711
|
+
// majorité des jobs.
|
|
14712
|
+
index("idx_agent_jobs_project").on(table.projectId).where(sql`${table.projectId} IS NOT NULL`),
|
|
14008
14713
|
check(
|
|
14009
14714
|
"agent_jobs_status_check",
|
|
14010
14715
|
sql`${table.status} IN ('pending','processing','completed','failed','awaiting_approval','awaiting_delegation','cancelled')`
|
|
@@ -14197,13 +14902,37 @@ var init_tool_calls = __esm({
|
|
|
14197
14902
|
// makes this row JOINABLE to the transcript message and to llm_calls by
|
|
14198
14903
|
// turn — the full-copy tool_output was previously unlinkable.
|
|
14199
14904
|
toolCallId: text("tool_call_id"),
|
|
14905
|
+
// P1 (plan « De la maquette au produit ») : la carte DÉCLARÉE par l'outil
|
|
14906
|
+
// et la charge utile que son present() a tirée de la sortie — persistées
|
|
14907
|
+
// ici pour que l'écran lise la ligne sans rejouer l'outil ni connaître son
|
|
14908
|
+
// nom. null sur les lignes antérieures à 0092 et sur celles que
|
|
14909
|
+
// l'enregistreur vivant du CLI écrit sans sortie exploitable : l'écran le
|
|
14910
|
+
// dit tel quel (entrée et sortie brutes), il n'invente pas une carte.
|
|
14911
|
+
card: text("card"),
|
|
14912
|
+
presented: jsonb("presented"),
|
|
14913
|
+
// L'échec du présentateur, s'il y en a eu un : `presented` est alors NULL et
|
|
14914
|
+
// CETTE colonne dit pourquoi — requêtable, pas seulement loggée (revue
|
|
14915
|
+
// passe 14). NULL = aucune erreur (charge présente, ou rien à présenter).
|
|
14916
|
+
presentationError: text("presentation_error"),
|
|
14917
|
+
// P7 (0095) : le niveau de risque DÉCLARÉ par l'outil (`read` | `write` |
|
|
14918
|
+
// `destructive`), tel quel. Pourquoi : l'écran doit dire si un tour a fait
|
|
14919
|
+
// sortir quelque chose du chat, et un connecteur tiers ne déclare que la
|
|
14920
|
+
// carte `generic` — la même pour une lecture et pour une écriture. Son
|
|
14921
|
+
// niveau de risque est alors le seul classement possible. NULL sur les
|
|
14922
|
+
// lignes antérieures à 0095 et sur les lignes `cli:*` (écrites hors
|
|
14923
|
+
// registre) : l'écran dit « incertain » plutôt que de deviner.
|
|
14924
|
+
riskLevel: text("risk_level"),
|
|
14200
14925
|
createdAt: timestamp("created_at", { withTimezone: true }).defaultNow()
|
|
14201
14926
|
},
|
|
14202
14927
|
(table) => [
|
|
14203
14928
|
index("idx_tool_calls_entity_id").on(table.entityId),
|
|
14204
14929
|
index("idx_tool_calls_job").on(table.jobId),
|
|
14205
14930
|
index("idx_tool_calls_job_created").on(table.jobId, sql`${table.createdAt} DESC`),
|
|
14206
|
-
index("idx_tool_calls_recent").on(sql`${table.createdAt} DESC`)
|
|
14931
|
+
index("idx_tool_calls_recent").on(sql`${table.createdAt} DESC`),
|
|
14932
|
+
check(
|
|
14933
|
+
"tool_calls_risk_level_check",
|
|
14934
|
+
sql`${table.riskLevel} IS NULL OR ${table.riskLevel} IN ('read','write','destructive')`
|
|
14935
|
+
)
|
|
14207
14936
|
]
|
|
14208
14937
|
);
|
|
14209
14938
|
}
|
|
@@ -14233,7 +14962,26 @@ var init_approvals = __esm({
|
|
|
14233
14962
|
// toolName alone (a fragility documented in the runner), and stamps the
|
|
14234
14963
|
// replayed tool_calls row with its original id.
|
|
14235
14964
|
toolCallId: text("tool_call_id"),
|
|
14965
|
+
/**
|
|
14966
|
+
* Ce que cette ligne DEMANDE (0098, P10a) : 'approval' — approuver ou
|
|
14967
|
+
* refuser une action — ou 'question' — choisir une option parmi celles que
|
|
14968
|
+
* l'agent propose (`ask_user`).
|
|
14969
|
+
*
|
|
14970
|
+
* POSÉE par la porte à la création, depuis ce que l'outil déclare
|
|
14971
|
+
* (`ToolDefinition.asksUser`), jamais devinée après coup par le nom de
|
|
14972
|
+
* l'outil : le web, le runner et Telegram la lisent tous les trois sans
|
|
14973
|
+
* avoir le registre d'outils sous la main.
|
|
14974
|
+
*/
|
|
14975
|
+
kind: text("kind").notNull().default("approval"),
|
|
14236
14976
|
status: text("status").default("pending"),
|
|
14977
|
+
/**
|
|
14978
|
+
* L'option choisie, TELLE QUELLE — le libellé, jamais l'index (0098).
|
|
14979
|
+
* Posée à la résolution, et seulement sur une ligne `kind = 'question'` :
|
|
14980
|
+
* l'écran et le transcript la relisent des mois plus tard, quand la liste
|
|
14981
|
+
* d'options n'existe plus qu'ici, dans `tool_input`. NULL tant que
|
|
14982
|
+
* personne n'a répondu, et sur un refus.
|
|
14983
|
+
*/
|
|
14984
|
+
answer: text("answer"),
|
|
14237
14985
|
requestedAt: timestamp("requested_at", { withTimezone: true }).defaultNow(),
|
|
14238
14986
|
resolvedAt: timestamp("resolved_at", { withTimezone: true }),
|
|
14239
14987
|
resolvedBy: text("resolved_by"),
|
|
@@ -14256,7 +15004,8 @@ var init_approvals = __esm({
|
|
|
14256
15004
|
check(
|
|
14257
15005
|
"approval_requests_status_check",
|
|
14258
15006
|
sql`${table.status} IN ('pending','approved','rejected','expired')`
|
|
14259
|
-
)
|
|
15007
|
+
),
|
|
15008
|
+
check("approval_requests_kind_check", sql`${table.kind} IN ('approval','question')`)
|
|
14260
15009
|
]
|
|
14261
15010
|
);
|
|
14262
15011
|
approvalRules = pgTable(
|
|
@@ -14574,6 +15323,39 @@ var init_skills = __esm({
|
|
|
14574
15323
|
}
|
|
14575
15324
|
});
|
|
14576
15325
|
|
|
15326
|
+
// ../../packages/db/src/schema/schedule-state.ts
|
|
15327
|
+
var SCHEDULE_STATE_VALUE_MAX, SCHEDULE_STATE_KEY_MAX, SCHEDULE_STATE_MAX_KEYS, scheduleState;
|
|
15328
|
+
var init_schedule_state = __esm({
|
|
15329
|
+
"../../packages/db/src/schema/schedule-state.ts"() {
|
|
15330
|
+
"use strict";
|
|
15331
|
+
init_pg_core();
|
|
15332
|
+
init_drizzle_orm();
|
|
15333
|
+
init_schedules();
|
|
15334
|
+
SCHEDULE_STATE_VALUE_MAX = 2e3;
|
|
15335
|
+
SCHEDULE_STATE_KEY_MAX = 120;
|
|
15336
|
+
SCHEDULE_STATE_MAX_KEYS = 20;
|
|
15337
|
+
scheduleState = pgTable(
|
|
15338
|
+
"schedule_state",
|
|
15339
|
+
{
|
|
15340
|
+
scheduleId: uuid("schedule_id").notNull().references(() => agentSchedules.id, { onDelete: "cascade" }),
|
|
15341
|
+
key: text("key").notNull(),
|
|
15342
|
+
value: text("value").notNull(),
|
|
15343
|
+
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
15344
|
+
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow()
|
|
15345
|
+
},
|
|
15346
|
+
(table) => [
|
|
15347
|
+
primaryKey({ columns: [table.scheduleId, table.key] }),
|
|
15348
|
+
index("idx_schedule_state_schedule").on(table.scheduleId),
|
|
15349
|
+
// Les bornes sont EN BASE, pas seulement dans l'outil : une écriture qui
|
|
15350
|
+
// passerait par un autre chemin ne doit pas pouvoir transformer l'état en
|
|
15351
|
+
// dépotoir. Une clé vide n'identifie rien.
|
|
15352
|
+
check("schedule_state_key_len", sql`length(${table.key}) BETWEEN 1 AND 120`),
|
|
15353
|
+
check("schedule_state_value_len", sql`length(${table.value}) <= 2000`)
|
|
15354
|
+
]
|
|
15355
|
+
);
|
|
15356
|
+
}
|
|
15357
|
+
});
|
|
15358
|
+
|
|
14577
15359
|
// ../../packages/db/src/schema/mcp.ts
|
|
14578
15360
|
var mcpServers, agentMcpServers, mcpConnections;
|
|
14579
15361
|
var init_mcp = __esm({
|
|
@@ -14670,24 +15452,109 @@ var init_code_projects = __esm({
|
|
|
14670
15452
|
"../../packages/db/src/schema/code-projects.ts"() {
|
|
14671
15453
|
"use strict";
|
|
14672
15454
|
init_pg_core();
|
|
15455
|
+
init_drizzle_orm();
|
|
14673
15456
|
init_entities();
|
|
15457
|
+
init_users();
|
|
15458
|
+
init_agents();
|
|
15459
|
+
init_jobs();
|
|
14674
15460
|
codeProjects = pgTable(
|
|
14675
15461
|
"code_projects",
|
|
14676
15462
|
{
|
|
14677
15463
|
id: uuid("id").primaryKey().defaultRandom(),
|
|
14678
15464
|
entityId: uuid("entity_id").notNull().references(() => entities.id, { onDelete: "cascade" }),
|
|
14679
|
-
/** Chemin absolu slash-normalisé du projet (la
|
|
15465
|
+
/** Chemin absolu slash-normalisé du projet (la valeur AFFICHÉE — jamais recasée après coup). */
|
|
14680
15466
|
projectPath: text("project_path").notNull(),
|
|
15467
|
+
/**
|
|
15468
|
+
* Clé d'identité canonique — `projectKey(project_path)`. Porte la
|
|
15469
|
+
* contrainte d'unicité (0088) ; `project_path` reste le texte tel qu'il a
|
|
15470
|
+
* été écrit la première fois, uniquement pour l'affichage.
|
|
15471
|
+
*/
|
|
15472
|
+
projectKey: text("project_key").notNull(),
|
|
14681
15473
|
/** Nom choisi par le propriétaire. NULL = nom du dossier. */
|
|
14682
15474
|
displayName: text("display_name"),
|
|
14683
15475
|
/** Masqué de la liste ET du contexte injecté aux agents. */
|
|
14684
15476
|
hidden: boolean("hidden").notNull().default(false),
|
|
15477
|
+
/** Séquence de preuve déclarée (v5-A). NULL = livrable `not_configured`. */
|
|
15478
|
+
verifyCommands: jsonb("verify_commands").$type(),
|
|
15479
|
+
/** Incrémenté à chaque changement de `verify_commands` — invalide l'approbation en cours. */
|
|
15480
|
+
verificationEpoch: integer("verification_epoch").notNull().default(0),
|
|
15481
|
+
/** Empreinte (D1) de la révision exacte approuvée par le propriétaire. */
|
|
15482
|
+
verifyApprovedManifestHash: text("verify_approved_manifest_hash"),
|
|
15483
|
+
verifyApprovedAt: timestamp("verify_approved_at", { withTimezone: true }),
|
|
15484
|
+
/**
|
|
15485
|
+
* QUI a décidé de cette séquence de preuve : `owner` quand le propriétaire
|
|
15486
|
+
* l'a saisie et approuvée, `agent` quand celui qui a construit l'a déclarée
|
|
15487
|
+
* en finissant. `null` sur les lignes d'avant la migration 0102.
|
|
15488
|
+
*
|
|
15489
|
+
* La distinction est pour l'ÉCRAN, pas pour le moteur : une preuve déclarée
|
|
15490
|
+
* par un agent s'exécute exactement comme une preuve approuvée, mais on ne
|
|
15491
|
+
* la présente pas comme le choix du propriétaire.
|
|
15492
|
+
*/
|
|
15493
|
+
verifySource: text("verify_source").$type(),
|
|
15494
|
+
/** Le job qui a déclaré cette séquence, quand `verify_source = 'agent'`. */
|
|
15495
|
+
verifyDeclaredByJobId: uuid("verify_declared_by_job_id"),
|
|
15496
|
+
/** SET NULL : l'utilisateur approbateur peut disparaître, l'approbation reste tracée. */
|
|
15497
|
+
verifyApprovedBy: uuid("verify_approved_by").references(() => users.id, {
|
|
15498
|
+
onDelete: "set null"
|
|
15499
|
+
}),
|
|
15500
|
+
/**
|
|
15501
|
+
* Ce que le projet PRODUIT — du code, ou des documents (0093).
|
|
15502
|
+
*
|
|
15503
|
+
* Le registre n'est pas réservé au code : un dossier de documents est un
|
|
15504
|
+
* projet au même titre, avec le même terrain et le même rattachement. La
|
|
15505
|
+
* colonne existe pour que l'écran le dise, jamais pour que le runtime en
|
|
15506
|
+
* déduise un comportement — c'est l'outil qui déclare ce qu'il produit
|
|
15507
|
+
* (`deliverableType`), pas le dossier où il écrit.
|
|
15508
|
+
*/
|
|
15509
|
+
kind: text("kind").notNull().default("code"),
|
|
15510
|
+
/**
|
|
15511
|
+
* L'agent responsable : celui dont le terrain contient ce projet. SET NULL
|
|
15512
|
+
* — supprimer un agent coupe le lien, il n'emporte pas le projet.
|
|
15513
|
+
*/
|
|
15514
|
+
agentId: uuid("agent_id").references(() => agents.id, { onDelete: "set null" }),
|
|
15515
|
+
/**
|
|
15516
|
+
* LE discriminant du registre (0093). NULL = ligne de COMPTABILITÉ (un
|
|
15517
|
+
* renommage, un masquage, une configuration de preuve, ou la ligne créée
|
|
15518
|
+
* toute seule par l'intention de mutation quand une écriture atterrit dans
|
|
15519
|
+
* une racine dérivée) ; NOT NULL = projet DÉCLARÉ, celui qu'un écran liste
|
|
15520
|
+
* et auquel un travail se rattache.
|
|
15521
|
+
*
|
|
15522
|
+
* Aucun lecteur existant ne regarde cette colonne : l'onglet Code et la
|
|
15523
|
+
* vérification continuent de lire la ligne par clé, exactement comme avant.
|
|
15524
|
+
*/
|
|
15525
|
+
registeredAt: timestamp("registered_at", { withTimezone: true }),
|
|
15526
|
+
/** D'où vient la déclaration : `spaces` (l'écran) ou `conversation` (P6). NULL si non enregistré. */
|
|
15527
|
+
registeredFrom: text("registered_from").$type(),
|
|
15528
|
+
/**
|
|
15529
|
+
* Le job qui a déclaré ce projet, quand la déclaration vient d'une
|
|
15530
|
+
* conversation. SET NULL : la purge des vieux jobs ne doit pas désinscrire
|
|
15531
|
+
* un projet vivant.
|
|
15532
|
+
*/
|
|
15533
|
+
registeredJobId: uuid("registered_job_id").references(() => agentJobs.id, {
|
|
15534
|
+
onDelete: "set null"
|
|
15535
|
+
}),
|
|
14685
15536
|
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
14686
15537
|
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow()
|
|
14687
15538
|
},
|
|
14688
15539
|
(table) => [
|
|
14689
|
-
|
|
14690
|
-
|
|
15540
|
+
// Remplace l'ancien code_projects_entity_path_unique (texte exact,
|
|
15541
|
+
// 0086) — la migration 0088 le retire par son vrai nom Postgres
|
|
15542
|
+
// (code_projects_entity_id_project_path_key, jamais nommé côté Drizzle).
|
|
15543
|
+
unique("code_projects_entity_key_unique").on(table.entityId, table.projectKey),
|
|
15544
|
+
index("idx_code_projects_entity").on(table.entityId),
|
|
15545
|
+
// Index PARTIEL (0093) : la liste des projets ne lit que les lignes
|
|
15546
|
+
// enregistrées, qui resteront minoritaires devant la comptabilité produite
|
|
15547
|
+
// par les écritures.
|
|
15548
|
+
index("idx_code_projects_registered").on(table.entityId).where(sql`${table.registeredAt} IS NOT NULL`),
|
|
15549
|
+
check("code_projects_kind_check", sql`${table.kind} IN ('code','documents')`),
|
|
15550
|
+
check(
|
|
15551
|
+
"code_projects_registered_from_check",
|
|
15552
|
+
sql`${table.registeredFrom} IS NULL OR ${table.registeredFrom} IN ('spaces','conversation')`
|
|
15553
|
+
),
|
|
15554
|
+
check(
|
|
15555
|
+
"code_projects_verify_commands_check",
|
|
15556
|
+
sql`${table.verifyCommands} IS NULL OR (jsonb_typeof(${table.verifyCommands}) = 'array' AND jsonb_array_length(${table.verifyCommands}) BETWEEN 1 AND 5)`
|
|
15557
|
+
)
|
|
14691
15558
|
]
|
|
14692
15559
|
);
|
|
14693
15560
|
}
|
|
@@ -14835,6 +15702,7 @@ var init_chat_messages = __esm({
|
|
|
14835
15702
|
init_entities();
|
|
14836
15703
|
init_agents();
|
|
14837
15704
|
init_jobs();
|
|
15705
|
+
init_code_projects();
|
|
14838
15706
|
conversations = pgTable(
|
|
14839
15707
|
"conversations",
|
|
14840
15708
|
{
|
|
@@ -14846,14 +15714,75 @@ var init_chat_messages = __esm({
|
|
|
14846
15714
|
// Stamped at CREATION time (never rewritten later) so the onboarding
|
|
14847
15715
|
// interview conversation never leaks into the dashboard's Chats list —
|
|
14848
15716
|
// whether the operator skips it or finishes it (migration 0065).
|
|
15717
|
+
//
|
|
15718
|
+
// `project` (0097) : ouverte DEPUIS la page d'un projet. C'est ce fil-là
|
|
15719
|
+
// que la saisie du bas de cette page prolonge — la récence ne suffisait
|
|
15720
|
+
// pas, une conversation simplement ancrée par une production finissait par
|
|
15721
|
+
// évincer celle qu'on avait ouverte exprès. Elle reste une conversation de
|
|
15722
|
+
// l'utilisateur partout ailleurs ; seul `onboarding` est tenu hors listes.
|
|
14849
15723
|
origin: text("origin").notNull().default("user"),
|
|
15724
|
+
/**
|
|
15725
|
+
* Le canal du fil (0094). `dashboard` par DÉFAUT — c'est ce qui laisse
|
|
15726
|
+
* `createConversationAction` inchangé, et ce qui donne son canal à chaque
|
|
15727
|
+
* ligne existante au moment de la migration.
|
|
15728
|
+
*/
|
|
15729
|
+
channel: text("channel").notNull().default("dashboard"),
|
|
15730
|
+
/**
|
|
15731
|
+
* L'identifiant du fil SUR le canal (chat Telegram, canal Slack, ...).
|
|
15732
|
+
* NULL pour le dashboard, dont le fil n'existe nulle part ailleurs qu'ici.
|
|
15733
|
+
*/
|
|
15734
|
+
chatId: text("chat_id"),
|
|
15735
|
+
/**
|
|
15736
|
+
* Le PROJET COURANT de la conversation (P6) : posé quand une production
|
|
15737
|
+
* atterrit dans un projet enregistré (attach.ts), et redit au modèle à
|
|
15738
|
+
* chaque tour dans le bloc `## Conversation`. TOUJOURS écrasé — la dernière
|
|
15739
|
+
* production décide, parce qu'une conversation qui change de sujet change
|
|
15740
|
+
* de dossier, et que l'utilisateur ne devrait pas avoir à le déclarer.
|
|
15741
|
+
* SET NULL : désinscrire un projet retire l'ancrage, jamais la conversation.
|
|
15742
|
+
*/
|
|
15743
|
+
currentProjectId: uuid("current_project_id").references(() => codeProjects.id, {
|
|
15744
|
+
onDelete: "set null"
|
|
15745
|
+
}),
|
|
14850
15746
|
createdAt: timestamp("created_at", { withTimezone: true }).defaultNow(),
|
|
14851
15747
|
// Bumped on each new turn — drives the recency sort in the sidebar.
|
|
14852
15748
|
updatedAt: timestamp("updated_at", { withTimezone: true }).defaultNow()
|
|
14853
15749
|
},
|
|
14854
15750
|
(table) => [
|
|
14855
15751
|
index("idx_conversations_entity_agent").on(table.entityId, table.agentId, table.updatedAt),
|
|
14856
|
-
|
|
15752
|
+
/**
|
|
15753
|
+
* LA requête du runner à chaque message entrant : la ligne la plus récente
|
|
15754
|
+
* du tuple (entité, agent, canal, chat).
|
|
15755
|
+
*/
|
|
15756
|
+
// `id` en dernier : c'est le DÉPARTAGE de `resolveConversation` à date
|
|
15757
|
+
// égale, et sans lui l'index ne couvre pas l'ordre entier — le moteur
|
|
15758
|
+
// trie ce qui reste (revue Codex, PR #48, passe 7). Deux chemins chauds
|
|
15759
|
+
// s'en servent : le runner sur chaque message entrant, et le `DISTINCT ON`
|
|
15760
|
+
// qui désigne le fil courant de chaque chat pour `/chat`.
|
|
15761
|
+
// `.desc()` sur les deux dernières, comme le SQL de la migration : sans
|
|
15762
|
+
// elles, Drizzle déclare un index ASC là où la migration en crée un mixte,
|
|
15763
|
+
// et le schéma décrit un index que la base n'a pas (revue Codex, PR #49,
|
|
15764
|
+
// passe 4).
|
|
15765
|
+
index("idx_conversations_thread_tiebreak").on(
|
|
15766
|
+
table.entityId,
|
|
15767
|
+
table.agentId,
|
|
15768
|
+
table.channel,
|
|
15769
|
+
table.chatId,
|
|
15770
|
+
table.createdAt.desc(),
|
|
15771
|
+
table.id.desc()
|
|
15772
|
+
),
|
|
15773
|
+
// L'autre question de `/chat` : quels chats DEVRAIENT être listés ? Elle
|
|
15774
|
+
// filtre sur l'ORIGINE, qu'aucun index ne portait (revue Codex, PR #48,
|
|
15775
|
+
// passe 10). PARTIEL, avec les prédicats exacts de la requête : il ne
|
|
15776
|
+
// couvre que les lignes qui peuvent répondre, et reste petit là où la
|
|
15777
|
+
// table grandit surtout par les fils qu'il exclut.
|
|
15778
|
+
index("idx_conversations_listable_chats").on(table.entityId, table.agentId, table.channel, table.chatId).where(
|
|
15779
|
+
sql`${table.origin} IN ('user', 'project') AND ${table.channel} <> 'dashboard' AND ${table.chatId} IS NOT NULL AND ${table.chatId} <> ''`
|
|
15780
|
+
),
|
|
15781
|
+
check("conversations_origin_check", sql`${table.origin} IN ('user','onboarding','project')`),
|
|
15782
|
+
check(
|
|
15783
|
+
"conversations_channel_check",
|
|
15784
|
+
sql`${table.channel} IN ('dashboard','telegram','slack','discord','whatsapp')`
|
|
15785
|
+
)
|
|
14857
15786
|
]
|
|
14858
15787
|
);
|
|
14859
15788
|
chatMessages = pgTable(
|
|
@@ -15157,6 +16086,7 @@ var init_llm_calls = __esm({
|
|
|
15157
16086
|
init_entities();
|
|
15158
16087
|
init_agents();
|
|
15159
16088
|
init_jobs();
|
|
16089
|
+
init_chat_messages();
|
|
15160
16090
|
llmCalls = pgTable(
|
|
15161
16091
|
"llm_calls",
|
|
15162
16092
|
{
|
|
@@ -15165,6 +16095,15 @@ var init_llm_calls = __esm({
|
|
|
15165
16095
|
// set null: an audit row must survive the deletion of its agent/job.
|
|
15166
16096
|
agentId: uuid("agent_id").references(() => agents.id, { onDelete: "set null" }),
|
|
15167
16097
|
jobId: uuid("job_id").references(() => agentJobs.id, { onDelete: "set null" }),
|
|
16098
|
+
/**
|
|
16099
|
+
* La CONVERSATION d'où vient l'appel (0100). Un tour de chat du tableau de
|
|
16100
|
+
* bord ne passe pas par un job : sans cette colonne, ses appels étaient
|
|
16101
|
+
* bien enregistrés mais jamais rattachables au fil, qui affichait
|
|
16102
|
+
* « 0 agents, 0 tokens » sous une réponse bien réelle (Quentin, 07/09).
|
|
16103
|
+
*/
|
|
16104
|
+
conversationId: uuid("conversation_id").references(() => conversations.id, {
|
|
16105
|
+
onDelete: "set null"
|
|
16106
|
+
}),
|
|
15168
16107
|
/** Where the call came from: 'job' | 'chat' | 'curator' | 'reflection' | 'cron' | … */
|
|
15169
16108
|
source: text("source").notNull(),
|
|
15170
16109
|
/** Job-loop turn number when applicable (null for chat/curator). */
|
|
@@ -15203,6 +16142,7 @@ var init_llm_calls = __esm({
|
|
|
15203
16142
|
},
|
|
15204
16143
|
(table) => [
|
|
15205
16144
|
index("idx_llm_calls_job").on(table.jobId, table.createdAt),
|
|
16145
|
+
index("idx_llm_calls_conversation").on(table.conversationId, table.createdAt),
|
|
15206
16146
|
index("idx_llm_calls_entity_created").on(table.entityId, table.createdAt),
|
|
15207
16147
|
index("idx_llm_calls_agent_created").on(table.agentId, table.createdAt)
|
|
15208
16148
|
]
|
|
@@ -15210,6 +16150,220 @@ var init_llm_calls = __esm({
|
|
|
15210
16150
|
}
|
|
15211
16151
|
});
|
|
15212
16152
|
|
|
16153
|
+
// ../../packages/db/src/schema/job-deliveries.ts
|
|
16154
|
+
var jobDeliveries;
|
|
16155
|
+
var init_job_deliveries = __esm({
|
|
16156
|
+
"../../packages/db/src/schema/job-deliveries.ts"() {
|
|
16157
|
+
"use strict";
|
|
16158
|
+
init_pg_core();
|
|
16159
|
+
init_drizzle_orm();
|
|
16160
|
+
init_jobs();
|
|
16161
|
+
jobDeliveries = pgTable(
|
|
16162
|
+
"job_deliveries",
|
|
16163
|
+
{
|
|
16164
|
+
id: uuid("id").primaryKey().defaultRandom(),
|
|
16165
|
+
jobId: uuid("job_id").notNull().references(() => agentJobs.id, { onDelete: "cascade" }),
|
|
16166
|
+
channel: text("channel").notNull(),
|
|
16167
|
+
chatId: text("chat_id").notNull(),
|
|
16168
|
+
payload: text("payload").notNull(),
|
|
16169
|
+
outcome: text("outcome").notNull(),
|
|
16170
|
+
idempotencyKey: text("idempotency_key").notNull().unique(),
|
|
16171
|
+
receipt: jsonb("receipt"),
|
|
16172
|
+
attempts: integer("attempts").notNull().default(0),
|
|
16173
|
+
claimedBy: text("claimed_by"),
|
|
16174
|
+
claimedAt: timestamp("claimed_at", { withTimezone: true }),
|
|
16175
|
+
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
16176
|
+
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow()
|
|
16177
|
+
},
|
|
16178
|
+
(table) => [
|
|
16179
|
+
index("idx_job_deliveries_open").on(table.outcome, table.claimedAt).where(sql`${table.outcome} IN ('prepared','attempted')`),
|
|
16180
|
+
check(
|
|
16181
|
+
"job_deliveries_channel_check",
|
|
16182
|
+
sql`${table.channel} IN ('telegram','discord','slack','whatsapp')`
|
|
16183
|
+
),
|
|
16184
|
+
check(
|
|
16185
|
+
"job_deliveries_outcome_check",
|
|
16186
|
+
sql`${table.outcome} IN ('prepared','attempted','confirmed','rejected')`
|
|
16187
|
+
),
|
|
16188
|
+
check("job_deliveries_attempts_check", sql`${table.attempts} <= 3`)
|
|
16189
|
+
]
|
|
16190
|
+
);
|
|
16191
|
+
}
|
|
16192
|
+
});
|
|
16193
|
+
|
|
16194
|
+
// ../../packages/db/src/schema/verification.ts
|
|
16195
|
+
var jobDeliverableVerificationState, verificationRuns;
|
|
16196
|
+
var init_verification2 = __esm({
|
|
16197
|
+
"../../packages/db/src/schema/verification.ts"() {
|
|
16198
|
+
"use strict";
|
|
16199
|
+
init_pg_core();
|
|
16200
|
+
init_drizzle_orm();
|
|
16201
|
+
init_entities();
|
|
16202
|
+
init_jobs();
|
|
16203
|
+
jobDeliverableVerificationState = pgTable(
|
|
16204
|
+
"job_deliverable_verification_state",
|
|
16205
|
+
{
|
|
16206
|
+
id: uuid("id").primaryKey().defaultRandom(),
|
|
16207
|
+
jobId: uuid("job_id").notNull().references(() => agentJobs.id, { onDelete: "cascade" }),
|
|
16208
|
+
/** DeliverableType (@nodal-agents/shared) — choisit le canonicaliseur ET la politique. */
|
|
16209
|
+
deliverableType: text("deliverable_type").notNull(),
|
|
16210
|
+
/** Clé stable du livrable — projectKey(path) pour code_project (T01/T09). */
|
|
16211
|
+
canonicalKey: text("canonical_key").notNull(),
|
|
16212
|
+
/** AtomicOutcome — livrables ATOMIQUES seulement (v6-A, sans écrivain en ①). */
|
|
16213
|
+
outcome: text("outcome"),
|
|
16214
|
+
/** Clé d'idempotence du livrable atomique — sans écrivain en ①. */
|
|
16215
|
+
idempotencyKey: text("idempotency_key"),
|
|
16216
|
+
/** Dernier chemin/étiquette affiché à l'owner, pour l'UI (snapshot, pas une FK vivante). */
|
|
16217
|
+
displayPathSnapshot: text("display_path_snapshot"),
|
|
16218
|
+
/** Livrables MUTABLES seulement : incrémenté à chaque écriture. */
|
|
16219
|
+
dirtyGeneration: integer("dirty_generation"),
|
|
16220
|
+
/** Livrables MUTABLES seulement : la génération que la preuve a validée en vert. */
|
|
16221
|
+
verifiedGeneration: integer("verified_generation"),
|
|
16222
|
+
/**
|
|
16223
|
+
* Ce livrable a-t-il été NOMMÉ par un outil (`true`), ou entre-t-il dans le
|
|
16224
|
+
* périmètre par précaution (`false`) ?
|
|
16225
|
+
*
|
|
16226
|
+
* La GARDE traite les deux pareil : un shell écrit où il veut, donc tout
|
|
16227
|
+
* son périmètre est marqué sale. L'ÉCRAN, lui, ne montre que ce qui a été
|
|
16228
|
+
* visé — sans quoi une application de recettes s'affiche avec vingt
|
|
16229
|
+
* livrables non vérifiés, dont `shared/_archive` (constaté le 08/09/2026).
|
|
16230
|
+
*/
|
|
16231
|
+
addressed: boolean("addressed").notNull().default(true),
|
|
16232
|
+
/**
|
|
16233
|
+
* Un outil a-t-il RÉUSSI à écrire dans ce livrable pendant ce job ?
|
|
16234
|
+
*
|
|
16235
|
+
* `addressed` ne peut pas répondre : l'intention est posée AVANT
|
|
16236
|
+
* l'exécution, et une tentative qui échoue la laisse en place — c'est la
|
|
16237
|
+
* bonne garde, mais une mauvaise autorisation. `declare_verification` s'en
|
|
16238
|
+
* servait pourtant comme telle, si bien qu'un `file_edit` au `old_string`
|
|
16239
|
+
* absent suffisait à déclarer la preuve d'un projet qu'on n'avait pas
|
|
16240
|
+
* produit (revue Codex, PR #49, passe 2).
|
|
16241
|
+
*
|
|
16242
|
+
* Deux colonnes, deux questions : `addressed` est ce que l'écran MONTRE,
|
|
16243
|
+
* `produced` est ce qui AUTORISE à déclarer une preuve. Défaut `false` —
|
|
16244
|
+
* une autorisation ne se présume pas.
|
|
16245
|
+
*/
|
|
16246
|
+
produced: boolean("produced").notNull().default(false),
|
|
16247
|
+
/** DecisionStatus — l'état lisible affiché à l'owner. */
|
|
16248
|
+
decisionStatus: text("decision_status").notNull(),
|
|
16249
|
+
/** Empreinte de la dernière commande de preuve exécutée (diagnostic, pas le hash d'approbation). */
|
|
16250
|
+
commandHashSnapshot: text("command_hash_snapshot"),
|
|
16251
|
+
/** Rouges consécutifs — sans écrivain en ① (passes de réparation). */
|
|
16252
|
+
redStreak: integer("red_streak").notNull().default(0),
|
|
16253
|
+
/** Tentatives de réparation automatique — sans écrivain en ①. */
|
|
16254
|
+
repairAttempts: integer("repair_attempts").notNull().default(0),
|
|
16255
|
+
/** verification_epoch de code_projects au moment du dernier test (T09). */
|
|
16256
|
+
testedEpoch: integer("tested_epoch"),
|
|
16257
|
+
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow()
|
|
16258
|
+
},
|
|
16259
|
+
(table) => [
|
|
16260
|
+
unique("job_deliverable_verification_state_job_type_key_unique").on(
|
|
16261
|
+
table.jobId,
|
|
16262
|
+
table.deliverableType,
|
|
16263
|
+
table.canonicalKey
|
|
16264
|
+
),
|
|
16265
|
+
check(
|
|
16266
|
+
"job_deliverable_verification_state_deliverable_type_check",
|
|
16267
|
+
sql`${table.deliverableType} IN ('code_project','office_file','document','outbound_action','other')`
|
|
16268
|
+
),
|
|
16269
|
+
check(
|
|
16270
|
+
"job_deliverable_verification_state_outcome_check",
|
|
16271
|
+
sql`${table.outcome} IS NULL OR ${table.outcome} IN ('prepared','attempted','confirmed','rejected','outcome_unknown')`
|
|
16272
|
+
),
|
|
16273
|
+
check(
|
|
16274
|
+
"job_deliverable_verification_state_decision_status_check",
|
|
16275
|
+
sql`${table.decisionStatus} IN ('dirty','green','red','pending_approval','not_configured','infra_error')`
|
|
16276
|
+
),
|
|
16277
|
+
check(
|
|
16278
|
+
"job_deliverable_verification_state_generation_check",
|
|
16279
|
+
sql`${table.verifiedGeneration} IS NULL OR ${table.verifiedGeneration} <= ${table.dirtyGeneration}`
|
|
16280
|
+
),
|
|
16281
|
+
// La famille du livrable impose sa forme : un ATOMIQUE ne porte jamais de
|
|
16282
|
+
// génération, un MUTABLE ne porte jamais d'outcome.
|
|
16283
|
+
check(
|
|
16284
|
+
"job_deliverable_verification_state_family_check",
|
|
16285
|
+
sql`(${table.deliverableType} = 'outbound_action' AND ${table.dirtyGeneration} IS NULL AND ${table.verifiedGeneration} IS NULL AND ${table.outcome} IS NOT NULL)
|
|
16286
|
+
OR (${table.deliverableType} <> 'outbound_action' AND ${table.outcome} IS NULL AND ${table.dirtyGeneration} IS NOT NULL)`
|
|
16287
|
+
)
|
|
16288
|
+
]
|
|
16289
|
+
);
|
|
16290
|
+
verificationRuns = pgTable(
|
|
16291
|
+
"verification_runs",
|
|
16292
|
+
{
|
|
16293
|
+
id: uuid("id").primaryKey().defaultRandom(),
|
|
16294
|
+
// set null (not cascade): a proof that actually ran is an audited fact —
|
|
16295
|
+
// it must survive the deletion of the job that requested it (mirrors
|
|
16296
|
+
// llm_calls.job_id).
|
|
16297
|
+
jobId: uuid("job_id").references(() => agentJobs.id, { onDelete: "set null" }),
|
|
16298
|
+
entityId: uuid("entity_id").references(() => entities.id, { onDelete: "cascade" }),
|
|
16299
|
+
deliverableType: text("deliverable_type").notNull(),
|
|
16300
|
+
canonicalKey: text("canonical_key").notNull(),
|
|
16301
|
+
/** Hash du manifeste (D1, @nodal-agents/shared) sous lequel cette commande a tourné. */
|
|
16302
|
+
manifestHash: text("manifest_hash"),
|
|
16303
|
+
/** Regroupe les commandes d'une même preuve (une exécution de runCommandSequence). */
|
|
16304
|
+
sequenceId: uuid("sequence_id").notNull(),
|
|
16305
|
+
commandRank: integer("command_rank").notNull(),
|
|
16306
|
+
command: text("command").notNull(),
|
|
16307
|
+
exitCode: integer("exit_code"),
|
|
16308
|
+
outcomeKind: text("outcome_kind").notNull(),
|
|
16309
|
+
/** Bornées par le code appelant (T09/T06), jamais illimitées en base. */
|
|
16310
|
+
stdoutTail: text("stdout_tail"),
|
|
16311
|
+
stderrTail: text("stderr_tail"),
|
|
16312
|
+
durationMs: integer("duration_ms"),
|
|
16313
|
+
verdict: text("verdict").notNull(),
|
|
16314
|
+
/** dirty_generation testé (livrables mutables) — snapshot au moment du run. */
|
|
16315
|
+
testedGeneration: integer("tested_generation"),
|
|
16316
|
+
/** verification_epoch testé — snapshot au moment du run. */
|
|
16317
|
+
testedEpoch: integer("tested_epoch"),
|
|
16318
|
+
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow()
|
|
16319
|
+
},
|
|
16320
|
+
(table) => [
|
|
16321
|
+
index("idx_verification_runs_job_created").on(table.jobId, table.createdAt),
|
|
16322
|
+
check(
|
|
16323
|
+
"verification_runs_outcome_kind_check",
|
|
16324
|
+
sql`${table.outcomeKind} IN ('exit','timeout','spawn_error')`
|
|
16325
|
+
),
|
|
16326
|
+
check(
|
|
16327
|
+
"verification_runs_verdict_check",
|
|
16328
|
+
sql`${table.verdict} IN ('green','red','infra_error')`
|
|
16329
|
+
)
|
|
16330
|
+
]
|
|
16331
|
+
);
|
|
16332
|
+
}
|
|
16333
|
+
});
|
|
16334
|
+
|
|
16335
|
+
// ../../packages/db/src/schema/job-checkpoints.ts
|
|
16336
|
+
var jobCheckpoints;
|
|
16337
|
+
var init_job_checkpoints = __esm({
|
|
16338
|
+
"../../packages/db/src/schema/job-checkpoints.ts"() {
|
|
16339
|
+
"use strict";
|
|
16340
|
+
init_pg_core();
|
|
16341
|
+
init_jobs();
|
|
16342
|
+
jobCheckpoints = pgTable(
|
|
16343
|
+
"job_checkpoints",
|
|
16344
|
+
{
|
|
16345
|
+
id: uuid("id").primaryKey().defaultRandom(),
|
|
16346
|
+
jobId: uuid("job_id").notNull().references(() => agentJobs.id, { onDelete: "cascade" }),
|
|
16347
|
+
/** Le compteur de tour du runner — celui que `ToolContext.turn` porte. */
|
|
16348
|
+
turn: integer("turn").notNull(),
|
|
16349
|
+
/** Le dossier TEL QUE LE SEAM LE CONNAÎT : chemin absolu, graphie d'origine. */
|
|
16350
|
+
workspace: text("workspace").notNull(),
|
|
16351
|
+
/** Le commit dans le magasin fantôme — l'état d'avant de ce tour. */
|
|
16352
|
+
sha: text("sha").notNull(),
|
|
16353
|
+
takenAt: timestamp("taken_at", { withTimezone: true }).notNull().defaultNow()
|
|
16354
|
+
},
|
|
16355
|
+
(table) => [
|
|
16356
|
+
unique("job_checkpoints_job_turn_workspace_unique").on(
|
|
16357
|
+
table.jobId,
|
|
16358
|
+
table.turn,
|
|
16359
|
+
table.workspace
|
|
16360
|
+
),
|
|
16361
|
+
index("idx_job_checkpoints_job").on(table.jobId)
|
|
16362
|
+
]
|
|
16363
|
+
);
|
|
16364
|
+
}
|
|
16365
|
+
});
|
|
16366
|
+
|
|
15213
16367
|
// ../../packages/db/src/schema/index.ts
|
|
15214
16368
|
var schema_exports = {};
|
|
15215
16369
|
__export(schema_exports, {
|
|
@@ -15228,6 +16382,9 @@ __export(schema_exports, {
|
|
|
15228
16382
|
OPERATION_RISK_LEVELS: () => OPERATION_RISK_LEVELS,
|
|
15229
16383
|
ORCHESTRATOR_MODES: () => ORCHESTRATOR_MODES,
|
|
15230
16384
|
SCHEDULE_LAST_STATUSES: () => SCHEDULE_LAST_STATUSES,
|
|
16385
|
+
SCHEDULE_STATE_KEY_MAX: () => SCHEDULE_STATE_KEY_MAX,
|
|
16386
|
+
SCHEDULE_STATE_MAX_KEYS: () => SCHEDULE_STATE_MAX_KEYS,
|
|
16387
|
+
SCHEDULE_STATE_VALUE_MAX: () => SCHEDULE_STATE_VALUE_MAX,
|
|
15231
16388
|
SCHEDULE_TYPES: () => SCHEDULE_TYPES,
|
|
15232
16389
|
TASK_PRIORITIES: () => TASK_PRIORITIES,
|
|
15233
16390
|
TASK_STATUSES: () => TASK_STATUSES,
|
|
@@ -15260,9 +16417,13 @@ __export(schema_exports, {
|
|
|
15260
16417
|
entityLlmKeys: () => entityLlmKeys,
|
|
15261
16418
|
entityMembers: () => entityMembers,
|
|
15262
16419
|
entitySettings: () => entitySettings,
|
|
16420
|
+
jobCheckpoints: () => jobCheckpoints,
|
|
16421
|
+
jobDeliverableVerificationState: () => jobDeliverableVerificationState,
|
|
16422
|
+
jobDeliveries: () => jobDeliveries,
|
|
15263
16423
|
llmCalls: () => llmCalls,
|
|
15264
16424
|
mcpConnections: () => mcpConnections,
|
|
15265
16425
|
mcpServers: () => mcpServers,
|
|
16426
|
+
scheduleState: () => scheduleState,
|
|
15266
16427
|
sessions: () => sessions,
|
|
15267
16428
|
skillConnectors: () => skillConnectors,
|
|
15268
16429
|
skillVersions: () => skillVersions,
|
|
@@ -15270,6 +16431,7 @@ __export(schema_exports, {
|
|
|
15270
16431
|
toolCalls: () => toolCalls,
|
|
15271
16432
|
userProfiles: () => userProfiles,
|
|
15272
16433
|
users: () => users,
|
|
16434
|
+
verificationRuns: () => verificationRuns,
|
|
15273
16435
|
verifications: () => verifications,
|
|
15274
16436
|
webhookTriggers: () => webhookTriggers,
|
|
15275
16437
|
workspaceLocks: () => workspaceLocks
|
|
@@ -15291,6 +16453,7 @@ var init_schema2 = __esm({
|
|
|
15291
16453
|
init_webhooks();
|
|
15292
16454
|
init_skills();
|
|
15293
16455
|
init_schedules();
|
|
16456
|
+
init_schedule_state();
|
|
15294
16457
|
init_llm_keys();
|
|
15295
16458
|
init_mcp();
|
|
15296
16459
|
init_code_projects();
|
|
@@ -15304,6 +16467,9 @@ var init_schema2 = __esm({
|
|
|
15304
16467
|
init_channel_allowed_conversations();
|
|
15305
16468
|
init_cli_runs();
|
|
15306
16469
|
init_llm_calls();
|
|
16470
|
+
init_job_deliveries();
|
|
16471
|
+
init_verification2();
|
|
16472
|
+
init_job_checkpoints();
|
|
15307
16473
|
}
|
|
15308
16474
|
});
|
|
15309
16475
|
|
|
@@ -15522,9 +16688,9 @@ async function doRefresh(dbOrTx, credentialId, row, payload) {
|
|
|
15522
16688
|
throw err;
|
|
15523
16689
|
}
|
|
15524
16690
|
if (!response.ok) {
|
|
15525
|
-
const
|
|
16691
|
+
const text3 = await response.text().catch(() => "");
|
|
15526
16692
|
throw new Error(
|
|
15527
|
-
`refreshAndPersistCredential: token endpoint returned ${response.status}: ${
|
|
16693
|
+
`refreshAndPersistCredential: token endpoint returned ${response.status}: ${text3}`
|
|
15528
16694
|
);
|
|
15529
16695
|
}
|
|
15530
16696
|
const json2 = await response.json();
|
|
@@ -15941,19 +17107,20 @@ async function createAgentRepo(db, entityId, input) {
|
|
|
15941
17107
|
);
|
|
15942
17108
|
}
|
|
15943
17109
|
if (input.role === "orchestrator") {
|
|
15944
|
-
const
|
|
15945
|
-
|
|
15946
|
-
|
|
15947
|
-
|
|
15948
|
-
|
|
15949
|
-
|
|
15950
|
-
}).where(eq(entities.id, entityId));
|
|
15951
|
-
|
|
15952
|
-
|
|
15953
|
-
|
|
15954
|
-
|
|
15955
|
-
|
|
15956
|
-
|
|
17110
|
+
const claimed = await db.update(entities).set({
|
|
17111
|
+
rootAgentId: row.id,
|
|
17112
|
+
rootGrants: INITIAL_AUTO_ROOT_GRANTS,
|
|
17113
|
+
updatedAt: /* @__PURE__ */ new Date()
|
|
17114
|
+
}).where(and(eq(entities.id, entityId), isNull(entities.rootAgentId))).returning({ rootAgentId: entities.rootAgentId });
|
|
17115
|
+
if (claimed.length === 0) {
|
|
17116
|
+
const [ent] = await db.select({ rootAgentId: entities.rootAgentId }).from(entities).where(eq(entities.id, entityId)).limit(1);
|
|
17117
|
+
if (ent?.rootAgentId && ent.rootAgentId !== row.id) {
|
|
17118
|
+
await db.insert(agentAssignments).values({
|
|
17119
|
+
orchestratorId: ent.rootAgentId,
|
|
17120
|
+
subAgentId: row.id,
|
|
17121
|
+
entityId
|
|
17122
|
+
});
|
|
17123
|
+
}
|
|
15957
17124
|
}
|
|
15958
17125
|
}
|
|
15959
17126
|
if (input.assignToOrchestratorId && input.assignToOrchestratorId !== row.id) {
|
|
@@ -16197,6 +17364,73 @@ var init_retention = __esm({
|
|
|
16197
17364
|
}
|
|
16198
17365
|
});
|
|
16199
17366
|
|
|
17367
|
+
// ../../packages/db/src/repos/schedule-state.ts
|
|
17368
|
+
async function readScheduleState(db, scheduleId) {
|
|
17369
|
+
const rows = await db.select({
|
|
17370
|
+
key: scheduleState.key,
|
|
17371
|
+
value: scheduleState.value,
|
|
17372
|
+
updatedAt: scheduleState.updatedAt
|
|
17373
|
+
}).from(scheduleState).where(eq(scheduleState.scheduleId, scheduleId)).orderBy(asc(scheduleState.key));
|
|
17374
|
+
return rows.map((r) => ({ key: r.key, value: r.value, updatedAt: r.updatedAt }));
|
|
17375
|
+
}
|
|
17376
|
+
async function writeScheduleState(db, scheduleId, key, value) {
|
|
17377
|
+
const k = key.trim();
|
|
17378
|
+
if (k === "") throw new ScheduleStateRefused("The key is empty.");
|
|
17379
|
+
if (k.length > SCHEDULE_STATE_KEY_MAX) {
|
|
17380
|
+
throw new ScheduleStateRefused(
|
|
17381
|
+
`The key is ${k.length} characters; the limit is ${SCHEDULE_STATE_KEY_MAX}.`
|
|
17382
|
+
);
|
|
17383
|
+
}
|
|
17384
|
+
if (value.length > SCHEDULE_STATE_VALUE_MAX) {
|
|
17385
|
+
throw new ScheduleStateRefused(
|
|
17386
|
+
`The value is ${value.length} characters; the limit is ${SCHEDULE_STATE_VALUE_MAX}. State is what you need to recognise this run against the last one, not a report.`
|
|
17387
|
+
);
|
|
17388
|
+
}
|
|
17389
|
+
return db.transaction(async (tx) => {
|
|
17390
|
+
await tx.execute(
|
|
17391
|
+
sql`SELECT pg_advisory_xact_lock(hashtext(${`schedule_state:${scheduleId}`}))`
|
|
17392
|
+
);
|
|
17393
|
+
const [existing] = await tx.select({ key: scheduleState.key }).from(scheduleState).where(and(eq(scheduleState.scheduleId, scheduleId), eq(scheduleState.key, k))).limit(1);
|
|
17394
|
+
if (!existing) {
|
|
17395
|
+
const [{ n }] = await tx.select({ n: sql`count(*)::int` }).from(scheduleState).where(eq(scheduleState.scheduleId, scheduleId));
|
|
17396
|
+
if (n >= SCHEDULE_STATE_MAX_KEYS) {
|
|
17397
|
+
throw new ScheduleStateRefused(
|
|
17398
|
+
`This routine already holds ${n} state keys, the maximum. Reuse one of its existing keys instead of adding another \u2014 state is not a log.`
|
|
17399
|
+
);
|
|
17400
|
+
}
|
|
17401
|
+
}
|
|
17402
|
+
const now = /* @__PURE__ */ new Date();
|
|
17403
|
+
const [row] = await tx.insert(scheduleState).values({ scheduleId, key: k, value, createdAt: now, updatedAt: now }).onConflictDoUpdate({
|
|
17404
|
+
target: [scheduleState.scheduleId, scheduleState.key],
|
|
17405
|
+
set: { value, updatedAt: now }
|
|
17406
|
+
}).returning({
|
|
17407
|
+
key: scheduleState.key,
|
|
17408
|
+
value: scheduleState.value,
|
|
17409
|
+
updatedAt: scheduleState.updatedAt
|
|
17410
|
+
});
|
|
17411
|
+
if (!row) {
|
|
17412
|
+
throw new Error("schedule_state_write_failed");
|
|
17413
|
+
}
|
|
17414
|
+
return { key: row.key, value: row.value, updatedAt: row.updatedAt };
|
|
17415
|
+
});
|
|
17416
|
+
}
|
|
17417
|
+
var ScheduleStateRefused;
|
|
17418
|
+
var init_schedule_state2 = __esm({
|
|
17419
|
+
"../../packages/db/src/repos/schedule-state.ts"() {
|
|
17420
|
+
"use strict";
|
|
17421
|
+
init_drizzle_orm();
|
|
17422
|
+
init_schedule_state();
|
|
17423
|
+
ScheduleStateRefused = class extends Error {
|
|
17424
|
+
constructor(reason) {
|
|
17425
|
+
super(reason);
|
|
17426
|
+
this.reason = reason;
|
|
17427
|
+
this.name = "ScheduleStateRefused";
|
|
17428
|
+
}
|
|
17429
|
+
reason;
|
|
17430
|
+
};
|
|
17431
|
+
}
|
|
17432
|
+
});
|
|
17433
|
+
|
|
16200
17434
|
// ../../packages/db/src/repos/app-settings.ts
|
|
16201
17435
|
async function getAppSetting(db, key) {
|
|
16202
17436
|
const [row] = await db.select({ value: appSettings.value }).from(appSettings).where(eq(appSettings.key, key)).limit(1);
|
|
@@ -16231,6 +17465,21 @@ var init_app_settings2 = __esm({
|
|
|
16231
17465
|
}
|
|
16232
17466
|
});
|
|
16233
17467
|
|
|
17468
|
+
// ../../packages/db/src/repos/verification-surfaces.ts
|
|
17469
|
+
async function getVerificationSurfaces(db, entityId) {
|
|
17470
|
+
const [row] = await db.select({ verificationSurfaces: entities.verificationSurfaces }).from(entities).where(eq(entities.id, entityId)).limit(1);
|
|
17471
|
+
if (!row) throw new Error(`ENTITY_NOT_FOUND: ${entityId}`);
|
|
17472
|
+
return parseVerificationSurfaces(row.verificationSurfaces);
|
|
17473
|
+
}
|
|
17474
|
+
var init_verification_surfaces2 = __esm({
|
|
17475
|
+
"../../packages/db/src/repos/verification-surfaces.ts"() {
|
|
17476
|
+
"use strict";
|
|
17477
|
+
init_drizzle_orm();
|
|
17478
|
+
init_src2();
|
|
17479
|
+
init_schema2();
|
|
17480
|
+
}
|
|
17481
|
+
});
|
|
17482
|
+
|
|
16234
17483
|
// ../../packages/db/src/index.ts
|
|
16235
17484
|
var src_exports = {};
|
|
16236
17485
|
__export(src_exports, {
|
|
@@ -16250,7 +17499,11 @@ __export(src_exports, {
|
|
|
16250
17499
|
OPERATION_RISK_LEVELS: () => OPERATION_RISK_LEVELS,
|
|
16251
17500
|
ORCHESTRATOR_MODES: () => ORCHESTRATOR_MODES,
|
|
16252
17501
|
SCHEDULE_LAST_STATUSES: () => SCHEDULE_LAST_STATUSES,
|
|
17502
|
+
SCHEDULE_STATE_KEY_MAX: () => SCHEDULE_STATE_KEY_MAX,
|
|
17503
|
+
SCHEDULE_STATE_MAX_KEYS: () => SCHEDULE_STATE_MAX_KEYS,
|
|
17504
|
+
SCHEDULE_STATE_VALUE_MAX: () => SCHEDULE_STATE_VALUE_MAX,
|
|
16253
17505
|
SCHEDULE_TYPES: () => SCHEDULE_TYPES,
|
|
17506
|
+
ScheduleStateRefused: () => ScheduleStateRefused,
|
|
16254
17507
|
TASK_PRIORITIES: () => TASK_PRIORITIES,
|
|
16255
17508
|
TASK_STATUSES: () => TASK_STATUSES,
|
|
16256
17509
|
accounts: () => accounts,
|
|
@@ -16308,6 +17561,7 @@ __export(src_exports, {
|
|
|
16308
17561
|
getEntitySetting: () => getEntitySetting,
|
|
16309
17562
|
getInstallNotes: () => getInstallNotes,
|
|
16310
17563
|
getMcpApprovalContext: () => getMcpApprovalContext,
|
|
17564
|
+
getVerificationSurfaces: () => getVerificationSurfaces,
|
|
16311
17565
|
gt: () => gt,
|
|
16312
17566
|
gte: () => gte,
|
|
16313
17567
|
ilike: () => ilike,
|
|
@@ -16316,6 +17570,9 @@ __export(src_exports, {
|
|
|
16316
17570
|
isConversationAllowed: () => isConversationAllowed,
|
|
16317
17571
|
isNotNull: () => isNotNull,
|
|
16318
17572
|
isNull: () => isNull,
|
|
17573
|
+
jobCheckpoints: () => jobCheckpoints,
|
|
17574
|
+
jobDeliverableVerificationState: () => jobDeliverableVerificationState,
|
|
17575
|
+
jobDeliveries: () => jobDeliveries,
|
|
16319
17576
|
like: () => like,
|
|
16320
17577
|
listAllowedConversations: () => listAllowedConversations,
|
|
16321
17578
|
listChannelBindings: () => listChannelBindings,
|
|
@@ -16331,9 +17588,11 @@ __export(src_exports, {
|
|
|
16331
17588
|
notInArray: () => notInArray,
|
|
16332
17589
|
or: () => or,
|
|
16333
17590
|
pruneOldJobs: () => pruneOldJobs,
|
|
17591
|
+
readScheduleState: () => readScheduleState,
|
|
16334
17592
|
refreshAndPersistCredential: () => refreshAndPersistCredential,
|
|
16335
17593
|
resolveOwnerChatId: () => resolveOwnerChatId,
|
|
16336
17594
|
resolveOwnerConversation: () => resolveOwnerConversation,
|
|
17595
|
+
scheduleState: () => scheduleState,
|
|
16337
17596
|
sessions: () => sessions,
|
|
16338
17597
|
setAppSetting: () => setAppSetting,
|
|
16339
17598
|
setEntitySetting: () => setEntitySetting,
|
|
@@ -16352,10 +17611,12 @@ __export(src_exports, {
|
|
|
16352
17611
|
updateSkillRepo: () => updateSkillRepo,
|
|
16353
17612
|
userProfiles: () => userProfiles,
|
|
16354
17613
|
users: () => users,
|
|
17614
|
+
verificationRuns: () => verificationRuns,
|
|
16355
17615
|
verifications: () => verifications,
|
|
16356
17616
|
webhookTriggers: () => webhookTriggers,
|
|
16357
17617
|
withTransaction: () => withTransaction,
|
|
16358
|
-
workspaceLocks: () => workspaceLocks
|
|
17618
|
+
workspaceLocks: () => workspaceLocks,
|
|
17619
|
+
writeScheduleState: () => writeScheduleState
|
|
16359
17620
|
});
|
|
16360
17621
|
var init_src4 = __esm({
|
|
16361
17622
|
"../../packages/db/src/index.ts"() {
|
|
@@ -16372,7 +17633,9 @@ var init_src4 = __esm({
|
|
|
16372
17633
|
init_agents2();
|
|
16373
17634
|
init_skills2();
|
|
16374
17635
|
init_retention();
|
|
17636
|
+
init_schedule_state2();
|
|
16375
17637
|
init_app_settings2();
|
|
17638
|
+
init_verification_surfaces2();
|
|
16376
17639
|
init_drizzle_orm();
|
|
16377
17640
|
}
|
|
16378
17641
|
});
|
|
@@ -17990,9 +19253,9 @@ var init_logs = __esm({
|
|
|
17990
19253
|
});
|
|
17991
19254
|
|
|
17992
19255
|
// ../../packages/checkpoints/src/checkpoints.ts
|
|
17993
|
-
import { execFile } from "child_process";
|
|
17994
|
-
import { createHash as createHash3 } from "crypto";
|
|
17995
|
-
import { mkdir, writeFile } from "fs/promises";
|
|
19256
|
+
import { execFile, spawn } from "child_process";
|
|
19257
|
+
import { createHash as createHash3, randomBytes as randomBytes6 } from "crypto";
|
|
19258
|
+
import { mkdir, rm, writeFile } from "fs/promises";
|
|
17996
19259
|
import { existsSync as existsSync11 } from "fs";
|
|
17997
19260
|
import { join as join10 } from "path";
|
|
17998
19261
|
import { promisify } from "util";
|
|
@@ -18004,28 +19267,32 @@ function workspaceKey(workspace) {
|
|
|
18004
19267
|
norm = norm.replace(/[\\/]+$/, "");
|
|
18005
19268
|
return createHash3("sha256").update(norm).digest("hex").slice(0, 16);
|
|
18006
19269
|
}
|
|
18007
|
-
|
|
19270
|
+
function gitEnv(store, workspace, indexFile) {
|
|
18008
19271
|
const key = workspaceKey(workspace);
|
|
19272
|
+
return {
|
|
19273
|
+
...process.env,
|
|
19274
|
+
GIT_DIR: join10(store, "store"),
|
|
19275
|
+
GIT_WORK_TREE: workspace,
|
|
19276
|
+
// A per-workspace index: two workspaces snapshotting at once must not
|
|
19277
|
+
// stomp on each other's staging area. A READ (diffFile) brings its own
|
|
19278
|
+
// temporary index instead — see diffFile — so it never touches this one.
|
|
19279
|
+
GIT_INDEX_FILE: indexFile ?? join10(store, "indexes", key),
|
|
19280
|
+
// A checkpoint is machinery, not authorship. Identity is fixed so it can
|
|
19281
|
+
// never depend on — or leak — the owner's git config.
|
|
19282
|
+
GIT_AUTHOR_NAME: "Nodal checkpoints",
|
|
19283
|
+
GIT_AUTHOR_EMAIL: "checkpoints@nodal.local",
|
|
19284
|
+
GIT_COMMITTER_NAME: "Nodal checkpoints",
|
|
19285
|
+
GIT_COMMITTER_EMAIL: "checkpoints@nodal.local",
|
|
19286
|
+
// The owner's global config must not change what we store or how.
|
|
19287
|
+
GIT_CONFIG_GLOBAL: join10(store, "gitconfig"),
|
|
19288
|
+
GIT_CONFIG_SYSTEM: join10(store, "gitconfig")
|
|
19289
|
+
};
|
|
19290
|
+
}
|
|
19291
|
+
async function git(store, workspace, args, indexFile) {
|
|
18009
19292
|
const { stdout } = await run("git", args, {
|
|
18010
19293
|
timeout: GIT_TIMEOUT_MS,
|
|
18011
19294
|
windowsHide: true,
|
|
18012
|
-
env:
|
|
18013
|
-
...process.env,
|
|
18014
|
-
GIT_DIR: join10(store, "store"),
|
|
18015
|
-
GIT_WORK_TREE: workspace,
|
|
18016
|
-
// A per-workspace index: two workspaces snapshotting at once must not
|
|
18017
|
-
// stomp on each other's staging area.
|
|
18018
|
-
GIT_INDEX_FILE: join10(store, "indexes", key),
|
|
18019
|
-
// A checkpoint is machinery, not authorship. Identity is fixed so it can
|
|
18020
|
-
// never depend on — or leak — the owner's git config.
|
|
18021
|
-
GIT_AUTHOR_NAME: "Nodal checkpoints",
|
|
18022
|
-
GIT_AUTHOR_EMAIL: "checkpoints@nodal.local",
|
|
18023
|
-
GIT_COMMITTER_NAME: "Nodal checkpoints",
|
|
18024
|
-
GIT_COMMITTER_EMAIL: "checkpoints@nodal.local",
|
|
18025
|
-
// The owner's global config must not change what we store or how.
|
|
18026
|
-
GIT_CONFIG_GLOBAL: join10(store, "gitconfig"),
|
|
18027
|
-
GIT_CONFIG_SYSTEM: join10(store, "gitconfig")
|
|
18028
|
-
}
|
|
19295
|
+
env: gitEnv(store, workspace, indexFile)
|
|
18029
19296
|
});
|
|
18030
19297
|
return stdout.trim();
|
|
18031
19298
|
}
|
|
@@ -18352,7 +19619,7 @@ var init_zod_compat = __esm({
|
|
|
18352
19619
|
});
|
|
18353
19620
|
|
|
18354
19621
|
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.29.0_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
|
|
18355
|
-
import * as
|
|
19622
|
+
import * as z25 from "zod/v4";
|
|
18356
19623
|
function assertCompleteRequestPrompt(request) {
|
|
18357
19624
|
if (request.params.ref.type !== "ref/prompt") {
|
|
18358
19625
|
throw new TypeError(`Expected CompleteRequestPrompt, but got ${request.params.ref.type}`);
|
|
@@ -18373,26 +19640,26 @@ var init_types3 = __esm({
|
|
|
18373
19640
|
SUPPORTED_PROTOCOL_VERSIONS = [LATEST_PROTOCOL_VERSION, "2025-06-18", "2025-03-26", "2024-11-05", "2024-10-07"];
|
|
18374
19641
|
RELATED_TASK_META_KEY = "io.modelcontextprotocol/related-task";
|
|
18375
19642
|
JSONRPC_VERSION = "2.0";
|
|
18376
|
-
AssertObjectSchema =
|
|
18377
|
-
ProgressTokenSchema =
|
|
18378
|
-
CursorSchema =
|
|
18379
|
-
TaskCreationParamsSchema =
|
|
19643
|
+
AssertObjectSchema = z25.custom((v) => v !== null && (typeof v === "object" || typeof v === "function"));
|
|
19644
|
+
ProgressTokenSchema = z25.union([z25.string(), z25.number().int()]);
|
|
19645
|
+
CursorSchema = z25.string();
|
|
19646
|
+
TaskCreationParamsSchema = z25.looseObject({
|
|
18380
19647
|
/**
|
|
18381
19648
|
* Requested duration in milliseconds to retain task from creation.
|
|
18382
19649
|
*/
|
|
18383
|
-
ttl:
|
|
19650
|
+
ttl: z25.number().optional(),
|
|
18384
19651
|
/**
|
|
18385
19652
|
* Time in milliseconds to wait between task status requests.
|
|
18386
19653
|
*/
|
|
18387
|
-
pollInterval:
|
|
19654
|
+
pollInterval: z25.number().optional()
|
|
18388
19655
|
});
|
|
18389
|
-
TaskMetadataSchema =
|
|
18390
|
-
ttl:
|
|
19656
|
+
TaskMetadataSchema = z25.object({
|
|
19657
|
+
ttl: z25.number().optional()
|
|
18391
19658
|
});
|
|
18392
|
-
RelatedTaskMetadataSchema =
|
|
18393
|
-
taskId:
|
|
19659
|
+
RelatedTaskMetadataSchema = z25.object({
|
|
19660
|
+
taskId: z25.string()
|
|
18394
19661
|
});
|
|
18395
|
-
RequestMetaSchema =
|
|
19662
|
+
RequestMetaSchema = z25.looseObject({
|
|
18396
19663
|
/**
|
|
18397
19664
|
* 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.
|
|
18398
19665
|
*/
|
|
@@ -18402,7 +19669,7 @@ var init_types3 = __esm({
|
|
|
18402
19669
|
*/
|
|
18403
19670
|
[RELATED_TASK_META_KEY]: RelatedTaskMetadataSchema.optional()
|
|
18404
19671
|
});
|
|
18405
|
-
BaseRequestParamsSchema =
|
|
19672
|
+
BaseRequestParamsSchema = z25.object({
|
|
18406
19673
|
/**
|
|
18407
19674
|
* See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage.
|
|
18408
19675
|
*/
|
|
@@ -18420,42 +19687,42 @@ var init_types3 = __esm({
|
|
|
18420
19687
|
task: TaskMetadataSchema.optional()
|
|
18421
19688
|
});
|
|
18422
19689
|
isTaskAugmentedRequestParams = (value) => TaskAugmentedRequestParamsSchema.safeParse(value).success;
|
|
18423
|
-
RequestSchema =
|
|
18424
|
-
method:
|
|
19690
|
+
RequestSchema = z25.object({
|
|
19691
|
+
method: z25.string(),
|
|
18425
19692
|
params: BaseRequestParamsSchema.loose().optional()
|
|
18426
19693
|
});
|
|
18427
|
-
NotificationsParamsSchema =
|
|
19694
|
+
NotificationsParamsSchema = z25.object({
|
|
18428
19695
|
/**
|
|
18429
19696
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
18430
19697
|
* for notes on _meta usage.
|
|
18431
19698
|
*/
|
|
18432
19699
|
_meta: RequestMetaSchema.optional()
|
|
18433
19700
|
});
|
|
18434
|
-
NotificationSchema =
|
|
18435
|
-
method:
|
|
19701
|
+
NotificationSchema = z25.object({
|
|
19702
|
+
method: z25.string(),
|
|
18436
19703
|
params: NotificationsParamsSchema.loose().optional()
|
|
18437
19704
|
});
|
|
18438
|
-
ResultSchema =
|
|
19705
|
+
ResultSchema = z25.looseObject({
|
|
18439
19706
|
/**
|
|
18440
19707
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
18441
19708
|
* for notes on _meta usage.
|
|
18442
19709
|
*/
|
|
18443
19710
|
_meta: RequestMetaSchema.optional()
|
|
18444
19711
|
});
|
|
18445
|
-
RequestIdSchema =
|
|
18446
|
-
JSONRPCRequestSchema =
|
|
18447
|
-
jsonrpc:
|
|
19712
|
+
RequestIdSchema = z25.union([z25.string(), z25.number().int()]);
|
|
19713
|
+
JSONRPCRequestSchema = z25.object({
|
|
19714
|
+
jsonrpc: z25.literal(JSONRPC_VERSION),
|
|
18448
19715
|
id: RequestIdSchema,
|
|
18449
19716
|
...RequestSchema.shape
|
|
18450
19717
|
}).strict();
|
|
18451
19718
|
isJSONRPCRequest = (value) => JSONRPCRequestSchema.safeParse(value).success;
|
|
18452
|
-
JSONRPCNotificationSchema =
|
|
18453
|
-
jsonrpc:
|
|
19719
|
+
JSONRPCNotificationSchema = z25.object({
|
|
19720
|
+
jsonrpc: z25.literal(JSONRPC_VERSION),
|
|
18454
19721
|
...NotificationSchema.shape
|
|
18455
19722
|
}).strict();
|
|
18456
19723
|
isJSONRPCNotification = (value) => JSONRPCNotificationSchema.safeParse(value).success;
|
|
18457
|
-
JSONRPCResultResponseSchema =
|
|
18458
|
-
jsonrpc:
|
|
19724
|
+
JSONRPCResultResponseSchema = z25.object({
|
|
19725
|
+
jsonrpc: z25.literal(JSONRPC_VERSION),
|
|
18459
19726
|
id: RequestIdSchema,
|
|
18460
19727
|
result: ResultSchema
|
|
18461
19728
|
}).strict();
|
|
@@ -18470,32 +19737,32 @@ var init_types3 = __esm({
|
|
|
18470
19737
|
ErrorCode2[ErrorCode2["InternalError"] = -32603] = "InternalError";
|
|
18471
19738
|
ErrorCode2[ErrorCode2["UrlElicitationRequired"] = -32042] = "UrlElicitationRequired";
|
|
18472
19739
|
})(ErrorCode || (ErrorCode = {}));
|
|
18473
|
-
JSONRPCErrorResponseSchema =
|
|
18474
|
-
jsonrpc:
|
|
19740
|
+
JSONRPCErrorResponseSchema = z25.object({
|
|
19741
|
+
jsonrpc: z25.literal(JSONRPC_VERSION),
|
|
18475
19742
|
id: RequestIdSchema.optional(),
|
|
18476
|
-
error:
|
|
19743
|
+
error: z25.object({
|
|
18477
19744
|
/**
|
|
18478
19745
|
* The error type that occurred.
|
|
18479
19746
|
*/
|
|
18480
|
-
code:
|
|
19747
|
+
code: z25.number().int(),
|
|
18481
19748
|
/**
|
|
18482
19749
|
* A short description of the error. The message SHOULD be limited to a concise single sentence.
|
|
18483
19750
|
*/
|
|
18484
|
-
message:
|
|
19751
|
+
message: z25.string(),
|
|
18485
19752
|
/**
|
|
18486
19753
|
* Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.).
|
|
18487
19754
|
*/
|
|
18488
|
-
data:
|
|
19755
|
+
data: z25.unknown().optional()
|
|
18489
19756
|
})
|
|
18490
19757
|
}).strict();
|
|
18491
19758
|
isJSONRPCErrorResponse = (value) => JSONRPCErrorResponseSchema.safeParse(value).success;
|
|
18492
|
-
JSONRPCMessageSchema =
|
|
19759
|
+
JSONRPCMessageSchema = z25.union([
|
|
18493
19760
|
JSONRPCRequestSchema,
|
|
18494
19761
|
JSONRPCNotificationSchema,
|
|
18495
19762
|
JSONRPCResultResponseSchema,
|
|
18496
19763
|
JSONRPCErrorResponseSchema
|
|
18497
19764
|
]);
|
|
18498
|
-
JSONRPCResponseSchema =
|
|
19765
|
+
JSONRPCResponseSchema = z25.union([JSONRPCResultResponseSchema, JSONRPCErrorResponseSchema]);
|
|
18499
19766
|
EmptyResultSchema = ResultSchema.strict();
|
|
18500
19767
|
CancelledNotificationParamsSchema = NotificationsParamsSchema.extend({
|
|
18501
19768
|
/**
|
|
@@ -18507,28 +19774,28 @@ var init_types3 = __esm({
|
|
|
18507
19774
|
/**
|
|
18508
19775
|
* An optional string describing the reason for the cancellation. This MAY be logged or presented to the user.
|
|
18509
19776
|
*/
|
|
18510
|
-
reason:
|
|
19777
|
+
reason: z25.string().optional()
|
|
18511
19778
|
});
|
|
18512
19779
|
CancelledNotificationSchema = NotificationSchema.extend({
|
|
18513
|
-
method:
|
|
19780
|
+
method: z25.literal("notifications/cancelled"),
|
|
18514
19781
|
params: CancelledNotificationParamsSchema
|
|
18515
19782
|
});
|
|
18516
|
-
IconSchema =
|
|
19783
|
+
IconSchema = z25.object({
|
|
18517
19784
|
/**
|
|
18518
19785
|
* URL or data URI for the icon.
|
|
18519
19786
|
*/
|
|
18520
|
-
src:
|
|
19787
|
+
src: z25.string(),
|
|
18521
19788
|
/**
|
|
18522
19789
|
* Optional MIME type for the icon.
|
|
18523
19790
|
*/
|
|
18524
|
-
mimeType:
|
|
19791
|
+
mimeType: z25.string().optional(),
|
|
18525
19792
|
/**
|
|
18526
19793
|
* Optional array of strings that specify sizes at which the icon can be used.
|
|
18527
19794
|
* Each string should be in WxH format (e.g., `"48x48"`, `"96x96"`) or `"any"` for scalable formats like SVG.
|
|
18528
19795
|
*
|
|
18529
19796
|
* If not provided, the client should assume that the icon can be used at any size.
|
|
18530
19797
|
*/
|
|
18531
|
-
sizes:
|
|
19798
|
+
sizes: z25.array(z25.string()).optional(),
|
|
18532
19799
|
/**
|
|
18533
19800
|
* Optional specifier for the theme this icon is designed for. `light` indicates
|
|
18534
19801
|
* the icon is designed to be used with a light background, and `dark` indicates
|
|
@@ -18536,9 +19803,9 @@ var init_types3 = __esm({
|
|
|
18536
19803
|
*
|
|
18537
19804
|
* If not provided, the client should assume the icon can be used with any theme.
|
|
18538
19805
|
*/
|
|
18539
|
-
theme:
|
|
19806
|
+
theme: z25.enum(["light", "dark"]).optional()
|
|
18540
19807
|
});
|
|
18541
|
-
IconsSchema =
|
|
19808
|
+
IconsSchema = z25.object({
|
|
18542
19809
|
/**
|
|
18543
19810
|
* Optional set of sized icons that the client can display in a user interface.
|
|
18544
19811
|
*
|
|
@@ -18550,11 +19817,11 @@ var init_types3 = __esm({
|
|
|
18550
19817
|
* - `image/svg+xml` - SVG images (scalable but requires security precautions)
|
|
18551
19818
|
* - `image/webp` - WebP images (modern, efficient format)
|
|
18552
19819
|
*/
|
|
18553
|
-
icons:
|
|
19820
|
+
icons: z25.array(IconSchema).optional()
|
|
18554
19821
|
});
|
|
18555
|
-
BaseMetadataSchema =
|
|
19822
|
+
BaseMetadataSchema = z25.object({
|
|
18556
19823
|
/** Intended for programmatic or logical use, but used as a display name in past specs or fallback */
|
|
18557
|
-
name:
|
|
19824
|
+
name: z25.string(),
|
|
18558
19825
|
/**
|
|
18559
19826
|
* Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
|
|
18560
19827
|
* even by those unfamiliar with domain-specific terminology.
|
|
@@ -18563,16 +19830,16 @@ var init_types3 = __esm({
|
|
|
18563
19830
|
* where `annotations.title` should be given precedence over using `name`,
|
|
18564
19831
|
* if present).
|
|
18565
19832
|
*/
|
|
18566
|
-
title:
|
|
19833
|
+
title: z25.string().optional()
|
|
18567
19834
|
});
|
|
18568
19835
|
ImplementationSchema = BaseMetadataSchema.extend({
|
|
18569
19836
|
...BaseMetadataSchema.shape,
|
|
18570
19837
|
...IconsSchema.shape,
|
|
18571
|
-
version:
|
|
19838
|
+
version: z25.string(),
|
|
18572
19839
|
/**
|
|
18573
19840
|
* An optional URL of the website for this implementation.
|
|
18574
19841
|
*/
|
|
18575
|
-
websiteUrl:
|
|
19842
|
+
websiteUrl: z25.string().optional(),
|
|
18576
19843
|
/**
|
|
18577
19844
|
* An optional human-readable description of what this implementation does.
|
|
18578
19845
|
*
|
|
@@ -18580,23 +19847,23 @@ var init_types3 = __esm({
|
|
|
18580
19847
|
* and capabilities. For example, a server might describe the types of resources
|
|
18581
19848
|
* or tools it provides, while a client might describe its intended use case.
|
|
18582
19849
|
*/
|
|
18583
|
-
description:
|
|
19850
|
+
description: z25.string().optional()
|
|
18584
19851
|
});
|
|
18585
|
-
FormElicitationCapabilitySchema =
|
|
18586
|
-
applyDefaults:
|
|
18587
|
-
}),
|
|
18588
|
-
ElicitationCapabilitySchema =
|
|
19852
|
+
FormElicitationCapabilitySchema = z25.intersection(z25.object({
|
|
19853
|
+
applyDefaults: z25.boolean().optional()
|
|
19854
|
+
}), z25.record(z25.string(), z25.unknown()));
|
|
19855
|
+
ElicitationCapabilitySchema = z25.preprocess((value) => {
|
|
18589
19856
|
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
18590
19857
|
if (Object.keys(value).length === 0) {
|
|
18591
19858
|
return { form: {} };
|
|
18592
19859
|
}
|
|
18593
19860
|
}
|
|
18594
19861
|
return value;
|
|
18595
|
-
},
|
|
19862
|
+
}, z25.intersection(z25.object({
|
|
18596
19863
|
form: FormElicitationCapabilitySchema.optional(),
|
|
18597
19864
|
url: AssertObjectSchema.optional()
|
|
18598
|
-
}),
|
|
18599
|
-
ClientTasksCapabilitySchema =
|
|
19865
|
+
}), z25.record(z25.string(), z25.unknown()).optional()));
|
|
19866
|
+
ClientTasksCapabilitySchema = z25.looseObject({
|
|
18600
19867
|
/**
|
|
18601
19868
|
* Present if the client supports listing tasks.
|
|
18602
19869
|
*/
|
|
@@ -18608,22 +19875,22 @@ var init_types3 = __esm({
|
|
|
18608
19875
|
/**
|
|
18609
19876
|
* Capabilities for task creation on specific request types.
|
|
18610
19877
|
*/
|
|
18611
|
-
requests:
|
|
19878
|
+
requests: z25.looseObject({
|
|
18612
19879
|
/**
|
|
18613
19880
|
* Task support for sampling requests.
|
|
18614
19881
|
*/
|
|
18615
|
-
sampling:
|
|
19882
|
+
sampling: z25.looseObject({
|
|
18616
19883
|
createMessage: AssertObjectSchema.optional()
|
|
18617
19884
|
}).optional(),
|
|
18618
19885
|
/**
|
|
18619
19886
|
* Task support for elicitation requests.
|
|
18620
19887
|
*/
|
|
18621
|
-
elicitation:
|
|
19888
|
+
elicitation: z25.looseObject({
|
|
18622
19889
|
create: AssertObjectSchema.optional()
|
|
18623
19890
|
}).optional()
|
|
18624
19891
|
}).optional()
|
|
18625
19892
|
});
|
|
18626
|
-
ServerTasksCapabilitySchema =
|
|
19893
|
+
ServerTasksCapabilitySchema = z25.looseObject({
|
|
18627
19894
|
/**
|
|
18628
19895
|
* Present if the server supports listing tasks.
|
|
18629
19896
|
*/
|
|
@@ -18635,24 +19902,24 @@ var init_types3 = __esm({
|
|
|
18635
19902
|
/**
|
|
18636
19903
|
* Capabilities for task creation on specific request types.
|
|
18637
19904
|
*/
|
|
18638
|
-
requests:
|
|
19905
|
+
requests: z25.looseObject({
|
|
18639
19906
|
/**
|
|
18640
19907
|
* Task support for tool requests.
|
|
18641
19908
|
*/
|
|
18642
|
-
tools:
|
|
19909
|
+
tools: z25.looseObject({
|
|
18643
19910
|
call: AssertObjectSchema.optional()
|
|
18644
19911
|
}).optional()
|
|
18645
19912
|
}).optional()
|
|
18646
19913
|
});
|
|
18647
|
-
ClientCapabilitiesSchema =
|
|
19914
|
+
ClientCapabilitiesSchema = z25.object({
|
|
18648
19915
|
/**
|
|
18649
19916
|
* Experimental, non-standard capabilities that the client supports.
|
|
18650
19917
|
*/
|
|
18651
|
-
experimental:
|
|
19918
|
+
experimental: z25.record(z25.string(), AssertObjectSchema).optional(),
|
|
18652
19919
|
/**
|
|
18653
19920
|
* Present if the client supports sampling from an LLM.
|
|
18654
19921
|
*/
|
|
18655
|
-
sampling:
|
|
19922
|
+
sampling: z25.object({
|
|
18656
19923
|
/**
|
|
18657
19924
|
* Present if the client supports context inclusion via includeContext parameter.
|
|
18658
19925
|
* If not declared, servers SHOULD only use `includeContext: "none"` (or omit it).
|
|
@@ -18670,11 +19937,11 @@ var init_types3 = __esm({
|
|
|
18670
19937
|
/**
|
|
18671
19938
|
* Present if the client supports listing roots.
|
|
18672
19939
|
*/
|
|
18673
|
-
roots:
|
|
19940
|
+
roots: z25.object({
|
|
18674
19941
|
/**
|
|
18675
19942
|
* Whether the client supports issuing notifications for changes to the roots list.
|
|
18676
19943
|
*/
|
|
18677
|
-
listChanged:
|
|
19944
|
+
listChanged: z25.boolean().optional()
|
|
18678
19945
|
}).optional(),
|
|
18679
19946
|
/**
|
|
18680
19947
|
* Present if the client supports task creation.
|
|
@@ -18683,25 +19950,25 @@ var init_types3 = __esm({
|
|
|
18683
19950
|
/**
|
|
18684
19951
|
* Extensions that the client supports. Keys are extension identifiers (vendor-prefix/extension-name).
|
|
18685
19952
|
*/
|
|
18686
|
-
extensions:
|
|
19953
|
+
extensions: z25.record(z25.string(), AssertObjectSchema).optional()
|
|
18687
19954
|
});
|
|
18688
19955
|
InitializeRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
18689
19956
|
/**
|
|
18690
19957
|
* The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well.
|
|
18691
19958
|
*/
|
|
18692
|
-
protocolVersion:
|
|
19959
|
+
protocolVersion: z25.string(),
|
|
18693
19960
|
capabilities: ClientCapabilitiesSchema,
|
|
18694
19961
|
clientInfo: ImplementationSchema
|
|
18695
19962
|
});
|
|
18696
19963
|
InitializeRequestSchema = RequestSchema.extend({
|
|
18697
|
-
method:
|
|
19964
|
+
method: z25.literal("initialize"),
|
|
18698
19965
|
params: InitializeRequestParamsSchema
|
|
18699
19966
|
});
|
|
18700
|
-
ServerCapabilitiesSchema =
|
|
19967
|
+
ServerCapabilitiesSchema = z25.object({
|
|
18701
19968
|
/**
|
|
18702
19969
|
* Experimental, non-standard capabilities that the server supports.
|
|
18703
19970
|
*/
|
|
18704
|
-
experimental:
|
|
19971
|
+
experimental: z25.record(z25.string(), AssertObjectSchema).optional(),
|
|
18705
19972
|
/**
|
|
18706
19973
|
* Present if the server supports sending log messages to the client.
|
|
18707
19974
|
*/
|
|
@@ -18713,33 +19980,33 @@ var init_types3 = __esm({
|
|
|
18713
19980
|
/**
|
|
18714
19981
|
* Present if the server offers any prompt templates.
|
|
18715
19982
|
*/
|
|
18716
|
-
prompts:
|
|
19983
|
+
prompts: z25.object({
|
|
18717
19984
|
/**
|
|
18718
19985
|
* Whether this server supports issuing notifications for changes to the prompt list.
|
|
18719
19986
|
*/
|
|
18720
|
-
listChanged:
|
|
19987
|
+
listChanged: z25.boolean().optional()
|
|
18721
19988
|
}).optional(),
|
|
18722
19989
|
/**
|
|
18723
19990
|
* Present if the server offers any resources to read.
|
|
18724
19991
|
*/
|
|
18725
|
-
resources:
|
|
19992
|
+
resources: z25.object({
|
|
18726
19993
|
/**
|
|
18727
19994
|
* Whether this server supports clients subscribing to resource updates.
|
|
18728
19995
|
*/
|
|
18729
|
-
subscribe:
|
|
19996
|
+
subscribe: z25.boolean().optional(),
|
|
18730
19997
|
/**
|
|
18731
19998
|
* Whether this server supports issuing notifications for changes to the resource list.
|
|
18732
19999
|
*/
|
|
18733
|
-
listChanged:
|
|
20000
|
+
listChanged: z25.boolean().optional()
|
|
18734
20001
|
}).optional(),
|
|
18735
20002
|
/**
|
|
18736
20003
|
* Present if the server offers any tools to call.
|
|
18737
20004
|
*/
|
|
18738
|
-
tools:
|
|
20005
|
+
tools: z25.object({
|
|
18739
20006
|
/**
|
|
18740
20007
|
* Whether this server supports issuing notifications for changes to the tool list.
|
|
18741
20008
|
*/
|
|
18742
|
-
listChanged:
|
|
20009
|
+
listChanged: z25.boolean().optional()
|
|
18743
20010
|
}).optional(),
|
|
18744
20011
|
/**
|
|
18745
20012
|
* Present if the server supports task creation.
|
|
@@ -18748,13 +20015,13 @@ var init_types3 = __esm({
|
|
|
18748
20015
|
/**
|
|
18749
20016
|
* Extensions that the server supports. Keys are extension identifiers (vendor-prefix/extension-name).
|
|
18750
20017
|
*/
|
|
18751
|
-
extensions:
|
|
20018
|
+
extensions: z25.record(z25.string(), AssertObjectSchema).optional()
|
|
18752
20019
|
});
|
|
18753
20020
|
InitializeResultSchema = ResultSchema.extend({
|
|
18754
20021
|
/**
|
|
18755
20022
|
* 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.
|
|
18756
20023
|
*/
|
|
18757
|
-
protocolVersion:
|
|
20024
|
+
protocolVersion: z25.string(),
|
|
18758
20025
|
capabilities: ServerCapabilitiesSchema,
|
|
18759
20026
|
serverInfo: ImplementationSchema,
|
|
18760
20027
|
/**
|
|
@@ -18762,31 +20029,31 @@ var init_types3 = __esm({
|
|
|
18762
20029
|
*
|
|
18763
20030
|
* 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.
|
|
18764
20031
|
*/
|
|
18765
|
-
instructions:
|
|
20032
|
+
instructions: z25.string().optional()
|
|
18766
20033
|
});
|
|
18767
20034
|
InitializedNotificationSchema = NotificationSchema.extend({
|
|
18768
|
-
method:
|
|
20035
|
+
method: z25.literal("notifications/initialized"),
|
|
18769
20036
|
params: NotificationsParamsSchema.optional()
|
|
18770
20037
|
});
|
|
18771
20038
|
PingRequestSchema = RequestSchema.extend({
|
|
18772
|
-
method:
|
|
20039
|
+
method: z25.literal("ping"),
|
|
18773
20040
|
params: BaseRequestParamsSchema.optional()
|
|
18774
20041
|
});
|
|
18775
|
-
ProgressSchema =
|
|
20042
|
+
ProgressSchema = z25.object({
|
|
18776
20043
|
/**
|
|
18777
20044
|
* The progress thus far. This should increase every time progress is made, even if the total is unknown.
|
|
18778
20045
|
*/
|
|
18779
|
-
progress:
|
|
20046
|
+
progress: z25.number(),
|
|
18780
20047
|
/**
|
|
18781
20048
|
* Total number of items to process (or total progress required), if known.
|
|
18782
20049
|
*/
|
|
18783
|
-
total:
|
|
20050
|
+
total: z25.optional(z25.number()),
|
|
18784
20051
|
/**
|
|
18785
20052
|
* An optional message describing the current progress.
|
|
18786
20053
|
*/
|
|
18787
|
-
message:
|
|
20054
|
+
message: z25.optional(z25.string())
|
|
18788
20055
|
});
|
|
18789
|
-
ProgressNotificationParamsSchema =
|
|
20056
|
+
ProgressNotificationParamsSchema = z25.object({
|
|
18790
20057
|
...NotificationsParamsSchema.shape,
|
|
18791
20058
|
...ProgressSchema.shape,
|
|
18792
20059
|
/**
|
|
@@ -18795,7 +20062,7 @@ var init_types3 = __esm({
|
|
|
18795
20062
|
progressToken: ProgressTokenSchema
|
|
18796
20063
|
});
|
|
18797
20064
|
ProgressNotificationSchema = NotificationSchema.extend({
|
|
18798
|
-
method:
|
|
20065
|
+
method: z25.literal("notifications/progress"),
|
|
18799
20066
|
params: ProgressNotificationParamsSchema
|
|
18800
20067
|
});
|
|
18801
20068
|
PaginatedRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
@@ -18815,86 +20082,86 @@ var init_types3 = __esm({
|
|
|
18815
20082
|
*/
|
|
18816
20083
|
nextCursor: CursorSchema.optional()
|
|
18817
20084
|
});
|
|
18818
|
-
TaskStatusSchema2 =
|
|
18819
|
-
TaskSchema =
|
|
18820
|
-
taskId:
|
|
20085
|
+
TaskStatusSchema2 = z25.enum(["working", "input_required", "completed", "failed", "cancelled"]);
|
|
20086
|
+
TaskSchema = z25.object({
|
|
20087
|
+
taskId: z25.string(),
|
|
18821
20088
|
status: TaskStatusSchema2,
|
|
18822
20089
|
/**
|
|
18823
20090
|
* Time in milliseconds to keep task results available after completion.
|
|
18824
20091
|
* If null, the task has unlimited lifetime until manually cleaned up.
|
|
18825
20092
|
*/
|
|
18826
|
-
ttl:
|
|
20093
|
+
ttl: z25.union([z25.number(), z25.null()]),
|
|
18827
20094
|
/**
|
|
18828
20095
|
* ISO 8601 timestamp when the task was created.
|
|
18829
20096
|
*/
|
|
18830
|
-
createdAt:
|
|
20097
|
+
createdAt: z25.string(),
|
|
18831
20098
|
/**
|
|
18832
20099
|
* ISO 8601 timestamp when the task was last updated.
|
|
18833
20100
|
*/
|
|
18834
|
-
lastUpdatedAt:
|
|
18835
|
-
pollInterval:
|
|
20101
|
+
lastUpdatedAt: z25.string(),
|
|
20102
|
+
pollInterval: z25.optional(z25.number()),
|
|
18836
20103
|
/**
|
|
18837
20104
|
* Optional diagnostic message for failed tasks or other status information.
|
|
18838
20105
|
*/
|
|
18839
|
-
statusMessage:
|
|
20106
|
+
statusMessage: z25.optional(z25.string())
|
|
18840
20107
|
});
|
|
18841
20108
|
CreateTaskResultSchema = ResultSchema.extend({
|
|
18842
20109
|
task: TaskSchema
|
|
18843
20110
|
});
|
|
18844
20111
|
TaskStatusNotificationParamsSchema = NotificationsParamsSchema.merge(TaskSchema);
|
|
18845
20112
|
TaskStatusNotificationSchema = NotificationSchema.extend({
|
|
18846
|
-
method:
|
|
20113
|
+
method: z25.literal("notifications/tasks/status"),
|
|
18847
20114
|
params: TaskStatusNotificationParamsSchema
|
|
18848
20115
|
});
|
|
18849
20116
|
GetTaskRequestSchema = RequestSchema.extend({
|
|
18850
|
-
method:
|
|
20117
|
+
method: z25.literal("tasks/get"),
|
|
18851
20118
|
params: BaseRequestParamsSchema.extend({
|
|
18852
|
-
taskId:
|
|
20119
|
+
taskId: z25.string()
|
|
18853
20120
|
})
|
|
18854
20121
|
});
|
|
18855
20122
|
GetTaskResultSchema = ResultSchema.merge(TaskSchema);
|
|
18856
20123
|
GetTaskPayloadRequestSchema = RequestSchema.extend({
|
|
18857
|
-
method:
|
|
20124
|
+
method: z25.literal("tasks/result"),
|
|
18858
20125
|
params: BaseRequestParamsSchema.extend({
|
|
18859
|
-
taskId:
|
|
20126
|
+
taskId: z25.string()
|
|
18860
20127
|
})
|
|
18861
20128
|
});
|
|
18862
20129
|
GetTaskPayloadResultSchema = ResultSchema.loose();
|
|
18863
20130
|
ListTasksRequestSchema = PaginatedRequestSchema.extend({
|
|
18864
|
-
method:
|
|
20131
|
+
method: z25.literal("tasks/list")
|
|
18865
20132
|
});
|
|
18866
20133
|
ListTasksResultSchema = PaginatedResultSchema.extend({
|
|
18867
|
-
tasks:
|
|
20134
|
+
tasks: z25.array(TaskSchema)
|
|
18868
20135
|
});
|
|
18869
20136
|
CancelTaskRequestSchema = RequestSchema.extend({
|
|
18870
|
-
method:
|
|
20137
|
+
method: z25.literal("tasks/cancel"),
|
|
18871
20138
|
params: BaseRequestParamsSchema.extend({
|
|
18872
|
-
taskId:
|
|
20139
|
+
taskId: z25.string()
|
|
18873
20140
|
})
|
|
18874
20141
|
});
|
|
18875
20142
|
CancelTaskResultSchema = ResultSchema.merge(TaskSchema);
|
|
18876
|
-
ResourceContentsSchema =
|
|
20143
|
+
ResourceContentsSchema = z25.object({
|
|
18877
20144
|
/**
|
|
18878
20145
|
* The URI of this resource.
|
|
18879
20146
|
*/
|
|
18880
|
-
uri:
|
|
20147
|
+
uri: z25.string(),
|
|
18881
20148
|
/**
|
|
18882
20149
|
* The MIME type of this resource, if known.
|
|
18883
20150
|
*/
|
|
18884
|
-
mimeType:
|
|
20151
|
+
mimeType: z25.optional(z25.string()),
|
|
18885
20152
|
/**
|
|
18886
20153
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
18887
20154
|
* for notes on _meta usage.
|
|
18888
20155
|
*/
|
|
18889
|
-
_meta:
|
|
20156
|
+
_meta: z25.record(z25.string(), z25.unknown()).optional()
|
|
18890
20157
|
});
|
|
18891
20158
|
TextResourceContentsSchema = ResourceContentsSchema.extend({
|
|
18892
20159
|
/**
|
|
18893
20160
|
* The text of the item. This must only be set if the item can actually be represented as text (not binary data).
|
|
18894
20161
|
*/
|
|
18895
|
-
text:
|
|
20162
|
+
text: z25.string()
|
|
18896
20163
|
});
|
|
18897
|
-
Base64Schema =
|
|
20164
|
+
Base64Schema = z25.string().refine((val) => {
|
|
18898
20165
|
try {
|
|
18899
20166
|
atob(val);
|
|
18900
20167
|
return true;
|
|
@@ -18908,44 +20175,44 @@ var init_types3 = __esm({
|
|
|
18908
20175
|
*/
|
|
18909
20176
|
blob: Base64Schema
|
|
18910
20177
|
});
|
|
18911
|
-
RoleSchema =
|
|
18912
|
-
AnnotationsSchema =
|
|
20178
|
+
RoleSchema = z25.enum(["user", "assistant"]);
|
|
20179
|
+
AnnotationsSchema = z25.object({
|
|
18913
20180
|
/**
|
|
18914
20181
|
* Intended audience(s) for the resource.
|
|
18915
20182
|
*/
|
|
18916
|
-
audience:
|
|
20183
|
+
audience: z25.array(RoleSchema).optional(),
|
|
18917
20184
|
/**
|
|
18918
20185
|
* Importance hint for the resource, from 0 (least) to 1 (most).
|
|
18919
20186
|
*/
|
|
18920
|
-
priority:
|
|
20187
|
+
priority: z25.number().min(0).max(1).optional(),
|
|
18921
20188
|
/**
|
|
18922
20189
|
* ISO 8601 timestamp for the most recent modification.
|
|
18923
20190
|
*/
|
|
18924
|
-
lastModified:
|
|
20191
|
+
lastModified: z25.iso.datetime({ offset: true }).optional()
|
|
18925
20192
|
});
|
|
18926
|
-
ResourceSchema =
|
|
20193
|
+
ResourceSchema = z25.object({
|
|
18927
20194
|
...BaseMetadataSchema.shape,
|
|
18928
20195
|
...IconsSchema.shape,
|
|
18929
20196
|
/**
|
|
18930
20197
|
* The URI of this resource.
|
|
18931
20198
|
*/
|
|
18932
|
-
uri:
|
|
20199
|
+
uri: z25.string(),
|
|
18933
20200
|
/**
|
|
18934
20201
|
* A description of what this resource represents.
|
|
18935
20202
|
*
|
|
18936
20203
|
* 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.
|
|
18937
20204
|
*/
|
|
18938
|
-
description:
|
|
20205
|
+
description: z25.optional(z25.string()),
|
|
18939
20206
|
/**
|
|
18940
20207
|
* The MIME type of this resource, if known.
|
|
18941
20208
|
*/
|
|
18942
|
-
mimeType:
|
|
20209
|
+
mimeType: z25.optional(z25.string()),
|
|
18943
20210
|
/**
|
|
18944
20211
|
* The size of the raw resource content, in bytes (i.e., before base64 encoding or any tokenization), if known.
|
|
18945
20212
|
*
|
|
18946
20213
|
* This can be used by Hosts to display file sizes and estimate context window usage.
|
|
18947
20214
|
*/
|
|
18948
|
-
size:
|
|
20215
|
+
size: z25.optional(z25.number()),
|
|
18949
20216
|
/**
|
|
18950
20217
|
* Optional annotations for the client.
|
|
18951
20218
|
*/
|
|
@@ -18954,25 +20221,25 @@ var init_types3 = __esm({
|
|
|
18954
20221
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
18955
20222
|
* for notes on _meta usage.
|
|
18956
20223
|
*/
|
|
18957
|
-
_meta:
|
|
20224
|
+
_meta: z25.optional(z25.looseObject({}))
|
|
18958
20225
|
});
|
|
18959
|
-
ResourceTemplateSchema =
|
|
20226
|
+
ResourceTemplateSchema = z25.object({
|
|
18960
20227
|
...BaseMetadataSchema.shape,
|
|
18961
20228
|
...IconsSchema.shape,
|
|
18962
20229
|
/**
|
|
18963
20230
|
* A URI template (according to RFC 6570) that can be used to construct resource URIs.
|
|
18964
20231
|
*/
|
|
18965
|
-
uriTemplate:
|
|
20232
|
+
uriTemplate: z25.string(),
|
|
18966
20233
|
/**
|
|
18967
20234
|
* A description of what this template is for.
|
|
18968
20235
|
*
|
|
18969
20236
|
* 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.
|
|
18970
20237
|
*/
|
|
18971
|
-
description:
|
|
20238
|
+
description: z25.optional(z25.string()),
|
|
18972
20239
|
/**
|
|
18973
20240
|
* 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.
|
|
18974
20241
|
*/
|
|
18975
|
-
mimeType:
|
|
20242
|
+
mimeType: z25.optional(z25.string()),
|
|
18976
20243
|
/**
|
|
18977
20244
|
* Optional annotations for the client.
|
|
18978
20245
|
*/
|
|
@@ -18981,19 +20248,19 @@ var init_types3 = __esm({
|
|
|
18981
20248
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
18982
20249
|
* for notes on _meta usage.
|
|
18983
20250
|
*/
|
|
18984
|
-
_meta:
|
|
20251
|
+
_meta: z25.optional(z25.looseObject({}))
|
|
18985
20252
|
});
|
|
18986
20253
|
ListResourcesRequestSchema = PaginatedRequestSchema.extend({
|
|
18987
|
-
method:
|
|
20254
|
+
method: z25.literal("resources/list")
|
|
18988
20255
|
});
|
|
18989
20256
|
ListResourcesResultSchema = PaginatedResultSchema.extend({
|
|
18990
|
-
resources:
|
|
20257
|
+
resources: z25.array(ResourceSchema)
|
|
18991
20258
|
});
|
|
18992
20259
|
ListResourceTemplatesRequestSchema = PaginatedRequestSchema.extend({
|
|
18993
|
-
method:
|
|
20260
|
+
method: z25.literal("resources/templates/list")
|
|
18994
20261
|
});
|
|
18995
20262
|
ListResourceTemplatesResultSchema = PaginatedResultSchema.extend({
|
|
18996
|
-
resourceTemplates:
|
|
20263
|
+
resourceTemplates: z25.array(ResourceTemplateSchema)
|
|
18997
20264
|
});
|
|
18998
20265
|
ResourceRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
18999
20266
|
/**
|
|
@@ -19001,97 +20268,97 @@ var init_types3 = __esm({
|
|
|
19001
20268
|
*
|
|
19002
20269
|
* @format uri
|
|
19003
20270
|
*/
|
|
19004
|
-
uri:
|
|
20271
|
+
uri: z25.string()
|
|
19005
20272
|
});
|
|
19006
20273
|
ReadResourceRequestParamsSchema = ResourceRequestParamsSchema;
|
|
19007
20274
|
ReadResourceRequestSchema = RequestSchema.extend({
|
|
19008
|
-
method:
|
|
20275
|
+
method: z25.literal("resources/read"),
|
|
19009
20276
|
params: ReadResourceRequestParamsSchema
|
|
19010
20277
|
});
|
|
19011
20278
|
ReadResourceResultSchema = ResultSchema.extend({
|
|
19012
|
-
contents:
|
|
20279
|
+
contents: z25.array(z25.union([TextResourceContentsSchema, BlobResourceContentsSchema]))
|
|
19013
20280
|
});
|
|
19014
20281
|
ResourceListChangedNotificationSchema = NotificationSchema.extend({
|
|
19015
|
-
method:
|
|
20282
|
+
method: z25.literal("notifications/resources/list_changed"),
|
|
19016
20283
|
params: NotificationsParamsSchema.optional()
|
|
19017
20284
|
});
|
|
19018
20285
|
SubscribeRequestParamsSchema = ResourceRequestParamsSchema;
|
|
19019
20286
|
SubscribeRequestSchema = RequestSchema.extend({
|
|
19020
|
-
method:
|
|
20287
|
+
method: z25.literal("resources/subscribe"),
|
|
19021
20288
|
params: SubscribeRequestParamsSchema
|
|
19022
20289
|
});
|
|
19023
20290
|
UnsubscribeRequestParamsSchema = ResourceRequestParamsSchema;
|
|
19024
20291
|
UnsubscribeRequestSchema = RequestSchema.extend({
|
|
19025
|
-
method:
|
|
20292
|
+
method: z25.literal("resources/unsubscribe"),
|
|
19026
20293
|
params: UnsubscribeRequestParamsSchema
|
|
19027
20294
|
});
|
|
19028
20295
|
ResourceUpdatedNotificationParamsSchema = NotificationsParamsSchema.extend({
|
|
19029
20296
|
/**
|
|
19030
20297
|
* The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to.
|
|
19031
20298
|
*/
|
|
19032
|
-
uri:
|
|
20299
|
+
uri: z25.string()
|
|
19033
20300
|
});
|
|
19034
20301
|
ResourceUpdatedNotificationSchema = NotificationSchema.extend({
|
|
19035
|
-
method:
|
|
20302
|
+
method: z25.literal("notifications/resources/updated"),
|
|
19036
20303
|
params: ResourceUpdatedNotificationParamsSchema
|
|
19037
20304
|
});
|
|
19038
|
-
PromptArgumentSchema =
|
|
20305
|
+
PromptArgumentSchema = z25.object({
|
|
19039
20306
|
/**
|
|
19040
20307
|
* The name of the argument.
|
|
19041
20308
|
*/
|
|
19042
|
-
name:
|
|
20309
|
+
name: z25.string(),
|
|
19043
20310
|
/**
|
|
19044
20311
|
* A human-readable description of the argument.
|
|
19045
20312
|
*/
|
|
19046
|
-
description:
|
|
20313
|
+
description: z25.optional(z25.string()),
|
|
19047
20314
|
/**
|
|
19048
20315
|
* Whether this argument must be provided.
|
|
19049
20316
|
*/
|
|
19050
|
-
required:
|
|
20317
|
+
required: z25.optional(z25.boolean())
|
|
19051
20318
|
});
|
|
19052
|
-
PromptSchema =
|
|
20319
|
+
PromptSchema = z25.object({
|
|
19053
20320
|
...BaseMetadataSchema.shape,
|
|
19054
20321
|
...IconsSchema.shape,
|
|
19055
20322
|
/**
|
|
19056
20323
|
* An optional description of what this prompt provides
|
|
19057
20324
|
*/
|
|
19058
|
-
description:
|
|
20325
|
+
description: z25.optional(z25.string()),
|
|
19059
20326
|
/**
|
|
19060
20327
|
* A list of arguments to use for templating the prompt.
|
|
19061
20328
|
*/
|
|
19062
|
-
arguments:
|
|
20329
|
+
arguments: z25.optional(z25.array(PromptArgumentSchema)),
|
|
19063
20330
|
/**
|
|
19064
20331
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
19065
20332
|
* for notes on _meta usage.
|
|
19066
20333
|
*/
|
|
19067
|
-
_meta:
|
|
20334
|
+
_meta: z25.optional(z25.looseObject({}))
|
|
19068
20335
|
});
|
|
19069
20336
|
ListPromptsRequestSchema = PaginatedRequestSchema.extend({
|
|
19070
|
-
method:
|
|
20337
|
+
method: z25.literal("prompts/list")
|
|
19071
20338
|
});
|
|
19072
20339
|
ListPromptsResultSchema = PaginatedResultSchema.extend({
|
|
19073
|
-
prompts:
|
|
20340
|
+
prompts: z25.array(PromptSchema)
|
|
19074
20341
|
});
|
|
19075
20342
|
GetPromptRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
19076
20343
|
/**
|
|
19077
20344
|
* The name of the prompt or prompt template.
|
|
19078
20345
|
*/
|
|
19079
|
-
name:
|
|
20346
|
+
name: z25.string(),
|
|
19080
20347
|
/**
|
|
19081
20348
|
* Arguments to use for templating the prompt.
|
|
19082
20349
|
*/
|
|
19083
|
-
arguments:
|
|
20350
|
+
arguments: z25.record(z25.string(), z25.string()).optional()
|
|
19084
20351
|
});
|
|
19085
20352
|
GetPromptRequestSchema = RequestSchema.extend({
|
|
19086
|
-
method:
|
|
20353
|
+
method: z25.literal("prompts/get"),
|
|
19087
20354
|
params: GetPromptRequestParamsSchema
|
|
19088
20355
|
});
|
|
19089
|
-
TextContentSchema =
|
|
19090
|
-
type:
|
|
20356
|
+
TextContentSchema = z25.object({
|
|
20357
|
+
type: z25.literal("text"),
|
|
19091
20358
|
/**
|
|
19092
20359
|
* The text content of the message.
|
|
19093
20360
|
*/
|
|
19094
|
-
text:
|
|
20361
|
+
text: z25.string(),
|
|
19095
20362
|
/**
|
|
19096
20363
|
* Optional annotations for the client.
|
|
19097
20364
|
*/
|
|
@@ -19100,10 +20367,10 @@ var init_types3 = __esm({
|
|
|
19100
20367
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
19101
20368
|
* for notes on _meta usage.
|
|
19102
20369
|
*/
|
|
19103
|
-
_meta:
|
|
20370
|
+
_meta: z25.record(z25.string(), z25.unknown()).optional()
|
|
19104
20371
|
});
|
|
19105
|
-
ImageContentSchema =
|
|
19106
|
-
type:
|
|
20372
|
+
ImageContentSchema = z25.object({
|
|
20373
|
+
type: z25.literal("image"),
|
|
19107
20374
|
/**
|
|
19108
20375
|
* The base64-encoded image data.
|
|
19109
20376
|
*/
|
|
@@ -19111,7 +20378,7 @@ var init_types3 = __esm({
|
|
|
19111
20378
|
/**
|
|
19112
20379
|
* The MIME type of the image. Different providers may support different image types.
|
|
19113
20380
|
*/
|
|
19114
|
-
mimeType:
|
|
20381
|
+
mimeType: z25.string(),
|
|
19115
20382
|
/**
|
|
19116
20383
|
* Optional annotations for the client.
|
|
19117
20384
|
*/
|
|
@@ -19120,10 +20387,10 @@ var init_types3 = __esm({
|
|
|
19120
20387
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
19121
20388
|
* for notes on _meta usage.
|
|
19122
20389
|
*/
|
|
19123
|
-
_meta:
|
|
20390
|
+
_meta: z25.record(z25.string(), z25.unknown()).optional()
|
|
19124
20391
|
});
|
|
19125
|
-
AudioContentSchema =
|
|
19126
|
-
type:
|
|
20392
|
+
AudioContentSchema = z25.object({
|
|
20393
|
+
type: z25.literal("audio"),
|
|
19127
20394
|
/**
|
|
19128
20395
|
* The base64-encoded audio data.
|
|
19129
20396
|
*/
|
|
@@ -19131,7 +20398,7 @@ var init_types3 = __esm({
|
|
|
19131
20398
|
/**
|
|
19132
20399
|
* The MIME type of the audio. Different providers may support different audio types.
|
|
19133
20400
|
*/
|
|
19134
|
-
mimeType:
|
|
20401
|
+
mimeType: z25.string(),
|
|
19135
20402
|
/**
|
|
19136
20403
|
* Optional annotations for the client.
|
|
19137
20404
|
*/
|
|
@@ -19140,34 +20407,34 @@ var init_types3 = __esm({
|
|
|
19140
20407
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
19141
20408
|
* for notes on _meta usage.
|
|
19142
20409
|
*/
|
|
19143
|
-
_meta:
|
|
20410
|
+
_meta: z25.record(z25.string(), z25.unknown()).optional()
|
|
19144
20411
|
});
|
|
19145
|
-
ToolUseContentSchema =
|
|
19146
|
-
type:
|
|
20412
|
+
ToolUseContentSchema = z25.object({
|
|
20413
|
+
type: z25.literal("tool_use"),
|
|
19147
20414
|
/**
|
|
19148
20415
|
* The name of the tool to invoke.
|
|
19149
20416
|
* Must match a tool name from the request's tools array.
|
|
19150
20417
|
*/
|
|
19151
|
-
name:
|
|
20418
|
+
name: z25.string(),
|
|
19152
20419
|
/**
|
|
19153
20420
|
* Unique identifier for this tool call.
|
|
19154
20421
|
* Used to correlate with ToolResultContent in subsequent messages.
|
|
19155
20422
|
*/
|
|
19156
|
-
id:
|
|
20423
|
+
id: z25.string(),
|
|
19157
20424
|
/**
|
|
19158
20425
|
* Arguments to pass to the tool.
|
|
19159
20426
|
* Must conform to the tool's inputSchema.
|
|
19160
20427
|
*/
|
|
19161
|
-
input:
|
|
20428
|
+
input: z25.record(z25.string(), z25.unknown()),
|
|
19162
20429
|
/**
|
|
19163
20430
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
19164
20431
|
* for notes on _meta usage.
|
|
19165
20432
|
*/
|
|
19166
|
-
_meta:
|
|
20433
|
+
_meta: z25.record(z25.string(), z25.unknown()).optional()
|
|
19167
20434
|
});
|
|
19168
|
-
EmbeddedResourceSchema =
|
|
19169
|
-
type:
|
|
19170
|
-
resource:
|
|
20435
|
+
EmbeddedResourceSchema = z25.object({
|
|
20436
|
+
type: z25.literal("resource"),
|
|
20437
|
+
resource: z25.union([TextResourceContentsSchema, BlobResourceContentsSchema]),
|
|
19171
20438
|
/**
|
|
19172
20439
|
* Optional annotations for the client.
|
|
19173
20440
|
*/
|
|
@@ -19176,19 +20443,19 @@ var init_types3 = __esm({
|
|
|
19176
20443
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
19177
20444
|
* for notes on _meta usage.
|
|
19178
20445
|
*/
|
|
19179
|
-
_meta:
|
|
20446
|
+
_meta: z25.record(z25.string(), z25.unknown()).optional()
|
|
19180
20447
|
});
|
|
19181
20448
|
ResourceLinkSchema = ResourceSchema.extend({
|
|
19182
|
-
type:
|
|
20449
|
+
type: z25.literal("resource_link")
|
|
19183
20450
|
});
|
|
19184
|
-
ContentBlockSchema =
|
|
20451
|
+
ContentBlockSchema = z25.union([
|
|
19185
20452
|
TextContentSchema,
|
|
19186
20453
|
ImageContentSchema,
|
|
19187
20454
|
AudioContentSchema,
|
|
19188
20455
|
ResourceLinkSchema,
|
|
19189
20456
|
EmbeddedResourceSchema
|
|
19190
20457
|
]);
|
|
19191
|
-
PromptMessageSchema =
|
|
20458
|
+
PromptMessageSchema = z25.object({
|
|
19192
20459
|
role: RoleSchema,
|
|
19193
20460
|
content: ContentBlockSchema
|
|
19194
20461
|
});
|
|
@@ -19196,24 +20463,24 @@ var init_types3 = __esm({
|
|
|
19196
20463
|
/**
|
|
19197
20464
|
* An optional description for the prompt.
|
|
19198
20465
|
*/
|
|
19199
|
-
description:
|
|
19200
|
-
messages:
|
|
20466
|
+
description: z25.string().optional(),
|
|
20467
|
+
messages: z25.array(PromptMessageSchema)
|
|
19201
20468
|
});
|
|
19202
20469
|
PromptListChangedNotificationSchema = NotificationSchema.extend({
|
|
19203
|
-
method:
|
|
20470
|
+
method: z25.literal("notifications/prompts/list_changed"),
|
|
19204
20471
|
params: NotificationsParamsSchema.optional()
|
|
19205
20472
|
});
|
|
19206
|
-
ToolAnnotationsSchema =
|
|
20473
|
+
ToolAnnotationsSchema = z25.object({
|
|
19207
20474
|
/**
|
|
19208
20475
|
* A human-readable title for the tool.
|
|
19209
20476
|
*/
|
|
19210
|
-
title:
|
|
20477
|
+
title: z25.string().optional(),
|
|
19211
20478
|
/**
|
|
19212
20479
|
* If true, the tool does not modify its environment.
|
|
19213
20480
|
*
|
|
19214
20481
|
* Default: false
|
|
19215
20482
|
*/
|
|
19216
|
-
readOnlyHint:
|
|
20483
|
+
readOnlyHint: z25.boolean().optional(),
|
|
19217
20484
|
/**
|
|
19218
20485
|
* If true, the tool may perform destructive updates to its environment.
|
|
19219
20486
|
* If false, the tool performs only additive updates.
|
|
@@ -19222,7 +20489,7 @@ var init_types3 = __esm({
|
|
|
19222
20489
|
*
|
|
19223
20490
|
* Default: true
|
|
19224
20491
|
*/
|
|
19225
|
-
destructiveHint:
|
|
20492
|
+
destructiveHint: z25.boolean().optional(),
|
|
19226
20493
|
/**
|
|
19227
20494
|
* If true, calling the tool repeatedly with the same arguments
|
|
19228
20495
|
* will have no additional effect on the its environment.
|
|
@@ -19231,7 +20498,7 @@ var init_types3 = __esm({
|
|
|
19231
20498
|
*
|
|
19232
20499
|
* Default: false
|
|
19233
20500
|
*/
|
|
19234
|
-
idempotentHint:
|
|
20501
|
+
idempotentHint: z25.boolean().optional(),
|
|
19235
20502
|
/**
|
|
19236
20503
|
* If true, this tool may interact with an "open world" of external
|
|
19237
20504
|
* entities. If false, the tool's domain of interaction is closed.
|
|
@@ -19240,9 +20507,9 @@ var init_types3 = __esm({
|
|
|
19240
20507
|
*
|
|
19241
20508
|
* Default: true
|
|
19242
20509
|
*/
|
|
19243
|
-
openWorldHint:
|
|
20510
|
+
openWorldHint: z25.boolean().optional()
|
|
19244
20511
|
});
|
|
19245
|
-
ToolExecutionSchema =
|
|
20512
|
+
ToolExecutionSchema = z25.object({
|
|
19246
20513
|
/**
|
|
19247
20514
|
* Indicates the tool's preference for task-augmented execution.
|
|
19248
20515
|
* - "required": Clients MUST invoke the tool as a task
|
|
@@ -19251,34 +20518,34 @@ var init_types3 = __esm({
|
|
|
19251
20518
|
*
|
|
19252
20519
|
* If not present, defaults to "forbidden".
|
|
19253
20520
|
*/
|
|
19254
|
-
taskSupport:
|
|
20521
|
+
taskSupport: z25.enum(["required", "optional", "forbidden"]).optional()
|
|
19255
20522
|
});
|
|
19256
|
-
ToolSchema =
|
|
20523
|
+
ToolSchema = z25.object({
|
|
19257
20524
|
...BaseMetadataSchema.shape,
|
|
19258
20525
|
...IconsSchema.shape,
|
|
19259
20526
|
/**
|
|
19260
20527
|
* A human-readable description of the tool.
|
|
19261
20528
|
*/
|
|
19262
|
-
description:
|
|
20529
|
+
description: z25.string().optional(),
|
|
19263
20530
|
/**
|
|
19264
20531
|
* A JSON Schema 2020-12 object defining the expected parameters for the tool.
|
|
19265
20532
|
* Must have type: 'object' at the root level per MCP spec.
|
|
19266
20533
|
*/
|
|
19267
|
-
inputSchema:
|
|
19268
|
-
type:
|
|
19269
|
-
properties:
|
|
19270
|
-
required:
|
|
19271
|
-
}).catchall(
|
|
20534
|
+
inputSchema: z25.object({
|
|
20535
|
+
type: z25.literal("object"),
|
|
20536
|
+
properties: z25.record(z25.string(), AssertObjectSchema).optional(),
|
|
20537
|
+
required: z25.array(z25.string()).optional()
|
|
20538
|
+
}).catchall(z25.unknown()),
|
|
19272
20539
|
/**
|
|
19273
20540
|
* An optional JSON Schema 2020-12 object defining the structure of the tool's output
|
|
19274
20541
|
* returned in the structuredContent field of a CallToolResult.
|
|
19275
20542
|
* Must have type: 'object' at the root level per MCP spec.
|
|
19276
20543
|
*/
|
|
19277
|
-
outputSchema:
|
|
19278
|
-
type:
|
|
19279
|
-
properties:
|
|
19280
|
-
required:
|
|
19281
|
-
}).catchall(
|
|
20544
|
+
outputSchema: z25.object({
|
|
20545
|
+
type: z25.literal("object"),
|
|
20546
|
+
properties: z25.record(z25.string(), AssertObjectSchema).optional(),
|
|
20547
|
+
required: z25.array(z25.string()).optional()
|
|
20548
|
+
}).catchall(z25.unknown()).optional(),
|
|
19282
20549
|
/**
|
|
19283
20550
|
* Optional additional tool information.
|
|
19284
20551
|
*/
|
|
@@ -19291,13 +20558,13 @@ var init_types3 = __esm({
|
|
|
19291
20558
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
19292
20559
|
* for notes on _meta usage.
|
|
19293
20560
|
*/
|
|
19294
|
-
_meta:
|
|
20561
|
+
_meta: z25.record(z25.string(), z25.unknown()).optional()
|
|
19295
20562
|
});
|
|
19296
20563
|
ListToolsRequestSchema = PaginatedRequestSchema.extend({
|
|
19297
|
-
method:
|
|
20564
|
+
method: z25.literal("tools/list")
|
|
19298
20565
|
});
|
|
19299
20566
|
ListToolsResultSchema = PaginatedResultSchema.extend({
|
|
19300
|
-
tools:
|
|
20567
|
+
tools: z25.array(ToolSchema)
|
|
19301
20568
|
});
|
|
19302
20569
|
CallToolResultSchema = ResultSchema.extend({
|
|
19303
20570
|
/**
|
|
@@ -19306,13 +20573,13 @@ var init_types3 = __esm({
|
|
|
19306
20573
|
* If the Tool does not define an outputSchema, this field MUST be present in the result.
|
|
19307
20574
|
* For backwards compatibility, this field is always present, but it may be empty.
|
|
19308
20575
|
*/
|
|
19309
|
-
content:
|
|
20576
|
+
content: z25.array(ContentBlockSchema).default([]),
|
|
19310
20577
|
/**
|
|
19311
20578
|
* An object containing structured tool output.
|
|
19312
20579
|
*
|
|
19313
20580
|
* If the Tool defines an outputSchema, this field MUST be present in the result, and contain a JSON object that matches the schema.
|
|
19314
20581
|
*/
|
|
19315
|
-
structuredContent:
|
|
20582
|
+
structuredContent: z25.record(z25.string(), z25.unknown()).optional(),
|
|
19316
20583
|
/**
|
|
19317
20584
|
* Whether the tool call ended in an error.
|
|
19318
20585
|
*
|
|
@@ -19327,30 +20594,30 @@ var init_types3 = __esm({
|
|
|
19327
20594
|
* server does not support tool calls, or any other exceptional conditions,
|
|
19328
20595
|
* should be reported as an MCP error response.
|
|
19329
20596
|
*/
|
|
19330
|
-
isError:
|
|
20597
|
+
isError: z25.boolean().optional()
|
|
19331
20598
|
});
|
|
19332
20599
|
CompatibilityCallToolResultSchema = CallToolResultSchema.or(ResultSchema.extend({
|
|
19333
|
-
toolResult:
|
|
20600
|
+
toolResult: z25.unknown()
|
|
19334
20601
|
}));
|
|
19335
20602
|
CallToolRequestParamsSchema = TaskAugmentedRequestParamsSchema.extend({
|
|
19336
20603
|
/**
|
|
19337
20604
|
* The name of the tool to call.
|
|
19338
20605
|
*/
|
|
19339
|
-
name:
|
|
20606
|
+
name: z25.string(),
|
|
19340
20607
|
/**
|
|
19341
20608
|
* Arguments to pass to the tool.
|
|
19342
20609
|
*/
|
|
19343
|
-
arguments:
|
|
20610
|
+
arguments: z25.record(z25.string(), z25.unknown()).optional()
|
|
19344
20611
|
});
|
|
19345
20612
|
CallToolRequestSchema = RequestSchema.extend({
|
|
19346
|
-
method:
|
|
20613
|
+
method: z25.literal("tools/call"),
|
|
19347
20614
|
params: CallToolRequestParamsSchema
|
|
19348
20615
|
});
|
|
19349
20616
|
ToolListChangedNotificationSchema = NotificationSchema.extend({
|
|
19350
|
-
method:
|
|
20617
|
+
method: z25.literal("notifications/tools/list_changed"),
|
|
19351
20618
|
params: NotificationsParamsSchema.optional()
|
|
19352
20619
|
});
|
|
19353
|
-
ListChangedOptionsBaseSchema =
|
|
20620
|
+
ListChangedOptionsBaseSchema = z25.object({
|
|
19354
20621
|
/**
|
|
19355
20622
|
* If true, the list will be refreshed automatically when a list changed notification is received.
|
|
19356
20623
|
* The callback will be called with the updated list.
|
|
@@ -19359,7 +20626,7 @@ var init_types3 = __esm({
|
|
|
19359
20626
|
*
|
|
19360
20627
|
* @default true
|
|
19361
20628
|
*/
|
|
19362
|
-
autoRefresh:
|
|
20629
|
+
autoRefresh: z25.boolean().default(true),
|
|
19363
20630
|
/**
|
|
19364
20631
|
* Debounce time in milliseconds for list changed notification processing.
|
|
19365
20632
|
*
|
|
@@ -19368,9 +20635,9 @@ var init_types3 = __esm({
|
|
|
19368
20635
|
*
|
|
19369
20636
|
* @default 300
|
|
19370
20637
|
*/
|
|
19371
|
-
debounceMs:
|
|
20638
|
+
debounceMs: z25.number().int().nonnegative().default(300)
|
|
19372
20639
|
});
|
|
19373
|
-
LoggingLevelSchema =
|
|
20640
|
+
LoggingLevelSchema = z25.enum(["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]);
|
|
19374
20641
|
SetLevelRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
19375
20642
|
/**
|
|
19376
20643
|
* 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.
|
|
@@ -19378,7 +20645,7 @@ var init_types3 = __esm({
|
|
|
19378
20645
|
level: LoggingLevelSchema
|
|
19379
20646
|
});
|
|
19380
20647
|
SetLevelRequestSchema = RequestSchema.extend({
|
|
19381
|
-
method:
|
|
20648
|
+
method: z25.literal("logging/setLevel"),
|
|
19382
20649
|
params: SetLevelRequestParamsSchema
|
|
19383
20650
|
});
|
|
19384
20651
|
LoggingMessageNotificationParamsSchema = NotificationsParamsSchema.extend({
|
|
@@ -19389,80 +20656,80 @@ var init_types3 = __esm({
|
|
|
19389
20656
|
/**
|
|
19390
20657
|
* An optional name of the logger issuing this message.
|
|
19391
20658
|
*/
|
|
19392
|
-
logger:
|
|
20659
|
+
logger: z25.string().optional(),
|
|
19393
20660
|
/**
|
|
19394
20661
|
* The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here.
|
|
19395
20662
|
*/
|
|
19396
|
-
data:
|
|
20663
|
+
data: z25.unknown()
|
|
19397
20664
|
});
|
|
19398
20665
|
LoggingMessageNotificationSchema = NotificationSchema.extend({
|
|
19399
|
-
method:
|
|
20666
|
+
method: z25.literal("notifications/message"),
|
|
19400
20667
|
params: LoggingMessageNotificationParamsSchema
|
|
19401
20668
|
});
|
|
19402
|
-
ModelHintSchema =
|
|
20669
|
+
ModelHintSchema = z25.object({
|
|
19403
20670
|
/**
|
|
19404
20671
|
* A hint for a model name.
|
|
19405
20672
|
*/
|
|
19406
|
-
name:
|
|
20673
|
+
name: z25.string().optional()
|
|
19407
20674
|
});
|
|
19408
|
-
ModelPreferencesSchema =
|
|
20675
|
+
ModelPreferencesSchema = z25.object({
|
|
19409
20676
|
/**
|
|
19410
20677
|
* Optional hints to use for model selection.
|
|
19411
20678
|
*/
|
|
19412
|
-
hints:
|
|
20679
|
+
hints: z25.array(ModelHintSchema).optional(),
|
|
19413
20680
|
/**
|
|
19414
20681
|
* How much to prioritize cost when selecting a model.
|
|
19415
20682
|
*/
|
|
19416
|
-
costPriority:
|
|
20683
|
+
costPriority: z25.number().min(0).max(1).optional(),
|
|
19417
20684
|
/**
|
|
19418
20685
|
* How much to prioritize sampling speed (latency) when selecting a model.
|
|
19419
20686
|
*/
|
|
19420
|
-
speedPriority:
|
|
20687
|
+
speedPriority: z25.number().min(0).max(1).optional(),
|
|
19421
20688
|
/**
|
|
19422
20689
|
* How much to prioritize intelligence and capabilities when selecting a model.
|
|
19423
20690
|
*/
|
|
19424
|
-
intelligencePriority:
|
|
20691
|
+
intelligencePriority: z25.number().min(0).max(1).optional()
|
|
19425
20692
|
});
|
|
19426
|
-
ToolChoiceSchema =
|
|
20693
|
+
ToolChoiceSchema = z25.object({
|
|
19427
20694
|
/**
|
|
19428
20695
|
* Controls when tools are used:
|
|
19429
20696
|
* - "auto": Model decides whether to use tools (default)
|
|
19430
20697
|
* - "required": Model MUST use at least one tool before completing
|
|
19431
20698
|
* - "none": Model MUST NOT use any tools
|
|
19432
20699
|
*/
|
|
19433
|
-
mode:
|
|
20700
|
+
mode: z25.enum(["auto", "required", "none"]).optional()
|
|
19434
20701
|
});
|
|
19435
|
-
ToolResultContentSchema =
|
|
19436
|
-
type:
|
|
19437
|
-
toolUseId:
|
|
19438
|
-
content:
|
|
19439
|
-
structuredContent:
|
|
19440
|
-
isError:
|
|
20702
|
+
ToolResultContentSchema = z25.object({
|
|
20703
|
+
type: z25.literal("tool_result"),
|
|
20704
|
+
toolUseId: z25.string().describe("The unique identifier for the corresponding tool call."),
|
|
20705
|
+
content: z25.array(ContentBlockSchema).default([]),
|
|
20706
|
+
structuredContent: z25.object({}).loose().optional(),
|
|
20707
|
+
isError: z25.boolean().optional(),
|
|
19441
20708
|
/**
|
|
19442
20709
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
19443
20710
|
* for notes on _meta usage.
|
|
19444
20711
|
*/
|
|
19445
|
-
_meta:
|
|
20712
|
+
_meta: z25.record(z25.string(), z25.unknown()).optional()
|
|
19446
20713
|
});
|
|
19447
|
-
SamplingContentSchema =
|
|
19448
|
-
SamplingMessageContentBlockSchema =
|
|
20714
|
+
SamplingContentSchema = z25.discriminatedUnion("type", [TextContentSchema, ImageContentSchema, AudioContentSchema]);
|
|
20715
|
+
SamplingMessageContentBlockSchema = z25.discriminatedUnion("type", [
|
|
19449
20716
|
TextContentSchema,
|
|
19450
20717
|
ImageContentSchema,
|
|
19451
20718
|
AudioContentSchema,
|
|
19452
20719
|
ToolUseContentSchema,
|
|
19453
20720
|
ToolResultContentSchema
|
|
19454
20721
|
]);
|
|
19455
|
-
SamplingMessageSchema =
|
|
20722
|
+
SamplingMessageSchema = z25.object({
|
|
19456
20723
|
role: RoleSchema,
|
|
19457
|
-
content:
|
|
20724
|
+
content: z25.union([SamplingMessageContentBlockSchema, z25.array(SamplingMessageContentBlockSchema)]),
|
|
19458
20725
|
/**
|
|
19459
20726
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
19460
20727
|
* for notes on _meta usage.
|
|
19461
20728
|
*/
|
|
19462
|
-
_meta:
|
|
20729
|
+
_meta: z25.record(z25.string(), z25.unknown()).optional()
|
|
19463
20730
|
});
|
|
19464
20731
|
CreateMessageRequestParamsSchema = TaskAugmentedRequestParamsSchema.extend({
|
|
19465
|
-
messages:
|
|
20732
|
+
messages: z25.array(SamplingMessageSchema),
|
|
19466
20733
|
/**
|
|
19467
20734
|
* The server's preferences for which model to select. The client MAY modify or omit this request.
|
|
19468
20735
|
*/
|
|
@@ -19470,7 +20737,7 @@ var init_types3 = __esm({
|
|
|
19470
20737
|
/**
|
|
19471
20738
|
* An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt.
|
|
19472
20739
|
*/
|
|
19473
|
-
systemPrompt:
|
|
20740
|
+
systemPrompt: z25.string().optional(),
|
|
19474
20741
|
/**
|
|
19475
20742
|
* A request to include context from one or more MCP servers (including the caller), to be attached to the prompt.
|
|
19476
20743
|
* The client MAY ignore this request.
|
|
@@ -19478,15 +20745,15 @@ var init_types3 = __esm({
|
|
|
19478
20745
|
* Default is "none". Values "thisServer" and "allServers" are soft-deprecated. Servers SHOULD only use these values if the client
|
|
19479
20746
|
* declares ClientCapabilities.sampling.context. These values may be removed in future spec releases.
|
|
19480
20747
|
*/
|
|
19481
|
-
includeContext:
|
|
19482
|
-
temperature:
|
|
20748
|
+
includeContext: z25.enum(["none", "thisServer", "allServers"]).optional(),
|
|
20749
|
+
temperature: z25.number().optional(),
|
|
19483
20750
|
/**
|
|
19484
20751
|
* The requested maximum number of tokens to sample (to prevent runaway completions).
|
|
19485
20752
|
*
|
|
19486
20753
|
* The client MAY choose to sample fewer tokens than the requested maximum.
|
|
19487
20754
|
*/
|
|
19488
|
-
maxTokens:
|
|
19489
|
-
stopSequences:
|
|
20755
|
+
maxTokens: z25.number().int(),
|
|
20756
|
+
stopSequences: z25.array(z25.string()).optional(),
|
|
19490
20757
|
/**
|
|
19491
20758
|
* Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific.
|
|
19492
20759
|
*/
|
|
@@ -19495,7 +20762,7 @@ var init_types3 = __esm({
|
|
|
19495
20762
|
* Tools that the model may use during generation.
|
|
19496
20763
|
* The client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared.
|
|
19497
20764
|
*/
|
|
19498
|
-
tools:
|
|
20765
|
+
tools: z25.array(ToolSchema).optional(),
|
|
19499
20766
|
/**
|
|
19500
20767
|
* Controls how the model uses tools.
|
|
19501
20768
|
* The client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared.
|
|
@@ -19504,14 +20771,14 @@ var init_types3 = __esm({
|
|
|
19504
20771
|
toolChoice: ToolChoiceSchema.optional()
|
|
19505
20772
|
});
|
|
19506
20773
|
CreateMessageRequestSchema = RequestSchema.extend({
|
|
19507
|
-
method:
|
|
20774
|
+
method: z25.literal("sampling/createMessage"),
|
|
19508
20775
|
params: CreateMessageRequestParamsSchema
|
|
19509
20776
|
});
|
|
19510
20777
|
CreateMessageResultSchema = ResultSchema.extend({
|
|
19511
20778
|
/**
|
|
19512
20779
|
* The name of the model that generated the message.
|
|
19513
20780
|
*/
|
|
19514
|
-
model:
|
|
20781
|
+
model: z25.string(),
|
|
19515
20782
|
/**
|
|
19516
20783
|
* The reason why sampling stopped, if known.
|
|
19517
20784
|
*
|
|
@@ -19522,7 +20789,7 @@ var init_types3 = __esm({
|
|
|
19522
20789
|
*
|
|
19523
20790
|
* This field is an open string to allow for provider-specific stop reasons.
|
|
19524
20791
|
*/
|
|
19525
|
-
stopReason:
|
|
20792
|
+
stopReason: z25.optional(z25.enum(["endTurn", "stopSequence", "maxTokens"]).or(z25.string())),
|
|
19526
20793
|
role: RoleSchema,
|
|
19527
20794
|
/**
|
|
19528
20795
|
* Response content. Single content block (text, image, or audio).
|
|
@@ -19533,7 +20800,7 @@ var init_types3 = __esm({
|
|
|
19533
20800
|
/**
|
|
19534
20801
|
* The name of the model that generated the message.
|
|
19535
20802
|
*/
|
|
19536
|
-
model:
|
|
20803
|
+
model: z25.string(),
|
|
19537
20804
|
/**
|
|
19538
20805
|
* The reason why sampling stopped, if known.
|
|
19539
20806
|
*
|
|
@@ -19545,144 +20812,144 @@ var init_types3 = __esm({
|
|
|
19545
20812
|
*
|
|
19546
20813
|
* This field is an open string to allow for provider-specific stop reasons.
|
|
19547
20814
|
*/
|
|
19548
|
-
stopReason:
|
|
20815
|
+
stopReason: z25.optional(z25.enum(["endTurn", "stopSequence", "maxTokens", "toolUse"]).or(z25.string())),
|
|
19549
20816
|
role: RoleSchema,
|
|
19550
20817
|
/**
|
|
19551
20818
|
* Response content. May be a single block or array. May include ToolUseContent if stopReason is "toolUse".
|
|
19552
20819
|
*/
|
|
19553
|
-
content:
|
|
20820
|
+
content: z25.union([SamplingMessageContentBlockSchema, z25.array(SamplingMessageContentBlockSchema)])
|
|
19554
20821
|
});
|
|
19555
|
-
BooleanSchemaSchema =
|
|
19556
|
-
type:
|
|
19557
|
-
title:
|
|
19558
|
-
description:
|
|
19559
|
-
default:
|
|
20822
|
+
BooleanSchemaSchema = z25.object({
|
|
20823
|
+
type: z25.literal("boolean"),
|
|
20824
|
+
title: z25.string().optional(),
|
|
20825
|
+
description: z25.string().optional(),
|
|
20826
|
+
default: z25.boolean().optional()
|
|
19560
20827
|
});
|
|
19561
|
-
StringSchemaSchema =
|
|
19562
|
-
type:
|
|
19563
|
-
title:
|
|
19564
|
-
description:
|
|
19565
|
-
minLength:
|
|
19566
|
-
maxLength:
|
|
19567
|
-
format:
|
|
19568
|
-
default:
|
|
20828
|
+
StringSchemaSchema = z25.object({
|
|
20829
|
+
type: z25.literal("string"),
|
|
20830
|
+
title: z25.string().optional(),
|
|
20831
|
+
description: z25.string().optional(),
|
|
20832
|
+
minLength: z25.number().optional(),
|
|
20833
|
+
maxLength: z25.number().optional(),
|
|
20834
|
+
format: z25.enum(["email", "uri", "date", "date-time"]).optional(),
|
|
20835
|
+
default: z25.string().optional()
|
|
19569
20836
|
});
|
|
19570
|
-
NumberSchemaSchema =
|
|
19571
|
-
type:
|
|
19572
|
-
title:
|
|
19573
|
-
description:
|
|
19574
|
-
minimum:
|
|
19575
|
-
maximum:
|
|
19576
|
-
default:
|
|
20837
|
+
NumberSchemaSchema = z25.object({
|
|
20838
|
+
type: z25.enum(["number", "integer"]),
|
|
20839
|
+
title: z25.string().optional(),
|
|
20840
|
+
description: z25.string().optional(),
|
|
20841
|
+
minimum: z25.number().optional(),
|
|
20842
|
+
maximum: z25.number().optional(),
|
|
20843
|
+
default: z25.number().optional()
|
|
19577
20844
|
});
|
|
19578
|
-
UntitledSingleSelectEnumSchemaSchema =
|
|
19579
|
-
type:
|
|
19580
|
-
title:
|
|
19581
|
-
description:
|
|
19582
|
-
enum:
|
|
19583
|
-
default:
|
|
20845
|
+
UntitledSingleSelectEnumSchemaSchema = z25.object({
|
|
20846
|
+
type: z25.literal("string"),
|
|
20847
|
+
title: z25.string().optional(),
|
|
20848
|
+
description: z25.string().optional(),
|
|
20849
|
+
enum: z25.array(z25.string()),
|
|
20850
|
+
default: z25.string().optional()
|
|
19584
20851
|
});
|
|
19585
|
-
TitledSingleSelectEnumSchemaSchema =
|
|
19586
|
-
type:
|
|
19587
|
-
title:
|
|
19588
|
-
description:
|
|
19589
|
-
oneOf:
|
|
19590
|
-
const:
|
|
19591
|
-
title:
|
|
20852
|
+
TitledSingleSelectEnumSchemaSchema = z25.object({
|
|
20853
|
+
type: z25.literal("string"),
|
|
20854
|
+
title: z25.string().optional(),
|
|
20855
|
+
description: z25.string().optional(),
|
|
20856
|
+
oneOf: z25.array(z25.object({
|
|
20857
|
+
const: z25.string(),
|
|
20858
|
+
title: z25.string()
|
|
19592
20859
|
})),
|
|
19593
|
-
default:
|
|
20860
|
+
default: z25.string().optional()
|
|
19594
20861
|
});
|
|
19595
|
-
LegacyTitledEnumSchemaSchema =
|
|
19596
|
-
type:
|
|
19597
|
-
title:
|
|
19598
|
-
description:
|
|
19599
|
-
enum:
|
|
19600
|
-
enumNames:
|
|
19601
|
-
default:
|
|
20862
|
+
LegacyTitledEnumSchemaSchema = z25.object({
|
|
20863
|
+
type: z25.literal("string"),
|
|
20864
|
+
title: z25.string().optional(),
|
|
20865
|
+
description: z25.string().optional(),
|
|
20866
|
+
enum: z25.array(z25.string()),
|
|
20867
|
+
enumNames: z25.array(z25.string()).optional(),
|
|
20868
|
+
default: z25.string().optional()
|
|
19602
20869
|
});
|
|
19603
|
-
SingleSelectEnumSchemaSchema =
|
|
19604
|
-
UntitledMultiSelectEnumSchemaSchema =
|
|
19605
|
-
type:
|
|
19606
|
-
title:
|
|
19607
|
-
description:
|
|
19608
|
-
minItems:
|
|
19609
|
-
maxItems:
|
|
19610
|
-
items:
|
|
19611
|
-
type:
|
|
19612
|
-
enum:
|
|
20870
|
+
SingleSelectEnumSchemaSchema = z25.union([UntitledSingleSelectEnumSchemaSchema, TitledSingleSelectEnumSchemaSchema]);
|
|
20871
|
+
UntitledMultiSelectEnumSchemaSchema = z25.object({
|
|
20872
|
+
type: z25.literal("array"),
|
|
20873
|
+
title: z25.string().optional(),
|
|
20874
|
+
description: z25.string().optional(),
|
|
20875
|
+
minItems: z25.number().optional(),
|
|
20876
|
+
maxItems: z25.number().optional(),
|
|
20877
|
+
items: z25.object({
|
|
20878
|
+
type: z25.literal("string"),
|
|
20879
|
+
enum: z25.array(z25.string())
|
|
19613
20880
|
}),
|
|
19614
|
-
default:
|
|
20881
|
+
default: z25.array(z25.string()).optional()
|
|
19615
20882
|
});
|
|
19616
|
-
TitledMultiSelectEnumSchemaSchema =
|
|
19617
|
-
type:
|
|
19618
|
-
title:
|
|
19619
|
-
description:
|
|
19620
|
-
minItems:
|
|
19621
|
-
maxItems:
|
|
19622
|
-
items:
|
|
19623
|
-
anyOf:
|
|
19624
|
-
const:
|
|
19625
|
-
title:
|
|
20883
|
+
TitledMultiSelectEnumSchemaSchema = z25.object({
|
|
20884
|
+
type: z25.literal("array"),
|
|
20885
|
+
title: z25.string().optional(),
|
|
20886
|
+
description: z25.string().optional(),
|
|
20887
|
+
minItems: z25.number().optional(),
|
|
20888
|
+
maxItems: z25.number().optional(),
|
|
20889
|
+
items: z25.object({
|
|
20890
|
+
anyOf: z25.array(z25.object({
|
|
20891
|
+
const: z25.string(),
|
|
20892
|
+
title: z25.string()
|
|
19626
20893
|
}))
|
|
19627
20894
|
}),
|
|
19628
|
-
default:
|
|
20895
|
+
default: z25.array(z25.string()).optional()
|
|
19629
20896
|
});
|
|
19630
|
-
MultiSelectEnumSchemaSchema =
|
|
19631
|
-
EnumSchemaSchema =
|
|
19632
|
-
PrimitiveSchemaDefinitionSchema =
|
|
20897
|
+
MultiSelectEnumSchemaSchema = z25.union([UntitledMultiSelectEnumSchemaSchema, TitledMultiSelectEnumSchemaSchema]);
|
|
20898
|
+
EnumSchemaSchema = z25.union([LegacyTitledEnumSchemaSchema, SingleSelectEnumSchemaSchema, MultiSelectEnumSchemaSchema]);
|
|
20899
|
+
PrimitiveSchemaDefinitionSchema = z25.union([EnumSchemaSchema, BooleanSchemaSchema, StringSchemaSchema, NumberSchemaSchema]);
|
|
19633
20900
|
ElicitRequestFormParamsSchema = TaskAugmentedRequestParamsSchema.extend({
|
|
19634
20901
|
/**
|
|
19635
20902
|
* The elicitation mode.
|
|
19636
20903
|
*
|
|
19637
20904
|
* Optional for backward compatibility. Clients MUST treat missing mode as "form".
|
|
19638
20905
|
*/
|
|
19639
|
-
mode:
|
|
20906
|
+
mode: z25.literal("form").optional(),
|
|
19640
20907
|
/**
|
|
19641
20908
|
* The message to present to the user describing what information is being requested.
|
|
19642
20909
|
*/
|
|
19643
|
-
message:
|
|
20910
|
+
message: z25.string(),
|
|
19644
20911
|
/**
|
|
19645
20912
|
* A restricted subset of JSON Schema.
|
|
19646
20913
|
* Only top-level properties are allowed, without nesting.
|
|
19647
20914
|
*/
|
|
19648
|
-
requestedSchema:
|
|
19649
|
-
type:
|
|
19650
|
-
properties:
|
|
19651
|
-
required:
|
|
20915
|
+
requestedSchema: z25.object({
|
|
20916
|
+
type: z25.literal("object"),
|
|
20917
|
+
properties: z25.record(z25.string(), PrimitiveSchemaDefinitionSchema),
|
|
20918
|
+
required: z25.array(z25.string()).optional()
|
|
19652
20919
|
})
|
|
19653
20920
|
});
|
|
19654
20921
|
ElicitRequestURLParamsSchema = TaskAugmentedRequestParamsSchema.extend({
|
|
19655
20922
|
/**
|
|
19656
20923
|
* The elicitation mode.
|
|
19657
20924
|
*/
|
|
19658
|
-
mode:
|
|
20925
|
+
mode: z25.literal("url"),
|
|
19659
20926
|
/**
|
|
19660
20927
|
* The message to present to the user explaining why the interaction is needed.
|
|
19661
20928
|
*/
|
|
19662
|
-
message:
|
|
20929
|
+
message: z25.string(),
|
|
19663
20930
|
/**
|
|
19664
20931
|
* The ID of the elicitation, which must be unique within the context of the server.
|
|
19665
20932
|
* The client MUST treat this ID as an opaque value.
|
|
19666
20933
|
*/
|
|
19667
|
-
elicitationId:
|
|
20934
|
+
elicitationId: z25.string(),
|
|
19668
20935
|
/**
|
|
19669
20936
|
* The URL that the user should navigate to.
|
|
19670
20937
|
*/
|
|
19671
|
-
url:
|
|
20938
|
+
url: z25.string().url()
|
|
19672
20939
|
});
|
|
19673
|
-
ElicitRequestParamsSchema =
|
|
20940
|
+
ElicitRequestParamsSchema = z25.union([ElicitRequestFormParamsSchema, ElicitRequestURLParamsSchema]);
|
|
19674
20941
|
ElicitRequestSchema = RequestSchema.extend({
|
|
19675
|
-
method:
|
|
20942
|
+
method: z25.literal("elicitation/create"),
|
|
19676
20943
|
params: ElicitRequestParamsSchema
|
|
19677
20944
|
});
|
|
19678
20945
|
ElicitationCompleteNotificationParamsSchema = NotificationsParamsSchema.extend({
|
|
19679
20946
|
/**
|
|
19680
20947
|
* The ID of the elicitation that completed.
|
|
19681
20948
|
*/
|
|
19682
|
-
elicitationId:
|
|
20949
|
+
elicitationId: z25.string()
|
|
19683
20950
|
});
|
|
19684
20951
|
ElicitationCompleteNotificationSchema = NotificationSchema.extend({
|
|
19685
|
-
method:
|
|
20952
|
+
method: z25.literal("notifications/elicitation/complete"),
|
|
19686
20953
|
params: ElicitationCompleteNotificationParamsSchema
|
|
19687
20954
|
});
|
|
19688
20955
|
ElicitResultSchema = ResultSchema.extend({
|
|
@@ -19692,98 +20959,98 @@ var init_types3 = __esm({
|
|
|
19692
20959
|
* - "decline": User explicitly decline the action
|
|
19693
20960
|
* - "cancel": User dismissed without making an explicit choice
|
|
19694
20961
|
*/
|
|
19695
|
-
action:
|
|
20962
|
+
action: z25.enum(["accept", "decline", "cancel"]),
|
|
19696
20963
|
/**
|
|
19697
20964
|
* The submitted form data, only present when action is "accept".
|
|
19698
20965
|
* Contains values matching the requested schema.
|
|
19699
20966
|
* Per MCP spec, content is "typically omitted" for decline/cancel actions.
|
|
19700
20967
|
* We normalize null to undefined for leniency while maintaining type compatibility.
|
|
19701
20968
|
*/
|
|
19702
|
-
content:
|
|
20969
|
+
content: z25.preprocess((val) => val === null ? void 0 : val, z25.record(z25.string(), z25.union([z25.string(), z25.number(), z25.boolean(), z25.array(z25.string())])).optional())
|
|
19703
20970
|
});
|
|
19704
|
-
ResourceTemplateReferenceSchema =
|
|
19705
|
-
type:
|
|
20971
|
+
ResourceTemplateReferenceSchema = z25.object({
|
|
20972
|
+
type: z25.literal("ref/resource"),
|
|
19706
20973
|
/**
|
|
19707
20974
|
* The URI or URI template of the resource.
|
|
19708
20975
|
*/
|
|
19709
|
-
uri:
|
|
20976
|
+
uri: z25.string()
|
|
19710
20977
|
});
|
|
19711
|
-
PromptReferenceSchema =
|
|
19712
|
-
type:
|
|
20978
|
+
PromptReferenceSchema = z25.object({
|
|
20979
|
+
type: z25.literal("ref/prompt"),
|
|
19713
20980
|
/**
|
|
19714
20981
|
* The name of the prompt or prompt template
|
|
19715
20982
|
*/
|
|
19716
|
-
name:
|
|
20983
|
+
name: z25.string()
|
|
19717
20984
|
});
|
|
19718
20985
|
CompleteRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
19719
|
-
ref:
|
|
20986
|
+
ref: z25.union([PromptReferenceSchema, ResourceTemplateReferenceSchema]),
|
|
19720
20987
|
/**
|
|
19721
20988
|
* The argument's information
|
|
19722
20989
|
*/
|
|
19723
|
-
argument:
|
|
20990
|
+
argument: z25.object({
|
|
19724
20991
|
/**
|
|
19725
20992
|
* The name of the argument
|
|
19726
20993
|
*/
|
|
19727
|
-
name:
|
|
20994
|
+
name: z25.string(),
|
|
19728
20995
|
/**
|
|
19729
20996
|
* The value of the argument to use for completion matching.
|
|
19730
20997
|
*/
|
|
19731
|
-
value:
|
|
20998
|
+
value: z25.string()
|
|
19732
20999
|
}),
|
|
19733
|
-
context:
|
|
21000
|
+
context: z25.object({
|
|
19734
21001
|
/**
|
|
19735
21002
|
* Previously-resolved variables in a URI template or prompt.
|
|
19736
21003
|
*/
|
|
19737
|
-
arguments:
|
|
21004
|
+
arguments: z25.record(z25.string(), z25.string()).optional()
|
|
19738
21005
|
}).optional()
|
|
19739
21006
|
});
|
|
19740
21007
|
CompleteRequestSchema = RequestSchema.extend({
|
|
19741
|
-
method:
|
|
21008
|
+
method: z25.literal("completion/complete"),
|
|
19742
21009
|
params: CompleteRequestParamsSchema
|
|
19743
21010
|
});
|
|
19744
21011
|
CompleteResultSchema = ResultSchema.extend({
|
|
19745
|
-
completion:
|
|
21012
|
+
completion: z25.looseObject({
|
|
19746
21013
|
/**
|
|
19747
21014
|
* An array of completion values. Must not exceed 100 items.
|
|
19748
21015
|
*/
|
|
19749
|
-
values:
|
|
21016
|
+
values: z25.array(z25.string()).max(100),
|
|
19750
21017
|
/**
|
|
19751
21018
|
* The total number of completion options available. This can exceed the number of values actually sent in the response.
|
|
19752
21019
|
*/
|
|
19753
|
-
total:
|
|
21020
|
+
total: z25.optional(z25.number().int()),
|
|
19754
21021
|
/**
|
|
19755
21022
|
* Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown.
|
|
19756
21023
|
*/
|
|
19757
|
-
hasMore:
|
|
21024
|
+
hasMore: z25.optional(z25.boolean())
|
|
19758
21025
|
})
|
|
19759
21026
|
});
|
|
19760
|
-
RootSchema =
|
|
21027
|
+
RootSchema = z25.object({
|
|
19761
21028
|
/**
|
|
19762
21029
|
* The URI identifying the root. This *must* start with file:// for now.
|
|
19763
21030
|
*/
|
|
19764
|
-
uri:
|
|
21031
|
+
uri: z25.string().startsWith("file://"),
|
|
19765
21032
|
/**
|
|
19766
21033
|
* An optional name for the root.
|
|
19767
21034
|
*/
|
|
19768
|
-
name:
|
|
21035
|
+
name: z25.string().optional(),
|
|
19769
21036
|
/**
|
|
19770
21037
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
19771
21038
|
* for notes on _meta usage.
|
|
19772
21039
|
*/
|
|
19773
|
-
_meta:
|
|
21040
|
+
_meta: z25.record(z25.string(), z25.unknown()).optional()
|
|
19774
21041
|
});
|
|
19775
21042
|
ListRootsRequestSchema = RequestSchema.extend({
|
|
19776
|
-
method:
|
|
21043
|
+
method: z25.literal("roots/list"),
|
|
19777
21044
|
params: BaseRequestParamsSchema.optional()
|
|
19778
21045
|
});
|
|
19779
21046
|
ListRootsResultSchema = ResultSchema.extend({
|
|
19780
|
-
roots:
|
|
21047
|
+
roots: z25.array(RootSchema)
|
|
19781
21048
|
});
|
|
19782
21049
|
RootsListChangedNotificationSchema = NotificationSchema.extend({
|
|
19783
|
-
method:
|
|
21050
|
+
method: z25.literal("notifications/roots/list_changed"),
|
|
19784
21051
|
params: NotificationsParamsSchema.optional()
|
|
19785
21052
|
});
|
|
19786
|
-
ClientRequestSchema =
|
|
21053
|
+
ClientRequestSchema = z25.union([
|
|
19787
21054
|
PingRequestSchema,
|
|
19788
21055
|
InitializeRequestSchema,
|
|
19789
21056
|
CompleteRequestSchema,
|
|
@@ -19802,14 +21069,14 @@ var init_types3 = __esm({
|
|
|
19802
21069
|
ListTasksRequestSchema,
|
|
19803
21070
|
CancelTaskRequestSchema
|
|
19804
21071
|
]);
|
|
19805
|
-
ClientNotificationSchema =
|
|
21072
|
+
ClientNotificationSchema = z25.union([
|
|
19806
21073
|
CancelledNotificationSchema,
|
|
19807
21074
|
ProgressNotificationSchema,
|
|
19808
21075
|
InitializedNotificationSchema,
|
|
19809
21076
|
RootsListChangedNotificationSchema,
|
|
19810
21077
|
TaskStatusNotificationSchema
|
|
19811
21078
|
]);
|
|
19812
|
-
ClientResultSchema =
|
|
21079
|
+
ClientResultSchema = z25.union([
|
|
19813
21080
|
EmptyResultSchema,
|
|
19814
21081
|
CreateMessageResultSchema,
|
|
19815
21082
|
CreateMessageResultWithToolsSchema,
|
|
@@ -19819,7 +21086,7 @@ var init_types3 = __esm({
|
|
|
19819
21086
|
ListTasksResultSchema,
|
|
19820
21087
|
CreateTaskResultSchema
|
|
19821
21088
|
]);
|
|
19822
|
-
ServerRequestSchema =
|
|
21089
|
+
ServerRequestSchema = z25.union([
|
|
19823
21090
|
PingRequestSchema,
|
|
19824
21091
|
CreateMessageRequestSchema,
|
|
19825
21092
|
ElicitRequestSchema,
|
|
@@ -19829,7 +21096,7 @@ var init_types3 = __esm({
|
|
|
19829
21096
|
ListTasksRequestSchema,
|
|
19830
21097
|
CancelTaskRequestSchema
|
|
19831
21098
|
]);
|
|
19832
|
-
ServerNotificationSchema =
|
|
21099
|
+
ServerNotificationSchema = z25.union([
|
|
19833
21100
|
CancelledNotificationSchema,
|
|
19834
21101
|
ProgressNotificationSchema,
|
|
19835
21102
|
LoggingMessageNotificationSchema,
|
|
@@ -19840,7 +21107,7 @@ var init_types3 = __esm({
|
|
|
19840
21107
|
TaskStatusNotificationSchema,
|
|
19841
21108
|
ElicitationCompleteNotificationSchema
|
|
19842
21109
|
]);
|
|
19843
|
-
ServerResultSchema =
|
|
21110
|
+
ServerResultSchema = z25.union([
|
|
19844
21111
|
EmptyResultSchema,
|
|
19845
21112
|
InitializeResultSchema,
|
|
19846
21113
|
CompleteResultSchema,
|
|
@@ -26806,7 +28073,7 @@ var require_core = __commonJS({
|
|
|
26806
28073
|
errorsText(errors = this.errors, { separator = ", ", dataVar = "data" } = {}) {
|
|
26807
28074
|
if (!errors || errors.length === 0)
|
|
26808
28075
|
return "No errors";
|
|
26809
|
-
return errors.map((e) => `${dataVar}${e.instancePath} ${e.message}`).reduce((
|
|
28076
|
+
return errors.map((e) => `${dataVar}${e.instancePath} ${e.message}`).reduce((text3, msg) => text3 + separator + msg);
|
|
26810
28077
|
}
|
|
26811
28078
|
$dataMetaSchema(metaSchema, keywordsJsonPointers) {
|
|
26812
28079
|
const rules = this.RULES.all;
|
|
@@ -31129,22 +32396,22 @@ var init_stdio2 = __esm({
|
|
|
31129
32396
|
});
|
|
31130
32397
|
|
|
31131
32398
|
// ../../packages/mcp-server/src/tools.ts
|
|
31132
|
-
import { z as
|
|
32399
|
+
import { z as z26 } from "zod";
|
|
31133
32400
|
var runTaskInputSchema, RUN_TASK_DESCRIPTION;
|
|
31134
32401
|
var init_tools = __esm({
|
|
31135
32402
|
"../../packages/mcp-server/src/tools.ts"() {
|
|
31136
32403
|
"use strict";
|
|
31137
32404
|
init_src2();
|
|
31138
|
-
runTaskInputSchema =
|
|
32405
|
+
runTaskInputSchema = z26.object({
|
|
31139
32406
|
// LE contrat partage du slug (shared/agent-slug.ts) — la review a montre
|
|
31140
32407
|
// que trois definitions divergentes rendaient un agent valide inciblable.
|
|
31141
32408
|
agent: AgentSlugSchema.optional().describe(
|
|
31142
32409
|
"Optional TARGET agent, by slug, resolved INSIDE this workspace only. Omit to address the workspace root agent. Choosing a target is the same power as choosing which chat to type in \u2014 the job runs under THAT agent's tools, approval rules and budgets, and MCP jobs never get the configuration tools regardless of target."
|
|
31143
32410
|
),
|
|
31144
|
-
caller:
|
|
32411
|
+
caller: z26.string().min(1).max(120).regex(/^[\w .:@/-]+$/, "caller must be a plain label (letters, digits, spaces, .:@/-_ only)").optional().describe(
|
|
31145
32412
|
'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.'
|
|
31146
32413
|
),
|
|
31147
|
-
instruction:
|
|
32414
|
+
instruction: z26.string().min(1).max(16e3).describe(
|
|
31148
32415
|
"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."
|
|
31149
32416
|
)
|
|
31150
32417
|
});
|