@vecteur/cli 0.7.1 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/contract.js CHANGED
@@ -1,12 +1,16 @@
1
1
  // GENERATED by scripts/gen-contract.mjs from owner TypeScript projections.
2
- export const OWNER_CONTRACT_IDENTITY = "api-sha256:8f81ea544eecd9e81da3fd56ad816ac24991cb0e68f3b1cb45180711eaf16056;run-wire-sha256:d434735f6e34527aaa34ffa4babeb43da12fa07b36876a1394ab8da23bcea6e3";
2
+ export const OWNER_CONTRACT_IDENTITY = "api-sha256:b78084db722fba9eb9c159fcc93b29d12db0760ded46263aca2ad2fcf97d6a3f;run-wire-sha256:7bc5c77a90d6093cff5179533d4f4b6326056057dd677740cac097ebc0c8fb54";
3
+ export const MODEL_CATALOGUE = Object.freeze([{"profile_id":"glm","label":"GLM 5.3","model":"z-ai/glm-5.3","provider":"tensorx","data_residency":"EU","data_residency_source":"vendor","data_residency_source_url":"https://tensorx.ai/trust-security/","admitted_context_window_tokens":131072,"dialect":"openai_chat","execution_placement":null,"eligibility_sha256":"9b77e192a34bc1e2dc909a84a736d4e21f5d5835f25aae763380ac6f7c7907a7","hosting":"provider_api","reasoning":null,"image_input":false,"training_permitted":false,"retention_mode":"zero_retention","retention_stated_days":null,"retention_fact":"Prompts and completions are processed with zero data retention.","zero_retention_endpoint":true,"policy_source_url":"https://tensorx.ai/terms-of-service/","policy_checked_at":"2026-10-30","policy_expires_at":"2027-01-28","operator_entity":"TensorX Ltd.","operator_country":"Ireland","governing_law":"Ireland","operator_source_url":"https://tensorx.ai/terms-of-service/","downstream_provider":null,"downstream_policy_fact":null},{"profile_id":"flash","label":"DeepSeek V4.1 Flash 1017","model":"deepseek/deepseek-v4.1-flash-1017","provider":"tensorx","data_residency":"EU","data_residency_source":"vendor","data_residency_source_url":"https://tensorx.ai/trust-security/","admitted_context_window_tokens":131072,"dialect":"openai_chat","execution_placement":null,"eligibility_sha256":"0bb3844773a56a555dde5f20b2c8cab0271d937a246b7c3ae642fd98e49516e9","hosting":"provider_api","reasoning":"low","image_input":false,"training_permitted":false,"retention_mode":"zero_retention","retention_stated_days":null,"retention_fact":"Prompts and completions are processed with zero data retention.","zero_retention_endpoint":true,"policy_source_url":"https://tensorx.ai/terms-of-service/","policy_checked_at":"2026-10-30","policy_expires_at":"2027-01-28","operator_entity":"TensorX Ltd.","operator_country":"Ireland","governing_law":"Ireland","operator_source_url":"https://tensorx.ai/terms-of-service/","downstream_provider":null,"downstream_policy_fact":null},{"profile_id":"kimi_k3","label":"Kimi K3","model":"moonshotai/kimi-k3","provider":"tensorx","data_residency":"EU","data_residency_source":"vendor","data_residency_source_url":"https://tensorx.ai/trust-security/","admitted_context_window_tokens":131072,"dialect":"openai_chat","execution_placement":null,"eligibility_sha256":"e69f8b077c57c5636da412ce31d2a2e2eff6210ecc8832044250ea81a6ce3d9b","hosting":"provider_api","reasoning":null,"image_input":false,"training_permitted":false,"retention_mode":"zero_retention","retention_stated_days":null,"retention_fact":"Prompts and completions are processed with zero data retention.","zero_retention_endpoint":true,"policy_source_url":"https://tensorx.ai/terms-of-service/","policy_checked_at":"2026-10-30","policy_expires_at":"2027-01-28","operator_entity":"TensorX Ltd.","operator_country":"Ireland","governing_law":"Ireland","operator_source_url":"https://tensorx.ai/terms-of-service/","downstream_provider":null,"downstream_policy_fact":null},{"profile_id":"deepseek_pro","label":"DeepSeek V4 Pro","model":"deepseek/deepseek-v4-pro-0813","provider":"tensorx","data_residency":"EU","data_residency_source":"vendor","data_residency_source_url":"https://tensorx.ai/trust-security/","admitted_context_window_tokens":131072,"dialect":"openai_chat","execution_placement":null,"eligibility_sha256":"82cb953f9b3d7ee90d4de9b8e3abc8dcff16379ac0f446d9d194cea5d3ec2585","hosting":"provider_api","reasoning":null,"image_input":false,"training_permitted":false,"retention_mode":"zero_retention","retention_stated_days":null,"retention_fact":"Prompts and completions are processed with zero data retention.","zero_retention_endpoint":true,"policy_source_url":"https://tensorx.ai/terms-of-service/","policy_checked_at":"2026-10-30","policy_expires_at":"2027-01-28","operator_entity":"TensorX Ltd.","operator_country":"Ireland","governing_law":"Ireland","operator_source_url":"https://tensorx.ai/terms-of-service/","downstream_provider":null,"downstream_policy_fact":null},{"profile_id":"glm_flash","label":"GLM 5.3 Flash","model":"z-ai/glm-5.3-flash","provider":"tensorx","data_residency":"EU","data_residency_source":"vendor","data_residency_source_url":"https://tensorx.ai/trust-security/","admitted_context_window_tokens":1000000,"dialect":"openai_chat","execution_placement":null,"eligibility_sha256":"9b38c17e45100344956e5235c97ab6195de9e426108ceab63eba172b7a617592","hosting":"provider_api","reasoning":null,"image_input":false,"training_permitted":false,"retention_mode":"zero_retention","retention_stated_days":null,"retention_fact":"Prompts and completions are processed with zero data retention.","zero_retention_endpoint":true,"policy_source_url":"https://tensorx.ai/terms-of-service/","policy_checked_at":"2026-10-30","policy_expires_at":"2027-01-28","operator_entity":"TensorX Ltd.","operator_country":"Ireland","governing_law":"Ireland","operator_source_url":"https://tensorx.ai/terms-of-service/","downstream_provider":null,"downstream_policy_fact":null},{"profile_id":"mistral","label":"Mistral Small 4","model":"mistral-small-2603","provider":"mistral","data_residency":"EU","data_residency_source":"vendor","data_residency_source_url":"https://docs.mistral.ai/inference/regional-inference","admitted_context_window_tokens":262144,"dialect":"mistral_conversations","execution_placement":null,"eligibility_sha256":"8bf0ba9bc0ef536214e0248d8fc918f302f38b4e406883c4b9854ec9594aa77a","hosting":"provider_api","reasoning":null,"image_input":true,"training_permitted":false,"retention_mode":"published_with_exceptions","retention_stated_days":null,"retention_fact":"Commercial API data has published privacy and retention controls with documented exceptions; zero data retention requires separate account approval and enablement.","zero_retention_endpoint":false,"policy_source_url":"https://docs.mistral.ai/admin/monitor-comply/privacy-data-controls","policy_checked_at":"2026-08-28","policy_expires_at":"2026-11-26","operator_entity":"Mistral AI","operator_country":"France","governing_law":"France","operator_source_url":"https://legal.mistral.ai/terms/commercial-terms-of-service","downstream_provider":null,"downstream_policy_fact":null},{"profile_id":"mistral_medium","label":"Mistral Medium 3.5","model":"mistral-medium-2604","provider":"mistral","data_residency":"EU","data_residency_source":"vendor","data_residency_source_url":"https://docs.mistral.ai/inference/regional-inference","admitted_context_window_tokens":262144,"dialect":"mistral_conversations","execution_placement":null,"eligibility_sha256":"8c52e7ab13e7ec0c21777e9742b675ced4ef07b3166d3bdec6a129b0200f67d7","hosting":"provider_api","reasoning":null,"image_input":true,"training_permitted":false,"retention_mode":"published_with_exceptions","retention_stated_days":null,"retention_fact":"Commercial API data has published privacy and retention controls with documented exceptions; zero data retention requires separate account approval and enablement.","zero_retention_endpoint":false,"policy_source_url":"https://docs.mistral.ai/admin/monitor-comply/privacy-data-controls","policy_checked_at":"2026-08-28","policy_expires_at":"2026-11-26","operator_entity":"Mistral AI","operator_country":"France","governing_law":"France","operator_source_url":"https://legal.mistral.ai/terms/commercial-terms-of-service","downstream_provider":null,"downstream_policy_fact":null},{"profile_id":"luna","label":"GPT-6 Luna","model":"gpt-6-luna","provider":"openai","data_residency":"GLOBAL","data_residency_source":"vendor","data_residency_source_url":"https://developers.openai.com/api/docs/guides/your-data","admitted_context_window_tokens":131072,"dialect":"openai_responses","execution_placement":null,"eligibility_sha256":"5aad437ed7ad769d6e824d6a24e0ce7253a2cf65483f9af998257ba4b3a62210","hosting":"provider_api","reasoning":"medium","image_input":true,"training_permitted":false,"retention_mode":"published_with_exceptions","retention_stated_days":30,"retention_fact":"Chat Completions abuse-monitoring logs are normally retained up to 30 days, with documented legal and safety exceptions.","zero_retention_endpoint":false,"policy_source_url":"https://platform.openai.com/docs/models/default-usage-policies-by-endpoint","policy_checked_at":"2026-10-30","policy_expires_at":"2027-01-28","operator_entity":"OpenAI Ireland Ltd.","operator_country":"Ireland","governing_law":"Ireland","operator_source_url":"https://openai.com/policies/services-agreement/","downstream_provider":null,"downstream_policy_fact":null},{"profile_id":"sol","label":"GPT-6.1 Sol","model":"gpt-6.1-sol","provider":"openai","data_residency":"GLOBAL","data_residency_source":"vendor","data_residency_source_url":"https://developers.openai.com/api/docs/guides/your-data","admitted_context_window_tokens":131072,"dialect":"openai_responses","execution_placement":null,"eligibility_sha256":"d8d6c3f90abcce5c33a0fbaca1e20c01be408460a5a0ade3ed676e31a09bf128","hosting":"provider_api","reasoning":"medium","image_input":true,"training_permitted":false,"retention_mode":"published_with_exceptions","retention_stated_days":30,"retention_fact":"Chat Completions abuse-monitoring logs are normally retained up to 30 days, with documented legal and safety exceptions.","zero_retention_endpoint":false,"policy_source_url":"https://platform.openai.com/docs/models/default-usage-policies-by-endpoint","policy_checked_at":"2026-10-30","policy_expires_at":"2027-01-28","operator_entity":"OpenAI Ireland Ltd.","operator_country":"Ireland","governing_law":"Ireland","operator_source_url":"https://openai.com/policies/services-agreement/","downstream_provider":null,"downstream_policy_fact":null},{"profile_id":"astra","label":"GPT-6 Astra","model":"gpt-6-astra","provider":"openai","data_residency":"GLOBAL","data_residency_source":"vendor","data_residency_source_url":"https://developers.openai.com/api/docs/guides/your-data","admitted_context_window_tokens":131072,"dialect":"openai_responses","execution_placement":null,"eligibility_sha256":"166b94ca70d14249e14bcf080b92643772d3ebdb75fd3ab81c15a6a7fb2d6e5a","hosting":"provider_api","reasoning":"high","image_input":true,"training_permitted":false,"retention_mode":"published_with_exceptions","retention_stated_days":30,"retention_fact":"Chat Completions abuse-monitoring logs are normally retained up to 30 days, with documented legal and safety exceptions.","zero_retention_endpoint":false,"policy_source_url":"https://platform.openai.com/docs/models/default-usage-policies-by-endpoint","policy_checked_at":"2026-10-30","policy_expires_at":"2027-01-28","operator_entity":"OpenAI Ireland Ltd.","operator_country":"Ireland","governing_law":"Ireland","operator_source_url":"https://openai.com/policies/services-agreement/","downstream_provider":null,"downstream_policy_fact":null},{"profile_id":"claude_fable","label":"Claude Fable 5.1","model":"claude-fable-5-1","provider":"anthropic","data_residency":"US","data_residency_source":"vendor","data_residency_source_url":"https://privacy.claude.com/en/articles/7996890-where-are-your-servers-located-do-you-host-your-models-on-eu-servers","admitted_context_window_tokens":131072,"dialect":"anthropic_messages","execution_placement":null,"eligibility_sha256":"75224e4a7464da37d21c6b4b1ed4567a73b4430faad20221560899534404a8a7","hosting":"provider_api","reasoning":null,"image_input":true,"training_permitted":false,"retention_mode":"published_with_exceptions","retention_stated_days":30,"retention_fact":"Commercial API inputs and outputs are normally retained up to 30 days, with documented legal, policy and safety exceptions.","zero_retention_endpoint":false,"policy_source_url":"https://privacy.claude.com/en/articles/7996866-how-long-do-you-store-my-organization-s-data","policy_checked_at":"2026-10-30","policy_expires_at":"2027-01-28","operator_entity":"Anthropic Ireland, Limited","operator_country":"Ireland","governing_law":"Ireland","operator_source_url":"https://www.anthropic.com/legal/commercial-terms","downstream_provider":null,"downstream_policy_fact":null},{"profile_id":"claude_opus","label":"Claude Opus 5.5","model":"claude-opus-5-5","provider":"anthropic","data_residency":"US","data_residency_source":"vendor","data_residency_source_url":"https://privacy.claude.com/en/articles/7996890-where-are-your-servers-located-do-you-host-your-models-on-eu-servers","admitted_context_window_tokens":131072,"dialect":"anthropic_messages","execution_placement":null,"eligibility_sha256":"70fcb6021cb82980290ea4d431106bdf5dd0ccace8b012e44e83f07c61019e4d","hosting":"provider_api","reasoning":null,"image_input":true,"training_permitted":false,"retention_mode":"published_with_exceptions","retention_stated_days":30,"retention_fact":"Commercial API inputs and outputs are normally retained up to 30 days, with documented legal, policy and safety exceptions.","zero_retention_endpoint":false,"policy_source_url":"https://privacy.claude.com/en/articles/7996866-how-long-do-you-store-my-organization-s-data","policy_checked_at":"2026-10-30","policy_expires_at":"2027-01-28","operator_entity":"Anthropic Ireland, Limited","operator_country":"Ireland","governing_law":"Ireland","operator_source_url":"https://www.anthropic.com/legal/commercial-terms","downstream_provider":null,"downstream_policy_fact":null},{"profile_id":"claude_sonnet","label":"Claude Sonnet 5.5","model":"claude-sonnet-5-5","provider":"anthropic","data_residency":"US","data_residency_source":"vendor","data_residency_source_url":"https://privacy.claude.com/en/articles/7996890-where-are-your-servers-located-do-you-host-your-models-on-eu-servers","admitted_context_window_tokens":131072,"dialect":"anthropic_messages","execution_placement":null,"eligibility_sha256":"8892913a3ed87bae501dcfc300c51cb1342ede2956ef3a40d44ce30602f5d939","hosting":"provider_api","reasoning":null,"image_input":true,"training_permitted":false,"retention_mode":"published_with_exceptions","retention_stated_days":30,"retention_fact":"Commercial API inputs and outputs are normally retained up to 30 days, with documented legal, policy and safety exceptions.","zero_retention_endpoint":false,"policy_source_url":"https://privacy.claude.com/en/articles/7996866-how-long-do-you-store-my-organization-s-data","policy_checked_at":"2026-10-30","policy_expires_at":"2027-01-28","operator_entity":"Anthropic Ireland, Limited","operator_country":"Ireland","governing_law":"Ireland","operator_source_url":"https://www.anthropic.com/legal/commercial-terms","downstream_provider":null,"downstream_policy_fact":null},{"profile_id":"claude_haiku","label":"Claude Haiku 5.5","model":"claude-haiku-5-5","provider":"anthropic","data_residency":"US","data_residency_source":"vendor","data_residency_source_url":"https://privacy.claude.com/en/articles/7996890-where-are-your-servers-located-do-you-host-your-models-on-eu-servers","admitted_context_window_tokens":131072,"dialect":"anthropic_messages","execution_placement":null,"eligibility_sha256":"32647fa178a427705d04b7ec6447810da7016d36725c8625bbdc8ea5677e24f7","hosting":"provider_api","reasoning":null,"image_input":true,"training_permitted":false,"retention_mode":"published_with_exceptions","retention_stated_days":30,"retention_fact":"Commercial API inputs and outputs are normally retained up to 30 days, with documented legal, policy and safety exceptions.","zero_retention_endpoint":false,"policy_source_url":"https://privacy.claude.com/en/articles/7996866-how-long-do-you-store-my-organization-s-data","policy_checked_at":"2026-10-30","policy_expires_at":"2027-01-28","operator_entity":"Anthropic Ireland, Limited","operator_country":"Ireland","governing_law":"Ireland","operator_source_url":"https://www.anthropic.com/legal/commercial-terms","downstream_provider":null,"downstream_policy_fact":null},{"profile_id":"nebius_nemotron","label":"Nemotron 3.5 Lightning","model":"nvidia/Nemotron-3_5-Lightning","provider":"nebius","data_residency":"EU","data_residency_source":"vendor","data_residency_source_url":"https://docs.tokenfactory.nebius.com/legal/legal-quick-guide","admitted_context_window_tokens":1048576,"dialect":"openai_chat","execution_placement":null,"eligibility_sha256":"f0586d343f97c23ed000e00ed86236c3c0c91b3300b2763079e8f6879c081e16","hosting":"provider_api","reasoning":null,"image_input":false,"training_permitted":false,"retention_mode":"published_with_exceptions","retention_stated_days":null,"retention_fact":"Without organization-level zero data retention, inputs and outputs may be retained solely for speculative decoding; retained data is stored in Finland in the European Union.","zero_retention_endpoint":false,"policy_source_url":"https://docs.tokenfactory.nebius.com/legal/legal-quick-guide","policy_checked_at":"2026-10-30","policy_expires_at":"2027-01-28","operator_entity":"Nebius B.V.","operator_country":"Netherlands","governing_law":"Netherlands","operator_source_url":"https://docs.nebius.com/legal/agreement","downstream_provider":null,"downstream_policy_fact":null},{"profile_id":"openrouter_glm","label":"GLM 5.3","model":"z-ai/glm-5.3","provider":"openrouter","data_residency":"GLOBAL","data_residency_source":"vendor","data_residency_source_url":"https://openrouter.ai/docs/guides/privacy/provider-logging","admitted_context_window_tokens":131072,"dialect":"openai_chat","execution_placement":"GLOBAL","eligibility_sha256":"99d39ebcf0661d9556db669cfe118c59f94fb253476fa1a23bafb42938cc9a4b","hosting":"provider_api","reasoning":"low","image_input":false,"training_permitted":false,"retention_mode":"published_with_exceptions","retention_stated_days":null,"retention_fact":"OpenRouter retains prompts only on opt-in or for CSAM review, reporting and legal preservation, ZDR traffic included; downstream commercial policies have documented retention exceptions. This route makes no platform-wide zero-retention guarantee.","zero_retention_endpoint":true,"policy_source_url":"https://openrouter.ai/docs/guides/privacy/provider-logging","policy_checked_at":"2026-10-30","policy_expires_at":"2026-11-29","operator_entity":"OpenRouter, Inc.","operator_country":"United States","governing_law":"New York, United States","operator_source_url":"https://openrouter.ai/terms","downstream_provider":"DeepInfra","downstream_policy_fact":"DeepInfra does not train on API inputs for these models; in-memory processing has documented debugging and security logging exceptions."},{"profile_id":"openrouter_ling","label":"Ling 3.1 Flash","model":"inclusionai/ling-3.1-flash","provider":"openrouter","data_residency":"GLOBAL","data_residency_source":"vendor","data_residency_source_url":"https://openrouter.ai/docs/guides/privacy/provider-logging","admitted_context_window_tokens":131072,"dialect":"openai_chat","execution_placement":"GLOBAL","eligibility_sha256":"713b2ca20ed060398e1589baa4f2d9759a462e7985c2c4ec8456e8216ed949d0","hosting":"provider_api","reasoning":"off","image_input":false,"training_permitted":false,"retention_mode":"published_with_exceptions","retention_stated_days":null,"retention_fact":"OpenRouter retains prompts only on opt-in or for CSAM review, reporting and legal preservation, ZDR traffic included; downstream commercial policies have documented retention exceptions. This route makes no platform-wide zero-retention guarantee.","zero_retention_endpoint":true,"policy_source_url":"https://openrouter.ai/docs/guides/privacy/provider-logging","policy_checked_at":"2026-10-30","policy_expires_at":"2026-11-29","operator_entity":"OpenRouter, Inc.","operator_country":"United States","governing_law":"New York, United States","operator_source_url":"https://openrouter.ai/terms","downstream_provider":"DeepInfra","downstream_policy_fact":"DeepInfra does not train on API inputs for these models and does not store submitted data on disk; it holds it in memory during inference."},{"profile_id":"gpt_terra","label":"GPT-6.1 Terra","model":"gpt-6.1-terra","provider":"openai","data_residency":"GLOBAL","data_residency_source":"vendor","data_residency_source_url":"https://developers.openai.com/api/docs/guides/your-data","admitted_context_window_tokens":131072,"dialect":"openai_responses","execution_placement":null,"eligibility_sha256":"09e58e0478782db24bd9cdca7a8d04805716045e622830c9770fd823a083c6f7","hosting":"provider_api","reasoning":"medium","image_input":true,"training_permitted":false,"retention_mode":"published_with_exceptions","retention_stated_days":30,"retention_fact":"Chat Completions abuse-monitoring logs are normally retained up to 30 days, with documented legal and safety exceptions.","zero_retention_endpoint":false,"policy_source_url":"https://platform.openai.com/docs/models/default-usage-policies-by-endpoint","policy_checked_at":"2026-10-30","policy_expires_at":"2027-01-28","operator_entity":"OpenAI Ireland Ltd.","operator_country":"Ireland","governing_law":"Ireland","operator_source_url":"https://openai.com/policies/services-agreement/","downstream_provider":null,"downstream_policy_fact":null},{"profile_id":"openrouter_gemini_flash","label":"Gemini 3.8 Flash","model":"google/gemini-3.8-flash","provider":"openrouter","data_residency":"GLOBAL","data_residency_source":"vendor","data_residency_source_url":"https://openrouter.ai/docs/guides/privacy/provider-logging","admitted_context_window_tokens":131072,"dialect":"openai_chat","execution_placement":"GLOBAL","eligibility_sha256":"fe98eada28b9f5521600959ed87e6634923e1b10136c053ceae485919fb85ba8","hosting":"provider_api","reasoning":"medium","image_input":false,"training_permitted":false,"retention_mode":"published_with_exceptions","retention_stated_days":null,"retention_fact":"OpenRouter retains prompts only on opt-in or for CSAM review, reporting and legal preservation, ZDR traffic included; downstream commercial policies have documented retention exceptions. This route makes no platform-wide zero-retention guarantee.","zero_retention_endpoint":false,"policy_source_url":"https://openrouter.ai/docs/guides/privacy/provider-logging","policy_checked_at":"2026-10-30","policy_expires_at":"2026-11-29","operator_entity":"OpenRouter, Inc.","operator_country":"United States","governing_law":"New York, United States","operator_source_url":"https://openrouter.ai/terms","downstream_provider":"Google","downstream_policy_fact":"Google does not train on Vertex AI customer data without permission; prompts its abuse classifiers flag may be stored up to 90 days (OpenRouter Safety Retention on every Vertex endpoint since 2026-10-18), so this endpoint is not strict zero-retention."},{"profile_id":"openrouter_gemini_argon","label":"Gemini 4 Argon","model":"google/gemini-4-argon","provider":"openrouter","data_residency":"GLOBAL","data_residency_source":"vendor","data_residency_source_url":"https://openrouter.ai/docs/guides/privacy/provider-logging","admitted_context_window_tokens":131072,"dialect":"openai_chat","execution_placement":"GLOBAL","eligibility_sha256":"80efc4df5597ab3e9d4584bb065e381a2ae91b4f5d3f9187d6de7e3e568035d2","hosting":"provider_api","reasoning":"high","image_input":false,"training_permitted":false,"retention_mode":"published_with_exceptions","retention_stated_days":null,"retention_fact":"OpenRouter retains prompts only on opt-in or for CSAM review, reporting and legal preservation, ZDR traffic included; downstream commercial policies have documented retention exceptions. This route makes no platform-wide zero-retention guarantee.","zero_retention_endpoint":false,"policy_source_url":"https://openrouter.ai/docs/guides/privacy/provider-logging","policy_checked_at":"2026-10-30","policy_expires_at":"2026-11-29","operator_entity":"OpenRouter, Inc.","operator_country":"United States","governing_law":"New York, United States","operator_source_url":"https://openrouter.ai/terms","downstream_provider":"Google","downstream_policy_fact":"Google does not train on Vertex AI customer data without permission; prompts its abuse classifiers flag may be stored up to 90 days (OpenRouter Safety Retention on every Vertex endpoint since 2026-10-18), so this endpoint is not strict zero-retention."},{"profile_id":"openrouter_grok","label":"Grok 4.7","model":"x-ai/grok-4.7","provider":"openrouter","data_residency":"GLOBAL","data_residency_source":"vendor","data_residency_source_url":"https://openrouter.ai/docs/guides/privacy/provider-logging","admitted_context_window_tokens":131072,"dialect":"openai_chat","execution_placement":"GLOBAL","eligibility_sha256":"bf4c95e82a447814818183288ba7d8d8673453403ff93817fe6e3a8617968715","hosting":"provider_api","reasoning":"low","image_input":false,"training_permitted":false,"retention_mode":"published_with_exceptions","retention_stated_days":null,"retention_fact":"OpenRouter retains prompts only on opt-in or for CSAM review, reporting and legal preservation, ZDR traffic included; downstream commercial policies have documented retention exceptions. This route makes no platform-wide zero-retention guarantee.","zero_retention_endpoint":true,"policy_source_url":"https://openrouter.ai/docs/guides/privacy/provider-logging","policy_checked_at":"2026-10-30","policy_expires_at":"2026-11-29","operator_entity":"OpenRouter, Inc.","operator_country":"United States","governing_law":"New York, United States","operator_source_url":"https://openrouter.ai/terms","downstream_provider":"xAI","downstream_policy_fact":"xAI never trains on API inputs or outputs without permission; under ZDR inputs and outputs are never persisted to disk."}]);
4
+ export const PRODUCT_ROUTES = Object.freeze([{"route_id":"auto","label":"Auto","level":"balanced","region":"GLOBAL","route_sha256":"3d76e34a3fc43eddafb9d16d45ffbb85ce0d7cad72add85101e83322eabb383a","max_provider_switches":1,"candidates":[{"profile_id":"gpt_terra","provider_id":"openai","model_id":"gpt-6.1-terra","jurisdiction":"GLOBAL"},{"profile_id":"flash","provider_id":"tensorx","model_id":"deepseek/deepseek-v4.1-flash-1017","jurisdiction":"EU"}]},{"route_id":"auto_eu","label":"Auto EU","level":"balanced","region":"EU","route_sha256":"a1d9f41cb4ce71bf1925e33a838c78c4009416fe04d05795b3fbb7d4ea482162","max_provider_switches":1,"candidates":[{"profile_id":"flash","provider_id":"tensorx","model_id":"deepseek/deepseek-v4.1-flash-1017","jurisdiction":"EU"},{"profile_id":"glm_flash","provider_id":"tensorx","model_id":"z-ai/glm-5.3-flash","jurisdiction":"EU"}]},{"route_id":"quality","label":"Best quality","level":"quality","region":"GLOBAL","route_sha256":"88474569b15517cbc3b8b004588b41622b16b88529b5178f7a5159d4c535d2fd","max_provider_switches":1,"candidates":[{"profile_id":"astra","provider_id":"openai","model_id":"gpt-6-astra","jurisdiction":"GLOBAL"},{"profile_id":"claude_opus","provider_id":"anthropic","model_id":"claude-opus-5-5","jurisdiction":"US"}]},{"route_id":"quality_eu","label":"Best quality EU","level":"quality","region":"EU","route_sha256":"00fd959a8d8106119969bdb21f19b23edefa772642b34cb4b7d4107aa36c22dc","max_provider_switches":1,"candidates":[{"profile_id":"flash","provider_id":"tensorx","model_id":"deepseek/deepseek-v4.1-flash-1017","jurisdiction":"EU"},{"profile_id":"glm","provider_id":"tensorx","model_id":"z-ai/glm-5.3","jurisdiction":"EU"}]},{"route_id":"economy","label":"Lowest cost","level":"economy","region":"GLOBAL","route_sha256":"f9a74312bb237c9f5fc1af1defa3ed1711d10dca8cd1c0ef0c44ab5ac5b27501","max_provider_switches":1,"candidates":[{"profile_id":"luna","provider_id":"openai","model_id":"gpt-6-luna","jurisdiction":"GLOBAL"},{"profile_id":"claude_haiku","provider_id":"anthropic","model_id":"claude-haiku-5-5","jurisdiction":"US"}]},{"route_id":"economy_eu","label":"Lowest cost EU","level":"economy","region":"EU","route_sha256":"e56851dc6469526a05132b82bc1905d27b4fe4a9143c31c7f3e9df7f1265dcad","max_provider_switches":1,"candidates":[{"profile_id":"glm_flash","provider_id":"tensorx","model_id":"z-ai/glm-5.3-flash","jurisdiction":"EU"},{"profile_id":"flash","provider_id":"tensorx","model_id":"deepseek/deepseek-v4.1-flash-1017","jurisdiction":"EU"}]}]);
5
+ export const EXECUTION_HORIZONS = Object.freeze([{"tier":"free","max_steps":30},{"tier":"pro","max_steps":50},{"tier":"enterprise","max_steps":null}]);
6
+ export const CATALOGUE_ENVELOPE_SHA256 = Object.freeze("819e23f4ca1501312600da20559307d3bf57ae8b5aa0920fbb232e3b5175df0f");
3
7
  export const RECOVERY_ACTIONS = Object.freeze({"delete_project":{"label":"Delete a project","href":"/projects"},"upgrade_plan":{"label":"Upgrade your plan","href":"/dashboard/billing"},"wait_for_reset":{"label":"Wait until the UTC reset","href":null}});
