mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
Hold a voice orbit, pan or rotate until its fly-to lands
"Fly to Paris and orbit it" reaches the app as two sibling tool calls, which OpenAI runs at once. With a place that needs a lookup, the orbit started over the old view and the late flight then replaced it; with a known place, pan and rotate cancelled the flight already in the air. Orbit, pan and rotate now wait for a pending voice flight the same way tilt does: up to 30 s, and not run (saying so) if the flight is cancelled, finds nothing or times out. Stop and rotate_globe do not wait. Orbit keeps its own arming for flights the voice runner does not track.
This commit is contained in:
1 parent
91a3f787d4
commit
75000cf6a9
4 files changed
+117
-10
No files matched your search
+18
-6
@@ -1188,8 +1188,9 @@ export function createGevActionRunner({
|
||||
}
|
||||
|
||||
if (name === 'move_camera') {
|
||||
const motion = String(args.motion || '').toLowerCase();
|
||||
if (
|
||||
String(args.motion || '').toLowerCase() === 'tilt' &&
|
||||
VOICE_FLIGHT_WAITING_MOTIONS.has(motion) &&
|
||||
voiceFlight &&
|
||||
!voiceFlight.done
|
||||
) {
|
||||
@@ -1200,9 +1201,8 @@ export function createGevActionRunner({
|
||||
return {
|
||||
ok: false,
|
||||
action: 'move_camera',
|
||||
motion: 'tilt',
|
||||
error:
|
||||
'Not run: the flight this tilt was waiting for did not arrive.',
|
||||
motion,
|
||||
error: `Not run: the flight this ${motion} was waiting for did not arrive.`,
|
||||
};
|
||||
}
|
||||
return moveCamera(args, (navigate, releaseOptions) =>
|
||||
@@ -2721,7 +2721,6 @@ async function frameOverhead(viewer, dataManager, styleManager, args = {}) {
|
||||
);
|
||||
}
|
||||
|
||||
/** Run one validated voice camera mutation through the UI-owned authority seam. */
|
||||
/** A voice flight's end: 'arrived', 'cancelled' or 'failed', settled once. */
|
||||
function trackVoiceFlight() {
|
||||
let resolve;
|
||||
@@ -2739,9 +2738,21 @@ function trackVoiceFlight() {
|
||||
return flight;
|
||||
}
|
||||
|
||||
/** Longest a tilt waits for a flight (geocode plus flight) before giving up. */
|
||||
/** Longest a motion waits for a flight (geocode plus flight) before giving up. */
|
||||
const VOICE_FLIGHT_WAIT_MS = 30_000;
|
||||
|
||||
/**
|
||||
* Motions that act on the place the camera ends up at, so one sent beside a
|
||||
* fly-to waits for it. Stop is not one, and rotate_globe turns the
|
||||
* whole Earth from Globe View rather than at a place.
|
||||
*/
|
||||
const VOICE_FLIGHT_WAITING_MOTIONS = new Set([
|
||||
'tilt',
|
||||
'orbit',
|
||||
'pan',
|
||||
'rotate',
|
||||
]);
|
||||
|
||||
/** Wait for a voice flight to end; 'timeout' or 'aborted' if it does not. */
|
||||
function waitForVoiceFlight(flight, signal) {
|
||||
if (signal?.aborted) return Promise.resolve('aborted');
|
||||
@@ -2758,6 +2769,7 @@ function waitForVoiceFlight(flight, signal) {
|
||||
});
|
||||
}
|
||||
|
||||
/** Run one validated voice camera mutation through the UI-owned authority seam. */
|
||||
function runManagedVoiceNavigation(
|
||||
styleManager,
|
||||
noun,
|
||||
|
||||
Reference in new issue
Block a user