@ai-matrx/code-runtime 0.1.4 → 0.3.0
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 +48 -0
- package/dist/execute.cjs +20 -4
- package/dist/execute.cjs.map +1 -1
- package/dist/execute.js +20 -4
- package/dist/execute.js.map +1 -1
- package/dist/gate-lists.json +1 -0
- package/dist/gate.cjs +1 -0
- package/dist/gate.cjs.map +1 -1
- package/dist/gate.js +1 -0
- package/dist/gate.js.map +1 -1
- package/dist/index.cjs +20 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +20 -4
- package/dist/index.js.map +1 -1
- package/dist/scope.cjs +13 -3
- package/dist/scope.cjs.map +1 -1
- package/dist/scope.js +13 -3
- package/dist/scope.js.map +1 -1
- package/package.json +5 -4
package/dist/index.js
CHANGED
|
@@ -18,6 +18,7 @@ var gate_lists_default = {
|
|
|
18
18
|
"@/components/MarkdownStream",
|
|
19
19
|
"@/components/agent-copy/CopyButtons",
|
|
20
20
|
"@/components/agent-copy/CopyForAiButton",
|
|
21
|
+
"@/components/kind-kit/KindActionButton",
|
|
21
22
|
"@/components/kind-kit/KindHeaderBar",
|
|
22
23
|
"@/components/kind-kit/KindPanel",
|
|
23
24
|
"@/components/kind-kit/KindPanelGrid",
|
|
@@ -264,7 +265,7 @@ function markdownAlias(path, description) {
|
|
|
264
265
|
return { path, strategy: "named", exportMap: { default: "MarkdownStream" }, core: true, owner: "host", description };
|
|
265
266
|
}
|
|
266
267
|
function kindKit(name, exports, description) {
|
|
267
|
-
return { path: `@/components/kind-kit/${name}`, strategy: "named", exports, owner: "
|
|
268
|
+
return { path: `@/components/kind-kit/${name}`, strategy: "named", exports, owner: "package", description };
|
|
268
269
|
}
|
|
269
270
|
var SCOPE_ENTRIES = [
|
|
270
271
|
// ── Core ─────────────────────────────────────────────────────────────────
|
|
@@ -277,13 +278,15 @@ var SCOPE_ENTRIES = [
|
|
|
277
278
|
{ path: "@ai-matrx/design-system/controls", strategy: "spread", core: true, owner: "package", description: "THE controls: Button, Field, SearchField, Select, SegmentedControl, Tabs, Badge, Switch, Textarea, EmptyState\u2026" },
|
|
278
279
|
{ path: "@ai-matrx/design-system", strategy: "spread", owner: "package", description: "Design-system surfaces: Card, Dialog, Popover, Tooltip, Table, Accordion\u2026" },
|
|
279
280
|
// ── Copy actions ─────────────────────────────────────────────────────────
|
|
280
|
-
{ path: "@/components/agent-copy/CopyButtons", strategy: "named", exports: ["CopyButtons"], owner: "
|
|
281
|
+
{ path: "@/components/agent-copy/CopyButtons", strategy: "named", exports: ["CopyButtons"], owner: "package", description: "Copy / Copy-for-AI / JSON / Export bar from caller-supplied builders (the kind-kit copy-bar slot: the host's own bar when registered, a plain Copy button otherwise)" },
|
|
281
282
|
{ path: "@/components/agent-copy/CopyForAiButton", strategy: "named", exports: ["CopyForAiButton"], owner: "host", description: "Single Copy-for-AI action" },
|
|
282
|
-
// ── kind-kit
|
|
283
|
+
// ── kind-kit (@ai-matrx/content-ir-react/kind-kit; hosts register its copy
|
|
284
|
+
// bar and read notices with setKindKitHost) ───────────────────────────
|
|
283
285
|
kindKit("SortableList", ["SortableList"], "Drag-to-reorder list with arrow fallback and onRemove"),
|
|
284
286
|
kindKit("KindPanelGrid", ["KindPanelGrid"], "Content-aware auto-fit grid of equal-height panels"),
|
|
285
287
|
kindKit("KindPanel", ["KindPanel"], "Compact panel: header + overflow menu, subline, body, footer"),
|
|
286
288
|
kindKit("KindHeaderBar", ["KindHeaderBar"], "Kind title + stats + copy bar"),
|
|
289
|
+
kindKit("KindActionButton", ["KindActionButton"], "Button for the component's runAction prop: busy, optional confirm, inline error"),
|
|
287
290
|
kindKit("StreamingSkeleton", ["StreamingSkeleton", "useStreamingValue", "streamList", "streamText"], "Streaming skeletons + tolerant partial-value reads"),
|
|
288
291
|
kindKit("TagList", ["KeywordChip", "TagList"], "Wrapping chips with select, remove, inline edit, add"),
|
|
289
292
|
// ── Markdown (one renderer, four spellings stored code uses) ─────────────
|
|
@@ -372,6 +375,7 @@ import * as LucideModule from "lucide-react";
|
|
|
372
375
|
import * as IconsModule from "@ai-matrx/icons";
|
|
373
376
|
import * as DesignSystem from "@ai-matrx/design-system";
|
|
374
377
|
import * as Controls from "@ai-matrx/design-system/controls";
|
|
378
|
+
import * as KindKit from "@ai-matrx/content-ir-react/kind-kit";
|
|
375
379
|
var STORE_KEY = /* @__PURE__ */ Symbol.for("ai-matrx.code-runtime.modules");
|
|
376
380
|
function store() {
|
|
377
381
|
const g = globalThis;
|
|
@@ -396,6 +400,9 @@ var LEGACY_UI_MODULE = {
|
|
|
396
400
|
TabsListLegacy: ds.TabsList,
|
|
397
401
|
TabsTriggerLegacy: ds.TabsTrigger
|
|
398
402
|
};
|
|
403
|
+
var COPY_BUTTONS_MODULE = {
|
|
404
|
+
CopyButtons: (props) => ReactModule.createElement(KindKit.getKindKitHost().CopyButtons, props)
|
|
405
|
+
};
|
|
399
406
|
function packageLoader(path) {
|
|
400
407
|
if (path === "react") return () => ReactModule;
|
|
401
408
|
if (path === "lucide-react") return () => LucideModule;
|
|
@@ -404,6 +411,8 @@ function packageLoader(path) {
|
|
|
404
411
|
if (path === "@ai-matrx/design-system/controls") return () => Controls;
|
|
405
412
|
if (path === "@/lib/utils") return () => ({ cn: ds.cn });
|
|
406
413
|
if (path.startsWith("@/components/ui/")) return () => LEGACY_UI_MODULE;
|
|
414
|
+
if (path.startsWith("@/components/kind-kit/")) return () => KindKit;
|
|
415
|
+
if (path === "@/components/agent-copy/CopyButtons") return () => COPY_BUTTONS_MODULE;
|
|
407
416
|
if (path === "recharts") return () => import("recharts");
|
|
408
417
|
return null;
|
|
409
418
|
}
|
|
@@ -664,6 +673,7 @@ function applyToFlatScope(entry, mod, values) {
|
|
|
664
673
|
if (entry.strategy === "spread") {
|
|
665
674
|
for (const key of ownKeys(mod)) {
|
|
666
675
|
if (key === "default" || key === "__esModule") continue;
|
|
676
|
+
if (key in globalThis) continue;
|
|
667
677
|
values[key] = mod[key];
|
|
668
678
|
}
|
|
669
679
|
return;
|
|
@@ -750,7 +760,9 @@ function buildScope(spec) {
|
|
|
750
760
|
}
|
|
751
761
|
function patchMissingJsx(identifiers, state, declared, skip) {
|
|
752
762
|
for (const identifier of identifiers) {
|
|
753
|
-
if (
|
|
763
|
+
if (identifier in state.values || declared.has(identifier)) continue;
|
|
764
|
+
const providedBySpread = [...state.safeProxyPaths.values()].some(({ keys }) => keys.has(identifier));
|
|
765
|
+
if (skip.has(identifier) && !providedBySpread) continue;
|
|
754
766
|
let provided = false;
|
|
755
767
|
for (const [, { proxy, keys }] of state.safeProxyPaths) {
|
|
756
768
|
if (!keys.has(identifier)) continue;
|
|
@@ -818,6 +830,10 @@ function bindImports(mod, allFiles, state) {
|
|
|
818
830
|
} catch {
|
|
819
831
|
present = false;
|
|
820
832
|
}
|
|
833
|
+
if (!present && state.values[imported] !== void 0) {
|
|
834
|
+
view[imported] = state.values[imported];
|
|
835
|
+
present = true;
|
|
836
|
+
}
|
|
821
837
|
if (!present) {
|
|
822
838
|
if (/^[A-Z]/.test(imported)) view[imported] = createUnresolvedImportStandIn(imported, source);
|
|
823
839
|
recordUnresolved(state, { identifier: imported === local ? local : `${imported} as ${local}`, importPath: source });
|