@ultrst-armada/floks 1.7.2 → 1.9.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.
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schema": 1,
3
3
  "packageName": "@ultrst-armada/floks",
4
- "version": "1.7.2",
5
- "sourceCommit": "9f9ac9e03bdd94d9495b1d382a6c2f2b0a661530",
4
+ "version": "1.9.0",
5
+ "sourceCommit": "8c1e43243f0d3ce72d863ead580343e00c7df06d",
6
6
  "releaseWorkflow": "npm Release",
7
- "workflowRunId": "40933018875"
7
+ "workflowRunId": "41026070837"
8
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ultrst-armada/floks",
3
- "version": "1.7.2",
3
+ "version": "1.9.0",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -59,6 +59,11 @@
59
59
  "types": "./packages/canvas-ui/dist/fod/index.d.ts",
60
60
  "import": "./packages/canvas-ui/dist/fod/index.js",
61
61
  "default": "./packages/canvas-ui/dist/fod/index.js"
62
+ },
63
+ "./canvas-ui/aiko": {
64
+ "types": "./packages/canvas-ui/dist/aiko/index.d.ts",
65
+ "import": "./packages/canvas-ui/dist/aiko/index.js",
66
+ "default": "./packages/canvas-ui/dist/aiko/index.js"
62
67
  }
63
68
  },
64
69
  "scripts": {
@@ -74,7 +79,7 @@
74
79
  "d3-force": "^3.0.0",
75
80
  "zod": "^3.24.1",
76
81
  "zustand": "^5.0.3",
77
- "@dinilmusick/gutts": "^1.0.0"
82
+ "@dinilmusick/gutts": "^1.1.0"
78
83
  },
