@xenosystem/agent-interface-ui 0.1.136 → 0.1.138

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.
@@ -0,0 +1,64 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { getAgentPlatformBridge } from '@xenosystem/agent-conversation/platformBridge';
3
+ import React, { useCallback, useEffect, useState } from 'react';
4
+ export function ArtifactsPanel({ cwd, conversationId }) {
5
+ const [pages, setPages] = useState([]);
6
+ const [selectedId, setSelectedId] = useState(null);
7
+ const [url, setUrl] = useState(null);
8
+ const [comments, setComments] = useState([]);
9
+ const [draft, setDraft] = useState('');
10
+ const [notice, setNotice] = useState(null);
11
+ const [error, setError] = useState(null);
12
+ const [busy, setBusy] = useState(false);
13
+ const [loading, setLoading] = useState(true);
14
+ const call = useCallback(async (operation, params = {}) => (getAgentPlatformBridge().artifacts.request(operation, { ...params, ...(cwd ? { cwd } : {}), ...(conversationId ? { conversationId } : {}) })), [cwd, conversationId]);
15
+ const load = useCallback(async () => {
16
+ if (!cwd) {
17
+ setPages([]);
18
+ setLoading(false);
19
+ return;
20
+ }
21
+ const listed = await call('list');
22
+ setLoading(false);
23
+ if (!listed.success) {
24
+ setError(listed.error ?? 'The pages could not be read.');
25
+ return;
26
+ }
27
+ setError(null);
28
+ setPages(listed.pages ?? []);
29
+ }, [call, cwd]);
30
+ useEffect(() => { void load(); }, [load]);
31
+ const select = useCallback(async (artifactId) => {
32
+ setSelectedId(artifactId);
33
+ setNotice(null);
34
+ const [got, listed] = await Promise.all([call('get', { artifactId }), call('comments', { artifactId })]);
35
+ if (!got.success) {
36
+ setError(got.error ?? 'The page could not be read.');
37
+ return;
38
+ }
39
+ setError(null);
40
+ setUrl(got.url ?? null);
41
+ setComments((listed.comments ?? []));
42
+ }, [call]);
43
+ const act = useCallback(async (operation, params, done) => {
44
+ setBusy(true);
45
+ try {
46
+ const result = await call(operation, params);
47
+ if (!result.success) {
48
+ setError(result.error ?? 'The host refused.');
49
+ setNotice(null);
50
+ return;
51
+ }
52
+ setError(null);
53
+ setNotice(done(result));
54
+ if (selectedId)
55
+ await select(selectedId);
56
+ }
57
+ finally {
58
+ setBusy(false);
59
+ }
60
+ }, [call, select, selectedId]);
61
+ const selected = pages.find((page) => page.artifactId === selectedId);
62
+ return (_jsxs("div", { className: "h-full min-h-0 flex flex-col", "data-xeno-artifacts-panel": "", children: [!cwd && _jsx("div", { className: "px-4 py-10 text-center text-[12px] text-white/35", children: "Open a project folder to see the pages its agents publish." }), error && _jsx("div", { className: "mx-4 mt-3 px-3 py-2 border border-white/[0.10] bg-white/[0.04] text-[11px] text-white/70", "data-xeno-artifacts-error": "", children: error }), notice && _jsx("div", { className: "mx-4 mt-3 px-3 py-2 border border-white/[0.08] text-[11px] text-white/60", "data-xeno-artifacts-notice": "", children: notice }), cwd && (_jsxs("div", { className: "flex-1 min-h-0 flex", children: [_jsx("div", { className: "w-[42%] min-w-0 overflow-auto border-r border-white/[0.06]", children: loading ? (_jsx("div", { className: "px-4 py-8 text-center text-[12px] text-white/30", children: "Loading pages..." })) : pages.length === 0 ? (_jsx("div", { className: "px-4 py-10 text-center text-[12px] text-white/35", children: "No pages published in this folder yet." })) : pages.map((page) => (_jsx("button", { type: "button", onClick: () => { void select(page.artifactId); }, className: `w-full text-left px-4 py-2 border-b border-white/[0.04] ${selectedId === page.artifactId ? 'bg-white/[0.05]' : 'hover:bg-white/[0.03]'}`, "data-xeno-artifact-page": page.artifactId, children: _jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: "text-[12px] text-white/80 truncate flex-1", children: page.title }), _jsxs("span", { className: "text-[10px] text-white/40 border border-white/[0.08] rounded-sm px-1", children: ["r", page.revision] })] }) }, page.artifactId))) }), _jsx("div", { className: "flex-1 min-w-0 overflow-auto", children: !selected ? (_jsx("div", { className: "px-4 py-10 text-center text-[12px] text-white/30", children: "Select a page to open it and see its comments." })) : (_jsxs("div", { className: "px-4 py-3", "data-xeno-artifact-detail": selected.artifactId, children: [_jsxs("div", { className: "flex items-center gap-2 mb-3", children: [_jsx("span", { className: "text-[12px] text-white/85 truncate flex-1", children: selected.title }), url && _jsx("button", { type: "button", className: "text-[11px] px-2 py-0.5 border border-white/[0.12] text-white/70 hover:bg-white/[0.06]", onClick: () => { getAgentPlatformBridge().window?.openExternal(url); }, "data-xeno-artifact-action": "open", children: "Open" }), _jsx("button", { type: "button", className: "text-[11px] px-2 py-0.5 border border-white/[0.12] text-white/70 hover:bg-white/[0.06]", disabled: busy, onClick: () => { void act('promote', { artifactId: selected.artifactId }, (result) => `Hosted on your XENO account: ${result.url ?? ''}`); }, "data-xeno-artifact-action": "promote", children: "Host on my account" }), _jsx("button", { type: "button", className: "text-[11px] px-2 py-0.5 border border-white/[0.12] text-white/70 hover:bg-white/[0.06]", disabled: busy, onClick: () => { void act('share', { artifactId: selected.artifactId, visibility: 'link' }, (result) => `Anyone with this link can view it: ${result.url ?? ''}`); }, "data-xeno-artifact-action": "share", children: "Share link" })] }), _jsx("div", { className: "text-[10px] uppercase tracking-[0.12em] text-white/25 mb-1", children: "Comments" }), comments.length === 0 && _jsx("div", { className: "text-[11px] text-white/35 py-1", children: "No comments yet." }), comments.map((comment, index) => (_jsxs("div", { className: "py-1 border-b border-white/[0.04]", "data-xeno-artifact-comment": comment.commentId ?? '', children: [_jsx("span", { className: "text-[10px] text-white/40 mr-2", children: comment.actor?.displayName ?? comment.actor?.id ?? 'someone' }), _jsx("span", { className: "text-[11px] text-white/70", children: comment.body })] }, comment.commentId ?? index))), _jsxs("div", { className: "flex items-center gap-2 mt-3", children: [_jsx("input", { className: "flex-1 min-w-0 bg-white/[0.04] border border-white/[0.08] text-[11px] text-white/75 px-2 py-1 outline-none", placeholder: "Comment for the agent", value: draft, onChange: (event) => setDraft(event.target.value), "data-xeno-artifact-comment-input": "" }), _jsx("button", { type: "button", className: "text-[11px] px-2.5 py-1 border border-white/[0.12] text-white/75 hover:bg-white/[0.06] disabled:opacity-40", disabled: busy || !draft.trim(), onClick: () => { const body = draft.trim(); setDraft(''); void act('comment', { artifactId: selected.artifactId, body }, () => 'Comment added; it reaches the agent at its next idle point.'); }, "data-xeno-artifact-comment-add": "", children: "Add" })] })] })) })] }))] }));
63
+ }
64
+ //# sourceMappingURL=ArtifactsPanel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ArtifactsPanel.js","sourceRoot":"","sources":["../../../src/components/agent/ArtifactsPanel.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAA;AACtF,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAe/D,MAAM,UAAU,cAAc,CAAC,EAAE,GAAG,EAAE,cAAc,EAA6C;IAC/F,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAA6B,EAAE,CAAC,CAAA;IAClE,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAA;IACjE,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAA;IACnD,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAgB,EAAE,CAAC,CAAA;IAC3D,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAA;IACtC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAA;IACzD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAA;IACvD,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IACvC,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,IAA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
+ export declare function PeerMessagesPanel(): React.JSX.Element;
3
+ //# sourceMappingURL=PeerMessagesPanel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PeerMessagesPanel.d.ts","sourceRoot":"","sources":["../../../src/components/agent/PeerMessagesPanel.tsx"],"names":[],"mappings":"AACA,OAAO,KAA2C,MAAM,OAAO,CAAA;AAW/D,wBAAgB,iBAAiB,sBAqFhC"}
@@ -0,0 +1,49 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { getAgentPlatformBridge } from '@xenosystem/agent-conversation/platformBridge';
3
+ import React, { useCallback, useEffect, useState } from 'react';
4
+ /**
5
+ * Messages between sessions on this machine, as the GUI sees them (`coordination.peers.*`, ADE §9 step 5, slice 4):
6
+ * the sessions with their presence, and what each one received and sent, from the durable mailbox the CLI's `/peers`
7
+ * uses. Read-only on purpose: sending and deciding happen AS a live session, and this app is not one in the mailbox,
8
+ * so a send button here would only ever be refused by the host.
9
+ */
10
+ const POLL_MS = 3_000;
11
+ export function PeerMessagesPanel() {
12
+ const [peers, setPeers] = useState([]);
13
+ const [selectedId, setSelectedId] = useState(null);
14
+ const [box, setBox] = useState('inbox');
15
+ const [messages, setMessages] = useState([]);
16
+ const [error, setError] = useState(null);
17
+ const [loading, setLoading] = useState(true);
18
+ const loadPeers = useCallback(async () => {
19
+ const listed = await getAgentPlatformBridge().peers.request('list', { includeOffline: true });
20
+ setLoading(false);
21
+ if (!listed.success) {
22
+ setError(listed.error ?? 'The sessions could not be read.');
23
+ return;
24
+ }
25
+ setError(null);
26
+ setPeers(listed.peers ?? []);
27
+ }, []);
28
+ const loadMessages = useCallback(async () => {
29
+ if (!selectedId) {
30
+ setMessages([]);
31
+ return;
32
+ }
33
+ const read = await getAgentPlatformBridge().peers.request('messages', { sessionId: selectedId, box });
34
+ if (!read.success) {
35
+ setError(read.error ?? 'The messages could not be read.');
36
+ return;
37
+ }
38
+ setError(null);
39
+ setMessages(read.messages ?? []);
40
+ }, [selectedId, box]);
41
+ useEffect(() => {
42
+ void loadPeers();
43
+ const timer = setInterval(() => { void loadPeers(); }, POLL_MS);
44
+ return () => clearInterval(timer);
45
+ }, [loadPeers]);
46
+ useEffect(() => { void loadMessages(); }, [loadMessages]);
47
+ return (_jsxs("div", { className: "h-full min-h-0 flex flex-col", "data-xeno-peers-panel": "", children: [_jsx("div", { className: "px-4 py-2 border-b border-white/[0.06] text-[11px] text-white/40", children: "Messages agents and terminals sent each other on this machine. Sessions send and decide from their own terminal." }), error && _jsx("div", { className: "mx-4 mt-3 px-3 py-2 border border-white/[0.10] bg-white/[0.04] text-[11px] text-white/70", "data-xeno-peers-error": "", children: error }), _jsxs("div", { className: "flex-1 min-h-0 flex", children: [_jsx("div", { className: "w-[42%] min-w-0 overflow-auto border-r border-white/[0.06]", children: loading ? (_jsx("div", { className: "px-4 py-8 text-center text-[12px] text-white/30", children: "Loading sessions..." })) : peers.length === 0 ? (_jsx("div", { className: "px-4 py-10 text-center text-[12px] text-white/35", children: "No sessions have registered on this machine." })) : peers.map((peer) => (_jsx("button", { type: "button", onClick: () => setSelectedId(peer.sessionId), className: `w-full text-left px-4 py-2 border-b border-white/[0.04] ${selectedId === peer.sessionId ? 'bg-white/[0.05]' : 'hover:bg-white/[0.03]'}`, "data-xeno-peer-session": peer.sessionId, children: _jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: "text-[12px] text-white/80 truncate flex-1", children: peer.name ?? peer.sessionId }), _jsx("span", { className: "text-[10px] text-white/40 border border-white/[0.08] rounded-sm px-1", children: peer.state })] }) }, peer.sessionId))) }), _jsx("div", { className: "flex-1 min-w-0 overflow-auto", children: !selectedId ? (_jsx("div", { className: "px-4 py-10 text-center text-[12px] text-white/30", children: "Select a session to see its messages." })) : (_jsxs("div", { className: "px-4 py-3", "data-xeno-peer-detail": selectedId, children: [_jsx("div", { className: "flex items-center gap-2 mb-3", role: "radiogroup", children: ['inbox', 'sent'].map((value) => (_jsx("button", { type: "button", role: "radio", "aria-checked": box === value, onClick: () => setBox(value), className: `text-[11px] px-2 py-0.5 border ${box === value ? 'border-white/[0.30] bg-white/[0.08] text-white/90' : 'border-white/[0.08] text-white/55 hover:bg-white/[0.04]'}`, "data-xeno-peer-box": value, children: value === 'inbox' ? 'Received' : 'Sent' }, value))) }), messages.length === 0 && _jsx("div", { className: "text-[11px] text-white/35 py-1", children: "No messages." }), messages.map((message) => (_jsxs("div", { className: "py-1.5 border-b border-white/[0.04]", "data-xeno-peer-message": message.messageId, children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: "text-[10px] text-white/40", children: box === 'inbox' ? `from ${message.from.name ?? message.from.sessionId}` : `to ${message.to.name ?? message.to.sessionId}` }), _jsx("span", { className: "text-[10px] text-white/40", children: message.kind }), _jsx("span", { className: "text-[10px] text-white/40 ml-auto", "data-xeno-peer-status": "", children: message.task ? message.task.status : message.delivery.status })] }), _jsx("div", { className: "text-[11px] text-white/70 mt-0.5 whitespace-pre-wrap", children: message.text })] }, message.messageId)))] })) })] })] }));
48
+ }
49
+ //# sourceMappingURL=PeerMessagesPanel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PeerMessagesPanel.js","sourceRoot":"","sources":["../../../src/components/agent/PeerMessagesPanel.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAA;AACtF,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAG/D;;;;;GAKG;AACH,MAAM,OAAO,GAAG,KAAK,CAAA;AAErB,MAAM,UAAU,iBAAiB;IAC/B,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAqB,EAAE,CAAC,CAAA;IAC1D,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAA;IACjE,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,G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AAE,GAAG,KAAK,OAAO,CAAC,CAAC,CAAC,QAAQ,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,MAAM,OAAO,CAAC,EAAE,CAAC,IAAI,IAAI,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,GAAQ,EAC9K,eAAM,SAAS,EAAC,2BAA2B,YAAE,OAAO,CAAC,IAAI,GAAQ,EACjE,eAAM,SAAS,EAAC,mCAAmC,2BAAuB,EAAE,YAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,GAAQ,IAC9I,EACN,cAAK,SAAS,EAAC,sDAAsD,YAAE,OAAO,CAAC,IAAI,GAAO,KANlF,OAAO,CAAC,SAAS,CAOrB,CACP,CAAC,IACE,CACP,GACG,IACF,IACF,CACP,CAAA;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xenosystem/agent-interface-ui",
3
- "version": "0.1.136",
3
+ "version": "0.1.138",
4
4
  "license": "UNLICENSED",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -41,11 +41,11 @@
