Files
web-alterflixhub/app/actions/view-screen.ts
T
Bkk1234 92a2adad6a refactor: split repo into docs/ mockup/ app/
- move static mockups from resource/ui to mockup/
- move React app scaffold from resource/ui to app/
- move prome.md + images to docs/
- drop empty resource/jsonfile and resource/
- add root .gitignore
- rewrite README for new layout
- fix paths in mockup/index.html (resource/ui -> mockup, docs/prome.md)
2026-10-27 00:55:32 +07:00

32 lines
943 B
TypeScript

/**
* See what the user is currently looking at on screen.
*
* Reads and returns the current navigation state from application state.
*
* Usage:
* pnpm action view-screen
*/
import { defineAction } from "@agent-native/core/action";
import { readAppState } from "@agent-native/core/application-state";
import { z } from "zod";
export default defineAction({
description:
"See what the user is currently looking at on screen. Returns the current navigation state for the app canvas plus agent rail. Always call this first before taking any action.",
schema: z.object({}),
http: false,
readOnly: true,
run: async () => {
const navigation = await readAppState("navigation");
const screen: Record<string, unknown> = {};
if (navigation) screen.navigation = navigation;
if (Object.keys(screen).length === 0) {
return "No application state found. Is the app running?";
}
return screen;
},
});