anyray-connect 0.11.208 → 0.11.209

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 (2) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -317,7 +317,7 @@ Options:
317
317
  of the table (listing only).
318
318
  --help Show this help.
319
319
  `,R1=e=>{let t={json:!1,help:!1};for(let n of e)n==="--help"||n==="-h"?t.help=!0:n==="--json"?t.json=!0:n.startsWith("-")?t.error=`unknown option: ${n}`:t.modelId?t.error=`unexpected argument: ${n}`:t.modelId=n;return t},O1=e=>{let t=se.find(n=>n.id===Qo);if(!t)throw new Error("copilot-cli adapter missing from REGISTRY");return t.apply(e,{dryRun:!1,explicit:!0})},_1=e=>{let t=r=>r>=1e3?`${Math.round(r/1e3)}k`:String(r);return[...e.maxPromptTokens?[`${t(e.maxPromptTokens)} in`]:[],...e.maxOutputTokens?[`${t(e.maxOutputTokens)} out`]:[]].join(" / ")},T1=(e,t,n)=>`${e.origin.replace(/\/+$/,"")}/v1${Xi(t)}/${br(n)==="responses"?"responses":"chat/completions"}`,Ix=async(e=[],t={})=>{let n=R1(e);if(n.help)return process.stdout.write(Sx),0;if(n.error)return D(n.error),process.stdout.write(Sx),1;let r=await(t.loadTarget??Je)();if(!r)return D("Not enrolled \u2014 run `anyray-connect` first."),1;let{target:o}=r,a=await(t.discoverSeatToken??Gd)({allowKeychainPrompt:!0});if(!a.token)return D("No Copilot sign-in Connect can read \u2014 run `copilot` once and `/login` (say YES to storing credentials locally), then retry."),1;let s=a.token.token,i=a.capiSegment??"default",c=await(t.fetchCatalog??ss)(s,{},i,{laneOrigin:o.origin.replace(/\/+$/,""),...o.clientKey?{clientKey:o.clientKey}:{}}),l=Eh(c);if(l.length===0)return D("Could not fetch your seat's model catalog from GitHub (offline, or the sign-in lost its Copilot seat)."),1;if(!n.modelId){let m=process.env.COPILOT_MODEL?.trim();if(n.json)return process.stdout.write(`${JSON.stringify({origin:o.origin,current:m??null,models:l.map(f=>({id:f.id,wire:br(f.id),...f.maxPromptTokens?{maxPromptTokens:f.maxPromptTokens}:{},...f.maxOutputTokens?{maxOutputTokens:f.maxOutputTokens}:{}}))})}
