@archon-claw/cli 0.2.1 → 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/dist/public/assets/{chat-input-Cpyxmt8J.js → chat-input-D-F2IIDK.js} +33 -33
- package/dist/public/assets/embed-XPDwGdtM.js +1 -0
- package/dist/public/assets/{main-CfVKtiE-.js → main-DDb5hJ5F.js} +4 -4
- package/dist/public/embed.html +2 -2
- package/dist/public/index.html +2 -2
- package/dist/server.js +33 -0
- package/package.json +2 -2
- package/dist/public/assets/embed-CIS9O-0V.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as t,r as n,i,j as e,b as d,C as l,X as x,d as u}from"./chat-input-D-F2IIDK.js";function m(){return e.jsxs("div",{className:"flex h-10 shrink-0 items-center justify-between border-b px-3",children:[e.jsx("span",{className:"text-sm font-semibold",children:"Archon Claw"}),e.jsx("button",{type:"button",className:"text-muted-foreground hover:bg-accent rounded p-1 transition-colors",onClick:()=>window.parent.postMessage({type:"archon-claw:request-close"},"*"),children:e.jsx(x,{className:"h-4 w-4"})})]})}function h(){const a=t(s=>s.setAgentId),o=t(s=>s.createSession),r=t(s=>s.activeSession());return n.useEffect(()=>{const c=new URLSearchParams(window.location.search).get("agentId");c&&a(c),i()},[a]),n.useEffect(()=>{r||o()},[r,o]),e.jsxs("div",{className:"flex h-dvh flex-col bg-background text-foreground",children:[e.jsx(m,{}),e.jsx(d,{}),e.jsx(l,{})]})}u.createRoot(document.getElementById("embed-root")).render(e.jsx(n.StrictMode,{children:e.jsx(h,{})}));
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import{c as h,r as
|
|
1
|
+
import{c as h,r as d,j as e,a as x,u as t,B as i,X as f,M as p,b,C as g,d as j}from"./chat-input-D-F2IIDK.js";/**
|
|
2
2
|
* @license lucide-react v0.469.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const
|
|
6
|
+
*/const y=h("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
|
|
7
7
|
* @license lucide-react v0.469.0 - ISC
|
|
8
8
|
*
|
|
9
9
|
* This source code is licensed under the ISC license.
|
|
10
10
|
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const
|
|
11
|
+
*/const v=h("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
12
12
|
* @license lucide-react v0.469.0 - ISC
|
|
13
13
|
*
|
|
14
14
|
* This source code is licensed under the ISC license.
|
|
15
15
|
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/const w=h("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);function
|
|
16
|
+
*/const w=h("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);function N({content:o,children:a,side:n="top"}){const[l,r]=d.useState(!1),c={top:"bottom-full left-1/2 -translate-x-1/2 mb-2",bottom:"top-full left-1/2 -translate-x-1/2 mt-2",left:"right-full top-1/2 -translate-y-1/2 mr-2",right:"left-full top-1/2 -translate-y-1/2 ml-2"};return e.jsxs("div",{className:"relative inline-flex",onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:[a,l&&e.jsx("div",{className:x("absolute z-50 whitespace-nowrap rounded-md bg-popover px-3 py-1.5 text-xs text-popover-foreground shadow-md border border-border animate-in fade-in-0",c[n]),children:o})]})}function k(){const o=t(s=>s.sessions),a=t(s=>s.activeLocalId),n=t(s=>s.sidebarOpen),l=t(s=>s.setSidebarOpen),r=t(s=>s.createSession),c=t(s=>s.switchSession),m=t(s=>s.deleteSession);return e.jsxs(e.Fragment,{children:[n&&e.jsx("div",{className:"fixed inset-0 z-40 bg-black/60 md:hidden",onClick:()=>l(!1)}),e.jsxs("aside",{className:x("fixed inset-y-0 left-0 z-50 flex w-60 flex-col border-r border-border bg-secondary transition-transform duration-200 md:relative md:translate-x-0",n?"translate-x-0":"-translate-x-full"),children:[e.jsxs("div",{className:"flex h-14 items-center justify-between border-b border-border px-4",children:[e.jsx("h1",{className:"text-sm font-semibold text-foreground",children:"Archon Claw"}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(N,{content:"New chat",side:"bottom",children:e.jsx(i,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:r,children:e.jsx(v,{className:"h-4 w-4"})})}),e.jsx(i,{variant:"ghost",size:"icon",className:"h-8 w-8 md:hidden",onClick:()=>l(!1),children:e.jsx(f,{className:"h-4 w-4"})})]})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-2",children:[o.length===0&&e.jsx("p",{className:"px-2 py-4 text-center text-xs text-muted-foreground",children:"No conversations yet"}),o.map(s=>e.jsxs("div",{className:x("group flex items-center gap-2 rounded-lg px-3 py-2 text-sm cursor-pointer transition-colors",s.localId===a?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:bg-accent"),onClick:()=>c(s.localId),children:[e.jsx(p,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"flex-1 truncate",children:s.title}),e.jsx(i,{variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0 opacity-0 group-hover:opacity-100 transition-opacity",onClick:u=>{u.stopPropagation(),m(s.localId)},children:e.jsx(w,{className:"h-3.5 w-3.5 text-muted-foreground hover:text-destructive"})})]},s.localId))]})]})]})}function S(){const o=t(n=>n.setSidebarOpen),a=t(n=>n.activeSession());return e.jsxs("div",{className:"flex h-full flex-col",children:[e.jsxs("div",{className:"flex h-14 items-center gap-3 border-b border-border px-4",children:[e.jsx(i,{variant:"ghost",size:"icon",className:"md:hidden",onClick:()=>o(!0),children:e.jsx(y,{className:"h-5 w-5"})}),e.jsx("h2",{className:"truncate text-sm font-medium text-foreground",children:(a==null?void 0:a.title)??""})]}),e.jsx(b,{}),e.jsx(g,{})]})}function I(){const o=t(r=>r.setAgentId),a=t(r=>r.loadSessions),[n,l]=d.useState(!1);return d.useEffect(()=>{const c=new URLSearchParams(window.location.search).get("agentId");c&&o(c),a().then(()=>l(!0)).catch(()=>l(!0))},[o,a]),n?e.jsxs("div",{className:"flex h-dvh overflow-hidden bg-background text-foreground",children:[e.jsx(k,{}),e.jsx("main",{className:"flex-1 overflow-hidden",children:e.jsx(S,{})})]}):null}j.createRoot(document.getElementById("root")).render(e.jsx(d.StrictMode,{children:e.jsx(I,{})}));
|
package/dist/public/embed.html
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>Archon Claw Embed</title>
|
|
7
|
-
<script type="module" crossorigin src="/assets/embed-
|
|
8
|
-
<link rel="modulepreload" crossorigin href="/assets/chat-input-
|
|
7
|
+
<script type="module" crossorigin src="/assets/embed-XPDwGdtM.js"></script>
|
|
8
|
+
<link rel="modulepreload" crossorigin href="/assets/chat-input-D-F2IIDK.js">
|
|
9
9
|
<link rel="stylesheet" crossorigin href="/assets/chat-input-qoFFWtdQ.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
package/dist/public/index.html
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>Archon Claw</title>
|
|
7
|
-
<script type="module" crossorigin src="/assets/main-
|
|
8
|
-
<link rel="modulepreload" crossorigin href="/assets/chat-input-
|
|
7
|
+
<script type="module" crossorigin src="/assets/main-DDb5hJ5F.js"></script>
|
|
8
|
+
<link rel="modulepreload" crossorigin href="/assets/chat-input-D-F2IIDK.js">
|
|
9
9
|
<link rel="stylesheet" crossorigin href="/assets/chat-input-qoFFWtdQ.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
package/dist/server.js
CHANGED
|
@@ -292,6 +292,39 @@ export function createServer(agents, port) {
|
|
|
292
292
|
json(res, 404, { error: "Not found" });
|
|
293
293
|
return;
|
|
294
294
|
}
|
|
295
|
+
// Agent redirect/selection for UI entry points
|
|
296
|
+
if (method === "GET") {
|
|
297
|
+
const isRoot = url.pathname === "/";
|
|
298
|
+
const isEmbed = url.pathname === "/embed.html" || url.pathname === "/embed";
|
|
299
|
+
if ((isRoot || isEmbed) && !url.searchParams.has("agentId")) {
|
|
300
|
+
const agentIds = [...agentMap.keys()];
|
|
301
|
+
if (agentIds.length === 0) {
|
|
302
|
+
res.writeHead(200, { "Content-Type": "text/html; charset=utf-8" });
|
|
303
|
+
res.end("<!DOCTYPE html><html><body><h2>No agents configured</h2><p>Add an agent directory and restart the server.</p></body></html>");
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
306
|
+
if (agentIds.length === 1) {
|
|
307
|
+
const target = `${url.pathname === "/embed" ? "/embed.html" : url.pathname}?agentId=${encodeURIComponent(agentIds[0])}`;
|
|
308
|
+
res.writeHead(302, { Location: target });
|
|
309
|
+
res.end();
|
|
310
|
+
return;
|
|
311
|
+
}
|
|
312
|
+
// Multiple agents
|
|
313
|
+
if (isEmbed) {
|
|
314
|
+
res.writeHead(400, { "Content-Type": "text/html; charset=utf-8" });
|
|
315
|
+
res.end("<!DOCTYPE html><html><body><h2>Missing required parameter: agentId</h2><p>Use <code>/embed.html?agentId=your-agent</code></p></body></html>");
|
|
316
|
+
return;
|
|
317
|
+
}
|
|
318
|
+
// Selection page for standalone UI
|
|
319
|
+
const items = agentIds.map((id) => {
|
|
320
|
+
const entry = agentMap.get(id);
|
|
321
|
+
return `<a href="/?agentId=${encodeURIComponent(id)}" style="display:block;padding:16px 20px;margin:8px 0;border:1px solid #e2e8f0;border-radius:8px;text-decoration:none;color:inherit;transition:background .15s"><strong>${id}</strong><br><span style="color:#64748b;font-size:14px">${entry.config.tools.length} tools · ${Object.keys(entry.config.skills).length} skills</span></a>`;
|
|
322
|
+
}).join("");
|
|
323
|
+
res.writeHead(200, { "Content-Type": "text/html; charset=utf-8" });
|
|
324
|
+
res.end(`<!DOCTYPE html><html><head><title>Select Agent</title></head><body style="font-family:system-ui,-apple-system,sans-serif;max-width:480px;margin:80px auto;padding:0 20px"><h2 style="margin-bottom:24px">Select an agent</h2>${items}</body></html>`);
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
295
328
|
// Static files (SPA fallback)
|
|
296
329
|
if (method === "GET" && serveStatic(res, url.pathname))
|
|
297
330
|
return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@archon-claw/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "AI Agent CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"tsx": "^4.21.0",
|
|
22
22
|
"typescript": "^5.9.3",
|
|
23
23
|
"vitest": "^4.0.18",
|
|
24
|
-
"@archon-claw/web": "0.1.
|
|
24
|
+
"@archon-claw/web": "0.1.1"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@clack/prompts": "^1.1.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{u as n,r as a,f as d,i as l,j as e,b as h,C as u,X as x,d as f}from"./chat-input-Cpyxmt8J.js";function m(){return e.jsxs("div",{className:"flex h-10 shrink-0 items-center justify-between border-b px-3",children:[e.jsx("span",{className:"text-sm font-semibold",children:"Archon Claw"}),e.jsx("button",{type:"button",className:"text-muted-foreground hover:bg-accent rounded p-1 transition-colors",onClick:()=>window.parent.postMessage({type:"archon-claw:request-close"},"*"),children:e.jsx(x,{className:"h-4 w-4"})})]})}function g(){const t=n(s=>s.setAgentId),o=n(s=>s.createSession),r=n(s=>s.activeSession());return a.useEffect(()=>{const c=new URLSearchParams(window.location.search).get("agentId");c?t(c):d().then(i=>{i.length>0&&t(i[0].id)}).catch(()=>{}),l()},[t]),a.useEffect(()=>{r||o()},[r,o]),e.jsxs("div",{className:"flex h-dvh flex-col bg-background text-foreground",children:[e.jsx(m,{}),e.jsx(h,{}),e.jsx(u,{})]})}f.createRoot(document.getElementById("embed-root")).render(e.jsx(a.StrictMode,{children:e.jsx(g,{})}));
|