@ycodium-ai/agent-pi 0.2.5029 → 0.2.5100

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/assets/ui.js CHANGED
@@ -1,4 +1,4 @@
1
- var O=window.__ycodiumPluginHost.modules?.["@ycodium-ai/plugin-api/provider-settings"];if(!O)throw new Error("This plugin needs a newer Ycodium app. Update the app.");var{PROVIDER_SETTINGS_VIEW_CAPABILITY:U,accountDirectoryCandidates:Z,accountDirectorySlug:ee,accountProbeHasSignedInAccount:te,allocateAccountDirectory:oe,providerInstanceAccountPaths:ne}=O;var q=window.__ycodiumPluginHost.react;var{Activity:re,Children:ae,Component:ce,Fragment:se,Profiler:le,PureComponent:pe,StrictMode:ue,Suspense:me,__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE:de,__COMPILER_RUNTIME:fe,act:ge,cache:Pe,cacheSignal:ye,captureOwnerStack:Se,cloneElement:ve,createContext:k,createElement:S,createRef:Ie,forwardRef:we,isValidElement:he,lazy:Ce,memo:xe,startTransition:Te,unstable_useCacheRefresh:_e,use:be,useActionState:Ee,useCallback:Ne,useContext:L,useDebugValue:Ae,useDeferredValue:Re,useEffect:B,useEffectEvent:Oe,useId:D,useImperativeHandle:Ue,useInsertionEffect:ke,useLayoutEffect:Le,useMemo:Be,useOptimistic:De,useReducer:Ve,useRef:$e,useState:He,useSyncExternalStore:Ke,useTransition:Me,version:Ye}=q;var V=k(null),$=V.Provider;function d(){let e=L(V);if(e===null)throw new Error("Pi UI has not been registered.");return e}var v=["openai-completions","openai-responses","anthropic-messages"],H="openai-completions";function f(e){return v.some(t=>t===e)}var I=["pi","custom"];function w(e){return I.some(t=>t===e)}function K(e,t){return w(e)?e:t.trim()?"custom":"pi"}var h="connection",P="YCODIUM_PI_API_KEY";function C(e){try{let t=new URL(e.trim());return(t.protocol==="http:"||t.protocol==="https:")&&!t.username&&!t.password&&!t.search&&!t.hash}catch{return!1}}function x(e){let t=e.config.apiBaseUrl,n=e.environment.find(s=>s.name==="YCODIUM_PI_API_BASE_URL")?.value;return K(e.config.connection,typeof t=="string"&&t.trim()?t:n??"")}function M(e){if(x(e)==="pi")return!0;let{apiProtocol:t,apiBaseUrl:n,model:s}=e.config,a=e.environment.find(u=>u.name===P);return(t===void 0||f(t))&&typeof n=="string"&&C(n)&&typeof s=="string"&&s.trim().length>0&&a!==void 0&&(a.valueRedacted===!0||a.value.trim().length>0)}function Y(e,t){let n=e.trim();return!n&&t?{}:{environment:[{name:P,value:n,sensitive:!0}]}}function T(e){return S(d().ui.DraftInput,e)}function g(e){return(t=>S(d().ui[e],{...t,className:`ycodium-pi-ui ${typeof t.className=="string"?t.className:""}`}))}var _=g("Select"),b=g("SelectTrigger"),E=g("SelectPopup"),N=g("SelectItem"),A=g("SelectValue");function R(){let e=d().i18n.usePluginTranslation();return{t:(t,n)=>e(t,n)}}var{jsx:i,jsxs:l,Fragment:F}=window.__ycodiumPluginHost.jsxRuntime;function j({instance:e,readOnly:t,onReport:n,onChange:s}){let{t:a}=R(),u=D(),c=x(e),r=M(e),o=r&&c==="custom"?a("connectionNotVerified"):void 0;B(()=>n({complete:r,hidesSignIn:!0,signInAfterAdd:!1,notice:o}),[r,o,n]);let m=e.environment.find(p=>p.name===P),G=m?.valueRedacted===!0,y=e.config.apiProtocol,W=y===void 0?H:f(y)?y:null;return l("div",{className:"ycodium-pi-ui grid min-w-0 gap-4",children:[l("div",{className:"grid min-w-0 gap-1",children:[i("span",{id:`${u}-connection-label`,className:"text-control-4 font-medium",children:a("form.connection.title")}),l(_,{value:c,disabled:t,onValueChange:p=>{!t&&w(p)&&s({config:{connection:p}})},children:[i(b,{"aria-labelledby":`${u}-connection-label`,children:i(A,{children:a(`connection.modes.${c}`)})}),i(E,{children:I.map(p=>i(N,{value:p,children:a(`connection.modes.${p}`)},p))})]})]}),c==="custom"?i(J,{id:u,instance:e,readOnly:t,onChange:s,storedKey:G,keyValue:m?.value??"",protocol:W}):null]})}function J({id:e,instance:t,readOnly:n,onChange:s,storedKey:a,keyValue:u,protocol:c}){let{t:r}=R();return l(F,{children:[l("div",{className:"grid min-w-0 gap-1",children:[i("span",{id:`${e}-protocol-label`,className:"text-control-4 font-medium",children:r("form.apiProtocol.title")}),l(_,{value:c,disabled:n,onValueChange:o=>{!n&&f(o)&&s({config:{apiProtocol:o}})},children:[i(b,{"aria-labelledby":`${e}-protocol-label`,"aria-describedby":c===null?`${e}-protocol-description`:void 0,"aria-invalid":c===null,children:i(A,{children:r(c===null?"connection.protocolUnknown":`connection.protocols.${c}`)})}),i(E,{children:v.map(o=>i(N,{value:o,children:r(`connection.protocols.${o}`)},o))})]}),c===null?i("span",{id:`${e}-protocol-description`,className:"text-ui-sm text-destructive-foreground",children:r("connection.invalidProtocol")}):null]}),["apiBaseUrl","model"].map(o=>l("label",{className:"grid min-w-0 gap-1",children:[i("span",{className:"text-control-4 font-medium",children:r(`form.${o}.title`)}),i(T,{value:typeof t.config[o]=="string"?t.config[o]:"",onCommit:m=>{n||s({config:{[o]:m.trim()}})},validate:m=>(o==="apiBaseUrl"?C(m):m.trim().length>0)?null:r(o==="apiBaseUrl"?"connection.invalidUrl":"connection.modelRequired"),disabled:n,autoComplete:"off",spellCheck:!1,"aria-label":r(`form.${o}.title`),"aria-describedby":`${e}-${o}-description`}),i("span",{id:`${e}-${o}-description`,className:"text-ui-sm text-muted-foreground",children:r(o==="apiBaseUrl"&&c!==null?`connection.baseUrlGuidance.${c}`:`form.${o}.description`)})]},o)),l("label",{className:"grid min-w-0 gap-1",children:[i("span",{className:"text-control-4 font-medium",children:r("connection.key")}),i(T,{type:"password",autoComplete:"off",spellCheck:!1,disabled:n,"aria-label":r("connection.key"),value:a?"":u,placeholder:a?r("connection.stored"):void 0,validate:o=>a||o.trim()?null:r("connection.keyRequired"),onCommit:o=>{n||s(Y(o,a))}})]})]})}var z=`/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */
1
+ var O=window.__ycodiumPluginHost.modules?.["@ycodium-ai/plugin-api/provider-settings"];if(!O)throw new Error("This plugin needs a newer Ycodium app. Update the app.");var{PROVIDER_SETTINGS_VIEW_CAPABILITY:U,accountDirectoryCandidates:Z,accountDirectorySlug:ee,accountProbeHasSignedInAccount:te,allocateAccountDirectory:oe,providerInstanceAccountPaths:ne}=O;var q=window.__ycodiumPluginHost.react;var{Activity:re,Children:ce,Component:ae,Fragment:se,Profiler:le,PureComponent:pe,StrictMode:ue,Suspense:me,__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE:de,__COMPILER_RUNTIME:fe,act:ge,cache:Pe,cacheSignal:ye,captureOwnerStack:Se,cloneElement:ve,createContext:k,createElement:S,createRef:Ie,forwardRef:Ce,isValidElement:Te,lazy:we,memo:xe,startTransition:_e,unstable_useCacheRefresh:he,use:be,useActionState:Ee,useCallback:Ne,useContext:L,useDebugValue:Ae,useDeferredValue:Re,useEffect:B,useEffectEvent:Oe,useId:D,useImperativeHandle:Ue,useInsertionEffect:ke,useLayoutEffect:Le,useMemo:Be,useOptimistic:De,useReducer:Ve,useRef:$e,useState:He,useSyncExternalStore:Ke,useTransition:Me,version:Ye}=q;var V=k(null),$=V.Provider;function d(){let e=L(V);if(e===null)throw new Error("Pi UI has not been registered.");return e}var v=["openai-completions","openai-responses","anthropic-messages"],H="openai-completions";function f(e){return v.some(t=>t===e)}var I=["pi","custom"];function C(e){return I.some(t=>t===e)}function K(e,t){return C(e)?e:t.trim()?"custom":"pi"}var T="connection",P="YCODIUM_PI_API_KEY";function w(e){try{let t=new URL(e.trim());return(t.protocol==="http:"||t.protocol==="https:")&&!t.username&&!t.password&&!t.search&&!t.hash}catch{return!1}}function x(e){let t=e.config.apiBaseUrl,n=e.environment.find(s=>s.name==="YCODIUM_PI_API_BASE_URL")?.value;return K(e.config.connection,typeof t=="string"&&t.trim()?t:n??"")}function M(e){if(x(e)==="pi")return!0;let{apiProtocol:t,apiBaseUrl:n,model:s}=e.config,c=e.environment.find(u=>u.name===P);return(t===void 0||f(t))&&typeof n=="string"&&w(n)&&typeof s=="string"&&s.trim().length>0&&c!==void 0&&(c.valueRedacted===!0||c.value.trim().length>0)}function Y(e,t){let n=e.trim();return!n&&t?{}:{environment:[{name:P,value:n,sensitive:!0}]}}function _(e){return S(d().ui.DraftInput,e)}function g(e){return(t=>S(d().ui[e],{...t,className:`ycodium-pi-ui ${typeof t.className=="string"?t.className:""}`}))}var h=g("Select"),b=g("SelectTrigger"),E=g("SelectPopup"),N=g("SelectItem"),A=g("SelectValue");function R(){let e=d().i18n.usePluginTranslation();return{t:(t,n)=>e(t,n)}}var{jsx:i,jsxs:l,Fragment:F}=window.__ycodiumPluginHost.jsxRuntime;function j({instance:e,readOnly:t,onReport:n,onChange:s}){let{t:c}=R(),u=D(),a=x(e),r=M(e),o=r&&a==="custom"?c("connectionNotVerified"):void 0;B(()=>n({complete:r,hidesSignIn:!0,signInAfterAdd:!1,notice:o}),[r,o,n]);let m=e.environment.find(p=>p.name===P),G=m?.valueRedacted===!0,y=e.config.apiProtocol,W=y===void 0?H:f(y)?y:null;return l("div",{className:"ycodium-pi-ui grid min-w-0 gap-4",children:[l("div",{className:"grid min-w-0 gap-1",children:[i("span",{id:`${u}-connection-label`,className:"text-control-4 font-medium",children:c("form.connection.title")}),l(h,{value:a,disabled:t,onValueChange:p=>{!t&&C(p)&&s({config:{connection:p}})},children:[i(b,{"aria-labelledby":`${u}-connection-label`,children:i(A,{children:c(`connection.modes.${a}`)})}),i(E,{children:I.map(p=>i(N,{value:p,children:c(`connection.modes.${p}`)},p))})]})]}),a==="custom"?i(J,{id:u,instance:e,readOnly:t,onChange:s,storedKey:G,keyValue:m?.value??"",protocol:W}):null]})}function J({id:e,instance:t,readOnly:n,onChange:s,storedKey:c,keyValue:u,protocol:a}){let{t:r}=R();return l(F,{children:[l("div",{className:"grid min-w-0 gap-1",children:[i("span",{id:`${e}-protocol-label`,className:"text-control-4 font-medium",children:r("form.apiProtocol.title")}),l(h,{value:a,disabled:n,onValueChange:o=>{!n&&f(o)&&s({config:{apiProtocol:o}})},children:[i(b,{"aria-labelledby":`${e}-protocol-label`,"aria-describedby":a===null?`${e}-protocol-description`:void 0,"aria-invalid":a===null,children:i(A,{children:r(a===null?"connection.protocolUnknown":`connection.protocols.${a}`)})}),i(E,{children:v.map(o=>i(N,{value:o,children:r(`connection.protocols.${o}`)},o))})]}),a===null?i("span",{id:`${e}-protocol-description`,className:"text-ui-sm text-destructive-foreground",children:r("connection.invalidProtocol")}):null]}),["apiBaseUrl","model"].map(o=>l("label",{className:"grid min-w-0 gap-1",children:[i("span",{className:"text-control-4 font-medium",children:r(`form.${o}.title`)}),i(_,{value:typeof t.config[o]=="string"?t.config[o]:"",onCommit:m=>{n||s({config:{[o]:m.trim()}})},validate:m=>(o==="apiBaseUrl"?w(m):m.trim().length>0)?null:r(o==="apiBaseUrl"?"connection.invalidUrl":"connection.modelRequired"),disabled:n,autoComplete:"off",spellCheck:!1,"aria-label":r(`form.${o}.title`),"aria-describedby":`${e}-${o}-description`}),i("span",{id:`${e}-${o}-description`,className:"text-ui-sm text-muted-foreground",children:r(o==="apiBaseUrl"&&a!==null?`connection.baseUrlGuidance.${a}`:`form.${o}.description`)})]},o)),l("label",{className:"grid min-w-0 gap-1",children:[i("span",{className:"text-control-4 font-medium",children:r("connection.key")}),i(_,{type:"password",autoComplete:"off",spellCheck:!1,disabled:n,"aria-label":r("connection.key"),value:c?"":u,placeholder:c?r("connection.stored"):void 0,validate:o=>c||o.trim()?null:r("connection.keyRequired"),onCommit:o=>{n||s(Y(o,c))}})]})]})}var z=`/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */
2
2
  @layer properties, theme, base, components, utilities;
