@blade-hq/agent-kit 1.0.33 → 1.0.35

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.
Files changed (48) hide show
  1. package/README.md +95 -2
  2. package/dist/chunk-6KO3AOJ7.js +251 -0
  3. package/dist/chunk-6KO3AOJ7.js.map +1 -0
  4. package/dist/{chunk-FK4CV6R2.js → chunk-C63X3RCM.js} +629 -32
  5. package/dist/chunk-C63X3RCM.js.map +1 -0
  6. package/dist/{chunk-IGMLETZX.js → chunk-DOBX7XP3.js} +15 -12
  7. package/dist/chunk-DOBX7XP3.js.map +1 -0
  8. package/dist/{chunk-EGGBOVVF.js → chunk-IP7EZVT5.js} +2 -2
  9. package/dist/{chunk-OICNN4K4.js → chunk-J6H4TMTH.js} +2 -2
  10. package/dist/{chunk-F4Y7SUBC.js → chunk-SEHOWQVO.js} +2 -2
  11. package/dist/{chunk-IDVNG3YJ.js → chunk-YJSN44Q4.js} +16 -3
  12. package/dist/{chunk-IDVNG3YJ.js.map → chunk-YJSN44Q4.js.map} +1 -1
  13. package/dist/{chunk-E7FQV4IX.js → chunk-ZPPYDQPU.js} +3 -3
  14. package/dist/client/auth.d.ts +55 -0
  15. package/dist/client/blade-client.d.ts +19 -3
  16. package/dist/client/connection.d.ts +41 -0
  17. package/dist/client/index.d.ts +3 -0
  18. package/dist/client/index.js +11 -3
  19. package/dist/client/resources/auth.d.ts +1 -26
  20. package/dist/client/socket.d.ts +1 -0
  21. package/dist/client/types/rest.d.ts +246 -17
  22. package/dist/client/types/socket-events.d.ts +4 -0
  23. package/dist/react/api/model-config.d.ts +14 -2
  24. package/dist/react/api/published-apps.js +3 -3
  25. package/dist/react/api/sessions.js +2 -2
  26. package/dist/react/bootstrap.d.ts +1 -1
  27. package/dist/react/components/chat/index.js +5 -5
  28. package/dist/react/components/connection/BladeConnectionButton.d.ts +7 -0
  29. package/dist/react/components/connection/BladeConnectionPanel.d.ts +7 -0
  30. package/dist/react/components/connection/index.d.ts +2 -0
  31. package/dist/react/components/connection/index.js +15 -0
  32. package/dist/react/components/connection/index.js.map +1 -0
  33. package/dist/react/components/plan/index.js +4 -4
  34. package/dist/react/components/session/index.js +3 -3
  35. package/dist/react/components/workspace/index.js +3 -3
  36. package/dist/react/hooks/use-blade-connection.d.ts +14 -0
  37. package/dist/react/index.d.ts +6 -2
  38. package/dist/react/index.js +33 -28
  39. package/dist/react/index.js.map +1 -1
  40. package/dist/react/sockets/event-bridge.d.ts +2 -0
  41. package/dist/style.css +1 -1
  42. package/package.json +5 -1
  43. package/dist/chunk-FK4CV6R2.js.map +0 -1
  44. package/dist/chunk-IGMLETZX.js.map +0 -1
  45. /package/dist/{chunk-EGGBOVVF.js.map → chunk-IP7EZVT5.js.map} +0 -0
  46. /package/dist/{chunk-OICNN4K4.js.map → chunk-J6H4TMTH.js.map} +0 -0
  47. /package/dist/{chunk-F4Y7SUBC.js.map → chunk-SEHOWQVO.js.map} +0 -0
  48. /package/dist/{chunk-E7FQV4IX.js.map → chunk-ZPPYDQPU.js.map} +0 -0
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getClient
3
- } from "./chunk-IDVNG3YJ.js";
3
+ } from "./chunk-YJSN44Q4.js";
4
4
  import {
5
5
  __export
6
6
  } from "./chunk-PZ5AY32C.js";
