openmates 0.14.8-alpha.17 → 0.14.8-alpha.18

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.
@@ -6916,12 +6916,14 @@ var OpenMatesClient = class _OpenMatesClient {
6916
6916
  // -------------------------------------------------------------------------
6917
6917
  // Settings (generic passthrough)
6918
6918
  // -------------------------------------------------------------------------
6919
- async settingsGet(path) {
6920
- this.requireSession();
6919
+ async settingsGet(path, apiKey) {
6920
+ if (!apiKey) this.requireSession();
6921
6921
  const normalizedPath = this.normalizePath(path);
6922
+ const headers = this.getCliRequestHeaders();
6923
+ if (apiKey) headers.Authorization = `Bearer ${apiKey}`;
6922
6924
  let response = await this.http.get(
6923
6925
  normalizedPath,
6924
- this.getCliRequestHeaders()
6926
+ headers
6925
6927
  );
6926
6928
  if (response.status === 429) {
6927
6929
  process.stderr.write(
@@ -6929,7 +6931,7 @@ var OpenMatesClient = class _OpenMatesClient {
6929
6931
  `
6930
6932
  );
6931
6933
  await new Promise((resolve7) => setTimeout(resolve7, SETTINGS_GET_RATE_LIMIT_RETRY_MS));
6932
- response = await this.http.get(normalizedPath, this.getCliRequestHeaders());
6934
+ response = await this.http.get(normalizedPath, headers);
6933
6935
  }
6934
6936
  if (!response.ok) {
6935
6937
  throw new Error(`Settings GET failed with HTTP ${response.status}`);
@@ -6967,48 +6969,54 @@ var OpenMatesClient = class _OpenMatesClient {
6967
6969
  crypto: material
6968
6970
  };
6969
6971
  }
6970
- async settingsPost(path, body) {
6971
- this.requireSession();
6972
+ async settingsPost(path, body, apiKey) {
6973
+ if (!apiKey) this.requireSession();
6972
6974
  const normalizedPath = this.normalizePath(path);
6973
6975
  if (BLOCKED_SETTINGS_MUTATE_PATHS.has(normalizedPath)) {
6974
6976
  throw new Error(`Blocked operation: ${normalizedPath}`);
6975
6977
  }
6978
+ const headers = this.getCliRequestHeaders();
6979
+ if (apiKey) headers.Authorization = `Bearer ${apiKey}`;
6976
6980
  const response = await this.http.post(
6977
6981
  normalizedPath,
6978
6982
  body,
6979
- this.getCliRequestHeaders()
6983
+ headers
6980
6984
  );
6981
6985
  if (!response.ok) {
6982
6986
  throw new Error(`Settings POST failed with HTTP ${response.status}`);
6983
6987
  }
6984
6988
  return response.data;
6985
6989
  }
6986
- async settingsDelete(path, body) {
6987
- this.requireSession();
6990
+ async settingsDelete(path, body, apiKey) {
6991
+ if (!apiKey) this.requireSession();
6988
6992
  const normalizedPath = this.normalizePath(path);
6989
6993
  if (BLOCKED_SETTINGS_MUTATE_PATHS.has(normalizedPath)) {
6990
6994
  throw new Error(`Blocked operation: ${normalizedPath}`);
6991
6995
  }
6996
+ const headers = this.getCliRequestHeaders();
6997
+ if (apiKey) headers.Authorization = `Bearer ${apiKey}`;
6992
6998
  const response = await this.http.delete(
6993
6999
  normalizedPath,
6994
7000
  body,
6995
- this.getCliRequestHeaders()
7001
+ headers
6996
7002
  );
6997
7003
  if (!response.ok) {
6998
7004
  throw new Error(`Settings DELETE failed with HTTP ${response.status}`);
6999
7005
  }
7000
7006
  return response.data;
7001
7007
  }
7002
- async settingsPatch(path, body) {
7003
- this.requireSession();
7008
+ async settingsPatch(path, body, apiKey) {
7009
+ if (!apiKey) this.requireSession();
7004
7010
  const normalizedPath = this.normalizePath(path);
7005
7011
  if (BLOCKED_SETTINGS_MUTATE_PATHS.has(normalizedPath)) {
7006
7012
  throw new Error(`Blocked operation: ${normalizedPath}`);
7007
7013
  }
7014
+ const headers = this.getCliRequestHeaders();
7015
+ if (apiKey) headers.Authorization = `Bearer ${apiKey}`;
7008
7016
  const response = await this.http.patch(
7009
7017
  normalizedPath,
7010
7018
  body,
7011
- this.getCliRequestHeaders()
7019
+ headers
7012
7020
  );
7013
7021
  if (!response.ok) {
7014
7022
  throw new Error(`Settings PATCH failed with HTTP ${response.status}`);
@@ -53526,6 +53534,7 @@ async function handleSettings(client, subcommand, rest, flags) {
53526
53534
  return;
53527
53535
  }
53528
53536
  const tokens = [subcommand, ...rest].filter((token) => token !== "help");
53537
+ const apiKey = resolveApiKey(flags) ?? void 0;
53529
53538
  if (rest.includes("help") || Boolean(flags.help)) {
53530
53539
  printSettingsHelp(client, tokens);
53531
53540
  return;
@@ -53691,7 +53700,7 @@ async function handleSettings(client, subcommand, rest, flags) {
53691
53700
  if (Object.keys(body).length === 0) {
53692
53701
  throw new Error("Provide --simple <model-id|auto> and/or --complex <model-id|auto>.");
53693
53702
  }
53694
- await printSettingsMutationResult(client.settingsPost("ai-model-defaults", body), flags);
53703
+ await printSettingsMutationResult(client.settingsPost("ai-model-defaults", body, apiKey), flags);
53695
53704
  return;
53696
53705
  }
53697
53706
  if (matches(tokens, ["privacy", "auto-delete", "chats", "set"])) {
package/dist/cli.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  getExtForLang,
4
4
  serializeToYaml
5
- } from "./chunk-6M52O6HO.js";
5
+ } from "./chunk-PY7I7PSY.js";
6
6
  import "./chunk-AXNRPVLE.js";
7
7
  export {
8
8
  getExtForLang,
package/dist/index.d.ts CHANGED
@@ -1402,11 +1402,11 @@ declare class OpenMatesClient {
1402
1402
  createPlanCriterion(planId: string, input: UserPlanCriterionRecord): Promise<UserPlanCriterionRecord>;
1403
1403
  createPlanVerification(planId: string, input: UserPlanVerificationRecord & Record<string, unknown>): Promise<UserPlanVerificationRecord>;
1404
1404
  addPlanVerificationEvidence(planId: string, verificationId: string, input: Partial<UserPlanVerificationRecord>): Promise<UserPlanVerificationRecord>;
1405
- settingsGet(path: string): Promise<unknown>;
1405
+ settingsGet(path: string, apiKey?: string): Promise<unknown>;
1406
1406
  createApiKey(options: ApiKeyCreateOptions): Promise<CreatedApiKeyResult>;
1407
- settingsPost(path: string, body: Record<string, unknown>): Promise<unknown>;
1408
- settingsDelete(path: string, body?: Record<string, unknown>): Promise<unknown>;
1409
- settingsPatch(path: string, body: Record<string, unknown>): Promise<unknown>;
1407
+ settingsPost(path: string, body: Record<string, unknown>, apiKey?: string): Promise<unknown>;
1408
+ settingsDelete(path: string, body?: Record<string, unknown>, apiKey?: string): Promise<unknown>;
1409
+ settingsPatch(path: string, body: Record<string, unknown>, apiKey?: string): Promise<unknown>;
1410
1410
  redeemGiftCard(code: string): Promise<{
1411
1411
  success: boolean;
1412
1412
  credits_added: number;
package/dist/index.js CHANGED
@@ -29,7 +29,7 @@ import {
29
29
  renderSupportInfo,
30
30
  serializeToYaml,
31
31
  unwrapApiKeyMasterKey
32
- } from "./chunk-6M52O6HO.js";
32
+ } from "./chunk-PY7I7PSY.js";
33
33
  import "./chunk-AXNRPVLE.js";
34
34
 
35
35
  // src/generated/appSkills.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openmates",
3
- "version": "0.14.8-alpha.17",
3
+ "version": "0.14.8-alpha.18",
4
4
  "description": "OpenMates CLI and SDK",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",