Skip to content

Commit e8c2f98

Browse files
authored
fix: update for network policy field name change (#128)
## Description <!-- Provide a brief description of your changes --> **Note:** PR titles should follow [Conventional Commits](https://www.conventionalcommits.org/) format (e.g., `feat(devbox): add support for custom env vars` or `fix(snapshot): resolve pagination issue`) as they are used for automatic release notes generation. ## Type of Change <!-- Mark the relevant option with an 'x' --> - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Documentation update - [ ] Code refactoring - [ ] Performance improvement - [ ] Test updates ## Related Issues <!-- Link to related issues using #issue-number --> Closes # ## Changes Made <!-- Describe the changes in detail --> ## Testing <!-- Describe how you tested your changes --> - [ ] I have tested locally - [ ] I have added/updated tests - [ ] All existing tests pass ## Checklist - [ ] My code follows the code style of this project - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have updated the documentation accordingly - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged and published ## Screenshots (if applicable) <!-- Add screenshots to help explain your changes --> ## Additional Notes <!-- Any additional information that reviewers should know -->
1 parent 3017c5f commit e8c2f98

7 files changed

Lines changed: 35 additions & 34 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
"dependencies": {
7373
"@js-temporal/polyfill": "^0.5.1",
7474
"@modelcontextprotocol/sdk": "^1.26.0",
75-
"@runloop/api-client": "1.10.1",
75+
"@runloop/api-client": "1.10.2",
7676
"@types/express": "^5.0.6",
7777
"chalk": "^5.6.2",
7878
"commander": "^14.0.2",

pnpm-lock.yaml

Lines changed: 15 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/commands/network-policy/create.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export async function createNetworkPolicy(options: CreateOptions) {
2525
description: options.description,
2626
allow_all: options.allowAll ?? false,
2727
allow_devbox_to_devbox: options.allowDevboxToDevbox ?? false,
28-
allow_ai_gateway: options.allowAgentGateway ?? false,
28+
allow_agent_gateway: options.allowAgentGateway ?? false,
2929
allow_mcp_gateway: options.allowMcpGateway ?? false,
3030
allowed_hostnames: options.allowedHostnames ?? [],
3131
});

src/commands/network-policy/list.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ interface NetworkPolicyListItem {
4040
egress: {
4141
allow_all: boolean;
4242
allow_devbox_to_devbox: boolean;
43-
allow_ai_gateway: boolean;
43+
allow_agent_gateway: boolean;
4444
allow_mcp_gateway: boolean;
4545
allowed_hostnames: string[];
4646
};
@@ -167,7 +167,7 @@ const ListNetworkPoliciesUI = ({
167167
egress: {
168168
allow_all: p.egress.allow_all,
169169
allow_devbox_to_devbox: p.egress.allow_devbox_to_devbox,
170-
allow_ai_gateway: p.egress.allow_ai_gateway,
170+
allow_agent_gateway: p.egress.allow_agent_gateway,
171171
allow_mcp_gateway: p.egress.allow_mcp_gateway,
172172
allowed_hostnames: [...(p.egress.allowed_hostnames || [])],
173173
},

src/components/NetworkPolicyCreatePage.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ type FormField =
3535
| "description"
3636
| "allow_all"
3737
| "allow_devbox_to_devbox"
38-
| "allow_ai_gateway"
38+
| "allow_agent_gateway"
3939
| "allow_mcp_gateway"
4040
| "allowed_hostnames";
4141

@@ -44,7 +44,7 @@ interface FormData {
4444
description: string;
4545
allow_all: "Yes" | "No";
4646
allow_devbox_to_devbox: "Yes" | "No";
47-
allow_ai_gateway: "Yes" | "No";
47+
allow_agent_gateway: "Yes" | "No";
4848
allow_mcp_gateway: "Yes" | "No";
4949
allowed_hostnames: string[];
5050
}
@@ -67,7 +67,9 @@ export const NetworkPolicyCreatePage = ({
6767
allow_devbox_to_devbox: initialPolicy.egress.allow_devbox_to_devbox
6868
? "Yes"
6969
: "No",
70-
allow_ai_gateway: initialPolicy.egress.allow_ai_gateway ? "Yes" : "No",
70+
allow_agent_gateway: initialPolicy.egress.allow_agent_gateway
71+
? "Yes"
72+
: "No",
7173
allow_mcp_gateway: initialPolicy.egress.allow_mcp_gateway
7274
? "Yes"
7375
: "No",
@@ -79,7 +81,7 @@ export const NetworkPolicyCreatePage = ({
7981
description: "",
8082
allow_all: "No",
8183
allow_devbox_to_devbox: "No",
82-
allow_ai_gateway: "No",
84+
allow_agent_gateway: "No",
8385
allow_mcp_gateway: "No",
8486
allowed_hostnames: [],
8587
};
@@ -111,7 +113,7 @@ export const NetworkPolicyCreatePage = ({
111113
type: "select",
112114
},
113115
{
114-
key: "allow_ai_gateway",
116+
key: "allow_agent_gateway",
115117
label: "Allow Agent Gateway",
116118
type: "select",
117119
},
@@ -253,7 +255,7 @@ export const NetworkPolicyCreatePage = ({
253255
description?: string;
254256
allow_all?: boolean;
255257
allow_devbox_to_devbox?: boolean;
256-
allow_ai_gateway?: boolean;
258+
allow_agent_gateway?: boolean;
257259
allow_mcp_gateway?: boolean;
258260
allowed_hostnames?: string[];
259261
} = {};
@@ -274,7 +276,7 @@ export const NetworkPolicyCreatePage = ({
274276

275277
params.allow_all = formData.allow_all === "Yes";
276278
params.allow_devbox_to_devbox = formData.allow_devbox_to_devbox === "Yes";
277-
params.allow_ai_gateway = formData.allow_ai_gateway === "Yes";
279+
params.allow_agent_gateway = formData.allow_agent_gateway === "Yes";
278280
params.allow_mcp_gateway = formData.allow_mcp_gateway === "Yes";
279281

280282
// For allowed_hostnames, always send the current list

src/screens/NetworkPolicyDetailScreen.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ export function NetworkPolicyDetailScreen({
336336
lines.push(
337337
<Text key="egress-agent-gateway" dimColor>
338338
{" "}
339-
Allow Agent Gateway: {np.egress.allow_ai_gateway ? "Yes" : "No"}
339+
Allow Agent Gateway: {np.egress.allow_agent_gateway ? "Yes" : "No"}
340340
</Text>,
341341
);
342342
lines.push(

src/services/networkPolicyService.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export async function listNetworkPolicies(
6464
egress: {
6565
allow_all: p.egress.allow_all,
6666
allow_devbox_to_devbox: p.egress.allow_devbox_to_devbox,
67-
allow_ai_gateway: p.egress.allow_ai_gateway,
67+
allow_agent_gateway: p.egress.allow_agent_gateway,
6868
allow_mcp_gateway: p.egress.allow_mcp_gateway,
6969
allowed_hostnames: p.egress.allowed_hostnames || [],
7070
},
@@ -97,7 +97,7 @@ export async function getNetworkPolicy(id: string): Promise<NetworkPolicy> {
9797
egress: {
9898
allow_all: policy.egress.allow_all,
9999
allow_devbox_to_devbox: policy.egress.allow_devbox_to_devbox,
100-
allow_ai_gateway: policy.egress.allow_ai_gateway,
100+
allow_agent_gateway: policy.egress.allow_agent_gateway,
101101
allow_mcp_gateway: policy.egress.allow_mcp_gateway,
102102
allowed_hostnames: policy.egress.allowed_hostnames || [],
103103
},
@@ -120,7 +120,7 @@ export interface CreateNetworkPolicyParams {
120120
description?: string;
121121
allow_all?: boolean;
122122
allow_devbox_to_devbox?: boolean;
123-
allow_ai_gateway?: boolean;
123+
allow_agent_gateway?: boolean;
124124
allow_mcp_gateway?: boolean;
125125
allowed_hostnames?: string[];
126126
}
@@ -140,7 +140,7 @@ export async function createNetworkPolicy(
140140
egress: {
141141
allow_all: policy.egress.allow_all,
142142
allow_devbox_to_devbox: policy.egress.allow_devbox_to_devbox,
143-
allow_ai_gateway: policy.egress.allow_ai_gateway,
143+
allow_agent_gateway: policy.egress.allow_agent_gateway,
144144
allow_mcp_gateway: policy.egress.allow_mcp_gateway,
145145
allowed_hostnames: policy.egress.allowed_hostnames || [],
146146
},
@@ -155,7 +155,7 @@ export interface UpdateNetworkPolicyParams {
155155
description?: string;
156156
allow_all?: boolean;
157157
allow_devbox_to_devbox?: boolean;
158-
allow_ai_gateway?: boolean;
158+
allow_agent_gateway?: boolean;
159159
allow_mcp_gateway?: boolean;
160160
allowed_hostnames?: string[];
161161
}
@@ -176,7 +176,7 @@ export async function updateNetworkPolicy(
176176
egress: {
177177
allow_all: policy.egress.allow_all,
178178
allow_devbox_to_devbox: policy.egress.allow_devbox_to_devbox,
179-
allow_ai_gateway: policy.egress.allow_ai_gateway,
179+
allow_agent_gateway: policy.egress.allow_agent_gateway,
180180
allow_mcp_gateway: policy.egress.allow_mcp_gateway,
181181
allowed_hostnames: policy.egress.allowed_hostnames || [],
182182
},

0 commit comments

Comments
 (0)