4
8
  export const EVENT_KINDS = Object.freeze(["source","step_started","step_finished","tool_call","tool_result","synthesis","artifact","terminal","heartbeat","assistant_delta","knowledge_binding","engineering_projection","provider_attempt","clarification","clarification_evidence","input_rows"]);
5
9
  export const RETIRED_EVENT_KINDS = Object.freeze(["context_frame","cta","step_label"]);
6
- export const TERMINAL_FIELDS = Object.freeze(["answer","defect","deliverable_asked","evidence_dag","instruction_source","intent","missing_input_need","missing_inputs","provider_retry_offer","recovery","refusal_unfounded","state","steps","study_unpublished","unmet_wanted"]);
10
+ export const TERMINAL_FIELDS = Object.freeze(["answer","capacity","defect","deliverable_asked","evidence_dag","instruction_source","intent","missing_input_need","missing_inputs","provider_retry_offer","recovery","refusal_unfounded","state","steps","study_unpublished","unmet_wanted"]);
7
11
  export const TERMINAL_STATES = Object.freeze(["ok","partial","blocked","refused","infeasible_physics","capability_gap"]);
8
12
  export const ARTIFACT_MEDIA_TYPES = Object.freeze({"binary":"application/octet-stream","code":"text/plain","csv":"text/csv","docx":"application/vnd.openxmlformats-officedocument.wordprocessingml.document","drive":"application/vnd.google-drive","html":"text/html","jpeg":"image/jpeg","json":"application/json","md":"text/markdown","pdf":"application/pdf","png":"image/png","svg":"image/svg+xml","xlsx":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});
