@aria-cli/types 1.0.14 → 1.0.17

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 ADDED
@@ -0,0 +1,17 @@
1
+ # @aria-cli/types
2
+
3
+
4
+
5
+ Part of [ARIA](https://www.npmjs.com/package/@aria-cli/cli) — Adaptive Reasoning Intelligence Agent.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm i @aria-cli/types
11
+ ```
12
+
13
+ See the main [`@aria-cli/cli`](https://www.npmjs.com/package/@aria-cli/cli) package for full documentation.
14
+
15
+ ## License
16
+
17
+ MIT
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{existsSync as l,mkdirSync as p,readFileSync as h,unlinkSync as S,writeFileSync as R}from"node:fs";import{homedir as g}from"node:os";import{dirname as m,join as c}from"node:path";function M(r){return r.kind==="function"}function T(r){return r.kind==="native"}function x(r){return r instanceof Error?r.message:typeof r=="string"?r:String(r)}function C(r){if(typeof r=="object"&&r!==null&&"statusCode"in r&&typeof r.statusCode=="number")return r.statusCode}function D(r){return r instanceof Error&&"code"in r&&typeof r.code=="string"}function L(r){return!E(r)}function E(r){return["brave_search","computer","code_interpreter","text_editor","bash","dalle","file_search"].some(e=>r.name.startsWith(e))}var B=199,F="ARIA_NO_RELAUNCH",V="ARIA_RESUME_SESSION_ID",j="ARIA_RESUME_ARION",H="ARIA_RESTART_KIND";function A(){return process.env.ARIA_HOME?.trim()||c(g(),".aria")}function N(){return c(A(),"relaunch-pending")}function u(r=process.pid){return c(N(),`${r}.json`)}function W(r){try{let e=u(r.pid);p(m(e),{recursive:!0}),R(e,JSON.stringify(r),"utf-8")}catch{}}function G(r=process.pid){try{let e=u(r);if(!l(e))return null;let t=h(e,"utf-8");return JSON.parse(t)}catch{return null}}function J(r=process.pid){try{let e=u(r);l(e)&&S(e)}catch{}}function f(){return globalThis}function K(r){let e=f();e.__aria_stall_phase=r,e.__aria_stall_phase_ts=performance.now()}function X(){let r=f();r.__aria_stall_phase=void 0,r.__aria_stall_phase_ts=void 0}var b="\x1B[2m\x1B[90m",v="\x1B[36m",_="\x1B[0m",i={debug:0,info:1,warn:2,error:3,silent:4};function y(){let r=typeof process<"u"?process.env.ARIA_LOG_LEVEL:void 0;return r&&r in i?r:"info"}var s=y();function a(r){return i[r]>=i[s]}function k(r){if(!r||typeof r!="object")return!1;let e=r;return e.code==="EPIPE"||e.code==="ERR_STREAM_DESTROYED"}function w(r,e){try{r(...e)}catch(t){if(k(t))return;throw t}}function I(r){if(r.length===0)return r;let[e,...t]=r;return typeof e!="string"||!e.startsWith("[")?r:[`${b}${e}${_}`,...t]}function O(r){if(r.length===0)return r;let[e,...t]=r;return typeof e!="string"||!e.startsWith("[")?r:[`${v}${e}${_}`,...t]}var d={write(r,e){let t,o;switch(r){case"debug":t=I(e),o=console.debug;break;case"info":t=O(e),o=console.info;break;case"warn":t=e,o=console.warn;break;default:t=e,o=console.error;break}w(o,t)}},n=[d],Y={debug(...r){if(a("debug"))for(let e of n)e.write("debug",r)},info(...r){if(a("info"))for(let e of n)e.write("info",r)},warn(...r){if(a("warn"))for(let e of n)e.write("warn",r)},error(...r){if(a("error"))for(let e of n)e.write("error",r)},setLevel(r){s=r},getLevel(){return s},addSink(r){n.push(r)},removeSink(r){let e=n.indexOf(r);e>=0&&n.splice(e,1)},removeConsoleSink(){let r=n.indexOf(d);r>=0&&n.splice(r,1)}};export{F as NO_RELAUNCH_ENV,B as RELAUNCH_EXIT_CODE,H as RESTART_KIND_ENV,j as RESUME_ARION_ENV,V as RESUME_SESSION_ENV,X as clearGlobalStallPhase,J as clearRelaunchMarker,x as getErrorMessage,C as getErrorStatusCode,N as getRelaunchMarkerDir,u as getRelaunchMarkerPath,L as isFunctionTool,M as isFunctionToolSchema,E as isNativeTool,T as isNativeToolSchema,D as isNodeError,Y as log,G as readRelaunchMarker,K as setGlobalStallPhase,W as writeRelaunchMarker};
1
+ function P(_){return _.kind==="function"}function N(_){return _.kind==="native"}function w(_){if(_ instanceof Error)return _.message;if(typeof _==="string")return _;return String(_)}function C(_){if(typeof _==="object"&&_!==null&&"statusCode"in _&&typeof _.statusCode==="number")return _.statusCode;return}function D(_){return _ instanceof Error&&"code"in _&&typeof _.code==="string"}function R(_){return!b(_)}function b(_){return["brave_search","computer","code_interpreter","text_editor","bash","dalle","file_search"].some((G)=>_.name.startsWith(G))}import{existsSync as Y,mkdirSync as x,readFileSync as I,unlinkSync as O,writeFileSync as T}from"node:fs";import{homedir as B}from"node:os";import{dirname as F,join as J}from"node:path";var m=199,v="ARIA_NO_RELAUNCH",l="ARIA_RESUME_SESSION_ID",k="ARIA_RESUME_ARION",o="ARIA_RESTART_KIND";function H(){let _=process.env.ARIA_HOME?.trim();if(_)return _;return J(B(),".aria")}function U(){return J(H(),"relaunch-pending")}function K(_=process.pid){return J(U(),`${_}.json`)}function t(_){try{let p=K(_.pid);x(F(p),{recursive:!0}),T(p,JSON.stringify(_),"utf-8")}catch{}}function d(_=process.pid){try{let p=K(_);if(!Y(p))return null;let G=I(p,"utf-8");return JSON.parse(G)}catch{return null}}function g(_=process.pid){try{let p=K(_);if(Y(p))O(p)}catch{}}function Z(){return globalThis}function i(_){let p=Z();p.__aria_stall_phase=_,p.__aria_stall_phase_ts=performance.now()}function a(){let _=Z();_.__aria_stall_phase=void 0,_.__aria_stall_phase_ts=void 0}var Q={debug:0,info:1,warn:2,error:3,silent:4};function j(){let _=typeof process<"u"?process.env.ARIA_LOG_LEVEL:void 0;if(_&&_ in Q)return _;return"info"}var X=j();function z(_){return Q[_]>=Q[X]}function M(_){if(!_||typeof _!=="object")return!1;let p=_;return p.code==="EPIPE"||p.code==="ERR_STREAM_DESTROYED"}function V(_,p){try{_(...p)}catch(G){if(M(G))return;throw G}}function A(_){if(_.length===0)return _;let[p,...G]=_;if(typeof p!=="string")return _;if(!p.startsWith("["))return _;return[`\x1B[2m\x1B[90m${p}\x1B[0m`,...G]}function f(_){if(_.length===0)return _;let[p,...G]=_;if(typeof p!=="string")return _;if(!p.startsWith("["))return _;return[`\x1B[36m${p}\x1B[0m`,...G]}var $={write(_,p){let G,q;switch(_){case"debug":G=A(p),q=console.debug;break;case"info":G=f(p),q=console.info;break;case"warn":G=p,q=console.warn;break;default:G=p,q=console.error;break}V(q,G)}},W=[$],u={debug(..._){if(z("debug"))for(let p of W)p.write("debug",_)},info(..._){if(z("info"))for(let p of W)p.write("info",_)},warn(..._){if(z("warn"))for(let p of W)p.write("warn",_)},error(..._){if(z("error"))for(let p of W)p.write("error",_)},setLevel(_){X=_},getLevel(){return X},addSink(_){W.push(_)},removeSink(_){let p=W.indexOf(_);if(p>=0)W.splice(p,1)},removeConsoleSink(){let _=W.indexOf($);if(_>=0)W.splice(_,1)}};export{t as writeRelaunchMarker,i as setGlobalStallPhase,d as readRelaunchMarker,u as log,D as isNodeError,N as isNativeToolSchema,b as isNativeTool,P as isFunctionToolSchema,R as isFunctionTool,K as getRelaunchMarkerPath,U as getRelaunchMarkerDir,C as getErrorStatusCode,w as getErrorMessage,g as clearRelaunchMarker,a as clearGlobalStallPhase,l as RESUME_SESSION_ENV,k as RESUME_ARION_ENV,o as RESTART_KIND_ENV,m as RELAUNCH_EXIT_CODE,v as NO_RELAUNCH_ENV};
package/dist-cjs/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";var d=(e,n)=>()=>(n||e((n={exports:{}}).exports,n),n.exports),v=d(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isFunctionToolSchema=n,e.isNativeToolSchema=u;function n(i){return i.kind==="function"}function u(i){return i.kind==="native"}}),h=d(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})}),O=d(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getErrorMessage=n,e.getErrorStatusCode=u,e.isNodeError=i;function n(t){return t instanceof Error?t.message:typeof t=="string"?t:String(t)}function u(t){if(typeof t=="object"&&t!==null&&"statusCode"in t&&typeof t.statusCode=="number")return t.statusCode}function i(t){return t instanceof Error&&"code"in t&&typeof t.code=="string"}}),y=d(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isFunctionTool=n,e.isNativeTool=u;function n(i){return!u(i)}function u(i){return["brave_search","computer","code_interpreter","text_editor","bash","dalle","file_search"].some(t=>i.name.startsWith(t))}}),N=d(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RESTART_KIND_ENV=e.RESUME_ARION_ENV=e.RESUME_SESSION_ENV=e.NO_RELAUNCH_ENV=e.RELAUNCH_EXIT_CODE=void 0,e.getRelaunchMarkerDir=_,e.getRelaunchMarkerPath=f,e.writeRelaunchMarker=p,e.readRelaunchMarker=b,e.clearRelaunchMarker=g;var n=require("node:fs"),u=require("node:os"),i=require("node:path");e.RELAUNCH_EXIT_CODE=199,e.NO_RELAUNCH_ENV="ARIA_NO_RELAUNCH",e.RESUME_SESSION_ENV="ARIA_RESUME_SESSION_ID",e.RESUME_ARION_ENV="ARIA_RESUME_ARION",e.RESTART_KIND_ENV="ARIA_RESTART_KIND";function t(){return process.env.ARIA_HOME?.trim()||(0,i.join)((0,u.homedir)(),".aria")}function _(){return(0,i.join)(t(),"relaunch-pending")}function f(a=process.pid){return(0,i.join)(_(),`${a}.json`)}function p(a){try{let c=f(a.pid);(0,n.mkdirSync)((0,i.dirname)(c),{recursive:!0}),(0,n.writeFileSync)(c,JSON.stringify(a),"utf-8")}catch{}}function b(a=process.pid){try{let c=f(a);if(!(0,n.existsSync)(c))return null;let R=(0,n.readFileSync)(c,"utf-8");return JSON.parse(R)}catch{return null}}function g(a=process.pid){try{let c=f(a);(0,n.existsSync)(c)&&(0,n.unlinkSync)(c)}catch{}}}),A=d(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setGlobalStallPhase=u,e.clearGlobalStallPhase=i;function n(){return globalThis}function u(t){let _=n();_.__aria_stall_phase=t,_.__aria_stall_phase_ts=performance.now()}function i(){let t=n();t.__aria_stall_phase=void 0,t.__aria_stall_phase_ts=void 0}}),M=d(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.log=void 0;var n="\x1B[2m\x1B[90m",u="\x1B[36m",i="\x1B[0m",t={debug:0,info:1,warn:2,error:3,silent:4};function _(){let r=typeof process<"u"?process.env.ARIA_LOG_LEVEL:void 0;return r&&r in t?r:"info"}var f=_();function p(r){return t[r]>=t[f]}function b(r){if(!r||typeof r!="object")return!1;let o=r;return o.code==="EPIPE"||o.code==="ERR_STREAM_DESTROYED"}function g(r,o){try{r(...o)}catch(s){if(b(s))return;throw s}}function a(r){if(r.length===0)return r;let[o,...s]=r;return typeof o!="string"||!o.startsWith("[")?r:[`${n}${o}${i}`,...s]}function c(r){if(r.length===0)return r;let[o,...s]=r;return typeof o!="string"||!o.startsWith("[")?r:[`${u}${o}${i}`,...s]}var R={write(r,o){let s,S;switch(r){case"debug":s=a(o),S=console.debug;break;case"info":s=c(o),S=console.info;break;case"warn":s=o,S=console.warn;break;default:s=o,S=console.error;break}g(S,s)}},l=[R];e.log={debug(...r){if(p("debug"))for(let o of l)o.write("debug",r)},info(...r){if(p("info"))for(let o of l)o.write("info",r)},warn(...r){if(p("warn"))for(let o of l)o.write("warn",r)},error(...r){if(p("error"))for(let o of l)o.write("error",r)},setLevel(r){f=r},getLevel(){return f},addSink(r){l.push(r)},removeSink(r){let o=l.indexOf(r);o>=0&&l.splice(o,1)},removeConsoleSink(){let r=l.indexOf(R);r>=0&&l.splice(r,1)}}}),m=exports&&exports.__createBinding||(Object.create?(function(e,n,u,i){i===void 0&&(i=u);var t=Object.getOwnPropertyDescriptor(n,u);(!t||("get"in t?!n.__esModule:t.writable||t.configurable))&&(t={enumerable:!0,get:function(){return n[u]}}),Object.defineProperty(e,i,t)}):(function(e,n,u,i){i===void 0&&(i=u),e[i]=n[u]})),E=exports&&exports.__exportStar||function(e,n){for(var u in e)u!=="default"&&!Object.prototype.hasOwnProperty.call(n,u)&&m(n,e,u)};Object.defineProperty(exports,"__esModule",{value:!0});exports.log=void 0;E(v(),exports);E(h(),exports);E(O(),exports);E(y(),exports);E(N(),exports);E(A(),exports);var j=M();Object.defineProperty(exports,"log",{enumerable:!0,get:function(){return j.log}});
1
+ var{defineProperty:X,getOwnPropertyNames:F,getOwnPropertyDescriptor:H}=Object,U=Object.prototype.hasOwnProperty;function j(_){return this[_]}var M=(_)=>{var p=($??=new WeakMap).get(_),G;if(p)return p;if(p=X({},"__esModule",{value:!0}),_&&typeof _==="object"||typeof _==="function"){for(var q of F(_))if(!U.call(p,q))X(p,q,{get:j.bind(_,q),enumerable:!(G=H(_,q))||G.enumerable})}return $.set(_,p),p},$;var V=(_)=>_;function A(_,p){this[_]=V.bind(null,p)}var f=(_,p)=>{for(var G in p)X(_,G,{get:p[G],enumerable:!0,configurable:!0,set:A.bind(p,G)})};var i={};f(i,{writeRelaunchMarker:()=>c,setGlobalStallPhase:()=>l,readRelaunchMarker:()=>m,log:()=>B,isNodeError:()=>w,isNativeToolSchema:()=>P,isNativeTool:()=>b,isFunctionToolSchema:()=>u,isFunctionTool:()=>C,getRelaunchMarkerPath:()=>K,getRelaunchMarkerDir:()=>I,getErrorStatusCode:()=>S,getErrorMessage:()=>N,clearRelaunchMarker:()=>v,clearGlobalStallPhase:()=>k,RESUME_SESSION_ENV:()=>R,RESUME_ARION_ENV:()=>E,RESTART_KIND_ENV:()=>y,RELAUNCH_EXIT_CODE:()=>D,NO_RELAUNCH_ENV:()=>L});module.exports=M(i);function u(_){return _.kind==="function"}function P(_){return _.kind==="native"}function N(_){if(_ instanceof Error)return _.message;if(typeof _==="string")return _;return String(_)}function S(_){if(typeof _==="object"&&_!==null&&"statusCode"in _&&typeof _.statusCode==="number")return _.statusCode;return}function w(_){return _ instanceof Error&&"code"in _&&typeof _.code==="string"}function C(_){return!b(_)}function b(_){return["brave_search","computer","code_interpreter","text_editor","bash","dalle","file_search"].some((G)=>_.name.startsWith(G))}var W=require("node:fs"),x=require("node:os"),J=require("node:path"),D=199,L="ARIA_NO_RELAUNCH",R="ARIA_RESUME_SESSION_ID",E="ARIA_RESUME_ARION",y="ARIA_RESTART_KIND";function h(){let _=process.env.ARIA_HOME?.trim();if(_)return _;return J.join(x.homedir(),".aria")}function I(){return J.join(h(),"relaunch-pending")}function K(_=process.pid){return J.join(I(),`${_}.json`)}function c(_){try{let p=K(_.pid);W.mkdirSync(J.dirname(p),{recursive:!0}),W.writeFileSync(p,JSON.stringify(_),"utf-8")}catch{}}function m(_=process.pid){try{let p=K(_);if(!W.existsSync(p))return null;let G=W.readFileSync(p,"utf-8");return JSON.parse(G)}catch{return null}}function v(_=process.pid){try{let p=K(_);if(W.existsSync(p))W.unlinkSync(p)}catch{}}function O(){return globalThis}function l(_){let p=O();p.__aria_stall_phase=_,p.__aria_stall_phase_ts=performance.now()}function k(){let _=O();_.__aria_stall_phase=void 0,_.__aria_stall_phase_ts=void 0}var Y={debug:0,info:1,warn:2,error:3,silent:4};function o(){let _=typeof process<"u"?process.env.ARIA_LOG_LEVEL:void 0;if(_&&_ in Y)return _;return"info"}var Z=o();function Q(_){return Y[_]>=Y[Z]}function t(_){if(!_||typeof _!=="object")return!1;let p=_;return p.code==="EPIPE"||p.code==="ERR_STREAM_DESTROYED"}function d(_,p){try{_(...p)}catch(G){if(t(G))return;throw G}}function g(_){if(_.length===0)return _;let[p,...G]=_;if(typeof p!=="string")return _;if(!p.startsWith("["))return _;return[`\x1B[2m\x1B[90m${p}\x1B[0m`,...G]}function n(_){if(_.length===0)return _;let[p,...G]=_;if(typeof p!=="string")return _;if(!p.startsWith("["))return _;return[`\x1B[36m${p}\x1B[0m`,...G]}var T={write(_,p){let G,q;switch(_){case"debug":G=g(p),q=console.debug;break;case"info":G=n(p),q=console.info;break;case"warn":G=p,q=console.warn;break;default:G=p,q=console.error;break}d(q,G)}},z=[T],B={debug(..._){if(Q("debug"))for(let p of z)p.write("debug",_)},info(..._){if(Q("info"))for(let p of z)p.write("info",_)},warn(..._){if(Q("warn"))for(let p of z)p.write("warn",_)},error(..._){if(Q("error"))for(let p of z)p.write("error",_)},setLevel(_){Z=_},getLevel(){return Z},addSink(_){z.push(_)},removeSink(_){let p=z.indexOf(_);if(p>=0)z.splice(p,1)},removeConsoleSink(){let _=z.indexOf(T);if(_>=0)z.splice(_,1)}};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aria-cli/types",
3
- "version": "1.0.14",
3
+ "version": "1.0.17",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -11,6 +11,10 @@
11
11
  "require": "./dist-cjs/index.js"
12
12
  }
13
13
  },
14
+ "scripts": {
15
+ "test": "vitest run --config vitest.config.ts",
16
+ "dev": "tsc --watch"
17
+ },
14
18
  "devDependencies": {
15
19
  "typescript": "^5.9.3",
16
20
  "vitest": "^4.0.18"
@@ -21,8 +25,7 @@
21
25
  "!**/*.map",
22
26
  "!**/*.tsbuildinfo"
23
27
  ],
24
- "scripts": {
25
- "test": "vitest run --config vitest.config.ts",
26
- "dev": "tsc --watch"
28
+ "engines": {
29
+ "node": ">=20.0.0"
27
30
  }
28
- }
31
+ }