@aria_asi/cli 0.2.7 → 0.2.8

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.
@@ -121,30 +121,55 @@ function buildUrlList() {
121
121
  const list = [];
122
122
  const cached = loadCachedUrl();
123
123
  if (cached) list.push(cached);
124
+ // Explicit override takes priority — owner mode sets ARIA_SOUL_URL or
125
+ // ARIA_HARNESS_URL/ARIA_HARNESS_BASE_URL to a local cluster path.
124
126
  if (process.env.ARIA_SOUL_URL) list.push(process.env.ARIA_SOUL_URL.replace(/\/+$/, ''));
125
- list.push('http://localhost:30080', 'http://127.0.0.1:30080');
126
- list.push('http://aria-soul.aria.svc.cluster.local:8080');
127
- // Direct ClusterIP from kubectl
128
- try {
129
- const r = spawnSync('kubectl', [
130
- 'get', 'svc', '-n', 'aria', 'aria-soul',
131
- '-o', 'jsonpath={.spec.clusterIP}',
132
- ], { encoding: 'utf8', timeout: 3_000 });
133
- if (r.status === 0 && r.stdout && r.stdout !== 'None') {
134
- list.push(`http://${r.stdout.trim()}:8080`);
135
- }
136
- } catch {}
127
+ if (process.env.ARIA_HARNESS_URL) list.push(process.env.ARIA_HARNESS_URL.replace(/\/+$/, ''));
128
+ if (process.env.ARIA_HARNESS_BASE_URL) list.push(process.env.ARIA_HARNESS_BASE_URL.replace(/\/+$/, ''));
129
+ // Public default what every client install uses. Cloudflare tunnel routes
130
+ // to aria-soul-stateful inside the cluster. This must be FIRST in the
131
+ // public-facing path so client installs don't waste 1–2s timing out on
132
+ // localhost/127.0.0.1 before reaching anything real.
133
+ list.push('https://harness.ariasos.com');
137
134
  if (process.env.ARIA_PUBLIC_URL) list.push(process.env.ARIA_PUBLIC_URL.replace(/\/+$/, ''));
135
+ // Owner-mode fallbacks — only attempted when explicitly enabled, so client
136
+ // machines never burn time trying to reach Hamza's LAN. ARIA_OWNER_MODE=true
137
+ // is set in the dev box shell.
138
+ if ((process.env.ARIA_OWNER_MODE || '').toLowerCase() === 'true') {
139
+ list.push('http://localhost:30080', 'http://127.0.0.1:30080');
140
+ list.push('http://aria-soul.aria.svc.cluster.local:8080');
141
+ // Direct ClusterIP from kubectl — only relevant for in-cluster/owner runs.
142
+ try {
143
+ const r = spawnSync('kubectl', [
144
+ 'get', 'svc', '-n', 'aria', 'aria-soul',
145
+ '-o', 'jsonpath={.spec.clusterIP}',
146
+ ], { encoding: 'utf8', timeout: 3_000 });
147
+ if (r.status === 0 && r.stdout && r.stdout !== 'None') {
148
+ list.push(`http://${r.stdout.trim()}:8080`);
149
+ }
150
+ } catch {}
151
+ }
138
152
  // Dedup preserving order
139
153
  const seen = new Set();
140
154
  return list.filter((u) => (seen.has(u) ? false : (seen.add(u), true)));
141
155
  }
142
156
 
143
157
  async function tryViaSdk(baseUrl, apiKey) {
144
- // Dynamic import of the canonical SDK. The SDK is at a fixed path in the
145
- // monorepo; resolve absolute so the hook works from any cwd.
146
- const sdkPath = '/home/hamzaibrahim1/rei-ai-brain/harness/packages/harness-http-client/dist/index.js';
147
- const { HTTPHarnessClient } = await import(sdkPath);
158
+ // Owner-mode dynamic import of the canonical SDK from the monorepo. Client
159
+ // installs do not have this path they fall through to the raw-fetch path
160
+ // below (same network call, identical body shape). Prior code hard-coded the
161
+ // owner-only path and crashed on every client turn.
162
+ const ownerSdkPath = process.env.ARIA_HARNESS_SDK_PATH ||
163
+ '/home/hamzaibrahim1/rei-ai-brain/harness/packages/harness-http-client/dist/index.js';
164
+ let HTTPHarnessClient = null;
165
+ try {
166
+ ({ HTTPHarnessClient } = await import(ownerSdkPath));
167
+ } catch {
168
+ // SDK unavailable (the common case for client installs) — caller should
169
+ // catch this and fall through to the raw-fetch path. We surface a typed
170
+ // error instead of import-rejection noise so the caller can branch cleanly.
171
+ throw new Error('SDK_UNAVAILABLE');
172
+ }
148
173
  HTTPHarnessClient.resetInstance();
149
174
  const client = HTTPHarnessClient.getInstance({
150
175
  baseUrl,
@@ -45,8 +45,18 @@ import { dirname } from 'node:path';
45
45
  const HOME = process.env.HOME || '/tmp';
46
46
  const LOG = `${HOME}/.claude/aria-preprompt-consult.log`;
47
47
 
48
- const HARNESS_URL = process.env.ARIA_HARNESS_URL || 'http://192.168.4.25:30080';
49
- const HARNESS_TOKEN = process.env.ARIA_HARNESS_TOKEN || '30b18f0a302b03ae862de8a75021238d23e47464fd5d8f6a9324240933745587';
48
+ // Default to the public harness; client installs route to harness.ariasos.com.
49
+ // Owner mode (Hamza dev box): set ARIA_HARNESS_URL=http://localhost:30080 in shell.
50
+ const HARNESS_URL =
51
+ process.env.ARIA_HARNESS_URL ||
52
+ process.env.ARIA_HARNESS_BASE_URL ||
53
+ 'https://harness.ariasos.com';
54
+ // NEVER bake a default token. Client installs must inject their own license token
55
+ // via ARIA_HARNESS_TOKEN (set by the connector after onboarding self-issue). If
56
+ // absent we send no Authorization header — the server can decide whether to
57
+ // allow anonymous preprompt consults or skip them. Prior code defaulted to the
58
+ // master token, leaking Hamza's master credential into every npm install.
59
+ const HARNESS_TOKEN = process.env.ARIA_HARNESS_TOKEN || '';
50
60
  const MIN_PROMPT_CHARS = 40; // skip auto-consult on trivial prompts
51
61
  const MAX_DIRECTION_CHARS = 4000; // cap injected chunk size
52
62
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aria_asi/cli",
3
- "version": "0.2.7",
3
+ "version": "0.2.8",
4
4
  "description": "Aria Smart CLI — the world's first harness-powered terminal companion",
5
5
  "bin": {
6
6
  "aria": "./bin/aria.js"