Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 0 additions & 4 deletions .github/workflows/agent_build_publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Get Version
run: |
# Extract everything after "agent/"
# For example, from "agent/v1.2.3" we get "v1.2.3"
VERSION=${GITHUB_REF#refs/tags/agent/}
echo "VERSION=$VERSION" >> $GITHUB_ENV

- name: Get tags
run: echo "TAGS=ghcr.io/unkeyed/agent:${{env.VERSION}},ghcr.io/unkeyed/agent:latest" >> $GITHUB_ENV

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
Expand All @@ -36,7 +33,6 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GHCR_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v6
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ import { Controller, useFormContext, useWatch } from "react-hook-form";
import type { CreditsFormValues } from "../create-key.schema";
import { ProtectionSwitch } from "./protection-switch";

export const UsageSetup = () => {
export const UsageSetup = ({
overrideEnabled = false,
}: {
overrideEnabled?: boolean;
}) => {
const {
register,
formState: { errors },
Expand Down Expand Up @@ -99,15 +103,18 @@ export const UsageSetup = () => {

return (
<div className="space-y-5 px-2 py-1">
<ProtectionSwitch
description="Turn on to limit how many times this key can be used. Once the limit
{!overrideEnabled && (
<ProtectionSwitch
description="Turn on to limit how many times this key can be used. Once the limit
is reached, the key will be disabled."
title="Credits"
icon={<ChartPie className="text-gray-12" size="sm-regular" />}
checked={limitEnabled}
onCheckedChange={handleSwitchChange}
{...register("limit.enabled")}
/>
title="Credits"
icon={<ChartPie className="text-gray-12" size="sm-regular" />}
checked={limitEnabled}
onCheckedChange={handleSwitchChange}
{...register("limit.enabled")}
/>
)}

<FormInput
className="[&_input:first-of-type]:h-[36px]"
placeholder="100"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ const EXPIRATION_OPTIONS = [
},
];

export const ExpirationSetup = () => {
export const ExpirationSetup = ({
overrideEnabled = false,
}: {
overrideEnabled?: boolean;
}) => {
const {
register,
formState: { errors },
Expand Down Expand Up @@ -134,14 +138,16 @@ export const ExpirationSetup = () => {

return (
<div className="space-y-5 px-2 py-1">
<ProtectionSwitch
description="Turn on to set an expiration date. When reached, the key will be automatically disabled."
title="Expiration"
icon={<Clock className="text-gray-12" size="sm-regular" />}
checked={expirationEnabled}
onCheckedChange={handleSwitchChange}
{...register("expiration.enabled")}
/>
{!overrideEnabled && (
<ProtectionSwitch
description="Turn on to set an expiration date. When reached, the key will be automatically disabled."
title="Expiration"
icon={<Clock className="text-gray-12" size="sm-regular" />}
checked={expirationEnabled}
onCheckedChange={handleSwitchChange}
{...register("expiration.enabled")}
/>
)}

<Controller
control={control}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ const EXAMPLE_JSON = {
},
};

export const MetadataSetup = () => {
export const MetadataSetup = ({
overrideEnabled = false,
}: {
overrideEnabled?: boolean;
}) => {
const {
register,
formState: { errors },
Expand Down Expand Up @@ -67,15 +71,16 @@ export const MetadataSetup = () => {

return (
<div className="space-y-5 px-2 py-1">
<ProtectionSwitch
description="Add custom metadata to your API key as a JSON object. This metadata will be available when verifying the key."
title="Metadata"
icon={<Code className="text-gray-12" size="sm-regular" />}
checked={metadataEnabled}
onCheckedChange={handleSwitchChange}
{...register("metadata.enabled")}
/>

{!overrideEnabled && (
<ProtectionSwitch
description="Add custom metadata to your API key as a JSON object. This metadata will be available when verifying the key."
title="Metadata"
icon={<Code className="text-gray-12" size="sm-regular" />}
checked={metadataEnabled}
onCheckedChange={handleSwitchChange}
{...register("metadata.enabled")}
/>
)}
<div className="space-y-2 h-fit duration-300">
<FormTextarea
placeholder={JSON.stringify(EXAMPLE_JSON, null, 2)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ import { Controller, useFieldArray, useFormContext, useWatch } from "react-hook-
import type { RatelimitFormValues, RatelimitItem } from "../create-key.schema";
import { ProtectionSwitch } from "./protection-switch";

export const RatelimitSetup = () => {
export const RatelimitSetup = ({
overrideEnabled = false,
}: {
overrideEnabled?: boolean;
}) => {
const {
register,
formState: { errors },
Expand Down Expand Up @@ -56,15 +60,17 @@ export const RatelimitSetup = () => {

return (
<div className="space-y-5 px-2 py-1">
<ProtectionSwitch
description="Turn on to restrict how frequently this key can be used. Requests
{!overrideEnabled && (
<ProtectionSwitch
description="Turn on to restrict how frequently this key can be used. Requests
beyond the limit will be blocked."
title="Ratelimit"
icon={<Gauge className="text-gray-12" size="sm-regular" />}
checked={ratelimitEnabled}
onCheckedChange={handleSwitchChange}
{...register("ratelimit.enabled")}
/>
title="Ratelimit"
icon={<Gauge className="text-gray-12" size="sm-regular" />}
checked={ratelimitEnabled}
onCheckedChange={handleSwitchChange}
{...register("ratelimit.enabled")}
/>
)}

<div className="flex w-full justify-between items-center px-1">
<div className="flex gap-2 items-center">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { LogsLLMSearch } from "@/components/logs/llm-search";
import { toast } from "@/components/ui/toaster";
import { trpc } from "@/lib/trpc/client";
import { LLMSearch } from "@unkey/ui";
import { transformStructuredOutputToFilters } from "@unkey/ui";
import { useFilters } from "../../../../hooks/use-filters";

Expand Down Expand Up @@ -41,7 +41,7 @@ export const LogsSearch = ({ apiId }: { apiId: string }) => {
});

return (
<LogsLLMSearch
<LLMSearch
exampleQueries={[
"Show rate limited outcomes",
"Show identity that starts with test_",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { LogsLLMSearch } from "@/components/logs/llm-search";
import { toast } from "@/components/ui/toaster";
import { trpc } from "@/lib/trpc/client";
import { LLMSearch } from "@unkey/ui";
import { transformStructuredOutputToFilters } from "@unkey/ui";
import type { KeyDetailsFilterValue } from "../../../../filters.schema";
import { useFilters } from "../../../../hooks/use-filters";
Expand Down Expand Up @@ -50,7 +50,7 @@ export const LogsSearch = ({ apiId }: { apiId: string }) => {
});

return (
<LogsLLMSearch
<LLMSearch
exampleQueries={["Show rate limited outcomes"]}
isLoading={queryLLMForStructuredOutput.isLoading}
searchMode="manual"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { LogsLLMSearch } from "@/components/logs/llm-search";
import { toast } from "@/components/ui/toaster";
import { trpc } from "@/lib/trpc/client";
import { LLMSearch } from "@unkey/ui";
import { transformStructuredOutputToFilters } from "@unkey/ui";
import { useFilters } from "../../../../hooks/use-filters";

Expand Down Expand Up @@ -41,7 +41,7 @@ export const LogsSearch = ({ keyspaceId }: { keyspaceId: string }) => {
});

return (
<LogsLLMSearch
<LLMSearch
exampleQueries={[
"Find key exactly key_abc123xyz",
"Show keys with ID containing 'test'",
Expand Down
Loading
Loading