closeclaw 3.0.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.
Files changed (39) hide show
  1. package/dist/agent-templates/AGENTS.md +61 -0
  2. package/dist/agent-templates/HEARTBEAT.md +6 -0
  3. package/dist/agent-templates/SOUL.md +15 -0
  4. package/dist/cli-loader.cjs +1 -0
  5. package/dist/cli.cjs +8223 -0
  6. package/dist/cli.jsc +0 -0
  7. package/dist/index-loader.cjs +1 -0
  8. package/dist/index.cjs +6903 -0
  9. package/dist/index.jsc +0 -0
  10. package/dist/packages/platform-tools/index.js +160 -0
  11. package/dist/packages/platform-tools/openclaw.plugin.json +11 -0
  12. package/dist/packages/platform-tools/package.json +25 -0
  13. package/dist/public/assets/AdminPage-TYchgkhe.js +6 -0
  14. package/dist/public/assets/AgentsPage-fanigo1Q.js +1 -0
  15. package/dist/public/assets/ApprovalsPage-B0jTfJY1.js +1 -0
  16. package/dist/public/assets/GatewayPage-C3mps8uI.js +1 -0
  17. package/dist/public/assets/InboxPage-DWoHZ9O7.js +6 -0
  18. package/dist/public/assets/LogsPage-B-sl_Z5l.js +1 -0
  19. package/dist/public/assets/OrgPage-CcSQejSc.js +1 -0
  20. package/dist/public/assets/OrgSettingsPage-6NAXJQ1k.js +11 -0
  21. package/dist/public/assets/ProjectBoardPage-DnBdfWxy.js +25 -0
  22. package/dist/public/assets/ProjectListPage-DGdYSZz9.js +6 -0
  23. package/dist/public/assets/ProjectSettingsPage-BPttlyAC.js +6 -0
  24. package/dist/public/assets/SystemPage-B9j8tKx6.js +1 -0
  25. package/dist/public/assets/TeamPage-esENElH4.js +1 -0
  26. package/dist/public/assets/chevron-right-BnCRLuSC.js +6 -0
  27. package/dist/public/assets/circle-x-DqOtgfMh.js +11 -0
  28. package/dist/public/assets/clock-k3OP3WGD.js +6 -0
  29. package/dist/public/assets/empty-state-fdFSKAF8.js +1 -0
  30. package/dist/public/assets/index-DXrrw_d3.js +284 -0
  31. package/dist/public/assets/index-Yi92esJb.css +1 -0
  32. package/dist/public/assets/label-chip-CncSPoUy.js +1 -0
  33. package/dist/public/assets/refresh-cw-DPxC49W6.js +6 -0
  34. package/dist/public/assets/trash-2-DG-hxPmD.js +6 -0
  35. package/dist/public/assets/use-tasks-BRmu1Iuc.js +106 -0
  36. package/dist/public/assets/user-plus-DPBDxgC3.js +6 -0
  37. package/dist/public/assets/users-DP3a-Wwz.js +6 -0
  38. package/dist/public/index.html +32 -0
  39. package/package.json +54 -0
