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)
This commit is contained in:
1 parent
8e87e47017
commit
92a2adad6a
133 files changed
+23416
-50
No files matched your search
@@ -0,0 +1,40 @@
|
||||
/**
|
||||
* Navigate the UI to a view.
|
||||
*
|
||||
* Writes a navigate command to application state which the UI reads and auto-deletes.
|
||||
*
|
||||
* Usage:
|
||||
* pnpm action navigate --view=home
|
||||
* pnpm action navigate --path=/some/route
|
||||
*
|
||||
* Options:
|
||||
* --view View name to navigate to
|
||||
* --path URL path to navigate to
|
||||
*/
|
||||
|
||||
import { defineAction, fail } from "@agent-native/core/action";
|
||||
import { writeAppStateForCurrentTab } from "@agent-native/core/application-state";
|
||||
import { z } from "zod";
|
||||
|
||||
export default defineAction({
|
||||
description:
|
||||
"Navigate the UI to a specific view or path. Writes a navigate command to application state which the UI reads and auto-deletes. The default product surface is the home canvas at /; agent chat stays in the right rail.",
|
||||
schema: z.object({
|
||||
view: z.string().optional().describe("View name to navigate to"),
|
||||
path: z.string().optional().describe("URL path to navigate to"),
|
||||
}),
|
||||
http: false,
|
||||
run: async (args) => {
|
||||
if (!args.view && !args.path) {
|
||||
fail("At least --view or --path is required.", {
|
||||
errorCode: "navigate_target_required",
|
||||
});
|
||||
}
|
||||
const nav: Record<string, string> = {};
|
||||
if (args.view) nav.view = args.view;
|
||||
if (args.path) nav.path = args.path;
|
||||
nav._writeId = `${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
|
||||
await writeAppStateForCurrentTab("navigate", nav);
|
||||
return `Navigating to ${args.view || args.path}`;
|
||||
},
|
||||
});
|
||||
Reference in new issue
Block a user