@@ -20,4 +20,4 @@ export {
20
20
  unpublishApp,
21
21
  published_apps_exports
22
22
  };
23
- //# sourceMappingURL=chunk-EGGBOVVF.js.map
23
+ //# sourceMappingURL=chunk-IP7EZVT5.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  apiFetchResponse,
3
3
  getAuthedUrl
4
- } from "./chunk-IDVNG3YJ.js";
4
+ } from "./chunk-YJSN44Q4.js";
5
5
 
6
6
  // src/react/lib/session-file-preview.ts
7
7
  var IMAGE_EXTS = /* @__PURE__ */ new Set(["png", "jpg", "jpeg", "gif", "svg", "webp", "ico", "bmp"]);
@@ -117,4 +117,4 @@ export {
117
117
  resolveTextPreviewType,
118
118
  resolveSessionFilePreviewTarget
119
119
  };
120
- //# sourceMappingURL=chunk-OICNN4K4.js.map
120
+ //# sourceMappingURL=chunk-J6H4TMTH.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  useSessionStore
3
- } from "./chunk-IDVNG3YJ.js";
3
+ } from "./chunk-YJSN44Q4.js";
4
4
 
5
5
  // src/react/hooks/use-session.ts
6
6
  function useSession() {
@@ -27,4 +27,4 @@ function useSession() {
27
27
  export {
28
28
  useSession
29
29
  };
30
- //# sourceMappingURL=chunk-F4Y7SUBC.js.map
30
+ //# sourceMappingURL=chunk-SEHOWQVO.js.map
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  BladeClient,
6
6
  ClientProjectionBuilder
7
- } from "./chunk-FK4CV6R2.js";
7
+ } from "./chunk-C63X3RCM.js";
8
8
  import {
9
9
  createClientActions,
10
10
  useCardStateStore
@@ -3338,6 +3338,7 @@ var useRuntimeFeaturesStore = create12((set) => ({
3338
3338
  // src/react/bootstrap.ts
3339
3339
  var bootstrappedClient = null;
3340
3340
  var detachHostBridgeListener = null;
3341
+ var detachBaseUrlChangeListener = null;
3341
3342
  var stores = {
3342
3343
  answerCallback: useAnswerCallbackStore,
3343
3344
  auth: useAuthStore,
@@ -3359,6 +3360,18 @@ function attachClientToStores(client) {
3359
3360
  state.setClient(client);
3360
3361
  }
3361
3362
  bridgeSocketEvents(client, stores);
3363
+ detachBaseUrlChangeListener?.();
3364
+ detachBaseUrlChangeListener = client.onBaseUrlChange(() => {
3365
+ if (client.options.token === void 0) {
3366
+ useAuthStore.setState({
3367
+ token: null,
3368
+ socketAuthToken: null,
3369
+ user: null,
3370
+ error: null
3371
+ });
3372
+ }
3373
+ bridgeSocketEvents(client, stores);
3374
+ });
3362
3375
  detachHostBridgeListener?.();
3363
3376
  detachHostBridgeListener = attachHostBridgeListener(() => {
3364
3377
  const activeSessionId = useSessionStore.getState().activeSessionId;
@@ -3369,7 +3382,7 @@ function attachClientToStores(client) {
3369
3382
  };
3370
3383
  });
3371
3384
  }
3372
- function bootstrapBladeClient(options) {
3385
+ function bootstrapBladeClient(options = {}) {
3373
3386
  const client = new BladeClient(withStoreAuth(options));
3374
3387
  if (options.token === void 0) {
3375
3388
  client._attachStoreRestTokenResolver(() => useAuthStore.getState().token);
@@ -3584,4 +3597,4 @@ export {
3584
3597
  bootstrapBladeClient,
3585
3598
  getBootstrappedClient
3586
3599
  };
3587
- //# sourceMappingURL=chunk-IDVNG3YJ.js.map
3600
+ //# sourceMappingURL=chunk-YJSN44Q4.js.map