package/dist/index.jsc ADDED
Binary file
@@ -0,0 +1,160 @@
1
+ // Platform Tools — OpenClaw plugin for AI Alpha Tech
2
+ // Two tools: update_task + get_task
3
+ // Both call the backend at localhost:3001/internal/* (never touches DB directly)
4
+
5
+ import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
6
+ import { Type } from "@sinclair/typebox";
7
+
8
+ const BACKEND_URL = "http://127.0.0.1:3001";
9
+
10
+ export default definePluginEntry({
11
+ id: "platform-tools",
12
+ name: "Platform Tools",
13
+ description:
14
+ "AI Alpha Tech platform integration. Provides update_task and get_task tools for agents to interact with the project management backend.",
15
+ register(api) {
16
+ // Tool 1: update_task
17
+ api.registerTool({
18
+ name: "update_task",
19
+ label: "Update Task",
20
+ description:
21
+ "Update a platform task's status, plan, or post a comment. " +
22
+ "Use this to move tasks through the workflow, submit plans for review, " +
23
+ "or communicate with the team.",
24
+ parameters: Type.Object({
25
+ task_id: Type.String({ description: "The task ID to update." }),
26
+ status: Type.Optional(
27
+ Type.String({
28
+ description:
29
+ "New task status. Use: ai_planning, ai_discuss, ai_plan_review, ai_in_progress, ai_done.",
30
+ })
31
+ ),
32
+ ai_plan: Type.Optional(
33
+ Type.String({
34
+ description: "The plan text to submit for human review.",
35
+ })
36
+ ),
37
+ ai_plan_status: Type.Optional(
38
+ Type.String({
39
+ description:
40
+ 'Plan status. Use "pending_review" when submitting a plan.',
41
+ })
42
+ ),
43
+ comment: Type.Optional(
44
+ Type.String({
45
+ description:
46
+ "A comment to post on the task (visible to the team).",
47
+ })
48
+ ),
49
+ }),
50
+ async execute(_toolCallId, params) {
51
+ const res = await fetch(`${BACKEND_URL}/internal/task-update`, {
52
+ method: "POST",
53
+ headers: { "Content-Type": "application/json" },
54
+ body: JSON.stringify(params),
55
+ });
56
+
57
+ if (!res.ok) {
58
+ const text = await res.text().catch(() => "Unknown error");
59
+ return {
60
+ content: [{ type: "text", text: `Failed to update task: ${text}` }],
61
+ details: { status: "failed" },
62
+ };
63
+ }
64
+
65
+ const data = await res.json();
66
+ return {
67
+ content: [
68
+ {
69
+ type: "text",
70
+ text: `Task ${params.task_id} updated successfully.${params.status ? ` Status: ${params.status}.` : ""}${params.comment ? " Comment posted." : ""}${params.ai_plan ? " Plan submitted." : ""}`,
71
+ },
72
+ ],
73
+ details: data,
74
+ };
75
+ },
76
+ });
77
+
78
+ // Tool 2: get_task
79
+ api.registerTool({
80
+ name: "get_task",
81
+ label: "Get Task",
82
+ description:
83
+ "Retrieve full details of a platform task including description, " +
84
+ "labels, comments, and checklists. Use this to understand what " +
85
+ "needs to be done before planning or executing.",
86
+ parameters: Type.Object({
87
+ task_id: Type.String({ description: "The task ID to retrieve." }),
88
+ }),
89
+ async execute(_toolCallId, params) {
90
+ const res = await fetch(`${BACKEND_URL}/internal/task-get`, {
91
+ method: "POST",
92
+ headers: { "Content-Type": "application/json" },
93
+ body: JSON.stringify(params),
94
+ });
95
+
96
+ if (!res.ok) {
97
+ const text = await res.text().catch(() => "Unknown error");
98
+ return {
99
+ content: [{ type: "text", text: `Failed to get task: ${text}` }],
100
+ details: { status: "failed" },
101
+ };
102
+ }
103
+
104
+ const data = await res.json();
105
+ const task = data.task;
106
+
107
+ if (!task) {
108
+ return {
109
+ content: [{ type: "text", text: "Task not found." }],
110
+ details: { status: "not_found" },
111
+ };
112
+ }
113
+
114
+ const lines = [
115
+ `# Task: ${task.title}`,
116
+ `ID: ${task.id}`,
117
+ `Status: ${task.status}`,
118
+ `Priority: ${task.priority || "none"}`,
119
+ `Side: ${task.side}`,
120
+ ];
121
+
122
+ if (task.description) lines.push(`\n## Description\n${task.description}`);
123
+ if (task.due_date) lines.push(`Due: ${task.due_date}`);
124
+ if (task.story_points != null) lines.push(`Story Points: ${task.story_points}`);
125
+
126
+ const labels = task.task_labels
127
+ ?.map((tl) => tl.labels?.name)
128
+ .filter(Boolean);
129
+ if (labels?.length) {
130
+ lines.push(`\nLabels: ${labels.join(", ")}`);
131
+ }
132
+
133
+ const comments = task.comments || [];
134
+ if (comments.length > 0) {
135
+ lines.push("\n## Comments");
136
+ for (const c of comments) {
137
+ const author = c.is_ai_message ? "AI Agent" : "Human";
138
+ lines.push(`[${author}] ${c.content}`);
139
+ }
140
+ }
141
+
142
+ const checklists = task.checklists || [];
143
+ if (checklists.length > 0) {
144
+ lines.push("\n## Checklists");
145
+ for (const cl of checklists) {
146
+ lines.push(`### ${cl.title}`);
147
+ for (const item of cl.checklist_items || []) {
148
+ lines.push(`- [${item.is_checked ? "x" : " "}] ${item.content}`);
149
+ }
150
+ }
151
+ }
152
+
153
+ return {
154
+ content: [{ type: "text", text: lines.join("\n") }],
155
+ details: task,
156
+ };
157
+ },
158
+ });
159
+ },
160
+ });
@@ -0,0 +1,11 @@
1
+ {
2
+ "id": "platform-tools",
3
+ "name": "Platform Tools",
4
+ "description": "AI Alpha Tech platform integration — update_task and get_task tools that call the backend API.",
5
+ "version": "1.0.7",
6
+ "configSchema": {
7
+ "type": "object",
8
+ "additionalProperties": false,
9
+ "properties": {}
10
+ }
11
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "@prajwalshete/platform-tools",
3
+ "version": "1.3.0",
4
+ "type": "module",
5
+ "description": "OpenClaw plugin — gives AI agents tools for task management and GitHub integration with worktree isolation (update_task, get_task, list_branches, create_branch, create_pr, commit_and_push, get_pr_status).",
6
+ "openclaw": {
7
+ "extensions": [
8
+ "./index.ts"
9
+ ]
10
+ },
11
+ "keywords": [
12
+ "openclaw",
13
+ "openclaw-plugin",
14
+ "platform-tools",
15
+ "agent-tools",
16
+ "task-management"
17
+ ],
18
+ "license": "MIT",
19
+ "dependencies": {
20
+ "@sinclair/typebox": "0.34.48"
21
+ },
22
+ "peerDependencies": {
23
+ "openclaw": ">=2026.3.0"
24
+ }
25
+ }
@@ -0,0 +1,6 @@
1
+ import{c as u,aL as y,b3 as g,r,a0 as l,aW as h,Y as c,b4 as v,j as e}from"./index-DXrrw_d3.js";import{U as j}from"./users-DP3a-Wwz.js";/**
2
+ * @license lucide-react v0.577.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const b=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],f=u("zap",b);function k(){const{currentOrgId:t}=y(),o=g(s=>s.openclawConnected),[a,n]=r.useState([]),[i,d]=r.useState([]),[x,m]=r.useState([]);r.useEffect(()=>{t&&(l.request("adminAgentsList",{orgId:t}).then(s=>n(Array.isArray(s)?s:(s==null?void 0:s.agents)||[])).catch(()=>{}),l.request("getOrgMembers",{orgId:t}).then(d).catch(()=>{}),l.request("getProjects",{orgId:t}).then(m).catch(()=>{}))},[t]);const p=[{label:"Gateway",value:o?"Online":"Offline",icon:h,color:o?"var(--status-done)":"var(--priority-urgent)",dot:!0},{label:"Agents",value:String(a.length),icon:c,color:"var(--ai-indicator)"},{label:"Members",value:String(i.length),icon:j,color:"var(--accent-brand)"},{label:"Projects",value:String(x.length),icon:v,color:"var(--status-progress)"}];return e.jsxs("div",{className:"p-6",children:[e.jsx("h1",{className:"text-lg font-semibold",style:{color:"var(--text-primary)"},children:"Overview"}),e.jsx("p",{className:"mt-1 text-xs",style:{color:"var(--text-tertiary)"},children:"System status and workspace summary."}),e.jsx("div",{className:"mt-6 grid gap-3 sm:grid-cols-2 lg:grid-cols-4",children:p.map(s=>e.jsxs("div",{className:"flex items-center gap-3 rounded-lg border p-4",style:{borderColor:"var(--border-default)",backgroundColor:"var(--bg-surface)"},children:[e.jsx("div",{className:"flex size-9 items-center justify-center rounded-lg",style:{backgroundColor:`color-mix(in srgb, ${s.color} 12%, transparent)`},children:e.jsx(s.icon,{className:"size-4",style:{color:s.color}})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs",style:{color:"var(--text-tertiary)"},children:s.label}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[s.dot&&e.jsx("span",{className:"size-1.5 rounded-full",style:{backgroundColor:s.color}}),e.jsx("p",{className:"text-sm font-semibold",style:{color:"var(--text-primary)"},children:s.value})]})]})]},s.label))}),e.jsxs("div",{className:"mt-8",children:[e.jsx("h2",{className:"text-sm font-semibold",style:{color:"var(--text-primary)"},children:"Active Agents"}),e.jsx("div",{className:"mt-3 rounded-lg border",style:{borderColor:"var(--border-default)"},children:a.length===0?e.jsxs("div",{className:"p-6 text-center",children:[e.jsx(c,{className:"mx-auto size-8",style:{color:"var(--text-tertiary)"}}),e.jsx("p",{className:"mt-2 text-xs",style:{color:"var(--text-tertiary)"},children:"No agents configured yet. Create a project with an agent to get started."})]}):e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsxs("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:[e.jsx("th",{className:"px-4 py-2 text-left text-[11px] font-medium uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:"Agent ID"}),e.jsx("th",{className:"px-4 py-2 text-left text-[11px] font-medium uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:"Model"}),e.jsx("th",{className:"px-4 py-2 text-left text-[11px] font-medium uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:"Status"})]})}),e.jsx("tbody",{children:a.map(s=>e.jsxs("tr",{className:"transition-colors hover:bg-[var(--bg-hover)]",style:{borderBottom:"1px solid var(--border-subtle)"},children:[e.jsx("td",{className:"px-4 py-2.5",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(f,{className:"size-3.5",style:{color:"var(--ai-indicator)"}}),e.jsx("span",{className:"font-mono text-sm",style:{color:"var(--text-primary)"},children:s.id||s.agentId})]})}),e.jsx("td",{className:"px-4 py-2.5",children:e.jsx("span",{className:"text-xs",style:{color:"var(--text-secondary)"},children:s.model||"default"})}),e.jsx("td",{className:"px-4 py-2.5",children:e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[10px] font-medium",style:{backgroundColor:"color-mix(in srgb, var(--status-done) 12%, transparent)",color:"var(--status-done)"},children:[e.jsx("span",{className:"size-1 rounded-full",style:{backgroundColor:"var(--status-done)"}}),"Ready"]})})]},s.id||s.agentId))})]})})]})]})}export{k as default};
@@ -0,0 +1 @@
1
+ import{aL as A,r as o,j as e,_ as w,Y as p,aS as C,a0 as g}from"./index-DXrrw_d3.js";import{R as k}from"./refresh-cw-DPxC49W6.js";import{C as S}from"./chevron-right-BnCRLuSC.js";function E(){const{currentOrgId:l}=A(),[n,f]=o.useState([]),[h,c]=o.useState(!0),[v,y]=o.useState(null),[j,i]=o.useState({}),[b,d]=o.useState(!1),m=()=>{l&&(c(!0),g.request("adminAgentsList",{orgId:l}).then(s=>f(Array.isArray(s)?s:(s==null?void 0:s.agents)||[])).catch(()=>{}).finally(()=>c(!1)))};o.useEffect(()=>{m()},[l]);const N=async(s,t)=>{d(!0);try{const r=await g.request("adminAgentFilesGet",{orgId:l,agentId:s,path:t});i(a=>({...a,[`${s}:${t}`]:(r==null?void 0:r.content)||"(empty)"}))}catch{i(r=>({...r,[`${s}:${t}`]:"(failed to load)"}))}d(!1)},x=["AGENTS.md","SOUL.md","HEARTBEAT.md"];return e.jsxs("div",{className:"p-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-lg font-semibold",style:{color:"var(--text-primary)"},children:"Agents"}),e.jsx("p",{className:"mt-1 text-xs",style:{color:"var(--text-tertiary)"},children:"Manage AI agents registered with OpenClaw."})]}),e.jsxs(w,{variant:"ghost",size:"sm",onClick:m,className:"gap-1.5",children:[e.jsx(k,{className:"size-3.5"})," Refresh"]})]}),h?e.jsx("div",{className:"mt-12 flex justify-center",children:e.jsx("div",{className:"size-5 rounded-full border-2 border-[var(--accent-brand)] border-t-transparent animate-spin"})}):n.length===0?e.jsxs("div",{className:"mt-12 text-center",children:[e.jsx(p,{className:"mx-auto size-10",style:{color:"var(--text-tertiary)"}}),e.jsx("p",{className:"mt-3 text-sm",style:{color:"var(--text-secondary)"},children:"No agents found"})]}):e.jsx("div",{className:"mt-6 flex flex-col gap-3",children:n.map(s=>{const t=s.id||s.agentId,r=v===t;return e.jsxs("div",{className:"rounded-lg border transition-colors",style:{borderColor:r?"var(--ai-indicator)":"var(--border-default)",backgroundColor:"var(--bg-surface)"},children:[e.jsxs("button",{onClick:()=>y(r?null:t),className:"flex w-full items-center gap-3 p-4 text-left",children:[e.jsx(p,{className:"size-5 shrink-0",style:{color:"var(--ai-indicator)"}}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"font-mono text-sm font-medium",style:{color:"var(--text-primary)"},children:t}),e.jsxs("p",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:[s.model||"default model"," ",s.workspace?`| ${s.workspace}`:""]})]}),e.jsx(S,{className:"size-4 shrink-0 transition-transform duration-150",style:{color:"var(--text-tertiary)",transform:r?"rotate(90deg)":"rotate(0deg)"}})]}),r&&e.jsxs("div",{className:"border-t px-4 py-3",style:{borderColor:"var(--border-subtle)"},children:[e.jsx("p",{className:"mb-2 text-[11px] font-medium uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:"Agent Files"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:x.map(a=>e.jsxs("button",{onClick:()=>N(t,a),disabled:b,className:"flex items-center gap-1.5 rounded-md border px-2.5 py-1 text-xs transition-colors hover:bg-[var(--bg-hover)]",style:{borderColor:"var(--border-default)",color:"var(--text-secondary)"},children:[e.jsx(C,{className:"size-3"}),a]},a))}),x.map(a=>{const u=j[`${t}:${a}`];return u?e.jsxs("div",{className:"mt-3",children:[e.jsx("p",{className:"mb-1 text-[11px] font-medium",style:{color:"var(--text-secondary)"},children:a}),e.jsx("pre",{className:"max-h-[200px] overflow-auto rounded-md p-3 font-mono text-xs leading-relaxed",style:{backgroundColor:"var(--bg-base)",color:"var(--text-secondary)",border:"1px solid var(--border-subtle)"},children:u})]},a):null})]})]},t)})})]})}export{E as default};
@@ -0,0 +1 @@
1
+ import{aL as f,aU as j,j as e,H as i,b0 as h,r as l,a0 as d,Y as y,aR as g,_ as x}from"./index-DXrrw_d3.js";import{E as b}from"./empty-state-fdFSKAF8.js";import{C as N,a as C}from"./circle-x-DqOtgfMh.js";function E(){const{currentOrgId:t}=f(),{can:p}=j();if(!p.viewApprovals)return e.jsxs(e.Fragment,{children:[e.jsx(i,{}),e.jsx(h,{message:"Only project leads and admins can view the approval queue."})]});const[a,o]=l.useState([]),[m,c]=l.useState(!0);l.useEffect(()=>{t&&(c(!0),d.request("aiApprovalQueue",{orgId:t}).then(o).catch(()=>{}).finally(()=>c(!1)))},[t]);const n=async(s,r)=>{try{await d.request("aiApprovePlan",{taskId:s,action:r}),o(u=>u.filter(v=>v.id!==s))}catch{}};return e.jsxs(e.Fragment,{children:[e.jsx(i,{}),e.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-3 border-b px-6 py-3",style:{borderColor:"var(--border-subtle)"},children:[e.jsx(y,{className:"size-5",style:{color:"var(--ai-indicator)"}}),e.jsx("h2",{className:"text-base font-semibold",style:{color:"var(--text-primary)"},children:"Approval Queue"}),a.length>0&&e.jsx("span",{className:"rounded-full px-2 py-0.5 text-xs font-medium",style:{backgroundColor:"var(--accent-muted)",color:"var(--accent-brand)"},children:a.length})]}),e.jsx("div",{className:"flex-1 overflow-y-auto p-6",style:{backgroundColor:"var(--bg-base)"},children:m?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx("div",{className:"h-5 w-5 rounded-full border-2 border-[var(--accent-brand)] border-t-transparent animate-spin"})}):a.length===0?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx(b,{message:"No pending approvals."})}):e.jsx("div",{className:"mx-auto flex max-w-2xl flex-col gap-3",children:a.map(s=>{var r;return e.jsxs("div",{className:"rounded-lg border p-4",style:{borderColor:"var(--ai-border)",backgroundColor:"var(--ai-surface)"},children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{children:[e.jsxs("span",{className:"font-mono text-[11px]",style:{color:"var(--text-tertiary)"},children:[(r=s.projects)==null?void 0:r.prefix,"-",s.task_number]}),e.jsx("h3",{className:"mt-0.5 text-sm font-medium",style:{color:"var(--text-primary)"},children:s.title})]}),e.jsx("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:g(new Date(s.updated_at),{addSuffix:!0})})]}),s.ai_plan&&e.jsx("div",{className:"mt-3 whitespace-pre-wrap rounded-md p-3 text-xs leading-relaxed",style:{backgroundColor:"var(--bg-surface)",color:"var(--text-secondary)"},children:s.ai_plan}),e.jsxs("div",{className:"mt-3 flex gap-2",children:[e.jsxs(x,{size:"sm",onClick:()=>n(s.id,"approve"),className:"gap-1",style:{backgroundColor:"var(--status-done)"},children:[e.jsx(N,{className:"size-3.5"}),"Approve"]}),e.jsxs(x,{size:"sm",variant:"ghost",onClick:()=>n(s.id,"reject"),className:"gap-1 text-[var(--priority-urgent)]",children:[e.jsx(C,{className:"size-3.5"}),"Reject"]})]})]},s.id)})})})]})]})}export{E as default};
@@ -0,0 +1 @@
1
+ import{aL as p,r as l,a0 as o,j as e}from"./index-DXrrw_d3.js";import{C as f}from"./clock-k3OP3WGD.js";function b(){const{currentOrgId:s}=p(),[i,x]=l.useState(null),[n,m]=l.useState([]),[d,y]=l.useState([]),[u,c]=l.useState(!0);return l.useEffect(()=>{s&&(c(!0),Promise.all([o.request("adminConfigGet",{orgId:s}).catch(()=>null),o.request("adminModelsList",{orgId:s}).catch(()=>[]),o.request("adminCronList",{orgId:s}).catch(()=>[])]).then(([r,t,a])=>{x(r),m(Array.isArray(t)?t:(t==null?void 0:t.models)||[]),y(Array.isArray(a)?a:(a==null?void 0:a.crons)||[])}).finally(()=>c(!1)))},[s]),u?e.jsx("div",{className:"flex flex-1 items-center justify-center",children:e.jsx("div",{className:"size-5 rounded-full border-2 border-[var(--accent-brand)] border-t-transparent animate-spin"})}):e.jsxs("div",{className:"p-6",children:[e.jsx("h1",{className:"text-lg font-semibold",style:{color:"var(--text-primary)"},children:"Gateway Config"}),e.jsx("p",{className:"mt-1 text-xs",style:{color:"var(--text-tertiary)"},children:"OpenClaw gateway configuration, models, and scheduled tasks."}),e.jsxs("div",{className:"mt-6",children:[e.jsx("h2",{className:"flex items-center gap-2 text-sm font-semibold",style:{color:"var(--text-primary)"},children:"Available Models"}),e.jsx("div",{className:"mt-3 rounded-lg border",style:{borderColor:"var(--border-default)"},children:n.length===0?e.jsx("p",{className:"p-4 text-xs",style:{color:"var(--text-tertiary)"},children:"No models loaded"}):e.jsx("div",{className:"divide-y",style:{borderColor:"var(--border-subtle)"},children:n.map((r,t)=>e.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5",children:[e.jsx("span",{className:"font-mono text-xs",style:{color:"var(--text-primary)"},children:typeof r=="string"?r:r.id||r.name||JSON.stringify(r)}),r.provider&&e.jsx("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:r.provider})]},t))})})]}),e.jsxs("div",{className:"mt-8",children:[e.jsxs("h2",{className:"flex items-center gap-2 text-sm font-semibold",style:{color:"var(--text-primary)"},children:[e.jsx(f,{className:"size-4"})," Cron Jobs"]}),e.jsx("div",{className:"mt-3 rounded-lg border",style:{borderColor:"var(--border-default)"},children:d.length===0?e.jsx("p",{className:"p-4 text-xs",style:{color:"var(--text-tertiary)"},children:"No scheduled tasks"}):e.jsx("div",{className:"divide-y",style:{borderColor:"var(--border-subtle)"},children:d.map((r,t)=>e.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm",style:{color:"var(--text-primary)"},children:r.name||r.id||`Job ${t+1}`}),e.jsx("p",{className:"font-mono text-[11px]",style:{color:"var(--text-tertiary)"},children:r.schedule||r.cron||""})]}),e.jsx("span",{className:"rounded-full px-2 py-0.5 text-[10px] font-medium",style:{backgroundColor:r.enabled!==!1?"color-mix(in srgb, var(--status-done) 12%, transparent)":"color-mix(in srgb, var(--text-tertiary) 12%, transparent)",color:r.enabled!==!1?"var(--status-done)":"var(--text-tertiary)"},children:r.enabled!==!1?"Active":"Paused"})]},t))})})]}),i&&e.jsxs("div",{className:"mt-8",children:[e.jsx("h2",{className:"text-sm font-semibold",style:{color:"var(--text-primary)"},children:"Raw Configuration"}),e.jsx("pre",{className:"mt-3 max-h-[300px] overflow-auto rounded-lg border p-4 font-mono text-xs leading-relaxed",style:{borderColor:"var(--border-default)",backgroundColor:"var(--bg-surface)",color:"var(--text-secondary)"},children:JSON.stringify(i,null,2)})]})]})}export{b as default};
@@ -0,0 +1,6 @@
1
+ import{c as v,r as t,a0 as n,j as e,H as b,_ as u,b1 as p,aR as j,aK as N}from"./index-DXrrw_d3.js";import{E as k}from"./empty-state-fdFSKAF8.js";/**
2
+ * @license lucide-react v0.577.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const g=[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]],C=v("check-check",g);function z(){const[r,l]=t.useState([]),[f,d]=t.useState(!0),[s,x]=t.useState("all");t.useEffect(()=>{d(!0),n.request("getNotifications",{limit:100}).then(l).catch(()=>{}).finally(()=>d(!1))},[]);const h=async a=>{await n.request("markRead",{notificationId:a}).catch(()=>{}),l(o=>o.map(c=>c.id===a?{...c,is_read:!0}:c))},y=async()=>{await n.request("markAllRead").catch(()=>{}),l(a=>a.map(o=>({...o,is_read:!0})))},m=s==="unread"?r.filter(a=>!a.is_read):r,i=r.filter(a=>!a.is_read).length;return e.jsxs(e.Fragment,{children:[e.jsx(b,{}),e.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between border-b px-6 py-3",style:{borderColor:"var(--border-subtle)"},children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("h2",{className:"text-base font-semibold",style:{color:"var(--text-primary)"},children:"Inbox"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx("button",{onClick:()=>x("all"),className:"rounded-md px-2.5 py-1 text-xs transition-colors duration-100",style:{backgroundColor:s==="all"?"var(--bg-active)":void 0,color:s==="all"?"var(--text-primary)":"var(--text-secondary)"},children:"All"}),e.jsxs("button",{onClick:()=>x("unread"),className:"rounded-md px-2.5 py-1 text-xs transition-colors duration-100",style:{backgroundColor:s==="unread"?"var(--bg-active)":void 0,color:s==="unread"?"var(--text-primary)":"var(--text-secondary)"},children:["Unread",i>0&&` (${i})`]})]})]}),i>0&&e.jsxs(u,{variant:"ghost",size:"sm",onClick:y,children:[e.jsx(C,{className:"mr-1 size-3.5"}),"Mark all read"]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto",style:{backgroundColor:"var(--bg-base)"},children:f?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx("div",{className:"h-5 w-5 rounded-full border-2 border-[var(--accent-brand)] border-t-transparent animate-spin"})}):m.length===0?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx(k,{message:s==="unread"?"No unread notifications.":"No notifications yet."})}):e.jsx("div",{className:"flex flex-col",children:m.map(a=>e.jsxs("div",{className:"flex items-start gap-3 border-b px-6 py-3 transition-colors duration-100 hover:bg-[var(--bg-hover)]",style:{borderColor:"var(--border-subtle)"},children:[e.jsx("div",{className:"mt-1",children:a.is_read?e.jsx("span",{className:"block size-2"}):e.jsx("span",{className:"block size-2 rounded-full",style:{backgroundColor:"var(--accent-brand)"}})}),e.jsx(p,{className:"mt-0.5 size-4 shrink-0",style:{color:"var(--text-tertiary)"}}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm",style:{color:a.is_read?"var(--text-secondary)":"var(--text-primary)",fontWeight:a.is_read?400:500},children:a.title}),a.body&&e.jsx("p",{className:"mt-0.5 text-xs",style:{color:"var(--text-tertiary)"},children:a.body}),e.jsx("span",{className:"mt-1 block text-[11px]",style:{color:"var(--text-tertiary)"},children:j(new Date(a.created_at),{addSuffix:!0})})]}),!a.is_read&&e.jsx(u,{variant:"ghost",size:"icon-xs",onClick:()=>h(a.id),title:"Mark as read",children:e.jsx(N,{className:"size-3.5",style:{color:"var(--text-tertiary)"}})})]},a.id))})})]})]})}export{z as default};
@@ -0,0 +1 @@
1
+ import{aL as m,r as t,j as e,_ as g,b5 as p,a0 as u}from"./index-DXrrw_d3.js";import{R as h}from"./refresh-cw-DPxC49W6.js";function j(){const{currentOrgId:l}=m(),[o,i]=t.useState([]),[a,n]=t.useState(!1),[c,d]=t.useState(50),x=async()=>{if(l){n(!0);try{const s=await u.request("adminRpc",{orgId:l,method:"logs.tail",params:{lines:c}}),r=Array.isArray(s)?s:(s==null?void 0:s.logs)||(s==null?void 0:s.lines)||[];i(Array.isArray(r)?r.map(String):[String(s)])}catch(s){i([`Error: ${s.message}`])}n(!1)}};return e.jsxs("div",{className:"flex flex-1 flex-col p-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-lg font-semibold",style:{color:"var(--text-primary)"},children:"Logs"}),e.jsx("p",{className:"mt-1 text-xs",style:{color:"var(--text-tertiary)"},children:"View OpenClaw gateway logs."})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("select",{value:c,onChange:s=>d(Number(s.target.value)),className:"rounded-md border px-2 py-1 text-xs",style:{backgroundColor:"var(--bg-input, var(--bg-surface))",borderColor:"var(--border-default)",color:"var(--text-primary)"},children:[e.jsx("option",{value:25,children:"25 lines"}),e.jsx("option",{value:50,children:"50 lines"}),e.jsx("option",{value:100,children:"100 lines"}),e.jsx("option",{value:200,children:"200 lines"})]}),e.jsxs(g,{size:"sm",onClick:x,disabled:a,className:"gap-1.5",children:[e.jsx(h,{className:`size-3.5 ${a?"animate-spin":""}`}),a?"Loading...":"Fetch Logs"]})]})]}),e.jsx("div",{className:"mt-4 flex-1 overflow-auto rounded-lg border font-mono",style:{borderColor:"var(--border-default)",backgroundColor:"#0d0d0f",minHeight:300},children:o.length===0?e.jsx("div",{className:"flex h-full items-center justify-center p-8",children:e.jsxs("div",{className:"text-center",children:[e.jsx(p,{className:"mx-auto size-8",style:{color:"var(--text-tertiary)"}}),e.jsx("p",{className:"mt-3 text-xs",style:{color:"var(--text-tertiary)"},children:'Click "Fetch Logs" to view gateway output.'})]})}):e.jsx("div",{className:"p-3",children:o.map((s,r)=>e.jsx("div",{className:"whitespace-pre-wrap py-0.5 text-[11px] leading-relaxed",style:{color:s.includes("error")||s.includes("Error")?"#f87171":"#a1a1aa"},children:s},r))})})]})}export{j as default};
@@ -0,0 +1 @@
1
+ import{j as e,H as t}from"./index-DXrrw_d3.js";import{E as r}from"./empty-state-fdFSKAF8.js";function m(){return e.jsxs(e.Fragment,{children:[e.jsx(t,{}),e.jsx("div",{className:"flex flex-1 items-center justify-center",children:e.jsx(r,{message:"Select a project from the sidebar to get started."})})]})}export{m as default};
@@ -0,0 +1,11 @@
1
+ import{c as O,aL as D,b2 as W,aU as $,r as t,a0 as l,j as e,H as B,X as p,aQ as i,_ as x,Z as Q}from"./index-DXrrw_d3.js";import{U as V}from"./user-plus-DPBDxgC3.js";import{T as X}from"./trash-2-DG-hxPmD.js";/**
2
+ * @license lucide-react v0.577.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const Z=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],J=O("moon",Z);/**
7
+ * @license lucide-react v0.577.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const K=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],Y=O("sun",K);function re(){const{currentOrgId:s,theme:o,setTheme:g}=D(),c=W(a=>a.profile),{isAdmin:y}=$(),[n,U]=t.useState("workspace"),[ee,q]=t.useState(null),[u,b]=t.useState(""),[A,h]=t.useState([]),[v,f]=t.useState(""),[j,L]=t.useState("member"),[N,k]=t.useState(!1),[m,d]=t.useState(!1),[C,S]=t.useState(""),[w,M]=t.useState(""),[_,I]=t.useState(""),[z,E]=t.useState("");t.useEffect(()=>{s&&(l.request("getOrg",{orgId:s}).then(a=>{q(a),b(a.name)}).catch(()=>{}),l.request("getOrgMembers",{orgId:s}).then(h).catch(()=>{}))},[s]),t.useEffect(()=>{c&&(S(c.display_name||""),M(c.full_name||""),I(c.github_username||""),E(c.github_email||""))},[c]);const P=async()=>{if(!(!s||!u.trim())){d(!0);try{await l.request("updateOrg",{orgId:s,name:u.trim()})}catch{}d(!1)}},R=async()=>{if(!(!s||!v.trim())){k(!0);try{await l.request("inviteMember",{orgId:s,email:v.trim(),role:j}),f(""),l.request("getOrgMembers",{orgId:s}).then(h).catch(()=>{})}catch(a){alert(a.message||"Failed to invite")}k(!1)}},T=async a=>{if(!(!s||!confirm("Remove this member?")))try{await l.request("removeMember",{orgId:s,userId:a}),h(r=>r.filter(H=>H.user_id!==a))}catch(r){alert(r.message||"Failed to remove")}},F=async()=>{d(!0);try{await l.request("updateMe",{display_name:C,full_name:w,github_username:_||null,github_email:z||null})}catch{}d(!1)},G=[...y?[{key:"workspace",label:"Workspace"}]:[],...y?[{key:"members",label:"Members"}]:[],{key:"profile",label:"Preferences"}];return e.jsxs(e.Fragment,{children:[e.jsx(B,{}),e.jsxs("div",{className:"flex flex-1 overflow-hidden",style:{backgroundColor:"var(--bg-base)"},children:[e.jsx("div",{className:"flex w-48 shrink-0 flex-col gap-0.5 border-r p-3",style:{borderColor:"var(--border-subtle)"},children:G.map(a=>e.jsx("button",{onClick:()=>U(a.key),className:p("rounded-md px-3 py-1.5 text-left text-sm transition-colors duration-100"),style:{backgroundColor:n===a.key?"var(--bg-active)":void 0,color:n===a.key?"var(--text-primary)":"var(--text-secondary)"},children:a.label},a.key))}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-6",children:[n==="workspace"&&e.jsxs("div",{className:"max-w-lg",children:[e.jsx("h2",{className:"text-base font-semibold",style:{color:"var(--text-primary)"},children:"Workspace Settings"}),e.jsx("p",{className:"mt-1 text-xs",style:{color:"var(--text-tertiary)"},children:"Manage your workspace name and settings."}),e.jsxs("div",{className:"mt-6 flex flex-col gap-4",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs font-medium",style:{color:"var(--text-secondary)"},children:"Workspace Name"}),e.jsx(i,{value:u,onChange:a=>b(a.target.value)})]}),e.jsx(x,{size:"sm",onClick:P,disabled:m,className:"self-start",children:m?"Saving...":"Save Changes"})]})]}),n==="members"&&e.jsxs("div",{className:"max-w-lg",children:[e.jsx("h2",{className:"text-base font-semibold",style:{color:"var(--text-primary)"},children:"Members"}),e.jsx("p",{className:"mt-1 text-xs",style:{color:"var(--text-tertiary)"},children:"Manage workspace members and their roles."}),e.jsxs("div",{className:"mt-6 flex gap-2",children:[e.jsx(i,{value:v,onChange:a=>f(a.target.value),placeholder:"Email address",className:"flex-1"}),e.jsxs("select",{value:j,onChange:a=>L(a.target.value),className:"h-9 rounded-md border px-2 text-sm",style:{backgroundColor:"var(--bg-base)",borderColor:"var(--border-default)",color:"var(--text-primary)"},children:[e.jsx("option",{value:"member",children:"Member"}),e.jsx("option",{value:"admin",children:"Admin"}),e.jsx("option",{value:"viewer",children:"Viewer"})]}),e.jsxs(x,{size:"sm",onClick:R,disabled:N,children:[e.jsx(V,{className:"mr-1 size-3.5"}),N?"Inviting...":"Invite"]})]}),e.jsx("div",{className:"mt-4 flex flex-col gap-1",children:A.map(a=>{const r=a.profiles||{};return e.jsxs("div",{className:"flex items-center gap-3 rounded-md px-3 py-2 transition-colors duration-100 hover:bg-[var(--bg-hover)]",children:[e.jsx(Q,{name:r.full_name||r.email,avatarUrl:r.avatar_url,size:"sm"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"truncate text-sm",style:{color:"var(--text-primary)"},children:r.full_name||r.email||"Unknown"}),e.jsx("p",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:r.email})]}),e.jsx("span",{className:"rounded px-2 py-0.5 text-[10px] font-medium uppercase",style:{backgroundColor:"var(--bg-active)",color:"var(--text-secondary)"},children:a.role}),a.role!=="owner"&&e.jsx(x,{variant:"ghost",size:"icon-xs",onClick:()=>T(a.user_id),children:e.jsx(X,{className:"size-3.5",style:{color:"var(--text-tertiary)"}})})]},a.id)})})]}),n==="profile"&&e.jsxs("div",{className:"max-w-lg",children:[e.jsx("h2",{className:"text-base font-semibold",style:{color:"var(--text-primary)"},children:"Preferences"}),e.jsx("p",{className:"mt-1 text-xs",style:{color:"var(--text-tertiary)"},children:"Customize your profile and appearance."}),e.jsxs("div",{className:"mt-6 flex flex-col gap-4",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs font-medium",style:{color:"var(--text-secondary)"},children:"Display Name"}),e.jsx(i,{value:C,onChange:a=>S(a.target.value)})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs font-medium",style:{color:"var(--text-secondary)"},children:"Full Name"}),e.jsx(i,{value:w,onChange:a=>M(a.target.value)})]}),e.jsxs("div",{className:"mt-2 border-t pt-4",style:{borderColor:"var(--border-subtle)"},children:[e.jsx("label",{className:"text-xs font-medium",style:{color:"var(--text-secondary)"},children:"GitHub"}),e.jsx("p",{className:"mt-0.5 text-[11px]",style:{color:"var(--text-tertiary)"},children:"Link your GitHub account so commits made through the platform show on your profile."}),e.jsxs("div",{className:"mt-3 flex flex-col gap-3",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:"Username"}),e.jsx(i,{value:_,onChange:a=>I(a.target.value),placeholder:"octocat"})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:"Email"}),e.jsx(i,{value:z,onChange:a=>E(a.target.value),placeholder:"you@example.com"}),e.jsx("p",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:"Must match a verified email on your GitHub account."})]})]})]}),e.jsx(x,{size:"sm",onClick:F,disabled:m,className:"mt-4 self-start",children:m?"Saving...":"Save Profile"}),e.jsxs("div",{className:"mt-4 border-t pt-4",style:{borderColor:"var(--border-subtle)"},children:[e.jsx("label",{className:"text-xs font-medium",style:{color:"var(--text-secondary)"},children:"Theme"}),e.jsxs("div",{className:"mt-2 flex gap-2",children:[e.jsxs("button",{onClick:()=>{g("dark"),document.documentElement.setAttribute("data-theme","dark"),localStorage.setItem("theme","dark")},className:p("flex items-center gap-2 rounded-md px-3 py-2 text-xs transition-colors duration-100"),style:{backgroundColor:o==="dark"?"var(--bg-active)":"var(--bg-surface)",color:o==="dark"?"var(--text-primary)":"var(--text-secondary)",border:`1px solid ${o==="dark"?"var(--accent-brand)":"var(--border-default)"}`},children:[e.jsx(J,{className:"size-3.5"}),"Dark"]}),e.jsxs("button",{onClick:()=>{g("light"),document.documentElement.setAttribute("data-theme","light"),localStorage.setItem("theme","light")},className:p("flex items-center gap-2 rounded-md px-3 py-2 text-xs transition-colors duration-100"),style:{backgroundColor:o==="light"?"var(--bg-active)":"var(--bg-surface)",color:o==="light"?"var(--text-primary)":"var(--text-secondary)",border:`1px solid ${o==="light"?"var(--accent-brand)":"var(--border-default)"}`},children:[e.jsx(Y,{className:"size-3.5"}),"Light"]})]})]})]})]})]})]})]})}export{re as default};