79
84
  "peerDependencies": {
80
85
  "@ultrst-armada/kloks": "^1.17.0",
@@ -88,7 +93,7 @@
88
93
  "@types/node": "^22.0.0",
89
94
  "@types/react": "^19.0.0",
90
95
  "@types/react-dom": "^19.0.0",
91
- "@ultrst-armada/kloks": "^1.18.0",
96
+ "@ultrst-armada/kloks": "^1.19.0",
92
97
  "@ultrst-armada/frnlts": "^0.2.7",
93
98
  "happy-dom": "^21.0.3",
94
99
  "lucide-react": "^1.55.0",
@@ -0,0 +1,53 @@
1
+ import React__default from 'react';
2
+
3
+ interface AikoIntelligenceSpec {
4
+ [key: string]: unknown;
5
+ }
6
+ interface AikoAgentDefinition {
7
+ id: string;
8
+ name: string;
9
+ description?: string;
10
+ agentType: 'TOOL' | 'ENDPOINT' | 'AIKO';
11
+ tool?: Record<string, unknown>;
12
+ intelligenceSpec?: AikoIntelligenceSpec;
13
+ intelligenceSpecId?: string;
14
+ sourceKind?: 'endpoint' | 'fod-flow' | 'gutts-api' | 'custom';
15
+ sourceId?: string;
16
+ }
17
+ interface AikoKey {
18
+ id: string;
19
+ providerId: string;
20
+ label: string;
21
+ status?: string;
22
+ isActive?: boolean;
23
+ emailGroup?: string;
24
+ expiresAt?: string | null;
25
+ }
26
+ interface AikoRuntimeLike {
27
+ listAgents(): Promise<AikoAgentDefinition[]>;
28
+ executeAgent(agentId: string, input: string): Promise<unknown>;
29
+ listKeys(): Promise<AikoKey[]>;
30
+ getActiveKey(providerId: string): Promise<AikoKey | null>;
31
+ rotateKey(providerId: string): Promise<AikoKey | null>;
32
+ addKey?(input: {
33
+ providerId: string;
34
+ label: string;
35
+ key: string;
36
+ emailGroup?: string;
37
+ }): Promise<unknown>;
38
+ syncFromAikoEngine(): Promise<{
39
+ synced: number;
40
+ message?: string;
41
+ }>;
42
+ }
43
+ interface AikoModuleProps {
44
+ runtime: AikoRuntimeLike;
45
+ workspaceId: string;
46
+ className?: string;
47
+ }
48
+ declare function AikoModule({ runtime, workspaceId, className }: AikoModuleProps): React__default.JSX.Element;
49
+ declare namespace AikoModule {
50
+ var displayName: string;
51
+ }
52
+
53
+ export { type AikoAgentDefinition, type AikoIntelligenceSpec, type AikoKey, AikoModule, type AikoModuleProps, type AikoRuntimeLike };
@@ -0,0 +1,6 @@
1
+ import {
2
+ AikoModule
3
+ } from "../chunk-K7L2ZD3D.js";
4
+ export {
5
+ AikoModule
6
+ };
@@ -0,0 +1,107 @@
1
+ // src/aiko/AikoModule.tsx
2
+ import { useEffect, useMemo, useState } from "react";
3
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
+ function AikoModule({ runtime, workspaceId, className }) {
5
+ const [agents, setAgents] = useState([]);
6
+ const [keys, setKeys] = useState([]);
7
+ const [activeAgent, setActiveAgent] = useState("");
8
+ const [input, setInput] = useState("");
9
+ const [result, setResult] = useState("");
10
+ const [busy, setBusy] = useState(false);
11
+ const [message, setMessage] = useState("");
12
+ const [provider, setProvider] = useState("");
13
+ const [label, setLabel] = useState("");
14
+ const [secret, setSecret] = useState("");
15
+ const [group, setGroup] = useState("");
16
+ const refresh = async () => {
17
+ const [nextAgents, nextKeys] = await Promise.all([runtime.listAgents(), runtime.listKeys()]);
18
+ setAgents(nextAgents);
19
+ setKeys(nextKeys);
20
+ if (!activeAgent && nextAgents[0]) setActiveAgent(nextAgents[0].id);
21
+ };
22
+ useEffect(() => {
23
+ void refresh();
24
+ }, [workspaceId]);
25
+ const groups = useMemo(() => {
26
+ const map = /* @__PURE__ */ new Map();
27
+ for (const agent of agents) {
28
+ const key = agent.sourceKind ?? "custom";
29
+ const list = map.get(key) ?? [];
30
+ list.push(agent);
31
+ map.set(key, list);
32
+ }
33
+ return [...map.entries()];
34
+ }, [agents]);
35
+ const execute = async () => {
36
+ if (!activeAgent || !input.trim()) return;
37
+ setBusy(true);
38
+ try {
39
+ setResult(JSON.stringify(await runtime.executeAgent(activeAgent, input), null, 2));
40
+ } catch (error) {
41
+ setResult(error instanceof Error ? error.message : String(error));
42
+ } finally {
43
+ setBusy(false);
44
+ }
45
+ };
46
+ const addKey = async () => {
47
+ if (!runtime.addKey || !provider || !label || !secret) return;
48
+ await runtime.addKey({ providerId: provider, label, key: secret, emailGroup: group || void 0 });
49
+ setSecret("");
50
+ await refresh();
51
+ };
52
+ const sync = async () => {
53
+ setBusy(true);
54
+ try {
55
+ const response = await runtime.syncFromAikoEngine();
56
+ setMessage(response.message ?? "Synced " + response.synced + " keys");
57
+ await refresh();
58
+ } catch (error) {
59
+ setMessage(error instanceof Error ? error.message : String(error));
60
+ } finally {
61
+ setBusy(false);
62
+ }
63
+ };
64
+ return /* @__PURE__ */ jsxs("div", { className, "data-aiko-module": "true", style: { display: "grid", gridTemplateColumns: "260px 1fr", gridTemplateRows: "48px 1fr", height: "100%", minHeight: 500 }, children: [
65
+ /* @__PURE__ */ jsxs("header", { style: { gridColumn: "1 / -1", display: "flex", alignItems: "center", gap: 8, padding: 8, borderBottom: "1px solid var(--skipo-border,#333)" }, children: [
66
+ /* @__PURE__ */ jsx("strong", { children: "AIKO" }),
67
+ /* @__PURE__ */ jsx("button", { type: "button", onClick: () => void sync(), disabled: busy, children: "Fetch from Aiko Engine" }),
68
+ /* @__PURE__ */ jsx("span", { children: message })
69
+ ] }),
70
+ /* @__PURE__ */ jsxs("aside", { style: { overflow: "auto", padding: 10, borderRight: "1px solid var(--skipo-border,#333)" }, children: [
71
+ /* @__PURE__ */ jsx("h4", { children: "Agents" }),
72
+ groups.map(([group2, list]) => /* @__PURE__ */ jsxs("section", { children: [
73
+ /* @__PURE__ */ jsx("strong", { children: group2 }),
74
+ list.map((agent) => /* @__PURE__ */ jsx("button", { type: "button", onClick: () => setActiveAgent(agent.id), style: { display: "block", width: "100%", textAlign: "left", margin: "4px 0" }, children: agent.name }, agent.id))
75
+ ] }, group2)),
76
+ /* @__PURE__ */ jsx("h4", { children: "API Keys" }),
77
+ /* @__PURE__ */ jsxs("div", { children: [
78
+ /* @__PURE__ */ jsx("input", { value: provider, onChange: (event) => setProvider(event.target.value), placeholder: "Provider" }),
79
+ /* @__PURE__ */ jsx("input", { value: label, onChange: (event) => setLabel(event.target.value), placeholder: "Label" }),
80
+ /* @__PURE__ */ jsx("input", { value: group, onChange: (event) => setGroup(event.target.value), placeholder: "Email group" }),
81
+ /* @__PURE__ */ jsx("input", { value: secret, onChange: (event) => setSecret(event.target.value), placeholder: "API key", type: "password" }),
82
+ /* @__PURE__ */ jsx("button", { type: "button", onClick: () => void addKey(), children: "Add key" })
83
+ ] }),
84
+ keys.map((key) => /* @__PURE__ */ jsxs("div", { children: [
85
+ key.providerId,
86
+ ": ",
87
+ key.label,
88
+ " ",
89
+ key.isActive ? "(active)" : "",
90
+ " ",
91
+ /* @__PURE__ */ jsx("button", { type: "button", onClick: () => void runtime.rotateKey(key.providerId), children: "Rotate" })
92
+ ] }, key.id))
93
+ ] }),
94
+ /* @__PURE__ */ jsx("main", { style: { padding: 16, overflow: "auto" }, children: activeAgent ? /* @__PURE__ */ jsxs(Fragment, { children: [
95
+ /* @__PURE__ */ jsx("h3", { children: agents.find((agent) => agent.id === activeAgent)?.name }),
96
+ /* @__PURE__ */ jsx("pre", { children: JSON.stringify(agents.find((agent) => agent.id === activeAgent)?.intelligenceSpec, null, 2) }),
97
+ /* @__PURE__ */ jsx("textarea", { value: input, onChange: (event) => setInput(event.target.value), placeholder: "Describe what you want the agent to do", rows: 5, style: { width: "100%" } }),
98
+ /* @__PURE__ */ jsx("button", { type: "button", onClick: () => void execute(), disabled: busy || !input.trim(), children: "Execute" }),
99
+ /* @__PURE__ */ jsx("pre", { style: { whiteSpace: "pre-wrap" }, children: result })
100
+ ] }) : /* @__PURE__ */ jsx("p", { children: "No Aiko agent selected." }) })
101
+ ] });
102
+ }
103
+ AikoModule.displayName = "AikoModule";
104
+
105
+ export {
106
+ AikoModule
107
+ };
@@ -12,6 +12,7 @@ export { CanvasBackground2D, CanvasErrorBoundary, ContainerNode2D, EffectNode2D,
12
12
  export { PredictiveGhostNodeCard, PredictiveGhostNodeCardProps, PredictiveHudToolbar, PredictiveLayer2D, PredictiveLayer2DProps, UsePredictiveGraph2DProps, UseViewer2DPredictiveProps, usePredictiveGraph2D } from './predictive/index.js';
13
13
  export { AuthoringAssetRef, UIAuthoringContext, UIAuthoringNode, UIAuthoringNodeKind, UIAuthoringSession, UiAuthoringBindingEditor, UiAuthoringComponentRenderer, UiAuthoringInspector, UiAuthoringPreview, UiAuthoringTree, UiAuthoringValidationPanel, UiAuthoringWorkspace, getAuthoringChildren, getAuthoringDepth, getAuthoringSubtreeIds } from './authoring/index.js';
14
14
  export { FodModule, FodModuleProps, FodRuntimeLike } from './fod/index.js';
15
+ export { AikoAgentDefinition, AikoIntelligenceSpec, AikoKey, AikoModule, AikoModuleProps, AikoRuntimeLike } from './aiko/index.js';
15
16
  import '@ultrst-armada/kloks/contracts';
16
17
 
17
18
  interface MidpointWidgetsProps {
@@ -1,8 +1,34 @@
1
+ import {
2
+ BIOME_CONFIGS,
3
+ COORD_SCALE,
4
+ CanvasBackground2D,
5
+ CanvasErrorBoundary,
6
+ ContainerNode2D,
7
+ EffectNode2D,
8
+ MagneticTraces2D,
9
+ ModuleNode2D,
10
+ NodeRenderer2D,
11
+ RotaryKnob,
12
+ TriggerNode2D,
13
+ Wire2D,
14
+ useCanvas2DCoordinates,
15
+ useCanvas2DMagnetic
16
+ } from "./chunk-XVAHT5WE.js";
1
17
  import {
2
18
  PredictiveGhostNodeCard,
3
19
  PredictiveHudToolbar,
4
20
  PredictiveLayer2D
5
21
  } from "./chunk-RH5NINIT.js";
22
+ import {
23
+ NODE_CARD_WIDTH,
24
+ Node2DBase,
25
+ RecorderWaveformDisplay,
26
+ SOCKET_ROW_HEIGHT,
27
+ Socket2D,
28
+ getSocketLocalOffset,
29
+ getSocketScreenPosition,
30
+ renderSpriteIcon
31
+ } from "./chunk-U2SC3RMJ.js";
6
32
  import {
7
33
  Tile,
8
34
  TileCreateButton,
@@ -10,11 +36,8 @@ import {
10
36
  useTileMenu
11
37
  } from "./chunk-SA3JADUG.js";
12
38
  import {
13
- CanvasViewport,
14
- InfiniteCanvas,
15
- MiniMap,
16
- useCanvas
17
- } from "./chunk-34YRDZPJ.js";
39
+ AikoModule
40
+ } from "./chunk-K7L2ZD3D.js";
18
41
  import {
19
42
  UiAuthoringBindingEditor,
20
43
  UiAuthoringInspector,
@@ -26,6 +49,12 @@ import {
26
49
  getAuthoringDepth,
27
50
  getAuthoringSubtreeIds
28
51
  } from "./chunk-TS7P3WWH.js";
52
+ import {
53
+ CanvasViewport,
54
+ InfiniteCanvas,
55
+ MiniMap,
56
+ useCanvas
57
+ } from "./chunk-34YRDZPJ.js";
29
58
  import {
30
59
  DockBar,
31
60
  DockItem,
@@ -39,32 +68,6 @@ import {
39
68
  import {
40
69
  FodModule
41
70
  } from "./chunk-7CYX3B6O.js";
42
- import {
43
- BIOME_CONFIGS,
44
- COORD_SCALE,
45
- CanvasBackground2D,
46
- CanvasErrorBoundary,
47
- ContainerNode2D,
48
- EffectNode2D,
49
- MagneticTraces2D,
50
- ModuleNode2D,
51
- NodeRenderer2D,
52
- RotaryKnob,
53
- TriggerNode2D,
54
- Wire2D,
55
- useCanvas2DCoordinates,
56
- useCanvas2DMagnetic
57
- } from "./chunk-XVAHT5WE.js";
58
- import {
59
- NODE_CARD_WIDTH,
60
- Node2DBase,
61
- RecorderWaveformDisplay,
62
- SOCKET_ROW_HEIGHT,
63
- Socket2D,
64
- getSocketLocalOffset,
65
- getSocketScreenPosition,
66
- renderSpriteIcon
67
- } from "./chunk-U2SC3RMJ.js";
68
71
  import {
69
72
  CanvasContextMenu,
70
73
  CompatibleNodePicker,
@@ -707,6 +710,7 @@ function MovableSocketHandle({
707
710
  );
708
711
  }
709
712
  export {
713
+ AikoModule,
710
714
  BIOME_CONFIGS,
711
715
  COORD_SCALE,
712
716
  CanvasBackground2D,
@@ -63,6 +63,18 @@
63
63
  "requiredServices": [
64
64
  "fod"
65
65
  ]
66
+ },
67
+ {
68
+ "id": "AikoModule",
69
+ "name": "Aiko Application Module",
70
+ "export": "AikoModule",
71
+ "subpath": "aiko",
72
+ "targetTypes": [
73
+ "Main.tabs.aiko"
74
+ ],
75
+ "requiredServices": [
76
+ "aiko"
77
+ ]
66
78
  }
67
79
  ]
68
80
  }
@@ -62,15 +62,21 @@
62
62
  "import": "./dist/fod/index.js",
63
63
  "types": "./dist/fod/index.d.ts",
64
64
  "default": "./dist/fod/index.js"
65
+ },
66
+ "./aiko": {
67
+ "import": "./dist/aiko/index.js",
68
+ "types": "./dist/aiko/index.d.ts",
69
+ "default": "./dist/aiko/index.js"
65
70
  }
66
71
  },
67
72
  "scripts": {
68
- "build": "tsup src/index.ts src/canvas/index.ts src/dock/index.ts src/tile-menu/index.ts src/editor/index.ts src/authoring/index.ts src/graph-2d/index.ts src/predictive/index.ts src/frnl-editable-node-graph/index.ts src/fod/index.ts --format esm --dts --clean --external react --external react-dom --external lucide-react --external @floks/ui --external @ultrst-armada/frnlts --external @kloks/state-graph --external @kloks/audio-midi --external monaco-editor --external @dnd-kit/core --external @dnd-kit/sortable --external @dnd-kit/utilities"
73
+ "build": "tsup src/index.ts src/canvas/index.ts src/dock/index.ts src/tile-menu/index.ts src/editor/index.ts src/authoring/index.ts src/graph-2d/index.ts src/predictive/index.ts src/frnl-editable-node-graph/index.ts src/fod/index.ts src/aiko/index.ts --format esm --dts --clean --external react --external react-dom --external lucide-react --external @floks/ui --external @ultrst-armada/frnlts --external @kloks/state-graph --external @kloks/audio-midi --external monaco-editor --external @dnd-kit/core --external @dnd-kit/sortable --external @dnd-kit/utilities",
74
+ "typecheck": "tsc --noEmit"
69
75
  },
70
76
  "dependencies": {
71
77
  "@floks/ui": "workspace:*",
72
78
  "@ultrst-armada/frnlts": "^0.2.7",
73
- "@ultrst-armada/kloks": "^1.18.0"
79
+ "@ultrst-armada/kloks": "^1.19.0"
74
80
  },
75
81
  "peerDependencies": {
76
82
  "@dnd-kit/core": "^6.0.0",
@@ -64,18 +64,6 @@ import {
64
64
  TilesMenu,
65
65
  tilesMenuDefinition
66
66
  } from "./chunk-PH4NEHWR.js";
67
- import {
68
- frnlBadge,
69
- frnlBottomBar,
70
- frnlPage,
71
- frnlSelect,
72
- frnlSelectDefinition,
73
- frnlSlider,
74
- frnlTabWindow,
75
- frnlToggle,
76
- frnlToggleDefinition,
77
- frnlTopBar
78
- } from "./chunk-DGZBP3ND.js";
79
67
  import {
80
68
  ActionButton,
81
69
  Badge,
@@ -103,6 +91,18 @@ import {
103
91
  ToolbarPanel,
104
92
  UIParent
105
93
  } from "./chunk-SXRIBCJX.js";
94
+ import {
95
+ frnlBadge,
96
+ frnlBottomBar,
97
+ frnlPage,
98
+ frnlSelect,
99
+ frnlSelectDefinition,
100
+ frnlSlider,
101
+ frnlTabWindow,
102
+ frnlToggle,
103
+ frnlToggleDefinition,
104
+ frnlTopBar
105
+ } from "./chunk-DGZBP3ND.js";
106
106
  import "./chunk-SLJBDDSN.js";
107
107
  import {
108
108
  DEFAULT_PALETTE_ID,