9
- export const TERMINAL_RECOVERY_DECLARATIONS = Object.freeze({"answer_now":[["start_run",["project_id"]]],"artifact_publication_missing":[["start_run",["project_id"]]],"artifact_store_unavailable":[["start_run",["project_id"]]],"budget_exhausted":[["start_run",["project_id"]]],"cancelled":[["start_run",["project_id"]]],"cause_unrecorded":[["start_run",["project_id"]]],"clarification_custody_invalid":[["start_run",["project_id"]]],"clarification_custody_lost":[["start_run",["project_id"]]],"clarification_resume_invalid":[["start_run",["project_id"]]],"clarification_unpersisted":[["start_run",["project_id"]]],"context_unselected":[["start_run",["project_id"]]],"credential_class_disclosure":[["start_run",["project_id"]]],"deliverable_missing":[["start_run",["project_id"]]],"design_state_missing":[["start_run",["project_id"]]],"evidence_admission_invalid":[["start_run",["project_id"]]],"evidence_artifact_invalid":[["start_run",["project_id"]]],"evidence_artifact_unbound":[["start_run",["project_id"]]],"evidence_binding_unresolved":[["start_run",["project_id"]]],"evidence_context_invalid":[["start_run",["project_id"]]],"evidence_extract_unreached":[["start_run",["project_id"]]],"evidence_missing":[["start_run",["project_id"]]],"evidence_owner_receipt_mismatch":[["start_run",["project_id"]]],"evidence_owner_receipt_missing":[["start_run",["project_id"]]],"evidence_payload_invalid":[["start_run",["project_id"]]],"evidence_reached_invalid":[["start_run",["project_id"]]],"evidence_replay_invalid":[["start_run",["project_id"]]],"evidence_run_mismatch":[["start_run",["project_id"]]],"evidence_seal_collision":[["start_run",["project_id"]]],"evidence_selected_unreached":[["start_run",["project_id"]]],"execution_route_invalid":[["start_run",["project_id"]]],"executor_root_invalid":[["start_run",["project_id"]]],"extraction_offer_invalid":[["start_run",["project_id"]]],"extraction_offer_tampered":[["start_run",["project_id"]]],"fact_support_unread":[["start_run",["project_id"]]],"harness_arm_invalid":[["start_run",["project_id"]]],"harness_event_unmapped":[["start_run",["project_id"]]],"harness_exited":[["start_run",["project_id"]]],"harness_mapping_failed":[["start_run",["project_id"]]],"harness_session_invalid":[["start_run",["project_id"]]],"harness_session_missing":[["start_run",["project_id"]]],"harness_timeout":[["start_run",["project_id"]]],"infeasible_physics":[["start_run",["project_id"]]],"lab_denied":[["start_run",["project_id"]]],"lab_failed":[["start_run",["project_id"]]],"lab_not_reproduced":[["start_run",["project_id"]]],"lease_interval_invalid":[["start_run",["project_id"]]],"ledger_malformed":[["start_run",["project_id"]]],"max_tokens":[["start_run",["project_id"]]],"no_facts":[["start_run",["project_id"]]],"not_a_decision_i_can_make":[["start_run",["project_id"]]],"out_of_physics":[["start_run",["project_id"]]],"profile_eligibility_changed":[["start_run",["project_id"]]],"prompt_provenance_unavailable":[["start_run",["project_id"]]],"provider_budget_exhausted":[["start_run",["project_id"]]],"provider_budget_missing":[["start_run",["project_id"]]],"provider_budget_unavailable":[["start_run",["project_id"]]],"provider_relay_absent":[["start_run",["project_id"]]],"provider_route_control_invalid":[["start_run",["project_id"]]],"provider_route_exhausted":[["start_run",["project_id"]],["retry_run",["source_run_id","offer_id","generation"]]],"provider_route_failure_unobserved":[["start_run",["project_id"]]],"provider_route_reconciliation_invalid":[["start_run",["project_id"]]],"provider_route_restart_terminal":[["start_run",["project_id"]]],"provider_training_opted_in":[["start_run",["project_id"]]],"publish_seal_missing":[["start_run",["project_id"]]],"refusal_unfounded":[["start_run",["project_id"]]],"replay_capture_digest_mismatch":[["start_run",["project_id"]]],"replay_capture_invalid":[["start_run",["project_id"]]],"replay_config_incomplete":[["start_run",["project_id"]]],"replay_failed":[["start_run",["project_id"]]],"replay_no_requests":[["start_run",["project_id"]]],"replay_patch_invalid":[["start_run",["project_id"]]],"replay_plugin_absent":[["start_run",["project_id"]]],"replay_provider_socket":[["start_run",["project_id"]]],"replay_receipt_invalid":[["start_run",["project_id"]]],"replay_receipt_owner_chown":[["start_run",["project_id"]]],"replay_receipt_owner_incomplete":[["start_run",["project_id"]]],"replay_receipt_owner_invalid":[["start_run",["project_id"]]],"replay_request_observation_count":[["start_run",["project_id"]]],"replay_request_observation_invalid":[["start_run",["project_id"]]],"replay_request_observation_missing":[["start_run",["project_id"]]],"replay_request_owner_chown":[["start_run",["project_id"]]],"replay_socket_observation_invalid":[["start_run",["project_id"]]],"replay_socket_observation_missing":[["start_run",["project_id"]]],"replay_socket_owner_chown":[["start_run",["project_id"]]],"row_budget":[["start_run",["project_id"]]],"run_database_capability_refused":[["start_run",["project_id"]]],"runtime_unavailable":[["start_run",["project_id"]]],"sealed_contract_violated":[["start_run",["project_id"]]],"sealed_file_missing":[["start_run",["project_id"]]],"seat_patch_absent":[["start_run",["project_id"]]],"seat_patch_drift":[["start_run",["project_id"]]],"selection_admission_invalid":[["start_run",["project_id"]]],"selection_context_invalid":[["start_run",["project_id"]]],"selection_receipt_conflict":[["start_run",["project_id"]]],"selection_receipt_invalid":[["start_run",["project_id"]]],"selection_receipt_missing":[["start_run",["project_id"]]],"selection_required":[["start_run",["project_id"]]],"state_corrupt":[["start_run",["project_id"]]],"state_file_invalid":[["start_run",["project_id"]]],"state_invalid":[["start_run",["project_id"]]],"state_payload_overflow":[["start_run",["project_id"]]],"state_unencodable":[["start_run",["project_id"]]],"state_version_unknown":[["start_run",["project_id"]]],"unreceipted_numbers":[["start_run",["project_id"]]],"usage_egress_mismatch":[["start_run",["project_id"]]],"wall_budget":[["start_run",["project_id"]]],"wanted_not_computed":[["start_run",["project_id"]]]});
13
+ export const TERMINAL_RECOVERY_DECLARATIONS = Object.freeze({"answer_now":[["start_run",["project_id"]]],"artifact_publication_missing":[["start_run",["project_id"]]],"artifact_store_unavailable":[["start_run",["project_id"]]],"budget_exhausted":[["start_run",["project_id"]]],"cancelled":[["start_run",["project_id"]]],"carriage_capacity":[["start_run",["project_id"]]],"cause_unrecorded":[["start_run",["project_id"]]],"clarification_custody_invalid":[["start_run",["project_id"]]],"clarification_custody_lost":[["start_run",["project_id"]]],"clarification_resume_invalid":[["start_run",["project_id"]]],"clarification_unpersisted":[["start_run",["project_id"]]],"context_unselected":[["start_run",["project_id"]]],"credential_class_disclosure":[["start_run",["project_id"]]],"deliverable_missing":[["start_run",["project_id"]]],"design_state_missing":[["start_run",["project_id"]]],"evidence_admission_invalid":[["start_run",["project_id"]]],"evidence_artifact_invalid":[["start_run",["project_id"]]],"evidence_artifact_unbound":[["start_run",["project_id"]]],"evidence_binding_unresolved":[["start_run",["project_id"]]],"evidence_context_invalid":[["start_run",["project_id"]]],"evidence_extract_unreached":[["start_run",["project_id"]]],"evidence_missing":[["start_run",["project_id"]]],"evidence_owner_receipt_mismatch":[["start_run",["project_id"]]],"evidence_owner_receipt_missing":[["start_run",["project_id"]]],"evidence_payload_invalid":[["start_run",["project_id"]]],"evidence_reached_invalid":[["start_run",["project_id"]]],"evidence_replay_invalid":[["start_run",["project_id"]]],"evidence_run_mismatch":[["start_run",["project_id"]]],"evidence_seal_collision":[["start_run",["project_id"]]],"evidence_selected_unreached":[["start_run",["project_id"]]],"execution_route_invalid":[["start_run",["project_id"]]],"executor_root_invalid":[["start_run",["project_id"]]],"extraction_offer_invalid":[["start_run",["project_id"]]],"extraction_offer_tampered":[["start_run",["project_id"]]],"fact_support_unread":[["start_run",["project_id"]]],"harness_arm_invalid":[["start_run",["project_id"]]],"harness_event_unmapped":[["start_run",["project_id"]]],"harness_exited":[["start_run",["project_id"]]],"harness_mapping_failed":[["start_run",["project_id"]]],"harness_session_invalid":[["start_run",["project_id"]]],"harness_session_missing":[["start_run",["project_id"]]],"harness_timeout":[["start_run",["project_id"]]],"infeasible_physics":[["start_run",["project_id"]]],"lab_denied":[["start_run",["project_id"]]],"lab_failed":[["start_run",["project_id"]]],"lab_not_reproduced":[["start_run",["project_id"]]],"lease_interval_invalid":[["start_run",["project_id"]]],"ledger_malformed":[["start_run",["project_id"]]],"max_tokens":[["start_run",["project_id"]]],"no_facts":[["start_run",["project_id"]]],"not_a_decision_i_can_make":[["start_run",["project_id"]]],"out_of_physics":[["start_run",["project_id"]]],"profile_eligibility_changed":[["start_run",["project_id"]]],"prompt_provenance_unavailable":[["start_run",["project_id"]]],"provider_budget_exhausted":[["start_run",["project_id"]]],"provider_budget_missing":[["start_run",["project_id"]]],"provider_budget_unavailable":[["start_run",["project_id"]]],"provider_relay_absent":[["start_run",["project_id"]]],"provider_route_control_invalid":[["start_run",["project_id"]]],"provider_route_exhausted":[["start_run",["project_id"]],["retry_run",["source_run_id","offer_id","generation"]]],"provider_route_failure_unobserved":[["start_run",["project_id"]]],"provider_route_reconciliation_invalid":[["start_run",["project_id"]]],"provider_route_restart_terminal":[["start_run",["project_id"]]],"provider_training_opted_in":[["start_run",["project_id"]]],"publish_seal_missing":[["start_run",["project_id"]]],"refusal_unfounded":[["start_run",["project_id"]]],"replay_capture_digest_mismatch":[["start_run",["project_id"]]],"replay_capture_invalid":[["start_run",["project_id"]]],"replay_config_incomplete":[["start_run",["project_id"]]],"replay_failed":[["start_run",["project_id"]]],"replay_no_requests":[["start_run",["project_id"]]],"replay_patch_invalid":[["start_run",["project_id"]]],"replay_plugin_absent":[["start_run",["project_id"]]],"replay_provider_socket":[["start_run",["project_id"]]],"replay_receipt_invalid":[["start_run",["project_id"]]],"replay_receipt_owner_chown":[["start_run",["project_id"]]],"replay_receipt_owner_incomplete":[["start_run",["project_id"]]],"replay_receipt_owner_invalid":[["start_run",["project_id"]]],"replay_request_observation_count":[["start_run",["project_id"]]],"replay_request_observation_invalid":[["start_run",["project_id"]]],"replay_request_observation_missing":[["start_run",["project_id"]]],"replay_request_owner_chown":[["start_run",["project_id"]]],"replay_socket_observation_invalid":[["start_run",["project_id"]]],"replay_socket_observation_missing":[["start_run",["project_id"]]],"replay_socket_owner_chown":[["start_run",["project_id"]]],"row_budget":[["start_run",["project_id"]]],"run_database_capability_refused":[["start_run",["project_id"]]],"runtime_unavailable":[["start_run",["project_id"]]],"sealed_contract_violated":[["start_run",["project_id"]]],"sealed_file_missing":[["start_run",["project_id"]]],"seat_patch_absent":[["start_run",["project_id"]]],"seat_patch_drift":[["start_run",["project_id"]]],"selection_admission_invalid":[["start_run",["project_id"]]],"selection_context_invalid":[["start_run",["project_id"]]],"selection_receipt_conflict":[["start_run",["project_id"]]],"selection_receipt_invalid":[["start_run",["project_id"]]],"selection_receipt_missing":[["start_run",["project_id"]]],"selection_required":[["start_run",["project_id"]]],"state_corrupt":[["start_run",["project_id"]]],"state_file_invalid":[["start_run",["project_id"]]],"state_invalid":[["start_run",["project_id"]]],"state_payload_overflow":[["start_run",["project_id"]]],"state_unencodable":[["start_run",["project_id"]]],"state_version_unknown":[["start_run",["project_id"]]],"unreceipted_numbers":[["start_run",["project_id"]]],"usage_egress_mismatch":[["start_run",["project_id"]]],"wall_budget":[["start_run",["project_id"]]],"wanted_not_computed":[["start_run",["project_id"]]]});
10
14
  export const ORIGIN_KINDS = Object.freeze(["user","hypothesis","derived","knowledge","file","catalog","default"]);
