@vecteur/cli 0.11.1 → 0.13.1
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/README.md +39 -45
- package/bin/vecteur.js +46 -101
- package/package.json +4 -4
- package/src/blocks.js +43 -170
- package/src/client.js +62 -271
- package/src/commands.js +21 -45
- package/src/contract.js +19 -60
- package/src/download.js +2 -7
- package/src/exchange.js +6 -5
- package/src/format.js +82 -596
- package/src/localfiles.js +4 -26
- package/src/markdown.js +43 -68
- package/src/mcp.js +60 -76
- package/src/session.js +67 -377
- package/src/stop-words.js +19 -0
- package/src/terminal.js +7 -25
- package/src/tui/view.js +25 -62
- package/src/wire.js +73 -0
- package/src/executor.js +0 -171
- package/src/produce.js +0 -49
package/src/contract.js
CHANGED
|
@@ -1,41 +1,22 @@
|
|
|
1
|
-
// GENERATED by scripts/gen-contract.mjs from owner
|
|
2
|
-
export const OWNER_CONTRACT_IDENTITY = "api-sha256:
|
|
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":"71a2925cbe67b385c285e48d23ae01d12b97ffd3f8c456f5338329272bb8b9ea","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":"da4df920e6048bdbad3d070932e159be79555c9351a8232e243b1d8892cc6a6a","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":"67e10c9c55fe9e9a2d854951240ac72330f5fe1f91871ac41ac5eaaea630e41a","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":"3c019fc93f83070db784b3cb6121a2cd3ab28f5b55e10e2084229feaed3ff38a","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-11-09","policy_expires_at":"2027-02-07","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_large","label":"Mistral Large 4","model":"mistral-large-4","provider":"mistral","data_residency":"EU","data_residency_source":"vendor","data_residency_source_url":"https://docs.mistral.ai/inference/regional-inference","admitted_context_window_tokens":1048576,"dialect":"mistral_conversations","execution_placement":null,"eligibility_sha256":"8b9b2bfad076478fc939afea649d9e29862b38b96cface56d236159f5ce4f54b","hosting":"provider_api","reasoning":"medium","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-11-09","policy_expires_at":"2027-02-07","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":"a8a9df30ccf45dc2c10440a250e690ea28ad33b26fc6676c08159e5475dab117","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":"53beeb56387f3684081d9f144fa4b8ba64c10d22b7fdbfd8f50d29581ac9e78b","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":"1e86cd2b93712313625f1a12196346e56f68214d56e874f78c3c161c6fd0d106","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":"325fa660dd23adf0e2e279df41be343f1a74c744a09d99079f3684e6adc5e786","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":"79ae0a8299490c75e94de1dcdfeeb9cf61ddb8581f3b070a77371aab947f2d22","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. The account is set to ZDR only (owner console 2026-11-09) except Google models, where Safety Retention is allowed (owner decision 2026-11-09): OpenRouter or the provider may retain prompts and responses from any request to prevent abuse, not for training. 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-11-09","policy_expires_at":"2027-02-07","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":"a42f777a65727be36218c7617e20b98572df1c8fa4996b0b13c4831eb728f9e4","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. The account is set to ZDR only (owner console 2026-11-09) except Google models, where Safety Retention is allowed (owner decision 2026-11-09): OpenRouter or the provider may retain prompts and responses from any request to prevent abuse, not for training. 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-11-09","policy_expires_at":"2027-02-07","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":"d1c0e06b76c04e91c6d7dfe6e3684cb8876c2173798e6fe83f192cb9497d472b","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":"baa4e46ff36f42105d8d596b6b9de27ec4f4fd8747cc537d22f0666715668ab2","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. The account is set to ZDR only (owner console 2026-11-09) except Google models, where Safety Retention is allowed (owner decision 2026-11-09): OpenRouter or the provider may retain prompts and responses from any request to prevent abuse, not for training. 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-11-09","policy_expires_at":"2027-02-07","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; its abuse monitoring may log prompts its classifiers flag for up to 90 days (Google abuse-monitoring page read 2026-11-09), and OpenRouter marks every Google-model Vertex endpoint Safety Retention (any request may be retained to prevent abuse, not for training), 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":"3f99c62799996dd0083210582a80ffe464dfc0c5cd092b691b3d09874271b103","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. The account is set to ZDR only (owner console 2026-11-09) except Google models, where Safety Retention is allowed (owner decision 2026-11-09): OpenRouter or the provider may retain prompts and responses from any request to prevent abuse, not for training. 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-11-09","policy_expires_at":"2027-02-07","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; its abuse monitoring may log prompts its classifiers flag for up to 90 days (Google abuse-monitoring page read 2026-11-09), and OpenRouter marks every Google-model Vertex endpoint Safety Retention (any request may be retained to prevent abuse, not for training), 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":"8a5425136765d6414259adbe559a0f1e72a585d61272a4df6a578a3ed82714ac","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. The account is set to ZDR only (owner console 2026-11-09) except Google models, where Safety Retention is allowed (owner decision 2026-11-09): OpenRouter or the provider may retain prompts and responses from any request to prevent abuse, not for training. 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-11-09","policy_expires_at":"2027-02-07","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
|
|
5
|
-
export const
|
|
6
|
-
export const
|
|
1
|
+
// GENERATED by scripts/gen-contract.mjs from the owner projections.
|
|
2
|
+
export const OWNER_CONTRACT_IDENTITY = "api-sha256:bea0597dcb6e7e6d576ec53de9016f64c710b6787a0cfa7bcb7c6fe27e73989f;run-wire-sha256:678602fd4f1dba0493ad0f860be24bbf88532945edfe9dbe1555e5145bbbeefb";
|
|
3
|
+
export const MODEL_CHOICES = Object.freeze([{"route_id":"auto","label":"Auto","level":"balanced"},{"route_id":"claude_opus","label":"Claude Opus 5.5","level":"quality"},{"route_id":"claude_sonnet","label":"Claude Sonnet 5.5","level":"balanced"},{"route_id":"claude_haiku","label":"Claude Haiku 5.5","level":"economy"},{"route_id":"gpt_sol","label":"GPT-6.1 Sol","level":"quality"},{"route_id":"gpt_terra","label":"GPT-6.1 Terra","level":"balanced"},{"route_id":"gpt_luna","label":"GPT-6 Luna","level":"economy"},{"route_id":"mistral_large","label":"Mistral Large 4","level":"quality"},{"route_id":"deepseek_flash_eu","label":"DeepSeek V4.1 Flash","level":"balanced"}]);
|
|
4
|
+
export const EVENT_KINDS = Object.freeze(["assistant_delta","tool_call","tool_result","synthesis","artifact","study","review","terminal"]);
|
|
5
|
+
export const TOOL_KINDS = Object.freeze(["bash","python","read","write","edit","search","web","skill","other"]);
|
|
6
|
+
export const TERMINAL_STATES = Object.freeze(["completed","failed","cancelled","budget"]);
|
|
7
|
+
export const TERMINAL_DEFECTS = Object.freeze(["budget_exhausted","cancelled","runner_restart","turn_timeout","agent_error","provider_error","slot_unavailable","workspace_quota"]);
|
|
8
|
+
export const ARTIFACT_MEDIA_TYPES = Object.freeze({"binary":"application/octet-stream","code":"text/plain","csv":"text/csv","docx":"application/vnd.openxmlformats-officedocument.wordprocessingml.document","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"});
|
|
7
9
|
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}});
|
|
8
10
|
export const STOP_ACTION_HREFS = Object.freeze({"upgrade_plan":"/dashboard/billing?checkout=pro","contact_sales":"/enterprise#enterprise-contact","see_usage":"/dashboard/billing"});
|
|
9
|
-
export const STOP_WORDS = Object.freeze({"heading":{"plan_platform":"This study paused at your {plan} plan's limit","plan_restriction":"This study paused at a limit set in your organization","limit":"This study paused at a limit","token_limit":"This study reached the size limit for one run","run_limit":"This study reached the limit for one run","upstream_quota":"The model's service declined the next step","route_failure":"No model could take the next step","output_limit":"The model reached its output limit","context_limit":"This turn read more than the model can hold at once"},"reason":{"plan_platform":"{model} needs more room for its next step than your plan has left this {period}.","plan_restriction":"{model} needs more room for its next step than this limit has left this {period}.","limit":"{model} needs more room for its next step than is left for this period.","token_limit":"The work so far filled the room one run allows.","run_limit":"The work so far used what one run allows.","upstream_quota":"The service behind {model} refused on its side; your plan is not the cause.","route_failure":"The service behind {model} failed, and no other model could take over.","output_limit":"{model} ran out of room while writing its reply.","context_limit":"The material read and the work so far filled what {model} can hold in one turn. No service failed."},"result":{"authored":"Your computed work is saved, and what was written before the stop is below.","computed":"What ran is listed below; no final answer to your question was delivered.","nothing":"Nothing was computed yet. Your question is kept."},"forward":{"token_limit":"Ask a follow-up to continue from here.","run_limit":"Ask a follow-up to continue from here.","output_limit":"Ask a follow-up to continue from here.","context_limit":"Ask a follow-up with a narrower question, or attach less at once.","upstream_quota":"Try again in a moment, or choose another model.","route_failure":"Try again in a moment, or choose another model."},"renews":{"plan":"Your {plan} allowance renews on {date}.","restriction":"This limit renews on {date}.","renewed":"This limit has renewed, so you can ask again."},"usage_note":"A step reserves room before it runs, so this can appear before your usage reads full.","action_line":{"upgrade_plan":"Room for longer studies: up to {steps} steps per run and a larger usage allowance. {price}.","contact_sales":"If your studies regularly need more than Pro allows, we'll work out what fits.","ask_owner_free":"Your organization's owner can move you to Pro.","ask_owner_pro":"Your organization's owner can talk to us about Enterprise."},"continue_with":"Continue with {model}","continue_line":"Continue from this saved study.","continue_ask":"Continue from the saved results of this study and finish what was not delivered.","continue_withdrawn":"This study can no longer continue from here.","picker_hint":"A heavier model uses your Free allowance faster. Every model stays available.","see_usage":"See usage","summary_title":"What ran before the stop","original_text":"Original text of this stop"});
|
|
10
11
|
export const PLAN_WORDS = Object.freeze({"enterprise_action":"Talk to us about Enterprise","free_price":"€0","pro_action":"Move to Pro","pro_price":"€50 a month","pro_start":"Create an account to move to Pro","see_plan":"See your plan"});
|
|
11
|
-
export const HORIZON_STOP_DEFECTS = Object.freeze(["budget_exhausted","context_exhausted","max_tokens","provider_budget_exhausted","provider_route_exhausted"]);
|
|
12
|
-
export const HISTORICAL_STOP_HEADS = Object.freeze({"budget_exhausted":["The step limit was reached after these values were computed (each value is printed by the program that computed it):","The step limit was reached after these values were computed (the last figure each program printed, not a checked result):"],"max_tokens":["The model stopped at its output limit after these values were computed (each value is printed by the program that computed it):","The model stopped at its output limit after these values were computed (the last figure each program printed, not a checked result):"],"provider_budget_exhausted":["The provider budget was reached after these values were computed (each value is printed by the program that computed it):","The provider budget was reached after these values were computed (the last figure each program printed, not a checked result):"],"provider_route_exhausted":["The model provider failed after these values were computed (each value is printed by the program that computed it):","The model provider failed after these values were computed (the last figure each program printed, not a checked result):"]});
|
|
13
|
-
export const STOP_FIELDS = Object.freeze(["binding","cause","parent_state_hash","renews_at","result_kind","source_run"]);
|
|
14
|
-
export const STOP_BINDING_FIELDS = Object.freeze(["period","scope","tier"]);
|
|
15
|
-
export const STOP_CAUSES = Object.freeze(["plan_limit","token_limit","upstream_quota","route_failure","output_limit","run_limit","context_limit"]);
|
|
16
|
-
export const STOP_RESULT_KINDS = Object.freeze(["authored","activity","none"]);
|
|
17
|
-
export const STOP_BINDING_SCOPES = Object.freeze(["platform","organization","workspace","project","user"]);
|
|
18
|
-
export const STOP_PERIODS = Object.freeze(["utc_week","utc_month"]);
|
|
19
|
-
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"]);
|
|
20
|
-
export const RETIRED_EVENT_KINDS = Object.freeze(["context_frame","cta","step_label"]);
|
|
21
|
-
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","stop","study_unpublished","unmet_wanted"]);
|
|
22
12
|
export const WIRE_READER_HEADER = "Vecteur-Wire";
|
|
23
|
-
export const
|
|
24
|
-
export const
|
|
25
|
-
export const
|
|
26
|
-
export const SPECIALIST_TOOL_WIRE_VERSION = 4;
|
|
27
|
-
export const LOCAL_EXEC_WIRE_VERSION = 5;
|
|
28
|
-
export const WIRE_VERSION_UNSUPPORTED = "wire_version_unsupported";
|
|
29
|
-
export const AGENT_LABELS = Object.freeze({"engineering":"Engineering","business":"Business","knowledge":"Knowledge","code":"Code"});
|
|
30
|
-
export const TERMINAL_STATES = Object.freeze(["ok","partial","blocked","refused","infeasible_physics","capability_gap"]);
|
|
31
|
-
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"});
|
|
32
|
-
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_exhausted":[["start_run",["project_id"]]],"context_unselected":[["start_run",["project_id"]]],"credential_class_disclosure":[["start_run",["project_id"]]],"data_policy_denied":[["start_run",["project_id"]]],"data_policy_missing":[["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_resume_foreign":[["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"]]],"root_web_hook_missing":[["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"]]],"study_capacity":[["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"]]]});
|
|
33
|
-
export const ORIGIN_KINDS = Object.freeze(["user","hypothesis","derived","knowledge","file","catalog","default"]);
|
|
34
|
-
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"});
|
|
13
|
+
export const STORED_WIRE_VERSION_HEADER = "X-Vecteur-Stored-Wire-Version";
|
|
14
|
+
export const STORED_WIRE_VERSIONS = Object.freeze([6]);
|
|
15
|
+
export const WIRE_READER_VERSION = 6;
|
|
35
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));
|
|
36
17
|
const exact=(v,k)=>shape(v,k)&&Object.keys(v).length===k.length;
|
|
37
18
|
const text=(v)=>typeof v==="string"&&v.length>0; const integer=(v)=>Number.isSafeInteger(v);
|
|
38
|
-
const ownerAccount=v=>shape(v,["id","email","display_name","tier","org_id","organization_role","workspaces","connectors","capabilities","entitlements","avatar_url","display_currency","model_cost_estimates","is_platform_operator"],[])&&(typeof v.id==="string")&&(typeof v.email==="string")&&(typeof v.display_name==="string")&&(ownerTier(v.tier))&&(typeof v.org_id==="string")&&((v.organization_role==="OWNER"||v.organization_role==="ADMIN"||v.organization_role==="MEMBER"))&&(Array.isArray(v.workspaces)&&v.workspaces.every(x=>ownerWorkspace(x)))&&(Array.isArray(v.connectors)&&v.connectors.every(x=>typeof x==="string"))&&(Array.isArray(v.capabilities)&&v.capabilities.every(x=>ownerCapability(x)))&&(ownerEntitlements(v.entitlements))&&((typeof v.avatar_url==="string"||v.avatar_url===null))&&((v.display_currency==="EUR"||v.display_currency==="USD"))&&(ownerModelCostEstimates(v.model_cost_estimates))&&(typeof v.is_platform_operator==="boolean");
|
|
19
|
+
const ownerAccount=v=>shape(v,["id","email","display_name","tier","org_id","organization_name","organization_role","workspaces","connectors","capabilities","entitlements","avatar_url","display_currency","model_cost_estimates","is_platform_operator"],[])&&(typeof v.id==="string")&&(typeof v.email==="string")&&(typeof v.display_name==="string")&&(ownerTier(v.tier))&&(typeof v.org_id==="string")&&(typeof v.organization_name==="string")&&((v.organization_role==="OWNER"||v.organization_role==="ADMIN"||v.organization_role==="MEMBER"))&&(Array.isArray(v.workspaces)&&v.workspaces.every(x=>ownerWorkspace(x)))&&(Array.isArray(v.connectors)&&v.connectors.every(x=>typeof x==="string"))&&(Array.isArray(v.capabilities)&&v.capabilities.every(x=>ownerCapability(x)))&&(ownerEntitlements(v.entitlements))&&((typeof v.avatar_url==="string"||v.avatar_url===null))&&((v.display_currency==="EUR"||v.display_currency==="USD"))&&(ownerModelCostEstimates(v.model_cost_estimates))&&(typeof v.is_platform_operator==="boolean");
|
|
39
20
|
const ownerTier=v=>(v==="free"||v==="pro"||v==="enterprise");
|
|
40
21
|
const ownerWorkspace=v=>shape(v,["id","org_id","name","status"],[])&&(typeof v.id==="string")&&(typeof v.org_id==="string")&&(typeof v.name==="string")&&(v.status==="active");
|
|
41
22
|
const ownerCapability=v=>shape(v,["id","affordance","state","required_tier","reason","recovery"],[])&&(typeof v.id==="string")&&((v.affordance==="composer-source"||v.affordance==="workspace-export"||v.affordance==="composer-preference"))&&((v.state==="available"||v.state==="locked"||v.state==="disconnected"||v.state==="unavailable"))&&((v.required_tier==="pro"||v.required_tier==="enterprise"||v.required_tier===null))&&(typeof v.reason==="string")&&((typeof v.recovery==="string"||v.recovery===null));
|
|
@@ -47,34 +28,20 @@ const ownerModelCostEstimate=v=>shape(v,["selection_id","customer_gross_microusd
|
|
|
47
28
|
const ownerModelCostTick=v=>shape(v,["customer_gross_microusd","display"],[])&&(Number.isFinite(v.customer_gross_microusd))&&(typeof v.display==="string");
|
|
48
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");
|
|
49
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"));
|
|
50
|
-
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));
|
|
31
|
+
const ownerCustomerCostProjection=v=>shape(v,["schema","scope","period","binding_scope","period_start","period_end","unit","used","scope_used","limit","remaining","committed","reset_at","coverage","next_action","display"],[])&&(v.schema==="vecteur.customer-cost-projection.v1")&&(ownerCostScope(v.scope))&&((v.period==="utc_week"||v.period==="utc_month"||v.period==="contract"))&&(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.committed)||v.committed===null))&&(Number.isFinite(v.reset_at))&&((v.coverage==="complete"||v.coverage==="incomplete"))&&((v.next_action==="upgrade_plan"||v.next_action==="renew_contract"||v.next_action==="raise_restriction"||v.next_action==="ask_organization_admin"||v.next_action===null))&&(ownerCustomerCostDisplay(v.display));
|
|
51
32
|
const ownerCostScope=v=>shape(v,["type","id"],[])&&((v.type==="organization"||v.type==="workspace"||v.type==="project"||v.type==="user"))&&(typeof v.id==="string");
|
|
52
|
-
const ownerCostBindingScope=v=>shape(v,["kind","scope"],[])&&((v.kind==="platform_tier"||v.kind==="restriction"||v.kind==="unlimited"))&&(ownerCostScope(v.scope));
|
|
53
|
-
const ownerCustomerCostDisplay=v=>shape(v,["currency","used","scope_used","limit","remaining"],[])&&((v.currency==="EUR"||v.currency==="USD"))&&((typeof v.used==="string"||v.used===null))&&((typeof v.scope_used==="string"||v.scope_used===null))&&((typeof v.limit==="string"||v.limit===null))&&((typeof v.remaining==="string"||v.remaining===null));
|
|
33
|
+
const ownerCostBindingScope=v=>shape(v,["kind","scope"],[])&&((v.kind==="platform_tier"||v.kind==="contract"||v.kind==="restriction"||v.kind==="unlimited"))&&(ownerCostScope(v.scope));
|
|
34
|
+
const ownerCustomerCostDisplay=v=>shape(v,["currency","used","scope_used","limit","remaining","committed"],[])&&((v.currency==="EUR"||v.currency==="USD"))&&((typeof v.used==="string"||v.used===null))&&((typeof v.scope_used==="string"||v.scope_used===null))&&((typeof v.limit==="string"||v.limit===null))&&((typeof v.remaining==="string"||v.remaining===null))&&((typeof v.committed==="string"||v.committed===null));
|
|
54
35
|
const ownerRunStopOffer=v=>shape(v,["schema","run_id","as_of","actions","continuation"],[])&&(v.schema==="vecteur.run-stop-offer.v1")&&(typeof v.run_id==="string")&&(Number.isFinite(v.as_of))&&(Array.isArray(v.actions)&&v.actions.every(x=>(x==="upgrade_plan"||x==="ask_owner"||x==="contact_sales"||x==="see_usage"||x==="continue_with_model")))&&((ownerStopContinuation(v.continuation)||v.continuation===null));
|
|
55
36
|
const ownerStopContinuation=v=>shape(v,["model_choice","label","source_run","parent_state_hash","expires_at"],[])&&(typeof v.model_choice==="string")&&(typeof v.label==="string")&&(typeof v.source_run==="string")&&(typeof v.parent_state_hash==="string")&&(Number.isFinite(v.expires_at));
|
|
56
|
-
const ownerLimitDenial=v=>shape(v,["schema","scope","binding_scope","period_start","period_end","unit","used","scope_used","limit","remaining","reset_at","coverage","display","dimension","recovery"],[])&&(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))&&(v.dimension==="customer_cost")&&(Array.isArray(v.recovery)&&v.recovery.every(x=>(x==="wait_for_reset"||x==="upgrade_plan")));
|
|
57
|
-
const ownerArtifact=v=>shape(v,["id","kind","cas_ref","filename"],["produced_by_step","from_input_rows","build_receipt_id","output_index","path","revision","origin_call_id","preview","supersedes_cas_ref","execution_id"])&&(typeof v.id==="string")&&((v.kind==="docx"||v.kind==="xlsx"||v.kind==="pdf"||v.kind==="md"||v.kind==="csv"||v.kind==="html"||v.kind==="code"||v.kind==="drive"||v.kind==="png"||v.kind==="jpeg"||v.kind==="svg"||v.kind==="json"||v.kind==="binary"))&&(ownerCasRef(v.cas_ref))&&(typeof v.filename==="string")&&(v.produced_by_step===undefined||(typeof v.produced_by_step==="string"||v.produced_by_step===null))&&(v.from_input_rows===undefined||(Array.isArray(v.from_input_rows)&&v.from_input_rows.every(x=>typeof x==="string")||v.from_input_rows===null))&&(v.build_receipt_id===undefined||(typeof v.build_receipt_id==="string"||v.build_receipt_id===null))&&(v.output_index===undefined||(Number.isFinite(v.output_index)||v.output_index===null))&&(v.path===undefined||(typeof v.path==="string"||v.path===null))&&(v.revision===undefined||(Number.isFinite(v.revision)||v.revision===null))&&(v.origin_call_id===undefined||(typeof v.origin_call_id==="string"||v.origin_call_id===null))&&(v.preview===undefined||(v.preview==="text"||v.preview==="code"||v.preview==="csv"||v.preview==="table"||v.preview==="series"||v.preview==="image"||v.preview==="html"||v.preview==="docx"||v.preview==="xlsx"||v.preview==="pdf"||v.preview==="binary"||v.preview===null))&&(v.supersedes_cas_ref===undefined||(ownerCasRef(v.supersedes_cas_ref)||v.supersedes_cas_ref===null))&&(v.execution_id===undefined||(typeof v.execution_id==="string"||v.execution_id===null));
|
|
58
|
-
const ownerCasRef=v=>typeof v==="string";
|
|
59
|
-
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"));
|
|
60
|
-
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));
|
|
61
|
-
const ownerRunControlEgress=v=>shape(v,["candidate","call"],[])&&(Number.isFinite(v.candidate))&&(Number.isFinite(v.call));
|
|
62
|
-
const ownerLocalExecAdmission=v=>shape(v,["secret_sha256"],[])&&(typeof v.secret_sha256==="string");
|
|
63
|
-
const ownerLocalExecPoll=v=>shape(v,["secret"],[])&&(typeof v.secret==="string");
|
|
64
|
-
const ownerLocalExecAction=v=>shape(v,["secret","action"],["nonce","result","code"])&&(typeof v.secret==="string")&&((v.action==="start"||v.action==="seal"||v.action==="refuse"))&&(v.nonce===undefined||typeof v.nonce==="string")&&(v.result===undefined||v.result!==null&&typeof v.result==="object"&&!Array.isArray(v.result)&&Object.values(v.result).every(x=>true))&&(v.code===undefined||typeof v.code==="string");
|
|
65
|
-
const ownerLocalExecStatus=v=>shape(v,["stop","paused","requests"],[])&&(typeof v.stop==="boolean")&&(typeof v.paused==="boolean")&&(Array.isArray(v.requests)&&v.requests.every(x=>ownerLocalExecRequest(x)));
|
|
66
|
-
const ownerLocalExecRequest=v=>shape(v,["id","command","timeout","state","approval_remaining","hard_remaining"],[])&&(typeof v.id==="string")&&(typeof v.command==="string")&&(Number.isFinite(v.timeout))&&((v.state==="pending"||v.state==="started"))&&(Number.isFinite(v.approval_remaining))&&(Number.isFinite(v.hard_remaining));
|
|
67
|
-
const ownerStoredWireVersion=v=>(v===1||v===2||v===3||v===4||v===5);
|
|
37
|
+
const ownerLimitDenial=v=>shape(v,["schema","scope","period","binding_scope","period_start","period_end","unit","used","scope_used","limit","remaining","committed","reset_at","coverage","next_action","display","dimension","recovery"],[])&&(v.schema==="vecteur.customer-cost-projection.v1")&&(ownerCostScope(v.scope))&&((v.period==="utc_week"||v.period==="utc_month"||v.period==="contract"))&&(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.committed)||v.committed===null))&&(Number.isFinite(v.reset_at))&&((v.coverage==="complete"||v.coverage==="incomplete"))&&((v.next_action==="upgrade_plan"||v.next_action==="renew_contract"||v.next_action==="raise_restriction"||v.next_action==="ask_organization_admin"||v.next_action===null))&&(ownerCustomerCostDisplay(v.display))&&(v.dimension==="customer_cost")&&(Array.isArray(v.recovery)&&v.recovery.every(x=>(x==="wait_for_reset"||x==="upgrade_plan"||x==="renew_contract")));
|
|
68
38
|
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));
|
|
69
39
|
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));
|
|
70
40
|
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)));
|
|
71
|
-
const ownerSourceHandle=v=>shape(v,["cas_ref","acquisition_ref"],[])&&
|
|
72
|
-
const
|
|
73
|
-
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");
|
|
74
|
-
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));
|
|
41
|
+
const ownerSourceHandle=v=>shape(v,["cas_ref","acquisition_ref"],[])&&typeof v.cas_ref==="string"&&typeof v.acquisition_ref==="string";
|
|
42
|
+
const ownerOfferExtract=v=>shape(v,["id","locator","extractor_id","extractor_version","text_sha256"],[])&&(typeof v.id==="string")&&(v.locator!==null&&typeof v.locator==="object"&&!Array.isArray(v.locator)&&Object.values(v.locator).every(x=>true))&&(typeof v.extractor_id==="string")&&(typeof v.extractor_version==="string")&&(typeof v.text_sha256==="string");
|
|
75
43
|
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));
|
|
76
44
|
export const validateCliRelease=ownerCliRelease;
|
|
77
|
-
export const validateLocalExecStatus=ownerLocalExecStatus;
|
|
78
45
|
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));
|
|
79
46
|
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);
|
|
80
47
|
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);
|
|
@@ -82,18 +49,10 @@ const costProjection=v=>[v.scope?.id,v.binding_scope?.scope?.id].every(plainText
|
|
|
82
49
|
export const validateRunStopOffer=v=>ownerRunStopOffer(v)&&plainText(v.run_id)&&integer(v.as_of)&&v.as_of>0;
|
|
83
50
|
export const validateCustomerCostProjection=v=>ownerCustomerCostProjection(v)&&costProjection(v);
|
|
84
51
|
export const validateLimitDenial=v=>ownerLimitDenial(v)&&costProjection(v)&&v.coverage==="incomplete"&&v.scope_used===null&&v.recovery.length>0;
|
|
85
|
-
export const validateArtifact=v=>ownerArtifact(v)&&plainText(v.id)&&/^sha256:[0-9a-f]{64}$/.test(v.cas_ref)&&plainText(v.filename);
|
|
86
52
|
export const validateSource=v=>ownerSourceObject(v)||ownerSourceObjectWithOffer(v);
|
|
87
53
|
export const validateSourceOffer=v=>ownerSourceOffer(v);
|
|
88
|
-
export const validateSynthesis=v=>ownerSynthesis(v)&&text(v.answer)&&!/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f-\u009f]/.test(v.answer);
|
|
89
54
|
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);
|
|
90
|
-
export const validateProject=(v)=>
|
|
55
|
+
export const validateProject=(v)=>shape(v,["id","name","org_id","workspace_id","role","members","created_at","updated_at"],["engine"])&&(v.engine===undefined||v.engine==="v5"||v.engine==="v6")&&[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);
|
|
91
56
|
export const validateRunAck=(v)=>exact(v,["run_id","state_hash","accepted_at","requested_route_id"])&&[v.run_id,v.state_hash,v.requested_route_id].every(text)&&integer(v.accepted_at);
|
|
92
|
-
const dimension=(v)=>shape(v,["uncached_input","cache_read","cache_write","output"],["cache_write_class","cache_write_duration_s","provider_tier","long_context_band"])&&["uncached_input","cache_read","cache_write","output"].every(k=>integer(v[k])&&v[k]>=0)&&[v.cache_write_class,v.provider_tier,v.long_context_band].every(x=>x===undefined||x===null||text(x))&&(v.cache_write_duration_s===undefined||v.cache_write_duration_s===null||(integer(v.cache_write_duration_s)&&v.cache_write_duration_s>=0));
|
|
93
|
-
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);
|
|
94
|
-
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);
|
|
95
|
-
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);
|
|
96
|
-
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));
|
|
97
57
|
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);
|
|
98
58
|
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;
|
|
99
|
-
export const validateRunControl=control;
|
package/src/download.js
CHANGED
|
@@ -12,18 +12,13 @@ function defaultName(casRef) {
|
|
|
12
12
|
/**
|
|
13
13
|
* Stream admitted bytes to a private sibling, then publish with an atomic no-overwrite link.
|
|
14
14
|
* A remote filename never reaches this path: the caller either supplies --output or receives
|
|
15
|
-
* a digest-derived basename, so traversal and shell metacharacters cannot arrive from
|
|
15
|
+
* a digest-derived basename, so traversal and shell metacharacters cannot arrive from the wire.
|
|
16
16
|
*/
|
|
17
17
|
export async function downloadArtifact(client, casRef, projectId, output) {
|
|
18
18
|
return downloadTo(output ?? defaultName(casRef),
|
|
19
19
|
chunk => client.artifactGet(casRef, projectId, chunk));
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
export async function downloadProjection(client, projectId, runId, projection, output) {
|
|
23
|
-
return downloadTo(output ?? `transfer-table-${projection.projection_id.slice(11, 23)}.json`,
|
|
24
|
-
chunk => client.projectionGet(projectId, runId, projection, chunk));
|
|
25
|
-
}
|
|
26
|
-
|
|
27
22
|
async function downloadTo(filename, fetchBytes) {
|
|
28
23
|
const target = resolve(filename);
|
|
29
24
|
const temporary = resolve(dirname(target), `.vecteur-${basename(target)}-${randomUUID()}.part`);
|
|
@@ -69,7 +64,7 @@ export async function exportRun(client, run, projectId, directory) {
|
|
|
69
64
|
await writeFile(join(target, name), bytes, { flag: "wx", mode: 0o600 });
|
|
70
65
|
files.push({ path: join(target, name), bytes: Buffer.byteLength(bytes) });
|
|
71
66
|
};
|
|
72
|
-
if (sections.answer
|
|
67
|
+
if (sections.answer) await write("answer.md", sections.answer);
|
|
73
68
|
await write("run.json", canonicalJson(run));
|
|
74
69
|
const used = new Set(["answer.md", "run.json"]);
|
|
75
70
|
for (const { artifact } of sections.artifacts) {
|
package/src/exchange.js
CHANGED
|
@@ -4,8 +4,9 @@ import { basename, dirname, extname, join, resolve, sep } from "node:path";
|
|
|
4
4
|
|
|
5
5
|
import { CliError } from "./errors.js";
|
|
6
6
|
import { downloadArtifact } from "./download.js";
|
|
7
|
+
import { runArtifacts } from "./blocks.js";
|
|
7
8
|
|
|
8
|
-
//
|
|
9
|
+
// The run door's material cap (backend asgi.MAX_MATERIAL_BYTES): one figure everywhere.
|
|
9
10
|
export const MAX_MATERIAL_BYTES = 16 * 1024 * 1024;
|
|
10
11
|
export const MEDIA = { ".txt": "text/plain", ".md": "text/markdown", ".csv": "text/csv", ".json": "application/json",
|
|
11
12
|
...Object.fromEntries(['.py', '.m', '.jl', '.r', '.c', '.h', '.cpp', '.f90', '.toml', '.yaml', '.yml', '.ini', '.cfg', '.tex', '.rst'].map(ext => [ext, 'text/plain'])),
|
|
@@ -25,13 +26,13 @@ async function contained(cwd, name, { leaf }) {
|
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
/** Digest-verified artifact download (the `vecteur run export` verifier) into the working folder. */
|
|
28
|
-
export async function artifactToFolder(client, { projectId, casRef, runId,
|
|
29
|
+
export async function artifactToFolder(client, { projectId, casRef, runId, artifactPath, output, cwd, signal }) {
|
|
29
30
|
if (!casRef) {
|
|
30
|
-
if (!runId || !
|
|
31
|
+
if (!runId || !artifactPath) throw new CliError("usage_invalid", "Give cas_ref, or run_id with artifact_path");
|
|
31
32
|
const run = await client.runGet(runId, signal);
|
|
32
|
-
const found = run.events.find(
|
|
33
|
+
const found = runArtifacts(run.events).find(artifact => artifact.path === artifactPath);
|
|
33
34
|
if (!found) throw new CliError("artifact_unavailable", "Run has no such artifact");
|
|
34
|
-
casRef = found.
|
|
35
|
+
casRef = found.cas_ref;
|
|
35
36
|
}
|
|
36
37
|
const target = await contained(cwd, output ?? `artifact-${String(casRef).slice(7, 19)}`, { leaf: true });
|
|
37
38
|
const result = await downloadArtifact(client, casRef, projectId, target);
|