@pen.dev/cli 0.3.3 → 0.3.5

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.
Files changed (70) hide show
  1. package/README.md +13 -6
  2. package/dist/anthropic-messages-xcJLXjiT.mjs +40 -0
  3. package/dist/azure-openai-responses-CoA9_5_J.mjs +2 -0
  4. package/dist/dist-Dmu1Pp1Y.mjs +1580 -0
  5. package/dist/{dist-BY6vOcMF.mjs → dist-L3CkgNK3.mjs} +2 -2
  6. package/dist/{error-body-D2Mrqb4g.mjs → error-body-BBlqjbe7.mjs} +1 -1
  7. package/dist/google-generative-ai-CFHCNDEQ.mjs +2 -0
  8. package/dist/google-shared-DolBdAGX.mjs +318 -0
  9. package/dist/google-vertex-tT_ymu8S.mjs +2 -0
  10. package/dist/index.mjs +2 -2
  11. package/dist/lib-EA7A-_Pc.mjs +9 -0
  12. package/dist/mistral-conversations-CsN5eF3B.mjs +5 -0
  13. package/dist/models-BBd5zwn6.mjs +2 -0
  14. package/dist/node_modules/@highagency/pencil-wasm/package.json +1 -1
  15. package/dist/node_modules/@highagency/pencil-wasm/pencil.d.ts +3 -0
  16. package/dist/node_modules/@highagency/pencil-wasm/pencil.js +1 -1
  17. package/dist/node_modules/@highagency/pencil-wasm/pencil.wasm +0 -0
  18. package/dist/openai-CbFQ5q5I.mjs +18 -0
  19. package/dist/openai-codex-responses-BIh-ZL5a.mjs +8 -0
  20. package/dist/openai-completions-CLJSzdfY.mjs +6 -0
  21. package/dist/openai-responses-DKbl253t.mjs +2 -0
  22. package/dist/openai-responses-shared-Brqyk2bc.mjs +11 -0
  23. package/dist/{openrouter-images-BbBWg9zF.mjs → openrouter-images-C8mOFqx9.mjs} +1 -1
  24. package/dist/out/mcp-server-darwin-arm64 +0 -0
  25. package/dist/out/mcp-server-darwin-x64 +0 -0
  26. package/dist/out/mcp-server-linux-arm64 +0 -0
  27. package/dist/out/mcp-server-linux-x64 +0 -0
  28. package/dist/out/mcp-server-windows-arm64.exe +0 -0
  29. package/dist/out/mcp-server-windows-x64.exe +0 -0
  30. package/dist/out/skills/pen-dev/SKILL.md +204 -0
  31. package/dist/out/skills/pen-dev/execute.md +364 -0
  32. package/dist/out/skills/pen-dev/guide/code.md +198 -0
  33. package/dist/out/skills/pen-dev/guide/components.md +45 -0
  34. package/dist/out/skills/pen-dev/guide/design-system.md +556 -0
  35. package/dist/out/skills/pen-dev/guide/landing-page.md +31 -0
  36. package/dist/out/skills/pen-dev/guide/mobile-app.md +31 -0
  37. package/dist/out/skills/pen-dev/guide/slides.md +222 -0
  38. package/dist/out/skills/pen-dev/guide/table.md +37 -0
  39. package/dist/out/skills/pen-dev/guide/tailwind.md +328 -0
  40. package/dist/out/skills/pen-dev/guide/web-app.md +245 -0
  41. package/dist/out/skills/pen-dev/pen-schema.md +202 -0
  42. package/dist/out/skills/pen-dev/scripts-and-shaders.md +94 -0
  43. package/dist/{pi-messages-CSXUHkjV.mjs → pi-messages-CucvyzBS.mjs} +2 -2
  44. package/dist/transform-messages-1ulTEFY1.mjs +2 -0
  45. package/dist/typescript-D0uAMumm.mjs +6 -0
  46. package/package.json +3 -3
  47. package/dist/anthropic-messages-Bf-fvkNu.mjs +0 -40
  48. package/dist/azure-openai-responses-CzgVqECr.mjs +0 -2
  49. package/dist/completionchunk-BQtPqA8U.mjs +0 -28
  50. package/dist/dist-BEo0Z8Vf.mjs +0 -1558
  51. package/dist/google-generative-ai-DSOqI0LF.mjs +0 -2
  52. package/dist/google-shared-CetPT_Vt.mjs +0 -318
  53. package/dist/google-vertex-CPtOc5oU.mjs +0 -2
  54. package/dist/mistral-conversations-CUsdbDQ8.mjs +0 -10
  55. package/dist/models-CwK5xZH9.mjs +0 -2
  56. package/dist/openai-Brr_V-tF.mjs +0 -17
  57. package/dist/openai-codex-responses-Cb5pfH5S.mjs +0 -8
  58. package/dist/openai-completions-BvTlcCeP.mjs +0 -6
  59. package/dist/openai-responses-IuaLTEHh.mjs +0 -2
  60. package/dist/openai-responses-shared-D4d0NbBE.mjs +0 -11
  61. package/dist/otel-CaADOqYZ.mjs +0 -4
  62. package/dist/transform-messages-CSBQpmXO.mjs +0 -2
  63. /package/dist/{deferred-tools-D8j2Ra6f.mjs → deferred-tools-CozAnCQL.mjs} +0 -0
  64. /package/dist/{github-copilot-headers-DZOfokGy.mjs → github-copilot-headers-DCj7hJoC.mjs} +0 -0
  65. /package/dist/{hash-Kp92CI9R.mjs → hash-DNYCELl4.mjs} +0 -0
  66. /package/dist/{headers-BvGum5dc.mjs → headers-DlpC0ues.mjs} +0 -0
  67. /package/dist/{openai-prompt-cache-t4kk9puG.mjs → openai-prompt-cache-tVHrB8oW.mjs} +0 -0
  68. /package/dist/{photon_rs-BySSRmP5.mjs → photon_rs-o0nbTM4F.mjs} +0 -0
  69. /package/dist/{provider-retry-BM3ArvaW.mjs → provider-retry-GaV_ioT7.mjs} +0 -0
  70. /package/dist/{sanitize-unicode-CHjuq5rK.mjs → sanitize-unicode-D-15laVS.mjs} +0 -0
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{a as e}from"./diagnostics-B0j2bfEp.mjs";import{n as t,t as n}from"./models-CwK5xZH9.mjs";import{t as r}from"./provider-env-CL5ShLlj.mjs";import{n as i}from"./headers-BvGum5dc.mjs";import{t as a}from"./sanitize-unicode-CHjuq5rK.mjs";import{r as o}from"./transform-messages-CSBQpmXO.mjs";import{n as s,t as c}from"./error-body-D2Mrqb4g.mjs";import{a as l,c as u,i as d,l as f,n as p,o as m,r as h,s as g,t as _,u as v}from"./google-shared-CetPT_Vt.mjs";const y={THINKING_LEVEL_UNSPECIFIED:v.THINKING_LEVEL_UNSPECIFIED,MINIMAL:v.MINIMAL,LOW:v.LOW,MEDIUM:v.MEDIUM,HIGH:v.HIGH};let b=0;const x=(t,r,i)=>{let a=new e;return(async()=>{let e={role:`assistant`,content:[],api:`google-vertex`,provider:t.provider,model:t.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:`pending`,timestamp:Date.now()};try{if(i?.fetch&&i.fetch!==globalThis.fetch)throw Error(`Custom fetch is not supported by the Google Vertex adapter`);let o=k(i),s=o?w(t,o,i?.headers):C(t,j(i),M(i),i?.headers,i?.env),c=N(t,r,i),l=await i?.onPayload?.(c,t);l!==void 0&&(c=l);let u=await s.models.generateContentStream(c);a.push({type:`start`,partial:e});let f=null,p=e.content,g=()=>p.length-1;for await(let r of u){e.responseId||=r.responseId;let i=r.candidates?.[0];if(i?.content?.parts)for(let t of i.content.parts){if(t.text!==void 0){let n=h(t);(!f||n&&f.type!==`thinking`||!n&&f.type!==`text`)&&(f&&(f.type===`text`?a.push({type:`text_end`,contentIndex:p.length-1,content:f.text,partial:e}):a.push({type:`thinking_end`,contentIndex:g(),content:f.thinking,partial:e})),n?(f={type:`thinking`,thinking:``,thinkingSignature:void 0},e.content.push(f),a.push({type:`thinking_start`,contentIndex:g(),partial:e})):(f={type:`text`,text:``},e.content.push(f),a.push({type:`text_start`,contentIndex:g(),partial:e}))),f.type===`thinking`?(f.thinking+=t.text,f.thinkingSignature=m(f.thinkingSignature,t.thoughtSignature),a.push({type:`thinking_delta`,contentIndex:g(),delta:t.text,partial:e})):(f.text+=t.text,f.textSignature=m(f.textSignature,t.thoughtSignature),a.push({type:`text_delta`,contentIndex:g(),delta:t.text,partial:e}))}if(t.functionCall){f&&=(f.type===`text`?a.push({type:`text_end`,contentIndex:g(),content:f.text,partial:e}):a.push({type:`thinking_end`,contentIndex:g(),content:f.thinking,partial:e}),null);let n=t.functionCall.id,r={type:`toolCall`,id:!n||e.content.some(e=>e.type===`toolCall`&&e.id===n)?`${t.functionCall.name}_${Date.now()}_${++b}`:n,name:t.functionCall.name||``,arguments:t.functionCall.args??{},...t.thoughtSignature&&{thoughtSignature:t.thoughtSignature}};e.content.push(r),a.push({type:`toolcall_start`,contentIndex:g(),partial:e}),a.push({type:`toolcall_delta`,contentIndex:g(),delta:JSON.stringify(r.arguments),partial:e}),a.push({type:`toolcall_end`,contentIndex:g(),toolCall:r,partial:e})}}i?.finishReason&&(e.rawStopReason=i.finishReason,e.stopReason=d(i.finishReason),e.content.some(e=>e.type===`toolCall`)&&(e.stopReason=`toolUse`)),r.usageMetadata&&(e.usage={input:(r.usageMetadata.promptTokenCount||0)-(r.usageMetadata.cachedContentTokenCount||0),output:(r.usageMetadata.candidatesTokenCount||0)+(r.usageMetadata.thoughtsTokenCount||0),cacheRead:r.usageMetadata.cachedContentTokenCount||0,cacheWrite:0,reasoning:r.usageMetadata.thoughtsTokenCount||0,totalTokens:r.usageMetadata.totalTokenCount||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},n(t,e.usage))}if(f&&(f.type===`text`?a.push({type:`text_end`,contentIndex:g(),content:f.text,partial:e}):a.push({type:`thinking_end`,contentIndex:g(),content:f.thinking,partial:e})),i?.signal?.aborted)throw Error(`Request was aborted`);if(e.stopReason===`pending`)throw Error(`Google Vertex stream ended without a finish reason`);if(e.stopReason===`aborted`||e.stopReason===`error`){let t=e.rawStopReason?`Provider stopped with: ${e.rawStopReason}`:`An unknown error occurred`;throw Error(t)}a.push({type:`done`,reason:e.stopReason,message:e}),a.end()}catch(t){for(let t of e.content)`index`in t&&delete t.index;e.stopReason=i?.signal?.aborted?`aborted`:`error`,e.errorMessage=c(s(t)),a.push({type:`error`,reason:e.stopReason,error:e}),a.end()}})(),a},S=(e,n,r)=>{let i=o(e,n,r,void 0);if(!r?.reasoning)return x(e,n,{...i,thinking:{enabled:!1}});let a=t(e,r.reasoning),s=a===`off`?`high`:a,c=e;return P(c)||F(c)?x(e,n,{...i,thinking:{enabled:!0,level:L(s,c)}}):x(e,n,{...i,thinking:{enabled:!0,budgetTokens:R(c,s,r.thinkingBudgets)}})};function C(e,t,n,r,i){let a=O(i);return new u({vertexai:!0,project:t,location:n,apiVersion:`v1`,...a?{googleAuthOptions:a}:{},httpOptions:T(e,r)})}function w(e,t,n){return new u({vertexai:!0,apiKey:t,apiVersion:`v1`,httpOptions:T(e,n)})}function T(e,t){let n={},r=E(e.baseUrl);r&&(n.baseUrl=r,n.baseUrlResourceScope=f.COLLECTION,D(r)&&(n.apiVersion=``));let a=i({...e.headers,...t});return a&&(n.headers=a),Object.keys(n).length>0?n:void 0}function E(e){let t=e.trim();if(!(!t||t.includes(`{location}`)))return t}function D(e){try{return new URL(e).pathname.split(`/`).some(e=>/^v\d+(?:beta\d*)?$/.test(e))}catch{return/(?:^|\/)v\d+(?:beta\d*)?(?:\/|$)/.test(e)}}function O(e){let t=r(`GOOGLE_APPLICATION_CREDENTIALS`,e);return t?{keyFilename:t}:void 0}function k(e){let t=e?.apiKey?.trim();if(!(!t||t===`gcp-vertex-credentials`||A(t)))return t}function A(e){return/^<[^>]+>$/.test(e)}function j(e){let t=e?.project||r(`GOOGLE_CLOUD_PROJECT`,e?.env)||r(`GCLOUD_PROJECT`,e?.env);if(!t)throw Error(`Vertex AI requires a project ID. Set GOOGLE_CLOUD_PROJECT/GCLOUD_PROJECT or pass project in options.`);return t}function M(e){let t=e?.location||r(`GOOGLE_CLOUD_LOCATION`,e?.env);if(!t)throw Error(`Vertex AI requires a location. Set GOOGLE_CLOUD_LOCATION or pass location in options.`);return t}function N(e,t,n={}){let r=_(e,t),i={};n.temperature!==void 0&&(i.temperature=n.temperature),n.maxTokens!==void 0&&(i.maxOutputTokens=n.maxTokens);let o=t.tools?.length?l(t.tools,n.toolChoice,g(e.id)):void 0,s={...Object.keys(i).length>0&&i,...t.systemPrompt&&{systemInstruction:a(t.systemPrompt)},...t.tools&&t.tools.length>0&&{tools:p(t.tools)},...o!==void 0&&{toolConfig:{functionCallingConfig:{mode:o}}}};if(n.thinking?.enabled&&e.reasoning){let e={includeThoughts:!0};n.thinking.level===void 0?n.thinking.budgetTokens!==void 0&&(e.thinkingBudget=n.thinking.budgetTokens):e.thinkingLevel=y[n.thinking.level],s.thinkingConfig=e}else e.reasoning&&n.thinking&&!n.thinking.enabled&&(s.thinkingConfig=I(e));if(n.signal){if(n.signal.aborted)throw Error(`Request aborted`);s.abortSignal=n.signal}return{model:e.id,contents:r,config:s}}function P(e){return/gemini-3(?:\.\d+)?-pro/.test(e.id.toLowerCase())}function F(e){let t=e.id.toLowerCase();return/gemini-3(?:\.\d+)?-flash/.test(t)||t===`gemini-flash-latest`||t===`gemini-flash-lite-latest`}function I(e){let t=e;return P(t)?{thinkingLevel:v.LOW}:F(t)?{thinkingLevel:v.MINIMAL}:{thinkingBudget:0}}function L(e,t){if(P(t))switch(e){case`minimal`:case`low`:return`LOW`;case`medium`:case`high`:return`HIGH`}switch(e){case`minimal`:return`MINIMAL`;case`low`:return`LOW`;case`medium`:return`MEDIUM`;case`high`:return`HIGH`}}function R(e,t,n){return n?.[t]===void 0?e.id.includes(`2.5-pro`)?{minimal:128,low:2048,medium:8192,high:32768}[t]:e.id.includes(`2.5-flash`)?{minimal:128,low:2048,medium:8192,high:24576}[t]:-1:n[t]}export{x as stream,S as streamSimple};