11
15
  export const ORIGIN_WORD = Object.freeze({"user":"your brief","hypothesis":"assumed","derived":"derived","knowledge":"Vecteur knowledge","file":"your file","catalog":"catalogue","default":"default","unattributed":"unstated"});
12
16
  const shape=(v,r,o=[])=>!!v&&typeof v==="object"&&!Array.isArray(v)&&r.every(k=>Object.hasOwn(v,k))&&Object.keys(v).every(k=>r.includes(k)||o.includes(k));
@@ -22,6 +26,7 @@ const ownerSeatEntitlement=v=>shape(v,["current","states","reason"],[])&&(Number
22
26
  const ownerModelCostEstimates=v=>shape(v,["schema","catalogue_envelope_sha256","reference_sha256","projection_sha256","workload","display_currency","rows","cost_ticks"],[])&&(v.schema==="vecteur.model-cost-estimates.v4")&&(typeof v.catalogue_envelope_sha256==="string")&&(typeof v.reference_sha256==="string")&&(typeof v.projection_sha256==="string")&&(typeof v.workload==="string")&&((v.display_currency==="EUR"||v.display_currency==="USD"))&&(Array.isArray(v.rows)&&v.rows.every(x=>ownerModelCostEstimate(x)))&&(Array.isArray(v.cost_ticks)&&v.cost_ticks.every(x=>ownerModelCostTick(x)));
23
27
  const ownerModelCostEstimate=v=>shape(v,["selection_id","customer_gross_microusd","display"],[])&&(typeof v.selection_id==="string")&&(Number.isFinite(v.customer_gross_microusd))&&(typeof v.display==="string");
24
28
  const ownerModelCostTick=v=>shape(v,["customer_gross_microusd","display"],[])&&(Number.isFinite(v.customer_gross_microusd))&&(typeof v.display==="string");
29
+ const ownerCliRelease=v=>shape(v,["package","version","contract","registry","integrity","channel","release"],[])&&(v.package==="@vecteur/cli")&&(typeof v.version==="string")&&(typeof v.contract==="string")&&(v.registry==="https://registry.npmjs.org")&&((typeof v.integrity==="string"||v.integrity===null))&&((v.channel==="stable"||v.channel==="preview"))&&(typeof v.release==="string");
25
30
  const ownerQuotaDenial=v=>shape(v,["resource","current","maximum","tier","recovery"],[])&&(typeof v.resource==="string")&&(Number.isFinite(v.current))&&(Number.isFinite(v.maximum))&&(typeof v.tier==="string")&&(Array.isArray(v.recovery)&&v.recovery.every(x=>typeof x==="string"));
26
31
  const ownerCustomerCostProjection=v=>shape(v,["schema","scope","binding_scope","period_start","period_end","unit","used","scope_used","limit","remaining","reset_at","coverage","display"],[])&&(v.schema==="vecteur.customer-cost-projection.v1")&&(ownerCostScope(v.scope))&&(ownerCostBindingScope(v.binding_scope))&&(Number.isFinite(v.period_start))&&(Number.isFinite(v.period_end))&&(v.unit==="customer_gross_microusd")&&((Number.isFinite(v.used)||v.used===null))&&((Number.isFinite(v.scope_used)||v.scope_used===null))&&((Number.isFinite(v.limit)||v.limit===null))&&((Number.isFinite(v.remaining)||v.remaining===null))&&(Number.isFinite(v.reset_at))&&((v.coverage==="complete"||v.coverage==="incomplete"))&&(ownerCustomerCostDisplay(v.display));
27
32
  const ownerCostScope=v=>shape(v,["type","id"],[])&&((v.type==="organization"||v.type==="workspace"||v.type==="project"||v.type==="user"))&&(typeof v.id==="string");
@@ -33,6 +38,16 @@ const ownerCasRef=v=>typeof v==="string";
33
38
  const ownerSynthesis=v=>shape(v,["answer","core","terminal"],[])&&(typeof v.answer==="string")&&(v.core!==null&&typeof v.core==="object"&&!Array.isArray(v.core)&&Object.values(v.core).every(x=>true))&&((v.terminal==="ok"||v.terminal==="partial"||v.terminal==="blocked"||v.terminal==="refused"||v.terminal==="infeasible_physics"||v.terminal==="capability_gap"));
34
39
  const ownerRunControl=v=>shape(v,["id","kind","sequence","state","attempt","step","egress"],["text"])&&(typeof v.id==="string")&&((v.kind==="steer"||v.kind==="answer_now"))&&(Number.isFinite(v.sequence))&&((v.state==="queued"||v.state==="claimed"||v.state==="dispatched"||v.state==="not_dispatched"))&&((Number.isFinite(v.attempt)||v.attempt===null))&&((Number.isFinite(v.step)||v.step===null))&&((ownerRunControlEgress(v.egress)||v.egress===null))&&(v.text===undefined||(typeof v.text==="string"||v.text===null));
35
40
  const ownerRunControlEgress=v=>shape(v,["candidate","call"],[])&&(Number.isFinite(v.candidate))&&(Number.isFinite(v.call));
41
+ const ownerStoredWireVersion=v=>(v===1||v===2);
42
+ const ownerSourceObjectWithOffer=v=>shape(v,["cas_ref","sha256","size","content_type","acquisition_ref","acquisition","offer"],[])&&(typeof v.cas_ref==="string")&&(typeof v.sha256==="string")&&(Number.isFinite(v.size))&&(typeof v.content_type==="string")&&(typeof v.acquisition_ref==="string")&&(ownerSourceAcquisition(v.acquisition))&&(ownerSourceOffer(v.offer));
43
+ const ownerSourceAcquisition=v=>shape(v,["kind","provider_ref","provider_version"],[])&&((v.kind==="local"||v.kind==="google_drive"))&&((typeof v.provider_ref==="string"||v.provider_ref===null))&&((typeof v.provider_version==="string"||v.provider_version===null));
44
+ const ownerSourceOffer=v=>shape(v,["id","sha256","project_id","source_handle","extracts"],[])&&(typeof v.id==="string")&&(typeof v.sha256==="string")&&(typeof v.project_id==="string")&&(ownerSourceHandle(v.source_handle))&&(Array.isArray(v.extracts)&&v.extracts.every(x=>ownerOfferExtract(x)));
45
+ const ownerSourceHandle=v=>shape(v,["cas_ref","acquisition_ref"],[])&&(ownerCasRef(v.cas_ref))&&(ownerAcquisitionRef(v.acquisition_ref));
46
+ const ownerAcquisitionRef=v=>typeof v==="string";
47
+ const ownerOfferExtract=v=>shape(v,["id","locator","extractor_id","extractor_version","text_sha256"],[])&&(typeof v.id==="string")&&(ownerLocator(v.locator))&&(typeof v.extractor_id==="string")&&(typeof v.extractor_version==="string")&&(typeof v.text_sha256==="string");
48
+ const ownerLocator=v=>shape(v,["kind"],["page","block","sheet","start_cell","end_cell"])&&(typeof v.kind==="string")&&(v.page===undefined||(Number.isFinite(v.page)||v.page===null))&&(v.block===undefined||(Number.isFinite(v.block)||v.block===null))&&(v.sheet===undefined||(typeof v.sheet==="string"||v.sheet===null))&&(v.start_cell===undefined||(typeof v.start_cell==="string"||v.start_cell===null))&&(v.end_cell===undefined||(typeof v.end_cell==="string"||v.end_cell===null));
49
+ const ownerSourceObject=v=>shape(v,["cas_ref","sha256","size","content_type","acquisition_ref","acquisition"],[])&&(typeof v.cas_ref==="string")&&(typeof v.sha256==="string")&&(Number.isFinite(v.size))&&(typeof v.content_type==="string")&&(typeof v.acquisition_ref==="string")&&(ownerSourceAcquisition(v.acquisition));
50
+ export const validateCliRelease=ownerCliRelease;
36
51
  export const validateAccount=v=>ownerAccount(v)&&[v.id,v.email,v.display_name,v.org_id].every(text)&&v.workspaces.every(w=>[w.id,w.org_id,w.name].every(text))&&integer(v.entitlements.active_projects.current)&&v.entitlements.active_projects.current>=0&&(v.entitlements.active_projects.maximum===null||(integer(v.entitlements.active_projects.maximum)&&v.entitlements.active_projects.maximum>=0));
37
52
  export const validateQuotaDenial=v=>ownerQuotaDenial(v)&&v.resource==="active_projects"&&integer(v.current)&&v.current>=0&&integer(v.maximum)&&v.maximum>=0&&text(v.tier);
38
53
  const plainText=v=>text(v)&&!/[\u0000-\u001f\u007f-\u009f]/.test(v); const costText=v=>v===null||plainText(v); const money=v=>v===null||(integer(v)&&v>=0);
@@ -40,6 +55,8 @@ const costProjection=v=>[v.scope?.id,v.binding_scope?.scope?.id].every(plainText
40
55
  export const validateCustomerCostProjection=v=>ownerCustomerCostProjection(v)&&costProjection(v);
41
56
  export const validateLimitDenial=v=>ownerLimitDenial(v)&&costProjection(v)&&v.coverage==="incomplete"&&v.scope_used===null&&v.recovery.length>0;
42
57
  export const validateArtifact=v=>ownerArtifact(v)&&plainText(v.id)&&/^sha256:[0-9a-f]{64}$/.test(v.cas_ref)&&plainText(v.filename);
58
+ export const validateSource=v=>ownerSourceObject(v)||ownerSourceObjectWithOffer(v);
59
+ export const validateSourceOffer=v=>ownerSourceOffer(v);
43
60
  export const validateSynthesis=v=>ownerSynthesis(v)&&text(v.answer)&&!/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f-\u009f]/.test(v.answer);
44
61
  const member=(v)=>exact(v,["user_id","email","display_name","role"])&&[v.user_id,v.email,v.display_name].every(text)&&["OWNER","EDITOR","VIEWER"].includes(v.role);
45
62
  export const validateProject=(v)=>exact(v,["id","name","org_id","workspace_id","role","members","created_at","updated_at"])&&[v.id,v.name,v.org_id,v.workspace_id].every(text)&&["OWNER","EDITOR","VIEWER"].includes(v.role)&&Array.isArray(v.members)&&v.members.every(member)&&integer(v.created_at)&&integer(v.updated_at);
@@ -48,6 +65,7 @@ const dimension=(v)=>shape(v,["uncached_input","cache_read","cache_write","outpu
48
65
  const usage=(v)=>exact(v,["coverage","provider_id","model_id","observed_at","billable_dimensions"])&&["complete","incomplete"].includes(v.coverage)&&[v.provider_id,v.model_id].every(text)&&integer(v.observed_at)&&v.observed_at>=0&&Array.isArray(v.billable_dimensions)&&v.billable_dimensions.length>0&&v.billable_dimensions.every(dimension);
49
66
  const control=v=>ownerRunControl(v)&&/^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/.test(v.id)&&integer(v.sequence)&&v.sequence>=1&&v.sequence<=32&&(v.kind==="steer"?typeof v.text==="string"&&v.text.trim().length>0&&Buffer.byteLength(v.text,"utf8")<=8192:v.text===undefined||v.text===null)&&((v.attempt===null&&v.step===null)||(integer(v.attempt)&&v.attempt>=0&&integer(v.step)&&v.step>0))&&(v.egress===null||(integer(v.egress.candidate)&&v.egress.candidate>=0&&integer(v.egress.call)&&v.egress.call>=0))&&(v.state==="queued"?v.attempt===null&&v.egress===null:v.state==="claimed"?v.attempt!==null&&v.egress===null:v.state==="dispatched"?v.attempt!==null&&v.egress!==null:v.egress===null);
50
67
  const controls=v=>Array.isArray(v)&&v.length<=32&&v.every(control)&&new Set(v.map(x=>x.id)).size===v.length&&v.every((x,i)=>i===0||v[i-1].sequence<x.sequence);
51
- export const validateAdmitted=(v)=>shape(v,["run_id","state_hash","result_hash","requested_route_id","profile","terminal","usage","events","controls"],["duration_seconds"])&&[v.run_id,v.state_hash,v.requested_route_id,v.profile].every(text)&&((v.terminal===""&&v.result_hash===""&&Array.isArray(v.events)&&(v.events.length===0||v.events.at(-1)?.kind!=="terminal"))||(TERMINAL_STATES.includes(v.terminal)&&text(v.result_hash)))&&usage(v.usage)&&Array.isArray(v.events)&&controls(v.controls)&&(v.duration_seconds===undefined||v.duration_seconds===null||(integer(v.duration_seconds)&&v.duration_seconds>=0));
68
+ export const validateAdmitted=(v)=>shape(v,["run_id","state_hash","result_hash","requested_route_id","profile","terminal","usage","events","stored_wire_version","controls"],["duration_seconds"])&&ownerStoredWireVersion(v.stored_wire_version)&&[v.run_id,v.state_hash,v.requested_route_id,v.profile].every(text)&&((v.terminal===""&&v.result_hash===""&&Array.isArray(v.events)&&(v.events.length===0||v.events.at(-1)?.kind!=="terminal"))||(TERMINAL_STATES.includes(v.terminal)&&text(v.result_hash)))&&usage(v.usage)&&Array.isArray(v.events)&&controls(v.controls)&&(v.duration_seconds===undefined||v.duration_seconds===null||(integer(v.duration_seconds)&&v.duration_seconds>=0));
52
69
  export const validatePatCreated=(v)=>exact(v,["id","name","token","prefix","project_id","scopes","created_at","expires_at"])&&[v.id,v.name,v.token,v.prefix].every(text)&&(v.project_id===null||text(v.project_id))&&Array.isArray(v.scopes)&&v.scopes.every(s=>["project:read","project:execute"].includes(s))&&integer(v.created_at)&&integer(v.expires_at);
53
70
  export const validateDeviceAuthorization=(v)=>exact(v,["device_code","user_code","verification_uri","verification_uri_complete","expires_at","interval"])&&[v.device_code,v.user_code,v.verification_uri,v.verification_uri_complete].every(text)&&integer(v.expires_at)&&integer(v.interval)&&v.interval>=0;
71
+ export const validateRunControl=control;
@@ -1,8 +1,9 @@
1
- import { chmodSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
1
+ import { rmSync } from "node:fs";
2
2
  import { homedir } from "node:os";
3
- import { dirname, join } from "node:path";
3
+ import { isAbsolute, join } from "node:path";
4
4
 
5
5
  import { CliError } from "./errors.js";
6
+ import { readStore, withStoreLock, writeStore } from "./store.js";
6
7
 
7
8
  /**
8
9
  * PERSISTENT LOGINS, ONE FILE, PER ORIGIN.
@@ -20,28 +21,16 @@ import { CliError } from "./errors.js";
20
21
  * holds the fleet's own store in, for the same reason. One file is the only store; there is no
21
22
  * second reader.
22
23
  */
23
- const FILE_MODE = 0o600;
24
- const DIRECTORY_MODE = 0o700;
25
-
26
24
  /** `$XDG_CONFIG_HOME/vecteur/credentials.json`, or `~/.config/vecteur/credentials.json`. */
27
25
  export function credentialsPath(env = process.env) {
28
- const base = env.XDG_CONFIG_HOME && env.XDG_CONFIG_HOME.startsWith("/")
26
+ const base = env.XDG_CONFIG_HOME && isAbsolute(env.XDG_CONFIG_HOME)
29
27
  ? env.XDG_CONFIG_HOME
30
28
  : join(env.HOME || homedir(), ".config");
31
29
  return join(base, "vecteur", "credentials.json");
32
30
  }
33
31
 
34
32
  function persistStore(store, env) {
35
- const path = credentialsPath(env);
36
- mkdirSync(dirname(path), { recursive: true, mode: DIRECTORY_MODE });
37
- // Written 0600 AT CREATION, not chmod'ed after: between an 0644 create and a chmod there is a
38
- // window in which any local user can read the token, and on a shared machine that window is
39
- // the whole exposure.
40
- writeFileSync(path, `${JSON.stringify({ current: store.current, logins: store.logins }, null, 2)}\n`, {
41
- mode: FILE_MODE,
42
- });
43
- chmodSync(path, FILE_MODE); // an existing file keeps its old mode through writeFileSync
44
- return path;
33
+ return writeStore(credentialsPath(env), { current: store.current, logins: store.logins });
45
34
  }
46
35
 
47
36
  function unreadable(env) {
@@ -83,80 +72,84 @@ function fromStore(parsed) {
83
72
  * Per-origin `{token, project_id?}` logins, or `null` when nobody has logged in.
84
73
  * Both legacy single-origin and string-map stores migrate in place on first read.
85
74
  */
86
- export function readCredentials(env = process.env) {
87
- let raw;
88
- try {
89
- raw = readFileSync(credentialsPath(env), "utf8");
90
- } catch (error) {
91
- if (error.code === "ENOENT") return null;
92
- throw unreadable(env);
93
- }
75
+ export function readCredentials(env = process.env, locked = false) {
94
76
  let parsed;
95
77
  try {
96
- parsed = JSON.parse(raw);
78
+ parsed = readStore(credentialsPath(env));
79
+ if (parsed === null) return null;
97
80
  } catch {
98
- // A corrupt store is a typed refusal, not a silent fall back to "not logged in": the second
99
- // reads as "run login again" and loses the fact that a credential IS there and unreadable.
100
81
  throw unreadable(env);
101
82
  }
102
83
  const store = fromStore(parsed);
103
84
  if (store) {
104
- if (Object.values(parsed.logins).some(login => typeof login === "string")) persistStore(store, env);
85
+ if (Object.values(parsed.logins).some(login => typeof login === "string")) {
86
+ if (!locked) return withStoreLock(credentialsPath(env), () => readCredentials(env, true));
87
+ persistStore(store, env);
88
+ }
105
89
  return store;
106
90
  }
107
91
  const migrated = fromLegacy(parsed);
108
92
  if (!migrated) throw unreadable(env);
93
+ if (!locked) return withStoreLock(credentialsPath(env), () => readCredentials(env, true));
109
94
  persistStore(migrated, env);
110
95
  return migrated;
111
96
  }
112
97
 
113
98
  export function writeCredentials({ origin, token }, env = process.env) {
114
- const saved = readCredentials(env) ?? { current: origin, logins: {} };
115
- saved.logins[origin] = { token };
116
- saved.current = origin;
117
- return persistStore(saved, env);
99
+ return withStoreLock(credentialsPath(env), () => {
100
+ const saved = readCredentials(env) ?? { current: origin, logins: {} };
101
+ saved.logins[origin] = { token };
102
+ saved.current = origin;
103
+ return persistStore(saved, env);
104
+ });
118
105
  }
119
106
 
120
107
  export function setCurrentOrigin(origin, env = process.env) {
121
- const saved = readCredentials(env);
122
- if (!saved || !Object.hasOwn(saved.logins, origin) || saved.current === origin) return;
123
- saved.current = origin;
124
- persistStore(saved, env);
108
+ return withStoreLock(credentialsPath(env), () => {
109
+ const saved = readCredentials(env);
110
+ if (!saved || !Object.hasOwn(saved.logins, origin) || saved.current === origin) return;
111
+ saved.current = origin;
112
+ persistStore(saved, env);
113
+ });
125
114
  }
126
115
 
127
116
  export function clearCredentials(env = process.env, origin = undefined) {
128
- const path = credentialsPath(env);
129
- if (origin === undefined) {
130
- rmSync(path, { force: true });
131
- return path;
132
- }
133
- let saved;
134
- try {
135
- saved = readCredentials(env);
136
- } catch {
137
- rmSync(path, { force: true });
117
+ return withStoreLock(credentialsPath(env), () => {
118
+ const path = credentialsPath(env);
119
+ if (origin === undefined) {
120
+ rmSync(path, { force: true });
121
+ return path;
122
+ }
123
+ let saved;
124
+ try {
125
+ saved = readCredentials(env);
126
+ } catch {
127
+ rmSync(path, { force: true });
128
+ return path;
129
+ }
130
+ if (!saved) {
131
+ rmSync(path, { force: true });
132
+ return path;
133
+ }
134
+ delete saved.logins[origin];
135
+ if (!Object.keys(saved.logins).length) {
136
+ rmSync(path, { force: true });
137
+ return path;
138
+ }
139
+ if (saved.current === origin) saved.current = Object.keys(saved.logins).sort()[0];
140
+ persistStore(saved, env);
138
141
  return path;
139
- }
140
- if (!saved) {
141
- rmSync(path, { force: true });
142
- return path;
143
- }
144
- delete saved.logins[origin];
145
- if (!Object.keys(saved.logins).length) {
146
- rmSync(path, { force: true });
147
- return path;
148
- }
149
- if (saved.current === origin) saved.current = Object.keys(saved.logins).sort()[0];
150
- persistStore(saved, env);
151
- return path;
142
+ });
152
143
  }
153
144
 
154
145
  /** Selection is an id only; every use resolves it against the live authorized list. */
155
146
  export function selectProject(origin, projectId, env = process.env) {
156
147
  if (env.VECTEUR_TOKEN) throw new CliError("persistent_login_required",
157
148
  "project use requires a persistent login; unset VECTEUR_TOKEN and run `vecteur login`");
158
- const saved = readCredentials(env);
159
- if (!saved?.logins[origin]) throw new CliError("persistent_login_required", "run `vecteur login` first");
160
- saved.logins[origin].project_id = projectId;
161
- persistStore(saved, env);
149
+ return withStoreLock(credentialsPath(env), () => {
150
+ const saved = readCredentials(env);
151
+ if (!saved?.logins[origin]) throw new CliError("persistent_login_required", "run `vecteur login` first");
152
+ saved.logins[origin].project_id = projectId;
153
+ persistStore(saved, env);
154
+ });
162
155
  }
@@ -0,0 +1,39 @@
1
+ import { existsSync, readFileSync } from "node:fs";
2
+ import { dirname, join } from "node:path";
3
+ import { VecteurClient, resolveOrigin } from "./client.js";
4
+ import { credentialsPath, readCredentials } from "./credentials.js";
5
+ import { OWNER_CONTRACT_IDENTITY } from "./contract.js";
6
+ import { terminalText } from "./format.js";
7
+
8
+ /** Read-only diagnostics shared by the shell command and the interactive session. */
9
+ export async function diagnose({ env = process.env, origin, client, offline = false } = {}) {
10
+ const manifest = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
11
+ const saved = env.VECTEUR_TOKEN ? null : readCredentials(env);
12
+ origin = resolveOrigin(env, saved, origin);
13
+ const token = client?.config?.token ?? env.VECTEUR_TOKEN ?? saved?.logins?.[origin]?.token;
14
+ client ??= new VecteurClient({ origin, token, timeout: 5_000 });
15
+ const file = credentialsPath(env), folderFile = join(dirname(file), "folders.json");
16
+ const lines = [
17
+ `Vecteur ${manifest.version} · Node ${process.versions.node} (requires ${manifest.engines.node}) · ${process.platform}`,
18
+ `Origin: ${origin}`, `Client contract: ${OWNER_CONTRACT_IDENTITY}`,
19
+ `Terminal: ${process.stdin.isTTY && process.stdout.isTTY ? "interactive" : "non-interactive"}; TERM=${env.TERM ?? "unset"}; ${env.NO_COLOR !== undefined ? "no color" : "color permitted"}`,
20
+ `Credentials: ${file}`, `Folder registry: ${folderFile}`,
21
+ `Store locks: credentials=${existsSync(file + ".lock") ? "present" : "absent"}, folders=${existsSync(folderFile + ".lock") ? "present" : "absent"}`,
22
+ ];
23
+ const { installation, installationText } = await import("./update.js");
24
+ lines.push(installationText(installation({ env })));
25
+ let ok = true;
26
+ if (offline) lines.push("Offline: network and update checks disabled.");
27
+ else try {
28
+ const ready = await client.readiness();
29
+ lines.push(`Origin: reachable and ready; contract ${ready.compatible ? "matches" : "DIFFERS"}`, `Server contract: ${ready.contract}`);
30
+ ok = ready.compatible;
31
+ } catch (error) { ok = false; lines.push(`Origin: ${error.code ?? "unavailable"}: ${error.message}`); }
32
+ if (token && !offline) {
33
+ try { const account = await client.accountMe(); lines.push(`Login: ${account.email} (${account.id})`); }
34
+ catch (error) { ok = false; lines.push(`Login: ${error.code ?? "unavailable"}: ${error.message}`); }
35
+ } else lines.push("Login: not signed in; vecteur or vecteur login");
36
+ lines.push("Device pairing, grants, companion and desktop permissions: unavailable in stage 1.");
37
+ lines.push("Updates: /update check or vecteur update --check identifies this exact installation; /settings controls automatic installation.");
38
+ return { ok, text: terminalText(lines.join("\n")) };
39
+ }
package/src/download.js CHANGED
@@ -1,8 +1,9 @@
1
1
  import { randomUUID } from "node:crypto";
2
- import { link, open, unlink } from "node:fs/promises";
3
- import { basename, dirname, resolve } from "node:path";
2
+ import { link, mkdir, open, unlink, writeFile } from "node:fs/promises";
3
+ import { basename, dirname, join, resolve } from "node:path";
4
4
 
5
5
  import { CliError } from "./errors.js";
6
+ import { canonicalJson, runSections, safeArtifactName } from "./format.js";
6
7
 
7
8
  function defaultName(casRef) {
8
9
  return `artifact-${casRef.slice("sha256:".length, "sha256:".length + 12)}`;
@@ -50,3 +51,33 @@ async function downloadTo(filename, fetchBytes) {
50
51
  await unlink(temporary).catch(() => {});
51
52
  }
52
53
  }
54
+
55
+ /**
56
+ * File-only exchange out of Vecteur: one NEW folder holding the exact answer bytes, the canonical
57
+ * Run record and every artifact, each digest-verified against its CAS id. Nothing is overwritten.
58
+ */
59
+ export async function exportRun(client, run, projectId, directory) {
60
+ const sections = runSections(run);
61
+ if (!sections.state) throw new CliError("run_open", "Export a completed Run; this one is still open");
62
+ const target = resolve(directory);
63
+ try { await mkdir(target, { mode: 0o700 }); } catch (error) {
64
+ if (error?.code === "EEXIST") throw new CliError("output_exists", `refusing to export into existing ${target}`);
65
+ throw new CliError("export_failed", `could not create ${target}`);
66
+ }
67
+ const files = [];
68
+ const write = async (name, bytes) => {
69
+ await writeFile(join(target, name), bytes, { flag: "wx", mode: 0o600 });
70
+ files.push({ path: join(target, name), bytes: Buffer.byteLength(bytes) });
71
+ };
72
+ if (sections.answer !== undefined) await write("answer.md", sections.answer);
73
+ await write("run.json", canonicalJson(run));
74
+ const used = new Set(["answer.md", "run.json"]);
75
+ for (const { artifact } of sections.artifacts) {
76
+ let name = safeArtifactName(artifact);
77
+ if (used.has(name)) name = `${artifact.cas_ref.slice(7, 19)}-${name}`;
78
+ used.add(name);
79
+ const result = await downloadArtifact(client, artifact.cas_ref, projectId, join(target, name));
80
+ files.push({ path: result.path, bytes: result.bytes, cas_ref: artifact.cas_ref });
81
+ }
82
+ return { directory: target, run_id: run.run_id, terminal: run.terminal, files };
83
+ }