320
- `),0;k(Z(`Copilot models your seat serves (via ${o.origin})`));for(let f of l){let h=f.id===m?"*":" ",g=_1(f);k(` ${h} ${f.id.padEnd(24)}${g?v(g):""}`)}return M("Switch the startup model: `anyray-connect models <id>` (per launch: `copilot --model <id>`)."),M("The CLI's own /models cannot list models on a custom provider \u2014 this list is the picker."),0}let d=l.find(m=>m.id===n.modelId);if(!d)return D(`'${n.modelId}' is not in your seat's catalog \u2014 run \`anyray-connect models\` to list it.`),1;let u=await(t.probeChat??Hd)(T1(o,i,d.id),{...Ih(),authorization:`Bearer ${s}`,...o.clientKey?{"x-anyray-api-key":o.clientKey}:{}},d.id);if(u==="rejected")return D(`GitHub refuses chat as '${d.id}' for this sign-in (it is in the catalog, but chat entitlement is narrower). Pick another id from \`anyray-connect models\`.`),1;u==="unreachable"?P("Could not verify the model over the lane (offline?) \u2014 applying anyway."):B(`'${d.id}' answers on your lane.`);let p=process.env.ANYRAY_COPILOT_MODEL;process.env.ANYRAY_COPILOT_MODEL=d.id;try{let m=await(t.applyCopilotCli??O1)(o);if(m.status!=="configured"){for(let f of m.messages)k(f);return D("Apply did not complete \u2014 see above."),1}}finally{p===void 0?delete process.env.ANYRAY_COPILOT_MODEL:process.env.ANYRAY_COPILOT_MODEL=p}return B(`Copilot CLI startup model \u2192 ${d.id}`),M("Open a fresh terminal (or re-source your profile), then run `copilot`."),0};import{createReadStream as OK}from"node:fs";import{spawnSync as n0}from"node:child_process";import{createHash as _K}from"node:crypto";import{access as r0,chmod as Lg,copyFile as TK,lstat as PK,mkdir as DK,mkdtemp as o0,readFile as fp,rename as LK,rm as ko,stat as NK,writeFile as $K}from"node:fs/promises";import{constants as a0}from"node:fs";import{platform as Ns,tmpdir as MK}from"node:os";import{dirname as BK,isAbsolute as FK,join as dp}from"node:path";import{z as Ke}from"zod";var Ne="0.11.208";import{createWriteStream as Q1}from"node:fs";import{spawnSync as Fx}from"node:child_process";import{chmod as Wx,copyFile as Sg,lstat as Ig,mkdir as Eg,readdir as ip,realpath as sp,rename as rp,rm as Bt,stat as Ux,symlink as eK,writeFile as tK}from"node:fs/promises";import{createHash as nK}from"node:crypto";import{basename as op,dirname as An,join as _s}from"node:path";import{Readable as rK}from"node:stream";import{pipeline as oK}from"node:stream/promises";var P1=["hook_registration","mcp_registration","hook_binary","beacon_target"],ya=e=>e.status==="configured"||e.status==="queued",ga=async(e,t=se)=>{let n=new Set(e),r=[];for(let o of t)if(n.has(o.id))try{(await o.detect()).installed&&r.push(o)}catch{}return r},Os=async(e,t,n=se)=>{let r=[];for(let o of await ga(e,n))if(o.pointsAt)try{if(o.automaticRepairAllowed&&!await o.automaticRepairAllowed())continue;await o.pointsAt(t)||r.push(o)}catch{}return r},bg=async(e,t=se)=>{let n=[];for(let r of await ga(e,t))if(r.integrationStatus)try{n.push({adapter:r,checks:await r.integrationStatus()})}catch{n.push({adapter:r,checks:Object.fromEntries(P1.map(o=>[o,"unreadable"]))})}return n},Ex=e=>e.filter(t=>!t.integrationStatus),D1=e=>{let t=e?.code;return t==="EACCES"||t==="EPERM"||t==="EROFS"?"settings_not_writable":"apply_threw"},tn=async(e,t)=>{let n=[];for(let r of e)try{let o=await r.apply(t,{dryRun:!1});n.push({id:r.id,title:r.title,status:o.status,...o.errorClass?{errorClass:o.errorClass}:{}})}catch(o){let a=D1(o);if(r.classifyApplyError)try{a=r.classifyApplyError(o)}catch{}n.push({id:r.id,title:r.title,status:"failed",errorClass:a})}return n};import{constants as xx}from"node:fs";import{access as L1,chmod as N1,lstat as $1,mkdir as M1,open as B1,readFile as F1,realpath as W1,rm as U1,stat as Ox,writeFile as H1}from"node:fs/promises";import{randomUUID as G1}from"node:crypto";import{platform as Cg}from"node:os";import{dirname as K1,join as V1,posix as j1,win32 as _x}from"node:path";var Rc="/usr/local/bin/anyray-credential-helper",Oc="C:\\Program Files\\Anyray\\anyray-credential-helper.cmd",qu="/usr/local/bin/anyray-bootstrap-headers-helper",Qu="C:\\Program Files\\Anyray\\anyray-bootstrap-headers-helper.cmd",xc="Managed by anyray-connect desktop helper; do not edit.",Y1=`anyray-connect desktop helper <--write|--print> --bin <absolute> [options]
320
+ `),0;k(Z(`Copilot models your seat serves (via ${o.origin})`));for(let f of l){let h=f.id===m?"*":" ",g=_1(f);k(` ${h} ${f.id.padEnd(24)}${g?v(g):""}`)}return M("Switch the startup model: `anyray-connect models <id>` (per launch: `copilot --model <id>`)."),M("The CLI's own /models cannot list models on a custom provider \u2014 this list is the picker."),0}let d=l.find(m=>m.id===n.modelId);if(!d)return D(`'${n.modelId}' is not in your seat's catalog \u2014 run \`anyray-connect models\` to list it.`),1;let u=await(t.probeChat??Hd)(T1(o,i,d.id),{...Ih(),authorization:`Bearer ${s}`,...o.clientKey?{"x-anyray-api-key":o.clientKey}:{}},d.id);if(u==="rejected")return D(`GitHub refuses chat as '${d.id}' for this sign-in (it is in the catalog, but chat entitlement is narrower). Pick another id from \`anyray-connect models\`.`),1;u==="unreachable"?P("Could not verify the model over the lane (offline?) \u2014 applying anyway."):B(`'${d.id}' answers on your lane.`);let p=process.env.ANYRAY_COPILOT_MODEL;process.env.ANYRAY_COPILOT_MODEL=d.id;try{let m=await(t.applyCopilotCli??O1)(o);if(m.status!=="configured"){for(let f of m.messages)k(f);return D("Apply did not complete \u2014 see above."),1}}finally{p===void 0?delete process.env.ANYRAY_COPILOT_MODEL:process.env.ANYRAY_COPILOT_MODEL=p}return B(`Copilot CLI startup model \u2192 ${d.id}`),M("Open a fresh terminal (or re-source your profile), then run `copilot`."),0};import{createReadStream as OK}from"node:fs";import{spawnSync as n0}from"node:child_process";import{createHash as _K}from"node:crypto";import{access as r0,chmod as Lg,copyFile as TK,lstat as PK,mkdir as DK,mkdtemp as o0,readFile as fp,rename as LK,rm as ko,stat as NK,writeFile as $K}from"node:fs/promises";import{constants as a0}from"node:fs";import{platform as Ns,tmpdir as MK}from"node:os";import{dirname as BK,isAbsolute as FK,join as dp}from"node:path";import{z as Ke}from"zod";var Ne="0.11.209";import{createWriteStream as Q1}from"node:fs";import{spawnSync as Fx}from"node:child_process";import{chmod as Wx,copyFile as Sg,lstat as Ig,mkdir as Eg,readdir as ip,realpath as sp,rename as rp,rm as Bt,stat as Ux,symlink as eK,writeFile as tK}from"node:fs/promises";import{createHash as nK}from"node:crypto";import{basename as op,dirname as An,join as _s}from"node:path";import{Readable as rK}from"node:stream";import{pipeline as oK}from"node:stream/promises";var P1=["hook_registration","mcp_registration","hook_binary","beacon_target"],ya=e=>e.status==="configured"||e.status==="queued",ga=async(e,t=se)=>{let n=new Set(e),r=[];for(let o of t)if(n.has(o.id))try{(await o.detect()).installed&&r.push(o)}catch{}return r},Os=async(e,t,n=se)=>{let r=[];for(let o of await ga(e,n))if(o.pointsAt)try{if(o.automaticRepairAllowed&&!await o.automaticRepairAllowed())continue;await o.pointsAt(t)||r.push(o)}catch{}return r},bg=async(e,t=se)=>{let n=[];for(let r of await ga(e,t))if(r.integrationStatus)try{n.push({adapter:r,checks:await r.integrationStatus()})}catch{n.push({adapter:r,checks:Object.fromEntries(P1.map(o=>[o,"unreadable"]))})}return n},Ex=e=>e.filter(t=>!t.integrationStatus),D1=e=>{let t=e?.code;return t==="EACCES"||t==="EPERM"||t==="EROFS"?"settings_not_writable":"apply_threw"},tn=async(e,t)=>{let n=[];for(let r of e)try{let o=await r.apply(t,{dryRun:!1});n.push({id:r.id,title:r.title,status:o.status,...o.errorClass?{errorClass:o.errorClass}:{}})}catch(o){let a=D1(o);if(r.classifyApplyError)try{a=r.classifyApplyError(o)}catch{}n.push({id:r.id,title:r.title,status:"failed",errorClass:a})}return n};import{constants as xx}from"node:fs";import{access as L1,chmod as N1,lstat as $1,mkdir as M1,open as B1,readFile as F1,realpath as W1,rm as U1,stat as Ox,writeFile as H1}from"node:fs/promises";import{randomUUID as G1}from"node:crypto";import{platform as Cg}from"node:os";import{dirname as K1,join as V1,posix as j1,win32 as _x}from"node:path";var Rc="/usr/local/bin/anyray-credential-helper",Oc="C:\\Program Files\\Anyray\\anyray-credential-helper.cmd",qu="/usr/local/bin/anyray-bootstrap-headers-helper",Qu="C:\\Program Files\\Anyray\\anyray-bootstrap-headers-helper.cmd",xc="Managed by anyray-connect desktop helper; do not edit.",Y1=`anyray-connect desktop helper <--write|--print> --bin <absolute> [options]
321
321
 
322
322
  Create the helpers required by Claude Desktop and Codex fleet artifacts: the
323
323
  credential helper (inferenceCredentialHelper, also used by Codex) and the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anyray-connect",
3
- "version": "0.11.208",
3
+ "version": "0.11.209",
4
4
  "description": "Anyray connect — points local coding tools (Claude Code, Cursor, Windsurf, SDKs) at the Anyray gateway through supported configuration and enrolled personal authentication.",
5
5
  "type": "module",
6
6
  "bin": {