eve 0.32.0 → 0.33.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/CHANGELOG.md +23 -1
- package/README.md +8 -4
- package/dist/src/channel/channel-address.d.ts +4 -1
- package/dist/src/channel/channel-address.js +1 -1
- package/dist/src/channel/channel-operations.d.ts +3 -1
- package/dist/src/channel/compiled-channel.d.ts +2 -1
- package/dist/src/channel/cross-channel-receive.d.ts +5 -2
- package/dist/src/channel/cross-channel-receive.js +1 -1
- package/dist/src/channel/session.d.ts +6 -2
- package/dist/src/channel/session.js +1 -1
- package/dist/src/channel/types.d.ts +6 -0
- package/dist/src/channel/types.js +1 -1
- package/dist/src/chunks/{use-eve-agent-CX87G1vU.js → use-eve-agent-3oBnxzhV.js} +27 -17
- package/dist/src/chunks/{use-eve-agent-DwyRde1N.js → use-eve-agent-B-Hky2f4.js} +27 -17
- package/dist/src/cli/commands/agent-prompt/collect-intent.md +3 -0
- package/dist/src/cli/commands/agent-prompt/scaffold.md +4 -2
- package/dist/src/cli/commands/info.js +1 -1
- package/dist/src/cli/commands/init-repl.d.ts +1 -1
- package/dist/src/cli/commands/init-repl.js +1 -1
- package/dist/src/cli/commands/init.d.ts +7 -0
- package/dist/src/cli/commands/init.js +1 -1
- package/dist/src/cli/commands/integration-connect.d.ts +3 -3
- package/dist/src/cli/commands/integration-connect.js +1 -1
- package/dist/src/cli/commands/integration-setup.js +1 -1
- package/dist/src/cli/commands/set.d.ts +20 -0
- package/dist/src/cli/commands/set.js +1 -0
- package/dist/src/cli/dev/tui/runner.js +1 -1
- package/dist/src/cli/dev/tui/setup-issues.js +1 -1
- package/dist/src/cli/option-parsers.d.ts +3 -0
- package/dist/src/cli/option-parsers.js +1 -1
- package/dist/src/cli/run.js +1 -1
- package/dist/src/client/agent-info-schema.d.ts +28 -5
- package/dist/src/client/agent-info-schema.js +1 -1
- package/dist/src/client/session.js +1 -1
- package/dist/src/client/types.d.ts +3 -0
- package/dist/src/compiler/extension-compatibility.d.ts +19 -9
- package/dist/src/compiler/extension-compatibility.js +1 -1
- package/dist/src/compiler/manifest.d.ts +119 -19
- package/dist/src/compiler/manifest.js +1 -1
- package/dist/src/compiler/model-catalog.d.ts +2 -30
- package/dist/src/compiler/model-catalog.js +1 -1
- package/dist/src/compiler/module-map.d.ts +2 -2
- package/dist/src/compiler/module-map.js +2 -2
- package/dist/src/compiler/normalize-agent-config.js +1 -1
- package/dist/src/compiler/normalize-instructions.js +1 -1
- package/dist/src/compiler/normalize-manifest.js +2 -2
- package/dist/src/compiler/normalize-skill.js +1 -1
- package/dist/src/compiler/normalize-subagent.d.ts +5 -1
- package/dist/src/compiler/normalize-subagent.js +1 -1
- package/dist/src/compiler/remote-agent-node.d.ts +4 -1
- package/dist/src/compiler/workspace-resources.js +1 -1
- package/dist/src/context/dynamic-model-lifecycle.d.ts +7 -2
- package/dist/src/context/dynamic-model-lifecycle.js +1 -1
- package/dist/src/context/dynamic-subagent-lifecycle.js +1 -1
- package/dist/src/context/hook-lifecycle.js +1 -1
- package/dist/src/context/keys.d.ts +8 -0
- package/dist/src/context/keys.js +1 -1
- package/dist/src/evals/session.js +1 -1
- package/dist/src/execution/dispatch-runtime-actions-step.d.ts +3 -9
- package/dist/src/execution/dispatch-runtime-actions-step.js +1 -1
- package/dist/src/execution/durable-session-store.d.ts +5 -0
- package/dist/src/execution/durable-session-store.js +1 -1
- package/dist/src/execution/effective-agent-config.js +1 -1
- package/dist/src/execution/node-step.js +1 -1
- package/dist/src/execution/parked-delivery-wait.d.ts +8 -0
- package/dist/src/execution/parked-delivery-wait.js +1 -1
- package/dist/src/execution/route-child-delivery.js +1 -1
- package/dist/src/execution/session-command-wire.js +1 -1
- package/dist/src/execution/session.d.ts +2 -0
- package/dist/src/execution/session.js +2 -2
- package/dist/src/execution/settle-cancelled-turn-step.js +1 -1
- package/dist/src/execution/subagent-hitl-proxy.d.ts +1 -0
- package/dist/src/execution/subagent-hitl-proxy.js +1 -1
- package/dist/src/execution/turn-control-receiver.d.ts +2 -0
- package/dist/src/execution/turn-control-receiver.js +1 -1
- package/dist/src/execution/turn-workflow.js +1 -1
- package/dist/src/execution/workflow-entry.js +1 -1
- package/dist/src/execution/workflow-steps.d.ts +4 -1
- package/dist/src/execution/workflow-steps.js +1 -1
- package/dist/src/harness/emission.d.ts +1 -1
- package/dist/src/harness/emission.js +1 -1
- package/dist/src/harness/hitl/approval-input-requests.d.ts +13 -0
- package/dist/src/harness/hitl/approval-input-requests.js +1 -0
- package/dist/src/harness/hitl/pending-input-resolution.d.ts +51 -0
- package/dist/src/harness/hitl/pending-input-resolution.js +1 -0
- package/dist/src/harness/hitl/question-input-requests.d.ts +15 -0
- package/dist/src/harness/hitl/question-input-requests.js +1 -0
- package/dist/src/harness/hitl/session-limit-input-requests.d.ts +10 -0
- package/dist/src/harness/hitl/session-limit-input-requests.js +1 -0
- package/dist/src/harness/input-requests.d.ts +17 -105
- package/dist/src/harness/input-requests.js +1 -1
- package/dist/src/harness/pending-input-batches.d.ts +77 -0
- package/dist/src/harness/pending-input-batches.js +1 -0
- package/dist/src/harness/proxy-input-requests.d.ts +13 -3
- package/dist/src/harness/proxy-input-requests.js +1 -1
- package/dist/src/harness/session-limit-enforcement.js +1 -1
- package/dist/src/harness/step-hooks.d.ts +1 -1
- package/dist/src/harness/step-hooks.js +1 -1
- package/dist/src/harness/tool-loop.d.ts +1 -1
- package/dist/src/harness/tool-loop.js +2 -2
- package/dist/src/harness/types.d.ts +11 -5
- package/dist/src/harness/types.js +1 -1
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/authored-definition/core.js +1 -1
- package/dist/src/internal/authored-definition/schema-backed.js +1 -1
- package/dist/src/internal/authored-module-loader.js +1 -1
- package/dist/src/internal/authored-module-map-loader.js +1 -1
- package/dist/src/internal/model-catalog.d.ts +46 -0
- package/dist/src/internal/model-catalog.js +1 -0
- package/dist/src/internal/nitro/host/build-vercel-agent-summary.js +1 -1
- package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
- package/dist/src/internal/nitro/host/dev-host-fingerprint.js +1 -1
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response-from-manifest.js +1 -1
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.d.ts +20 -10
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.js +1 -1
- package/dist/src/internal/nitro/routes/channel-dispatch.js +1 -1
- package/dist/src/internal/nitro/routes/info.js +1 -1
- package/dist/src/internal/vercel-agent-summary.d.ts +12 -3
- package/dist/src/internal/vercel-agent-summary.js +1 -1
- package/dist/src/protocol/message.d.ts +2 -2
- package/dist/src/protocol/message.js +1 -1
- package/dist/src/public/channels/chat-sdk/chatSdkChannel.d.ts +5 -5
- package/dist/src/public/channels/chat-sdk/chatSdkChannel.js +2 -2
- package/dist/src/public/channels/discord/discordChannel.d.ts +3 -1
- package/dist/src/public/channels/discord/discordChannel.js +1 -1
- package/dist/src/public/channels/eve.d.ts +3 -1
- package/dist/src/public/channels/eve.js +1 -1
- package/dist/src/public/channels/github/githubChannel.d.ts +3 -1
- package/dist/src/public/channels/github/githubChannel.js +1 -1
- package/dist/src/public/channels/index.d.ts +1 -1
- package/dist/src/public/channels/linear/linearChannel.d.ts +3 -1
- package/dist/src/public/channels/linear/linearChannel.js +1 -1
- package/dist/src/public/channels/photon/photonIMessageChannel.d.ts +3 -1
- package/dist/src/public/channels/photon/photonIMessageChannel.js +1 -1
- package/dist/src/public/channels/slack/slackChannel.d.ts +3 -1
- package/dist/src/public/channels/slack/slackChannel.js +1 -1
- package/dist/src/public/channels/teams/teamsChannel.d.ts +3 -1
- package/dist/src/public/channels/teams/teamsChannel.js +1 -1
- package/dist/src/public/channels/telegram/telegramChannel.d.ts +3 -1
- package/dist/src/public/channels/telegram/telegramChannel.js +1 -1
- package/dist/src/public/channels/twilio/twilioChannel.d.ts +3 -1
- package/dist/src/public/channels/twilio/twilioChannel.js +1 -1
- package/dist/src/public/definitions/agent.d.ts +5 -7
- package/dist/src/public/definitions/agent.js +1 -1
- package/dist/src/public/definitions/channel.d.ts +3 -1
- package/dist/src/public/definitions/channel.js +1 -1
- package/dist/src/public/definitions/tool.d.ts +1 -5
- package/dist/src/public/definitions/tool.js +1 -1
- package/dist/src/public/index.d.ts +1 -1
- package/dist/src/runtime/agent/bootstrap.d.ts +19 -6
- package/dist/src/runtime/agent/bootstrap.js +1 -1
- package/dist/src/runtime/agent/model-catalog.d.ts +10 -0
- package/dist/src/runtime/agent/model-catalog.js +1 -0
- package/dist/src/runtime/agent/resolve-model.d.ts +8 -4
- package/dist/src/runtime/agent/resolve-model.js +1 -1
- package/dist/src/runtime/framework-channels/index.js +1 -1
- package/dist/src/runtime/resolve-agent-graph.js +1 -1
- package/dist/src/runtime/resolve-agent.d.ts +2 -2
- package/dist/src/runtime/resolve-agent.js +1 -1
- package/dist/src/runtime/resolve-channel.js +1 -1
- package/dist/src/runtime/resolve-dynamic-subagent.d.ts +2 -5
- package/dist/src/runtime/subagents/dynamic-agent-config.d.ts +8 -7
- package/dist/src/runtime/subagents/dynamic-agent-config.js +1 -1
- package/dist/src/runtime/types.d.ts +11 -4
- package/dist/src/setup/flows/deploy.d.ts +5 -3
- package/dist/src/setup/flows/deploy.js +1 -1
- package/dist/src/setup/flows/ensure-vercel-project.d.ts +5 -1
- package/dist/src/setup/flows/ensure-vercel-project.js +1 -1
- package/dist/src/setup/flows/model-source-change.d.ts +1 -0
- package/dist/src/setup/flows/model-source-change.js +1 -1
- package/dist/src/setup/integrations/discord/setup.js +1 -1
- package/dist/src/setup/integrations/github/setup.js +1 -1
- package/dist/src/setup/integrations/linear/setup.js +1 -1
- package/dist/src/setup/integrations/photon/setup-flow.js +1 -1
- package/dist/src/setup/integrations/slack/setup.js +1 -1
- package/dist/src/setup/scaffold/create/add-to-project.d.ts +2 -0
- package/dist/src/setup/scaffold/create/add-to-project.js +1 -1
- package/dist/src/setup/scaffold/create/project.d.ts +3 -1
- package/dist/src/setup/scaffold/create/project.js +4 -4
- package/dist/src/setup/scaffold/create/web-template.d.ts +9 -0
- package/dist/src/setup/scaffold/create/web-template.js +291 -1
- package/dist/src/setup/scaffold/index.d.ts +1 -1
- package/dist/src/setup/scaffold/update/channels.d.ts +4 -13
- package/dist/src/setup/scaffold/update/channels.js +2 -2
- package/dist/src/setup/scaffold/update/web-options.d.ts +15 -0
- package/dist/src/setup/scaffold/update/web-options.js +1 -0
- package/dist/src/setup/vercel-project.js +0 -0
- package/dist/src/shared/agent-definition.d.ts +23 -23
- package/dist/src/shared/agent-definition.js +1 -1
- package/dist/src/shared/channel-definition.d.ts +3 -1
- package/dist/src/shared/dynamic-tool-definition.d.ts +4 -10
- package/dist/src/shared/dynamic-tool-definition.js +1 -1
- package/dist/src/svelte/index.js +1 -1
- package/dist/src/svelte/use-eve-agent.js +1 -1
- package/dist/src/vue/index.js +1 -1
- package/dist/src/vue/use-eve-agent.js +1 -1
- package/docs/agent-config.md +30 -19
- package/docs/channels/chat-sdk.mdx +5 -5
- package/docs/channels/custom.mdx +20 -0
- package/docs/channels/discord.mdx +1 -0
- package/docs/channels/eve.mdx +2 -0
- package/docs/channels/github.mdx +1 -1
- package/docs/channels/linear.mdx +1 -1
- package/docs/channels/overview.mdx +19 -0
- package/docs/channels/photon.mdx +5 -2
- package/docs/channels/slack.mdx +5 -11
- package/docs/concepts/execution-model-and-durability.mdx +5 -8
- package/docs/concepts/sessions-runs-and-streaming.md +6 -6
- package/docs/guides/dynamic-capabilities.md +24 -20
- package/docs/guides/frontend/overview.mdx +31 -10
- package/docs/guides/frontend/use-eve-agent-svelte.mdx +37 -15
- package/docs/guides/frontend/use-eve-agent-vue.mdx +38 -15
- package/docs/installation.mdx +7 -1
- package/docs/reference/cli.md +33 -8
- package/docs/tools/human-in-the-loop.md +2 -2
- package/package.json +1 -1
|
@@ -4969,4 +4969,294 @@ export default config;
|
|
|
4969
4969
|
],
|
|
4970
4970
|
"exclude": ["node_modules"]
|
|
4971
4971
|
}
|
|
4972
|
-
`},
|
|
4972
|
+
`},WEB_APP_SIGN_IN_WITH_VERCEL_TEMPLATE_FILES={"agent/channels/eve.ts":`import { eveChannel } from "eve/channels/eve";
|
|
4973
|
+
import { localDev, type AuthFn, vercelOidc } from "eve/channels/auth";
|
|
4974
|
+
import { auth } from "@/lib/auth";
|
|
4975
|
+
|
|
4976
|
+
const betterAuthSession: AuthFn<Request> = async (request) => {
|
|
4977
|
+
const session = await auth.api.getSession({ headers: request.headers });
|
|
4978
|
+
if (!session) return null;
|
|
4979
|
+
|
|
4980
|
+
const attributes: Record<string, string> = {
|
|
4981
|
+
email: session.user.email,
|
|
4982
|
+
name: session.user.name,
|
|
4983
|
+
};
|
|
4984
|
+
if (session.user.image) {
|
|
4985
|
+
attributes.picture = session.user.image;
|
|
4986
|
+
}
|
|
4987
|
+
|
|
4988
|
+
return {
|
|
4989
|
+
attributes,
|
|
4990
|
+
authenticator: "better-auth:vercel",
|
|
4991
|
+
issuer: "https://vercel.com",
|
|
4992
|
+
principalId: session.user.id,
|
|
4993
|
+
principalType: "user",
|
|
4994
|
+
};
|
|
4995
|
+
};
|
|
4996
|
+
|
|
4997
|
+
export default eveChannel({
|
|
4998
|
+
auth: [betterAuthSession, vercelOidc(), localDev()],
|
|
4999
|
+
});
|
|
5000
|
+
`,"app/_components/web-chat-auth.tsx":`"use client";
|
|
5001
|
+
|
|
5002
|
+
import { LogOutIcon } from "lucide-react";
|
|
5003
|
+
import { useState } from "react";
|
|
5004
|
+
import { Button } from "@/components/ui/button";
|
|
5005
|
+
import {
|
|
5006
|
+
DropdownMenu,
|
|
5007
|
+
DropdownMenuContent,
|
|
5008
|
+
DropdownMenuItem,
|
|
5009
|
+
DropdownMenuSeparator,
|
|
5010
|
+
DropdownMenuTrigger,
|
|
5011
|
+
} from "@/components/ui/dropdown-menu";
|
|
5012
|
+
import { authClient } from "@/lib/auth-client";
|
|
5013
|
+
|
|
5014
|
+
const AGENT_NAME = "__EVE_INIT_APP_NAME__";
|
|
5015
|
+
|
|
5016
|
+
export function SignIn() {
|
|
5017
|
+
const [pending, setPending] = useState(false);
|
|
5018
|
+
const [error, setError] = useState<string>();
|
|
5019
|
+
|
|
5020
|
+
async function signIn() {
|
|
5021
|
+
setPending(true);
|
|
5022
|
+
setError(undefined);
|
|
5023
|
+
try {
|
|
5024
|
+
const result = await authClient.signIn.social({
|
|
5025
|
+
callbackURL: "/",
|
|
5026
|
+
provider: "vercel",
|
|
5027
|
+
});
|
|
5028
|
+
if (!result.error) return;
|
|
5029
|
+
setPending(false);
|
|
5030
|
+
setError("Sign-in failed. Try again.");
|
|
5031
|
+
} catch {
|
|
5032
|
+
setPending(false);
|
|
5033
|
+
setError("Sign-in failed. Try again.");
|
|
5034
|
+
}
|
|
5035
|
+
}
|
|
5036
|
+
|
|
5037
|
+
return (
|
|
5038
|
+
<main className="flex h-dvh items-center justify-center bg-background px-6 text-foreground">
|
|
5039
|
+
<div className="flex w-full max-w-sm flex-col items-center gap-6 text-center">
|
|
5040
|
+
<div className="space-y-2">
|
|
5041
|
+
<h1 className="break-words font-medium text-4xl tracking-tighter">{AGENT_NAME}</h1>
|
|
5042
|
+
<p className="text-muted-foreground text-sm">
|
|
5043
|
+
Team members can sign in with Vercel to chat.
|
|
5044
|
+
</p>
|
|
5045
|
+
</div>
|
|
5046
|
+
<Button disabled={pending} onClick={signIn}>
|
|
5047
|
+
Sign in with Vercel
|
|
5048
|
+
</Button>
|
|
5049
|
+
{error ? (
|
|
5050
|
+
<p className="text-destructive text-sm" role="alert">
|
|
5051
|
+
{error}
|
|
5052
|
+
</p>
|
|
5053
|
+
) : null}
|
|
5054
|
+
</div>
|
|
5055
|
+
</main>
|
|
5056
|
+
);
|
|
5057
|
+
}
|
|
5058
|
+
|
|
5059
|
+
export function AccountControl({
|
|
5060
|
+
email,
|
|
5061
|
+
image,
|
|
5062
|
+
name,
|
|
5063
|
+
}: {
|
|
5064
|
+
readonly email: string;
|
|
5065
|
+
readonly image?: string | null;
|
|
5066
|
+
readonly name: string;
|
|
5067
|
+
}) {
|
|
5068
|
+
const [imageFailed, setImageFailed] = useState(false);
|
|
5069
|
+
const [pending, setPending] = useState(false);
|
|
5070
|
+
const initials = getInitials(name, email);
|
|
5071
|
+
|
|
5072
|
+
async function signOut() {
|
|
5073
|
+
setPending(true);
|
|
5074
|
+
try {
|
|
5075
|
+
await authClient.signOut({
|
|
5076
|
+
fetchOptions: {
|
|
5077
|
+
onError: () => setPending(false),
|
|
5078
|
+
onSuccess: () => window.location.assign("/"),
|
|
5079
|
+
},
|
|
5080
|
+
});
|
|
5081
|
+
} catch {
|
|
5082
|
+
setPending(false);
|
|
5083
|
+
}
|
|
5084
|
+
}
|
|
5085
|
+
|
|
5086
|
+
return (
|
|
5087
|
+
<div className="fixed top-3 right-3 z-10">
|
|
5088
|
+
<DropdownMenu>
|
|
5089
|
+
<DropdownMenuTrigger asChild>
|
|
5090
|
+
<Button
|
|
5091
|
+
aria-label={\`Open account menu for \${name}\`}
|
|
5092
|
+
className="size-9 cursor-pointer overflow-hidden rounded-full p-0"
|
|
5093
|
+
size="icon"
|
|
5094
|
+
variant="outline"
|
|
5095
|
+
>
|
|
5096
|
+
{image && !imageFailed ? (
|
|
5097
|
+
<img
|
|
5098
|
+
alt=""
|
|
5099
|
+
className="size-full object-cover"
|
|
5100
|
+
onError={() => setImageFailed(true)}
|
|
5101
|
+
src={image}
|
|
5102
|
+
/>
|
|
5103
|
+
) : (
|
|
5104
|
+
<span aria-hidden="true" className="font-medium text-xs">
|
|
5105
|
+
{initials}
|
|
5106
|
+
</span>
|
|
5107
|
+
)}
|
|
5108
|
+
</Button>
|
|
5109
|
+
</DropdownMenuTrigger>
|
|
5110
|
+
<DropdownMenuContent align="end" className="w-64">
|
|
5111
|
+
<div className="min-w-0 px-2 py-1.5 text-sm">
|
|
5112
|
+
<span className="block truncate font-medium leading-5" title={name}>
|
|
5113
|
+
{name}
|
|
5114
|
+
</span>
|
|
5115
|
+
<span className="block truncate text-muted-foreground leading-5" title={email}>
|
|
5116
|
+
{email}
|
|
5117
|
+
</span>
|
|
5118
|
+
</div>
|
|
5119
|
+
<DropdownMenuSeparator />
|
|
5120
|
+
<DropdownMenuItem
|
|
5121
|
+
className="cursor-pointer justify-between"
|
|
5122
|
+
disabled={pending}
|
|
5123
|
+
onSelect={signOut}
|
|
5124
|
+
>
|
|
5125
|
+
{pending ? "Logging out…" : "Log out"}
|
|
5126
|
+
<LogOutIcon aria-hidden="true" />
|
|
5127
|
+
</DropdownMenuItem>
|
|
5128
|
+
</DropdownMenuContent>
|
|
5129
|
+
</DropdownMenu>
|
|
5130
|
+
</div>
|
|
5131
|
+
);
|
|
5132
|
+
}
|
|
5133
|
+
|
|
5134
|
+
function getInitials(name: string, email: string): string {
|
|
5135
|
+
const parts = name.trim().split(/\\s+/).filter(Boolean);
|
|
5136
|
+
if (parts.length >= 2) {
|
|
5137
|
+
return \`\${parts[0]?.[0] ?? ""}\${parts.at(-1)?.[0] ?? ""}\`.toUpperCase();
|
|
5138
|
+
}
|
|
5139
|
+
return (parts[0]?.[0] ?? email[0] ?? "?").toUpperCase();
|
|
5140
|
+
}
|
|
5141
|
+
`,"app/api/auth/[...all]/route.ts":`import { toNextJsHandler } from "better-auth/next-js";
|
|
5142
|
+
import { auth } from "@/lib/auth";
|
|
5143
|
+
|
|
5144
|
+
export const { GET, POST } = toNextJsHandler(auth);
|
|
5145
|
+
`,"app/layout.tsx":`import type { Metadata } from "next";
|
|
5146
|
+
import { Geist, Geist_Mono } from "next/font/google";
|
|
5147
|
+
import type { ReactNode } from "react";
|
|
5148
|
+
import { TooltipProvider } from "@/components/ui/tooltip";
|
|
5149
|
+
import { cn } from "@/lib/utils";
|
|
5150
|
+
import "./globals.css";
|
|
5151
|
+
|
|
5152
|
+
const sans = Geist({
|
|
5153
|
+
variable: "--font-sans",
|
|
5154
|
+
subsets: ["latin"],
|
|
5155
|
+
weight: "variable",
|
|
5156
|
+
display: "swap",
|
|
5157
|
+
});
|
|
5158
|
+
|
|
5159
|
+
const mono = Geist_Mono({
|
|
5160
|
+
variable: "--font-mono",
|
|
5161
|
+
subsets: ["latin"],
|
|
5162
|
+
weight: "variable",
|
|
5163
|
+
display: "swap",
|
|
5164
|
+
});
|
|
5165
|
+
|
|
5166
|
+
export const metadata: Metadata = {
|
|
5167
|
+
title: "__EVE_INIT_APP_NAME__",
|
|
5168
|
+
description: "A Next.js starter for eve agents with AI Elements.",
|
|
5169
|
+
};
|
|
5170
|
+
|
|
5171
|
+
// The page and Eve routes validate the generated app's Better Auth session.
|
|
5172
|
+
export default function RootLayout({ children }: { readonly children: ReactNode }) {
|
|
5173
|
+
return (
|
|
5174
|
+
<html className={cn(sans.variable, mono.variable)} lang="en">
|
|
5175
|
+
<body>
|
|
5176
|
+
<TooltipProvider>{children}</TooltipProvider>
|
|
5177
|
+
</body>
|
|
5178
|
+
</html>
|
|
5179
|
+
);
|
|
5180
|
+
}
|
|
5181
|
+
`,"app/page.tsx":`import { headers } from "next/headers";
|
|
5182
|
+
import { AgentChat } from "./_components/agent-chat";
|
|
5183
|
+
import { AccountControl, SignIn } from "./_components/web-chat-auth";
|
|
5184
|
+
import { auth } from "@/lib/auth";
|
|
5185
|
+
|
|
5186
|
+
export default async function Page() {
|
|
5187
|
+
if (process.env.NODE_ENV === "development") {
|
|
5188
|
+
return <AgentChat />;
|
|
5189
|
+
}
|
|
5190
|
+
|
|
5191
|
+
const session = await auth.api.getSession({ headers: await headers() });
|
|
5192
|
+
if (!session) {
|
|
5193
|
+
return <SignIn />;
|
|
5194
|
+
}
|
|
5195
|
+
|
|
5196
|
+
return (
|
|
5197
|
+
<>
|
|
5198
|
+
<AgentChat />
|
|
5199
|
+
<AccountControl
|
|
5200
|
+
email={session.user.email}
|
|
5201
|
+
image={session.user.image}
|
|
5202
|
+
name={session.user.name}
|
|
5203
|
+
/>
|
|
5204
|
+
</>
|
|
5205
|
+
);
|
|
5206
|
+
}
|
|
5207
|
+
`,"lib/auth-client.ts":`"use client";
|
|
5208
|
+
|
|
5209
|
+
import { createAuthClient } from "better-auth/react";
|
|
5210
|
+
|
|
5211
|
+
export const authClient = createAuthClient();
|
|
5212
|
+
`,"lib/auth.ts":`import { betterAuth } from "better-auth";
|
|
5213
|
+
|
|
5214
|
+
const SESSION_MAX_AGE_SECONDS = 8 * 60 * 60;
|
|
5215
|
+
const DEVELOPMENT_ALLOWED_HOSTS = ["localhost:*", "127.0.0.1:*"];
|
|
5216
|
+
|
|
5217
|
+
function getAllowedHosts(): string[] {
|
|
5218
|
+
if (process.env.NODE_ENV === "development") {
|
|
5219
|
+
return DEVELOPMENT_ALLOWED_HOSTS;
|
|
5220
|
+
}
|
|
5221
|
+
const deploymentHosts = [
|
|
5222
|
+
process.env.VERCEL_URL,
|
|
5223
|
+
process.env.VERCEL_BRANCH_URL,
|
|
5224
|
+
process.env.VERCEL_PROJECT_PRODUCTION_URL,
|
|
5225
|
+
].filter((host): host is string => Boolean(host));
|
|
5226
|
+
if (deploymentHosts.length === 0) {
|
|
5227
|
+
throw new Error("No trusted deployment hosts are configured");
|
|
5228
|
+
}
|
|
5229
|
+
return Array.from(new Set(deploymentHosts));
|
|
5230
|
+
}
|
|
5231
|
+
|
|
5232
|
+
function requireEnvironmentVariable(name: string): string {
|
|
5233
|
+
const value = process.env[name];
|
|
5234
|
+
if (value) return value;
|
|
5235
|
+
if (process.env.NODE_ENV === "development") return \`development-\${name}\`;
|
|
5236
|
+
throw new Error(\`Missing required environment variable: \${name}\`);
|
|
5237
|
+
}
|
|
5238
|
+
|
|
5239
|
+
export const auth = betterAuth({
|
|
5240
|
+
baseURL: {
|
|
5241
|
+
allowedHosts: getAllowedHosts(),
|
|
5242
|
+
protocol: process.env.NODE_ENV === "development" ? "auto" : "https",
|
|
5243
|
+
},
|
|
5244
|
+
secret: requireEnvironmentVariable("BETTER_AUTH_SECRET"),
|
|
5245
|
+
session: {
|
|
5246
|
+
expiresIn: SESSION_MAX_AGE_SECONDS,
|
|
5247
|
+
disableSessionRefresh: true,
|
|
5248
|
+
cookieCache: {
|
|
5249
|
+
enabled: true,
|
|
5250
|
+
maxAge: SESSION_MAX_AGE_SECONDS,
|
|
5251
|
+
refreshCache: false,
|
|
5252
|
+
strategy: "jwe",
|
|
5253
|
+
},
|
|
5254
|
+
},
|
|
5255
|
+
socialProviders: {
|
|
5256
|
+
vercel: {
|
|
5257
|
+
clientId: requireEnvironmentVariable("VERCEL_APP_CLIENT_ID"),
|
|
5258
|
+
clientSecret: requireEnvironmentVariable("VERCEL_APP_CLIENT_SECRET"),
|
|
5259
|
+
},
|
|
5260
|
+
},
|
|
5261
|
+
});
|
|
5262
|
+
`},WEB_APP_TEMPLATE_PACKAGE_JSON={scripts:{build:`next build`,"build:eve":`eve build`,dev:`next dev`,"dev:eve":`eve dev`,start:`next start`,"start:eve":`eve start`,typecheck:`tsc --noEmit -p tsconfig.json`},dependencies:{"@radix-ui/react-use-controllable-state":`1.2.2`,"@shikijs/core":`4.1.0`,"@shikijs/engine-javascript":`4.1.0`,"@shikijs/engine-oniguruma":`4.1.0`,"@streamdown/cjk":`1.0.3`,"@streamdown/code":`1.1.1`,"@streamdown/math":`1.0.2`,"@streamdown/mermaid":`1.0.2`,"@tailwindcss/postcss":`4.3.0`,ai:`^7.0.38`,"class-variance-authority":`0.7.1`,clsx:`2.1.1`,cmdk:`1.1.1`,"lucide-react":`1.16.0`,motion:`12.40.0`,nanoid:`5.1.11`,next:`16.3.0-preview.6`,"radix-ui":`1.4.3`,react:`19.2.6`,"react-dom":`19.2.6`,shiki:`4.1.0`,streamdown:`2.5.0`,"tailwind-merge":`3.6.0`,tailwindcss:`4.3.0`,"use-stick-to-bottom":`1.1.4`,zod:`4.4.3`},devDependencies:{"@types/node":`26`,"@types/react":`19.2.15`,"@types/react-dom":`19.2.3`,typescript:`6.0.3`}};export{WEB_APP_SIGN_IN_WITH_VERCEL_TEMPLATE_FILES,WEB_APP_TEMPLATE_FILES,WEB_APP_TEMPLATE_PACKAGE_JSON};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { byokProviderEnvVar, CURRENT_DIRECTORY_PROJECT_NAME, isEveProject, scaffoldBaseProject, type EvePackageContract, type ScaffoldBaseProjectOptions, } from "./create/project.js";
|
|
2
2
|
export { scaffoldExtensionProject, type ScaffoldExtensionProjectOptions, } from "./create/extension.js";
|
|
3
|
-
export { DEFAULT_SLACK_CONNECTOR_SLUG, SLACK_CHANNEL_DEFAULT_ROUTE, deriveSlackConnectorSlug, ensureChannel, hasVercelHostFramework, isNextJsProject, listAuthoredChannels, normalizeSlackConnectorSlug, resolveVercelHostFrameworkPreset, type ChannelKind, type ChannelMutationResult, type EnsureChannelOptions, type SlackConnectorSlug, type WebPackageVersions, } from "./update/channels.js";
|
|
3
|
+
export { DEFAULT_SLACK_CONNECTOR_SLUG, SLACK_CHANNEL_DEFAULT_ROUTE, deriveSlackConnectorSlug, ensureChannel, hasVercelHostFramework, isNextJsProject, listAuthoredChannels, normalizeSlackConnectorSlug, resolveVercelHostFrameworkPreset, type ChannelKind, type ChannelMutationResult, type EnsureChannelOptions, type SlackConnectorSlug, type WebAuthentication, type WebPackageVersions, } from "./update/channels.js";
|
|
4
4
|
export { SCAFFOLDABLE_CHANNELS, type ScaffoldableChannel } from "./channels-catalog.js";
|
|
5
5
|
export { ensureConnection, ensureConnectionDependencies, listAuthoredConnections, type ConnectionInput, type ConnectionMutationAction, type ConnectionMutationResult, type EnsureConnectionOptions, type EnsureConnectionDependenciesOptions, } from "./update/connections.js";
|
|
6
6
|
export { catalogSlugs, CONNECTION_CATALOG, CUSTOM_CONNECTION_SLUG, effectiveProtocols, endpointForProtocol, getCatalogEntry, isValidConnectionSlug, SUPPORTED_PROTOCOLS, type ConnectionAuthSpec, type ConnectionCatalogEntry, type ConnectionProtocol, type CustomConnectionInput, type EnvHeader, type McpEndpoint, type OpenApiEndpoint, } from "./connections/catalog.js";
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { PackageManagerKind } from "../../package-manager.js";
|
|
2
2
|
import { type NodeEngineOverride } from "../../node-engine.js";
|
|
3
3
|
import { type WorkspaceRootMutation } from "../workspace-root.js";
|
|
4
|
-
import { type
|
|
4
|
+
import { type WebAuthentication, type WebPackageVersions } from "./web-options.js";
|
|
5
|
+
export type { WebAuthentication, WebPackageVersions } from "./web-options.js";
|
|
5
6
|
export declare const SLACK_CHANNEL_DEFAULT_ROUTE = "/eve/v1/slack";
|
|
6
7
|
export declare const DEFAULT_SLACK_CONNECTOR_SLUG = "my-agent";
|
|
7
8
|
declare const slackConnectorSlugBrand: unique symbol;
|
|
@@ -97,23 +98,13 @@ export interface EnsureChannelOptions {
|
|
|
97
98
|
slackCredentials?: "vercel-connect" | "environment";
|
|
98
99
|
connectPackageVersion?: string;
|
|
99
100
|
webPackageVersions?: WebPackageVersions;
|
|
101
|
+
/** Authentication integration generated for Web Chat. Omit to keep the fail-closed placeholder. */
|
|
102
|
+
webAuthentication?: WebAuthentication;
|
|
100
103
|
/** When false, Web Chat leaves Vercel Services config unwritten for preview-only scaffolds. */
|
|
101
104
|
configureVercelServices?: boolean;
|
|
102
105
|
onWorkspaceRootMutation?: (mutation: WorkspaceRootMutation) => void | Promise<void>;
|
|
103
106
|
/** Dependencies are already owned and installed by a registry item. */
|
|
104
107
|
skipDependencyMutation?: boolean;
|
|
105
108
|
}
|
|
106
|
-
export interface WebPackageVersions {
|
|
107
|
-
evePackage?: EvePackageContract;
|
|
108
|
-
aiPackageVersion?: string;
|
|
109
|
-
nextPackageVersion?: string;
|
|
110
|
-
reactPackageVersion?: string;
|
|
111
|
-
reactDomPackageVersion?: string;
|
|
112
|
-
streamdownPackageVersion?: string;
|
|
113
|
-
zodPackageVersion?: string;
|
|
114
|
-
typesReactPackageVersion?: string;
|
|
115
|
-
typesReactDomPackageVersion?: string;
|
|
116
|
-
}
|
|
117
109
|
export declare function ensureChannel(options: EnsureChannelOptions): Promise<ChannelMutationResult>;
|
|
118
110
|
export declare function listAuthoredChannels(projectRoot: string): Promise<string[]>;
|
|
119
|
-
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{appendEnv}from"../../append-env.js";import{pinnedNodeEngineMajor}from"../../node-engine.js";import{getSupportedModuleBaseName,matchesSupportedModuleBaseName}from"./module-files.js";import{pathExists,writeTextFile}from"../files.js";import{resolveVersionToken}from"../version-tokens.js";import{patchPackageJson}from"./package-json.js";import{applyPackageManagerWorkspaceConfiguration,isPackageManagerWorkspaceMember,patchWorkspaceRootPackageJson}from"../workspace-root.js";import{WEB_APP_TEMPLATE_FILES,WEB_APP_TEMPLATE_PACKAGE_JSON}from"../create/web-template.js";import{
|
|
1
|
+
import{appendEnv}from"../../append-env.js";import{pinnedNodeEngineMajor}from"../../node-engine.js";import{getSupportedModuleBaseName,matchesSupportedModuleBaseName}from"./module-files.js";import{pathExists,writeTextFile}from"../files.js";import{resolveVersionToken}from"../version-tokens.js";import{patchPackageJson}from"./package-json.js";import{applyPackageManagerWorkspaceConfiguration,isPackageManagerWorkspaceMember,patchWorkspaceRootPackageJson}from"../workspace-root.js";import{WEB_APP_SIGN_IN_WITH_VERCEL_TEMPLATE_FILES,WEB_APP_TEMPLATE_FILES,WEB_APP_TEMPLATE_PACKAGE_JSON}from"../create/web-template.js";import{resolveEvePackageContract}from"../create/project.js";import{resolveWebPackageVersions}from"./web-options.js";import{readFile,readdir,unlink,writeFile}from"node:fs/promises";import{basename,join,resolve}from"node:path";const SLACK_CHANNEL_DEFAULT_ROUTE=`/eve/v1/slack`,DEFAULT_SLACK_CONNECTOR_SLUG=`my-agent`,NEXT_PACKAGE_NAME=`next`,PACKAGE_DEPENDENCY_FIELDS=[`dependencies`,`devDependencies`],WEB_NEXT_CONFIG_PATH=`next.config.ts`,WEB_COMPETING_NEXT_CONFIG_PATHS=[`next.config.js`,`next.config.mjs`,WEB_NEXT_CONFIG_PATH,`next.config.mts`].filter(e=>e!==WEB_NEXT_CONFIG_PATH);function toSlackConnectorSlug(e){return e}function isJsonObject(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}async function readPackageJsonObject(e){if(!await pathExists(e))return;let t=JSON.parse(await readFile(e,`utf8`));return isJsonObject(t)?t:void 0}async function readDependencyVersion(e,t){let n=await readPackageJsonObject(e);if(n===void 0||!isJsonObject(n.dependencies))return;let r=n.dependencies[t];return typeof r==`string`?r:void 0}function packageJsonHasDependency(e,t){for(let n of PACKAGE_DEPENDENCY_FIELDS){let r=e[n];if(isJsonObject(r)&&typeof r[t]==`string`)return!0}return!1}async function hasPackageDependency(e,t){let n=await readPackageJsonObject(e);return n!==void 0&&packageJsonHasDependency(n,t)}async function isNextJsProject(e){return hasPackageDependency(join(e,`package.json`),NEXT_PACKAGE_NAME)}const VERCEL_HOST_FRAMEWORK_PRESETS={"@sveltejs/kit":`sveltekit`,[NEXT_PACKAGE_NAME]:`nextjs`,nuxt:`nuxtjs`,nuxt3:`nuxtjs`,"nuxt-edge":`nuxtjs`,"nuxt-nightly":`nuxtjs`};async function resolveVercelHostFrameworkPreset(e){let t=await readPackageJsonObject(join(e,`package.json`));if(t!==void 0){for(let[e,n]of Object.entries(VERCEL_HOST_FRAMEWORK_PRESETS))if(packageJsonHasDependency(t,e))return n}}async function hasVercelHostFramework(e){return await resolveVercelHostFrameworkPreset(e)!==void 0}async function ensurePackageDependency(e,t,n){return!await pathExists(e)||await readDependencyVersion(e,t)===n?[]:(await patchPackageJson(e,{dependencies:{[t]:n}}),[{path:e,dependencies:[t],devDependencies:[],scripts:[]}])}function formatEveDependencySpecifier(e){return/^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z-.]+)?$/.test(e)?`^${e}`:e}async function patchWebPackageJson(e,n,r,a,c,d=!0,f){let h=join(e,`package.json`);if(!await pathExists(h))return{mutations:[]};let g=resolveEvePackageContract(a.evePackage),_=pinnedNodeEngineMajor(g.nodeEngine),v={...WEB_APP_TEMPLATE_PACKAGE_JSON.dependencies,ai:resolveVersionToken(`aiPackageVersion`,a.aiPackageVersion),eve:formatEveDependencySpecifier(g.version),next:resolveVersionToken(`nextPackageVersion`,a.nextPackageVersion),react:resolveVersionToken(`reactPackageVersion`,a.reactPackageVersion),"react-dom":resolveVersionToken(`reactDomPackageVersion`,a.reactDomPackageVersion),streamdown:resolveVersionToken(`streamdownPackageVersion`,a.streamdownPackageVersion),zod:resolveVersionToken(`zodPackageVersion`,a.zodPackageVersion),...f===`sign-in-with-vercel`?{"better-auth":resolveVersionToken(`betterAuthPackageVersion`,a.betterAuthPackageVersion)}:{}},y={...WEB_APP_TEMPLATE_PACKAGE_JSON.devDependencies,"@types/node":_,"@types/react":resolveVersionToken(`typesReactPackageVersion`,a.typesReactPackageVersion),"@types/react-dom":resolveVersionToken(`typesReactDomPackageVersion`,a.typesReactDomPackageVersion),typescript:`6.0.3`},b=WEB_APP_TEMPLATE_PACKAGE_JSON.scripts,x=isPackageManagerWorkspaceMember(n,r),S={scripts:b};d&&(S.dependencies=v,S.devDependencies=y),x||(S.nodeEngineRequirement=g.nodeEngine);let C=await patchPackageJson(h,S),w=(await patchWorkspaceRootPackageJson(n,r,{aiPackageVersion:v.ai,nodeEngineRequirement:g.nodeEngine,onWorkspaceRootMutation:c})).nodeEngineOverride??C.nodeEngineOverride;return{mutations:[{path:h,dependencies:d?Object.keys(v):[],devDependencies:d?Object.keys(y):[],scripts:Object.keys(b)}],nodeEngineOverride:w}}function normalizeSlackConnectorSlug(e){return toSlackConnectorSlug((e.trim().replace(/^@/,``).split(`/`).at(-1)??``).toLowerCase().replace(/[^a-z0-9_-]+/g,`-`).replace(/^[^a-z0-9]+/,``).replace(/[^a-z0-9]+$/,``).slice(0,100).replace(/[^a-z0-9]+$/,``)||`my-agent`)}async function deriveSlackConnectorSlug(e,t){if(t!==void 0&&t.length>0&&t!==`.`)return normalizeSlackConnectorSlug(t);try{let t=await readFile(join(e,`package.json`),`utf8`),n=JSON.parse(t);if(typeof n.name==`string`&&n.name.length>0)return normalizeSlackConnectorSlug(n.name)}catch{}return normalizeSlackConnectorSlug(basename(resolve(e))||`my-agent`)}function buildSlackConnectTemplate(e){if(!e.startsWith(`slack/`)||e.length===6)throw Error(`Invalid Slack connector UID "${e}".`);return`import { connectSlackCredentials } from "@vercel/connect/eve";
|
|
2
2
|
import { slackChannel } from "eve/channels/slack";
|
|
3
3
|
|
|
4
4
|
export default slackChannel({
|
|
5
5
|
credentials: connectSlackCredentials(${JSON.stringify(e)}),
|
|
6
6
|
});
|
|
7
|
-
`}const SLACK_ENV_EXAMPLE_VALUES={SLACK_BOT_TOKEN:``,SLACK_SIGNING_SECRET:``};function renderWebAppTemplate(e,t){return e.replaceAll(`__EVE_INIT_APP_NAME__`,t).replaceAll(`__EVE_INIT_WITH_EVE_OPTIONS__`,``)}async function ensureWebVercelJson(e){return await pathExists(e)?`skipped`:(await writeTextFile(e,`${JSON.stringify({$schema:`https://openapi.vercel.sh/vercel.json`},null,2)}\n`,{force:!0}),`written`)}async function findCompetingNextConfigFiles(e){let t=[];for(let n of WEB_COMPETING_NEXT_CONFIG_PATHS){let r=join(e,n);await pathExists(r)&&t.push(r)}return t}async function ensureChannel(e){switch(e.kind){case`slack`:return ensureSlackChannel({...e,kind:`slack`});case`web`:return ensureWebChannel({...e,kind:`web`})}}async function ensureWebChannel(e){let t=join(e.projectRoot,`package.json`),n=await pathExists(join(e.projectRoot,`app/page.tsx`));if(!e.force&&await isNextJsProject(e.projectRoot))return{kind:`web`,action:`skipped`,skipReason:`nextjs-project`,filesWritten:[],filesSkipped:[t],packageJsonUpdated:[]};let r=resolveWebPackageVersions(e.webPackageVersions),o=e.packageManager??`pnpm`,s=resolve(e.workspaceProbeDirectory??e.projectRoot),l=await patchWebPackageJson(e.projectRoot,o,s,r,e.onWorkspaceRootMutation,!e.skipDependencyMutation),u=[],
|
|
7
|
+
`}const SLACK_ENV_EXAMPLE_VALUES={SLACK_BOT_TOKEN:``,SLACK_SIGNING_SECRET:``};function renderWebAppTemplate(e,t){return e.replaceAll(`__EVE_INIT_APP_NAME__`,t).replaceAll(`__EVE_INIT_WITH_EVE_OPTIONS__`,``)}async function ensureWebVercelJson(e){return await pathExists(e)?`skipped`:(await writeTextFile(e,`${JSON.stringify({$schema:`https://openapi.vercel.sh/vercel.json`},null,2)}\n`,{force:!0}),`written`)}async function findCompetingNextConfigFiles(e){let t=[];for(let n of WEB_COMPETING_NEXT_CONFIG_PATHS){let r=join(e,n);await pathExists(r)&&t.push(r)}return t}async function ensureChannel(e){switch(e.kind){case`slack`:return ensureSlackChannel({...e,kind:`slack`});case`web`:return ensureWebChannel({...e,kind:`web`})}}async function ensureWebChannel(e){let t=join(e.projectRoot,`package.json`),n=await pathExists(join(e.projectRoot,`app/page.tsx`));if(!e.force&&await isNextJsProject(e.projectRoot))return{kind:`web`,action:`skipped`,skipReason:`nextjs-project`,filesWritten:[],filesSkipped:[t],packageJsonUpdated:[]};let r=resolveWebPackageVersions(e.webPackageVersions,e.webAuthentication),o=e.packageManager??`pnpm`,s=resolve(e.workspaceProbeDirectory??e.projectRoot),l=await patchWebPackageJson(e.projectRoot,o,s,r,e.onWorkspaceRootMutation,!e.skipDependencyMutation,e.webAuthentication),u=[],p=[],m=[],g=[],_=basename(resolve(e.projectRoot));if(e.configureVercelServices??!0){let t=join(e.projectRoot,`vercel.json`);await ensureWebVercelJson(t)===`written`?u.push(t):g.push(t)}let v=await applyPackageManagerWorkspaceConfiguration({packageManager:o,projectRoot:e.projectRoot,workspaceProbeRoot:s,onWorkspaceRootMutation:e.onWorkspaceRootMutation});if(u.push(...v.filesWritten),g.push(...v.filesSkipped),!e.skipDependencyMutation){let t={...WEB_APP_TEMPLATE_FILES,...e.webAuthentication===`sign-in-with-vercel`?WEB_APP_SIGN_IN_WITH_VERCEL_TEMPLATE_FILES:{}};for(let[n,r]of Object.entries(t)){let t=join(e.projectRoot,n);if(n===`agent/channels/eve.ts`&&!e.force&&await pathExists(t)){g.push(t);continue}let o=await pathExists(t);await writeTextFile(t,renderWebAppTemplate(r,_),{force:!0}),u.push(t),o&&p.push(t)}}m.push(...await findCompetingNextConfigFiles(e.projectRoot));let y=[...new Set(u)],S=[...new Set(g)].filter(e=>!y.includes(e)),C={kind:`web`,action:n?`overwritten`:`created`,filesWritten:y,filesSkipped:S,packageJsonUpdated:l.mutations};return p.length>0&&(C.filesOverwritten=p),m.length>0&&(C.competingNextConfigFiles=m),l.nodeEngineOverride!==void 0&&(C.nodeEngineOverride=l.nodeEngineOverride),C}async function ensureSlackChannel(t){let n=join(t.projectRoot,`agent/channels/slack.ts`),r=await pathExists(n);if(!t.force&&r)return{kind:`slack`,action:`skipped`,filesWritten:[],filesSkipped:[n],packageJsonUpdated:[]};let s=t.slackCredentials??`vercel-connect`,c=t.slackConnectorSlug??await deriveSlackConnectorSlug(t.projectRoot),l,u=[],d=[n],f=[],p;if(s===`vercel-connect`){if(!t.skipDependencyMutation){let e=resolveVersionToken(`connectPackageVersion`,t.connectPackageVersion??`0.4.3`);u=await ensurePackageDependency(join(t.projectRoot,`package.json`),`@vercel/connect`,e)}l=buildSlackConnectTemplate(t.slackConnectorUid??`slack/${c}`)}else{l=`import { slackChannel } from "eve/channels/slack";
|
|
8
8
|
|
|
9
9
|
export default slackChannel();
|
|
10
10
|
`;let n=join(t.projectRoot,`.env.example`);p={path:n,...await pathExists(n)?{content:await readFile(n,`utf8`)}:{}},(await appendEnv(n,SLACK_ENV_EXAMPLE_VALUES)).written.length>0?d.push(n):f.push(n)}try{await writeTextFile(n,l,{force:t.force})}catch(e){throw p!==void 0&&(p.content===void 0?await unlink(p.path):await writeFile(p.path,p.content,`utf8`)),e}let m={kind:`slack`,action:r?`overwritten`:`created`,filesWritten:d,filesSkipped:f,packageJsonUpdated:u,slackConnectorSlug:c};return r&&(m.filesOverwritten=[n]),m}async function listAuthoredChannels(e){let t=join(e,`agent/channels`),i;try{i=await readdir(t,{withFileTypes:!0})}catch(e){if(e.code===`ENOENT`)return[];throw e}let a=[];for(let e of i){if(e.isFile()){let t=getSupportedModuleBaseName(e.name);t!==null&&a.push(t);continue}if(e.isDirectory())try{(await readdir(join(t,e.name))).some(e=>matchesSupportedModuleBaseName(e,`connection`))&&a.push(e.name)}catch{}}return a.sort()}export{DEFAULT_SLACK_CONNECTOR_SLUG,SLACK_CHANNEL_DEFAULT_ROUTE,deriveSlackConnectorSlug,ensureChannel,hasVercelHostFramework,isNextJsProject,listAuthoredChannels,normalizeSlackConnectorSlug,resolveVercelHostFrameworkPreset};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type EvePackageContract } from "../create/project.js";
|
|
2
|
+
export type WebAuthentication = "sign-in-with-vercel";
|
|
3
|
+
export interface WebPackageVersions {
|
|
4
|
+
evePackage?: EvePackageContract;
|
|
5
|
+
aiPackageVersion?: string;
|
|
6
|
+
betterAuthPackageVersion?: string;
|
|
7
|
+
nextPackageVersion?: string;
|
|
8
|
+
reactPackageVersion?: string;
|
|
9
|
+
reactDomPackageVersion?: string;
|
|
10
|
+
streamdownPackageVersion?: string;
|
|
11
|
+
zodPackageVersion?: string;
|
|
12
|
+
typesReactPackageVersion?: string;
|
|
13
|
+
typesReactDomPackageVersion?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function resolveWebPackageVersions(input: WebPackageVersions | undefined, authentication?: WebAuthentication): Required<WebPackageVersions>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{DEFAULT_EVE_PACKAGE_CONTRACT}from"../create/project.js";function resolveWebPackageVersions(e,t){return{evePackage:e?.evePackage??DEFAULT_EVE_PACKAGE_CONTRACT,aiPackageVersion:e?.aiPackageVersion??`^7.0.58`,betterAuthPackageVersion:e?.betterAuthPackageVersion??`1.6.26`,nextPackageVersion:e?.nextPackageVersion??(t===`sign-in-with-vercel`?`16.3.0`:`16.3.0-preview.6`),reactPackageVersion:e?.reactPackageVersion??`19.2.6`,reactDomPackageVersion:e?.reactDomPackageVersion??`19.2.6`,streamdownPackageVersion:e?.streamdownPackageVersion??`2.5.0`,zodPackageVersion:e?.zodPackageVersion??`4.4.3`,typesReactPackageVersion:e?.typesReactPackageVersion??`19.2.15`,typesReactDomPackageVersion:e?.typesReactDomPackageVersion??`19.2.3`}}export{resolveWebPackageVersions};
|
|
Binary file
|
|
@@ -43,6 +43,7 @@ export type ModelRouting = {
|
|
|
43
43
|
export type InternalAgentModelDefinition = {
|
|
44
44
|
id: string;
|
|
45
45
|
contextWindowTokens?: number;
|
|
46
|
+
maxOutputTokens?: number;
|
|
46
47
|
source?: ModuleSourceRef;
|
|
47
48
|
providerOptions?: Record<string, JsonObject>;
|
|
48
49
|
};
|
|
@@ -55,17 +56,15 @@ export type PublicAgentStaticModelDefinition = string | LanguageModel;
|
|
|
55
56
|
export type AgentModelResolveContext = DynamicResolveContext;
|
|
56
57
|
export interface PublicAgentModelSelectionDefinition {
|
|
57
58
|
readonly model: PublicAgentStaticModelDefinition;
|
|
58
|
-
/** Context window of the selected model, in tokens
|
|
59
|
+
/** Context window of the selected model, in tokens. */
|
|
59
60
|
readonly modelContextWindowTokens?: number;
|
|
60
|
-
/** Provider options for the selected model
|
|
61
|
+
/** Provider options for the selected model. */
|
|
61
62
|
readonly modelOptions?: AgentModelOptionsDefinition;
|
|
62
63
|
}
|
|
63
|
-
export type PublicAgentDynamicModelResult = PublicAgentStaticModelDefinition | PublicAgentModelSelectionDefinition
|
|
64
|
+
export type PublicAgentDynamicModelResult = PublicAgentStaticModelDefinition | PublicAgentModelSelectionDefinition;
|
|
64
65
|
export type AgentModelResolver = (event: unknown, ctx: AgentModelResolveContext) => PublicAgentDynamicModelResult | Promise<PublicAgentDynamicModelResult>;
|
|
65
|
-
export type PublicAgentDynamicModelDefinition = DynamicSentinel<PublicAgentDynamicModelResult
|
|
66
|
+
export type PublicAgentDynamicModelDefinition = DynamicSentinel<PublicAgentDynamicModelResult>;
|
|
66
67
|
export interface PublicAgentDynamicModelDefinitionInput {
|
|
67
|
-
/** Compiled static model: build-time metadata and the active model when no scope is set. */
|
|
68
|
-
readonly fallback: PublicAgentStaticModelDefinition;
|
|
69
68
|
readonly events: DynamicSentinel<PublicAgentDynamicModelResult>["events"];
|
|
70
69
|
}
|
|
71
70
|
export declare function isDynamicModelDefinition(value: unknown): value is PublicAgentDynamicModelDefinition;
|
|
@@ -237,7 +236,7 @@ export type InternalAgentDefinition = {
|
|
|
237
236
|
* package name or app-root basename). Authored definitions do not carry
|
|
238
237
|
* a `name` field.
|
|
239
238
|
*/
|
|
240
|
-
|
|
239
|
+
type PublicAgentDefinitionBase = {
|
|
241
240
|
/**
|
|
242
241
|
* Human-readable description of the agent's purpose. Required for
|
|
243
242
|
* subagents (authored under `subagents/<id>/agent.ts`): surfaced to
|
|
@@ -251,22 +250,6 @@ export type PublicAgentDefinition = {
|
|
|
251
250
|
* {@link AgentExperimentalDefinition}.
|
|
252
251
|
*/
|
|
253
252
|
readonly experimental?: AgentExperimentalDefinition;
|
|
254
|
-
/**
|
|
255
|
-
* Language model used for agent turns. Accepts an AI Gateway model ID, any AI
|
|
256
|
-
* SDK-compatible language model, or `defineDynamic({ fallback, events })` for
|
|
257
|
-
* scoped dynamic model selection.
|
|
258
|
-
*/
|
|
259
|
-
readonly model: PublicAgentModelDefinition;
|
|
260
|
-
/**
|
|
261
|
-
* Optional override for the primary model's context window size, in tokens.
|
|
262
|
-
*
|
|
263
|
-
* Escape hatch for cases where eve cannot resolve the model's metadata via
|
|
264
|
-
* the AI Gateway model catalog (e.g. a custom or unlisted model id). When
|
|
265
|
-
* set, eve uses this value verbatim and skips the AI Gateway lookup. Prefer
|
|
266
|
-
* leaving this unset so eve can stay in sync with provider metadata.
|
|
267
|
-
*/
|
|
268
|
-
readonly modelContextWindowTokens?: number;
|
|
269
|
-
readonly modelOptions?: AgentModelOptionsDefinition;
|
|
270
253
|
/**
|
|
271
254
|
* Provider-agnostic reasoning effort for the agent's turn model calls.
|
|
272
255
|
* Support for individual levels depends on the selected model and provider.
|
|
@@ -284,3 +267,20 @@ export type PublicAgentDefinition = {
|
|
|
284
267
|
*/
|
|
285
268
|
readonly outputSchema?: StandardJSONSchemaV1<unknown, unknown> | JsonObject;
|
|
286
269
|
};
|
|
270
|
+
/**
|
|
271
|
+
* Shared public definition for an agent. Static models may carry definition-level
|
|
272
|
+
* metadata; dynamic models must return metadata with each concrete selection.
|
|
273
|
+
*/
|
|
274
|
+
export type PublicAgentDefinition = PublicAgentDefinitionBase & ({
|
|
275
|
+
/** Language model used for agent turns. */
|
|
276
|
+
readonly model: PublicAgentStaticModelDefinition;
|
|
277
|
+
/** Optional context-window override for the static model. */
|
|
278
|
+
readonly modelContextWindowTokens?: number;
|
|
279
|
+
readonly modelOptions?: AgentModelOptionsDefinition;
|
|
280
|
+
} | {
|
|
281
|
+
/** Resolver that must select a concrete model before model-dependent work. */
|
|
282
|
+
readonly model: PublicAgentDynamicModelDefinition;
|
|
283
|
+
readonly modelContextWindowTokens?: never;
|
|
284
|
+
readonly modelOptions?: never;
|
|
285
|
+
});
|
|
286
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isDynamicSentinel}from"#shared/dynamic-tool-definition.js";function isDynamicModelDefinition(e){return isDynamicSentinel(e)
|
|
1
|
+
import{isDynamicSentinel}from"#shared/dynamic-tool-definition.js";function isDynamicModelDefinition(e){return isDynamicSentinel(e)}export{isDynamicModelDefinition};
|
|
@@ -3,7 +3,7 @@ import type { UserContent } from "ai";
|
|
|
3
3
|
import type { ChannelReceiveContext } from "#channel/channel-operations.js";
|
|
4
4
|
import type { RouteDefinition } from "#channel/routes.js";
|
|
5
5
|
import type { Session, SessionHandle } from "#channel/session.js";
|
|
6
|
-
import type { SessionAuthContext } from "#channel/types.js";
|
|
6
|
+
import type { SessionAuthContext, TurnPolicy } from "#channel/types.js";
|
|
7
7
|
/**
|
|
8
8
|
* Enriched return shape from a channel's {@link ChannelAdapter.fetchFile}
|
|
9
9
|
* function. Return a bare {@link Buffer} when only bytes are known, or
|
|
@@ -40,6 +40,8 @@ export interface GenericReceiveInput<TReceiveTarget = Record<string, unknown>> {
|
|
|
40
40
|
* projection).
|
|
41
41
|
*/
|
|
42
42
|
export interface GenericChannelDefinition<TEvents, TState = undefined, TCtx = void, TReceiveTarget = Record<string, unknown>, TMetadata extends Record<string, unknown> = Record<string, unknown>> {
|
|
43
|
+
/** Policy used by message sends that do not provide an explicit override. */
|
|
44
|
+
readonly turnPolicy?: TurnPolicy;
|
|
43
45
|
readonly state?: TState;
|
|
44
46
|
/**
|
|
45
47
|
* CORS policy for this channel's HTTP routes. `true` enables H3/Nitro's
|
|
@@ -106,25 +106,19 @@ export type DynamicToolEvents = {
|
|
|
106
106
|
export type DynamicEvents<TResult = unknown> = {
|
|
107
107
|
readonly [K in DynamicToolEventName]?: (event: unknown, ctx: DynamicResolveContext) => TResult | Promise<TResult>;
|
|
108
108
|
};
|
|
109
|
-
export type DynamicEventsWithFallback<TResult = unknown> = {
|
|
110
|
-
readonly [K in DynamicToolEventName]?: (event: unknown, ctx: DynamicResolveContext) => Exclude<TResult, undefined> | Promise<Exclude<TResult, undefined>>;
|
|
111
|
-
};
|
|
112
109
|
/**
|
|
113
110
|
* Marker discriminator for a `defineDynamic({ events })` export.
|
|
114
111
|
*/
|
|
115
112
|
export declare const DYNAMIC_SENTINEL_KIND: "eve:dynamic";
|
|
116
113
|
/**
|
|
117
114
|
* Return value of `defineDynamic`: the runtime shape of a dynamic export,
|
|
118
|
-
* stamped with a sentinel kind the compiler/normalizer detects.
|
|
119
|
-
* is used by dynamic agent models.
|
|
115
|
+
* stamped with a sentinel kind the compiler/normalizer detects.
|
|
120
116
|
*/
|
|
121
|
-
export type DynamicSentinel<TResult = unknown
|
|
117
|
+
export type DynamicSentinel<TResult = unknown> = {
|
|
122
118
|
readonly kind: typeof DYNAMIC_SENTINEL_KIND;
|
|
123
119
|
readonly events: DynamicEvents<TResult>;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
});
|
|
127
|
-
export declare function rejectDynamicSentinelFallback(sentinel: DynamicSentinel, message: string): void;
|
|
120
|
+
};
|
|
121
|
+
export declare function assertResolverOnlyDynamicSentinel(sentinel: DynamicSentinel, message: string): void;
|
|
128
122
|
export declare function isDynamicSentinel(value: unknown): value is DynamicSentinel;
|
|
129
123
|
/**
|
|
130
124
|
* Symbol-based brand stamped by `defineTool` on every entry. Invisible
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const ALLOWED_DYNAMIC_TOOL_EVENTS=new Set([`session.started`,`turn.started`,`step.started`]),ALLOWED_DYNAMIC_INSTRUCTION_EVENTS=new Set([`session.started`,`turn.started`]),ALLOWED_DYNAMIC_SKILL_EVENTS=new Set([`session.started`,`turn.started`]),DYNAMIC_SENTINEL_KIND=`eve:dynamic`;function
|
|
1
|
+
const ALLOWED_DYNAMIC_TOOL_EVENTS=new Set([`session.started`,`turn.started`,`step.started`]),ALLOWED_DYNAMIC_INSTRUCTION_EVENTS=new Set([`session.started`,`turn.started`]),ALLOWED_DYNAMIC_SKILL_EVENTS=new Set([`session.started`,`turn.started`]),DYNAMIC_SENTINEL_KIND=`eve:dynamic`;function assertResolverOnlyDynamicSentinel(e,t){let n=Object.keys(e).filter(e=>e!==`events`&&e!==`kind`);if(n.length>0)throw Error(`${t} Unknown key(s): ${n.join(`, `)}.`)}function isDynamicSentinel(e){return typeof e==`object`&&!!e&&e.kind===`eve:dynamic`}const TOOL_BRAND=Symbol.for(`eve:tool-brand`);function isBrandedToolEntry(e){return typeof e==`object`&&!!e&&e[TOOL_BRAND]===!0}const INSTRUCTIONS_BRAND=Symbol.for(`eve:instructions-brand`);function isBrandedInstructionsEntry(e){return typeof e==`object`&&!!e&&e[INSTRUCTIONS_BRAND]===!0}const SKILL_BRAND=Symbol.for(`eve:skill-brand`);function isBrandedSkillEntry(e){return typeof e==`object`&&!!e&&e[SKILL_BRAND]===!0}export{ALLOWED_DYNAMIC_INSTRUCTION_EVENTS,ALLOWED_DYNAMIC_SKILL_EVENTS,ALLOWED_DYNAMIC_TOOL_EVENTS,DYNAMIC_SENTINEL_KIND,INSTRUCTIONS_BRAND,SKILL_BRAND,TOOL_BRAND,assertResolverOnlyDynamicSentinel,isBrandedInstructionsEntry,isBrandedSkillEntry,isBrandedToolEntry,isDynamicSentinel};
|
package/dist/src/svelte/index.js
CHANGED
package/dist/src/vue/index.js
CHANGED