Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

### 新增

- Organization Phase 3(设置切片):宿主内 Organization Settings。Dashboard `/organization/settings` 使用共享 `dashboard/src/org-ui` 的 `SettingsPage`。本页只编辑 `org_os` 目录模块开关(复用 `GET/PUT /api/org-module/modules`)与组织本地偏好(`GET /api/org-module/settings` · `PUT /api/org-module/prefs`,`{FREEOS_HOME}/org-os/prefs.json`)。**不是** FreeOS 系统设置:大模型密钥、用户、时区仍链到 `/system-settings`。没有边车,也不复制 sidecar 的 AI/用户/数据库页。`freeos org export-standalone` 同时列出 Settings。未迁:Agents、Chat、Workspace、边车系统设置。
- Organization Phase 3(智能体切片):宿主内 Agent Studio / 智能体定制。Dashboard `/organization/agents` 使用共享 `dashboard/src/org-ui` 的 `AgentsPage`。列表走 `GET /api/org-module/agents`;编译 / 生命周期 / 注册复用已有 `POST /api/org-module/blueprints/compile`、`/employees/transition`、`/employees/spawn`(`{FREEOS_HOME}/tenants/<id>/employees/`)。**不是** FreeOS 个性化智能体编辑器,也不是 Chat,也不依赖未挂载的 sidecar `/api/agent-studio/*`。注册后的同事出现在 Experts。`freeos org export-standalone` 同时列出 Agents。未迁:Chat、资料上传、人才市场、薄 Workspace overview。
- Organization Phase 3(设置切片):宿主内 Organization Settings。Dashboard `/organization/settings` 使用共享 `dashboard/src/org-ui` 的 `SettingsPage`。本页只编辑 `org_os` 目录模块开关(复用 `GET/PUT /api/org-module/modules`)与组织本地偏好(`GET /api/org-module/settings` · `PUT /api/org-module/prefs`,`{FREEOS_HOME}/org-os/prefs.json`)。**不是** FreeOS 系统设置:大模型密钥、用户、时区仍链到 `/system-settings`。没有边车,也不复制 sidecar 的 AI/用户/数据库页。`freeos org export-standalone` 同时列出 Settings。未迁:Chat、Workspace、边车系统设置。
- Organization Phase 3(反思切片):宿主内 Reflections。Dashboard `/organization/reflections` 使用共享 `dashboard/src/org-ui` 的 `ReflectionsPage`。列表/创建/删除走 `/api/org-module/reflections*`,SQLite 在 `{FREEOS_HOME}/org/reflections.sqlite`。可选 `employee_id` / `task_id` 指向同一租户的目录员工与组织任务。这是组织复盘,不是 Chat,也不是第二套技能运行时。`freeos org export-standalone` 同时列出 Reflections。未迁:Chat、边车技能统计、边车部署铁律样例、其余 Open-12。
- Organization Phase 3(任务切片):宿主内 Tasks。Dashboard `/organization/tasks` 与 `/organization/tasks/:id` 使用共享 `dashboard/src/org-ui` 的 `TasksPage` / `TaskDetailPage`。CRUD、状态流转、子任务与人工评论走 `/api/org-module/tasks*`,SQLite 在 `{FREEOS_HOME}/org/tasks.sqlite`。这是组织待办,不是 Octop cron,也不是项目/Chat 对话。`freeos org export-standalone` 同时列出 Tasks。未迁:Chat、附件上传、边车任务库、其余 Open-12。
- Organization Phase 3(知识切片):宿主内 Knowledge。Dashboard `/organization/knowledge` 使用共享 `dashboard/src/org-ui` 的 `KnowledgePage`。列表/详情/笔记走 `/api/org-module/knowledge*`,包装已有 `KnowledgeService`(Octop `knowledge_bases` / `knowledge_documents`),与 Chat 检索同一套行。不克隆 openXYOS sidecar notes/files DB。上传、文件夹、嵌入模型仍在 `/knowledge-bases`。`freeos org export-standalone` 同时列出 Knowledge。未迁:Chat、边车知识库、其余 Open-12。
Expand Down
6 changes: 5 additions & 1 deletion dashboard/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@
"navTasks": "Tasks",
"navReflections": "Reflections",
"navSettings": "Settings",
"navAgents": "Agents",
"announcementsTitle": "Announcements",
"announcementsBody": "Publish notices and track who has read them. This page lives in the host — no sidecar or second port.",
"openAnnouncements": "Open announcements",
Expand All @@ -217,7 +218,10 @@
"openReflections": "Open reflections",
"settingsTitle": "Organization settings",
"settingsBody": "Org-module catalog toggles and local preferences. LLM keys, users, and timezone stay on FreeOS system settings — no sidecar.",
"openSettings": "Open settings"
"openSettings": "Open settings",
"agentsTitle": "Agent Studio",
"agentsBody": "Compile organization digital colleagues from blueprints and manage lifecycle on the host. FreeOS Agents, Experts, and personalization stay where they are — no sidecar Agent Studio and no Chat page.",
"openAgents": "Open Agent Studio"
},
"systemSettings": {
"subtitle": "Workbench, remote desktop, and host administration in one place."
Expand Down
6 changes: 5 additions & 1 deletion dashboard/src/locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@
"navTasks": "任务",
"navReflections": "反思",
"navSettings": "设置",
"navAgents": "智能体定制",
"announcementsTitle": "通知公告",
"announcementsBody": "发布公告并跟踪已读。此页跑在宿主内,不需要边车或第二端口。",
"openAnnouncements": "打开通知公告",
Expand All @@ -217,7 +218,10 @@
"openReflections": "打开反思",
"settingsTitle": "组织设置",
"settingsBody": "组织模块的目录开关与本地偏好。大模型密钥、用户和时区仍在 FreeOS 系统设置,没有边车。",
"openSettings": "打开设置"
"openSettings": "打开设置",
"agentsTitle": "智能体定制",
"agentsBody": "在宿主内把蓝图编译成组织数字同事并管理生命周期。FreeOS 智能体、专家页和个性化保持原位——没有边车 Agent Studio,也不迁对话页。",
"openAgents": "打开智能体定制"
},
"systemSettings": {
"subtitle": "工作台、远程桌面与主机管理集中在这里。"
Expand Down
26 changes: 26 additions & 0 deletions dashboard/src/org-ui/api/createClient.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,20 @@ describe("createOrgApiClient", () => {
if (path === "/org-module/modules") {
return { updates: { settings: true, chat: false } };
}
if (path === "/org-module/agents") {
return {
success: true,
data: {
scope: "org_module",
colleagues: [{ slug: "policy-analyst", lifecycle: "draft" }],
stats: { total: 1, spawned: 0 },
host_surfaces: { experts: "/experts" },
},
};
}
if (path === "/org-module/blueprints/compile") {
return { slug: "policy-analyst", workspace: "/tmp/policy-analyst" };
}
throw new Error(`unexpected ${path}`);
});
const client = createOrgApiClient({ fetchJson });
Expand All @@ -122,6 +136,18 @@ describe("createOrgApiClient", () => {
settings: true,
chat: false,
});
expect((await client.agents.snapshot()).colleagues[0]?.slug).toBe(
"policy-analyst",
);
expect(
(
await client.agents.compile({
name: "Policy Analyst",
positioning: "Review drafts.",
capabilities: ["Risk alerts"],
})
).slug,
).toBe("policy-analyst");
expect(fetchJson).toHaveBeenCalled();
});

