notte-sdk 0.0.4 → 0.0.6

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/dist/index.mjs CHANGED
@@ -1249,6 +1249,30 @@ var anythingStart = (options) => (options.client ?? client).post({
1249
1249
  ...options.headers
1250
1250
  }
1251
1251
  });
1252
+ var listSecrets = (options) => (options?.client ?? client).get({
1253
+ security: [{ scheme: "bearer", type: "http" }],
1254
+ url: "/secrets",
1255
+ ...options
1256
+ });
1257
+ var storeSecret = (options) => (options.client ?? client).post({
1258
+ security: [{ scheme: "bearer", type: "http" }],
1259
+ url: "/secrets",
1260
+ ...options,
1261
+ headers: {
1262
+ "Content-Type": "application/json",
1263
+ ...options.headers
1264
+ }
1265
+ });
1266
+ var getSecret = (options) => (options.client ?? client).get({
1267
+ security: [{ scheme: "bearer", type: "http" }],
1268
+ url: "/secrets/{name}",
1269
+ ...options
1270
+ });
1271
+ var deleteSecret = (options) => (options.client ?? client).delete({
1272
+ security: [{ scheme: "bearer", type: "http" }],
1273
+ url: "/secrets/{secret_id}",
1274
+ ...options
1275
+ });
1252
1276
  var healthCheck = (options) => (options?.client ?? client).get({ url: "/health", ...options });
1253
1277
  var scrapeWebpage = (options) => (options.client ?? client).post({
1254
1278
  security: [{ scheme: "bearer", type: "http" }],
@@ -1604,6 +1628,15 @@ function prepareAgentRequest(data) {
1604
1628
  }
1605
1629
  return { apiData, zodSchema: null };
1606
1630
  }
1631
+ function parseAgentStatusMessage(parsed, agentId) {
1632
+ if (parsed?.status === "agent_stop" && parsed.agent && parsed.agent.agent_id === agentId && parsed.agent.task !== void 0 && parsed.agent.status !== void 0) {
1633
+ return parsed.agent;
1634
+ }
1635
+ if (parsed?.agent_id === agentId && parsed.task !== void 0 && parsed.status !== void 0) {
1636
+ return parsed;
1637
+ }
1638
+ return null;
1639
+ }
1607
1640
  function validatePersonaOption(persona, persona_id) {
1608
1641
  if (persona) {
1609
1642
  try {
@@ -1830,19 +1863,19 @@ var Agent = class {
1830
1863
  } catch {
1831
1864
  return;
1832
1865
  }
1833
- if (parsed.agent_id === agentId && parsed.task !== void 0 && parsed.status !== void 0) {
1834
- const response = parsed;
1866
+ const finalStatus = parseAgentStatusMessage(parsed, agentId);
1867
+ if (finalStatus) {
1835
1868
  if (updateHandler) {
1836
1869
  updateHandler({
1837
1870
  type: "completion",
1838
- data: response,
1871
+ data: finalStatus,
1839
1872
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
1840
1873
  });
1841
- } else if (!response.success) {
1842
- console.error(response.answer);
1874
+ } else if (!finalStatus.success) {
1875
+ console.error(finalStatus.answer);
1843
1876
  }
1844
1877
  this.disconnectWebSocket();
1845
- resolve(response);
1878
+ resolve(finalStatus);
1846
1879
  return;
1847
1880
  }
1848
1881
  if (log) {
@@ -2491,7 +2524,7 @@ var NottePersona = class {
2491
2524
  };
2492
2525
 
2493
2526
  // src/version.ts
2494
- var SDK_VERSION = true ? "0.0.4" : "dev";
2527
+ var SDK_VERSION = true ? "0.0.6" : "dev";
2495
2528
 
2496
2529
  // src/functions.ts
2497
2530
  var NotteFunction = class {
@@ -2750,6 +2783,7 @@ export {
2750
2783
  client,
2751
2784
  createClient2 as createClient,
2752
2785
  NotteClient as default,
2786
+ deleteSecret,
2753
2787
  fileDownload,
2754
2788
  fileListDownloads,
2755
2789
  fileListUploads,
@@ -2767,6 +2801,7 @@ export {
2767
2801
  functionScheduleSet,
2768
2802
  functionUpdate,
2769
2803
  getScript,
2804
+ getSecret,
2770
2805
  getSessionScript,
2771
2806
  getUsage,
2772
2807
  getUsageLogs,
@@ -2776,6 +2811,7 @@ export {
2776
2811
  listFunctionRunsByFunctionId,
2777
2812
  listFunctions,
2778
2813
  listPersonas,
2814
+ listSecrets,
2779
2815
  listSessions,
2780
2816
  listVaults,
2781
2817
  nudgePrompt,
@@ -2804,6 +2840,7 @@ export {
2804
2840
  sessionStart,
2805
2841
  sessionStatus,
2806
2842
  sessionStop,
2843
+ storeSecret,
2807
2844
  vaultCreate,
2808
2845
  vaultCredentialsAdd,
2809
2846
  vaultCredentialsDelete,