@agent-native/core 0.128.3 → 0.128.4
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 +7 -0
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/client/chat/legacy-chart-shorthand.tsx +479 -0
- package/corpus/core/src/client/chat/markdown-renderer.tsx +23 -3
- package/corpus/core/src/extensions/actions.ts +1 -1
- package/corpus/templates/analytics/.agents/skills/data-querying/SKILL.md +12 -0
- package/corpus/templates/analytics/actions/generate-chart.ts +2 -2
- package/corpus/templates/chat/README.md +2 -0
- package/dist/client/chat/legacy-chart-shorthand.d.ts +29 -0
- package/dist/client/chat/legacy-chart-shorthand.d.ts.map +1 -0
- package/dist/client/chat/legacy-chart-shorthand.js +330 -0
- package/dist/client/chat/legacy-chart-shorthand.js.map +1 -0
- package/dist/client/chat/markdown-renderer.d.ts.map +1 -1
- package/dist/client/chat/markdown-renderer.js +8 -2
- package/dist/client/chat/markdown-renderer.js.map +1 -1
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/extensions/actions.js +1 -1
- package/dist/extensions/actions.js.map +1 -1
- package/dist/file-upload/actions/upload-image.d.ts +1 -1
- package/dist/observability/routes.d.ts +3 -3
- package/dist/provider-api/actions/custom-provider-registration.d.ts +14 -14
- package/dist/provider-api/actions/provider-api.d.ts +8 -8
- package/dist/server/realtime-token.d.ts +1 -1
- package/dist/server/transcribe-voice.d.ts +1 -1
- package/dist/templates/chat/README.md +2 -0
- package/package.json +1 -1
- package/src/client/chat/legacy-chart-shorthand.tsx +479 -0
- package/src/client/chat/markdown-renderer.tsx +23 -3
- package/src/extensions/actions.ts +1 -1
- package/src/templates/chat/README.md +2 -0
|
@@ -32,6 +32,13 @@ import { NEW_CHAT_ACTION_HREF } from "../error-format.js";
|
|
|
32
32
|
import { HighlightedCodeBlock as SharedHighlightedCodeBlock } from "../HighlightedCodeBlock.js";
|
|
33
33
|
import { IframeEmbed, parseEmbedBody } from "../IframeEmbed.js";
|
|
34
34
|
import { cn } from "../utils.js";
|
|
35
|
+
import {
|
|
36
|
+
LEGACY_CHART_SHORTHAND_LANG,
|
|
37
|
+
LegacyChartShorthandChart,
|
|
38
|
+
LegacyChartShorthandFallback,
|
|
39
|
+
parseLegacyChartShorthand,
|
|
40
|
+
wrapLegacyChartShorthandLines,
|
|
41
|
+
} from "./legacy-chart-shorthand.js";
|
|
35
42
|
|
|
36
43
|
// ─── Lazy markdown loader ────────────────────────────────────────────────────
|
|
37
44
|
// react-markdown + remark-gfm are deferred so they stay off the critical path
|
|
@@ -284,6 +291,19 @@ export const markdownComponents = {
|
|
|
284
291
|
<IframeEmbed {...(parsed as Parameters<typeof IframeEmbed>[0])} />
|
|
285
292
|
);
|
|
286
293
|
}
|
|
294
|
+
if (
|
|
295
|
+
new RegExp(`\\blanguage-${LEGACY_CHART_SHORTHAND_LANG}\\b`).test(
|
|
296
|
+
className,
|
|
297
|
+
)
|
|
298
|
+
) {
|
|
299
|
+
const body = extractCodeText(childProps.children).replace(/\n$/, "");
|
|
300
|
+
const parsed = parseLegacyChartShorthand(body);
|
|
301
|
+
return parsed ? (
|
|
302
|
+
<LegacyChartShorthandChart parsed={parsed} />
|
|
303
|
+
) : (
|
|
304
|
+
<LegacyChartShorthandFallback text={body} />
|
|
305
|
+
);
|
|
306
|
+
}
|
|
287
307
|
const langMatch = className.match(/\blanguage-([\w+-]+)\b/);
|
|
288
308
|
if (langMatch) {
|
|
289
309
|
const code = extractCodeText(childProps.children).replace(/\n$/, "");
|
|
@@ -589,7 +609,7 @@ export const MemoizedMarkdownBlock = React.memo(function MemoizedMarkdownBlock({
|
|
|
589
609
|
components={markdownComponents}
|
|
590
610
|
urlTransform={markdownUrlTransform}
|
|
591
611
|
>
|
|
592
|
-
{blockText}
|
|
612
|
+
{wrapLegacyChartShorthandLines(blockText)}
|
|
593
613
|
</ReactMarkdown>
|
|
594
614
|
);
|
|
595
615
|
});
|
|
@@ -642,7 +662,7 @@ export function SmoothMarkdownText({
|
|
|
642
662
|
components={markdownComponents}
|
|
643
663
|
urlTransform={markdownUrlTransform}
|
|
644
664
|
>
|
|
645
|
-
{split.tail}
|
|
665
|
+
{wrapLegacyChartShorthandLines(split.tail)}
|
|
646
666
|
</ReactMarkdown>
|
|
647
667
|
) : null}
|
|
648
668
|
</>
|
|
@@ -653,7 +673,7 @@ export function SmoothMarkdownText({
|
|
|
653
673
|
components={markdownComponents}
|
|
654
674
|
urlTransform={markdownUrlTransform}
|
|
655
675
|
>
|
|
656
|
-
{visibleText}
|
|
676
|
+
{wrapLegacyChartShorthandLines(visibleText)}
|
|
657
677
|
</ReactMarkdown>
|
|
658
678
|
)
|
|
659
679
|
) : (
|
|
@@ -623,7 +623,7 @@ export function createExtensionActionEntries(): Record<string, ActionEntry> {
|
|
|
623
623
|
"update-extension": {
|
|
624
624
|
tool: {
|
|
625
625
|
description:
|
|
626
|
-
'Update an existing sandboxed Alpine.js mini-app extension. Pass exactly three fields: `id`, `operation`, and `payloadJson`. `payloadJson` is a JSON object encoded as a string so model gateways cannot fill its optional members with invalid empty placeholders. For operation="edit", pass {"edits":[...]} or {"patches":[...]} and optional format=true. For operation="replace", pass exactly one of content, contentFromAttachment, or contentFromWorkspaceFile; use this operation only for a user-requested broad visual rewrite or complete replacement body. For operation="metadata", pass name, description, or icon. Change sharing through set-resource-visibility instead. If the user is viewing the extension, use the extensionId from <current-screen> or <current-url> directly.',
|
|
626
|
+
'Update an existing sandboxed Alpine.js mini-app extension. Pass exactly three fields: `id`, `operation`, and `payloadJson`. `payloadJson` is a JSON object encoded as a string so model gateways cannot fill its optional members with invalid empty placeholders. For operation="edit", pass {"edits":[...]} or {"patches":[...]} and optional format=true — prefer several small, targeted edits over one large one; a single edit/replace body over roughly 8KB risks the model truncating its own payloadJson mid-generation, which arrives here as an empty or malformed call that must be retried from scratch. For operation="replace", pass exactly one of content, contentFromAttachment, or contentFromWorkspaceFile; use this operation only for a user-requested broad visual rewrite or complete replacement body. Do not inline large static datasets (full metric histories, big arrays) into the HTML/JS body — store them with extension-data-set and fetch them at runtime via extensionData.list()/get() instead, so edits stay small regardless of dataset size. For operation="metadata", pass name, description, or icon. Change sharing through set-resource-visibility instead. If the user is viewing the extension, use the extensionId from <current-screen> or <current-url> directly.',
|
|
627
627
|
parameters: {
|
|
628
628
|
type: "object",
|
|
629
629
|
properties: {
|