Expand Down
144 changes: 144 additions & 0 deletions dashboard/src/org-ui/api/createClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,96 @@ export interface OrgSettingsClient {
): Promise<Record<string, boolean>>;
}

export type OrgColleagueLifecycle =
| "draft"
| "market"
| "recruit"
| "shadow"
| "active"
| "offboard";

export interface OrgColleague {
slug: string;
tenant_id: string;
name: string;
lifecycle: OrgColleagueLifecycle | string;
workspace: string;
agent_id?: string;
spawned: boolean;
next: string[];
created_at?: number;
updated_at?: number;
read_only?: boolean;
cron_enabled?: boolean;
}

export interface OrgColleagueStats {
total: number;
spawned: number;
by_lifecycle: Record<string, number>;
}

export interface OrgAgentHostSurfaces {
experts: string;
personalization: string;
employees: string;
chat: string;
workbench: string;
}

export interface OrgAgentsSnapshot {
scope: string;
tenant_id: string;
schema: string;
states: string[];
next_states: Record<string, string[]>;
colleagues: OrgColleague[];
stats: OrgColleagueStats;
host_surfaces: OrgAgentHostSurfaces;
not_on_this_page: string[];
compile: string;
transition: string;
spawn: string;
}

export interface OrgBlueprintWrite {
name: string;
positioning: string;
capabilities: string[];
industry?: string;
experience?: string;
ima_url?: string;
}

export interface OrgCompiledColleague {
slug: string;
tenant_id: string;
workspace: string;
soul?: string;
skill_files?: string[];
}

