@skaile/workspace-bridge-vue 0.29.1 → 0.30.1

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 CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.30.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`72e099c`](https://github.com/skaile-ai/workspaces/commit/72e099cc09577d0c0c3c8f2445927fc8c880eaf5)]:
8
+ - @skaile/workspaces@0.30.1
9
+
10
+ ## 0.30.0
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies [[`fe1066f`](https://github.com/skaile-ai/workspaces/commit/fe1066f746ea2eaf88e0618998a12df399640deb), [`dd48d44`](https://github.com/skaile-ai/workspaces/commit/dd48d44e4dd5d72ba92b47af3788c5ba70d18e3c), [`963fa56`](https://github.com/skaile-ai/workspaces/commit/963fa56c921d94d4defffa651f26de7d283c006a), [`ed78a7d`](https://github.com/skaile-ai/workspaces/commit/ed78a7d1f9e9de7cca8be861c6198b600aa85ba1)]:
15
+ - @skaile/workspaces@0.30.0
16
+
3
17
  ## 0.29.1
4
18
 
5
19
  ### Patch Changes
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type {\n AgentStore,\n AgentStoreSnapshot,\n ResourceClient,\n ResourceClientSnapshot,\n SubscribableStore,\n} from \"@skaile/workspaces/store\";\nimport {\n type MaybeRefOrGetter,\n onScopeDispose,\n type ShallowRef,\n shallowRef,\n toValue,\n watch,\n} from \"vue\";\n\n/**\n * Subscribe to any {@link SubscribableStore} and return a reactive snapshot ref.\n *\n * Generic composable — works for {@link AgentStore}, {@link ResourceClient}, or\n * any future store implementing the same `subscribe`/`getSnapshot` contract.\n * Uses `shallowRef` for fine-grained reactivity. The subscription is cleaned up\n * automatically when the owning scope is disposed (e.g. component unmount).\n *\n * Accepts a plain store, a `ref`, or a getter. Pass a getter (`() => props.store`)\n * or a ref when the store can change at runtime — the composable tears down the\n * old subscription and re-subscribes to the new store. A plain value is treated\n * as stable (no re-subscription).\n *\n * @typeParam T - Snapshot type the store exposes via `getSnapshot()`.\n * @param store - The store to subscribe to (or a ref/getter resolving to one).\n * @returns A `ShallowRef` whose `.value` is the current snapshot.\n *\n * @since 0.8.0\n */\nexport function useSubscribableStore<T>(\n store: MaybeRefOrGetter<SubscribableStore<T>>,\n): ShallowRef<T> {\n const snapshot = shallowRef(toValue(store).getSnapshot()) as ShallowRef<T>;\n let unsub: () => void = () => {};\n\n const bind = (s: SubscribableStore<T>): void => {\n unsub();\n snapshot.value = s.getSnapshot();\n unsub = s.subscribe(() => {\n snapshot.value = s.getSnapshot();\n });\n };\n bind(toValue(store));\n\n // Re-subscribe when a reactive `store` (ref/getter) resolves to a new store.\n watch(\n () => toValue(store),\n (s) => bind(s),\n );\n onScopeDispose(() => unsub());\n return snapshot;\n}\n\n/**\n * Subscribe to an {@link AgentStore} and return a reactive snapshot ref.\n *\n * Vue templates and computed properties that read `snapshot.value.messages`\n * etc. will update automatically as the store mutates.\n *\n * @param store - The store to subscribe to (or a ref/getter resolving to one).\n * @returns A `ShallowRef` whose `.value` is the current immutable state snapshot.\n *\n * @example\n * ```vue\n * <script setup>\n * import { useAgentStore } from '@skaile/workspace-bridge-vue'\n *\n * const props = defineProps<{ store: AgentStore }>()\n * // Pass a getter so the snapshot re-binds if `props.store` changes.\n * const snapshot = useAgentStore(() => props.store)\n * // snapshot.value.messages, snapshot.value.streamingText, etc.\n * </script>\n * ```\n */\nexport function useAgentStore(\n store: MaybeRefOrGetter<AgentStore>,\n): ShallowRef<AgentStoreSnapshot> {\n return useSubscribableStore(store);\n}\n\n/**\n * Subscribe to a {@link ResourceClient} and return a reactive snapshot ref.\n *\n * Re-renders only when the agent emits a `resources_available` event (typically\n * once on connect). The subscription is cleaned up automatically when the owning\n * scope is disposed.\n *\n * @param client - The resource client to subscribe to (or a ref/getter resolving to one).\n * @returns A `ShallowRef` whose `.value` is the current resource snapshot.\n *\n * @example\n * ```vue\n * <script setup>\n * import { useResourceClient } from '@skaile/workspace-bridge-vue'\n *\n * const props = defineProps<{ client: ResourceClient }>()\n * // Pass a getter so the snapshot re-binds if `props.client` changes.\n * const resources = useResourceClient(() => props.client)\n * // resources.value.mounts, resources.value.connectors\n * </script>\n * ```\n */\nexport function useResourceClient(\n client: MaybeRefOrGetter<ResourceClient>,\n): ShallowRef<ResourceClientSnapshot> {\n return useSubscribableStore(client);\n}\n"],"mappings":";AAOA;AAAA,EAEE;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAqBA,SAAS,qBACd,OACe;AACf,QAAM,WAAW,WAAW,QAAQ,KAAK,EAAE,YAAY,CAAC;AACxD,MAAI,QAAoB,MAAM;AAAA,EAAC;AAE/B,QAAM,OAAO,CAAC,MAAkC;AAC9C,UAAM;AACN,aAAS,QAAQ,EAAE,YAAY;AAC/B,YAAQ,EAAE,UAAU,MAAM;AACxB,eAAS,QAAQ,EAAE,YAAY;AAAA,IACjC,CAAC;AAAA,EACH;AACA,OAAK,QAAQ,KAAK,CAAC;AAGnB;AAAA,IACE,MAAM,QAAQ,KAAK;AAAA,IACnB,CAAC,MAAM,KAAK,CAAC;AAAA,EACf;AACA,iBAAe,MAAM,MAAM,CAAC;AAC5B,SAAO;AACT;AAuBO,SAAS,cACd,OACgC;AAChC,SAAO,qBAAqB,KAAK;AACnC;AAwBO,SAAS,kBACd,QACoC;AACpC,SAAO,qBAAqB,MAAM;AACpC;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type {\n AgentStore,\n AgentStoreSnapshot,\n ResourceClient,\n ResourceClientSnapshot,\n SubscribableStore,\n} from \"@skaile/workspaces/store\";\nimport {\n type MaybeRefOrGetter,\n onScopeDispose,\n type ShallowRef,\n shallowRef,\n toValue,\n watch,\n} from \"vue\";\n\n/**\n * Subscribe to any {@link SubscribableStore} and return a reactive snapshot ref.\n *\n * Generic composable — works for {@link AgentStore}, {@link ResourceClient}, or\n * any future store implementing the same `subscribe`/`getSnapshot` contract.\n * Uses `shallowRef` for fine-grained reactivity. The subscription is cleaned up\n * automatically when the owning scope is disposed (e.g. component unmount).\n *\n * Accepts a plain store, a `ref`, or a getter. Pass a getter (`() => props.store`)\n * or a ref when the store can change at runtime — the composable tears down the\n * old subscription and re-subscribes to the new store. A plain value is treated\n * as stable (no re-subscription).\n *\n * @typeParam T - Snapshot type the store exposes via `getSnapshot()`.\n * @param store - The store to subscribe to (or a ref/getter resolving to one).\n * @returns A `ShallowRef` whose `.value` is the current snapshot.\n *\n * @since 0.8.0\n */\nexport function useSubscribableStore<T>(\n store: MaybeRefOrGetter<SubscribableStore<T>>,\n): ShallowRef<T> {\n const snapshot = shallowRef(toValue(store).getSnapshot()) as ShallowRef<T>;\n let unsub: () => void = () => {};\n\n const bind = (s: SubscribableStore<T>): void => {\n unsub();\n snapshot.value = s.getSnapshot();\n unsub = s.subscribe(() => {\n snapshot.value = s.getSnapshot();\n });\n };\n bind(toValue(store));\n\n // Re-subscribe when a reactive `store` (ref/getter) resolves to a new store.\n watch(\n () => toValue(store),\n (s) => bind(s),\n );\n onScopeDispose(() => unsub());\n return snapshot;\n}\n\n/**\n * Subscribe to an {@link AgentStore} and return a reactive snapshot ref.\n *\n * Vue templates and computed properties that read `snapshot.value.messages`\n * etc. will update automatically as the store mutates.\n *\n * @param store - The store to subscribe to (or a ref/getter resolving to one).\n * @returns A `ShallowRef` whose `.value` is the current immutable state snapshot.\n *\n * @example\n * ```vue\n * <script setup>\n * import { useAgentStore } from '@skaile/workspace-bridge-vue'\n *\n * const props = defineProps<{ store: AgentStore }>()\n * // Pass a getter so the snapshot re-binds if `props.store` changes.\n * const snapshot = useAgentStore(() => props.store)\n * // snapshot.value.messages, snapshot.value.streamingText, etc.\n * </script>\n * ```\n */\nexport function useAgentStore(store: MaybeRefOrGetter<AgentStore>): ShallowRef<AgentStoreSnapshot> {\n return useSubscribableStore(store);\n}\n\n/**\n * Subscribe to a {@link ResourceClient} and return a reactive snapshot ref.\n *\n * Re-renders only when the agent emits a `resources_available` event (typically\n * once on connect). The subscription is cleaned up automatically when the owning\n * scope is disposed.\n *\n * @param client - The resource client to subscribe to (or a ref/getter resolving to one).\n * @returns A `ShallowRef` whose `.value` is the current resource snapshot.\n *\n * @example\n * ```vue\n * <script setup>\n * import { useResourceClient } from '@skaile/workspace-bridge-vue'\n *\n * const props = defineProps<{ client: ResourceClient }>()\n * // Pass a getter so the snapshot re-binds if `props.client` changes.\n * const resources = useResourceClient(() => props.client)\n * // resources.value.mounts, resources.value.connectors\n * </script>\n * ```\n */\nexport function useResourceClient(\n client: MaybeRefOrGetter<ResourceClient>,\n): ShallowRef<ResourceClientSnapshot> {\n return useSubscribableStore(client);\n}\n"],"mappings":";AAOA;AAAA,EAEE;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAqBA,SAAS,qBACd,OACe;AACf,QAAM,WAAW,WAAW,QAAQ,KAAK,EAAE,YAAY,CAAC;AACxD,MAAI,QAAoB,MAAM;AAAA,EAAC;AAE/B,QAAM,OAAO,CAAC,MAAkC;AAC9C,UAAM;AACN,aAAS,QAAQ,EAAE,YAAY;AAC/B,YAAQ,EAAE,UAAU,MAAM;AACxB,eAAS,QAAQ,EAAE,YAAY;AAAA,IACjC,CAAC;AAAA,EACH;AACA,OAAK,QAAQ,KAAK,CAAC;AAGnB;AAAA,IACE,MAAM,QAAQ,KAAK;AAAA,IACnB,CAAC,MAAM,KAAK,CAAC;AAAA,EACf;AACA,iBAAe,MAAM,MAAM,CAAC;AAC5B,SAAO;AACT;AAuBO,SAAS,cAAc,OAAqE;AACjG,SAAO,qBAAqB,KAAK;AACnC;AAwBO,SAAS,kBACd,QACoC;AACpC,SAAO,qBAAqB,MAAM;AACpC;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skaile/workspace-bridge-vue",
3
- "version": "0.29.1",
3
+ "version": "0.30.1",
4
4
  "description": "Vue 3.3+ bindings for @skaile/workspaces (useAgentStore, useResourceClient, useSubscribableStore)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -22,7 +22,7 @@
22
22
  "node": ">=20"
23
23
  },
24
24
  "dependencies": {
25
- "@skaile/workspaces": "^0.29.1"
25
+ "@skaile/workspaces": "^0.30.1"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "vue": ">=3.3"