@ainyc/canonry 4.113.0 → 4.114.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.
Files changed (28) hide show
  1. package/assets/assets/{BacklinksPage-AYTE7he1.js → BacklinksPage-C60ma4Sg.js} +1 -1
  2. package/assets/assets/{ChartPrimitives-J0xH87kk.js → ChartPrimitives-Blgw1l6J.js} +1 -1
  3. package/assets/assets/ProjectPage-DfvEEwNU.js +7 -0
  4. package/assets/assets/{RunRow-Duz6GoZ0.js → RunRow-DgQiXWZl.js} +1 -1
  5. package/assets/assets/{RunsPage-DpocjSZ-.js → RunsPage-C9upHccV.js} +1 -1
  6. package/assets/assets/SettingsPage-Bz_-_DnJ.js +1 -0
  7. package/assets/assets/{TrafficPage-B5c8opWF.js → TrafficPage-BhBnQl2N.js} +1 -1
  8. package/assets/assets/{TrafficSourceDetailPage-D9JPwzH-.js → TrafficSourceDetailPage-DWXqcRNO.js} +1 -1
  9. package/assets/assets/{arrow-left-DMukIffh.js → arrow-left-C6SuuEtD.js} +1 -1
  10. package/assets/assets/{extract-error-message-CVln-Uf_.js → extract-error-message-DPZ5yqzd.js} +1 -1
  11. package/assets/assets/index-C3oQZHf8.js +210 -0
  12. package/assets/assets/index-CReX5Jn9.css +1 -0
  13. package/assets/assets/{trash-2-BbhOWhnf.js → trash-2-D3Nju7AK.js} +1 -1
  14. package/assets/index.html +2 -2
  15. package/dist/{chunk-XYSEBOHP.js → chunk-3VSTTH4M.js} +82 -2
  16. package/dist/{chunk-RMTNF2ES.js → chunk-DUBZH5JW.js} +1 -1
  17. package/dist/{chunk-DBZLOLYT.js → chunk-VEUBAZRG.js} +8 -1
  18. package/dist/{chunk-B3B3HJPH.js → chunk-WMWZW34J.js} +71 -9
  19. package/dist/cli.js +4 -4
  20. package/dist/index.d.ts +9 -0
  21. package/dist/index.js +4 -4
  22. package/dist/{intelligence-service-RRWOGVVE.js → intelligence-service-I5EQ77KZ.js} +2 -2
  23. package/dist/mcp.js +2 -2
  24. package/package.json +8 -8
  25. package/assets/assets/ProjectPage-BcqfsS5X.js +0 -7
  26. package/assets/assets/SettingsPage-CboDfSRx.js +0 -1
  27. package/assets/assets/index-DNoISJxr.js +0 -210
  28. package/assets/assets/index-l-PAIV0A.css +0 -1