export interface OrgSpawnedColleague {
agent_id: string;
slug: string;
name: string;
tenant_id: string;
workspace: string;
persisted_to_db?: boolean;
notes?: string[];
}

export interface OrgAgentsClient {
snapshot(): Promise<OrgAgentsSnapshot>;
compile(body: OrgBlueprintWrite): Promise<OrgCompiledColleague>;
transition(
slug: string,
state: string,
reason?: string,
): Promise<OrgColleague>;
spawn(slug: string): Promise<OrgSpawnedColleague>;
}

export interface OrgApiClient {
announcements: OrgAnnouncementsClient;
org: OrgChartClient;
Expand All @@ -553,6 +643,7 @@ export interface OrgApiClient {
tasks: OrgTasksClient;
reflections: OrgReflectionsClient;
settings: OrgSettingsClient;
agents: OrgAgentsClient;
}

async function unwrap<T>(payload: OrgEnvelope<T>): Promise<T> {
Expand All @@ -576,6 +667,7 @@ export function createOrgApiClient(opts: {
tasksPrefix?: string;
reflectionsPrefix?: string;
settingsPrefix?: string;
agentsPrefix?: string;
}): OrgApiClient {
const prefix = opts.announcementsPrefix ?? "/org-module/announcements";
const orgPrefix = opts.orgPrefix ?? "/org-module/org";
Expand All @@ -585,6 +677,7 @@ export function createOrgApiClient(opts: {
const tasksPrefix = opts.tasksPrefix ?? "/org-module/tasks";
const reflectionsPrefix = opts.reflectionsPrefix ?? "/org-module/reflections";
const settingsPrefix = opts.settingsPrefix ?? "/org-module";
const agentsPrefix = opts.agentsPrefix ?? "/org-module";
const fetchJson = opts.fetchJson;

const announcements: OrgAnnouncementsClient = {
Expand Down Expand Up @@ -1063,6 +1156,56 @@ export function createOrgApiClient(opts: {
},
};

const agents: OrgAgentsClient = {
async snapshot() {
return unwrap(
await fetchJson<OrgEnvelope<OrgAgentsSnapshot>>(
`${agentsPrefix}/agents`,
),
);
},
async compile(body) {
const ima = body.ima_url?.trim();
return fetchJson<OrgCompiledColleague>(
`${agentsPrefix}/blueprints/compile`,
{
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
blueprint: {
schema: "openxyos.agent-blueprint.v1",
name: body.name,
positioning: body.positioning,
capabilities: body.capabilities,
industry: body.industry || "professional-services",
experience: body.experience || "",
ima: ima ? { url: ima, status: "linked-unverified" } : undefined,
lifecycle: "draft",
},
}),
},
);
},
async transition(slug, state, reason) {
return fetchJson<OrgColleague>(`${agentsPrefix}/employees/transition`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
slug,
state,
reason: reason || "",
}),
});
},
async spawn(slug) {
return fetchJson<OrgSpawnedColleague>(`${agentsPrefix}/employees/spawn`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ slug }),
});
},
};

return {
announcements,
org,
Expand All @@ -1073,5 +1216,6 @@ export function createOrgApiClient(opts: {
tasks,
reflections,
settings,
agents,
};
}
1 change: 1 addition & 0 deletions dashboard/src/org-ui/contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export const SHARED_ORG_UI_MODULES = [
"tasks",
"reflections",
"settings",
"agents",
] as const;

export type SharedOrgUiModule = (typeof SHARED_ORG_UI_MODULES)[number];
11 changes: 11 additions & 0 deletions dashboard/src/org-ui/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,15 @@ export type {
OrgSettingsClient,
OrgSettingsSnapshot,
OrgSystemSettingsLinks,
OrgAgentHostSurfaces,
OrgAgentsClient,
OrgAgentsSnapshot,
OrgBlueprintWrite,
OrgColleague,
OrgColleagueLifecycle,
OrgColleagueStats,
OrgCompiledColleague,
OrgSpawnedColleague,
OrgSkill,
OrgSkillCatalogRow,
OrgSkillGenerateResult,
Expand Down Expand Up @@ -83,6 +92,8 @@ export { ReflectionsPage } from "./pages/reflections/ReflectionsPage";
export type { ReflectionsPageProps } from "./pages/reflections/ReflectionsPage";
export { SettingsPage } from "./pages/settings/SettingsPage";
export type { SettingsPageProps } from "./pages/settings/SettingsPage";
export { AgentsPage } from "./pages/agents/AgentsPage";
export type { AgentsPageProps } from "./pages/agents/AgentsPage";
export type {
IdentityBridge,
OrgFetcher,
Expand Down
Loading
Loading