@agent-native/core 0.78.0 → 0.78.2
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/corpus/README.md +1 -1
- package/corpus/core/CHANGELOG.md +15 -0
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/agent/production-agent.ts +269 -237
- package/corpus/core/src/agent/types.ts +22 -0
- package/corpus/core/src/client/AgentPanel.tsx +8 -0
- package/corpus/core/src/client/AssistantChat.tsx +40 -0
- package/corpus/core/src/client/agent-chat.ts +173 -0
- package/corpus/core/src/client/composer/TiptapComposer.tsx +316 -60
- package/corpus/core/src/client/composer/extensions/MentionReference.tsx +3 -0
- package/corpus/core/src/client/composer/types.ts +22 -0
- package/corpus/core/src/client/index.ts +5 -0
- package/corpus/core/src/server/agent-chat-plugin.ts +10 -0
- package/corpus/core/src/server/request-context.ts +8 -0
- package/corpus/templates/analytics/server/plugins/agent-chat.ts +13 -0
- package/corpus/templates/assets/.agents/skills/asset-generation/SKILL.md +10 -2
- package/corpus/templates/assets/.agents/skills/image-generation/SKILL.md +14 -7
- package/corpus/templates/assets/.agents/skills/library-management/SKILL.md +12 -0
- package/corpus/templates/assets/AGENTS.md +18 -3
- package/corpus/templates/assets/actions/_image-model-default.ts +24 -0
- package/corpus/templates/assets/actions/dismiss-variant-slots.ts +15 -22
- package/corpus/templates/assets/actions/generate-asset.ts +30 -23
- package/corpus/templates/assets/actions/generate-image-batch.ts +76 -29
- package/corpus/templates/assets/actions/generate-image.ts +46 -30
- package/corpus/templates/assets/actions/generate-video.ts +18 -3
- package/corpus/templates/assets/actions/list-assets.ts +39 -8
- package/corpus/templates/assets/actions/list-libraries.ts +24 -2
- package/corpus/templates/assets/actions/navigate.ts +1 -1
- package/corpus/templates/assets/actions/open-asset-picker.ts +38 -1
- package/corpus/templates/assets/actions/refresh-generation-run.ts +10 -0
- package/corpus/templates/assets/actions/save-generated-image.ts +21 -19
- package/corpus/templates/assets/actions/variant-slots.ts +131 -28
- package/corpus/templates/assets/actions/view-screen.ts +9 -0
- package/corpus/templates/assets/app/components/generation/GenerationResults.tsx +425 -0
- package/corpus/templates/assets/app/components/layout/Header.tsx +3 -1
- package/corpus/templates/assets/app/components/layout/Layout.tsx +5 -0
- package/corpus/templates/assets/app/components/layout/Sidebar.tsx +4 -6
- package/corpus/templates/assets/app/hooks/use-navigation-state.ts +47 -21
- package/corpus/templates/assets/app/i18n-data.ts +1815 -0
- package/corpus/templates/assets/app/lib/libraries.ts +6 -0
- package/corpus/templates/assets/app/lib/picker-chat-handoff.ts +71 -0
- package/corpus/templates/assets/app/routes/_index.tsx +4 -0
- package/corpus/templates/assets/app/routes/asset.$id.tsx +2 -2
- package/corpus/templates/assets/app/routes/audit.tsx +1 -1
- package/corpus/templates/assets/app/routes/brand-kits.$id.tsx +1557 -2164
- package/corpus/templates/assets/app/routes/brand-kits._index.tsx +7 -191
- package/corpus/templates/assets/app/routes/brand-kits.tsx +1 -5
- package/corpus/templates/assets/app/routes/libraries.tsx +4 -4
- package/corpus/templates/assets/app/routes/library.$id.tsx +9 -7
- package/corpus/templates/assets/app/routes/library.tsx +1454 -175
- package/corpus/templates/assets/server/db/index.ts +1 -1
- package/corpus/templates/assets/server/lib/generation.ts +86 -15
- package/corpus/templates/assets/server/plugins/agent-chat.ts +196 -0
- package/corpus/templates/assets/server/plugins/db.ts +5 -0
- package/corpus/templates/assets/shared/api.ts +6 -3
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +50 -29
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/agent/types.d.ts +21 -0
- package/dist/agent/types.d.ts.map +1 -1
- package/dist/agent/types.js.map +1 -1
- package/dist/client/AgentPanel.d.ts +5 -1
- package/dist/client/AgentPanel.d.ts.map +1 -1
- package/dist/client/AgentPanel.js +2 -2
- package/dist/client/AgentPanel.js.map +1 -1
- package/dist/client/AssistantChat.d.ts +6 -0
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +15 -3
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/agent-chat.d.ts +32 -0
- package/dist/client/agent-chat.d.ts.map +1 -1
- package/dist/client/agent-chat.js +113 -0
- package/dist/client/agent-chat.js.map +1 -1
- package/dist/client/composer/TiptapComposer.d.ts +2 -1
- package/dist/client/composer/TiptapComposer.d.ts.map +1 -1
- package/dist/client/composer/TiptapComposer.js +228 -56
- package/dist/client/composer/TiptapComposer.js.map +1 -1
- package/dist/client/composer/extensions/MentionReference.d.ts.map +1 -1
- package/dist/client/composer/extensions/MentionReference.js +3 -0
- package/dist/client/composer/extensions/MentionReference.js.map +1 -1
- package/dist/client/composer/types.d.ts +21 -0
- package/dist/client/composer/types.d.ts.map +1 -1
- package/dist/client/composer/types.js.map +1 -1
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +1 -1
- package/dist/client/index.js.map +1 -1
- package/dist/notifications/routes.d.ts +1 -1
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +5 -0
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/request-context.d.ts +8 -0
- package/dist/server/request-context.d.ts.map +1 -1
- package/dist/server/request-context.js.map +1 -1
- package/package.json +1 -1
|
@@ -11,6 +11,12 @@ export type ImageLibrarySummary = {
|
|
|
11
11
|
styleBrief?: Record<string, unknown> | null;
|
|
12
12
|
settings?: Record<string, unknown> | null;
|
|
13
13
|
updatedAt?: string | null;
|
|
14
|
+
folders?: Array<{
|
|
15
|
+
id: string;
|
|
16
|
+
libraryId: string;
|
|
17
|
+
parentId?: string | null;
|
|
18
|
+
title: string;
|
|
19
|
+
}> | null;
|
|
14
20
|
};
|
|
15
21
|
|
|
16
22
|
export type LibraryPreviewAsset = {
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
type PickerMediaType = "image" | "video";
|
|
2
|
+
|
|
3
|
+
export interface PickerChatHandoffInput {
|
|
4
|
+
mediaType: PickerMediaType;
|
|
5
|
+
prompt: string;
|
|
6
|
+
count?: number;
|
|
7
|
+
aspectRatio?: string | null;
|
|
8
|
+
libraryId?: string | null;
|
|
9
|
+
libraryTitle?: string | null;
|
|
10
|
+
presetId?: string | null;
|
|
11
|
+
presetTitle?: string | null;
|
|
12
|
+
tier?: string | null;
|
|
13
|
+
styleStrength?: string | null;
|
|
14
|
+
includeLogo?: boolean | null;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function clean(value: string | null | undefined): string | null {
|
|
18
|
+
const trimmed = value?.trim();
|
|
19
|
+
return trimmed ? trimmed : null;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function pluralizeCandidate(count: number): string {
|
|
23
|
+
return count === 1 ? "candidate" : "candidates";
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function buildPickerChatHandoffPrompt(
|
|
27
|
+
input: PickerChatHandoffInput,
|
|
28
|
+
): string {
|
|
29
|
+
const prompt = clean(input.prompt) ?? "";
|
|
30
|
+
const count = Math.min(6, Math.max(1, Math.round(input.count ?? 3)));
|
|
31
|
+
const mediaLabel =
|
|
32
|
+
input.mediaType === "video"
|
|
33
|
+
? "a video asset"
|
|
34
|
+
: `${count} image ${pluralizeCandidate(count)}`;
|
|
35
|
+
const lines = [`Generate ${mediaLabel} in Assets for this request:`, prompt];
|
|
36
|
+
|
|
37
|
+
const libraryTitle = clean(input.libraryTitle);
|
|
38
|
+
const libraryId = clean(input.libraryId);
|
|
39
|
+
if (libraryTitle || libraryId) {
|
|
40
|
+
lines.push(
|
|
41
|
+
`Use the selected library: ${libraryTitle ?? "Untitled library"}${
|
|
42
|
+
libraryId ? ` (${libraryId})` : ""
|
|
43
|
+
}.`,
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const presetTitle = clean(input.presetTitle);
|
|
48
|
+
const presetId = clean(input.presetId);
|
|
49
|
+
if (presetTitle || presetId) {
|
|
50
|
+
lines.push(
|
|
51
|
+
`Use the selected preset: ${presetTitle ?? "Untitled preset"}${
|
|
52
|
+
presetId ? ` (${presetId})` : ""
|
|
53
|
+
}.`,
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const aspectRatio = clean(input.aspectRatio);
|
|
58
|
+
if (input.mediaType === "image" && aspectRatio) {
|
|
59
|
+
lines.push(`Use aspect ratio ${aspectRatio}.`);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const tier = clean(input.tier);
|
|
63
|
+
if (tier) lines.push(`Use quality tier ${tier}.`);
|
|
64
|
+
|
|
65
|
+
const styleStrength = clean(input.styleStrength);
|
|
66
|
+
if (styleStrength) lines.push(`Use style strength ${styleStrength}.`);
|
|
67
|
+
if (input.includeLogo) lines.push("Include the library logo if available.");
|
|
68
|
+
|
|
69
|
+
lines.push("Open the picker with the generated candidates so I can choose.");
|
|
70
|
+
return lines.filter(Boolean).join("\n");
|
|
71
|
+
}
|
|
@@ -11,6 +11,7 @@ import { IconPhoto, IconSparkles, IconVideo } from "@tabler/icons-react";
|
|
|
11
11
|
import { useCallback, useEffect, useState } from "react";
|
|
12
12
|
import { useNavigate, useParams } from "react-router";
|
|
13
13
|
|
|
14
|
+
import { GenerationResults } from "@/components/generation/GenerationResults";
|
|
14
15
|
import { ASSETS_CHAT_STORAGE_KEY } from "@/lib/chat";
|
|
15
16
|
|
|
16
17
|
// The composer's model picker shows the chat LLM (Claude/OpenAI/Gemini). The
|
|
@@ -137,6 +138,9 @@ export default function CreatePage() {
|
|
|
137
138
|
navigate,
|
|
138
139
|
}}
|
|
139
140
|
browserTabId={getBrowserTabId()}
|
|
141
|
+
threadFooterSlot={({ threadId }) => (
|
|
142
|
+
<GenerationResults threadId={threadId} />
|
|
143
|
+
)}
|
|
140
144
|
imageModelMenu={{
|
|
141
145
|
value: imageModel,
|
|
142
146
|
options: IMAGE_MODEL_OPTIONS.map((option) => ({
|
|
@@ -88,7 +88,7 @@ export default function AssetDetailPage() {
|
|
|
88
88
|
String(asset.libraryId || "").startsWith("starter:");
|
|
89
89
|
const libraryBackPath = isStarterAsset
|
|
90
90
|
? "/library"
|
|
91
|
-
: `/
|
|
91
|
+
: `/library/${asset.libraryId}`;
|
|
92
92
|
|
|
93
93
|
function refine() {
|
|
94
94
|
sendToAgentChat({
|
|
@@ -290,7 +290,7 @@ export default function AssetDetailPage() {
|
|
|
290
290
|
{ id: asset.id },
|
|
291
291
|
{
|
|
292
292
|
onSuccess: () =>
|
|
293
|
-
navigate(`/
|
|
293
|
+
navigate(`/library/${asset.libraryId}`),
|
|
294
294
|
},
|
|
295
295
|
)
|
|
296
296
|
}
|
|
@@ -555,7 +555,7 @@ function RunDetail({ runId }: { runId: string }) {
|
|
|
555
555
|
<Separator />
|
|
556
556
|
<div>
|
|
557
557
|
<a
|
|
558
|
-
href={`/
|
|
558
|
+
href={`/library/${run.libraryId}`}
|
|
559
559
|
className="text-xs text-muted-foreground underline-offset-4 hover:underline"
|
|
560
560
|
>
|
|
561
561
|
{t("audit.openBrandKit")}
|