@yottagraph-app/aether-instructions 1.0.1
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.
- package/README.md +52 -0
- package/commands/aether_broadchurch_setup.md +163 -0
- package/commands/aether_build_my_app.md +148 -0
- package/commands/aether_configure_query_server.md +90 -0
- package/commands/aether_deploy_agent.md +153 -0
- package/commands/aether_deploy_mcp.md +163 -0
- package/commands/aether_update_branding.md +123 -0
- package/commands/aether_update_instructions.md +183 -0
- package/commands/aether_vercel_deploy.md +278 -0
- package/commands/aether_vercel_setup.md +528 -0
- package/package.json +26 -0
- package/rules/aether_aether.mdc +21 -0
- package/rules/aether_agents.mdc +166 -0
- package/rules/aether_api.mdc +211 -0
- package/rules/aether_architecture.mdc +141 -0
- package/rules/aether_branding.mdc +43 -0
- package/rules/aether_cookbook.mdc +489 -0
- package/rules/aether_design.mdc +48 -0
- package/rules/aether_git-support.mdc +48 -0
- package/rules/aether_instructions_warning.mdc +48 -0
- package/rules/aether_mcp-servers.mdc +108 -0
- package/rules/aether_pref.mdc +123 -0
- package/rules/aether_server.mdc +99 -0
- package/rules/aether_something-broke.mdc +73 -0
- package/rules/aether_ui.mdc +76 -0
- package/skills/aether_test-api-queries/SKILL.md +63 -0
- package/skills/aether_test-api-queries/query-api.js +175 -0
package/README.md
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# @yottagraph-app/aether-instructions
|
|
2
|
+
|
|
3
|
+
Cursor rules, commands, and skills for Aether development.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
This package is automatically downloaded and extracted during Aether project
|
|
8
|
+
initialization (`init-project.js`). You don't need to install it directly.
|
|
9
|
+
|
|
10
|
+
### Updating Instructions
|
|
11
|
+
|
|
12
|
+
To update to the latest version:
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
/aether_update_instructions
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
This Cursor command will:
|
|
19
|
+
1. Download the latest version of this package
|
|
20
|
+
2. Delete existing `aether_*` files in `.cursor/`
|
|
21
|
+
3. Extract fresh files from the package
|
|
22
|
+
4. Commit the changes
|
|
23
|
+
|
|
24
|
+
### File Naming Convention
|
|
25
|
+
|
|
26
|
+
All files from this package are prefixed with `aether_`:
|
|
27
|
+
- Rules: `.cursor/rules/aether_*.mdc`
|
|
28
|
+
- Commands: `.cursor/commands/aether_*.md`
|
|
29
|
+
- Skills: `.cursor/skills/aether_*/`
|
|
30
|
+
|
|
31
|
+
This separates package-provided files from your own custom files. Files with
|
|
32
|
+
the `aether_` prefix will be overwritten on update; your non-prefixed files
|
|
33
|
+
are untouched.
|
|
34
|
+
|
|
35
|
+
### Customizing Rules/Commands
|
|
36
|
+
|
|
37
|
+
To customize a package file:
|
|
38
|
+
1. Copy it to a new name without the `aether_` prefix
|
|
39
|
+
2. Make your changes to the copy
|
|
40
|
+
3. Your copy won't be affected by instruction updates
|
|
41
|
+
|
|
42
|
+
## For Maintainers
|
|
43
|
+
|
|
44
|
+
This package is built from `aether-dev` sources. To publish:
|
|
45
|
+
|
|
46
|
+
1. Make changes to `rules/`, `commands/`, or `skills/` in aether-dev
|
|
47
|
+
2. Run `/publish_instructions --bump patch --publish`
|
|
48
|
+
|
|
49
|
+
The publish command:
|
|
50
|
+
- Copies source files with `aether_` prefix to `packages/aether-instructions/`
|
|
51
|
+
- Bumps the version
|
|
52
|
+
- Publishes to npmjs
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# Broadchurch Setup
|
|
2
|
+
|
|
3
|
+
Set up this Aether project for deploying agents and MCP servers to GCP via Broadchurch.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
This command walks through connecting an Aether project to the Broadchurch tenant infrastructure. It creates a `broadchurch.yaml` config file that stores the tenant's GCP project, service account, and deployment state. All subsequent `/deploy_agent` and `/deploy_mcp` commands read from this file.
|
|
8
|
+
|
|
9
|
+
**Prerequisite:** The user must have `gcloud` installed and authenticated, and their tenant must already exist in the Broadchurch Tenant Registry (created via the Portal or provisioning scripts).
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Step 1: Check for Existing Configuration
|
|
14
|
+
|
|
15
|
+
Check if `broadchurch.yaml` already exists in the project root.
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
cat broadchurch.yaml 2>/dev/null
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
**If the file exists:** Show the current config and ask:
|
|
22
|
+
|
|
23
|
+
> Broadchurch is already configured for this project. Would you like to reconfigure it?
|
|
24
|
+
|
|
25
|
+
If no, stop here. If yes, continue.
|
|
26
|
+
|
|
27
|
+
**If the file does not exist:** Continue with setup.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Step 2: Verify gcloud Authentication
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
gcloud auth list --filter=status:ACTIVE --format="value(account)" 2>&1
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
**If no active account:** Tell the user:
|
|
38
|
+
|
|
39
|
+
> You need to authenticate with Google Cloud first. Run: `gcloud auth login`
|
|
40
|
+
|
|
41
|
+
Wait for confirmation before continuing.
|
|
42
|
+
|
|
43
|
+
**Also check application default credentials:**
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
gcloud auth application-default print-access-token > /dev/null 2>&1
|
|
47
|
+
echo $?
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
**If this fails:** Tell the user:
|
|
51
|
+
|
|
52
|
+
> Application Default Credentials are not set up. Run: `gcloud auth application-default login`
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Step 3: Gather Tenant Information
|
|
57
|
+
|
|
58
|
+
Ask the user for their Auth0 Organization ID. This is the identifier from the Broadchurch Portal (format: `org_XXXXXXXXXXXXXX`).
|
|
59
|
+
|
|
60
|
+
> What is your Auth0 Organization ID? (e.g., org_U7tGKXTsbfM30te6)
|
|
61
|
+
|
|
62
|
+
If the user doesn't know, suggest:
|
|
63
|
+
|
|
64
|
+
> You can find this in the Broadchurch Portal under your tenant settings, or ask your Lovelace admin.
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Step 4: Look Up Tenant Configuration
|
|
69
|
+
|
|
70
|
+
Once you have the org_id, check if the tenant exists. The user needs to provide or you need to look up:
|
|
71
|
+
|
|
72
|
+
- **GCP Project:** The GCP project ID for this tenant (e.g., `broadchurch`)
|
|
73
|
+
- **GCP Region:** The deployment region (default: `us-central1`)
|
|
74
|
+
- **Service Account:** The tenant's service account email
|
|
75
|
+
|
|
76
|
+
Ask the user to confirm these values, or provide them if they have a different setup:
|
|
77
|
+
|
|
78
|
+
> Here's the configuration I'll use:
|
|
79
|
+
>
|
|
80
|
+
> - **GCP Project:** broadchurch
|
|
81
|
+
> - **Region:** us-central1
|
|
82
|
+
> - **Tenant Name:** (from user input)
|
|
83
|
+
>
|
|
84
|
+
> Does this look right?
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## Step 5: Create Staging Bucket
|
|
89
|
+
|
|
90
|
+
The agent deployment pipeline needs a GCS bucket for staging artifacts.
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
BUCKET_NAME="gs://broadchurch-staging-$(echo $ORG_ID | tr '[:upper:]' '[:lower:]' | sed 's/org_//')"
|
|
94
|
+
gsutil ls $BUCKET_NAME 2>/dev/null || gsutil mb -p $PROJECT_ID -l $REGION $BUCKET_NAME
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## Step 6: Verify ADK Installation
|
|
100
|
+
|
|
101
|
+
Check that the Google ADK CLI is available:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
adk --version 2>&1
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
**If not installed:** Tell the user:
|
|
108
|
+
|
|
109
|
+
> The Google ADK CLI is required for deploying agents. Install it with:
|
|
110
|
+
>
|
|
111
|
+
> ```
|
|
112
|
+
> pip install google-adk
|
|
113
|
+
> ```
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## Step 7: Write broadchurch.yaml
|
|
118
|
+
|
|
119
|
+
Create the configuration file:
|
|
120
|
+
|
|
121
|
+
```yaml
|
|
122
|
+
# Broadchurch Tenant Configuration
|
|
123
|
+
# Generated by /broadchurch_setup
|
|
124
|
+
# Do not commit secrets to this file.
|
|
125
|
+
|
|
126
|
+
tenant:
|
|
127
|
+
org_id: <ORG_ID>
|
|
128
|
+
name: '<TENANT_NAME>'
|
|
129
|
+
|
|
130
|
+
gcp:
|
|
131
|
+
project: <PROJECT_ID>
|
|
132
|
+
region: <REGION>
|
|
133
|
+
service_account: <SERVICE_ACCOUNT_EMAIL>
|
|
134
|
+
staging_bucket: <BUCKET_NAME>
|
|
135
|
+
|
|
136
|
+
# Auto-populated by /deploy_agent and /deploy_mcp
|
|
137
|
+
agents: {}
|
|
138
|
+
mcp_servers: {}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Also add `broadchurch.yaml` to `.gitignore` if it's not already there (it may contain sensitive config).
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## Step 8: Verify Connectivity
|
|
146
|
+
|
|
147
|
+
Run a quick check to verify everything works:
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
gcloud projects describe $PROJECT_ID --format="value(projectId)" 2>&1
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
**If successful:**
|
|
154
|
+
|
|
155
|
+
> Broadchurch setup complete! Your project is configured for agent and MCP server deployment.
|
|
156
|
+
>
|
|
157
|
+
> Next steps:
|
|
158
|
+
>
|
|
159
|
+
> - Create an agent in `agents/` and deploy with `/deploy_agent`
|
|
160
|
+
> - Create an MCP server in `mcp-servers/` and deploy with `/deploy_mcp`
|
|
161
|
+
> - Deploy your UI to Vercel with `/vercel_deploy`
|
|
162
|
+
|
|
163
|
+
**If it fails:** Help the user troubleshoot the GCP authentication.
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# Build My App
|
|
2
|
+
|
|
3
|
+
Read the project brief and build the described application.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
This command reads `DESIGN.md` (which contains the project creator's vision) and implements the described application using standard Nuxt patterns, Vuetify components, and the Lovelace platform's data APIs.
|
|
8
|
+
|
|
9
|
+
**This is meant to be the first thing a user runs after opening their project in Cursor.**
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Step 1: Read the Brief
|
|
14
|
+
|
|
15
|
+
Read `DESIGN.md` from the project root.
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
cat DESIGN.md
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Look for a `## Vision` section -- this contains the project creator's description of what they want to build.
|
|
22
|
+
|
|
23
|
+
**If the file doesn't exist or has no Vision section:**
|
|
24
|
+
|
|
25
|
+
> No project brief found. That's fine -- tell me what you'd like to build and I'll help you get started!
|
|
26
|
+
|
|
27
|
+
Stop here and wait for the user to describe what they want.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Step 2: Enable MCP Servers
|
|
32
|
+
|
|
33
|
+
Check if `.cursor/mcp.json` exists and contains Lovelace MCP servers:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
cat .cursor/mcp.json 2>/dev/null
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
**If the file contains `mcpServers`:** These MCP servers give you access to Lovelace platform tools (entity search, market data, news, etc.) that you'll need during development. Cursor disables new MCP servers by default, so ask the user:
|
|
40
|
+
|
|
41
|
+
> Before we start building, let's make sure your MCP tools are enabled.
|
|
42
|
+
>
|
|
43
|
+
> Open **Cursor Settings** (Cmd+Shift+J) → **Tools & MCP** and enable the `lovelace-*` servers listed there. They should show green toggles when active.
|
|
44
|
+
>
|
|
45
|
+
> Let me know when they're enabled (or if you'd like to skip this for now).
|
|
46
|
+
|
|
47
|
+
Wait for confirmation before proceeding. If the user skips this step, note that MCP tools won't be available during the build but can be enabled later.
|
|
48
|
+
|
|
49
|
+
**If the file doesn't exist or has no servers:** Skip this step silently.
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Step 3: Understand the Environment
|
|
54
|
+
|
|
55
|
+
First, ensure dependencies are installed (skill docs and types aren't available without this):
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
test -d node_modules || npm install
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Then read these files to understand what's available:
|
|
62
|
+
|
|
63
|
+
1. `DESIGN.md` -- project vision and current status
|
|
64
|
+
2. `broadchurch.yaml` -- project config (name, gateway URL, etc.)
|
|
65
|
+
3. **The `api` cursor rule** -- this is critical. It describes the Query Server, the platform's primary data source. Build against platform APIs, not external sources.
|
|
66
|
+
4. The **elemental-api skill docs** in `skills/elemental-api/` -- start with `SKILL.md` for API overview, then `entities.md`, `schema.md`, etc.
|
|
67
|
+
5. `.cursor/rules/` -- scan rule names to know what other patterns are available
|
|
68
|
+
|
|
69
|
+
**Important: Use the platform's data.** This app runs on the Lovelace platform, which provides a Query Server with entities, news, filings, sentiment, relationships, events, and more. Read the `api` rule and the skill docs to understand what data is available. Use `getSchema()` to discover entity types and properties at runtime.
|
|
70
|
+
|
|
71
|
+
Key capabilities:
|
|
72
|
+
|
|
73
|
+
- **Query Server / Elemental API** -- the primary data source. Use `useElementalClient()` from `@yottagraph-app/elemental-api/client`. See the `api` rule.
|
|
74
|
+
- **KV storage** -- always available for preferences and lightweight data (see `pref` rule)
|
|
75
|
+
- **Supabase** -- check if `NUXT_PUBLIC_SUPABASE_URL` is in `.env` for database access
|
|
76
|
+
- **AI agent chat** -- `pages/chat.vue` exists for agent interactions
|
|
77
|
+
- **MCP Explorer** -- `pages/mcp.vue` for testing MCP tools
|
|
78
|
+
- **Components** -- Vuetify 3 component library is available
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Step 4: Design the UX
|
|
83
|
+
|
|
84
|
+
Based on the brief, think about the right UX for this specific problem. Do NOT default to a sidebar-with-tabs layout. Consider:
|
|
85
|
+
|
|
86
|
+
- **Single-page app** -- if the core experience is one focused view (e.g. a dashboard, a watchlist, a chat interface)
|
|
87
|
+
- **Multi-page with navigation** -- if the app has distinct sections. Choose the right nav pattern: sidebar, top tabs, bottom nav, breadcrumbs, etc.
|
|
88
|
+
- **Hybrid** -- a primary view with secondary pages accessible from a menu or header
|
|
89
|
+
|
|
90
|
+
Design the UX around the user's workflow, not around a fixed navigation pattern.
|
|
91
|
+
|
|
92
|
+
Plan what you'll build:
|
|
93
|
+
|
|
94
|
+
1. What pages to create in `pages/`
|
|
95
|
+
2. What reusable components to extract into `components/`
|
|
96
|
+
3. What shared logic belongs in `composables/`
|
|
97
|
+
4. What data needs to be persisted (and whether KV or Supabase is appropriate)
|
|
98
|
+
5. Whether the app needs AI agents or MCP servers
|
|
99
|
+
6. Whether to keep, modify, or remove the built-in pages (`chat.vue`, `mcp.vue`, `entity-lookup.vue`)
|
|
100
|
+
7. Whether `app.vue` needs a sidebar, tabs, or other navigation (and what it should look like)
|
|
101
|
+
|
|
102
|
+
Present the plan to the user and ask for approval before proceeding.
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## Step 5: Build
|
|
107
|
+
|
|
108
|
+
Implement the plan:
|
|
109
|
+
|
|
110
|
+
1. Create pages in `pages/` (standard Nuxt file-based routing)
|
|
111
|
+
2. Extract reusable components into `components/`
|
|
112
|
+
3. Put shared logic in `composables/`
|
|
113
|
+
4. If the app needs navigation, add it to `app.vue` or to individual pages
|
|
114
|
+
5. Use `Pref<T>` for any persisted settings (see `pref.mdc`)
|
|
115
|
+
6. Use Vuetify components and the project's dark theme
|
|
116
|
+
7. Update `DESIGN.md` with what you built
|
|
117
|
+
|
|
118
|
+
**Follow the project's coding conventions:**
|
|
119
|
+
|
|
120
|
+
- `<script setup lang="ts">` for all Vue components
|
|
121
|
+
- TypeScript required
|
|
122
|
+
- Composables return `readonly()` refs with explicit setters
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## Step 6: Verify
|
|
127
|
+
|
|
128
|
+
After building, check dependencies are installed and run a build:
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
test -d node_modules || npm install
|
|
132
|
+
npm run build
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Fix any build errors.
|
|
136
|
+
|
|
137
|
+
Then suggest the user run `npm run dev` to preview their app locally.
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## Step 7: Next Steps
|
|
142
|
+
|
|
143
|
+
> Your app is taking shape! Here's what you can do next:
|
|
144
|
+
>
|
|
145
|
+
> - **Preview locally** with `npm run dev`
|
|
146
|
+
> - **Push to deploy** -- Vercel auto-deploys on push to main
|
|
147
|
+
> - **Deploy an AI agent** -- run `/deploy_agent` when you have an agent ready
|
|
148
|
+
> - **Deploy an MCP server** -- run `/deploy_mcp` for tool servers
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# Configure Query Server
|
|
2
|
+
|
|
3
|
+
Change the Query Server address used by this project for data access (Elemental API).
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
This command updates the Query Server URL in both `broadchurch.yaml` and `.env` so your local dev server uses the new address. No portal access is needed.
|
|
8
|
+
|
|
9
|
+
**Prerequisite:** The project must have a `broadchurch.yaml` file (created during provisioning or `/broadchurch_setup`).
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Step 1: Read Current Configuration
|
|
14
|
+
|
|
15
|
+
Read `broadchurch.yaml` from the project root.
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
cat broadchurch.yaml
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
**If the file does not exist:**
|
|
22
|
+
|
|
23
|
+
> This project doesn't have a `broadchurch.yaml` yet. Run `/broadchurch_setup` first, or create one manually.
|
|
24
|
+
|
|
25
|
+
Stop here.
|
|
26
|
+
|
|
27
|
+
Extract the current `query_server.url` value.
|
|
28
|
+
|
|
29
|
+
Also read `.env` to check the current `NUXT_PUBLIC_QUERY_SERVER_ADDRESS`:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
grep NUXT_PUBLIC_QUERY_SERVER_ADDRESS .env
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Show the user the current value from both files.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Step 2: Ask for the New Address
|
|
40
|
+
|
|
41
|
+
Present the user with common options:
|
|
42
|
+
|
|
43
|
+
> **Current Query Server:** `<current_url>`
|
|
44
|
+
>
|
|
45
|
+
> Which Query Server would you like to use?
|
|
46
|
+
>
|
|
47
|
+
> 1. **Production** — `https://query.news.prod.g.lovelace.ai`
|
|
48
|
+
> 2. **Sandbox** — `https://query.news.sbox.g.lovelace.ai`
|
|
49
|
+
> 3. **Local** — `http://localhost:8080`
|
|
50
|
+
> 4. **Custom** — Enter a custom URL
|
|
51
|
+
|
|
52
|
+
Wait for the user to choose.
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Step 3: Update broadchurch.yaml
|
|
57
|
+
|
|
58
|
+
Replace the `query_server.url` value in `broadchurch.yaml` with the new URL. The line to update looks like:
|
|
59
|
+
|
|
60
|
+
```yaml
|
|
61
|
+
query_server:
|
|
62
|
+
url: "<NEW_URL>"
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Preserve all other content in the file.
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Step 4: Update .env
|
|
70
|
+
|
|
71
|
+
Update the `NUXT_PUBLIC_QUERY_SERVER_ADDRESS` line in `.env`:
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
NUXT_PUBLIC_QUERY_SERVER_ADDRESS=<NEW_URL>
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
**If the line doesn't exist in `.env`:** Add it.
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Step 5: Confirm
|
|
82
|
+
|
|
83
|
+
> Query Server updated to `<NEW_URL>`.
|
|
84
|
+
>
|
|
85
|
+
> - `broadchurch.yaml` — updated
|
|
86
|
+
> - `.env` — updated
|
|
87
|
+
>
|
|
88
|
+
> **Restart your dev server** (`npm run dev`) for the change to take effect.
|
|
89
|
+
>
|
|
90
|
+
> Note: This only affects your local environment. To update the deployed app, change the Query Server address in the Broadchurch Portal (it will propagate to your repo and Vercel automatically).
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
# Deploy Agent
|
|
2
|
+
|
|
3
|
+
Deploy an ADK agent from the `agents/` directory to Vertex AI Agent Engine via the Broadchurch Portal.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
This command deploys a Python ADK agent by triggering a GitHub Actions workflow through the Portal API. No local GCP credentials are needed -- the workflow authenticates via Workload Identity Federation.
|
|
8
|
+
|
|
9
|
+
The agent must live in `agents/<name>/` with the standard ADK structure (`agent.py`, `__init__.py`, `requirements.txt`).
|
|
10
|
+
|
|
11
|
+
**Prerequisite:** The project must have a valid `broadchurch.yaml` (created during provisioning).
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Step 1: Read Configuration
|
|
16
|
+
|
|
17
|
+
Read `broadchurch.yaml` from the project root.
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
cat broadchurch.yaml
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
**If the file does not exist:**
|
|
24
|
+
|
|
25
|
+
> This project hasn't been provisioned yet. Create it in the Broadchurch Portal first.
|
|
26
|
+
|
|
27
|
+
Stop here.
|
|
28
|
+
|
|
29
|
+
Extract these values:
|
|
30
|
+
|
|
31
|
+
- `tenant.org_id` (tenant org ID)
|
|
32
|
+
- `gateway.url` (Portal Gateway URL)
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Step 2: Discover Agents
|
|
37
|
+
|
|
38
|
+
List the directories under `agents/`:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
ls -d agents/*/
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**If no directories exist:**
|
|
45
|
+
|
|
46
|
+
> No agents found. Create one by making a directory under `agents/` with the following structure:
|
|
47
|
+
>
|
|
48
|
+
> ```
|
|
49
|
+
> agents/my_agent/
|
|
50
|
+
> ├── __init__.py
|
|
51
|
+
> ├── agent.py # Your ADK agent definition (must export root_agent)
|
|
52
|
+
> └── requirements.txt
|
|
53
|
+
> ```
|
|
54
|
+
>
|
|
55
|
+
> See the `agents.mdc` rule for guidance on writing ADK agents.
|
|
56
|
+
|
|
57
|
+
Stop here.
|
|
58
|
+
|
|
59
|
+
**If multiple agents exist:** Ask the user which one to deploy.
|
|
60
|
+
|
|
61
|
+
**If only one agent exists:** Confirm with the user.
|
|
62
|
+
|
|
63
|
+
**Important:** Agent directory names must use underscores, not hyphens (e.g., `my_agent` not `my-agent`).
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Step 3: Validate Agent Structure
|
|
68
|
+
|
|
69
|
+
For the selected agent directory, verify the required files exist:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
ls agents/<name>/__init__.py agents/<name>/agent.py agents/<name>/requirements.txt
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
**If any are missing:** Tell the user what's needed.
|
|
76
|
+
|
|
77
|
+
Also verify that `agent.py` exports a `root_agent`:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
grep -l "root_agent" agents/<name>/agent.py
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## Step 4: Ensure Code is Pushed
|
|
86
|
+
|
|
87
|
+
The deployment workflow runs on the code in the GitHub repo, not the local working directory. Make sure the agent code is committed and pushed:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
git status
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
**If there are uncommitted changes in `agents/<name>/`:**
|
|
94
|
+
|
|
95
|
+
> Your agent code has local changes that aren't pushed yet. The deployment will use the version on GitHub. Would you like me to commit and push first?
|
|
96
|
+
|
|
97
|
+
If yes, commit and push. If no, warn them and continue.
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## Step 5: Trigger Deployment
|
|
102
|
+
|
|
103
|
+
Call the Portal API to trigger the deploy workflow:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
curl -sf -X POST "<GATEWAY_URL>/api/projects/<ORG_ID>/deploy" \
|
|
107
|
+
-H "Content-Type: application/json" \
|
|
108
|
+
-d '{"type": "agent", "name": "<AGENT_NAME>"}'
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
**If this fails with 404:** The agent directory may not exist on GitHub yet. Push your code first.
|
|
112
|
+
|
|
113
|
+
**If this succeeds:** The Portal has triggered the `deploy-agent.yml` GitHub Actions workflow.
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## Step 6: Monitor Progress
|
|
118
|
+
|
|
119
|
+
> Deployment triggered! The agent is being deployed via GitHub Actions.
|
|
120
|
+
>
|
|
121
|
+
> - **Agent:** <name>
|
|
122
|
+
> - **Workflow:** deploy-agent.yml
|
|
123
|
+
>
|
|
124
|
+
> This typically takes 2-5 minutes. You can monitor progress:
|
|
125
|
+
>
|
|
126
|
+
> - In the Broadchurch Portal under your project's Deployment Status section
|
|
127
|
+
> - On GitHub: `https://github.com/<REPO>/actions`
|
|
128
|
+
>
|
|
129
|
+
> Once complete, the agent will automatically appear in your app's `/chat` page.
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## Troubleshooting
|
|
134
|
+
|
|
135
|
+
### Deployment workflow fails
|
|
136
|
+
|
|
137
|
+
Check the GitHub Actions logs for the `Deploy Agent` workflow. Common issues:
|
|
138
|
+
|
|
139
|
+
- **"agent.py does not export root_agent"**: Ensure your agent module defines `root_agent`.
|
|
140
|
+
- **"Module not found"**: All dependencies must be in the agent's `requirements.txt`.
|
|
141
|
+
- **WIF auth failure**: The Broadchurch admin needs to run the WIF setup script (`portal/scripts/setup-wif.sh`).
|
|
142
|
+
|
|
143
|
+
### Agent directory naming
|
|
144
|
+
|
|
145
|
+
ADK requires directory names to use underscores (Python package convention). If your directory uses hyphens, rename it:
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
mv agents/my-agent agents/my_agent
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### "No agents found" after successful deploy
|
|
152
|
+
|
|
153
|
+
The workflow registers the agent with the Portal automatically. If it doesn't appear, check the workflow logs for the "Register with Portal" step.
|