@@ -1 +0,0 @@
1
- import{r as n,j as e}from"./vendor-tanstack-Be8JdV5M.js";import{B as f,j as A,bN as H,N as B,bO as q,bP as F,g as b,T as y,bQ as z,bb as Q,bK as V,bR as W,bS as _,bT as K,bU as T}from"./index-DNoISJxr.js";import"./vendor-radix-CQ77EO2y.js";import"./vendor-recharts-C9EZkgbP.js";import"./vendor-markdown-6dwjPOKK.js";function J({providerName:s,keyUrl:m,modelHint:o,onSaved:j}){const u=s.toLowerCase()==="local",[r,d]=n.useState(""),[x,c]=n.useState(""),[g,h]=n.useState(""),[p,a]=n.useState(""),[l,v]=n.useState(""),[N,S]=n.useState(""),[C,k]=n.useState(!1),[w,t]=n.useState(null),[U,M]=n.useState(!1),O=u?x.trim().length>0:r.trim().length>0;async function L(){if(O){k(!0),t(null),M(!1);try{const i=$=>{const I=parseInt($.trim(),10);return Number.isFinite(I)&&I>0?I:void 0},P={},D=i(p);D!==void 0&&(P.maxConcurrency=D);const G=i(l);G!==void 0&&(P.maxRequestsPerMinute=G);const E=i(N);E!==void 0&&(P.maxRequestsPerDay=E),await H(s.toLowerCase(),{...r.trim()?{apiKey:r.trim()}:{},...x.trim()?{baseUrl:x.trim()}:{},...g.trim()?{model:g.trim()}:{},...Object.keys(P).length>0?{quota:P}:{}}),d(""),c(""),h(""),a(""),v(""),S(""),M(!0),B({title:"Provider updated",detail:`${s} configuration saved.`,tone:"positive",dedupeKey:`settings:provider:${s}`,dedupeMode:"replace"}),j()}catch(i){t(i instanceof Error?i.message:"Failed to update provider")}finally{k(!1)}}}const R=o??"Use default model";return e.jsxs("div",{className:"mt-3 rounded-lg border border-base bg-bg-elevated/40 p-3 space-y-2",children:[u&&e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-muted",htmlFor:`base-url-${s}`,children:"Base URL"}),e.jsx("input",{id:`base-url-${s}`,type:"text",className:"mt-0.5 w-full rounded border border-strong bg-transparent px-2 py-1.5 text-sm text-strong placeholder-mono-600 focus:border-mono-500 focus:outline-none",placeholder:"http://localhost:11434/v1",value:x,onChange:i=>c(i.target.value)}),e.jsx("p",{className:"mt-0.5 text-[10px] text-faint",children:"Any OpenAI-compatible endpoint — Ollama, LM Studio, llama.cpp, vLLM"})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("label",{className:"text-xs text-muted",htmlFor:`api-key-${s}`,children:["API Key",u?" (optional)":""]}),m&&e.jsxs("a",{href:m,target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-muted hover:text-neutral underline underline-offset-2",children:["Get API key ","↗"]})]}),e.jsx("input",{id:`api-key-${s}`,type:"password",className:"mt-0.5 w-full rounded border border-strong bg-transparent px-2 py-1.5 text-sm text-strong placeholder-mono-600 focus:border-mono-500 focus:outline-none",placeholder:u?"Optional — most local servers don't need one":`Enter ${s} API key`,value:r,onChange:i=>d(i.target.value)})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-muted",htmlFor:`model-${s}`,children:"Model (optional)"}),e.jsx("input",{id:`model-${s}`,type:"text",className:"mt-0.5 w-full rounded border border-strong bg-transparent px-2 py-1.5 text-sm text-strong placeholder-mono-600 focus:border-mono-500 focus:outline-none",placeholder:R,value:g,onChange:i=>h(i.target.value)})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-muted",children:"Quota (optional)"}),e.jsxs("div",{className:"mt-0.5 grid grid-cols-3 gap-1.5",children:[e.jsxs("div",{children:[e.jsx("input",{type:"number",min:"1",className:"w-full rounded border border-strong bg-transparent px-2 py-1.5 text-sm text-strong placeholder-mono-600 focus:border-mono-500 focus:outline-none",placeholder:"Concurrent",value:p,onChange:i=>a(i.target.value)}),e.jsx("p",{className:"mt-0.5 text-[10px] text-faint",children:"Max concurrent"})]}),e.jsxs("div",{children:[e.jsx("input",{type:"number",min:"1",className:"w-full rounded border border-strong bg-transparent px-2 py-1.5 text-sm text-strong placeholder-mono-600 focus:border-mono-500 focus:outline-none",placeholder:"/min",value:l,onChange:i=>v(i.target.value)}),e.jsx("p",{className:"mt-0.5 text-[10px] text-faint",children:"Per minute"})]}),e.jsxs("div",{children:[e.jsx("input",{type:"number",min:"1",className:"w-full rounded border border-strong bg-transparent px-2 py-1.5 text-sm text-strong placeholder-mono-600 focus:border-mono-500 focus:outline-none",placeholder:"/day",value:N,onChange:i=>S(i.target.value)}),e.jsx("p",{className:"mt-0.5 text-[10px] text-faint",children:"Per day"})]})]})]}),w&&e.jsx("p",{className:"text-xs text-negative-400",children:w}),U&&e.jsx("p",{className:"text-xs text-positive-400",children:"Provider updated."}),e.jsx(f,{type:"button",size:"sm",disabled:!O||C,onClick:A(L),children:C?"Saving...":"Save"})]})}function X({onSaved:s}){const[m,o]=n.useState(""),[j,u]=n.useState(""),[r,d]=n.useState(!1),[x,c]=n.useState(null),[g,h]=n.useState(!1),p=m.trim().length>0&&j.trim().length>0;async function a(){if(p){d(!0),c(null),h(!1);try{await q({clientId:m.trim(),clientSecret:j.trim()}),o(""),u(""),h(!0),B({title:"Google OAuth app updated",detail:"Dashboard Google credentials were saved.",tone:"positive",dedupeKey:"settings:google-oauth",dedupeMode:"replace"}),s()}catch(l){c(l instanceof Error?l.message:"Failed to update Google OAuth credentials")}finally{d(!1)}}}return e.jsxs("div",{className:"mt-3 rounded-lg border border-base bg-bg-elevated/40 p-3 space-y-2",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("label",{className:"text-xs text-muted",htmlFor:"google-client-id",children:"Client ID"}),e.jsxs("a",{href:"https://console.cloud.google.com/apis/credentials",target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-muted hover:text-neutral underline underline-offset-2",children:["Google Cloud ","↗"]})]}),e.jsx("input",{id:"google-client-id",type:"text",className:"mt-0.5 w-full rounded border border-strong bg-transparent px-2 py-1.5 text-sm text-strong placeholder-mono-600 focus:border-mono-500 focus:outline-none",placeholder:"Google OAuth client ID",value:m,onChange:l=>o(l.target.value)})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-muted",htmlFor:"google-client-secret",children:"Client secret"}),e.jsx("input",{id:"google-client-secret",type:"password",className:"mt-0.5 w-full rounded border border-strong bg-transparent px-2 py-1.5 text-sm text-strong placeholder-mono-600 focus:border-mono-500 focus:outline-none",placeholder:"Google OAuth client secret",value:j,onChange:l=>u(l.target.value)})]}),e.jsxs("p",{className:"text-[11px] text-muted",children:["These credentials are stored in ",e.jsx("code",{children:"~/.canonry/config.yaml"}),". Project-level Search Console connections are created separately per canonical domain."]}),x&&e.jsx("p",{className:"text-xs text-negative-400",children:x}),g&&e.jsx("p",{className:"text-xs text-positive-400",children:"Google OAuth credentials updated."}),e.jsx(f,{type:"button",size:"sm",disabled:!p||r,onClick:A(a),children:r?"Saving...":"Save Google OAuth app"})]})}function Y(){const[s,m]=n.useState(null),[o,j]=n.useState(null),[u,r]=n.useState(!1),[d,x]=n.useState("localhost"),[c,g]=n.useState("9222"),[h,p]=n.useState(!1);return n.useEffect(()=>{F().then(m).catch(a=>{const l=a instanceof Error?a.message:String(a);l.includes("501")||j(l)})},[]),e.jsxs(b,{className:"surface-card",children:[e.jsxs("div",{className:"section-head",children:[e.jsxs("div",{children:[e.jsx("p",{className:"eyebrow eyebrow-soft",children:"Browser provider"}),e.jsx("h2",{children:"ChatGPT (CDP)"})]}),e.jsx(y,{tone:s?.connected?"positive":"caution",children:s?.connected?"Connected":"Not connected"})]}),e.jsxs("dl",{className:"definition-list mt-3",children:[s?.endpoint&&e.jsxs("div",{children:[e.jsx("dt",{children:"Endpoint"}),e.jsx("dd",{className:"font-mono text-xs",children:s.endpoint})]}),s?.browserVersion&&e.jsxs("div",{children:[e.jsx("dt",{children:"Browser"}),e.jsx("dd",{className:"text-xs",children:s.browserVersion})]}),s?.targets&&s.targets.length>0&&e.jsxs("div",{children:[e.jsx("dt",{children:"Tabs"}),e.jsx("dd",{children:s.targets.map(a=>e.jsxs("span",{className:"mr-2",children:[a.name,": ",a.alive?"● alive":"○ idle"]},a.name))})]})]}),e.jsx("p",{className:"mt-2 text-sm text-muted",children:s?.connected?"Connected to Chrome via CDP. Launch Chrome with --remote-debugging-port to use this provider.":o||"Not configured. Set an endpoint below or run: canonry cdp connect --host localhost --port 9222"}),e.jsx("div",{className:"mt-2",children:e.jsx(f,{type:"button",variant:"outline",size:"sm",onClick:()=>r(!u),children:u?"Cancel":s?.connected?"Update endpoint":"Configure"})}),u&&e.jsxs("form",{className:"mt-3 flex flex-col gap-2",onSubmit:A(async a=>{a.preventDefault(),p(!0);try{await z(d,parseInt(c,10)||9222);const l=await F().catch(()=>null);l&&m(l),r(!1),B({title:"CDP endpoint saved",detail:`${d}:${parseInt(c,10)||9222} is now configured.`,tone:"positive",dedupeKey:"settings:cdp",dedupeMode:"replace"})}catch(l){j(l instanceof Error?l.message:String(l))}finally{p(!1)}}),children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{className:"flex-1 rounded border border-strong bg-bg-elevated px-2 py-1 text-sm text-heading placeholder-mono-500 focus:outline-none focus:ring-1 focus:ring-mono-500",placeholder:"localhost",value:d,onChange:a=>x(a.target.value),"aria-label":"CDP host"}),e.jsx("input",{className:"w-24 rounded border border-strong bg-bg-elevated px-2 py-1 text-sm text-heading placeholder-mono-500 focus:outline-none focus:ring-1 focus:ring-mono-500",placeholder:"9222",value:c,onChange:a=>g(a.target.value),"aria-label":"CDP port"})]}),e.jsx("div",{children:e.jsx(f,{type:"submit",size:"sm",disabled:h,children:h?"Saving…":"Save endpoint"})})]})]})}const Z={apiStatus:{state:"checking",detail:"Checking service health"},workerStatus:{state:"checking",detail:"Checking service health"}};function le(){const s=Q(),{dashboard:m}=V(),o=m?.settings??s?.dashboard?.settings,r=W(!s,s?.health).data??s?.health??Z,[d,x]=n.useState(null),[c,g]=n.useState(!1),[h,p]=n.useState(!1),[a,l]=n.useState(""),[v,N]=n.useState(!1),[S,C]=n.useState(null),[k,w]=n.useState(!1);return o?e.jsxs("div",{className:"page-container",children:[e.jsx("div",{className:"page-header",children:e.jsxs("div",{className:"page-header-left",children:[e.jsx("h1",{className:"page-title",children:"Settings"}),e.jsx("p",{className:"page-subtitle",children:"Provider state, Google OAuth, Bing WMT setup, and service health."})]})}),e.jsxs("section",{className:"settings-grid",children:[o.providerStatuses.map(t=>e.jsxs(b,{className:"surface-card",children:[e.jsxs("div",{className:"section-head",children:[e.jsxs("div",{children:[e.jsx("p",{className:"eyebrow eyebrow-soft",children:"Provider"}),e.jsx("h2",{children:t.displayName??t.name})]}),e.jsx(y,{tone:t.state==="ready"?"positive":"caution",children:t.state==="ready"?"Ready":"Needs config"})]}),e.jsxs("dl",{className:"definition-list mt-3",children:[e.jsxs("div",{children:[e.jsx("dt",{children:"Model"}),e.jsxs("dd",{className:"font-mono text-xs",children:[t.model??t.defaultModel??"unknown",!t.model&&t.defaultModel&&e.jsx("span",{className:"ml-1 font-sans text-muted",children:"(default)"})]})]}),t.quota&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("dt",{children:"Concurrency"}),e.jsx("dd",{children:t.quota.maxConcurrency})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Rate limit"}),e.jsxs("dd",{children:[t.quota.maxRequestsPerMinute,"/min · ",t.quota.maxRequestsPerDay,"/day"]})]})]})]}),e.jsx("p",{className:"mt-2 text-sm text-muted",children:t.detail}),e.jsx("div",{className:"mt-2",children:e.jsx(f,{type:"button",variant:"outline",size:"sm",onClick:()=>x(d===t.name?null:t.name),children:d===t.name?"Cancel":t.state==="ready"?t.name.toLowerCase()==="local"?"Update config":"Update key":"Configure"})}),d===t.name&&e.jsx(J,{providerName:t.name,keyUrl:t.keyUrl,modelHint:t.modelHint,onSaved:()=>{x(null)}})]},t.name)),e.jsxs(b,{className:"surface-card",children:[e.jsxs("div",{className:"section-head",children:[e.jsxs("div",{children:[e.jsx("p",{className:"eyebrow eyebrow-soft",children:"Google"}),e.jsx("h2",{children:"Search Console OAuth"})]}),e.jsx(y,{tone:o.google.state==="ready"?"positive":"caution",children:o.google.state==="ready"?"Ready":"Needs config"})]}),e.jsxs("dl",{className:"definition-list mt-3",children:[e.jsxs("div",{children:[e.jsx("dt",{children:"Auth model"}),e.jsx("dd",{children:"One app credential set, then one OAuth connection per project domain"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Storage"}),e.jsx("dd",{className:"font-mono text-xs",children:"~/.canonry/config.yaml"})]})]}),e.jsx("p",{className:"mt-2 text-sm text-muted",children:o.google.detail}),e.jsx("div",{className:"mt-2",children:e.jsx(f,{type:"button",variant:"outline",size:"sm",onClick:()=>g(!c),children:c?"Cancel":o.google.state==="ready"?"Update OAuth app":"Configure Google OAuth"})}),c&&e.jsx(X,{onSaved:()=>{g(!1)}})]}),e.jsxs(b,{className:"surface-card",children:[e.jsxs("div",{className:"section-head",children:[e.jsxs("div",{children:[e.jsx("p",{className:"eyebrow eyebrow-soft",children:"Bing"}),e.jsx("h2",{children:"Webmaster Tools"})]}),e.jsx(y,{tone:o.bing.state==="ready"?"positive":"caution",children:o.bing.state==="ready"?"Ready":"Needs config"})]}),e.jsxs("dl",{className:"definition-list mt-3",children:[e.jsxs("div",{children:[e.jsx("dt",{children:"Auth model"}),e.jsx("dd",{children:"API key authentication — no OAuth needed"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Storage"}),e.jsx("dd",{className:"font-mono text-xs",children:"~/.canonry/config.yaml"})]})]}),e.jsx("p",{className:"mt-2 text-sm text-muted",children:o.bing.detail}),e.jsx("div",{className:"mt-2",children:e.jsx(f,{type:"button",variant:"outline",size:"sm",onClick:()=>p(!h),children:h?"Cancel":o.bing.state==="ready"?"Update API key":"Configure Bing"})}),h&&e.jsxs("div",{className:"mt-3 rounded-lg border border-base bg-bg-elevated/40 p-3 space-y-2",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("label",{className:"text-xs text-muted",htmlFor:"bing-api-key",children:"API Key"}),e.jsx("a",{href:"https://www.bing.com/webmasters/",target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-muted hover:text-neutral underline underline-offset-2",children:"Bing Webmaster Tools"})]}),e.jsx("input",{id:"bing-api-key",type:"password",className:"mt-0.5 w-full rounded border border-strong bg-transparent px-2 py-1.5 text-sm text-strong placeholder-mono-600 focus:border-mono-500 focus:outline-none",placeholder:"Bing Webmaster Tools API key",value:a,onChange:t=>l(t.target.value)})]}),e.jsxs("p",{className:"text-[11px] text-muted",children:["This key is stored in ",e.jsx("code",{children:"~/.canonry/config.yaml"}),". Project-level Bing connections are created separately per canonical domain."]}),S&&e.jsx("p",{className:"text-xs text-negative-400",children:S}),k&&e.jsx("p",{className:"text-xs text-positive-400",children:"Bing API key updated."}),e.jsx(f,{type:"button",size:"sm",disabled:!a.trim()||v,onClick:A(async()=>{if(a.trim()){N(!0),C(null),w(!1);try{await _(a.trim()),l(""),w(!0),p(!1),B({title:"Bing API key updated",detail:"Dashboard Bing credentials were saved.",tone:"positive",dedupeKey:"settings:bing",dedupeMode:"replace"})}catch(t){C(t instanceof Error?t.message:"Failed to update Bing API key")}finally{N(!1)}}}),children:v?"Saving...":"Save Bing API key"})]})]}),e.jsx(Y,{}),e.jsxs(b,{className:"surface-card",children:[e.jsx("div",{className:"section-head",children:e.jsxs("div",{children:[e.jsx("p",{className:"eyebrow eyebrow-soft",children:"Service health"}),e.jsx("h2",{children:"API and worker"})]})}),e.jsxs("div",{className:"compact-stack",children:[e.jsxs("div",{className:"health-row",children:[e.jsxs("div",{children:[e.jsx("p",{className:"run-row-title",children:"API"}),e.jsx("p",{className:"supporting-copy",children:r.apiStatus.detail})]}),e.jsx(y,{tone:T(r.apiStatus),title:K(r.apiStatus),children:r.apiStatus.state==="ok"?"Healthy":"Attention"})]}),e.jsxs("div",{className:"health-row",children:[e.jsxs("div",{children:[e.jsx("p",{className:"run-row-title",children:"Worker"}),e.jsx("p",{className:"supporting-copy",children:r.workerStatus.detail})]}),e.jsx(y,{tone:T(r.workerStatus),title:K(r.workerStatus),children:r.workerStatus.state==="ok"?"Healthy":"Attention"})]})]})]})]}),e.jsx("section",{className:"page-section",children:e.jsxs(b,{className:"surface-card",children:[e.jsx("div",{className:"section-head",children:e.jsxs("div",{children:[e.jsx("p",{className:"eyebrow eyebrow-soft",children:"Self-host notes"}),e.jsx("h2",{children:"Operational guidance"})]})}),e.jsx("ul",{className:"detail-list",children:o.selfHostNotes.map(t=>e.jsx("li",{children:t},t))}),e.jsx("p",{className:"supporting-copy",children:o.bootstrapNote})]})})]}):null}export{le as SettingsPage};