@loxtep/sdk 0.7.6 → 0.7.9
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/CHANGELOG.md +24 -0
- package/README.md +27 -31
- package/dist/auth/browser-login.d.ts +6 -0
- package/dist/auth/browser-login.d.ts.map +1 -1
- package/dist/auth/browser-login.js +54 -26
- package/dist/auth/browser-login.js.map +1 -1
- package/dist/cli/help.d.ts +1 -1
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/help.js +13 -15
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/cli/version.d.ts.map +1 -1
- package/dist/cli/version.js +1 -6
- package/dist/cli/version.js.map +1 -1
- package/docs/getting-started.md +0 -1
- package/docs/quick-reference.md +3 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,30 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
|
6
6
|
and this project adheres to
|
|
7
7
|
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
8
8
|
|
|
9
|
+
## [0.7.9] - 2026-07-23
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
- **Browser login** no longer hangs after printing success: the localhost callback
|
|
14
|
+
server now destroys keep-alive connections and closes immediately so the CLI
|
|
15
|
+
process exits as soon as tokens are saved.
|
|
16
|
+
|
|
17
|
+
## [0.7.8] - 2026-07-23
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
|
|
21
|
+
- **README and quick reference** use customer-facing API area names instead of
|
|
22
|
+
internal MCP facade terminology (`loxtep_session`, "MCP-aligned facades", etc.).
|
|
23
|
+
SDK paths (`client.build`, …) are unchanged.
|
|
24
|
+
|
|
25
|
+
## [0.7.7] - 2026-07-23
|
|
26
|
+
|
|
27
|
+
### Changed
|
|
28
|
+
|
|
29
|
+
- **CLI help** no longer exposes internal MCP facade names (`loxtep_session`,
|
|
30
|
+
`client.build`, etc.). Commands are grouped under customer-facing headings
|
|
31
|
+
(Authentication, Workspace, Build & deploy, Governance, …).
|
|
32
|
+
|
|
9
33
|
## [0.7.6] - 2026-07-23
|
|
10
34
|
|
|
11
35
|
### Added
|
package/README.md
CHANGED
|
@@ -1,27 +1,26 @@
|
|
|
1
1
|
# Loxtep Node.js SDK
|
|
2
2
|
|
|
3
|
-
Client for the Loxtep API. Since **v0.7.0**,
|
|
4
|
-
**
|
|
3
|
+
Client for the Loxtep API. Since **v0.7.0**, `LoxtepClient` groups APIs under
|
|
4
|
+
**namespaced areas** on the client (no flat top-level namespaces like
|
|
5
5
|
`client.workflows` or `client.data_products`).
|
|
6
6
|
|
|
7
|
-
|
|
|
7
|
+
| Area | SDK namespace | Examples |
|
|
8
8
|
| --- | --- | --- |
|
|
9
|
-
|
|
|
10
|
-
|
|
|
11
|
-
|
|
|
12
|
-
|
|
|
13
|
-
|
|
|
14
|
-
|
|
|
15
|
-
|
|
|
16
|
-
|
|
|
17
|
-
|
|
|
18
|
-
|
|
|
19
|
-
|
|
20
|
-
**Stream I/O** uses top-level helpers
|
|
9
|
+
| Authentication | `client.session` | `get_current_user()` |
|
|
10
|
+
| Connect | `client.connect` | `.connectors.*`, `.templates.*` |
|
|
11
|
+
| Workspace | `client.workspace` | `.projects.*`, `.instances.*` |
|
|
12
|
+
| Build & deploy | `client.build` | `.workflows.*`, `.triggers.*`, `.data_products.*`, `.targets.*` |
|
|
13
|
+
| Governance | `client.define` | `.schemas.*`, `.quality.*`, `.domains.*`, … |
|
|
14
|
+
| Semantics | `client.meaning` | `.thesaurus.*` |
|
|
15
|
+
| Review | `client.review` | `.approvals.*`, `.improvements.*` |
|
|
16
|
+
| Analytics | `client.query` | `.catalog.*`, `.discovery.*`, `.query()` |
|
|
17
|
+
| Observe | `client.observe` | `.stream_config()`, `.open_reader()` |
|
|
18
|
+
| Context | `client.context` | `.procedures.*`, `.activity.*`, … |
|
|
19
|
+
|
|
20
|
+
**Stream I/O** uses top-level helpers on the client:
|
|
21
21
|
`await client.get_writer('data-product-name')` and
|
|
22
22
|
`await client.get_reader('data-product-name')`.
|
|
23
23
|
|
|
24
|
-
Full mapping table: [`docs/sdk-mcp-mapping.md`](./docs/sdk-mcp-mapping.md).
|
|
25
24
|
**Upgrading from 0.6.x:** replace `client.data_products` →
|
|
26
25
|
`client.build.data_products` (CRUD/stream/replay) or `client.get_writer` /
|
|
27
26
|
`client.get_reader` (recommended write/read path); `client.workflows` →
|
|
@@ -163,18 +162,18 @@ See `loxtep init --help`, `loxtep attach --help`, etc. for all flags. The full C
|
|
|
163
162
|
|
|
164
163
|
## API surface
|
|
165
164
|
|
|
166
|
-
Every method is `snake_case`.
|
|
167
|
-
`LoxtepClient` (see table at the top). Nested APIs
|
|
168
|
-
(`workflows`, `data_products`, `connectors`, …) under
|
|
165
|
+
Every method is `snake_case`. APIs live on **namespaced areas** of
|
|
166
|
+
`LoxtepClient` (see table at the top). Nested APIs use descriptive names
|
|
167
|
+
(`workflows`, `data_products`, `connectors`, …) under each area.
|
|
169
168
|
|
|
170
169
|
### Top-level stream I/O (preferred)
|
|
171
170
|
|
|
172
171
|
- **`get_writer(name_or_id)`** — write path; resolves queue, bot, stream config
|
|
173
172
|
- **`get_reader(name_or_id)`** — async iterable read path
|
|
174
173
|
- **`LoxtepClient.fromWorkspace()`** — construct from `.loxtep/project.json` +
|
|
175
|
-
|
|
174
|
+
`./.loxtep/credentials.json` (env overrides: `LOXTEP_API_URL`, `LOXTEP_TOKEN`, …)
|
|
176
175
|
|
|
177
|
-
### `client.build`
|
|
176
|
+
### Build & deploy (`client.build`)
|
|
178
177
|
|
|
179
178
|
- **`.workflows`** — `list`, `get`, `create`, `get_graph`, `deploy`; low-level
|
|
180
179
|
`.get_writer(workflow_id, { bot_id, … })` escape hatch
|
|
@@ -184,30 +183,30 @@ Every method is `snake_case`. Use the **10 MCP-aligned facades** on
|
|
|
184
183
|
`client.get_writer` / `get_reader`)
|
|
185
184
|
- **`.targets`** — delivery sink bindings (`list`, `get`, `create`, `update`, `delete`)
|
|
186
185
|
|
|
187
|
-
### `client.connect`
|
|
186
|
+
### Connect (`client.connect`)
|
|
188
187
|
|
|
189
188
|
- **`.connectors`** — org-level connector credentials
|
|
190
189
|
- **`.templates`** — starter templates (`list`, `get`, `apply_template` on projects)
|
|
191
190
|
|
|
192
|
-
### `client.workspace`
|
|
191
|
+
### Workspace (`client.workspace`)
|
|
193
192
|
|
|
194
193
|
- **`.projects`** — `list`, `get`, `create`, `update`, `delete`, `apply_template`
|
|
195
194
|
- **`.instances`** — `list`, `get`, stream config helpers
|
|
196
195
|
|
|
197
|
-
### `client.define`
|
|
196
|
+
### Governance (`client.define`)
|
|
198
197
|
|
|
199
198
|
- **`.schemas`**, **`.quality`**, **`.standards`**, **`.data_contracts`**, **`.domains`**
|
|
200
199
|
|
|
201
|
-
### `client.query`
|
|
200
|
+
### Analytics (`client.query`)
|
|
202
201
|
|
|
203
202
|
- **`.catalog`**, **`.discovery`**, **`.query()`**, **`.list_tables()`**, **`.search()`**
|
|
204
203
|
|
|
205
|
-
### `client.observe`
|
|
204
|
+
### Observe (`client.observe`)
|
|
206
205
|
|
|
207
206
|
- **`status()`**, **`stream_config()`**, **`open_reader()`**, **`open_writer()`**,
|
|
208
207
|
**`get_queue_metadata()`**, **`get_reader_checkpoint()`**
|
|
209
208
|
|
|
210
|
-
###
|
|
209
|
+
### Authentication, semantics, review, and context
|
|
211
210
|
|
|
212
211
|
- **`client.session`** — `get_current_user`, `get_current_organization`, `logout`
|
|
213
212
|
- **`client.meaning`** — `.thesaurus.*`
|
|
@@ -215,8 +214,6 @@ Every method is `snake_case`. Use the **10 MCP-aligned facades** on
|
|
|
215
214
|
- **`client.context`** — `.procedures.*`, `.activity.*`, `.process_intelligence.*`
|
|
216
215
|
- **`client.metrics`** — `log`, `get_reporter` (stub until metrics wiring lands)
|
|
217
216
|
|
|
218
|
-
See [`docs/sdk-mcp-mapping.md`](./docs/sdk-mcp-mapping.md) for the full MCP ↔ SDK table.
|
|
219
|
-
|
|
220
217
|
## Data product writer and reader
|
|
221
218
|
|
|
222
219
|
`await client.get_writer('name')` resolves the data product's queue, bot
|
|
@@ -304,8 +301,7 @@ await client.build.targets.delete('dp_abc123', webhook.consumption_id);
|
|
|
304
301
|
- **[Code-first CLI](./docs/code-first-cli.md)** – `loxtep init`, attach, generate, test, deploy.
|
|
305
302
|
- **[Quick reference](./docs/quick-reference.md)** – Single-page cheat sheet.
|
|
306
303
|
- **[Event replay cookbook](./docs/event-replay-cookbook.md)** – Replay events from a data product or queue.
|
|
307
|
-
- **[
|
|
308
|
-
- **[MCP → SDK mapping](./docs/sdk-mcp-mapping.md)** – Agent-oriented table.
|
|
304
|
+
- **[SDK + agent pairing](./docs/sdk-pairing.md)** – When to use the SDK vs IDE agent integrations.
|
|
309
305
|
- **Typed errors** – `import { … } from '@loxtep/sdk/errors'`.
|
|
310
306
|
- **API reference** – `pnpm run docs` (Typedoc).
|
|
311
307
|
|
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
* 4. App redirects to our localhost callback with access_token + refresh_token
|
|
13
13
|
* 5. Return tokens to caller, shut down server
|
|
14
14
|
*/
|
|
15
|
+
import { type Server } from 'node:http';
|
|
16
|
+
import type { Socket } from 'node:net';
|
|
15
17
|
export interface BrowserLoginOptions {
|
|
16
18
|
/** Loxtep app URL (e.g. https://app.loxtep.io or https://appdev.loxtep.io). */
|
|
17
19
|
app_url: string;
|
|
@@ -21,6 +23,8 @@ export interface BrowserLoginOptions {
|
|
|
21
23
|
timeout_ms?: number;
|
|
22
24
|
/** If true, don't auto-open the browser — just print the URL. */
|
|
23
25
|
no_open?: boolean;
|
|
26
|
+
/** For tests: invoked once the callback server is listening (with bound port). */
|
|
27
|
+
on_listening?: (port: number) => void;
|
|
24
28
|
}
|
|
25
29
|
export interface BrowserLoginResult {
|
|
26
30
|
access_token: string;
|
|
@@ -33,6 +37,8 @@ export interface BrowserLoginResult {
|
|
|
33
37
|
expiration: string;
|
|
34
38
|
};
|
|
35
39
|
}
|
|
40
|
+
/** Force-close keep-alive sockets so the CLI process can exit immediately. */
|
|
41
|
+
export declare function shutdownCallbackServer(server: Server, sockets: Set<Socket>): void;
|
|
36
42
|
/**
|
|
37
43
|
* Run the browser-based OAuth login flow.
|
|
38
44
|
* Returns tokens on success, throws on timeout or failure.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-login.d.ts","sourceRoot":"","sources":["../../src/auth/browser-login.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;
|
|
1
|
+
{"version":3,"file":"browser-login.d.ts","sourceRoot":"","sources":["../../src/auth/browser-login.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAsC,KAAK,MAAM,EAAuB,MAAM,WAAW,CAAC;AACjG,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAKvC,MAAM,WAAW,mBAAmB;IAClC,+EAA+E;IAC/E,OAAO,EAAE,MAAM,CAAC;IAChB,0EAA0E;IAC1E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,8EAA8E;IAC9E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iEAAiE;IACjE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,kFAAkF;IAClF,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC;AAED,MAAM,WAAW,kBAAkB;IACjC,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE;QAChB,aAAa,EAAE,MAAM,CAAC;QACtB,iBAAiB,EAAE,MAAM,CAAC;QAC1B,aAAa,EAAE,MAAM,CAAC;QACtB,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;CACH;AAID,8EAA8E;AAC9E,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI,CASjF;AAmBD;;;GAGG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAyGtF"}
|
|
@@ -16,31 +16,65 @@ import { createServer } from 'node:http';
|
|
|
16
16
|
import { URL } from 'node:url';
|
|
17
17
|
import { exec } from 'node:child_process';
|
|
18
18
|
import { platform } from 'node:os';
|
|
19
|
+
const CLOSE_HEADERS = { Connection: 'close' };
|
|
20
|
+
/** Force-close keep-alive sockets so the CLI process can exit immediately. */
|
|
21
|
+
export function shutdownCallbackServer(server, sockets) {
|
|
22
|
+
for (const socket of sockets) {
|
|
23
|
+
socket.destroy();
|
|
24
|
+
}
|
|
25
|
+
sockets.clear();
|
|
26
|
+
const maybeCloseAll = server;
|
|
27
|
+
maybeCloseAll.closeAllConnections?.();
|
|
28
|
+
server.close();
|
|
29
|
+
}
|
|
19
30
|
/**
|
|
20
31
|
* Open a URL in the user's default browser.
|
|
21
32
|
*/
|
|
22
33
|
function openBrowser(url) {
|
|
23
34
|
const os = platform();
|
|
24
35
|
const cmd = os === 'darwin' ? 'open' : os === 'win32' ? 'start' : 'xdg-open';
|
|
25
|
-
exec(`${cmd} "${url}"`);
|
|
36
|
+
const child = exec(`${cmd} "${url}"`);
|
|
37
|
+
child.unref?.();
|
|
38
|
+
}
|
|
39
|
+
function finishResponse(res, body, status = 200) {
|
|
40
|
+
res.writeHead(status, { 'Content-Type': 'text/html', ...CLOSE_HEADERS });
|
|
41
|
+
res.end(body);
|
|
42
|
+
res.socket?.destroy();
|
|
26
43
|
}
|
|
27
44
|
/**
|
|
28
45
|
* Run the browser-based OAuth login flow.
|
|
29
46
|
* Returns tokens on success, throws on timeout or failure.
|
|
30
47
|
*/
|
|
31
48
|
export function browserLogin(options) {
|
|
32
|
-
const { app_url, timeout_ms = 300_000, no_open = false } = options;
|
|
49
|
+
const { app_url, timeout_ms = 300_000, no_open = false, on_listening } = options;
|
|
33
50
|
return new Promise((resolve, reject) => {
|
|
34
51
|
let settled = false;
|
|
35
52
|
let timeoutId;
|
|
53
|
+
const sockets = new Set();
|
|
54
|
+
const settleSuccess = (result) => {
|
|
55
|
+
if (settled)
|
|
56
|
+
return;
|
|
57
|
+
settled = true;
|
|
58
|
+
if (timeoutId)
|
|
59
|
+
clearTimeout(timeoutId);
|
|
60
|
+
shutdownCallbackServer(server, sockets);
|
|
61
|
+
resolve(result);
|
|
62
|
+
};
|
|
63
|
+
const settleFailure = (err) => {
|
|
64
|
+
if (settled)
|
|
65
|
+
return;
|
|
66
|
+
settled = true;
|
|
67
|
+
if (timeoutId)
|
|
68
|
+
clearTimeout(timeoutId);
|
|
69
|
+
shutdownCallbackServer(server, sockets);
|
|
70
|
+
reject(err);
|
|
71
|
+
};
|
|
36
72
|
const server = createServer((req, res) => {
|
|
37
73
|
const reqUrl = new URL(req.url ?? '/', `http://localhost`);
|
|
38
74
|
if (reqUrl.pathname === '/callback') {
|
|
39
|
-
// Tokens come as query params from the Loxtep app redirect
|
|
40
75
|
const access_token = reqUrl.searchParams.get('access_token');
|
|
41
76
|
const refresh_token = reqUrl.searchParams.get('refresh_token') ?? undefined;
|
|
42
77
|
const expires_at = reqUrl.searchParams.get('expires_at') ?? undefined;
|
|
43
|
-
// AWS credentials (optional, URL-encoded JSON)
|
|
44
78
|
let aws_credentials;
|
|
45
79
|
const awsCredsParam = reqUrl.searchParams.get('aws_credentials');
|
|
46
80
|
if (awsCredsParam) {
|
|
@@ -52,30 +86,31 @@ export function browserLogin(options) {
|
|
|
52
86
|
}
|
|
53
87
|
}
|
|
54
88
|
if (!access_token) {
|
|
55
|
-
res
|
|
56
|
-
res.end('<html><body><h2>Login failed</h2><p>No access token received. Close this window and try again.</p></body></html>');
|
|
89
|
+
finishResponse(res, '<html><body><h2>Login failed</h2><p>No access token received. Close this window and try again.</p></body></html>', 400);
|
|
57
90
|
return;
|
|
58
91
|
}
|
|
59
|
-
res
|
|
60
|
-
|
|
61
|
-
settled = true;
|
|
62
|
-
if (timeoutId)
|
|
63
|
-
clearTimeout(timeoutId);
|
|
64
|
-
server.close();
|
|
65
|
-
resolve({ access_token, refresh_token, expires_at, aws_credentials });
|
|
92
|
+
finishResponse(res, '<html><body><h2>Login successful!</h2><p>You can close this window and return to your terminal.</p></body></html>');
|
|
93
|
+
settleSuccess({ access_token, refresh_token, expires_at, aws_credentials });
|
|
66
94
|
return;
|
|
67
95
|
}
|
|
68
|
-
|
|
69
|
-
res.writeHead(200, { 'Content-Type': 'text/plain' });
|
|
96
|
+
res.writeHead(200, { 'Content-Type': 'text/plain', ...CLOSE_HEADERS });
|
|
70
97
|
res.end('Loxtep SDK login callback server');
|
|
98
|
+
res.socket?.destroy();
|
|
99
|
+
});
|
|
100
|
+
server.on('connection', socket => {
|
|
101
|
+
sockets.add(socket);
|
|
102
|
+
socket.on('close', () => {
|
|
103
|
+
sockets.delete(socket);
|
|
104
|
+
});
|
|
71
105
|
});
|
|
72
106
|
server.listen(0, '127.0.0.1', () => {
|
|
73
107
|
const addr = server.address();
|
|
74
108
|
if (!addr || typeof addr === 'string') {
|
|
75
|
-
|
|
109
|
+
settleFailure(new Error('Failed to start callback server'));
|
|
76
110
|
return;
|
|
77
111
|
}
|
|
78
112
|
const port = addr.port;
|
|
113
|
+
on_listening?.(port);
|
|
79
114
|
const callbackUrl = `http://localhost:${port}/callback`;
|
|
80
115
|
const loginUrl = `${app_url.replace(/\/$/, '')}/auth/mcp?callback_url=${encodeURIComponent(callbackUrl)}`;
|
|
81
116
|
if (no_open) {
|
|
@@ -89,19 +124,12 @@ export function browserLogin(options) {
|
|
|
89
124
|
console.log('Waiting for login to complete...');
|
|
90
125
|
});
|
|
91
126
|
server.on('error', err => {
|
|
92
|
-
|
|
93
|
-
settled = true;
|
|
94
|
-
reject(new Error(`Callback server error: ${err.message}`));
|
|
95
|
-
}
|
|
127
|
+
settleFailure(new Error(`Callback server error: ${err.message}`));
|
|
96
128
|
});
|
|
97
|
-
// Timeout
|
|
98
129
|
timeoutId = setTimeout(() => {
|
|
99
|
-
|
|
100
|
-
settled = true;
|
|
101
|
-
server.close();
|
|
102
|
-
reject(new Error(`Login timed out after ${timeout_ms / 1000} seconds. Try again.`));
|
|
103
|
-
}
|
|
130
|
+
settleFailure(new Error(`Login timed out after ${timeout_ms / 1000} seconds. Try again.`));
|
|
104
131
|
}, timeout_ms);
|
|
132
|
+
timeoutId.unref?.();
|
|
105
133
|
});
|
|
106
134
|
}
|
|
107
135
|
//# sourceMappingURL=browser-login.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-login.js","sourceRoot":"","sources":["../../src/auth/browser-login.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"browser-login.js","sourceRoot":"","sources":["../../src/auth/browser-login.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,YAAY,EAA0D,MAAM,WAAW,CAAC;AAEjG,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAqB,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AA2BnC,MAAM,aAAa,GAAG,EAAE,UAAU,EAAE,OAAgB,EAAE,CAAC;AAEvD,8EAA8E;AAC9E,MAAM,UAAU,sBAAsB,CAAC,MAAc,EAAE,OAAoB;IACzE,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,MAAM,CAAC,OAAO,EAAE,CAAC;IACnB,CAAC;IACD,OAAO,CAAC,KAAK,EAAE,CAAC;IAEhB,MAAM,aAAa,GAAG,MAAuD,CAAC;IAC9E,aAAa,CAAC,mBAAmB,EAAE,EAAE,CAAC;IACtC,MAAM,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AO,EAAE,CAAC;gBACZ,OAAO,CAAC,GAAG,CAAC,mDAAmD,QAAQ,IAAI,CAAC,CAAC;YAC/E,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,GAAG,CAAC,4CAA4C,QAAQ,IAAI,CAAC,CAAC;gBACtE,OAAO,CAAC,GAAG,CAAC,2EAA2E,CAAC,CAAC;gBACzF,WAAW,CAAC,QAAQ,CAAC,CAAC;YACxB,CAAC;YAED,OAAO,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAC;QAClD,CAAC,CAAC,CAAC;QAEH,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,CAAC,EAAE;YACvB,aAAa,CAAC,IAAI,KAAK,CAAC,0BAA0B,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;QACpE,CAAC,CAAC,CAAC;QAEH,SAAS,GAAG,UAAU,CAAC,GAAG,EAAE;YAC1B,aAAa,CAAC,IAAI,KAAK,CAAC,yBAAyB,UAAU,GAAG,IAAI,sBAAsB,CAAC,CAAC,CAAC;QAC7F,CAAC,EAAE,UAAU,CAAC,CAAC;QACf,SAAS,CAAC,KAAK,EAAE,EAAE,CAAC;IACtB,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/cli/help.d.ts
CHANGED
package/dist/cli/help.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../src/cli/help.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,eAAO,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../src/cli/help.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,eAAO,MAAM,QAAQ,QA0EV,CAAC;AAEZ,wBAAgB,YAAY,IAAI,IAAI,CAEnC"}
|
package/dist/cli/help.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Top-level CLI help
|
|
2
|
+
* Top-level CLI help — customer-facing command groups (no internal MCP facade names).
|
|
3
3
|
*/
|
|
4
4
|
export const CLI_HELP = `
|
|
5
5
|
Loxtep — the Enterprise Context Layer.
|
|
@@ -8,15 +8,13 @@ Turns organizational knowledge, expertise, and norms into machine-usable context
|
|
|
8
8
|
Usage: loxtep <command> [subcommand] [options]
|
|
9
9
|
loxtep --version | loxtep -V
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
Session (client.session · loxtep_session)
|
|
11
|
+
Authentication
|
|
14
12
|
login Log in (browser by default; --console for email/password/TOTP)
|
|
15
13
|
Saves to ./.loxtep/credentials.json by default (--global for ~/.loxtep)
|
|
16
14
|
logout Remove stored credentials (--local / --global to force scope)
|
|
17
15
|
whoami Print current user and organization
|
|
18
16
|
|
|
19
|
-
Workspace
|
|
17
|
+
Workspace
|
|
20
18
|
init [--template <slug>] [--create-repo | --from-repo <url>]
|
|
21
19
|
Scaffold .loxtep/project.json + domains/, connectors/, workflows/, data-products/
|
|
22
20
|
attach [--instance <id>]
|
|
@@ -25,7 +23,7 @@ Workspace (client.workspace · loxtep_workspace)
|
|
|
25
23
|
instances list | get <id> | create … | deployment-urls | register … | registration
|
|
26
24
|
Provision and register runtime instances
|
|
27
25
|
|
|
28
|
-
Build
|
|
26
|
+
Build & deploy
|
|
29
27
|
test <module> --event <file>
|
|
30
28
|
Run a workflow module locally (action trace)
|
|
31
29
|
deploy Compile workflow modules and deploy to the attached instance
|
|
@@ -36,32 +34,32 @@ Build (client.build · loxtep_build)
|
|
|
36
34
|
data-products list | get <id> | create … | readiness <id> | promote <id> --target …
|
|
37
35
|
Data product CRUD and medallion promotion
|
|
38
36
|
|
|
39
|
-
|
|
37
|
+
Governance
|
|
40
38
|
domains list | get <id>
|
|
41
|
-
standards list | get <id>
|
|
39
|
+
standards list | get <id> Standards (policies)
|
|
42
40
|
data-contracts list | get <id> | create …
|
|
43
41
|
|
|
44
|
-
Review
|
|
42
|
+
Review
|
|
45
43
|
improvements list [--status …] [--workflow <name>]
|
|
46
44
|
improvements apply <id> | reject <id> Adopt or reject AI-eval workflow improvements
|
|
47
45
|
|
|
48
|
-
|
|
46
|
+
Analytics
|
|
49
47
|
data-products query <id> "SQL" | --file <path>
|
|
50
48
|
data-products tables <id> List tables for analytics SQL
|
|
51
49
|
|
|
52
|
-
Observe
|
|
53
|
-
observe status Platform / instance
|
|
50
|
+
Observe
|
|
51
|
+
observe status Platform / instance health snapshot
|
|
54
52
|
queue info <data-product-id> | --queue <name>
|
|
55
53
|
queue checkpoint <id> --bot <bot-id> Reader checkpoint for a bot
|
|
56
54
|
metrics rate-limits | log --id <id> --value <n>
|
|
57
55
|
|
|
58
|
-
|
|
56
|
+
Activity
|
|
59
57
|
activity list [--source …] [--actor …] [--resource-type …] [--from …] [--to …]
|
|
60
58
|
|
|
61
|
-
|
|
59
|
+
Configuration
|
|
62
60
|
config list | paths | set <key> <value>
|
|
63
61
|
config export --from-connector <id> | --from-data-product <id> [--format sh|json|env]
|
|
64
|
-
bus login
|
|
62
|
+
bus login Stream bus vs JWT explainer (placeholder)
|
|
65
63
|
|
|
66
64
|
Examples:
|
|
67
65
|
pnpm exec loxtep login
|
package/dist/cli/help.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help.js","sourceRoot":"","sources":["../../src/cli/help.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,CAAC,MAAM,QAAQ,GAAG
|
|
1
|
+
{"version":3,"file":"help.js","sourceRoot":"","sources":["../../src/cli/help.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,CAAC,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0EvB,CAAC,OAAO,EAAE,CAAC;AAEZ,MAAM,UAAU,YAAY;IAC1B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AACxB,CAAC"}
|
package/dist/cli/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* context for AI across heterogeneous systems.
|
|
6
6
|
*
|
|
7
7
|
* Usage: loxtep <command> [options]
|
|
8
|
-
* Help is grouped by
|
|
8
|
+
* Help is grouped by customer-facing command areas — see ./help.ts
|
|
9
9
|
*/
|
|
10
10
|
export {};
|
|
11
11
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/cli/index.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* context for AI across heterogeneous systems.
|
|
6
6
|
*
|
|
7
7
|
* Usage: loxtep <command> [options]
|
|
8
|
-
* Help is grouped by
|
|
8
|
+
* Help is grouped by customer-facing command areas — see ./help.ts
|
|
9
9
|
*/
|
|
10
10
|
import { runLogin } from './commands/login.js';
|
|
11
11
|
import { runLogout } from './commands/logout.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/cli/version.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/cli/version.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,oEAAoE;AACpE,wBAAgB,aAAa,IAAI,MAAM,CAOtC;AAED,wBAAgB,oBAAoB,IAAI,MAAM,CAE7C;AAED,wBAAgB,eAAe,IAAI,IAAI,CAEtC"}
|
package/dist/cli/version.js
CHANGED
|
@@ -1,18 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* CLI/SDK version from package.json (same semver as `@loxtep/sdk` on npm).
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
5
|
-
import { dirname, join } from 'node:path';
|
|
6
|
-
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import pkg from '../../package.json' with { type: 'json' };
|
|
7
5
|
let cachedVersion;
|
|
8
6
|
/** Resolve `@loxtep/sdk` semver from the installed package.json. */
|
|
9
7
|
export function getSdkVersion() {
|
|
10
8
|
if (cachedVersion) {
|
|
11
9
|
return cachedVersion;
|
|
12
10
|
}
|
|
13
|
-
const here = dirname(fileURLToPath(import.meta.url));
|
|
14
|
-
const pkgPath = join(here, '../../package.json');
|
|
15
|
-
const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));
|
|
16
11
|
cachedVersion = pkg.version ?? '0.0.0';
|
|
17
12
|
return cachedVersion;
|
|
18
13
|
}
|
package/dist/cli/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/cli/version.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/cli/version.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,GAAG,MAAM,oBAAoB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAE3D,IAAI,aAAiC,CAAC;AAEtC,oEAAoE;AACpE,MAAM,UAAU,aAAa;IAC3B,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,aAAa,CAAC;IACvB,CAAC;IAED,aAAa,GAAG,GAAG,CAAC,OAAO,IAAI,OAAO,CAAC;IACvC,OAAO,aAAa,CAAC;AACvB,CAAC;AAED,MAAM,UAAU,oBAAoB;IAClC,OAAO,eAAe,aAAa,EAAE,EAAE,CAAC;AAC1C,CAAC;AAED,MAAM,UAAU,eAAe;IAC7B,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,CAAC,CAAC;AACtC,CAAC"}
|
package/docs/getting-started.md
CHANGED
|
@@ -324,6 +324,5 @@ Now that you've written and read your first event, explore these resources:
|
|
|
324
324
|
| [Code-first CLI guide](./code-first-cli.md) | `loxtep init`, attach, generate, test, deploy |
|
|
325
325
|
| [Quick Reference Card](./quick-reference.md) | Single-page cheat sheet for common SDK operations |
|
|
326
326
|
| [Event Replay Cookbook](./event-replay-cookbook.md) | Patterns for replaying and reprocessing historical events |
|
|
327
|
-
| [MCP → SDK Mapping](./sdk-mcp-mapping.md) | How MCP tools map to SDK methods |
|
|
328
327
|
|
|
329
328
|
See the [SDK README](../README.md) for the full API surface.
|
package/docs/quick-reference.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# SDK Quick Reference Card
|
|
2
2
|
|
|
3
|
-
Concise cheat sheet for common Loxtep SDK operations (Node.js **v0.7+**
|
|
4
|
-
|
|
3
|
+
Concise cheat sheet for common Loxtep SDK operations (Node.js **v0.7+**).
|
|
4
|
+
For full walkthroughs, see the [Getting Started Guide](./getting-started.md)
|
|
5
5
|
(programmatic) or [Code-first CLI guide](./code-first-cli.md) (`loxtep init`).
|
|
6
6
|
|
|
7
7
|
---
|
|
@@ -175,8 +175,6 @@ const hits = await client.query.catalog.search({ query: 'orders' });
|
|
|
175
175
|
| **Catalog search** | `client.query.catalog.search({ query })` |
|
|
176
176
|
| **Invalidate cache** | `client.build.data_products.invalidate_cache('name')` |
|
|
177
177
|
|
|
178
|
-
See [MCP → SDK mapping](./sdk-mcp-mapping.md) for all 10 facades.
|
|
179
|
-
|
|
180
178
|
---
|
|
181
179
|
|
|
182
180
|
## CLI Shortcuts
|
|
@@ -220,4 +218,4 @@ in application code.
|
|
|
220
218
|
|----------|-------------|
|
|
221
219
|
| [Getting Started Guide](./getting-started.md) | Zero-to-first-event walkthrough |
|
|
222
220
|
| [Event Replay Cookbook](./event-replay-cookbook.md) | Replay patterns (`build.data_products`, `observe`) |
|
|
223
|
-
| [
|
|
221
|
+
| [Code-first CLI guide](./code-first-cli.md) | `loxtep init` through deploy |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loxtep/sdk",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.9",
|
|
4
4
|
"description": "Loxtep SDK for Node.js — the Enterprise Context Layer: data products, workflows, projects, queues, and machine-usable context for AI",
|
|
5
5
|
"author": "Loxtep <engineering@loxtep.io>",
|
|
6
6
|
"homepage": "https://loxtep.io",
|