@agent-native/core 0.84.57 → 0.84.59
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 +19 -0
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/action.ts +87 -2
- package/corpus/core/src/agent/production-agent.ts +24 -46
- package/corpus/core/src/client/AssistantChat.tsx +69 -12
- package/corpus/core/src/client/MultiTabAssistantChat.tsx +1 -1
- package/corpus/core/src/client/conversation/use-near-bottom-autoscroll.ts +45 -2
- package/corpus/core/src/coding-tools/run-code.ts +1 -0
- package/corpus/core/src/integrations/webhook-handler.ts +10 -9
- package/corpus/core/src/server/action-discovery.ts +3 -0
- package/corpus/core/src/server/credential-provider.ts +11 -6
- package/corpus/templates/analytics/server/lib/agent-chat-plan-mode.ts +29 -0
- package/corpus/templates/analytics/server/plugins/agent-chat.ts +9 -1
- package/corpus/templates/design/actions/list-design-extensions.ts +2 -2
- package/corpus/templates/design/app/components/design/CodeWorkbenchHost.tsx +11 -89
- package/corpus/templates/design/app/components/design/DesignExtensionsPanel.tsx +314 -181
- package/corpus/templates/design/app/components/design/DesignImportPanel.tsx +92 -134
- package/corpus/templates/design/app/components/design/EditPanel.tsx +93 -19
- package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +18 -26
- package/corpus/templates/design/app/components/design/TokensPanel.tsx +220 -192
- package/corpus/templates/design/app/components/design/code-workbench-theme.ts +150 -0
- package/corpus/templates/design/app/i18n/zh-TW.ts +5 -7
- package/corpus/templates/design/app/i18n-data.ts +61 -77
- package/corpus/templates/design/app/lib/design-import.ts +4 -1
- package/corpus/templates/design/app/pages/DesignEditor.tsx +97 -48
- package/corpus/templates/design/changelog/2026-07-02-design-inspector-and-canvas-controls-stay-consistent-when-se.md +6 -0
- package/corpus/templates/design/changelog/2026-07-02-fixed-a-crash-when-opening-the-code-editor.md +6 -0
- package/corpus/templates/design/changelog/2026-07-02-fixed-motion-drawer-open-transition.md +6 -0
- package/corpus/templates/design/changelog/2026-07-02-improved-design-assets-panel.md +6 -0
- package/dist/action.d.ts +8 -0
- package/dist/action.d.ts.map +1 -1
- package/dist/action.js +79 -2
- package/dist/action.js.map +1 -1
- package/dist/agent/production-agent.d.ts +10 -11
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +21 -44
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/client/AssistantChat.d.ts +1 -0
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +61 -11
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/MultiTabAssistantChat.js +1 -1
- package/dist/client/MultiTabAssistantChat.js.map +1 -1
- package/dist/client/conversation/use-near-bottom-autoscroll.d.ts.map +1 -1
- package/dist/client/conversation/use-near-bottom-autoscroll.js +43 -2
- package/dist/client/conversation/use-near-bottom-autoscroll.js.map +1 -1
- package/dist/coding-tools/run-code.d.ts.map +1 -1
- package/dist/coding-tools/run-code.js +1 -0
- package/dist/coding-tools/run-code.js.map +1 -1
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/awareness.d.ts.map +1 -1
- package/dist/file-upload/actions/upload-image.d.ts +2 -2
- package/dist/integrations/webhook-handler.d.ts +1 -0
- package/dist/integrations/webhook-handler.d.ts.map +1 -1
- package/dist/integrations/webhook-handler.js +9 -9
- package/dist/integrations/webhook-handler.js.map +1 -1
- package/dist/notifications/routes.d.ts +3 -3
- package/dist/observability/routes.d.ts +4 -4
- package/dist/server/action-discovery.d.ts.map +1 -1
- package/dist/server/action-discovery.js +3 -0
- package/dist/server/action-discovery.js.map +1 -1
- package/dist/server/credential-provider.d.ts +4 -0
- package/dist/server/credential-provider.d.ts.map +1 -1
- package/dist/server/credential-provider.js +13 -7
- package/dist/server/credential-provider.js.map +1 -1
- package/dist/server/transcribe-voice.d.ts +1 -1
- package/package.json +1 -1
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
} from "@agent-native/core/server";
|
|
8
8
|
|
|
9
9
|
import actionsRegistry from "../../.generated/actions-registry.js";
|
|
10
|
+
import { applyAnalyticsPlanModePolicy } from "../lib/agent-chat-plan-mode";
|
|
10
11
|
import { renderDataDictionary } from "../lib/data-dictionary-context";
|
|
11
12
|
import {
|
|
12
13
|
failedDataQueryAttemptMessage,
|
|
@@ -65,6 +66,11 @@ const INITIAL_TOOL_NAMES = [
|
|
|
65
66
|
"navigate",
|
|
66
67
|
];
|
|
67
68
|
|
|
69
|
+
export {
|
|
70
|
+
applyAnalyticsPlanModePolicy,
|
|
71
|
+
PLAN_MODE_ACT_ONLY_TOOLS,
|
|
72
|
+
} from "../lib/agent-chat-plan-mode";
|
|
73
|
+
|
|
68
74
|
function latestUserText(
|
|
69
75
|
messages: AgentLoopFinalResponseGuardContext["messages"],
|
|
70
76
|
): string {
|
|
@@ -160,7 +166,9 @@ function realDataFinalGuard(context: AgentLoopFinalResponseGuardContext) {
|
|
|
160
166
|
|
|
161
167
|
export default createAgentChatPlugin({
|
|
162
168
|
appId: "analytics",
|
|
163
|
-
actions:
|
|
169
|
+
actions: applyAnalyticsPlanModePolicy(
|
|
170
|
+
loadActionsFromStaticRegistry(actionsRegistry),
|
|
171
|
+
),
|
|
164
172
|
initialToolNames: INITIAL_TOOL_NAMES,
|
|
165
173
|
finalResponseGuard: realDataFinalGuard,
|
|
166
174
|
// Enable sandboxed JavaScript execution for analytics data processing.
|
|
@@ -68,7 +68,7 @@ const FIRST_PARTY_EXTENSIONS: FirstPartyDesignExtension[] = [
|
|
|
68
68
|
id: "design.asset-library",
|
|
69
69
|
name: "Asset Library",
|
|
70
70
|
description:
|
|
71
|
-
"Browse and insert Design
|
|
71
|
+
"Browse and insert Design primitives, generated or uploaded media, and rendered Figma library components into the active design screen. " +
|
|
72
72
|
"Selection-aware: inserts near the selected element when one is active.",
|
|
73
73
|
icon: "Photo",
|
|
74
74
|
availability: "available",
|
|
@@ -77,7 +77,7 @@ const FIRST_PARTY_EXTENSIONS: FirstPartyDesignExtension[] = [
|
|
|
77
77
|
capabilities: [
|
|
78
78
|
{
|
|
79
79
|
id: "native",
|
|
80
|
-
label: "Browse Design
|
|
80
|
+
label: "Browse Design assets",
|
|
81
81
|
status: "available",
|
|
82
82
|
reason:
|
|
83
83
|
"Uses list-design-native-assets and insert-design-native-asset for editable HTML primitives/components.",
|
|
@@ -28,10 +28,11 @@ import { Button } from "@/components/ui/button";
|
|
|
28
28
|
import { Spinner } from "@/components/ui/spinner";
|
|
29
29
|
import { cn } from "@/lib/utils";
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
import {
|
|
32
|
+
normalizeMonacoThemeColor,
|
|
33
|
+
readCodeWorkbenchTheme,
|
|
34
|
+
type CodeWorkbenchTheme,
|
|
35
|
+
} from "./code-workbench-theme";
|
|
35
36
|
|
|
36
37
|
interface CodeWorkbenchDraft {
|
|
37
38
|
content: string;
|
|
@@ -56,87 +57,6 @@ interface CodeWorkbenchHostProps {
|
|
|
56
57
|
onActiveFileChange?: (file: CodeWorkbenchActiveFile | null) => void;
|
|
57
58
|
}
|
|
58
59
|
|
|
59
|
-
const WORKBENCH_THEME_VARS: Record<string, string[]> = {
|
|
60
|
-
"--workbench-bg": ["--design-editor-panel-bg", "--background"],
|
|
61
|
-
"--workbench-sidebar-bg": ["--design-editor-panel-bg", "--card"],
|
|
62
|
-
"--workbench-editor-bg": ["--design-editor-panel-bg", "--background"],
|
|
63
|
-
"--workbench-surface-bg": ["--design-editor-control-bg", "--muted"],
|
|
64
|
-
"--workbench-border": ["--design-editor-control-border", "--border"],
|
|
65
|
-
"--workbench-fg": ["--foreground"],
|
|
66
|
-
"--workbench-muted-fg": ["--muted-foreground"],
|
|
67
|
-
"--workbench-hover-bg": ["--design-editor-layer-hover-color", "--accent"],
|
|
68
|
-
"--workbench-active-bg": ["--design-editor-selection-color", "--accent"],
|
|
69
|
-
"--workbench-active-fg": [
|
|
70
|
-
"--design-editor-accent-color",
|
|
71
|
-
"--accent-foreground",
|
|
72
|
-
],
|
|
73
|
-
"--workbench-accent": ["--design-editor-accent-color", "--primary"],
|
|
74
|
-
"--workbench-button-bg": ["--design-editor-control-bg", "--background"],
|
|
75
|
-
"--workbench-button-fg": ["--foreground"],
|
|
76
|
-
"--workbench-selection-bg": ["--design-editor-selection-color", "--accent"],
|
|
77
|
-
"--workbench-dirty": ["--warning", "--destructive"],
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
function normalizeThemeColorValue(value: string): string {
|
|
81
|
-
const trimmed = value.trim();
|
|
82
|
-
if (!trimmed) return "";
|
|
83
|
-
if (/^-?\d+(\.\d+)?\s+-?\d+(\.\d+)?%/.test(trimmed)) {
|
|
84
|
-
return `hsl(${trimmed})`;
|
|
85
|
-
}
|
|
86
|
-
return trimmed;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
function resolveCssColorValue(value: string): string {
|
|
90
|
-
if (typeof window === "undefined" || typeof document === "undefined") {
|
|
91
|
-
return value;
|
|
92
|
-
}
|
|
93
|
-
const probe = document.createElement("span");
|
|
94
|
-
probe.style.color = value;
|
|
95
|
-
probe.style.position = "fixed";
|
|
96
|
-
probe.style.pointerEvents = "none";
|
|
97
|
-
probe.style.visibility = "hidden";
|
|
98
|
-
document.body.appendChild(probe);
|
|
99
|
-
const resolved = window.getComputedStyle(probe).color;
|
|
100
|
-
probe.remove();
|
|
101
|
-
return resolved || value;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
function readThemeVar(
|
|
105
|
-
elementStyles: CSSStyleDeclaration,
|
|
106
|
-
rootStyles: CSSStyleDeclaration,
|
|
107
|
-
names: string[],
|
|
108
|
-
): string | undefined {
|
|
109
|
-
for (const name of names) {
|
|
110
|
-
const value =
|
|
111
|
-
elementStyles.getPropertyValue(name) || rootStyles.getPropertyValue(name);
|
|
112
|
-
const normalized = normalizeThemeColorValue(value);
|
|
113
|
-
if (normalized) return resolveCssColorValue(normalized);
|
|
114
|
-
}
|
|
115
|
-
return undefined;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
function readCodeWorkbenchTheme(
|
|
119
|
-
element: HTMLElement | null,
|
|
120
|
-
): CodeWorkbenchTheme {
|
|
121
|
-
if (typeof window === "undefined" || !element) {
|
|
122
|
-
return { colorScheme: "light", values: {} };
|
|
123
|
-
}
|
|
124
|
-
const elementStyles = window.getComputedStyle(element);
|
|
125
|
-
const rootStyles = window.getComputedStyle(document.documentElement);
|
|
126
|
-
const values: Record<string, string> = {};
|
|
127
|
-
for (const [targetVar, sourceVars] of Object.entries(WORKBENCH_THEME_VARS)) {
|
|
128
|
-
const value = readThemeVar(elementStyles, rootStyles, sourceVars);
|
|
129
|
-
if (value) values[targetVar] = value;
|
|
130
|
-
}
|
|
131
|
-
const colorScheme =
|
|
132
|
-
document.documentElement.classList.contains("dark") ||
|
|
133
|
-
elementStyles.colorScheme.includes("dark") ||
|
|
134
|
-
rootStyles.colorScheme.includes("dark")
|
|
135
|
-
? "dark"
|
|
136
|
-
: "light";
|
|
137
|
-
return { colorScheme, values };
|
|
138
|
-
}
|
|
139
|
-
|
|
140
60
|
let monacoEnvironmentInstalled = false;
|
|
141
61
|
|
|
142
62
|
function ensureMonacoEnvironment() {
|
|
@@ -210,10 +130,12 @@ function defineMonacoTheme(theme: CodeWorkbenchTheme): string {
|
|
|
210
130
|
"editorWidget.background": values["--workbench-surface-bg"],
|
|
211
131
|
"editorWidget.border": values["--workbench-border"],
|
|
212
132
|
focusBorder: values["--workbench-accent"],
|
|
213
|
-
})
|
|
214
|
-
(
|
|
215
|
-
|
|
216
|
-
|
|
133
|
+
})
|
|
134
|
+
.map(([key, value]) => [key, normalizeMonacoThemeColor(value)] as const)
|
|
135
|
+
.filter(
|
|
136
|
+
(entry): entry is [string, string] =>
|
|
137
|
+
typeof entry[1] === "string" && entry[1].length > 0,
|
|
138
|
+
),
|
|
217
139
|
);
|
|
218
140
|
monaco.editor.defineTheme(name, {
|
|
219
141
|
base: dark ? "vs-dark" : "vs",
|