@eventmodelers/cli 1.0.158 → 1.0.159
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
CHANGED
|
@@ -697,6 +697,7 @@ Every config field can be set via an `EVENTMODELERS_*` env var instead of the in
|
|
|
697
697
|
| `EVENTMODELERS_MODEL` | `model` |
|
|
698
698
|
| `EVENTMODELERS_SUBAGENT_MODEL` | `subagentModel` |
|
|
699
699
|
| `EVENTMODELERS_AGENT_NAME` | `agentName` |
|
|
700
|
+
| `EVENTMODELERS_POCKETBASE_URL` | `pocketbaseUrl` — on-prem only: overrides the PocketBase address the server advertises via `/api/config` (e.g. `/pb` or `https://host/pb`; a leading `/` is resolved against the base URL, replacing any path on it). Also read from `config.json`; either one beats the server's value |
|
|
700
701
|
|
|
701
702
|
```bash
|
|
702
703
|
EVENTMODELERS_ORGANIZATION_ID=... EVENTMODELERS_BOARD_ID=... EVENTMODELERS_TOKEN=... \
|
package/cli.js
CHANGED
|
@@ -437,6 +437,7 @@ const ENV_CONFIG_MAP = {
|
|
|
437
437
|
EVENTMODELERS_MODEL: 'model',
|
|
438
438
|
EVENTMODELERS_SUBAGENT_MODEL: 'subagentModel',
|
|
439
439
|
EVENTMODELERS_AGENT_NAME: 'agentName',
|
|
440
|
+
EVENTMODELERS_POCKETBASE_URL: 'pocketbaseUrl',
|
|
440
441
|
};
|
|
441
442
|
|
|
442
443
|
function applyEnvOverrides(config) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eventmodelers/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.159",
|
|
4
4
|
"description": "Eventmodelers CLI — real-time Claude agent + skills for Claude Code, for any stack (Node, Supabase, Axon, OpenCQRS, UmaDB, Kurrent, or modeling-only)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -16,12 +16,20 @@ const REALTIME_EVENTS_COLLECTION = 'realtime_events';
|
|
|
16
16
|
// ourselves.
|
|
17
17
|
const RECONNECT_INTERVALS_MS = [200, 300, 500, 1000, 1200, 1500, 2000];
|
|
18
18
|
|
|
19
|
+
// A path like "/pb" (client-side override) is resolved against the platform's base URL,
|
|
20
|
+
// so it replaces any path on it: https://host/api + /pb -> https://host/pb.
|
|
21
|
+
function resolvePocketBaseUrl({ pocketbaseUrl, baseUrl }) {
|
|
22
|
+
if (!pocketbaseUrl?.startsWith('/')) return pocketbaseUrl;
|
|
23
|
+
if (!baseUrl) throw new Error(`pocketbaseUrl "${pocketbaseUrl}" is a path but no baseUrl is configured to resolve it against`);
|
|
24
|
+
return new URL(pocketbaseUrl, baseUrl).href.replace(/\/+$/, '');
|
|
25
|
+
}
|
|
26
|
+
|
|
19
27
|
// deps.PocketBase is injectable for tests; by default it is the pocketbase SDK's client.
|
|
20
28
|
export async function createPocketBaseRealtimeAdapter(cfg, initialToken, deps = {}) {
|
|
21
29
|
const { EventSource } = await import('eventsource');
|
|
22
30
|
if (!globalThis.EventSource) globalThis.EventSource = EventSource; // PocketBase's SDK assumes a browser-style global
|
|
23
31
|
const PocketBase = deps.PocketBase ?? (await import('pocketbase')).default;
|
|
24
|
-
const pb = new PocketBase(cfg
|
|
32
|
+
const pb = new PocketBase(resolvePocketBaseUrl(cfg));
|
|
25
33
|
pb.authStore.save(initialToken, null);
|
|
26
34
|
|
|
27
35
|
// The SDK adds one EventSource listener per subscribe() call — and keeps it when the call
|
|
@@ -99,6 +99,7 @@ const ENV_CONFIG_MAP = {
|
|
|
99
99
|
EVENTMODELERS_MODEL: 'model',
|
|
100
100
|
EVENTMODELERS_SUBAGENT_MODEL: 'subagentModel',
|
|
101
101
|
EVENTMODELERS_AGENT_NAME: 'agentName',
|
|
102
|
+
EVENTMODELERS_POCKETBASE_URL: 'pocketbaseUrl',
|
|
102
103
|
};
|
|
103
104
|
|
|
104
105
|
function loadLocalConfig(kitDir) {
|
|
@@ -199,7 +200,10 @@ async function fetchPlatformConfig(local) {
|
|
|
199
200
|
const remote = await fetchJSON(`${local.baseUrl}/api/config`, {
|
|
200
201
|
headers: { 'x-token': local.token, ...agentHeaders(local) },
|
|
201
202
|
});
|
|
202
|
-
|
|
203
|
+
// A client-side pocketbaseUrl (EVENTMODELERS_POCKETBASE_URL / config.json) beats the server's:
|
|
204
|
+
// on-prem the server may advertise its internal docker address (http://pocketbase:8090) that a
|
|
205
|
+
// remote agent cannot reach.
|
|
206
|
+
return { ...local, ...remote, ...(local.pocketbaseUrl ? { pocketbaseUrl: local.pocketbaseUrl } : {}) };
|
|
203
207
|
}
|
|
204
208
|
|
|
205
209
|
// ── Realtime agent ────────────────────────────────────────────────────────────
|