From 264779a9d0b9fd696e7ced7abba2dd6fca801661 Mon Sep 17 00:00:00 2001 From: Zookeeper Lee Date: Mon, 14 Apr 2025 12:09:45 -0400 Subject: [PATCH 1/3] Follow up: Stream Idle PR (#6238) * Use a dropdown for stream idle setting * Add support for undefined values in dropdowns * Move cache bust to the beginning of engine open for reconnections * yarn tsc * Don't setup model feature highlighters until the connection is ready * Wait 2s to give engine time to serve video, then listen for modeling commands * Undo teardown * yarn fmt * Fix circular module dependency; fmt & lint & tsc * Fix editor-test waiting for 2 instead of 1 * Increment another 2 numbers ... --------- Co-authored-by: Pierre Jacquier --- e2e/playwright/editor-tests.spec.ts | 8 +- src/components/EngineCommands.tsx | 2 +- .../Settings/SettingsFieldInput.tsx | 5 +- src/hooks/useEngineConnectionSubscriptions.ts | 12 +- src/lang/KclSingleton.ts | 2 +- src/lang/std/commandLog.ts | 31 ++++ src/lang/std/engineConnection.ts | 86 +++++------- src/lib/coredump.ts | 6 +- src/lib/settings/initialSettings.tsx | 132 +++++------------- src/lib/singletons.ts | 5 + src/machines/engineStreamMachine.ts | 16 +-- 11 files changed, 128 insertions(+), 177 deletions(-) create mode 100644 src/lang/std/commandLog.ts diff --git a/e2e/playwright/editor-tests.spec.ts b/e2e/playwright/editor-tests.spec.ts index 597358b69..9b6a0ecb2 100644 --- a/e2e/playwright/editor-tests.spec.ts +++ b/e2e/playwright/editor-tests.spec.ts @@ -82,7 +82,7 @@ sketch001 = startSketchOn(XY) .poll(() => page.locator('[data-receive-command-type="scene_clear_all"]').count() ) - .toBe(1) + .toBe(2) await expect .poll(() => page.locator('[data-message-type="execution-done"]').count()) .toBe(2) @@ -106,7 +106,7 @@ sketch001 = startSketchOn(XY) ).toHaveCount(3) await expect( page.locator('[data-receive-command-type="scene_clear_all"]') - ).toHaveCount(1) + ).toHaveCount(2) }) test('ensure we use the cache, and do not clear on append', async ({ @@ -133,7 +133,7 @@ sketch001 = startSketchOn(XY) await u.openDebugPanel() await expect( page.locator('[data-receive-command-type="scene_clear_all"]') - ).toHaveCount(1) + ).toHaveCount(2) await expect( page.locator('[data-message-type="execution-done"]') ).toHaveCount(2) @@ -161,7 +161,7 @@ sketch001 = startSketchOn(XY) ).toHaveCount(3) await expect( page.locator('[data-receive-command-type="scene_clear_all"]') - ).toHaveCount(1) + ).toHaveCount(2) }) test('if you click the format button it formats your code', async ({ diff --git a/src/components/EngineCommands.tsx b/src/components/EngineCommands.tsx index 6bf3cfd20..7db85f75d 100644 --- a/src/components/EngineCommands.tsx +++ b/src/components/EngineCommands.tsx @@ -1,6 +1,6 @@ import { useEffect, useState } from 'react' -import type { CommandLog } from '@src/lang/std/engineConnection' +import type { CommandLog } from '@src/lang/std/commandLog' import { engineCommandManager } from '@src/lib/singletons' import { reportRejection } from '@src/lib/trap' diff --git a/src/components/Settings/SettingsFieldInput.tsx b/src/components/Settings/SettingsFieldInput.tsx index a70ae59ed..a5a45bfa3 100644 --- a/src/components/Settings/SettingsFieldInput.tsx +++ b/src/components/Settings/SettingsFieldInput.tsx @@ -101,7 +101,10 @@ export function SettingsFieldInput({ type: `set.${category}.${settingName}`, data: { level: settingsLevel, - value: e.target.value, + // undefined is the only special string due to no way to + // encode it in the string-only options. + value: + e.target.value === 'undefined' ? undefined : e.target.value, }, } as unknown as EventFrom) } diff --git a/src/hooks/useEngineConnectionSubscriptions.ts b/src/hooks/useEngineConnectionSubscriptions.ts index 9da09dcb2..13e911ad1 100644 --- a/src/hooks/useEngineConnectionSubscriptions.ts +++ b/src/hooks/useEngineConnectionSubscriptions.ts @@ -27,6 +27,8 @@ import { } from '@src/lib/singletons' import { err, reportRejection } from '@src/lib/trap' import { getModuleId } from '@src/lib/utils' +import { engineStreamActor } from '@src/machines/appMachine' +import { EngineStreamState } from '@src/machines/engineStreamMachine' import type { EdgeCutInfo, ExtrudeFacePlane, @@ -38,8 +40,11 @@ export function useEngineConnectionSubscriptions() { const stateRef = useRef(state) stateRef.current = state + const engineStreamState = engineStreamActor.getSnapshot() + useEffect(() => { if (!engineCommandManager) return + if (engineStreamState.value !== EngineStreamState.Playing) return const unSubHover = engineCommandManager.subscribeToUnreliable({ // Note this is our hover logic, "highlight_set_entity" is the event that is fired when we hover over an entity @@ -76,9 +81,12 @@ export function useEngineConnectionSubscriptions() { unSubHover() unSubClick() } - }, [engineCommandManager, context?.sketchEnginePathId]) + }, [engineCommandManager, engineStreamState, context?.sketchEnginePathId]) useEffect(() => { + if (!engineCommandManager) return + if (engineStreamState.value !== EngineStreamState.Playing) return + const unSub = engineCommandManager.subscribeTo({ event: 'select_with_point', callback: state.matches('Sketch no face') @@ -342,5 +350,5 @@ export function useEngineConnectionSubscriptions() { : () => {}, }) return unSub - }, [state]) + }, [engineCommandManager, engineStreamState, state]) } diff --git a/src/lang/KclSingleton.ts b/src/lang/KclSingleton.ts index 989da6441..8fb9aaaa1 100644 --- a/src/lang/KclSingleton.ts +++ b/src/lang/KclSingleton.ts @@ -19,8 +19,8 @@ import { } from '@src/lang/errors' import { executeAst, executeAstMock, lintAst } from '@src/lang/langHelpers' import { getNodeFromPath, getSettingsAnnotation } from '@src/lang/queryAst' +import { CommandLogType } from '@src/lang/std/commandLog' import type { EngineCommandManager } from '@src/lang/std/engineConnection' -import { CommandLogType } from '@src/lang/std/engineConnection' import { topLevelRange } from '@src/lang/util' import type { ArtifactGraph, diff --git a/src/lang/std/commandLog.ts b/src/lang/std/commandLog.ts new file mode 100644 index 000000000..c42842fd0 --- /dev/null +++ b/src/lang/std/commandLog.ts @@ -0,0 +1,31 @@ +import type { Models } from '@kittycad/lib' +import type { EngineCommand } from '@src/lang/std/artifactGraph' + +export enum CommandLogType { + SendModeling = 'send-modeling', + SendScene = 'send-scene', + ReceiveReliable = 'receive-reliable', + ExecutionDone = 'execution-done', + ExportDone = 'export-done', + SetDefaultSystemProperties = 'set_default_system_properties', +} + +export type CommandLog = + | { + type: CommandLogType.SendModeling + data: EngineCommand + } + | { + type: CommandLogType.SendScene + data: EngineCommand + } + | { + type: CommandLogType.ReceiveReliable + data: Models['OkWebSocketResponseData_type'] + id: string + cmd_type?: string + } + | { + type: CommandLogType.ExecutionDone + data: null + } diff --git a/src/lang/std/engineConnection.ts b/src/lang/std/engineConnection.ts index faed48549..fbc6e5df7 100644 --- a/src/lang/std/engineConnection.ts +++ b/src/lang/std/engineConnection.ts @@ -1,15 +1,20 @@ import type { Models } from '@kittycad/lib' import { VITE_KC_API_WS_MODELING_URL, VITE_KC_DEV_TOKEN } from '@src/env' +import { jsAppSettings } from '@src/lib/settings/settingsUtils' import { BSON } from 'bson' import type { MachineManager } from '@src/components/MachineManagerProvider' import type { useModelingContext } from '@src/hooks/useModelingContext' +import type CodeManager from '@src/lang/codeManager' import type { KclManager } from '@src/lang/KclSingleton' import type { EngineCommand, ResponseMap } from '@src/lang/std/artifactGraph' +import type { CommandLog } from '@src/lang/std/commandLog' +import { CommandLogType } from '@src/lang/std/commandLog' import type { SourceRange } from '@src/lang/wasm' import { defaultSourceRange } from '@src/lang/wasm' import { EXECUTE_AST_INTERRUPT_ERROR_MESSAGE } from '@src/lib/constants' import { markOnce } from '@src/lib/performance' +import type RustContext from '@src/lib/rustContext' import type { SettingsViaQueryString } from '@src/lib/settings/settingsTypes' import { Themes, @@ -28,8 +33,6 @@ function isHighlightSetEntity_type( return data.entity_id && data.sequence } -type OkWebSocketResponseData = Models['OkWebSocketResponseData_type'] - interface NewTrackArgs { conn: EngineConnection mediaStream: MediaStream @@ -658,6 +661,22 @@ class EngineConnection extends EventTarget { detail: { conn: this, mediaStream: this.mediaStream! }, }) ) + + setTimeout(() => { + // Everything is now connected. + this.state = { + type: EngineConnectionStateType.ConnectionEstablished, + } + + this.engineCommandManager.inSequence = 1 + + this.dispatchEvent( + new CustomEvent(EngineConnectionEvents.Opened, { + detail: this, + }) + ) + markOnce('code/endInitialEngineConnect') + }, 2000) break case 'connecting': break @@ -785,18 +804,6 @@ class EngineConnection extends EventTarget { type: ConnectingType.DataChannelEstablished, }, } - - // Everything is now connected. - this.state = { - type: EngineConnectionStateType.ConnectionEstablished, - } - - this.engineCommandManager.inSequence = 1 - - this.dispatchEvent( - new CustomEvent(EngineConnectionEvents.Opened, { detail: this }) - ) - markOnce('code/endInitialEngineConnect') } this.unreliableDataChannel?.addEventListener( 'open', @@ -1269,35 +1276,6 @@ export interface Subscription { ) => void } -export enum CommandLogType { - SendModeling = 'send-modeling', - SendScene = 'send-scene', - ReceiveReliable = 'receive-reliable', - ExecutionDone = 'execution-done', - ExportDone = 'export-done', - SetDefaultSystemProperties = 'set_default_system_properties', -} - -export type CommandLog = - | { - type: CommandLogType.SendModeling - data: EngineCommand - } - | { - type: CommandLogType.SendScene - data: EngineCommand - } - | { - type: CommandLogType.ReceiveReliable - data: OkWebSocketResponseData - id: string - cmd_type?: string - } - | { - type: CommandLogType.ExecutionDone - data: null - } - export enum EngineCommandManagerEvents { // engineConnection is available but scene setup may not have run EngineAvailable = 'engine-available', @@ -1398,6 +1376,7 @@ export class EngineCommandManager extends EventTarget { private onEngineConnectionOpened = () => {} private onEngineConnectionClosed = () => {} + private onVideoTrackMute = () => {} private onDarkThemeMediaQueryChange = (e: MediaQueryListEvent) => { this.setTheme(e.matches ? Themes.Dark : Themes.Light).catch(reportRejection) } @@ -1408,6 +1387,8 @@ export class EngineCommandManager extends EventTarget { modelingSend: ReturnType['send'] = (() => {}) as any kclManager: null | KclManager = null + codeManager?: CodeManager + rustContext?: RustContext // The current "manufacturing machine" aka 3D printer, CNC, etc. public machineManager: MachineManager | null = null @@ -1480,6 +1461,11 @@ export class EngineCommandManager extends EventTarget { // eslint-disable-next-line @typescript-eslint/no-misused-promises this.onEngineConnectionOpened = async () => { + await this.rustContext?.clearSceneAndBustCache( + { settings: await jsAppSettings() }, + this.codeManager?.currentFilePath || undefined + ) + // Set the stream's camera projection type // We don't send a command to the engine if in perspective mode because // for now it's the engine's default. @@ -1695,15 +1681,17 @@ export class EngineCommandManager extends EventTarget { delete this.pendingCommands[message.request_id || ''] }) as EventListener) + this.onVideoTrackMute = () => { + console.error('video track mute: check webrtc internals -> inbound rtp') + } + this.onEngineConnectionNewTrack = ({ detail: { mediaStream }, }: CustomEvent) => { - mediaStream.getVideoTracks()[0].addEventListener('mute', () => { - console.error( - 'video track mute: check webrtc internals -> inbound rtp' - ) - }) - + // Engine side had an oopsie (client sent trickle_ice, engine no happy) + mediaStream + .getVideoTracks()[0] + .addEventListener('mute', this.onVideoTrackMute) setMediaStream(mediaStream) } this.engineConnection?.addEventListener( diff --git a/src/lib/coredump.ts b/src/lib/coredump.ts index fa528c4ff..4299ea41d 100644 --- a/src/lib/coredump.ts +++ b/src/lib/coredump.ts @@ -5,10 +5,8 @@ import type { OsInfo } from '@rust/kcl-lib/bindings/OsInfo' import type { WebrtcStats } from '@rust/kcl-lib/bindings/WebrtcStats' import type CodeManager from '@src/lang/codeManager' -import type { - CommandLog, - EngineCommandManager, -} from '@src/lang/std/engineConnection' +import type { CommandLog } from '@src/lang/std/commandLog' +import type { EngineCommandManager } from '@src/lang/std/engineConnection' import { isDesktop } from '@src/lib/isDesktop' import type RustContext from '@src/lib/rustContext' import screenshot from '@src/lib/screenshot' diff --git a/src/lib/settings/initialSettings.tsx b/src/lib/settings/initialSettings.tsx index 27d559459..5d6982aa7 100644 --- a/src/lib/settings/initialSettings.tsx +++ b/src/lib/settings/initialSettings.tsx @@ -1,4 +1,4 @@ -import { useRef, useState } from 'react' +import { useRef } from 'react' import type { CameraOrbitType } from '@rust/kcl-lib/bindings/CameraOrbitType' import type { CameraProjectionType } from '@rust/kcl-lib/bindings/CameraProjectionType' @@ -6,7 +6,6 @@ import type { NamedView } from '@rust/kcl-lib/bindings/NamedView' import type { OnboardingStatus } from '@rust/kcl-lib/bindings/OnboardingStatus' import { CustomIcon } from '@src/components/CustomIcon' -import { Toggle } from '@src/components/Toggle/Toggle' import Tooltip from '@src/components/Tooltip' import type { CameraSystem } from '@src/lib/cameraControls' import { cameraMouseDragGuards, cameraSystems } from '@src/lib/cameraControls' @@ -216,104 +215,37 @@ export function createSettings() { hideOnLevel: 'project', description: 'Save bandwidth & battery', validate: (v) => - v === undefined || - (typeof v === 'number' && - v >= 1 * MS_IN_MINUTE && - v <= 60 * MS_IN_MINUTE), - Component: ({ - value: settingValueInStorage, - updateValue: writeSettingValueToStorage, - }) => { - const [timeoutId, setTimeoutId] = useState< - ReturnType | undefined - >(undefined) - const [preview, setPreview] = useState( - settingValueInStorage === undefined - ? settingValueInStorage - : settingValueInStorage / MS_IN_MINUTE - ) - const onChangeRange = (e: React.SyntheticEvent) => { - if ( - !( - e.isTrusted && - 'value' in e.currentTarget && - e.currentTarget.value - ) - ) - return - setPreview(Number(e.currentTarget.value)) - } - const onSaveRange = (e: React.SyntheticEvent) => { - if (preview === undefined) return - if ( - !( - e.isTrusted && - 'value' in e.currentTarget && - e.currentTarget.value - ) - ) - return - writeSettingValueToStorage( - Number(e.currentTarget.value) * MS_IN_MINUTE - ) - } - - return ( -
- ) => { - if (timeoutId) { - return - } - const isChecked = event.currentTarget.checked - clearTimeout(timeoutId) - setTimeoutId( - setTimeout(() => { - const requested = !isChecked ? undefined : 5 - setPreview(requested) - writeSettingValueToStorage( - requested === undefined - ? undefined - : Number(requested) * MS_IN_MINUTE - ) - setTimeoutId(undefined) - }, 100) - ) - }} - className="block w-4 h-4" - /> -
- - {preview !== undefined && preview !== null && ( -
- {preview / MS_IN_MINUTE === 60 - ? '1 hour' - : preview / MS_IN_MINUTE === 1 - ? '1 minute' - : preview + ' minutes'} -
- )} -
-
- ) + String(v) == 'undefined' || + (Number(v) >= 0 && Number(v) <= 60 * MS_IN_MINUTE), + commandConfig: { + inputType: 'options', + defaultValueFromContext: (context) => + context.app.streamIdleMode.current, + options: (cmdContext, settingsContext) => + [ + undefined, + 5 * 1000, + 30 * 1000, + 1 * MS_IN_MINUTE, + 2 * MS_IN_MINUTE, + 5 * MS_IN_MINUTE, + 15 * MS_IN_MINUTE, + 30 * MS_IN_MINUTE, + 60 * MS_IN_MINUTE, + ].map((v) => ({ + name: + v === undefined + ? 'Off' + : v < MS_IN_MINUTE + ? `${Math.floor(v / 1000)} seconds` + : `${Math.floor(v / MS_IN_MINUTE)} minutes`, + value: v, + isCurrent: + v === + settingsContext.app.streamIdleMode[ + cmdContext.argumentsToSubmit.level as SettingsLevel + ], + })), }, }), allowOrbitInSketchMode: new Setting({ diff --git a/src/lib/singletons.ts b/src/lib/singletons.ts index 712ada0e3..7ff9134d0 100644 --- a/src/lib/singletons.ts +++ b/src/lib/singletons.ts @@ -44,7 +44,12 @@ export const kclManager = new KclManager(engineCommandManager, { // CYCLIC REF editorManager.kclManager = kclManager +// These are all late binding because of their circular dependency. +// TODO: proper dependency injection. engineCommandManager.kclManager = kclManager +engineCommandManager.codeManager = codeManager +engineCommandManager.rustContext = rustContext + kclManager.sceneInfraBaseUnitMultiplierSetter = (unit: BaseUnit) => { sceneInfra.baseUnit = unit } diff --git a/src/machines/engineStreamMachine.ts b/src/machines/engineStreamMachine.ts index ba2b0b8c9..04b656bee 100644 --- a/src/machines/engineStreamMachine.ts +++ b/src/machines/engineStreamMachine.ts @@ -1,10 +1,4 @@ -import { jsAppSettings } from '@src/lib/settings/settingsUtils' -import { - codeManager, - engineCommandManager, - rustContext, - sceneInfra, -} from '@src/lib/singletons' +import { engineCommandManager, sceneInfra } from '@src/lib/singletons' import type { MutableRefObject } from 'react' import type { ActorRefFrom } from 'xstate' import { assign, fromPromise, setup } from 'xstate' @@ -129,14 +123,6 @@ export const engineStreamMachine = setup({ await holdOntoVideoFrameInCanvas(video, canvas) video.style.display = 'none' - // Before doing anything else clear the cache - // Originally I (lee) had this on the reconnect but it was interfering - // with kclManager.executeCode()? - await rustContext.clearSceneAndBustCache( - { settings: await jsAppSettings() }, - codeManager.currentFilePath || undefined - ) - await sceneInfra.camControls.saveRemoteCameraState() // Make sure we're on the next frame for no flickering between canvas From 542a9a3f1365618ab87316d507b28ae3259abf46 Mon Sep 17 00:00:00 2001 From: Jonathan Tran Date: Mon, 14 Apr 2025 12:19:09 -0400 Subject: [PATCH 2/3] Fix to update prompt-to-edit snapshot (#6320) * Fix to update prompt-to-edit snapshot * Delete snapshot with no TS test file --- ...hot-tests-spec-ts--change-colour.snap.json | 33 ------------------- ...example-snapshots--change-colour.snap.json | 9 ++--- 2 files changed, 5 insertions(+), 37 deletions(-) delete mode 100644 e2e/playwright/snapshots/prompt-to-edit/prompt-to-edit-snapshot-tests-spec-ts--change-colour.snap.json diff --git a/e2e/playwright/snapshots/prompt-to-edit/prompt-to-edit-snapshot-tests-spec-ts--change-colour.snap.json b/e2e/playwright/snapshots/prompt-to-edit/prompt-to-edit-snapshot-tests-spec-ts--change-colour.snap.json deleted file mode 100644 index 9636941ee..000000000 --- a/e2e/playwright/snapshots/prompt-to-edit/prompt-to-edit-snapshot-tests-spec-ts--change-colour.snap.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "original_source_code": "sketch001 = startSketchOn(XZ)\nprofile001 = startProfileAt([57.81, 250.51], sketch001)\n |> line(end = [121.13, 56.63], tag = $seg02)\n |> line(end = [83.37, -34.61], tag = $seg01)\n |> line(end = [19.66, -116.4])\n |> line(end = [-221.8, -41.69])\n |> line(endAbsolute = [profileStartX(%), profileStartY(%)])\n |> close()\nextrude001 = extrude(profile001, length = 200)\nsketch002 = startSketchOn('XZ')\n |> startProfileAt([-73.64, -42.89], %)\n |> xLine(length = 173.71)\n |> line(end = [-22.12, -94.4])\n |> xLine(length = -156.98)\n |> line(endAbsolute = [profileStartX(%), profileStartY(%)])\n |> close()\nextrude002 = extrude(sketch002, length = 50)\nsketch003 = startSketchOn(XY)\n |> startProfileAt([52.92, 157.81], %)\n |> angledLine(angle = 0, length = 176.4, tag = $rectangleSegmentA001)\n |> angledLine(angle = segAng(rectangleSegmentA001) - 90,\n length = 53.4\n ], tag = $rectangleSegmentB001)\n |> angledLine(angle = segAng(rectangleSegmentA001),\n length = -segLen(rectangleSegmentA001)\n tag = $rectangleSegmentC001)\n |> line(endAbsolute = [profileStartX(%), profileStartY(%)])\n |> close()\nextrude003 = extrude(sketch003, length = 20)\n", - "prompt": "make this neon green please, use #39FF14", - "source_ranges": [ - { - "prompt": "The users main selection is the end cap of a general-sweep (that is an extrusion, revolve, sweep or loft).\nThe source range most likely refers to \"startProfileAt\" simply because this is the start of the profile that was swept.\nIf you need to operate on this cap, for example for sketching on the face, you can use the special string END i.e. `startSketchOn(someSweepVariable, END)`\nWhen they made this selection they main have intended this surface directly or meant something more general like the sweep body.\nSee later source ranges for more context.", - "range": { - "start": { - "line": 11, - "column": 5 - }, - "end": { - "line": 11, - "column": 40 - } - } - }, - { - "prompt": "This is the sweep's source range from the user's main selection of the end cap.", - "range": { - "start": { - "line": 17, - "column": 13 - }, - "end": { - "line": 17, - "column": 44 - } - } - } - ], - "kcl_version": "0.2.48" -} diff --git a/e2e/playwright/snapshots/prompt-to-edit/prompt-to-edit-snapshot-tests-spec-ts--edit-with-ai-example-snapshots--change-colour.snap.json b/e2e/playwright/snapshots/prompt-to-edit/prompt-to-edit-snapshot-tests-spec-ts--edit-with-ai-example-snapshots--change-colour.snap.json index 94b3ec8ef..e8925316b 100644 --- a/e2e/playwright/snapshots/prompt-to-edit/prompt-to-edit-snapshot-tests-spec-ts--edit-with-ai-example-snapshots--change-colour.snap.json +++ b/e2e/playwright/snapshots/prompt-to-edit/prompt-to-edit-snapshot-tests-spec-ts--edit-with-ai-example-snapshots--change-colour.snap.json @@ -1,9 +1,9 @@ { - "original_source_code": "sketch001 = startSketchOn(XZ)\nprofile001 = startProfileAt([57.81, 250.51], sketch001)\n |> line(end = [121.13, 56.63], tag = $seg02)\n |> line(end = [83.37, -34.61], tag = $seg01)\n |> line(end = [19.66, -116.4])\n |> line(end = [-221.8, -41.69])\n |> line(endAbsolute = [profileStartX(%), profileStartY(%)])\n |> close()\nextrude001 = extrude(profile001, length = 200)\nsketch002 = startSketchOn(XZ)\n |> startProfileAt([-73.64, -42.89], %)\n |> xLine(length = 173.71)\n |> line(end = [-22.12, -94.4])\n |> xLine(length = -156.98)\n |> line(endAbsolute = [profileStartX(%), profileStartY(%)])\n |> close()\nextrude002 = extrude(sketch002, length = 50)\nsketch003 = startSketchOn(XY)\n |> startProfileAt([52.92, 157.81], %)\n |> angledLine(angle = 0, 176.4], %, $rectangleSegmentA001)\n |> angledLine([\n segAng(rectangleSegmentA001) - 90,\n 53.4\n ], %, length = $rectangleSegmentB001)\n |> angledLine(\n angle = segAng(rectangleSegmentA001),\n length = -segLen(rectangleSegmentA001),\n tag = $rectangleSegmentC001)\n |> line(endAbsolute = [profileStartX(%), profileStartY(%)])\n |> close()\nextrude003 = extrude(sketch003, length = 20)\n", + "original_source_code": "sketch001 = startSketchOn(XZ)\nprofile001 = startProfileAt([57.81, 250.51], sketch001)\n |> line(end = [121.13, 56.63], tag = $seg02)\n |> line(end = [83.37, -34.61], tag = $seg01)\n |> line(end = [19.66, -116.4])\n |> line(end = [-221.8, -41.69])\n |> line(endAbsolute = [profileStartX(%), profileStartY(%)])\n |> close()\nextrude001 = extrude(profile001, length = 200)\nsketch002 = startSketchOn(XZ)\n |> startProfileAt([-73.64, -42.89], %)\n |> xLine(length = 173.71)\n |> line(end = [-22.12, -94.4])\n |> xLine(length = -156.98)\n |> line(endAbsolute = [profileStartX(%), profileStartY(%)])\n |> close()\nextrude002 = extrude(sketch002, length = 50)\nsketch003 = startSketchOn(XY)\n |> startProfileAt([52.92, 157.81], %)\n |> angledLine(angle = 0, length = 176.4, tag = $rectangleSegmentA001)\n |> angledLine(\n angle = segAng(rectangleSegmentA001) - 90,\n length = 53.4,\n tag = $rectangleSegmentB001,\n )\n |> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001), tag = $rectangleSegmentC001)\n |> line(endAbsolute = [profileStartX(%), profileStartY(%)])\n |> close()\nextrude003 = extrude(sketch003, length = 20)\n", "prompt": "make this neon green please, use #39FF14", "source_ranges": [ { - "prompt": "The users main selection is the end cap of a general-sweep (that is an extrusion, revolve, sweep or loft).\nThe source range most likely refers to \"startProfileAt\" simply because this is the start of the profile that was swept.\nIf you need to operate on this cap, for example for sketching on the face, you can use the special string END i.e. `startSketchOn(someSweepVariable, END)`\nWhen they made this selection they main have intended this surface directly or meant something more general like the sweep body.\nSee later source ranges for more context.", + "prompt": "The users main selection is the end cap of a general-sweep (that is an extrusion, revolve, sweep or loft).\nThe source range most likely refers to \"startProfileAt\" simply because this is the start of the profile that was swept.\nIf you need to operate on this cap, for example for sketching on the face, you can use the special string END i.e. `startSketchOn(someSweepVariable, face = END)`\nWhen they made this selection they main have intended this surface directly or meant something more general like the sweep body.\nSee later source ranges for more context.", "range": { "start": { "line": 11, @@ -29,5 +29,6 @@ } } ], - "kcl_version": "0.2.57" -} + "project_name": "testDefault", + "kcl_version": "0.2.61" +} \ No newline at end of file From 6c7e42b54135aa1518214c9c765fb9ba39b7ba18 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Apr 2025 09:48:43 -0700 Subject: [PATCH 3/3] Bump the patch group in /rust with 8 updates (#6312) Bumps the patch group in /rust with 8 updates: | Package | From | To | | --- | --- | --- | | [anyhow](https://github.com/dtolnay/anyhow) | `1.0.97` | `1.0.98` | | [clap](https://github.com/clap-rs/clap) | `4.5.32` | `4.5.36` | | [kittycad-modeling-cmds](https://github.com/KittyCAD/modeling-api) | `0.2.113` | `0.2.114` | | [once_cell](https://github.com/matklad/once_cell) | `1.21.1` | `1.21.3` | | [log](https://github.com/rust-lang/log) | `0.4.26` | `0.4.27` | | [flate2](https://github.com/rust-lang/flate2-rs) | `1.1.0` | `1.1.1` | | [time](https://github.com/time-rs/time) | `0.3.40` | `0.3.41` | | [image](https://github.com/image-rs/image) | `0.25.5` | `0.25.6` | Updates `anyhow` from 1.0.97 to 1.0.98 - [Release notes](https://github.com/dtolnay/anyhow/releases) - [Commits](https://github.com/dtolnay/anyhow/compare/1.0.97...1.0.98) Updates `clap` from 4.5.32 to 4.5.36 - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.32...clap_complete-v4.5.36) Updates `kittycad-modeling-cmds` from 0.2.113 to 0.2.114 - [Commits](https://github.com/KittyCAD/modeling-api/compare/kittycad-modeling-cmds-0.2.113...kittycad-modeling-cmds-0.2.114) Updates `once_cell` from 1.21.1 to 1.21.3 - [Changelog](https://github.com/matklad/once_cell/blob/master/CHANGELOG.md) - [Commits](https://github.com/matklad/once_cell/compare/v1.21.1...v1.21.3) Updates `log` from 0.4.26 to 0.4.27 - [Release notes](https://github.com/rust-lang/log/releases) - [Changelog](https://github.com/rust-lang/log/blob/master/CHANGELOG.md) - [Commits](https://github.com/rust-lang/log/compare/0.4.26...0.4.27) Updates `flate2` from 1.1.0 to 1.1.1 - [Release notes](https://github.com/rust-lang/flate2-rs/releases) - [Commits](https://github.com/rust-lang/flate2-rs/compare/1.1.0...1.1.1) Updates `time` from 0.3.40 to 0.3.41 - [Release notes](https://github.com/time-rs/time/releases) - [Changelog](https://github.com/time-rs/time/blob/main/CHANGELOG.md) - [Commits](https://github.com/time-rs/time/compare/v0.3.40...v0.3.41) Updates `image` from 0.25.5 to 0.25.6 - [Changelog](https://github.com/image-rs/image/blob/main/CHANGES.md) - [Commits](https://github.com/image-rs/image/compare/v0.25.5...v0.25.6) --- updated-dependencies: - dependency-name: anyhow dependency-version: 1.0.98 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: patch - dependency-name: clap dependency-version: 4.5.36 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: patch - dependency-name: kittycad-modeling-cmds dependency-version: 0.2.114 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: patch - dependency-name: once_cell dependency-version: 1.21.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: patch - dependency-name: log dependency-version: 0.4.27 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: patch - dependency-name: flate2 dependency-version: 1.1.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: patch - dependency-name: time dependency-version: 0.3.41 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: patch - dependency-name: image dependency-version: 0.25.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- rust/Cargo.lock | 40 ++++++++++----------- rust/Cargo.toml | 4 +-- rust/kcl-derive-docs/Cargo.toml | 2 +- rust/kcl-language-server-release/Cargo.toml | 6 ++-- rust/kcl-language-server/Cargo.toml | 2 +- rust/kcl-lib/Cargo.toml | 6 ++-- rust/kcl-test-server/Cargo.toml | 2 +- 7 files changed, 31 insertions(+), 31 deletions(-) diff --git a/rust/Cargo.lock b/rust/Cargo.lock index fd7a558a8..f46844bca 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -133,9 +133,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.97" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcfed56ad506cb2c684a14971b8861fdc3baaaae314b9e5f9bb532cbe3ba7a4f" +checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" dependencies = [ "backtrace", ] @@ -482,9 +482,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.32" +version = "4.5.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6088f3ae8c3608d19260cd7445411865a485688711b78b5be70d78cd96136f83" +checksum = "2df961d8c8a0d08aa9945718ccf584145eee3f3aa06cddbeac12933781102e04" dependencies = [ "clap_builder", "clap_derive", @@ -492,9 +492,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.32" +version = "4.5.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22a7ef7f676155edfb82daa97f99441f3ebf4a58d5e32f295a56259f1b6facc8" +checksum = "132dbda40fb6753878316a489d5a1242a8ef2f0d9e47ba01c951ea8aa7d013a5" dependencies = [ "anstream", "anstyle", @@ -995,9 +995,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11faaf5a5236997af9848be0bef4db95824b1d534ebc64d0f0c6cf3e67bd38dc" +checksum = "7ced92e76e966ca2fd84c8f7aa01a4aea65b0eb6648d72f7c8f3e2764a67fece" dependencies = [ "crc32fast", "miniz_oxide", @@ -1615,9 +1615,9 @@ dependencies = [ [[package]] name = "image" -version = "0.25.5" +version = "0.25.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd6f44aed642f18953a158afeb30206f4d50da59fbc66ecb53c66488de73563b" +checksum = "db35664ce6b9810857a38a906215e75a9c879f0696556a39f59c62829710251a" dependencies = [ "bytemuck", "byteorder-lite", @@ -2033,9 +2033,9 @@ dependencies = [ [[package]] name = "kittycad-modeling-cmds" -version = "0.2.113" +version = "0.2.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa1c927569925425a1b03711617c384a30cb7554394e8a6a01266910b22421de" +checksum = "681ce29b9da92aa6f8bfc003ccb79a9f1a84368e064d68684327b3181dfe16ec" dependencies = [ "anyhow", "chrono", @@ -2156,9 +2156,9 @@ checksum = "9374ef4228402d4b7e403e5838cb880d9ee663314b0a900d5a6aabf0c213552e" [[package]] name = "log" -version = "0.4.26" +version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" dependencies = [ "serde", ] @@ -2414,9 +2414,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.21.1" +version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75b0bedcc4fe52caa0e03d9f1151a323e4aa5e2d78ba3580400cd3c9e2bc4bc" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] name = "oncemutex" @@ -3890,9 +3890,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.40" +version = "0.3.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d9c75b47bdff86fa3334a3db91356b8d7d86a9b839dab7d0bdc5c3d3a077618" +checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40" dependencies = [ "deranged", "itoa", @@ -3911,9 +3911,9 @@ checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c" [[package]] name = "time-macros" -version = "0.2.21" +version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29aa485584182073ed57fd5004aa09c371f021325014694e432313345865fd04" +checksum = "3526739392ec93fd8b359c8e98514cb3e8e021beb4e5f597b00a0221f8ed8a49" dependencies = [ "num-conv", "time-core", diff --git a/rust/Cargo.toml b/rust/Cargo.toml index cb5b26e57..2a0a01e17 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -31,12 +31,12 @@ debug = "line-tables-only" async-trait = "0.1.88" anyhow = { version = "1" } bson = { version = "2.13.0", features = ["uuid-1", "chrono"] } -clap = { version = "4.5.31", features = ["derive"] } +clap = { version = "4.5.36", features = ["derive"] } dashmap = { version = "6.1.0" } http = "1" indexmap = "2.7.0" kittycad = { version = "0.3.36", default-features = false, features = ["js", "requests"] } -kittycad-modeling-cmds = { version = "0.2.113", features = ["ts-rs", "websocket"] } +kittycad-modeling-cmds = { version = "0.2.114", features = ["ts-rs", "websocket"] } lazy_static = "1.5.0" miette = "7.5.0" pyo3 = { version = "0.24.1" } diff --git a/rust/kcl-derive-docs/Cargo.toml b/rust/kcl-derive-docs/Cargo.toml index 7b8927616..b2fce0d1f 100644 --- a/rust/kcl-derive-docs/Cargo.toml +++ b/rust/kcl-derive-docs/Cargo.toml @@ -14,7 +14,7 @@ bench = false [dependencies] Inflector = "0.11.4" convert_case = "0.8.0" -once_cell = "1.20.3" +once_cell = "1.21.3" proc-macro2 = "1" quote = "1" regex = "1.11" diff --git a/rust/kcl-language-server-release/Cargo.toml b/rust/kcl-language-server-release/Cargo.toml index 7aa9b198b..4e1275762 100644 --- a/rust/kcl-language-server-release/Cargo.toml +++ b/rust/kcl-language-server-release/Cargo.toml @@ -14,14 +14,14 @@ bench = false [dependencies] anyhow = { workspace = true } clap = { workspace = true, features = ["cargo", "derive", "env", "unicode"] } -flate2 = "1.1.0" +flate2 = "1.1.1" lazy_static = { workspace = true } -log = { version = "0.4.26", features = ["serde"] } +log = { version = "0.4.27", features = ["serde"] } slog = { workspace = true } slog-async = { workspace = true } slog-json = { workspace = true } slog-term = { workspace = true } -time = "0.3.40" +time = "0.3.41" tokio = { workspace = true, features = ["full"] } tracing-subscriber = { workspace = true } xshell = "0.2.6" diff --git a/rust/kcl-language-server/Cargo.toml b/rust/kcl-language-server/Cargo.toml index 929d17434..68addf825 100644 --- a/rust/kcl-language-server/Cargo.toml +++ b/rust/kcl-language-server/Cargo.toml @@ -23,7 +23,7 @@ kcl-lib = { path = "../kcl-lib", default-features = false, features = [ ] } kittycad = { workspace = true } lazy_static = { workspace = true } -log = { version = "0.4.26", features = ["serde"] } +log = { version = "0.4.27", features = ["serde"] } slog = { workspace = true } slog-async = { workspace = true } slog-json = { workspace = true } diff --git a/rust/kcl-lib/Cargo.toml b/rust/kcl-lib/Cargo.toml index b1b07ef2e..e211864b0 100644 --- a/rust/kcl-lib/Cargo.toml +++ b/rust/kcl-lib/Cargo.toml @@ -26,7 +26,7 @@ async-trait = { workspace = true } base64 = "0.22.1" bson = { workspace = true } chrono = "0.4.38" -clap = { version = "4.5.27", default-features = false, optional = true, features = [ +clap = { version = "4.5.36", default-features = false, optional = true, features = [ "std", "derive", ] } @@ -39,7 +39,7 @@ futures = { version = "0.3.31" } git_rev = "0.1.0" gltf-json = "1.4.1" http = { workspace = true } -image = { version = "0.25.5", default-features = false, features = ["png"] } +image = { version = "0.25.6", default-features = false, features = ["png"] } indexmap = { workspace = true, features = ["serde"] } itertools = "0.13.0" kcl-derive-docs = { version = "0.1", path = "../kcl-derive-docs" } @@ -121,7 +121,7 @@ base64 = "0.22.1" criterion = { version = "0.5.1", features = ["async_tokio"] } expectorate = "1.1.0" handlebars = "6.3.2" -image = { version = "0.25.5", default-features = false, features = ["png"] } +image = { version = "0.25.6", default-features = false, features = ["png"] } insta = { version = "1.41.1", features = ["json", "filters", "redactions"] } kcl-directory-test-macro = { version = "0.1", path = "../kcl-directory-test-macro" } miette = { version = "7.5.0", features = ["fancy"] } diff --git a/rust/kcl-test-server/Cargo.toml b/rust/kcl-test-server/Cargo.toml index 55930932b..6894fd419 100644 --- a/rust/kcl-test-server/Cargo.toml +++ b/rust/kcl-test-server/Cargo.toml @@ -9,7 +9,7 @@ license = "MIT" bench = false [dependencies] -anyhow = "1.0.95" +anyhow = "1.0.98" hyper = { version = "0.14.29", features = ["http1", "server", "tcp"] } kcl-lib = { version = "0.2", path = "../kcl-lib" } pico-args = "0.5.0"