41
41
  "react-markdown": "^10.1.0",
42
42
  "remark-gfm": "^4.0.1",
43
43
  "zustand": "^5.0.2",
44
- "@xenosystem/agent-conversation": "0.1.136",
45
- "@xenosystem/agent-interface-core": "0.1.136",
46
- "@xenosystem/agent-interface-contract": "0.1.136",
47
- "@xenosystem/agent-interface-hub-adapter": "0.1.136",
48
- "@xenosystem/agent-interface-client": "0.1.136"
44
+ "@xenosystem/agent-interface-core": "0.1.138",
45
+ "@xenosystem/agent-conversation": "0.1.138",
46
+ "@xenosystem/agent-interface-client": "0.1.138",
47
+ "@xenosystem/agent-interface-contract": "0.1.138",
48
+ "@xenosystem/agent-interface-hub-adapter": "0.1.138"
49
49
  },
50
50
  "peerDependencies": {
51
51
  "react": "^19.0.0",
@@ -63,5 +63,5 @@
63
63
  "scripts": {
64
64
  "build:css": "node scripts/build-css.mjs"
65
65
  },
66
- "gitHead": "424969135dc9fe86a1876bcfdfc0b5f34cfb32be"
66
+ "gitHead": "f65590c6b9fad19a61b06cdcce74a802e5701be3"
67
67
  }