3
3
  @layer properties;
4
4
  @layer utilities {
@@ -6,24 +6,6 @@ var O=window.__ycodiumPluginHost.modules?.["@ycodium-ai/plugin-api/provider-sett
6
6
  .relative:where(:scope, *) {
7
7
  position: relative;
8
8
  }
9
- .container:where(:scope, *) {
10
- width: 100%;
11
- @media (width >= 40rem) {
12
- max-width: 40rem;
13
- }
14
- @media (width >= 48rem) {
15
- max-width: 48rem;
16
- }
17
- @media (width >= 64rem) {
18
- max-width: 64rem;
19
- }
20
- @media (width >= 80rem) {
21
- max-width: 80rem;
22
- }
23
- @media (width >= 96rem) {
24
- max-width: 96rem;
25
- }
26
- }
27
9
  .grid:where(:scope, *) {
28
10
  display: grid;
29
11
  }
@@ -63,4 +45,4 @@ var O=window.__ycodiumPluginHost.modules?.["@ycodium-ai/plugin-api/provider-sett
63
45
  }
64
46
  }
65
47
  }
66
- `;function X(e){let t=n=>l($,{value:e,children:[i("style",{children:z}),i(j,{...n})]});return{pages:{},panels:{},views:{[h]:t},viewCapabilities:{[h]:[U]}}}export{X as default};
48
+ `;function X(e){let t=n=>l($,{value:e,children:[i("style",{children:z}),i(j,{...n})]});return{pages:{},panels:{},views:{[T]:t},viewCapabilities:{[T]:[U]}}}export{X as default};
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@ import * as NodePath3 from "node:path";
4
4
  import { definePlugin } from "@ycodium-ai/plugin-api";
5
5
 
6
6
  // ../../packages/plugin-api/src/version.ts
7
- var PLUGIN_API_VERSION = 143;
7
+ var PLUGIN_API_VERSION = 148;
8
8
 
9
9
  // src/index.ts
10
10
  import {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ycodium-ai/agent-pi",
3
- "version": "0.2.5029",
3
+ "version": "0.2.5100",
4
4
  "description": "Pi executor over the native RPC protocol.",
5
5
  "keywords": [
6
6
  "ycodium",
@@ -30,9 +30,10 @@
30
30
  "tailwindcss": "^4.0.0",
31
31
  "typescript": "~6.0.3",
32
32
  "vite-plus": "0.2.2",
33
- "@ycodium-ai/plugin-api": "0.2.5029",
33
+ "@ycodium/contracts": "0.0.33",
34
34
  "ycodium-executor-testing": "0.0.0",
35
- "@ycodium/contracts": "0.0.33"
35
+ "ycodium-react-test-harness": "0.0.0",
36
+ "@ycodium-ai/plugin-api": "0.2.5100"
36
37
  },
37
38
  "ycodium": {
38
39
  "plugin": "./dist/index.js",