openmates 0.29.0-alpha.10 → 0.29.0-alpha.12
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 +27 -0
- package/README.md +24 -10
- package/dist/chunk-3R7U773U.js +46 -0
- package/dist/{chunk-QVCMMBD4.js → chunk-APUIUJ63.js} +1657 -1657
- package/dist/{chunk-BYYH2YTS.js → chunk-GMUR6H4Z.js} +1 -1
- package/dist/{chunk-CZNP4FS5.js → chunk-IOV3IUT6.js} +49 -49
- package/dist/cli-internal-client.d.ts +6 -0
- package/dist/cli-internal-client.js +132 -0
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +4 -4
- package/dist/{client-CCQdkE5S.d.ts → client-B0AS9IqI.d.ts} +13 -13
- package/dist/index.d.ts +28 -14
- package/dist/index.js +13 -29
- package/dist/sdk-entry.d.ts +2 -2
- package/dist/sdk-entry.js +2 -2
- package/dist/{sdkTaskOrder-CJPmq9yh.d.ts → sdkTaskOrder-B9ddZ7FN.d.ts} +1 -1
- package/fixtures/privacy-runtime/linux-arm64/libggml-base.so +0 -0
- package/fixtures/privacy-runtime/linux-arm64/libggml-base.so.0 +0 -0
- package/fixtures/privacy-runtime/linux-arm64/libggml-base.so.0.15.1 +0 -0
- package/fixtures/privacy-runtime/linux-arm64/libggml-cpu.so +0 -0
- package/fixtures/privacy-runtime/linux-arm64/libggml-cpu.so.0 +0 -0
- package/fixtures/privacy-runtime/linux-arm64/libggml-cpu.so.0.15.1 +0 -0
- package/fixtures/privacy-runtime/linux-arm64/libggml.so +0 -0
- package/fixtures/privacy-runtime/linux-arm64/libggml.so.0 +0 -0
- package/fixtures/privacy-runtime/linux-arm64/libggml.so.0.15.1 +0 -0
- package/fixtures/privacy-runtime/linux-arm64/manifest.json +9 -9
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,33 @@
|
|
|
3
3
|
Only SDK-relevant compatibility notes are recorded here. Release versions follow
|
|
4
4
|
the product line (`0.29.x` alpha prereleases from `dev`, stable from `main`).
|
|
5
5
|
|
|
6
|
+
## 0.30.0
|
|
7
|
+
|
|
8
|
+
### Breaking
|
|
9
|
+
|
|
10
|
+
- **The SDK is API-key only and separate from the CLI login.** The root
|
|
11
|
+
`OpenMatesClient` export no longer loads the stored CLI login (the 0.29.x
|
|
12
|
+
`OPENMATES_SDK_CLI_SESSION` deprecation is complete). It is now the API-key
|
|
13
|
+
client: `new OpenMatesClient({ apiKey })`. Constructing it (or calling
|
|
14
|
+
`OpenMatesClient.load()`) without an `apiKey` throws
|
|
15
|
+
`OpenMatesApiKeyRequiredError` (code `OPENMATES_SDK_API_KEY_REQUIRED`), and the
|
|
16
|
+
`session` / `loadStoredSession` options are rejected. No SDK entrypoint reads
|
|
17
|
+
CLI state files or the keychain, so an SDK script can use a different account
|
|
18
|
+
from the logged-in CLI. `SDK_CLI_SESSION_DEPRECATION_CODE` is removed.
|
|
19
|
+
|
|
20
|
+
**Migration:** create an API key in Settings → Developers and pass it
|
|
21
|
+
explicitly (`new OpenMatesClient({ apiKey })` or `new OpenMates({ apiKey })`).
|
|
22
|
+
The key decrypts your chats locally with its own wrapped account key; nothing
|
|
23
|
+
else is needed. The `openmates` command line keeps its own login and is
|
|
24
|
+
unaffected.
|
|
25
|
+
|
|
26
|
+
### Deprecated
|
|
27
|
+
|
|
28
|
+
- `SessionClient.loginPassword()` / `importSession()` in `openmates/sdk/v1`. Public
|
|
29
|
+
SDKs are API-key only; these login modes are removed once every capability they
|
|
30
|
+
offer is available through API-key authentication (open work tracked in
|
|
31
|
+
`config/sdk-capabilities.json`).
|
|
32
|
+
|
|
6
33
|
## 0.29.x
|
|
7
34
|
|
|
8
35
|
### Deprecated
|
package/README.md
CHANGED
|
@@ -375,23 +375,37 @@ Use `chats.send()` for anonymous AI chat with automatic routing; `apps.ai.ask()`
|
|
|
375
375
|
requires an account. With an API key, use `saveToAccount: true` when you want the
|
|
376
376
|
chat saved to the OpenMates account.
|
|
377
377
|
|
|
378
|
-
###
|
|
378
|
+
### API keys only, never the CLI login
|
|
379
379
|
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
380
|
+
The SDK authenticates only with an API key you pass explicitly (or configure via
|
|
381
|
+
`OPENMATES_API_KEY`). It is completely separate from the `openmates` command
|
|
382
|
+
line: it never reads the CLI's `~/.openmates/session.json`, its state directory
|
|
383
|
+
or the OS keychain, so a script can use a different account than the one logged
|
|
384
|
+
in to the CLI. Create an API key in Settings → Developers. Each key carries its
|
|
385
|
+
own wrapped copy of your account key, so the SDK decrypts your chats locally,
|
|
386
|
+
in memory, with only that key.
|
|
387
|
+
|
|
388
|
+
Since 0.30.0 the root `OpenMatesClient` is the API-key client and requires
|
|
389
|
+
`apiKey`; constructing it without one throws `OpenMatesApiKeyRequiredError`
|
|
390
|
+
(code `OPENMATES_SDK_API_KEY_REQUIRED`). The former `session` and
|
|
391
|
+
`loadStoredSession` options are rejected.
|
|
392
|
+
|
|
393
|
+
```typescript
|
|
394
|
+
import { OpenMatesClient } from "openmates";
|
|
395
|
+
|
|
396
|
+
const om = new OpenMatesClient({ apiKey: process.env.MY_OPENMATES_KEY! });
|
|
397
|
+
```
|
|
387
398
|
|
|
388
399
|
### Native session SDK (preview)
|
|
389
400
|
|
|
390
401
|
`openmates/sdk/v1` exports `SessionClient`, `RustApiKeyClient` and related
|
|
391
402
|
types. Every operation runs in the shared OpenMates Rust core through a native
|
|
392
403
|
Node-API module loaded from `native/<platform>-<arch>.node`; the SDK never
|
|
393
|
-
launches the CLI and never reads CLI login state.
|
|
394
|
-
|
|
404
|
+
launches the CLI and never reads CLI login state. Its password/imported-session
|
|
405
|
+
login modes (`loginPassword()`, `importSession()`) are deprecated: public SDKs
|
|
406
|
+
are API-key only, and these modes are removed once every capability they offer
|
|
407
|
+
is available through API-key authentication (tracked in
|
|
408
|
+
`config/sdk-capabilities.json`). Use an API key for new integrations. If the native
|
|
395
409
|
module for your platform is missing or incompatible, construction throws
|
|
396
410
|
`SessionClientError` with code `native_binding_unavailable` (no TypeScript
|
|
397
411
|
fallback). The SDK is moving to one portable WebAssembly build of the core
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import {
|
|
2
|
+
OpenMates,
|
|
3
|
+
OpenMatesConfigError
|
|
4
|
+
} from "./chunk-APUIUJ63.js";
|
|
5
|
+
|
|
6
|
+
// src/sdkRootClient.ts
|
|
7
|
+
var SDK_API_KEY_REQUIRED_CODE = "OPENMATES_SDK_API_KEY_REQUIRED";
|
|
8
|
+
var OpenMatesApiKeyRequiredError = class extends OpenMatesConfigError {
|
|
9
|
+
code = SDK_API_KEY_REQUIRED_CODE;
|
|
10
|
+
constructor(message) {
|
|
11
|
+
super(message);
|
|
12
|
+
this.name = "OpenMatesApiKeyRequiredError";
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
var ALLOWED_OPTIONS = /* @__PURE__ */ new Set(["apiKey", "apiUrl", "deviceId", "deviceIdPath"]);
|
|
16
|
+
var MIGRATION = "Create an API key in Settings \u2192 Developers and pass it explicitly: new OpenMatesClient({ apiKey }). The SDK never uses the CLI login.";
|
|
17
|
+
function requireApiKeyOptions(options) {
|
|
18
|
+
if (options === void 0 || options === null || typeof options !== "object" || Array.isArray(options)) {
|
|
19
|
+
throw new OpenMatesApiKeyRequiredError(`OpenMatesClient requires an explicit API key. ${MIGRATION}`);
|
|
20
|
+
}
|
|
21
|
+
const record = options;
|
|
22
|
+
for (const key of Object.keys(record)) {
|
|
23
|
+
if (key === "session" || key === "loadStoredSession") {
|
|
24
|
+
throw new OpenMatesApiKeyRequiredError(`OpenMatesClient no longer accepts \`${key}\`; CLI sessions are not SDK credentials. ${MIGRATION}`);
|
|
25
|
+
}
|
|
26
|
+
if (!ALLOWED_OPTIONS.has(key)) throw new OpenMatesConfigError(`Unknown OpenMatesClient option: ${key}`);
|
|
27
|
+
}
|
|
28
|
+
if (typeof record.apiKey !== "string" || record.apiKey.trim() === "") {
|
|
29
|
+
throw new OpenMatesApiKeyRequiredError(`OpenMatesClient requires an explicit API key. ${MIGRATION}`);
|
|
30
|
+
}
|
|
31
|
+
return { ...record, anonymous: false, sdkName: "npm" };
|
|
32
|
+
}
|
|
33
|
+
var OpenMatesClient = class _OpenMatesClient extends OpenMates {
|
|
34
|
+
constructor(options) {
|
|
35
|
+
super(requireApiKeyOptions(options));
|
|
36
|
+
}
|
|
37
|
+
static load(options) {
|
|
38
|
+
return new _OpenMatesClient(options);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export {
|
|
43
|
+
SDK_API_KEY_REQUIRED_CODE,
|
|
44
|
+
OpenMatesApiKeyRequiredError,
|
|
45
|
+
OpenMatesClient
|
|
46
|
+
};
|