@viamrobotics/motion-tools 1.34.0 → 1.34.2

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.
@@ -181,7 +181,13 @@ export const provideFrames = (partID) => {
181
181
  existing.set(traits.Center, center);
182
182
  }
183
183
  traits.updateGeometryTrait(existing, frame.physicalObject);
184
- if (!isEditMode && !partConfig.hasPendingSave) {
184
+ // Freeze the baseline while the user has unsaved edits so the
185
+ // WorldMatrix formula (live × baseline⁻¹ × edited) previews the
186
+ // edited position rather than amplifying any robot movement.
187
+ // isDirty is used rather than isEditMode because isDirty is $state
188
+ // and updates synchronously; isEditMode derives from viewerMode via
189
+ // a plain $effect and lags by one flush.
190
+ if (!partConfig.isDirty) {
185
191
  const baseline = existing.get(traits.Matrix);
186
192
  if (baseline) {
187
193
  poseToMatrix(pose, baseline);
@@ -197,7 +203,7 @@ export const provideFrames = (partID) => {
197
203
  // values would shift entities whose parents the user is portaling
198
204
  // into — the gizmo's drag target moves underneath it. Once we're
199
205
  // back in monitor mode, the next sync resumes the overwrite.
200
- if (!isEditMode) {
206
+ if (!isEditMode || !editSession.current) {
201
207
  const edited = existing.get(traits.EditedMatrix);
202
208
  if (edited) {
203
209
  poseToMatrix(pose, edited);
@@ -1,20 +0,0 @@
1
- <script lang="ts">
2
- import { Input } from '@viamrobotics/prime-core'
3
-
4
- import { useSettings } from '../../hooks/useSettings.svelte'
5
-
6
- const settings = useSettings()
7
- </script>
8
-
9
- <div class="flex flex-col gap-2.5 text-xs">
10
- <h3 class="border-gray-3 border-b py-1 text-sm"><strong>Anthropic</strong></h3>
11
- <label class="flex flex-col gap-1">
12
- API key
13
- <Input
14
- type="password"
15
- bind:value={settings.current.anthropicKey}
16
- placeholder="sk-ant-..."
17
- />
18
- </label>
19
- <p class="text-gray-5">Used by the Scene Builder AI feature. Stored locally in your browser.</p>
20
- </div>
@@ -1,5 +1,18 @@
1
+ export default AISettings;
2
+ type AISettings = SvelteComponent<{
3
+ [x: string]: never;
4
+ }, {
5
+ [evt: string]: CustomEvent<any>;
6
+ }, {}> & {
7
+ $$bindings?: string | undefined;
8
+ };
9
+ declare const AISettings: $$__sveltets_2_IsomorphicComponent<{
10
+ [x: string]: never;
11
+ }, {
12
+ [evt: string]: CustomEvent<any>;
13
+ }, {}, {}, string>;
1
14
  interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
2
- new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
15
+ new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
3
16
  $$bindings?: Bindings;
4
17
  } & Exports;
5
18
  (internal: unknown, props: {
@@ -11,8 +24,3 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
11
24
  };
12
25
  z_$$bindings?: Bindings;
13
26
  }
14
- declare const AISettings: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
15
- [evt: string]: CustomEvent<any>;
16
- }, {}, {}, string>;
17
- type AISettings = InstanceType<typeof AISettings>;
18
- export default AISettings;
@@ -8,7 +8,6 @@ export { default as Skybox } from './Skybox/Skybox.svelte';
8
8
  export { default as Debug } from './Debug/Debug.svelte';
9
9
  export { default as Focus } from './Focus/Focus.svelte';
10
10
  export { default as LLMSceneBuilder } from './LLMSceneBuilder/LLMSceneBuilder.svelte';
11
- export { default as AISettings } from './LLMSceneBuilder/AISettings.svelte';
12
11
  export type { InferCallback, ComponentFrameInfo } from './LLMSceneBuilder/useSceneBuilder.svelte';
13
12
  export type { FrameDelta } from './LLMSceneBuilder/frameDeltaAdapter';
14
13
  export { default as XR } from './XR/XR.svelte';
@@ -13,6 +13,5 @@ export { default as Debug } from './Debug/Debug.svelte';
13
13
  export { default as Focus } from './Focus/Focus.svelte';
14
14
  // LLMSceneBuilder
15
15
  export { default as LLMSceneBuilder } from './LLMSceneBuilder/LLMSceneBuilder.svelte';
16
- export { default as AISettings } from './LLMSceneBuilder/AISettings.svelte';
17
16
  export { default as XR } from './XR/XR.svelte';
18
17
  export { default as XRSettings } from './XR/XRSettings.svelte';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viamrobotics/motion-tools",
3
- "version": "1.34.0",
3
+ "version": "1.34.2",
4
4
  "description": "Motion visualization with Viam",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -1,7 +0,0 @@
1
- import { type InferCallback } from '../plugins';
2
- interface StandaloneLLMContext {
3
- current: InferCallback;
4
- }
5
- export declare const provideStandaloneLLM: () => StandaloneLLMContext;
6
- export declare const useStandaloneLLMContext: () => StandaloneLLMContext;
7
- export {};
@@ -1,32 +0,0 @@
1
- import { getContext, setContext } from 'svelte';
2
- import { backendIP, websocketPort } from '../defines';
3
- import { useSettings } from './useSettings.svelte';
4
- import {} from '../plugins';
5
- const key = Symbol('standalone-llm-context');
6
- export const provideStandaloneLLM = () => {
7
- const settings = useSettings();
8
- const standaloneInfer = async (prompt, components) => {
9
- const res = await fetch(`http://${backendIP}:${websocketPort}/scene-builder`, {
10
- method: 'POST',
11
- headers: { 'Content-Type': 'application/json' },
12
- body: JSON.stringify({
13
- prompt,
14
- components,
15
- anthropicKey: settings.current.anthropicKey || undefined,
16
- }),
17
- });
18
- if (!res.ok) {
19
- throw new Error(`${res.status}: ${await res.text()}`);
20
- }
21
- return res.json();
22
- };
23
- const context = setContext(key, {
24
- get current() {
25
- return standaloneInfer;
26
- },
27
- });
28
- return context;
29
- };
30
- export const useStandaloneLLMContext = () => {
31
- return getContext(key);
32
- };