@agent-native/core 0.109.3 → 0.109.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 +2 -2
- package/corpus/core/CHANGELOG.md +8 -0
- package/corpus/core/docs/content/agent-native-toolkit.mdx +46 -13
- package/corpus/core/docs/content/locales/ar-SA/agent-native-toolkit.mdx +79 -55
- package/corpus/core/docs/content/locales/ar-SA/toolkit-capability-packages.mdx +21 -0
- package/corpus/core/docs/content/locales/ar-SA/toolkit-context-knowledge.mdx +12 -0
- package/corpus/core/docs/content/locales/ar-SA/toolkit-editors-canvases.mdx +17 -0
- package/corpus/core/docs/content/locales/de-DE/agent-native-toolkit.mdx +82 -54
- package/corpus/core/docs/content/locales/de-DE/toolkit-capability-packages.mdx +21 -0
- package/corpus/core/docs/content/locales/de-DE/toolkit-context-knowledge.mdx +12 -0
- package/corpus/core/docs/content/locales/de-DE/toolkit-editors-canvases.mdx +17 -0
- package/corpus/core/docs/content/locales/es-ES/agent-native-toolkit.mdx +81 -52
- package/corpus/core/docs/content/locales/es-ES/toolkit-capability-packages.mdx +21 -0
- package/corpus/core/docs/content/locales/es-ES/toolkit-context-knowledge.mdx +12 -0
- package/corpus/core/docs/content/locales/es-ES/toolkit-editors-canvases.mdx +21 -0
- package/corpus/core/docs/content/locales/fr-FR/agent-native-toolkit.mdx +84 -54
- package/corpus/core/docs/content/locales/fr-FR/toolkit-capability-packages.mdx +21 -0
- package/corpus/core/docs/content/locales/fr-FR/toolkit-context-knowledge.mdx +12 -0
- package/corpus/core/docs/content/locales/fr-FR/toolkit-editors-canvases.mdx +21 -0
- package/corpus/core/docs/content/locales/hi-IN/agent-native-toolkit.mdx +69 -62
- package/corpus/core/docs/content/locales/hi-IN/toolkit-capability-packages.mdx +21 -0
- package/corpus/core/docs/content/locales/hi-IN/toolkit-context-knowledge.mdx +12 -0
- package/corpus/core/docs/content/locales/hi-IN/toolkit-editors-canvases.mdx +17 -0
- package/corpus/core/docs/content/locales/ja-JP/agent-native-toolkit.mdx +69 -62
- package/corpus/core/docs/content/locales/ja-JP/toolkit-capability-packages.mdx +21 -0
- package/corpus/core/docs/content/locales/ja-JP/toolkit-context-knowledge.mdx +12 -0
- package/corpus/core/docs/content/locales/ja-JP/toolkit-editors-canvases.mdx +17 -0
- package/corpus/core/docs/content/locales/ko-KR/agent-native-toolkit.mdx +69 -62
- package/corpus/core/docs/content/locales/ko-KR/toolkit-capability-packages.mdx +21 -0
- package/corpus/core/docs/content/locales/ko-KR/toolkit-context-knowledge.mdx +12 -0
- package/corpus/core/docs/content/locales/ko-KR/toolkit-editors-canvases.mdx +17 -0
- package/corpus/core/docs/content/locales/pt-BR/agent-native-toolkit.mdx +82 -54
- package/corpus/core/docs/content/locales/pt-BR/toolkit-capability-packages.mdx +21 -0
- package/corpus/core/docs/content/locales/pt-BR/toolkit-context-knowledge.mdx +12 -0
- package/corpus/core/docs/content/locales/pt-BR/toolkit-editors-canvases.mdx +17 -0
- package/corpus/core/docs/content/locales/zh-CN/agent-native-toolkit.mdx +69 -62
- package/corpus/core/docs/content/locales/zh-CN/toolkit-capability-packages.mdx +21 -0
- package/corpus/core/docs/content/locales/zh-CN/toolkit-context-knowledge.mdx +12 -0
- package/corpus/core/docs/content/locales/zh-CN/toolkit-editors-canvases.mdx +17 -0
- package/corpus/core/docs/content/locales/zh-TW/agent-native-toolkit.mdx +69 -62
- package/corpus/core/docs/content/locales/zh-TW/toolkit-capability-packages.mdx +21 -0
- package/corpus/core/docs/content/locales/zh-TW/toolkit-context-knowledge.mdx +12 -0
- package/corpus/core/docs/content/locales/zh-TW/toolkit-editors-canvases.mdx +17 -0
- package/corpus/core/docs/content/toolkit-capability-packages.mdx +52 -0
- package/corpus/core/docs/content/toolkit-context-knowledge.mdx +46 -0
- package/corpus/core/docs/content/toolkit-editors-canvases.mdx +55 -0
- package/corpus/core/package.json +35 -34
- package/corpus/core/src/cli/create.ts +39 -3
- package/corpus/core/src/cli/package-lifecycle.ts +2 -0
- package/corpus/core/src/cli/skills-content/visual-plan-skill.ts +2 -0
- package/corpus/core/src/client/context-xray/ContextMeter.tsx +31 -111
- package/corpus/core/src/client/context-xray/ContextSegmentRow.tsx +8 -111
- package/corpus/core/src/client/context-xray/ContextTreemap.tsx +6 -111
- package/corpus/core/src/client/context-xray/ContextXRayPanel.tsx +31 -391
- package/corpus/core/src/client/context-xray/SegmentProvenancePopover.tsx +4 -52
- package/corpus/core/src/client/context-xray/format.ts +0 -33
- package/corpus/core/src/client/rich-markdown-editor/index.ts +42 -57
- package/corpus/core/src/client/rich-markdown-editor/uploadEditorImage.ts +2 -1
- package/corpus/core/src/client/visual-style-controls.tsx +1 -1088
- package/corpus/core/src/collab/agent-identity.ts +5 -22
- package/corpus/core/src/collab/client.ts +1 -53
- package/corpus/core/src/styles/rich-markdown-editor.css +1 -510
- package/corpus/core/src/testing.ts +1 -1
- package/corpus/core/src/vite/client.ts +3 -0
- package/corpus/templates/content/app/components/editor/VisualEditor.tsx +5 -3
- package/corpus/templates/content/app/components/editor/extensions/DragHandle.tsx +4 -4
- package/corpus/templates/content/package.json +25 -25
- package/corpus/templates/design/app/components/design/TweaksPanel.tsx +2 -1
- package/corpus/templates/design/package.json +1 -1
- package/corpus/templates/mail/package.json +9 -9
- package/corpus/templates/plan/.agents/skills/visual-plan/SKILL.md +2 -0
- package/corpus/templates/plan/app/components/editor/PlanDocumentEditor.tsx +8 -8
- package/corpus/templates/plan/app/components/editor/planSlashCommands.ts +6 -6
- package/corpus/templates/plan/app/components/plan/PlanImageNode.tsx +4 -7
- package/corpus/templates/plan/app/components/plan/PlanMarkdownEditor.tsx +6 -4
- package/corpus/templates/plan/app/components/plan/PlanVisualSurface.tsx +1 -1
- package/corpus/templates/plan/changelog/2026-07-18-visual-plans-now-open-on-wireframes-by-default-when-a-protot.md +6 -0
- package/corpus/templates/plan/package.json +3 -3
- package/corpus/templates/slides/app/components/editor/SlideStyleInspector.tsx +2 -2
- package/corpus/templates/slides/app/components/editor/TweaksPanel.tsx +2 -2
- package/corpus/templates/slides/package.json +13 -13
- package/dist/catalog.json +39 -1
- package/dist/cli/create.d.ts.map +1 -1
- package/dist/cli/create.js +32 -3
- package/dist/cli/create.js.map +1 -1
- package/dist/cli/package-lifecycle.d.ts.map +1 -1
- package/dist/cli/package-lifecycle.js +2 -0
- package/dist/cli/package-lifecycle.js.map +1 -1
- package/dist/cli/skills-content/visual-plan-skill.d.ts +1 -1
- package/dist/cli/skills-content/visual-plan-skill.d.ts.map +1 -1
- package/dist/cli/skills-content/visual-plan-skill.js +2 -0
- package/dist/cli/skills-content/visual-plan-skill.js.map +1 -1
- package/dist/client/context-xray/ContextMeter.d.ts.map +1 -1
- package/dist/client/context-xray/ContextMeter.js +8 -23
- package/dist/client/context-xray/ContextMeter.js.map +1 -1
- package/dist/client/context-xray/ContextSegmentRow.d.ts.map +1 -1
- package/dist/client/context-xray/ContextSegmentRow.js +3 -19
- package/dist/client/context-xray/ContextSegmentRow.js.map +1 -1
- package/dist/client/context-xray/ContextTreemap.d.ts.map +1 -1
- package/dist/client/context-xray/ContextTreemap.js +3 -54
- package/dist/client/context-xray/ContextTreemap.js.map +1 -1
- package/dist/client/context-xray/ContextXRayPanel.d.ts.map +1 -1
- package/dist/client/context-xray/ContextXRayPanel.js +21 -163
- package/dist/client/context-xray/ContextXRayPanel.js.map +1 -1
- package/dist/client/context-xray/SegmentProvenancePopover.d.ts.map +1 -1
- package/dist/client/context-xray/SegmentProvenancePopover.js +3 -4
- package/dist/client/context-xray/SegmentProvenancePopover.js.map +1 -1
- package/dist/client/context-xray/format.d.ts +0 -4
- package/dist/client/context-xray/format.d.ts.map +1 -1
- package/dist/client/context-xray/format.js +0 -49
- package/dist/client/context-xray/format.js.map +1 -1
- package/dist/client/rich-markdown-editor/index.d.ts +1 -12
- package/dist/client/rich-markdown-editor/index.d.ts.map +1 -1
- package/dist/client/rich-markdown-editor/index.js +1 -12
- package/dist/client/rich-markdown-editor/index.js.map +1 -1
- package/dist/client/rich-markdown-editor/uploadEditorImage.d.ts +1 -1
- package/dist/client/rich-markdown-editor/uploadEditorImage.d.ts.map +1 -1
- package/dist/client/rich-markdown-editor/uploadEditorImage.js.map +1 -1
- package/dist/client/visual-style-controls.d.ts +1 -89
- package/dist/client/visual-style-controls.d.ts.map +1 -1
- package/dist/client/visual-style-controls.js +1 -498
- package/dist/client/visual-style-controls.js.map +1 -1
- package/dist/collab/agent-identity.d.ts +1 -14
- package/dist/collab/agent-identity.d.ts.map +1 -1
- package/dist/collab/agent-identity.js +1 -13
- package/dist/collab/agent-identity.js.map +1 -1
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/awareness.d.ts.map +1 -1
- package/dist/collab/client.d.ts +1 -19
- package/dist/collab/client.d.ts.map +1 -1
- package/dist/collab/client.js +1 -53
- package/dist/collab/client.js.map +1 -1
- package/dist/collab/routes.d.ts +1 -1
- package/dist/file-upload/actions/upload-image.d.ts +1 -1
- package/dist/notifications/routes.d.ts +3 -3
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/styles/rich-markdown-editor.css +1 -510
- package/dist/testing.d.ts +1 -1
- package/dist/testing.d.ts.map +1 -1
- package/dist/testing.js +1 -1
- package/dist/testing.js.map +1 -1
- package/dist/vite/client.d.ts.map +1 -1
- package/dist/vite/client.js +3 -0
- package/dist/vite/client.js.map +1 -1
- package/docs/content/agent-native-toolkit.mdx +46 -13
- package/docs/content/locales/ar-SA/agent-native-toolkit.mdx +79 -55
- package/docs/content/locales/ar-SA/toolkit-capability-packages.mdx +21 -0
- package/docs/content/locales/ar-SA/toolkit-context-knowledge.mdx +12 -0
- package/docs/content/locales/ar-SA/toolkit-editors-canvases.mdx +17 -0
- package/docs/content/locales/de-DE/agent-native-toolkit.mdx +82 -54
- package/docs/content/locales/de-DE/toolkit-capability-packages.mdx +21 -0
- package/docs/content/locales/de-DE/toolkit-context-knowledge.mdx +12 -0
- package/docs/content/locales/de-DE/toolkit-editors-canvases.mdx +17 -0
- package/docs/content/locales/es-ES/agent-native-toolkit.mdx +81 -52
- package/docs/content/locales/es-ES/toolkit-capability-packages.mdx +21 -0
- package/docs/content/locales/es-ES/toolkit-context-knowledge.mdx +12 -0
- package/docs/content/locales/es-ES/toolkit-editors-canvases.mdx +21 -0
- package/docs/content/locales/fr-FR/agent-native-toolkit.mdx +84 -54
- package/docs/content/locales/fr-FR/toolkit-capability-packages.mdx +21 -0
- package/docs/content/locales/fr-FR/toolkit-context-knowledge.mdx +12 -0
- package/docs/content/locales/fr-FR/toolkit-editors-canvases.mdx +21 -0
- package/docs/content/locales/hi-IN/agent-native-toolkit.mdx +69 -62
- package/docs/content/locales/hi-IN/toolkit-capability-packages.mdx +21 -0
- package/docs/content/locales/hi-IN/toolkit-context-knowledge.mdx +12 -0
- package/docs/content/locales/hi-IN/toolkit-editors-canvases.mdx +17 -0
- package/docs/content/locales/ja-JP/agent-native-toolkit.mdx +69 -62
- package/docs/content/locales/ja-JP/toolkit-capability-packages.mdx +21 -0
- package/docs/content/locales/ja-JP/toolkit-context-knowledge.mdx +12 -0
- package/docs/content/locales/ja-JP/toolkit-editors-canvases.mdx +17 -0
- package/docs/content/locales/ko-KR/agent-native-toolkit.mdx +69 -62
- package/docs/content/locales/ko-KR/toolkit-capability-packages.mdx +21 -0
- package/docs/content/locales/ko-KR/toolkit-context-knowledge.mdx +12 -0
- package/docs/content/locales/ko-KR/toolkit-editors-canvases.mdx +17 -0
- package/docs/content/locales/pt-BR/agent-native-toolkit.mdx +82 -54
- package/docs/content/locales/pt-BR/toolkit-capability-packages.mdx +21 -0
- package/docs/content/locales/pt-BR/toolkit-context-knowledge.mdx +12 -0
- package/docs/content/locales/pt-BR/toolkit-editors-canvases.mdx +17 -0
- package/docs/content/locales/zh-CN/agent-native-toolkit.mdx +69 -62
- package/docs/content/locales/zh-CN/toolkit-capability-packages.mdx +21 -0
- package/docs/content/locales/zh-CN/toolkit-context-knowledge.mdx +12 -0
- package/docs/content/locales/zh-CN/toolkit-editors-canvases.mdx +17 -0
- package/docs/content/locales/zh-TW/agent-native-toolkit.mdx +69 -62
- package/docs/content/locales/zh-TW/toolkit-capability-packages.mdx +21 -0
- package/docs/content/locales/zh-TW/toolkit-context-knowledge.mdx +12 -0
- package/docs/content/locales/zh-TW/toolkit-editors-canvases.mdx +17 -0
- package/docs/content/toolkit-capability-packages.mdx +52 -0
- package/docs/content/toolkit-context-knowledge.mdx +46 -0
- package/docs/content/toolkit-editors-canvases.mdx +55 -0
- package/package.json +27 -26
- package/corpus/core/src/client/rich-markdown-editor/BubbleToolbar.tsx +0 -253
- package/corpus/core/src/client/rich-markdown-editor/CodeBlockNode.tsx +0 -258
- package/corpus/core/src/client/rich-markdown-editor/DragHandle.ts +0 -1437
- package/corpus/core/src/client/rich-markdown-editor/ImageExtension.ts +0 -306
- package/corpus/core/src/client/rich-markdown-editor/RichMarkdownEditor.tsx +0 -80
- package/corpus/core/src/client/rich-markdown-editor/RunId.ts +0 -61
- package/corpus/core/src/client/rich-markdown-editor/SharedRichEditor.tsx +0 -321
- package/corpus/core/src/client/rich-markdown-editor/SlashCommandMenu.tsx +0 -310
- package/corpus/core/src/client/rich-markdown-editor/extensions.ts +0 -402
- package/corpus/core/src/client/rich-markdown-editor/gfmDoc.ts +0 -92
- package/corpus/core/src/client/rich-markdown-editor/surgical-apply.ts +0 -192
- package/corpus/core/src/client/rich-markdown-editor/useCollabReconcile.ts +0 -590
- package/dist/client/rich-markdown-editor/BubbleToolbar.d.ts +0 -37
- package/dist/client/rich-markdown-editor/BubbleToolbar.d.ts.map +0 -1
- package/dist/client/rich-markdown-editor/BubbleToolbar.js +0 -171
- package/dist/client/rich-markdown-editor/BubbleToolbar.js.map +0 -1
- package/dist/client/rich-markdown-editor/CodeBlockNode.d.ts +0 -49
- package/dist/client/rich-markdown-editor/CodeBlockNode.d.ts.map +0 -1
- package/dist/client/rich-markdown-editor/CodeBlockNode.js +0 -127
- package/dist/client/rich-markdown-editor/CodeBlockNode.js.map +0 -1
- package/dist/client/rich-markdown-editor/DragHandle.d.ts +0 -97
- package/dist/client/rich-markdown-editor/DragHandle.d.ts.map +0 -1
- package/dist/client/rich-markdown-editor/DragHandle.js +0 -1066
- package/dist/client/rich-markdown-editor/DragHandle.js.map +0 -1
- package/dist/client/rich-markdown-editor/ImageExtension.d.ts +0 -63
- package/dist/client/rich-markdown-editor/ImageExtension.d.ts.map +0 -1
- package/dist/client/rich-markdown-editor/ImageExtension.js +0 -243
- package/dist/client/rich-markdown-editor/ImageExtension.js.map +0 -1
- package/dist/client/rich-markdown-editor/RichMarkdownEditor.d.ts +0 -51
- package/dist/client/rich-markdown-editor/RichMarkdownEditor.d.ts.map +0 -1
- package/dist/client/rich-markdown-editor/RichMarkdownEditor.js +0 -37
- package/dist/client/rich-markdown-editor/RichMarkdownEditor.js.map +0 -1
- package/dist/client/rich-markdown-editor/RunId.d.ts +0 -28
- package/dist/client/rich-markdown-editor/RunId.d.ts.map +0 -1
- package/dist/client/rich-markdown-editor/RunId.js +0 -60
- package/dist/client/rich-markdown-editor/RunId.js.map +0 -1
- package/dist/client/rich-markdown-editor/SharedRichEditor.d.ts +0 -110
- package/dist/client/rich-markdown-editor/SharedRichEditor.d.ts.map +0 -1
- package/dist/client/rich-markdown-editor/SharedRichEditor.js +0 -144
- package/dist/client/rich-markdown-editor/SharedRichEditor.js.map +0 -1
- package/dist/client/rich-markdown-editor/SlashCommandMenu.d.ts +0 -41
- package/dist/client/rich-markdown-editor/SlashCommandMenu.d.ts.map +0 -1
- package/dist/client/rich-markdown-editor/SlashCommandMenu.js +0 -221
- package/dist/client/rich-markdown-editor/SlashCommandMenu.js.map +0 -1
- package/dist/client/rich-markdown-editor/extensions.d.ts +0 -178
- package/dist/client/rich-markdown-editor/extensions.d.ts.map +0 -1
- package/dist/client/rich-markdown-editor/extensions.js +0 -224
- package/dist/client/rich-markdown-editor/extensions.js.map +0 -1
- package/dist/client/rich-markdown-editor/gfmDoc.d.ts +0 -24
- package/dist/client/rich-markdown-editor/gfmDoc.d.ts.map +0 -1
- package/dist/client/rich-markdown-editor/gfmDoc.js +0 -83
- package/dist/client/rich-markdown-editor/gfmDoc.js.map +0 -1
- package/dist/client/rich-markdown-editor/surgical-apply.d.ts +0 -66
- package/dist/client/rich-markdown-editor/surgical-apply.d.ts.map +0 -1
- package/dist/client/rich-markdown-editor/surgical-apply.js +0 -147
- package/dist/client/rich-markdown-editor/surgical-apply.js.map +0 -1
- package/dist/client/rich-markdown-editor/useCollabReconcile.d.ts +0 -110
- package/dist/client/rich-markdown-editor/useCollabReconcile.d.ts.map +0 -1
- package/dist/client/rich-markdown-editor/useCollabReconcile.js +0 -441
- package/dist/client/rich-markdown-editor/useCollabReconcile.js.map +0 -1
package/corpus/core/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-native/core",
|
|
3
|
-
"version": "0.109.
|
|
3
|
+
"version": "0.109.4",
|
|
4
4
|
"description": "Framework for agent-native application development — where AI agents and UI share SQL state, actions, and context",
|
|
5
5
|
"homepage": "https://github.com/BuilderIO/agent-native#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
"type": "module",
|
|
32
32
|
"sideEffects": [
|
|
33
33
|
"*.css",
|
|
34
|
+
"dist/client/index.js",
|
|
34
35
|
"dist/client/chat/widgets/builtin-tool-renderers.js",
|
|
35
36
|
"dist/client/dev-overlay/builtins.js"
|
|
36
37
|
],
|
|
@@ -280,12 +281,12 @@
|
|
|
280
281
|
"@mozilla/readability": "0.6.0",
|
|
281
282
|
"@neondatabase/serverless": "^1.1.0",
|
|
282
283
|
"@opentelemetry/sdk-trace-base": "^2.8.0",
|
|
283
|
-
"@radix-ui/react-dialog": "
|
|
284
|
-
"@radix-ui/react-dropdown-menu": "
|
|
285
|
-
"@radix-ui/react-hover-card": "
|
|
286
|
-
"@radix-ui/react-popover": "
|
|
287
|
-
"@radix-ui/react-select": "
|
|
288
|
-
"@radix-ui/react-tooltip": "
|
|
284
|
+
"@radix-ui/react-dialog": "catalog:",
|
|
285
|
+
"@radix-ui/react-dropdown-menu": "catalog:",
|
|
286
|
+
"@radix-ui/react-hover-card": "catalog:",
|
|
287
|
+
"@radix-ui/react-popover": "catalog:",
|
|
288
|
+
"@radix-ui/react-select": "catalog:",
|
|
289
|
+
"@radix-ui/react-tooltip": "catalog:",
|
|
289
290
|
"@react-router/dev": "^8.1.0",
|
|
290
291
|
"@react-router/fs-routes": "^8.1.0",
|
|
291
292
|
"@resvg/resvg-js": "^2.6.2",
|
|
@@ -295,63 +296,63 @@
|
|
|
295
296
|
"@shadcn/react": "^0.2.0",
|
|
296
297
|
"@standard-schema/spec": "^1.1.0",
|
|
297
298
|
"@tanstack/react-table": "^8.21.3",
|
|
298
|
-
"@tiptap/core": "
|
|
299
|
-
"@tiptap/extension-code-block-lowlight": "
|
|
300
|
-
"@tiptap/extension-collaboration": "
|
|
301
|
-
"@tiptap/extension-collaboration-caret": "
|
|
302
|
-
"@tiptap/extension-image": "
|
|
303
|
-
"@tiptap/extension-link": "
|
|
304
|
-
"@tiptap/extension-placeholder": "
|
|
305
|
-
"@tiptap/extension-table": "
|
|
306
|
-
"@tiptap/extension-table-cell": "
|
|
307
|
-
"@tiptap/extension-table-header": "
|
|
308
|
-
"@tiptap/extension-table-row": "
|
|
309
|
-
"@tiptap/extension-task-item": "
|
|
310
|
-
"@tiptap/extension-task-list": "
|
|
311
|
-
"@tiptap/pm": "
|
|
312
|
-
"@tiptap/react": "
|
|
313
|
-
"@tiptap/starter-kit": "
|
|
314
|
-
"@tiptap/y-tiptap": "
|
|
299
|
+
"@tiptap/core": "catalog:",
|
|
300
|
+
"@tiptap/extension-code-block-lowlight": "catalog:",
|
|
301
|
+
"@tiptap/extension-collaboration": "catalog:",
|
|
302
|
+
"@tiptap/extension-collaboration-caret": "catalog:",
|
|
303
|
+
"@tiptap/extension-image": "catalog:",
|
|
304
|
+
"@tiptap/extension-link": "catalog:",
|
|
305
|
+
"@tiptap/extension-placeholder": "catalog:",
|
|
306
|
+
"@tiptap/extension-table": "catalog:",
|
|
307
|
+
"@tiptap/extension-table-cell": "catalog:",
|
|
308
|
+
"@tiptap/extension-table-header": "catalog:",
|
|
309
|
+
"@tiptap/extension-table-row": "catalog:",
|
|
310
|
+
"@tiptap/extension-task-item": "catalog:",
|
|
311
|
+
"@tiptap/extension-task-list": "catalog:",
|
|
312
|
+
"@tiptap/pm": "catalog:",
|
|
313
|
+
"@tiptap/react": "catalog:",
|
|
314
|
+
"@tiptap/starter-kit": "catalog:",
|
|
315
|
+
"@tiptap/y-tiptap": "catalog:",
|
|
315
316
|
"@uiw/react-codemirror": "^4.25.10",
|
|
316
317
|
"ajv": "^8.20.0",
|
|
317
318
|
"better-auth": "1.6.16",
|
|
318
319
|
"better-sqlite3": "^12.8.0",
|
|
319
320
|
"botframework-connector": "^4.23.3",
|
|
320
|
-
"clsx": "
|
|
321
|
+
"clsx": "catalog:",
|
|
321
322
|
"cron-parser": "^5.5.0",
|
|
322
323
|
"diff-match-patch": "^1.0.5",
|
|
323
324
|
"dotenv": "^17.2.1",
|
|
324
325
|
"drizzle-orm": "^0.45.2",
|
|
325
326
|
"h3": "^2.0.1-rc.20",
|
|
326
|
-
"highlight.js": "
|
|
327
|
+
"highlight.js": "catalog:",
|
|
327
328
|
"i18next": "26.3.1",
|
|
328
329
|
"isbot": "^5",
|
|
329
330
|
"jiti": "^2.6.1",
|
|
330
331
|
"jose": "^6.2.2",
|
|
331
332
|
"linkedom": "0.18.12",
|
|
332
|
-
"lowlight": "
|
|
333
|
+
"lowlight": "catalog:",
|
|
333
334
|
"minimatch": "^10.0.0",
|
|
334
335
|
"nanoid": "^5.1.9",
|
|
335
|
-
"next-themes": "
|
|
336
|
+
"next-themes": "catalog:",
|
|
336
337
|
"nf3": "0.3.17",
|
|
337
338
|
"nitro": "3.0.260415-beta",
|
|
338
339
|
"p-limit": "^7.3.0",
|
|
339
340
|
"prettier": "^3.8.3",
|
|
340
341
|
"react-i18next": "17.0.8",
|
|
341
342
|
"react-markdown": "^10.1.0",
|
|
342
|
-
"recharts": "
|
|
343
|
+
"recharts": "catalog:",
|
|
343
344
|
"remark-gfm": "^4.0.1",
|
|
344
345
|
"roughjs": "4.6.6",
|
|
345
346
|
"safe-regex2": "5.1.1",
|
|
346
347
|
"shiki": "^4.0.2",
|
|
347
|
-
"sonner": "
|
|
348
|
-
"tailwind-merge": "
|
|
349
|
-
"tiptap-markdown": "
|
|
348
|
+
"sonner": "catalog:",
|
|
349
|
+
"tailwind-merge": "catalog:",
|
|
350
|
+
"tiptap-markdown": "catalog:",
|
|
350
351
|
"turndown": "7.2.4",
|
|
351
352
|
"tw-animate-css": "1.4.0",
|
|
352
353
|
"tweetnacl": "^1.0.3",
|
|
353
|
-
"y-protocols": "
|
|
354
|
-
"yjs": "
|
|
354
|
+
"y-protocols": "catalog:",
|
|
355
|
+
"yjs": "catalog:",
|
|
355
356
|
"zod": "^4.3.6"
|
|
356
357
|
},
|
|
357
358
|
"devDependencies": {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { execFile, execFileSync } from "child_process";
|
|
2
2
|
import fs from "fs";
|
|
3
|
+
import os from "os";
|
|
3
4
|
import path from "path";
|
|
4
5
|
import { fileURLToPath, pathToFileURL } from "url";
|
|
5
6
|
|
|
@@ -44,6 +45,7 @@ const FIRST_PARTY_TARBALL_SYMLINK_EXCLUDES = [
|
|
|
44
45
|
"*/CLAUDE.md",
|
|
45
46
|
"*/.claude/skills",
|
|
46
47
|
];
|
|
48
|
+
const localPackageTarballs = new Map<string, string>();
|
|
47
49
|
|
|
48
50
|
/**
|
|
49
51
|
* Tagged error for input that fails CLI-level validation (repo names, app
|
|
@@ -903,6 +905,40 @@ function findLocalPackage(name: string): string | undefined {
|
|
|
903
905
|
return undefined;
|
|
904
906
|
}
|
|
905
907
|
|
|
908
|
+
/**
|
|
909
|
+
* Pack a local framework package before linking it into a generated app.
|
|
910
|
+
* Raw file: dependencies retain workspace-only catalog references, while a
|
|
911
|
+
* packed artifact has the publish-ready manifest that consumers receive.
|
|
912
|
+
*/
|
|
913
|
+
function localPackageTarball(packageDir: string): string {
|
|
914
|
+
const cached = localPackageTarballs.get(packageDir);
|
|
915
|
+
if (cached) return cached;
|
|
916
|
+
|
|
917
|
+
const packDir = fs.mkdtempSync(
|
|
918
|
+
path.join(os.tmpdir(), "agent-native-local-package-"),
|
|
919
|
+
);
|
|
920
|
+
const pnpm = process.platform === "win32" ? "pnpm.cmd" : "pnpm";
|
|
921
|
+
execFileSync(pnpm, ["pack", "--pack-destination", packDir], {
|
|
922
|
+
cwd: packageDir,
|
|
923
|
+
encoding: "utf-8",
|
|
924
|
+
env: { ...process.env, npm_config_ignore_scripts: "true" },
|
|
925
|
+
stdio: "pipe",
|
|
926
|
+
});
|
|
927
|
+
|
|
928
|
+
const tarballs = fs
|
|
929
|
+
.readdirSync(packDir)
|
|
930
|
+
.filter((entry) => entry.endsWith(".tgz"));
|
|
931
|
+
if (tarballs.length !== 1) {
|
|
932
|
+
throw new Error(
|
|
933
|
+
`Expected one packed local package artifact in ${packDir}, found ${tarballs.length}.`,
|
|
934
|
+
);
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
const tarball = pathToFileURL(path.join(packDir, tarballs[0]!)).href;
|
|
938
|
+
localPackageTarballs.set(packageDir, tarball);
|
|
939
|
+
return tarball;
|
|
940
|
+
}
|
|
941
|
+
|
|
906
942
|
/**
|
|
907
943
|
* Scaffold internal workspace packages required by the selected templates.
|
|
908
944
|
* Deduplicates so each package is only copied once even if multiple
|
|
@@ -1691,7 +1727,7 @@ function fixWebManifestName(
|
|
|
1691
1727
|
function getCoreDependencyVersion(): string {
|
|
1692
1728
|
if (process.env.AGENT_NATIVE_CREATE_USE_LOCAL_CORE === "1") {
|
|
1693
1729
|
const localCore = findLocalPackage("core");
|
|
1694
|
-
if (localCore) return
|
|
1730
|
+
if (localCore) return localPackageTarball(localCore);
|
|
1695
1731
|
}
|
|
1696
1732
|
|
|
1697
1733
|
// Generated apps must install before the current package version is
|
|
@@ -1713,7 +1749,7 @@ function getDispatchDependencyVersion(): string {
|
|
|
1713
1749
|
function getToolkitDependencyVersion(): string {
|
|
1714
1750
|
if (process.env.AGENT_NATIVE_CREATE_USE_LOCAL_CORE === "1") {
|
|
1715
1751
|
const localToolkit = findLocalPackage("toolkit");
|
|
1716
|
-
if (localToolkit) return
|
|
1752
|
+
if (localToolkit) return localPackageTarball(localToolkit);
|
|
1717
1753
|
}
|
|
1718
1754
|
|
|
1719
1755
|
return "latest";
|
|
@@ -1722,7 +1758,7 @@ function getToolkitDependencyVersion(): string {
|
|
|
1722
1758
|
function localToolkitOverride(): string | null {
|
|
1723
1759
|
if (process.env.AGENT_NATIVE_CREATE_USE_LOCAL_CORE !== "1") return null;
|
|
1724
1760
|
const localToolkit = findLocalPackage("toolkit");
|
|
1725
|
-
return localToolkit ?
|
|
1761
|
+
return localToolkit ? localPackageTarball(localToolkit) : null;
|
|
1726
1762
|
}
|
|
1727
1763
|
|
|
1728
1764
|
function localRecapCliOverride(): string | null {
|
|
@@ -139,6 +139,8 @@ function flagValue(args: string[], name: string): string | undefined {
|
|
|
139
139
|
|
|
140
140
|
export function packageLifecycleUsage(): string {
|
|
141
141
|
return [
|
|
142
|
+
"Install-on-demand Toolkit capability module lifecycle:",
|
|
143
|
+
"",
|
|
142
144
|
"Usage:",
|
|
143
145
|
" agent-native package inspect <package> [--root <dir>] [--app <name>] [--json]",
|
|
144
146
|
" agent-native package add <package> [--root <dir>] [--app <name>] [--apply] [--json]",
|
|
@@ -290,6 +290,8 @@ folding framework chrome into the product UI.
|
|
|
290
290
|
needs to operate the behavior. Keep the static wireframes in
|
|
291
291
|
\`content.canvas\`, add the aligned functional prototype in
|
|
292
292
|
\`content.prototype\`, and rely on the top visual tabs to switch between them.
|
|
293
|
+
When both surfaces are present, open the Wireframes tab by default; the
|
|
294
|
+
prototype remains available as the interactive follow-up view.
|
|
293
295
|
- **Prototype-first** when the user asks to operate the UI or when interaction is
|
|
294
296
|
the main question. Use \`create-prototype-plan\`, which still preserves static
|
|
295
297
|
mocks where useful.
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ContextMeterView } from "@agent-native/toolkit/context-ui";
|
|
1
2
|
import { lazy, Suspense, useEffect, useRef, useState } from "react";
|
|
2
3
|
|
|
3
4
|
import type {
|
|
@@ -8,20 +9,8 @@ import {
|
|
|
8
9
|
manifestConversationTokens,
|
|
9
10
|
manifestSystemTokens,
|
|
10
11
|
} from "../../shared/context-xray.js";
|
|
11
|
-
import {
|
|
12
|
-
Popover,
|
|
13
|
-
PopoverContent,
|
|
14
|
-
PopoverTrigger,
|
|
15
|
-
} from "../components/ui/popover.js";
|
|
16
|
-
import {
|
|
17
|
-
Tooltip,
|
|
18
|
-
TooltipContent,
|
|
19
|
-
TooltipProvider,
|
|
20
|
-
TooltipTrigger,
|
|
21
|
-
} from "../components/ui/tooltip.js";
|
|
22
12
|
import { useActionMutation, useActionQuery } from "../use-action.js";
|
|
23
|
-
import {
|
|
24
|
-
import { formatTokens, resolveContextWindow } from "./format.js";
|
|
13
|
+
import { resolveContextWindow } from "./format.js";
|
|
25
14
|
|
|
26
15
|
const ContextXRayPanel = lazy(() =>
|
|
27
16
|
import("./ContextXRayPanel.js").then((m) => ({
|
|
@@ -29,40 +18,6 @@ const ContextXRayPanel = lazy(() =>
|
|
|
29
18
|
})),
|
|
30
19
|
);
|
|
31
20
|
|
|
32
|
-
function ContextDonut({ pct, advisory }: { pct: number; advisory: boolean }) {
|
|
33
|
-
const radius = 7.5;
|
|
34
|
-
const circumference = 2 * Math.PI * radius;
|
|
35
|
-
const displayPct = Math.max(3, Math.min(100, pct));
|
|
36
|
-
const dashOffset = circumference - (displayPct / 100) * circumference;
|
|
37
|
-
|
|
38
|
-
return (
|
|
39
|
-
<span className="relative flex size-5 items-center justify-center">
|
|
40
|
-
<svg aria-hidden="true" viewBox="0 0 20 20" className="-rotate-90 size-5">
|
|
41
|
-
<circle
|
|
42
|
-
cx="10"
|
|
43
|
-
cy="10"
|
|
44
|
-
r={radius}
|
|
45
|
-
className="stroke-muted"
|
|
46
|
-
fill="none"
|
|
47
|
-
strokeWidth="3"
|
|
48
|
-
/>
|
|
49
|
-
<circle
|
|
50
|
-
cx="10"
|
|
51
|
-
cy="10"
|
|
52
|
-
r={radius}
|
|
53
|
-
className={cn(advisory ? "stroke-amber-500" : "stroke-[#00B5FF]")}
|
|
54
|
-
fill="none"
|
|
55
|
-
strokeLinecap="round"
|
|
56
|
-
strokeWidth="3"
|
|
57
|
-
strokeDasharray={circumference}
|
|
58
|
-
strokeDashoffset={dashOffset}
|
|
59
|
-
/>
|
|
60
|
-
</svg>
|
|
61
|
-
<span className="absolute size-2 rounded-full bg-background" />
|
|
62
|
-
</span>
|
|
63
|
-
);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
21
|
export function ContextMeter({
|
|
67
22
|
threadId,
|
|
68
23
|
manifest: providedManifest,
|
|
@@ -106,15 +61,6 @@ export function ContextMeter({
|
|
|
106
61
|
}, [enabled, threadId]);
|
|
107
62
|
|
|
108
63
|
const manifest = providedManifest ?? query.data;
|
|
109
|
-
const contextWindow = resolveContextWindow(manifest?.model);
|
|
110
|
-
const pct = manifest
|
|
111
|
-
? Math.min(100, Math.round((manifest.totalTokens / contextWindow) * 100))
|
|
112
|
-
: 0;
|
|
113
|
-
const systemTokens = manifest ? manifestSystemTokens(manifest) : 0;
|
|
114
|
-
const conversationTokens = manifest
|
|
115
|
-
? manifestConversationTokens(manifest)
|
|
116
|
-
: 0;
|
|
117
|
-
|
|
118
64
|
if (
|
|
119
65
|
(!shouldQuery && !providedManifest) ||
|
|
120
66
|
!manifest ||
|
|
@@ -144,61 +90,35 @@ export function ContextMeter({
|
|
|
144
90
|
};
|
|
145
91
|
|
|
146
92
|
return (
|
|
147
|
-
<
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
</PopoverTrigger>
|
|
165
|
-
</TooltipTrigger>
|
|
166
|
-
<TooltipContent>
|
|
167
|
-
Context {pct}% · {formatTokens(manifest.totalTokens)}
|
|
168
|
-
{systemTokens > 0
|
|
169
|
-
? ` (${formatTokens(systemTokens)} system + ${formatTokens(conversationTokens)} conversation)`
|
|
170
|
-
: ""}
|
|
171
|
-
</TooltipContent>
|
|
172
|
-
</Tooltip>
|
|
173
|
-
<PopoverContent
|
|
174
|
-
align="end"
|
|
175
|
-
side="top"
|
|
176
|
-
sideOffset={8}
|
|
177
|
-
className="w-[min(92vw,380px)] overflow-hidden border-border/70 p-0"
|
|
93
|
+
<ContextMeterView
|
|
94
|
+
manifest={{
|
|
95
|
+
...manifest,
|
|
96
|
+
systemTokens: manifestSystemTokens(manifest),
|
|
97
|
+
conversationTokens: manifestConversationTokens(manifest),
|
|
98
|
+
}}
|
|
99
|
+
contextWindow={resolveContextWindow(manifest.model)}
|
|
100
|
+
open={open}
|
|
101
|
+
onOpenChange={setOpen}
|
|
102
|
+
>
|
|
103
|
+
{open ? (
|
|
104
|
+
<Suspense
|
|
105
|
+
fallback={
|
|
106
|
+
<div className="flex h-52 items-center justify-center text-xs text-muted-foreground">
|
|
107
|
+
Loading context view…
|
|
108
|
+
</div>
|
|
109
|
+
}
|
|
178
110
|
>
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
onEvict={(segmentId) =>
|
|
192
|
-
mutateStatus(segmentId, "evicted", "evict")
|
|
193
|
-
}
|
|
194
|
-
onRestore={(segmentId) =>
|
|
195
|
-
mutateStatus(segmentId, "active", "restore")
|
|
196
|
-
}
|
|
197
|
-
/>
|
|
198
|
-
</Suspense>
|
|
199
|
-
) : null}
|
|
200
|
-
</PopoverContent>
|
|
201
|
-
</Popover>
|
|
202
|
-
</TooltipProvider>
|
|
111
|
+
<ContextXRayPanel
|
|
112
|
+
manifest={manifest}
|
|
113
|
+
optimistic={optimistic}
|
|
114
|
+
onPin={(segmentId) => mutateStatus(segmentId, "pinned", "pin")}
|
|
115
|
+
onEvict={(segmentId) => mutateStatus(segmentId, "evicted", "evict")}
|
|
116
|
+
onRestore={(segmentId) =>
|
|
117
|
+
mutateStatus(segmentId, "active", "restore")
|
|
118
|
+
}
|
|
119
|
+
/>
|
|
120
|
+
</Suspense>
|
|
121
|
+
) : null}
|
|
122
|
+
</ContextMeterView>
|
|
203
123
|
);
|
|
204
124
|
}
|
|
@@ -1,14 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ContextSegmentRowView } from "@agent-native/toolkit/context-ui";
|
|
2
2
|
|
|
3
3
|
import type { ContextManifestSegment } from "../../shared/context-xray.js";
|
|
4
|
-
import {
|
|
5
|
-
Tooltip,
|
|
6
|
-
TooltipContent,
|
|
7
|
-
TooltipTrigger,
|
|
8
|
-
} from "../components/ui/tooltip.js";
|
|
9
|
-
import { cn } from "../utils.js";
|
|
10
|
-
import { formatTokens, statusLabel } from "./format.js";
|
|
11
|
-
import { SegmentProvenancePopover } from "./SegmentProvenancePopover.js";
|
|
12
4
|
|
|
13
5
|
export function ContextSegmentRow({
|
|
14
6
|
segment,
|
|
@@ -23,108 +15,13 @@ export function ContextSegmentRow({
|
|
|
23
15
|
onEvict: () => void;
|
|
24
16
|
onRestore: () => void;
|
|
25
17
|
}) {
|
|
26
|
-
const disabled = segment.protected || segment.status === "evicted";
|
|
27
18
|
return (
|
|
28
|
-
<
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
className={cn(
|
|
36
|
-
"group flex min-h-11 items-center gap-2 rounded-sm px-2 py-1.5 outline-none transition-colors hover:bg-accent/35 focus-visible:bg-accent/35 focus-visible:ring-1 focus-visible:ring-ring",
|
|
37
|
-
segment.status === "evicted" && "opacity-60",
|
|
38
|
-
)}
|
|
39
|
-
>
|
|
40
|
-
<SegmentProvenancePopover segment={segment}>
|
|
41
|
-
<button
|
|
42
|
-
type="button"
|
|
43
|
-
className="min-w-0 flex-1 text-left"
|
|
44
|
-
aria-label={`Inspect ${segment.label}`}
|
|
45
|
-
>
|
|
46
|
-
<div
|
|
47
|
-
className={cn(
|
|
48
|
-
"truncate text-[13px] font-medium leading-5 text-foreground",
|
|
49
|
-
segment.status === "evicted" && "line-through",
|
|
50
|
-
)}
|
|
51
|
-
>
|
|
52
|
-
{segment.label}
|
|
53
|
-
</div>
|
|
54
|
-
<div className="flex items-center gap-1.5 text-[11px] text-muted-foreground">
|
|
55
|
-
<span>{formatTokens(segment.tokenCount)}</span>
|
|
56
|
-
{segment.tokenMethod === "estimate" && <span>~</span>}
|
|
57
|
-
<span>·</span>
|
|
58
|
-
<span>{statusLabel(segment)}</span>
|
|
59
|
-
{advisory && <span>· advisory</span>}
|
|
60
|
-
</div>
|
|
61
|
-
</button>
|
|
62
|
-
</SegmentProvenancePopover>
|
|
63
|
-
<div className="flex shrink-0 items-center gap-1 opacity-100 sm:opacity-0 sm:group-hover:opacity-100 sm:group-focus-within:opacity-100">
|
|
64
|
-
{segment.protected ? (
|
|
65
|
-
<Tooltip>
|
|
66
|
-
<TooltipTrigger asChild>
|
|
67
|
-
<span className="flex size-6 items-center justify-center rounded-md text-muted-foreground">
|
|
68
|
-
<IconLock className="h-3.5 w-3.5" />
|
|
69
|
-
</span>
|
|
70
|
-
</TooltipTrigger>
|
|
71
|
-
<TooltipContent>Protected during active turn</TooltipContent>
|
|
72
|
-
</Tooltip>
|
|
73
|
-
) : segment.status === "evicted" ||
|
|
74
|
-
segment.status === "summarized" ||
|
|
75
|
-
segment.status === "pinned" ? (
|
|
76
|
-
<Tooltip>
|
|
77
|
-
<TooltipTrigger asChild>
|
|
78
|
-
<button
|
|
79
|
-
type="button"
|
|
80
|
-
onClick={onRestore}
|
|
81
|
-
className="flex size-6 items-center justify-center rounded-md text-muted-foreground hover:bg-background hover:text-foreground"
|
|
82
|
-
aria-label={
|
|
83
|
-
segment.status === "pinned"
|
|
84
|
-
? "Unpin segment"
|
|
85
|
-
: "Restore segment"
|
|
86
|
-
}
|
|
87
|
-
>
|
|
88
|
-
<IconRotate2 className="h-3.5 w-3.5" />
|
|
89
|
-
</button>
|
|
90
|
-
</TooltipTrigger>
|
|
91
|
-
<TooltipContent>
|
|
92
|
-
{segment.status === "pinned" ? "Unpin" : "Restore"}
|
|
93
|
-
</TooltipContent>
|
|
94
|
-
</Tooltip>
|
|
95
|
-
) : (
|
|
96
|
-
<>
|
|
97
|
-
<Tooltip>
|
|
98
|
-
<TooltipTrigger asChild>
|
|
99
|
-
<button
|
|
100
|
-
type="button"
|
|
101
|
-
onClick={onPin}
|
|
102
|
-
className="flex size-6 items-center justify-center rounded-md text-muted-foreground hover:bg-background hover:text-foreground"
|
|
103
|
-
aria-label="Pin segment"
|
|
104
|
-
>
|
|
105
|
-
<IconPin className="h-3.5 w-3.5" />
|
|
106
|
-
</button>
|
|
107
|
-
</TooltipTrigger>
|
|
108
|
-
<TooltipContent>Pin</TooltipContent>
|
|
109
|
-
</Tooltip>
|
|
110
|
-
<Tooltip>
|
|
111
|
-
<TooltipTrigger asChild>
|
|
112
|
-
<button
|
|
113
|
-
type="button"
|
|
114
|
-
onClick={onEvict}
|
|
115
|
-
className="flex size-6 items-center justify-center rounded-md text-muted-foreground hover:bg-background hover:text-destructive"
|
|
116
|
-
aria-label="Evict segment"
|
|
117
|
-
>
|
|
118
|
-
<IconX className="h-3.5 w-3.5" />
|
|
119
|
-
</button>
|
|
120
|
-
</TooltipTrigger>
|
|
121
|
-
<TooltipContent>
|
|
122
|
-
{advisory ? "Record eviction intent" : "Evict"}
|
|
123
|
-
</TooltipContent>
|
|
124
|
-
</Tooltip>
|
|
125
|
-
</>
|
|
126
|
-
)}
|
|
127
|
-
</div>
|
|
128
|
-
</div>
|
|
19
|
+
<ContextSegmentRowView
|
|
20
|
+
segment={segment}
|
|
21
|
+
advisory={advisory}
|
|
22
|
+
onPin={onPin}
|
|
23
|
+
onEvict={onEvict}
|
|
24
|
+
onRestore={onRestore}
|
|
25
|
+
/>
|
|
129
26
|
);
|
|
130
27
|
}
|
|
@@ -1,52 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Treemap } from "recharts";
|
|
1
|
+
import { ContextTreemapView } from "@agent-native/toolkit/context-ui";
|
|
3
2
|
|
|
4
3
|
import type {
|
|
5
4
|
ContextManifestSegment,
|
|
6
5
|
ContextManifestSystemSection,
|
|
7
6
|
} from "../../shared/context-xray.js";
|
|
8
|
-
import { formatTokens, groupFill } from "./format.js";
|
|
9
|
-
|
|
10
|
-
interface TreemapDatum {
|
|
11
|
-
name: string;
|
|
12
|
-
size: number;
|
|
13
|
-
group: string;
|
|
14
|
-
segmentId: string;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
function TreemapContent(props: any) {
|
|
18
|
-
const { x, y, width, height, name, group, size } = props;
|
|
19
|
-
if (width < 8 || height < 8) return null;
|
|
20
|
-
const showLabel = width > 90 && height > 42;
|
|
21
|
-
return (
|
|
22
|
-
<g>
|
|
23
|
-
<rect
|
|
24
|
-
x={x}
|
|
25
|
-
y={y}
|
|
26
|
-
width={width}
|
|
27
|
-
height={height}
|
|
28
|
-
rx={3}
|
|
29
|
-
ry={3}
|
|
30
|
-
fill={groupFill(group)}
|
|
31
|
-
stroke="var(--background)"
|
|
32
|
-
strokeWidth={2}
|
|
33
|
-
/>
|
|
34
|
-
{showLabel && (
|
|
35
|
-
<foreignObject
|
|
36
|
-
x={x + 6}
|
|
37
|
-
y={y + 6}
|
|
38
|
-
width={width - 12}
|
|
39
|
-
height={height - 12}
|
|
40
|
-
>
|
|
41
|
-
<div className="flex h-full flex-col justify-between overflow-hidden text-[11px] leading-tight text-white">
|
|
42
|
-
<div className="truncate font-medium">{name}</div>
|
|
43
|
-
<div className="text-white/85">{formatTokens(size)}</div>
|
|
44
|
-
</div>
|
|
45
|
-
</foreignObject>
|
|
46
|
-
)}
|
|
47
|
-
</g>
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
7
|
|
|
51
8
|
export function ContextTreemap({
|
|
52
9
|
segments,
|
|
@@ -57,73 +14,11 @@ export function ContextTreemap({
|
|
|
57
14
|
systemSections?: ContextManifestSystemSection[];
|
|
58
15
|
onSelect?: (segmentId: string) => void;
|
|
59
16
|
}) {
|
|
60
|
-
const containerRef = useRef<HTMLDivElement>(null);
|
|
61
|
-
const [chartWidth, setChartWidth] = useState(0);
|
|
62
|
-
const data: TreemapDatum[] = segments
|
|
63
|
-
.filter((segment) => segment.status !== "evicted" && segment.tokenCount > 0)
|
|
64
|
-
.map((segment) => ({
|
|
65
|
-
name: segment.label,
|
|
66
|
-
size: segment.tokenCount,
|
|
67
|
-
group: segment.group,
|
|
68
|
-
segmentId: segment.segmentId,
|
|
69
|
-
}));
|
|
70
|
-
data.push(
|
|
71
|
-
...systemSections
|
|
72
|
-
.filter((section) => section.tokenCount > 0)
|
|
73
|
-
.map((section) => ({
|
|
74
|
-
name: section.label,
|
|
75
|
-
size: section.tokenCount,
|
|
76
|
-
group: `System · ${section.governance}`,
|
|
77
|
-
segmentId: section.segmentId,
|
|
78
|
-
})),
|
|
79
|
-
);
|
|
80
|
-
|
|
81
|
-
useEffect(() => {
|
|
82
|
-
const element = containerRef.current;
|
|
83
|
-
if (!element) return;
|
|
84
|
-
|
|
85
|
-
const updateWidth = () => {
|
|
86
|
-
setChartWidth(Math.max(0, Math.floor(element.clientWidth - 8)));
|
|
87
|
-
};
|
|
88
|
-
updateWidth();
|
|
89
|
-
|
|
90
|
-
const observer =
|
|
91
|
-
typeof ResizeObserver !== "undefined"
|
|
92
|
-
? new ResizeObserver(updateWidth)
|
|
93
|
-
: null;
|
|
94
|
-
observer?.observe(element);
|
|
95
|
-
window.addEventListener("resize", updateWidth);
|
|
96
|
-
return () => {
|
|
97
|
-
observer?.disconnect();
|
|
98
|
-
window.removeEventListener("resize", updateWidth);
|
|
99
|
-
};
|
|
100
|
-
}, []);
|
|
101
|
-
|
|
102
|
-
if (data.length === 0) {
|
|
103
|
-
return (
|
|
104
|
-
<div className="flex h-52 items-center justify-center rounded-md bg-muted/30 text-xs text-muted-foreground">
|
|
105
|
-
No active segments
|
|
106
|
-
</div>
|
|
107
|
-
);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
17
|
return (
|
|
111
|
-
<
|
|
112
|
-
{
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
data={data as any}
|
|
117
|
-
dataKey="size"
|
|
118
|
-
nameKey="name"
|
|
119
|
-
aspectRatio={4 / 3}
|
|
120
|
-
isAnimationActive={false}
|
|
121
|
-
content={<TreemapContent />}
|
|
122
|
-
onClick={(datum: any) => {
|
|
123
|
-
if (datum?.segmentId) onSelect?.(datum.segmentId);
|
|
124
|
-
}}
|
|
125
|
-
/>
|
|
126
|
-
)}
|
|
127
|
-
</div>
|
|
18
|
+
<ContextTreemapView
|
|
19
|
+
segments={segments}
|
|
20
|
+
systemSections={systemSections}
|
|
21
|
+
onSelect={onSelect}
|
|
22
|
+
/>
|
|
128
23
|
);
|
|
129
24
|
}
|