fuli-context 0.12.0 → 0.12.2
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/README.md +14 -6
- package/README.zh-CN.md +9 -4
- package/dist/web/assets/{AboutPage-BAD0iPVX.js → AboutPage-Dized8Uz.js} +1 -1
- package/dist/web/assets/{AgentConversations-1iGTd4sz.js → AgentConversations-Ccy41mEA.js} +1 -1
- package/dist/web/assets/{AgentHand-D_RafKOM.js → AgentHand-UzVhbKUC.js} +1 -1
- package/dist/web/assets/{AgentName-B5LKQ09q.js → AgentName-DJpvkub2.js} +1 -1
- package/dist/web/assets/AgentProfilePage-CFViQ8kj.js +1 -0
- package/dist/web/assets/AgentsDirectoryPage-CBFTg_IE.js +1 -0
- package/dist/web/assets/AgentsDirectoryPage-Cv-vxw2C.css +1 -0
- package/dist/web/assets/{ConnectionsPage-Tr2rRVOZ.js → ConnectionsPage-uXcabab_.js} +1 -1
- package/dist/web/assets/EmployeeRecruitDialog-D8Hvhc-M.js +1 -0
- package/dist/web/assets/EmployeeWorkbenchPage-TBl_HNj6.js +3 -0
- package/dist/web/assets/KnowledgeEditDialog-HmiqLC-Y.js +1 -0
- package/dist/web/assets/KnowledgeInspector-Cj2yK4Qh.js +1 -0
- package/dist/web/assets/KnowledgeOrganizerPage-DT3BROZm.js +1 -0
- package/dist/web/assets/KnowledgePage-C4J4VueL.js +1 -0
- package/dist/web/assets/KnowledgeWorkspace-DA_dqVRG.js +4 -0
- package/dist/web/assets/{NotFoundPage-fetSnp0N.js → NotFoundPage-x_Yd59mm.js} +1 -1
- package/dist/web/assets/{OverviewPage-BD4yY2Xz.js → OverviewPage-3eZjQ26v.js} +1 -1
- package/dist/web/assets/OverviewPage-8LBN8Shi.css +1 -0
- package/dist/web/assets/PersonalProfilePage-CDQk096L.js +1 -0
- package/dist/web/assets/PersonalProjectsPage-CJxp4Wyz.js +1 -0
- package/dist/web/assets/{ProjectAgentFirstTask-BcxqmKXQ.js → ProjectAgentFirstTask-BkRJ0zwO.js} +1 -1
- package/dist/web/assets/{ProjectAgentsPage-BWDJBESb.js → ProjectAgentsPage-BuNNqSEy.js} +8 -8
- package/dist/web/assets/{ProjectScopePicker-yodM7lF_.js → ProjectScopePicker-CiDxM2Yx.js} +1 -1
- package/dist/web/assets/PublicProjectsPage-ByOT559r.js +1 -0
- package/dist/web/assets/{ReviewPage-Cy0Rt4CO.js → ReviewPage-C0Vdr9uq.js} +1 -1
- package/dist/web/assets/RoundtablesPage-Drou-B81.css +1 -0
- package/dist/web/assets/RoundtablesPage-L3ShEWS3.js +1 -0
- package/dist/web/assets/SettingsPage-BE8pWbI6.css +1 -0
- package/dist/web/assets/SettingsPage-McYuinGz.js +1 -0
- package/dist/web/assets/{SharedJefaReportPage-C56kPciB.js → SharedJefaReportPage-Bg6lIk3E.js} +1 -1
- package/dist/web/assets/UiButton-x8hiHNRM.js +1 -0
- package/dist/web/assets/UiDialog-mjletK0y.js +1 -0
- package/dist/web/assets/{UiDisclosure-D0iMTplF.js → UiDisclosure-_IxeiexW.js} +1 -1
- package/dist/web/assets/{UiSegmented-DIJW6wv3.js → UiSegmented-WFfz9Evl.js} +1 -1
- package/dist/web/assets/{UiSelect-CMR0QqF6.js → UiSelect-K29jnV-1.js} +1 -1
- package/dist/web/assets/{WritingTastePage-QgNzssfF.js → WritingTastePage-DCULB-d2.js} +1 -1
- package/dist/web/assets/agent-pins-DS4mNsNt.js +1 -0
- package/dist/web/assets/agent-profile-Bh3MJGvb.css +1 -0
- package/dist/web/assets/{attention-store-B1DI8wmd.js → attention-store-CA5y8j1R.js} +1 -1
- package/dist/web/assets/catalog-D0VEfOAV.js +1 -0
- package/dist/web/assets/{client-CR-W5Wzp.js → client-DnwnUBQV.js} +1 -1
- package/dist/web/assets/{console-D7GHOMEC.js → console-Cw7TzOSC.js} +1 -1
- package/dist/web/assets/conversation-launcher-settings-Yc13viwr.js +1 -0
- package/dist/web/assets/{i18n-CVFhT_k7.js → i18n-oJFlt8hW.js} +3 -3
- package/dist/web/assets/{identity-CM6Dmy00.js → identity-DSGS4CZc.js} +1 -1
- package/dist/web/assets/index-BfHCcUL2.css +1 -0
- package/dist/web/assets/index-CxNER7Oo.js +5 -0
- package/dist/web/assets/{judgment-types-CJBEyJs1.js → judgment-types-DR931cZ7.js} +1 -1
- package/dist/web/assets/{model-WFhQZ3v_.js → model-BJ-UF4cs.js} +1 -1
- package/dist/web/assets/{personal-profile-graph-BwCh2M9G.js → personal-profile-graph-SOK0BR0w.js} +1 -1
- package/dist/web/assets/project-team-api-C_0qJk_B.js +1 -0
- package/dist/web/assets/{shared-report-CeIvrL9a.js → shared-report-CiX64ZiD.js} +1 -1
- package/dist/web/assets/useAgentRoster-B84mzZIg.js +1 -0
- package/dist/web/assets/{useApi-CROJJdhE-BYhbjaZB.js → useApi-CROJJdhE-7gt0QyQ5.js} +1 -1
- package/dist/web/assets/{vue-router-DaxrQwX3.js → vue-router-CCvPGaLD.js} +1 -1
- package/dist/web/index.html +15 -14
- package/dist/web/licenses/ant-design-icons.txt +22 -0
- package/docs/agent-conversations-and-collaboration.md +3 -3
- package/docs/agent-roundtable.md +33 -0
- package/docs/client-connections.md +108 -0
- package/docs/employee-agents.md +3 -3
- package/docs/project-agent-memory.md +6 -6
- package/graph-provider/fuli_graph/default_project_lead.py +1 -1
- package/graph-provider/fuli_graph/project_agent_delegations.py +70 -2
- package/graph-provider/fuli_graph/project_agent_memory_routes.py +18 -1
- package/graph-provider/fuli_graph/project_agent_remote_origins.py +154 -0
- package/graph-provider/fuli_graph/project_agent_task_models.py +1 -1
- package/graph-provider/fuli_graph/runtime.py +7 -0
- package/graph-provider/fuli_graph/store_project_agent_context.py +3 -2
- package/graph-provider/fuli_graph/store_project_agent_coordination_policy.py +1 -1
- package/graph-provider/fuli_graph/store_project_agent_task_reads.py +1 -1
- package/graph-provider/fuli_graph/store_project_agent_task_recruitment.py +5 -5
- package/graph-provider/fuli_graph/store_project_agent_task_staffing.py +2 -2
- package/graph-provider/fuli_graph/store_project_agent_tasks.py +2 -2
- package/graph-provider/fuli_graph/store_project_agents.py +6 -6
- package/graph-provider/fuli_graph/system_agents.py +12 -2
- package/graph-provider/fuli_graph/system_hr_identity.py +2 -2
- package/graph-provider/pyproject.toml +2 -1
- package/npm-shrinkwrap.json +280 -5
- package/package.json +6 -2
- package/skills/operating-fuli/SKILL.md +3 -3
- package/src/agent-peer/coordinator-http.js +117 -0
- package/src/agent-peer/coordinator-service.js +258 -0
- package/src/agent-peer/coordinator-store.js +95 -0
- package/src/agent-peer/device-identity.js +70 -0
- package/src/agent-peer/http.js +47 -0
- package/src/agent-peer/node-store.js +127 -0
- package/src/agent-peer/origin-proof.js +56 -0
- package/src/agent-peer/peer-port.js +140 -0
- package/src/agent-peer/peer-runtime.js +298 -0
- package/src/agent-peer/peer-transport.js +78 -0
- package/src/agent-peer/protocol.js +161 -0
- package/src/agent-peer/runner.js +251 -0
- package/src/agent-roundtable/http.js +17 -3
- package/src/agent-roundtable/service.js +272 -43
- package/src/agent-roundtable/tools.js +15 -1
- package/src/agent-roundtable/wake.js +12 -3
- package/src/agent-tools/graph-definitions.js +14 -5
- package/src/agent-tools/graph-handlers.js +1 -0
- package/src/agent-tools/interface-catalog.js +10 -1
- package/src/agent-tools/project-agent-definitions.js +1 -1
- package/src/agents/identity-receipt.js +1 -1
- package/src/cli/command-registry.js +3 -0
- package/src/cli/connect-command.js +31 -0
- package/src/cli/mcp-command.js +101 -0
- package/src/cli/peer-command.js +100 -0
- package/src/cli/setup-agent-selection.js +2 -2
- package/src/cli/setup-command.js +12 -5
- package/src/cli.js +16 -0
- package/src/employees/catalog/bole.json +2 -2
- package/src/graphiti/federated-application.js +4 -1
- package/src/graphiti/project-agent-control-plane.js +7 -0
- package/src/graphiti/project-agent-task-entry.js +4 -4
- package/src/graphiti/project-agent-team-context.js +16 -18
- package/src/graphiti/project-team-view.js +82 -0
- package/src/graphiti/provider-client.js +9 -0
- package/src/graphiti/task-entry-preferences.js +1 -1
- package/src/http/api-router.js +10 -1
- package/src/http/graph-api-router.js +7 -0
- package/src/mcp/runtime.js +2 -1
- package/src/mcp/tool-annotations.js +4 -3
- package/src/mcp/tool-profiles.js +36 -0
- package/src/mcp-server.js +2 -100
- package/src/server.js +14 -2
- package/src/setup/agent-installation-status.js +5 -3
- package/src/setup/agents.js +23 -3
- package/src/setup/claude-desktop-config.js +60 -0
- package/src/setup/client-connection.js +25 -0
- package/src/setup/paths.js +3 -1
- package/src/setup/setup.js +1 -1
- package/src/setup/stable-package-root.js +29 -0
- package/src/system/system-service.js +5 -0
- package/dist/web/assets/AgentProfilePage-CioOdkBM.js +0 -1
- package/dist/web/assets/AgentsDirectoryPage--1A9nvNA.js +0 -1
- package/dist/web/assets/AgentsDirectoryPage-C7OUQH9v.css +0 -1
- package/dist/web/assets/EmployeeRecruitDialog-1QevD4Qv.js +0 -1
- package/dist/web/assets/EmployeeWorkbenchPage-B0vQIgwA.js +0 -3
- package/dist/web/assets/KnowledgeEditDialog-ClnrfPZi.js +0 -1
- package/dist/web/assets/KnowledgeInspector-Te1hJZbx.js +0 -1
- package/dist/web/assets/KnowledgeOrganizerPage-CCCrWl6Y.js +0 -1
- package/dist/web/assets/KnowledgePage-DGOcBwr8.js +0 -1
- package/dist/web/assets/KnowledgeWorkspace-cKn1NCRe.js +0 -4
- package/dist/web/assets/OverviewPage-By-fUzSG.css +0 -1
- package/dist/web/assets/PersonalProfilePage-DGJVP_VB.js +0 -1
- package/dist/web/assets/PersonalProjectsPage-D25HYMgD.js +0 -1
- package/dist/web/assets/PublicProjectsPage-CyNxVzW3.js +0 -1
- package/dist/web/assets/RoundtablesPage-BjVhvwMc.js +0 -1
- package/dist/web/assets/RoundtablesPage-Cb0R4GaM.css +0 -1
- package/dist/web/assets/SettingsPage-CCZqZtnH.js +0 -1
- package/dist/web/assets/SettingsPage-DYz5bTwa.css +0 -1
- package/dist/web/assets/UiDialog-CvDxg3B1.js +0 -1
- package/dist/web/assets/agent-pins-BcJ_qr8n.js +0 -1
- package/dist/web/assets/agent-profile-BZj3ezWe.css +0 -1
- package/dist/web/assets/catalog-DbXv0_bR.js +0 -1
- package/dist/web/assets/conversation-launcher-settings-Dj2GMzCI.js +0 -1
- package/dist/web/assets/index-CJ6Jmok9.css +0 -1
- package/dist/web/assets/index-CRa3GnYi.js +0 -5
- package/dist/web/assets/useAgentRoster-DCArHlxK.js +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const READ_TOOLS = new Set([
|
|
2
2
|
'get_judgment_policy', 'list_judgments', 'get_agent_pins',
|
|
3
|
-
'find_agents', 'read_agent_messages', 'read_agent_thread',
|
|
3
|
+
'find_agents', 'read_agent_messages', 'read_agent_thread', 'get_agent_message_status',
|
|
4
4
|
'get_agent_quality_gate',
|
|
5
5
|
'plan_agent_collaboration', 'list_agent_loans',
|
|
6
6
|
'list_agent_conversations', 'read_agent_conversation', 'get_agent_conversation_policy',
|
|
@@ -32,6 +32,7 @@ const READ_TOOLS = new Set([
|
|
|
32
32
|
'view_project_agent_task',
|
|
33
33
|
'view_project_agent_activity',
|
|
34
34
|
'get_project_agent_coordination_policy',
|
|
35
|
+
'get_project_team',
|
|
35
36
|
'get_project_agent_recruitment_policy',
|
|
36
37
|
'list_project_agent_recruitments',
|
|
37
38
|
'list_executors',
|
|
@@ -52,7 +53,7 @@ const READ_TOOLS = new Set([
|
|
|
52
53
|
|
|
53
54
|
const WRITE_TOOLS = new Set([
|
|
54
55
|
'review_with_tonborg', 'assess_agent_action', 'assess_task_completion', 'pin_agent',
|
|
55
|
-
'message_agent', 'reply_agent_message',
|
|
56
|
+
'message_agent', 'reply_agent_message', 'cancel_agent_message',
|
|
56
57
|
'record_agent_verification',
|
|
57
58
|
'request_agent_loan', 'decide_agent_loan',
|
|
58
59
|
'resume_agent_conversation', 'update_agent_conversation_policy',
|
|
@@ -172,7 +173,7 @@ export function annotationsFor(name) {
|
|
|
172
173
|
name === 'record_knowledge_usage' || name === 'record_decision_trace' ||
|
|
173
174
|
name === 'record_knowledge_feedback' ||
|
|
174
175
|
name === 'record_workflow_transition_observation' ||
|
|
175
|
-
name === 'message_agent' || name === 'reply_agent_message' ||
|
|
176
|
+
name === 'message_agent' || name === 'reply_agent_message' || name === 'cancel_agent_message' ||
|
|
176
177
|
name === 'checkpoint_task_knowledge' ||
|
|
177
178
|
name === 'checkpoint_project_agent_memory',
|
|
178
179
|
openWorldHint: name === 'review_with_tonborg' || name === 'assess_agent_action' || name === 'assess_task_completion' || name === 'capture_session_knowledge' ||
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// Named MCP tool sets. Chat clients such as Claude Desktop load every tool schema
|
|
2
|
+
// into each conversation, so they get only the day-to-day memory, preference and
|
|
3
|
+
// Roundtable tools; management stays in the console and the full profile.
|
|
4
|
+
const CHAT_TOOLS = Object.freeze([
|
|
5
|
+
'get_collaboration_preferences',
|
|
6
|
+
'get_user_taste_skill',
|
|
7
|
+
'search_current_project_knowledge',
|
|
8
|
+
'search_knowledge_graph',
|
|
9
|
+
'capture_session_knowledge',
|
|
10
|
+
'record_knowledge_usage',
|
|
11
|
+
'record_decision_trace',
|
|
12
|
+
'checkpoint_task_knowledge',
|
|
13
|
+
'list_personal_projects',
|
|
14
|
+
'list_project_agents',
|
|
15
|
+
'get_project_agent_context',
|
|
16
|
+
'list_agent_conversations',
|
|
17
|
+
'read_agent_conversation',
|
|
18
|
+
'resume_agent_conversation',
|
|
19
|
+
'find_agents',
|
|
20
|
+
'message_agent',
|
|
21
|
+
'read_agent_messages',
|
|
22
|
+
'reply_agent_message',
|
|
23
|
+
'read_agent_thread',
|
|
24
|
+
'get_agent_message_status',
|
|
25
|
+
]);
|
|
26
|
+
|
|
27
|
+
export const MCP_TOOL_PROFILES = Object.freeze({ full: null, chat: CHAT_TOOLS });
|
|
28
|
+
|
|
29
|
+
// Returns the allow-listed tool names, or null for every tool.
|
|
30
|
+
export function toolNamesForProfile(profile = 'full') {
|
|
31
|
+
if (!Object.hasOwn(MCP_TOOL_PROFILES, profile)) {
|
|
32
|
+
throw new TypeError(`Unknown MCP tool profile: ${profile}. Use ${Object.keys(MCP_TOOL_PROFILES).join(' or ')}`);
|
|
33
|
+
}
|
|
34
|
+
const names = MCP_TOOL_PROFILES[profile];
|
|
35
|
+
return names ? [...names] : null;
|
|
36
|
+
}
|
package/src/mcp-server.js
CHANGED
|
@@ -1,105 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
bindRuntimeLeaseAgentTools,
|
|
5
|
-
createRuntimeLeaseClient
|
|
6
|
-
} from './adaptive-runtime/lease-client.js';
|
|
7
|
-
import { ApplicationError } from './app/application-error.js';
|
|
8
|
-
import { openFederatedGraphApplication } from './graphiti/federated-application.js';
|
|
9
|
-
import {
|
|
10
|
-
GraphRuntimeConfigurationError,
|
|
11
|
-
resolveGraphRuntimeOptions
|
|
12
|
-
} from './graphiti/runtime-config.js';
|
|
13
|
-
import { runStdio } from './mcp/runtime.js';
|
|
14
|
-
import { prepareDirectAgentToolCall } from './mcp/direct-call.js';
|
|
15
|
-
import { normalizeMcpSourceApplication } from './mcp/session-id.js';
|
|
16
|
-
import { applicationErrorMessage } from './mcp/tool-result.js';
|
|
2
|
+
import { runMcpCommand, startupMessage } from './cli/mcp-command.js';
|
|
17
3
|
|
|
18
|
-
await
|
|
4
|
+
await runMcpCommand(process.argv.slice(2)).catch((error) => {
|
|
19
5
|
process.stderr.write(`${startupMessage(error)}\n`);
|
|
20
6
|
process.exitCode = 1;
|
|
21
7
|
});
|
|
22
|
-
|
|
23
|
-
async function main(args) {
|
|
24
|
-
if (args.includes('--tools')) {
|
|
25
|
-
process.stdout.write(`${JSON.stringify(listAgentTools(), null, 2)}\n`);
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
if (args.includes('--help') || args.includes('-h')) {
|
|
29
|
-
process.stdout.write(helpText());
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const { runtimeConfigPath } = resolveGraphRuntimeOptions(args, process.env);
|
|
34
|
-
const configuredSourceApplication = args.includes('--source-application')
|
|
35
|
-
? requiredOption(args, '--source-application')
|
|
36
|
-
: null;
|
|
37
|
-
if (args.includes('--call')) {
|
|
38
|
-
await runCall({
|
|
39
|
-
args,
|
|
40
|
-
runtimeConfigPath,
|
|
41
|
-
sourceApplication: configuredSourceApplication
|
|
42
|
-
? normalizeMcpSourceApplication(configuredSourceApplication)
|
|
43
|
-
: 'other'
|
|
44
|
-
});
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
await runStdio({
|
|
48
|
-
runtimeConfigPath,
|
|
49
|
-
sourceApplication: configuredSourceApplication
|
|
50
|
-
? normalizeMcpSourceApplication(configuredSourceApplication)
|
|
51
|
-
: undefined
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
async function runCall({ args, runtimeConfigPath, sourceApplication }) {
|
|
56
|
-
const toolName = requiredOption(args, '--call');
|
|
57
|
-
const prepared = await prepareDirectAgentToolCall({
|
|
58
|
-
toolName,
|
|
59
|
-
input: parseInput(args),
|
|
60
|
-
sourceApplication
|
|
61
|
-
});
|
|
62
|
-
const app = openFederatedGraphApplication({ runtimeConfigPath });
|
|
63
|
-
const leaseClient = createRuntimeLeaseClient({ runtimeConfigPath });
|
|
64
|
-
bindRuntimeLeaseAgentTools(app, leaseClient);
|
|
65
|
-
try {
|
|
66
|
-
const result = await leaseClient.withGraphLease(
|
|
67
|
-
`cli-call:${toolName}`,
|
|
68
|
-
() => callAgentTool(app, toolName, prepared.input)
|
|
69
|
-
);
|
|
70
|
-
process.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
|
|
71
|
-
} finally {
|
|
72
|
-
await leaseClient.close();
|
|
73
|
-
await app.close();
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
function option(args, flag) {
|
|
78
|
-
const index = args.indexOf(flag);
|
|
79
|
-
return index === -1 ? null : args[index + 1];
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
function requiredOption(args, flag) {
|
|
83
|
-
const value = option(args, flag);
|
|
84
|
-
if (!value) throw new TypeError(`Missing value for ${flag}`);
|
|
85
|
-
return value;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
function parseInput(args) {
|
|
89
|
-
const raw = option(args, '--input');
|
|
90
|
-
return raw ? JSON.parse(raw) : {};
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
function startupMessage(error) {
|
|
94
|
-
if (error instanceof ApplicationError) return applicationErrorMessage(error);
|
|
95
|
-
if (error instanceof GraphRuntimeConfigurationError) return error.message;
|
|
96
|
-
return 'MCP server failed to start';
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
function helpText() {
|
|
100
|
-
return 'Usage: node src/mcp-server.js [--runtime-config <graph-runtime.json>] ' +
|
|
101
|
-
'[--source-application <codex|claude|claude_code|cursor|kiro|other>]\n' +
|
|
102
|
-
' node src/mcp-server.js --tools\n' +
|
|
103
|
-
' node src/mcp-server.js --runtime-config <graph-runtime.json> ' +
|
|
104
|
-
'--call <tool> [--input <json>]\n';
|
|
105
|
-
}
|
package/src/server.js
CHANGED
|
@@ -3,6 +3,7 @@ import { createServer as createHttpServer } from 'node:http';
|
|
|
3
3
|
import { dirname } from 'node:path';
|
|
4
4
|
import { fileURLToPath } from 'node:url';
|
|
5
5
|
|
|
6
|
+
import { createPeerRuntime } from './agent-peer/peer-runtime.js';
|
|
6
7
|
import { handleApiRequest } from './http/api-router.js';
|
|
7
8
|
import { mapHttpError } from './http/error-mapping.js';
|
|
8
9
|
import { localServerAuthority, rejectRequestOutsidePolicy } from './http/request-policy.js';
|
|
@@ -57,10 +58,11 @@ export async function createServer(options = {}) {
|
|
|
57
58
|
let system = null;
|
|
58
59
|
let resourcesClosing = null;
|
|
59
60
|
let stopJudgment = () => {};
|
|
61
|
+
let peer = null;
|
|
60
62
|
function closeResources() {
|
|
61
63
|
resourcesClosing ??= (async () => {
|
|
62
64
|
const failures = [];
|
|
63
|
-
for (const close of [() => stopJudgment(), () => system?.close?.(), () => runtime.close()]) {
|
|
65
|
+
for (const close of [() => stopJudgment(), () => peer?.close(), () => system?.close?.(), () => runtime.close()]) {
|
|
64
66
|
try {
|
|
65
67
|
const pending = close();
|
|
66
68
|
if (pending?.then) await pending;
|
|
@@ -92,6 +94,7 @@ export async function createServer(options = {}) {
|
|
|
92
94
|
packageRoot: PACKAGE_ROOT
|
|
93
95
|
}),
|
|
94
96
|
packageRoot: PACKAGE_ROOT,
|
|
97
|
+
runtimeConfigPath: localOptions.runtimeConfigPath,
|
|
95
98
|
activePort: port,
|
|
96
99
|
activeLan: lanEnabled,
|
|
97
100
|
executorAdapters: options.executorAdapters
|
|
@@ -113,6 +116,7 @@ export async function createServer(options = {}) {
|
|
|
113
116
|
system,
|
|
114
117
|
externalKnowledge,
|
|
115
118
|
connectedKnowledge,
|
|
119
|
+
peer,
|
|
116
120
|
authority,
|
|
117
121
|
lanAuthorities: allowedLanAuthorities,
|
|
118
122
|
lanAccessToken: lanToken
|
|
@@ -149,6 +153,12 @@ export async function createServer(options = {}) {
|
|
|
149
153
|
}
|
|
150
154
|
stopJudgment = startJudgmentScheduler({ app: application,
|
|
151
155
|
...(system?.withGraphRuntimeLease ? { withLease: (owner, run) => system.withGraphRuntimeLease(owner, run) } : {}) });
|
|
156
|
+
// Resumes only what the owner already turned on; console LAN access never enables it.
|
|
157
|
+
if (application.peer && options.peer !== false) {
|
|
158
|
+
peer = createPeerRuntime({ app: application, port: application.peer,
|
|
159
|
+
onError: (error) => console.error(`LAN roundtable: ${error.code ?? error.message}`) });
|
|
160
|
+
peer.resume().catch((error) => console.error(`LAN roundtable could not resume: ${error.code ?? error.message}`));
|
|
161
|
+
}
|
|
152
162
|
|
|
153
163
|
let closing = null;
|
|
154
164
|
const close = () => {
|
|
@@ -195,6 +205,7 @@ async function handleRequest({
|
|
|
195
205
|
system,
|
|
196
206
|
externalKnowledge,
|
|
197
207
|
connectedKnowledge,
|
|
208
|
+
peer,
|
|
198
209
|
authority,
|
|
199
210
|
lanAuthorities,
|
|
200
211
|
lanAccessToken
|
|
@@ -212,7 +223,8 @@ async function handleRequest({
|
|
|
212
223
|
app,
|
|
213
224
|
system,
|
|
214
225
|
externalKnowledge,
|
|
215
|
-
connectedKnowledge
|
|
226
|
+
connectedKnowledge,
|
|
227
|
+
peer
|
|
216
228
|
})) return;
|
|
217
229
|
serveStatic(new URL(request.url, 'http://127.0.0.1').pathname, response);
|
|
218
230
|
}
|
|
@@ -3,6 +3,7 @@ import { existsSync, readFileSync } from 'node:fs';
|
|
|
3
3
|
import { replaceFuliTable } from './codex-config.js';
|
|
4
4
|
import { isCodexBootstrapCurrent } from './codex-bootstrap.js';
|
|
5
5
|
import { hasCurrentClaudeCodeHooks } from './claude-code-config.js';
|
|
6
|
+
import { CLAUDE_DESKTOP_SERVER_ARGS } from './claude-desktop-config.js';
|
|
6
7
|
import {
|
|
7
8
|
hasCodexTomlHookDefinitions,
|
|
8
9
|
hasCurrentCodexLifecycleHooks,
|
|
@@ -27,7 +28,7 @@ export function inspectAgentInstallations(agents, context, {
|
|
|
27
28
|
[context.projectSkillPath, agent.projectSkillPath],
|
|
28
29
|
[context.reviewSkillPath, agent.reviewSkillPath],
|
|
29
30
|
[context.operationSkillPath, agent.operationSkillPath]
|
|
30
|
-
];
|
|
31
|
+
].filter(([, targetPath]) => targetPath);
|
|
31
32
|
const skillsPresent = skillPairs.some(([, targetPath]) => fileExists(targetPath));
|
|
32
33
|
const skillsCurrent = skillPairs.every(
|
|
33
34
|
([sourcePath, targetPath]) => skillCurrent(sourcePath, targetPath)
|
|
@@ -89,8 +90,9 @@ function inspectRegistration(agent, context, readers) {
|
|
|
89
90
|
context.mcpServerPath,
|
|
90
91
|
'--runtime-config',
|
|
91
92
|
context.runtimeConfigPath,
|
|
92
|
-
'
|
|
93
|
-
|
|
93
|
+
...(agent.id === 'claude-desktop'
|
|
94
|
+
? CLAUDE_DESKTOP_SERVER_ARGS
|
|
95
|
+
: ['--source-application', agent.id === 'claude-code' ? 'claude_code' : agent.id])
|
|
94
96
|
]
|
|
95
97
|
};
|
|
96
98
|
try {
|
package/src/setup/agents.js
CHANGED
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
connectClaudeCode,
|
|
8
8
|
disconnectClaudeCode
|
|
9
9
|
} from './claude-code-config.js';
|
|
10
|
+
import { connectClaudeDesktop, disconnectClaudeDesktop } from './claude-desktop-config.js';
|
|
10
11
|
import { connectCursor, disconnectCursor } from './cursor-config.js';
|
|
11
12
|
import { connectCodex, disconnectCodex } from './codex-config.js';
|
|
12
13
|
import { adaptAgentForReviewSkill } from './review-skill-adapters.js';
|
|
@@ -69,32 +70,51 @@ export function discoverAgents({
|
|
|
69
70
|
fileExists(cursorHome)
|
|
70
71
|
)
|
|
71
72
|
}
|
|
72
|
-
].map((agent) => adaptAgentForReviewSkill(agent, { homeDir, pathApi }))
|
|
73
|
+
].map((agent) => adaptAgentForReviewSkill(agent, { homeDir, pathApi }))
|
|
74
|
+
.concat(claudeDesktop({ platform, env, homeDir, pathApi, fileExists }) ?? []);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// The chat app: MCP only, no hooks or Skills. Its config lives beside its app data.
|
|
78
|
+
function claudeDesktop({ platform, env, homeDir, pathApi, fileExists }) {
|
|
79
|
+
const appData = platform === 'win32' ? nonEmpty(env.APPDATA)
|
|
80
|
+
: platform === 'darwin' ? pathApi.join(homeDir, 'Library', 'Application Support') : null;
|
|
81
|
+
if (!appData) return null;
|
|
82
|
+
const configDir = pathApi.join(appData, 'Claude');
|
|
83
|
+
return {
|
|
84
|
+
id: 'claude-desktop',
|
|
85
|
+
label: 'Claude Desktop',
|
|
86
|
+
configPath: pathApi.join(configDir, 'claude_desktop_config.json'),
|
|
87
|
+
available: Boolean(fileExists(configDir))
|
|
88
|
+
};
|
|
73
89
|
}
|
|
74
90
|
|
|
75
91
|
export function connectAgent(agent, context, {
|
|
76
92
|
connectCodexConfig = connectCodex,
|
|
77
93
|
connectClaudeCodeConfig = connectClaudeCode,
|
|
78
|
-
connectCursorConfig = connectCursor
|
|
94
|
+
connectCursorConfig = connectCursor,
|
|
95
|
+
connectClaudeDesktopConfig = connectClaudeDesktop
|
|
79
96
|
} = {}) {
|
|
80
97
|
if (agent.id === 'codex') return connectCodexConfig(agent, context);
|
|
81
98
|
if (agent.id === 'claude-code') {
|
|
82
99
|
return connectClaudeCodeConfig(agent, context);
|
|
83
100
|
}
|
|
84
101
|
if (agent.id === 'cursor') return connectCursorConfig(agent, context);
|
|
102
|
+
if (agent.id === 'claude-desktop') return connectClaudeDesktopConfig(agent, context);
|
|
85
103
|
throw new TypeError(`Unsupported agent: ${agent.id}`);
|
|
86
104
|
}
|
|
87
105
|
|
|
88
106
|
export function disconnectAgent(agent, {
|
|
89
107
|
disconnectCodexConfig = disconnectCodex,
|
|
90
108
|
disconnectClaudeCodeConfig = disconnectClaudeCode,
|
|
91
|
-
disconnectJsonConfig = disconnectCursor
|
|
109
|
+
disconnectJsonConfig = disconnectCursor,
|
|
110
|
+
disconnectClaudeDesktopConfig = disconnectClaudeDesktop
|
|
92
111
|
} = {}) {
|
|
93
112
|
if (agent.id === 'codex') return disconnectCodexConfig(agent);
|
|
94
113
|
if (agent.id === 'claude-code') return disconnectClaudeCodeConfig(agent);
|
|
95
114
|
if (agent.id === 'cursor') {
|
|
96
115
|
return disconnectJsonConfig(agent);
|
|
97
116
|
}
|
|
117
|
+
if (agent.id === 'claude-desktop') return disconnectClaudeDesktopConfig(agent);
|
|
98
118
|
throw new TypeError(`Unsupported agent: ${agent.id}`);
|
|
99
119
|
}
|
|
100
120
|
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs';
|
|
2
|
+
|
|
3
|
+
import { readJsonFile, writeJsonFileAtomic } from '../storage/json-file.js';
|
|
4
|
+
|
|
5
|
+
// Arguments after the runtime config that identify the app and keep its tool list small.
|
|
6
|
+
export const CLAUDE_DESKTOP_SERVER_ARGS = Object.freeze(['--source-application', 'claude', '--tool-profile', 'chat']);
|
|
7
|
+
|
|
8
|
+
// Claude Desktop (the chat app) reads stdio MCP servers from
|
|
9
|
+
// claude_desktop_config.json. It has no lifecycle hooks or Skill folder, and it
|
|
10
|
+
// loads every tool schema into each chat, so it gets the compact chat profile.
|
|
11
|
+
export function connectClaudeDesktop(agent, context, {
|
|
12
|
+
readConfig = readJsonFile,
|
|
13
|
+
writeConfig = writeJsonFileAtomic
|
|
14
|
+
} = {}) {
|
|
15
|
+
const current = readConfig(agent.configPath, {});
|
|
16
|
+
assertObject(current, 'Claude Desktop config');
|
|
17
|
+
const currentServers = current.mcpServers ?? {};
|
|
18
|
+
assertObject(currentServers, 'Claude Desktop mcpServers');
|
|
19
|
+
const next = {
|
|
20
|
+
...current,
|
|
21
|
+
mcpServers: {
|
|
22
|
+
...currentServers,
|
|
23
|
+
fuli: {
|
|
24
|
+
command: context.nodePath,
|
|
25
|
+
args: [
|
|
26
|
+
context.mcpServerPath,
|
|
27
|
+
'--runtime-config',
|
|
28
|
+
context.runtimeConfigPath,
|
|
29
|
+
...CLAUDE_DESKTOP_SERVER_ARGS
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
const changed = JSON.stringify(current) !== JSON.stringify(next);
|
|
35
|
+
if (changed) writeConfig(agent.configPath, next);
|
|
36
|
+
// The app only reads its config at launch.
|
|
37
|
+
return { id: agent.id, label: agent.label, status: 'connected', restartRequired: changed };
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function disconnectClaudeDesktop(agent, {
|
|
41
|
+
fileExists = existsSync,
|
|
42
|
+
readConfig = readJsonFile,
|
|
43
|
+
writeConfig = writeJsonFileAtomic
|
|
44
|
+
} = {}) {
|
|
45
|
+
if (!fileExists(agent.configPath)) return { id: agent.id, label: agent.label, status: 'not_connected' };
|
|
46
|
+
const current = readConfig(agent.configPath, {});
|
|
47
|
+
assertObject(current, 'Claude Desktop config');
|
|
48
|
+
const currentServers = current.mcpServers ?? {};
|
|
49
|
+
assertObject(currentServers, 'Claude Desktop mcpServers');
|
|
50
|
+
if (!Object.hasOwn(currentServers, 'fuli')) return { id: agent.id, label: agent.label, status: 'not_connected' };
|
|
51
|
+
const { fuli: _removed, ...remainingServers } = currentServers;
|
|
52
|
+
writeConfig(agent.configPath, { ...current, mcpServers: remainingServers });
|
|
53
|
+
return { id: agent.id, label: agent.label, status: 'disconnected' };
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function assertObject(value, label) {
|
|
57
|
+
if (!value || typeof value !== 'object' || Array.isArray(value)) {
|
|
58
|
+
throw new TypeError(`${label} must be a JSON object`);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { toolNamesForProfile } from '../mcp/tool-profiles.js';
|
|
2
|
+
import { normalizeMcpSourceApplication } from '../mcp/session-id.js';
|
|
3
|
+
|
|
4
|
+
// Configuration only: no client discovery, file writes, credentials or model calls.
|
|
5
|
+
export function clientConnectionConfig({ nodePath = process.execPath, mcpServerPath, runtimeConfigPath }, format = 'standard', {
|
|
6
|
+
profile = 'full',
|
|
7
|
+
sourceApplication = 'other'
|
|
8
|
+
} = {}) {
|
|
9
|
+
toolNamesForProfile(profile);
|
|
10
|
+
normalizeMcpSourceApplication(sourceApplication);
|
|
11
|
+
if (!['standard', 'vscode', 'server'].includes(format)) {
|
|
12
|
+
throw new TypeError('Connection format must be standard, vscode or server');
|
|
13
|
+
}
|
|
14
|
+
for (const value of [nodePath, mcpServerPath, runtimeConfigPath]) {
|
|
15
|
+
if (typeof value !== 'string' || !value.trim()) throw new TypeError('Connection paths are required');
|
|
16
|
+
}
|
|
17
|
+
const server = {
|
|
18
|
+
type: 'stdio',
|
|
19
|
+
command: nodePath,
|
|
20
|
+
args: [mcpServerPath, '--runtime-config', runtimeConfigPath, '--source-application', sourceApplication,
|
|
21
|
+
...(profile === 'full' ? [] : ['--tool-profile', profile])]
|
|
22
|
+
};
|
|
23
|
+
if (format === 'server') return server;
|
|
24
|
+
return { [format === 'vscode' ? 'servers' : 'mcpServers']: { fuli: server } };
|
|
25
|
+
}
|
package/src/setup/paths.js
CHANGED
|
@@ -2,7 +2,9 @@ import { homedir } from 'node:os';
|
|
|
2
2
|
import { dirname, join, resolve } from 'node:path';
|
|
3
3
|
import { fileURLToPath } from 'node:url';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
import { stablePackageRoot } from './stable-package-root.js';
|
|
6
|
+
|
|
7
|
+
const DEFAULT_PACKAGE_ROOT = stablePackageRoot(dirname(dirname(dirname(fileURLToPath(import.meta.url)))));
|
|
6
8
|
|
|
7
9
|
export function resolveSetupPaths({
|
|
8
10
|
dataDir = null,
|
package/src/setup/setup.js
CHANGED
|
@@ -121,7 +121,7 @@ export async function applyLocalSetup(plan, options, dependencies = {}) {
|
|
|
121
121
|
[{ ...agent, skillPath: agent.projectSkillPath }, plan.paths.projectSkillPath],
|
|
122
122
|
[{ ...agent, skillPath: agent.reviewSkillPath }, plan.paths.reviewSkillPath],
|
|
123
123
|
[{ ...agent, skillPath: agent.operationSkillPath }, plan.paths.operationSkillPath]
|
|
124
|
-
]) {
|
|
124
|
+
].filter(([target]) => target.skillPath)) {
|
|
125
125
|
skills.push(await installSkill(target, {
|
|
126
126
|
sourcePath,
|
|
127
127
|
backupDir: plan.paths.backupDir
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { existsSync, realpathSync } from 'node:fs';
|
|
2
|
+
import { basename, dirname, join } from 'node:path';
|
|
3
|
+
|
|
4
|
+
// Version managers such as nvm-windows install each Node version in its own
|
|
5
|
+
// folder and expose the active one through a symlink (C:\nvm4w\nodejs). The
|
|
6
|
+
// module URL resolves to the versioned folder, which breaks client configs on
|
|
7
|
+
// the next `nvm use`. Prefer the same package seen through the active Node's
|
|
8
|
+
// directory when it is the identical install.
|
|
9
|
+
export function stablePackageRoot(root, {
|
|
10
|
+
execPath = process.execPath,
|
|
11
|
+
exists = existsSync,
|
|
12
|
+
realpath = realpathSync
|
|
13
|
+
} = {}) {
|
|
14
|
+
const nodeDir = dirname(execPath);
|
|
15
|
+
const name = basename(root);
|
|
16
|
+
const candidates = [
|
|
17
|
+
join(nodeDir, 'node_modules', name),
|
|
18
|
+
join(dirname(nodeDir), 'lib', 'node_modules', name)
|
|
19
|
+
];
|
|
20
|
+
let real;
|
|
21
|
+
try { real = realpath(root); } catch { return root; }
|
|
22
|
+
for (const candidate of candidates) {
|
|
23
|
+
if (candidate === root || !exists(candidate)) continue;
|
|
24
|
+
try {
|
|
25
|
+
if (realpath(candidate) === real) return candidate;
|
|
26
|
+
} catch { /* unreadable candidate */ }
|
|
27
|
+
}
|
|
28
|
+
return root;
|
|
29
|
+
}
|
|
@@ -10,9 +10,11 @@ import { createResourceMonitor } from './resource-monitor.js';
|
|
|
10
10
|
import { createAdaptiveRuntimeBroker } from '../adaptive-runtime/runtime-broker.js';
|
|
11
11
|
import { readAdaptiveRuntimeSettings } from '../adaptive-runtime/settings.js';
|
|
12
12
|
import { createPackageVersionChecker } from './package-version-checker.js';
|
|
13
|
+
import { clientConnectionConfig } from '../setup/client-connection.js';
|
|
13
14
|
|
|
14
15
|
export function createSystemService({
|
|
15
16
|
paths,
|
|
17
|
+
runtimeConfigPath = paths.graphRuntimeConfigPath,
|
|
16
18
|
packageRoot,
|
|
17
19
|
activePort,
|
|
18
20
|
activeLan,
|
|
@@ -60,6 +62,9 @@ export function createSystemService({
|
|
|
60
62
|
return {
|
|
61
63
|
getSettings,
|
|
62
64
|
updateSettings,
|
|
65
|
+
clientConnection: () => Object.fromEntries(['standard', 'vscode', 'server'].map((format) => [
|
|
66
|
+
format, clientConnectionConfig({ mcpServerPath: paths.mcpServerPath, runtimeConfigPath }, format)
|
|
67
|
+
])),
|
|
63
68
|
resources: () => resourceMonitor.sample(),
|
|
64
69
|
versionStatus: () => versionChecker.check(),
|
|
65
70
|
runtimeStatus: () => runtimeBroker.status(),
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{B as e,E as t,H as n,I as r,N as i,P as a,Q as o,S as s,T as c,U as l,a as u,b as d,f,g as p,h as m,it as ee,j as h,ot as g,p as _,rt as v,v as y,w as b,x,y as S}from"./i18n-CVFhT_k7.js";import{t as C}from"./console-D7GHOMEC.js";import{a as w,n as T,o as E}from"./client-CR-W5Wzp.js";import{m as D}from"./useApi-CROJJdhE-BYhbjaZB.js";import{t as O}from"./vue-router-DaxrQwX3.js";import{t as k}from"./UiSelect-CMR0QqF6.js";import{t as A}from"./UiDisclosure-D0iMTplF.js";import{a as j,r as M,t as N}from"./profile-model-BQO4zNs9.js";import{a as P,h as te,l as ne,n as re}from"./task-evidence-DTiPCs7r.js";import{t as F}from"./useAgentRoster-DCArHlxK.js";import{n as I}from"./paths-CDREouhi.js";import{t as ie}from"./AgentName-B5LKQ09q.js";import{t as ae}from"./AgentConversations-1iGTd4sz.js";import{i as oe,r as se,t as ce}from"./agent-work-summary-C-yW7x7A.js";import{a as le,s as ue}from"./catalog-DbXv0_bR.js";/* empty css */var de={key:1,class:`agent-locked-platforms`},L={key:2,class:`agent-platform-field`},fe=[`disabled`,`placeholder`],R=[`onUpdate:modelValue`,`disabled`],pe={key:3,role:`alert`},me={key:4,role:`status`},z=[`disabled`],he=t({__name:`AgentProfileSettings`,props:{agent:{}},emits:[`saved`],setup(t,{emit:n}){let i=t,ee=n,h=o([]),_=o(!1),C=o(!1),D=o(``),O=o(!1),A=``,j=o(``),M=o(``),N=o({judgment:``,taste:``,personality:``}),P=y(()=>i.agent.profile.executorPolicy?.mode===`locked`),te=y(()=>{let e=i.agent.profile.executorPolicy;return(e?.lockedExecutorIds?.length?e.lockedExecutorIds:(e?.allowList??[]).map(e=>e.executorId)).map(e=>h.value.find(t=>t.executorId===e)?.displayName||e)}),ne=y(()=>h.value.filter(e=>e.registrationStatus===`registered`&&e.permissionStatus===`authorized`&&e.preflightStatus===`passed`&&e.workspacePermission&&e.healthStatus!==`unhealthy`&&(!e.healthRequired||e.healthStatus===`healthy`))),re=y(()=>[{value:``,label:u(`agentProfiles.automatic`)},...j.value&&!ne.value.some(e=>e.executorId===j.value)?[{value:j.value,label:u(`agentProfiles.platformUnavailable`),disabled:!0}]:[],...ne.value.map(e=>({value:e.executorId,label:e.displayName||e.executorId}))]),F=0;e(()=>`${i.agent.personalSpaceId}/${i.agent.agentId}`,async()=>{let e=i.agent,t=++F;M.value=e.profile.expectations??``,N.value={judgment:``,taste:``,personality:``,...e.profile.character},j.value=e.profile.executorPolicy?.preferredExecutorIds?.[0]??``,A=j.value,D.value=``,O.value=!1,C.value=!1,_.value=!0,h.value=[];try{let n=await T(`/api/executors?${new URLSearchParams({personalSpaceId:e.personalSpaceId})}`);t===F&&(h.value=Array.isArray(n)?n:n.executors)}catch{t===F&&(D.value=u(`agentProfiles.platformUnavailable`))}finally{t===F&&(_.value=!1)}},{immediate:!0});async function I(){if(C.value)return;let e=F,t=i.agent;C.value=!0,D.value=``,O.value=!1;let n=t.profile.executorPolicy;try{let r=await w(`/api/project-agents`,{personalSpaceId:t.personalSpaceId,personalProjectId:t.personalProjectId??null,agentId:t.agentId,profile:{...t.profile,character:{...N.value},expectations:M.value,executorPolicy:P.value||j.value===A?n:{...n,mode:`flexible`,preferredExecutorIds:j.value?[j.value]:[]}}});e===F&&(A=j.value,ee(`saved`,r),O.value=!0)}catch(t){e===F&&(D.value=t instanceof Error?t.message:u(`agentProfiles.saveError`))}finally{e===F&&(C.value=!1)}}return(e,t)=>(a(),s(`form`,{class:`agent-simple-settings`,onSubmit:m(I,[`prevent`])},[S(`h3`,null,g(v(u)(`agentProfiles.settings`)),1),_.value?(a(),d(E,{key:0,variant:`compact`,label:v(u)(`agentProfiles.settingsLoading`)},null,8,[`label`])):P.value?(a(),s(`div`,de,[S(`h4`,null,g(v(u)(`agentProfiles.platform`)),1),S(`p`,null,g(te.value.join(` · `)||v(u)(`agentProfiles.platformUnavailable`)),1),S(`small`,null,g(v(u)(`agentProfiles.locked`)),1)])):(a(),s(`div`,L,[c(k,{modelValue:j.value,"onUpdate:modelValue":t[0]||=e=>j.value=e,field:``,label:v(u)(`agentProfiles.platform`),options:re.value,disabled:P.value||C.value},null,8,[`modelValue`,`label`,`options`,`disabled`]),S(`small`,null,g(v(u)(P.value?`agentProfiles.locked`:`agentProfiles.platformHint`)),1)])),S(`label`,null,[b(g(v(u)(`agentProfiles.expectations`)),1),l(S(`textarea`,{"onUpdate:modelValue":t[1]||=e=>M.value=e,rows:`3`,maxlength:`4096`,disabled:C.value,placeholder:v(u)(`agentProfiles.expectationsPlaceholder`)},null,8,fe),[[f,M.value]])]),S(`details`,null,[S(`summary`,null,g(v(u)(`agentProfiles.editCharacter`)),1),(a(),s(p,null,r([`judgment`,`taste`,`personality`],e=>S(`label`,{key:e},[b(g(v(u)(`agentProfiles.${e}`)),1),l(S(`textarea`,{"onUpdate:modelValue":t=>N.value[e]=t,rows:`2`,maxlength:`2048`,disabled:C.value},null,8,R),[[f,N.value[e]]])])),64))]),D.value?(a(),s(`p`,pe,g(D.value),1)):x(``,!0),O.value?(a(),s(`p`,me,g(v(u)(`agentProfiles.saved`)),1)):x(``,!0),S(`button`,{class:`primary-button`,disabled:C.value||_.value,type:`submit`},[C.value?(a(),d(E,{key:0,variant:`inline`,label:v(u)(`agentProfiles.saving`)},null,8,[`label`])):(a(),s(p,{key:1},[b(g(v(u)(`agentProfiles.save`)),1)],64))],8,z)],32))}}),ge=[`aria-label`],_e={key:1,class:`ui-card ui-empty agent-profile-empty`,role:`alert`},ve={key:2,class:`ui-card ui-empty agent-profile-empty`},ye={class:`ui-card agent-resume-header`},be={class:`agent-portrait`,"aria-hidden":`true`},xe={class:`agent-resume-intro`},Se={class:`agent-resume-name-row`},Ce={key:0,class:`ui-badge fla-employee-number`},we={class:`agent-resume-meta`},Te={class:`agent-profile-actions`},Ee=[`aria-expanded`],De={key:1,class:`agent-profile-refresh-status`,role:`status`},Oe=[`aria-label`],ke=[`id`,`aria-selected`,`aria-controls`,`tabindex`,`onClick`,`onKeydown`],Ae={key:4,class:`agent-profile-partial`,role:`status`},je=[`aria-hidden`],Me={class:`agent-profile-primary-grid`},Ne={class:`ui-card agent-resume-section agent-current-work-section`},Pe={class:`agent-section-heading`},Fe={key:0},Ie={key:0,class:`agent-current-work-list`},Le={class:`ui-badge`},Re={key:1,class:`agent-muted`},ze={key:2,class:`agent-muted`},Be={class:`ui-card agent-resume-section agent-projects-section`},Ve={class:`agent-section-heading`},He={class:`agent-resume-list agent-current-project-list`},Ue={key:0,class:`agent-project-responsibility`},We={class:`agent-resume-list`},Ge={key:0,class:`agent-project-responsibility`},Ke={key:1,class:`agent-muted`},qe=[`aria-hidden`],Je={class:`ui-card agent-resume-section`},Ye={key:0,class:`ui-disclosure`,open:``},Xe={class:`agent-resume-list`},Ze={key:1,class:`agent-muted`},Qe={class:`ui-card agent-resume-section`},$e={class:`agent-muted`},et={class:`agent-work-timeline`},tt={class:`agent-section-heading`},nt={key:0},rt={key:0},it={key:0},at={key:0,class:`agent-muted`},ot=[`aria-hidden`],st={class:`ui-card agent-resume-section`},ct={class:`agent-character`},lt={key:0,class:`agent-expectation`},ut={class:`agent-strengths`},dt={class:`agent-inline-skills`},ft={key:0},pt=[`aria-hidden`],mt={class:`ui-card agent-resume-section`},ht={class:`agent-section-heading`},gt={key:0,role:`status`},_t={key:0,class:`agent-org-lead`},vt={key:1,class:`agent-org-reporting`},yt={key:2,class:`agent-org-members`},bt={key:2,class:`agent-muted`},xt={key:0,class:`agent-muted`},St={class:`ui-card agent-resume-section`},Ct={class:`agent-collaborators`},wt={key:0,class:`agent-muted`},Tt=[`aria-hidden`],Et={class:`ui-card agent-resume-section`},Dt=[`aria-hidden`],Ot={class:`ui-card agent-resume-section agent-management-card`},kt={class:`agent-muted`},At={class:`agent-profile-management-links`},jt={class:`agent-profile-footer`},B=t({__name:`AgentProfilePage`,setup(t){let f=D(),m=C(),w=y(()=>m.activePersonalSpace?.id??``),{agents:k,loading:de,error:L,load:fe}=F(w),R=y(()=>f.params.spaceId===w.value?k.value.find(e=>e.personalSpaceId===w.value&&(e.agentId===f.params.agentId||e.legacyAgentIds?.includes(String(f.params.agentId)))):void 0),pe=y(()=>(m.state?.personalProjects??[]).filter(e=>e.personal_space_id===w.value)),me=y(()=>pe.value.map(e=>({id:e.project_id,name:e.profile.name}))),z=e=>pe.value.find(t=>t.project_id===e)?.profile.name||e,B=e=>{let t=k.value.find(t=>t.agentId===e);return t?N(t):e},V=o([]),H=o(void 0),U=o([]),W=o(!1),G=o(!1),K=o(!1),q=o(`overview`),J=y(()=>{let e=[{id:`overview`,label:u(`agentProfiles.working`)},{id:`history`,label:u(`agentProfiles.experience`)},{id:`style`,label:u(`agentProfiles.about`)},{id:`collaborators`,label:u(`agentProfiles.collaborators`)},{id:`management`,label:u(`agentProfiles.advanced`)}];return R.value?.memoryScope===`reviewed_agent`&&e.splice(4,0,{id:`conversations`,label:u(`projectAgents.conversations.title`)}),e}),Mt=y(()=>R.value?M(R.value.agentId,V.value):[]),Y=y(()=>R.value?j({...R.value,assignments:H.value??R.value.assignments}):[]),Nt=y(()=>Y.value.slice(0,4)),Pt=y(()=>Y.value.slice(4)),Ft=y(()=>(H.value??[]).filter(e=>e.status!==`active`)),X=y(()=>V.value.filter(e=>oe.has(e.status)).slice(0,6)),Z=y(()=>le.value.find(e=>e.agentId===R.value?.agentId)),Q=e=>e&&!Number.isNaN(Date.parse(e))?new Date(e).toLocaleDateString():u(`agentProfiles.timeUnknown`),$=e=>{let t=H.value?.find(t=>t.personalProjectId===e&&t.status===`active`)?.responsibility?.trim(),n=R.value?.profile.responsibility.trim();return t&&t!==n?t:``},It=y(()=>{let e=`agentRedesign.projects.more`,t=u(e,{count:Y.value.length});return t===e?`All projects (${Y.value.length})`:t}),Lt=0;e(()=>R.value?`${R.value.personalSpaceId}/${R.value.agentId}`:``,async()=>{let e=R.value,t=++Lt;if(V.value=[],H.value=void 0,U.value=[],G.value=!1,W.value=!1,K.value=!1,q.value=`overview`,!e)return;ue(e.personalSpaceId),W.value=!0,H.value=e.assignments;let n=new URLSearchParams({personalSpaceId:e.personalSpaceId}),r=new URLSearchParams({personalSpaceId:e.personalSpaceId,agentId:e.agentId}),i=await Promise.allSettled([T(`/api/project-agent-tasks?${n}&limit=200`),T(`/api/project-agent-assignments?${r}`)]);if(t!==Lt)return;let[a,o]=i;if(a.status===`fulfilled`){let t=a.value,n=te(t);G.value=!ce(t),V.value=re(Array.isArray(t)?t:n.tasks??n.items).map(ne).filter(t=>!!(t&&(!t.personalSpaceId||t.personalSpaceId===e.personalSpaceId)&&se(t,e.agentId))).sort((e,t)=>(t.updatedAt??t.createdAt??``).localeCompare(e.updatedAt??e.createdAt??``))}else G.value=!0;if(o.status===`fulfilled`){let t=o.value,n=te(t);H.value=re(Array.isArray(t)?t:n.assignments??n.items).map(t=>P(t,e)).filter(t=>!!(t&&t.agentId===e.agentId&&t.personalSpaceId===e.personalSpaceId))}else G.value=!0;let s=j({...e,assignments:H.value??e.assignments}),c=await Promise.all(s.map(async t=>{try{return{projectId:t,policy:await T(`/api/project-agent-coordination-policy?${new URLSearchParams({personalSpaceId:e.personalSpaceId,personalProjectId:t})}`),error:!1}}catch{return{projectId:t,policy:null,error:!0}}}));t===Lt&&(U.value=c,W.value=!1)},{immediate:!0});function Rt(e){let t=k.value.findIndex(t=>t.agentId===e.agentId);t>=0&&(k.value[t]={...k.value[t],...e})}function zt(e){q.value=e}function Bt(e,t){let n=e.key;if(![`ArrowLeft`,`ArrowRight`,`Home`,`End`].includes(n))return;let r=e.currentTarget;e.preventDefault();let i=J.value.length,a=n===`Home`?0:n===`End`?i-1:(t+(n===`ArrowRight`?1:-1)+i)%i,o=J.value[a];o&&(zt(o.id),h(()=>{let e=(r?.closest(`[role="tablist"]`))?.querySelectorAll(`[role="tab"]`)[a];e?.focus(),e?.scrollIntoView?.({block:`nearest`,inline:`nearest`})}))}return i(()=>{m.runtimeStatus===`idle`&&m.refresh()}),(e,t)=>(a(),s(`section`,{class:`view agent-profile-page`,"aria-label":v(u)(`agentProfiles.profile`)},[c(v(O),{class:`agent-profile-back`,to:`/project-agents`},{default:n(()=>[b(` ← `+g(v(u)(`agentProfiles.back`)),1)]),_:1}),(v(de)||v(m).runtimeStatus===`loading`)&&!R.value?(a(),d(E,{key:0,label:v(u)(`agentProfiles.loading`)},null,8,[`label`])):(v(L)||v(m).runtimeStatus===`error`)&&!R.value?(a(),s(`div`,_e,[S(`p`,null,g(v(L)||v(u)(`agentProfiles.loadError`)),1),S(`button`,{class:`quiet-button`,type:`button`,onClick:t[0]||=e=>v(m).state?v(fe)():v(m).refresh()},g(v(u)(`agentProfiles.retry`)),1)])):R.value?(a(),s(p,{key:3},[S(`header`,ye,[S(`span`,be,g(R.value.profile.occupationEmoji||v(N)(R.value).slice(0,1)),1),S(`div`,xe,[S(`div`,Se,[S(`h1`,null,g(v(N)(R.value)),1),R.value.employeeNumber?(a(),s(`span`,Ce,`FLA `+g(R.value.employeeNumber),1)):x(``,!0),S(`span`,{class:ee([`ui-badge agent-profile-membership`,`is-${R.value.profile.status}`])},g(v(u)(`projectAgents.status.${R.value.profile.status}`)),3)]),S(`p`,null,g(R.value.profile.responsibility),1),S(`div`,we,[S(`span`,null,g(v(u)(R.value.recruitedAt?`agentProfiles.joined`:`agentProfiles.created`))+` · `+g(Q(R.value.recruitedAt||R.value.createdAt)),1)])]),S(`div`,Te,[Z.value?(a(),d(v(O),{key:0,class:`quiet-button`,to:`/employees/${encodeURIComponent(Z.value.id)}`},{default:n(()=>[b(g(v(u)(`agentProfiles.workbench`)),1)]),_:1},8,[`to`])):x(``,!0),S(`button`,{class:`quiet-button`,type:`button`,"aria-expanded":K.value,onClick:t[1]||=e=>K.value=!K.value},g(v(u)(`agentProfiles.settings`)),9,Ee),c(v(O),{class:`quiet-button`,to:{path:`/employees/bole`,query:{q:v(N)(R.value)}}},{default:n(()=>[b(g(v(u)(`agentProfiles.askHR`)),1)]),_:1},8,[`to`])])]),v(de)||v(m).runtimeStatus===`loading`?(a(),d(E,{key:0,variant:`compact`,label:v(u)(`agentProfiles.loading`)},null,8,[`label`])):x(``,!0),v(L)?(a(),s(`p`,De,g(v(L)),1)):x(``,!0),K.value?(a(),d(he,{key:R.value.agentId,agent:R.value,onSaved:Rt},null,8,[`agent`])):x(``,!0),W.value?(a(),d(E,{key:3,variant:`compact`,label:v(u)(`agentProfiles.detailLoading`)},null,8,[`label`])):x(``,!0),S(`nav`,{class:`agent-profile-tabs`,role:`tablist`,"aria-label":v(u)(`agentProfiles.profile`)},[(a(!0),s(p,null,r(J.value,e=>(a(),s(`button`,{id:`agent-tab-${e.id}`,key:e.id,class:`agent-profile-tab`,type:`button`,role:`tab`,"aria-selected":q.value===e.id,"aria-controls":`agent-panel-${e.id}`,tabindex:q.value===e.id?0:-1,onClick:t=>zt(e.id),onKeydown:t=>Bt(t,J.value.findIndex(t=>t.id===e.id))},g(e.label),41,ke))),128))],8,Oe),G.value?(a(),s(`p`,Ae,g(v(u)(`agentProfiles.partial`)),1)):x(``,!0),l(S(`section`,{id:`agent-panel-overview`,class:`agent-profile-panel`,role:`tabpanel`,"aria-labelledby":`agent-tab-overview`,"aria-hidden":q.value!==`overview`,tabindex:`0`},[S(`div`,Me,[S(`section`,Ne,[S(`div`,Pe,[S(`h2`,null,g(v(u)(`agentProfiles.working`)),1),X.value.length?(a(),s(`span`,Fe,g(X.value.length),1)):x(``,!0)]),X.value.length?(a(),s(`ul`,Ie,[(a(!0),s(p,null,r(X.value,e=>(a(),s(`li`,{key:e.taskId},[c(v(O),{to:{path:`/project-agents/manage`,query:{agent:R.value.agentId,task:e.taskId}}},{default:n(()=>[b(g(e.title),1)]),_:2},1032,[`to`]),S(`span`,Le,g(v(u)(`projectAgents.taskStatus.${e.status}`)),1)]))),128))])):!W.value&&!G.value?(a(),s(`p`,Re,g(v(u)(`agentProfiles.idle`)),1)):W.value?x(``,!0):(a(),s(`p`,ze,g(v(u)(`agentProfiles.partial`)),1))]),S(`section`,Be,[S(`div`,Ve,[S(`h2`,null,g(v(u)(`agentProfiles.projects`)),1),S(`span`,null,g(Y.value.length),1)]),S(`ul`,He,[(a(!0),s(p,null,r(Nt.value,e=>(a(),s(`li`,{key:e,class:`agent-project-item`},[S(`h3`,null,[c(v(O),{class:`agent-project-link`,to:v(I)(w.value,`graph`,e)},{default:n(()=>[b(g(z(e)),1)]),_:2},1032,[`to`])]),$(e)?(a(),s(`p`,Ue,g($(e)),1)):x(``,!0)]))),128))]),Pt.value.length?(a(),d(A,{key:0,class:`agent-project-overflow`,title:It.value},{default:n(()=>[S(`ul`,We,[(a(!0),s(p,null,r(Pt.value,e=>(a(),s(`li`,{key:e,class:`agent-project-item`},[S(`h3`,null,[c(v(O),{class:`agent-project-link`,to:v(I)(w.value,`graph`,e)},{default:n(()=>[b(g(z(e)),1)]),_:2},1032,[`to`])]),$(e)?(a(),s(`p`,Ge,g($(e)),1)):x(``,!0)]))),128))])]),_:1},8,[`title`])):x(``,!0),!W.value&&!Y.value.length?(a(),s(`p`,Ke,g(v(u)(`agentProfiles.noProject`)),1)):x(``,!0)])])],8,je),[[_,q.value===`overview`]]),l(S(`section`,{id:`agent-panel-history`,class:`agent-profile-panel`,role:`tabpanel`,"aria-labelledby":`agent-tab-history`,"aria-hidden":q.value!==`history`,tabindex:`0`},[S(`section`,Je,[S(`h2`,null,g(v(u)(`agentProfiles.projects`)),1),Ft.value.length?(a(),s(`details`,Ye,[S(`summary`,null,g(v(u)(`agentProfiles.projectHistory`)),1),S(`ul`,Xe,[(a(!0),s(p,null,r(Ft.value,e=>(a(),s(`li`,{key:e.assignmentId},[S(`h3`,null,[c(v(O),{class:`agent-project-link`,to:v(I)(w.value,`graph`,e.personalProjectId)},{default:n(()=>[b(g(z(e.personalProjectId)),1)]),_:2},1032,[`to`])]),S(`p`,null,g(e.responsibility),1),S(`small`,null,g(Q(e.assignedAt))+` – `+g(Q(e.endedAt)),1)]))),128))])])):W.value?x(``,!0):(a(),s(`p`,Ze,g(v(u)(`agentProfiles.noProject`)),1))]),S(`section`,Qe,[S(`h2`,null,g(v(u)(`agentProfiles.experience`)),1),S(`p`,$e,g(v(u)(`agentProfiles.recent`)),1),S(`ol`,et,[(a(!0),s(p,null,r(V.value.slice(0,12),e=>(a(),s(`li`,{key:e.taskId},[S(`div`,tt,[c(v(O),{to:{path:`/project-agents/manage`,query:{agent:R.value.agentId,task:e.taskId}}},{default:n(()=>[b(g(e.title),1)]),_:2},1032,[`to`]),S(`span`,null,g(v(u)(`projectAgents.taskStatus.${e.status}`)),1)]),e.resultSummary?(a(),s(`p`,nt,g(e.resultSummary),1)):x(``,!0),S(`small`,null,g(Q(e.completedAt||e.updatedAt||e.createdAt)),1)]))),128)),R.value.recruitedAt||R.value.recruitmentReason?(a(),s(`li`,rt,[S(`h3`,null,g(v(u)(`agentProfiles.recruitment`)),1),R.value.recruitmentReason?(a(),s(`p`,it,g(R.value.recruitmentReason),1)):x(``,!0),S(`small`,null,g(Q(R.value.recruitedAt)),1)])):x(``,!0)]),!W.value&&!V.value.length&&!R.value.recruitmentReason&&!R.value.recruitedAt?(a(),s(`p`,at,g(v(u)(`agentProfiles.noExperience`)),1)):x(``,!0)])],8,qe),[[_,q.value===`history`]]),l(S(`section`,{id:`agent-panel-style`,class:`agent-profile-panel`,role:`tabpanel`,"aria-labelledby":`agent-tab-style`,"aria-hidden":q.value!==`style`,tabindex:`0`},[S(`section`,st,[S(`h2`,null,g(v(u)(`agentProfiles.about`)),1),S(`div`,ct,[(a(),s(p,null,r([`judgment`,`taste`,`personality`],e=>S(`div`,{key:e},[S(`h3`,null,g(v(u)(`agentProfiles.${e}`)),1),S(`p`,{class:ee({"agent-muted":!R.value.profile.character?.[e]})},g(R.value.profile.character?.[e]||v(u)(`agentProfiles.characterEmpty`)),3)])),64))]),R.value.profile.expectations?(a(),s(`p`,lt,[S(`strong`,null,g(v(u)(`agentProfiles.expectations`)),1),b(` `+g(R.value.profile.expectations),1)])):x(``,!0),S(`div`,ut,[S(`h3`,null,g(v(u)(`agentProfiles.strengths`)),1),S(`div`,dt,[(a(!0),s(p,null,r(R.value.profile.capabilities,e=>(a(),s(`span`,{key:e},g(e),1))),128)),R.value.profile.capabilities.length?x(``,!0):(a(),s(`span`,ft,g(v(u)(`agentProfiles.noSkills`)),1))])])])],8,ot),[[_,q.value===`style`]]),l(S(`section`,{id:`agent-panel-collaborators`,class:`agent-profile-panel`,role:`tabpanel`,"aria-labelledby":`agent-tab-collaborators`,"aria-hidden":q.value!==`collaborators`,tabindex:`0`},[S(`section`,mt,[S(`div`,ht,[S(`h2`,null,g(v(u)(`agentProfiles.organization`)),1),c(v(O),{to:{path:`/employees/bole`,query:{q:v(N)(R.value)}}},{default:n(()=>[b(g(v(u)(`agentProfiles.hr`)),1)]),_:1},8,[`to`])]),(a(!0),s(p,null,r(U.value,e=>(a(),s(`div`,{key:e.projectId,class:`agent-organization`},[S(`h3`,null,g(z(e.projectId)),1),e.error?(a(),s(`p`,gt,g(v(u)(`agentProfiles.teamUnavailable`)),1)):e.policy?.teamLeadAgentId||e.policy?.teamMemberAgentIds?.length?(a(),s(p,{key:1},[e.policy.teamLeadAgentId?(a(),s(`div`,_t,[S(`span`,null,g(v(u)(`agentProfiles.lead`)),1),c(ie,{"space-id":w.value,"agent-id":e.policy.teamLeadAgentId,name:B(e.policy.teamLeadAgentId)},null,8,[`space-id`,`agent-id`,`name`])])):x(``,!0),e.policy.teamLeadAgentId?(a(),s(`p`,vt,g(v(u)(`agentProfiles.reporting`)),1)):x(``,!0),e.policy.teamMemberAgentIds?.length?(a(),s(`div`,yt,[S(`span`,null,g(v(u)(`agentProfiles.teammates`)),1),S(`ul`,null,[(a(!0),s(p,null,r([...new Set(e.policy.teamMemberAgentIds)].filter(t=>t!==e.policy?.teamLeadAgentId),e=>(a(),s(`li`,{key:e},[c(ie,{"space-id":w.value,"agent-id":e,name:B(e)},null,8,[`space-id`,`agent-id`,`name`])]))),128))])])):x(``,!0)],64)):(a(),s(`p`,bt,g(v(u)(`agentProfiles.teamUnset`)),1))]))),128)),!W.value&&!U.value.length?(a(),s(`p`,xt,g(v(u)(`agentProfiles.noProject`)),1)):x(``,!0)]),S(`section`,St,[S(`h2`,null,g(v(u)(`agentProfiles.collaborators`)),1),S(`ul`,Ct,[(a(!0),s(p,null,r(Mt.value,e=>(a(),s(`li`,{key:e.agentId},[c(ie,{"space-id":w.value,"agent-id":e.agentId,name:B(e.agentId)},null,8,[`space-id`,`agent-id`,`name`]),S(`span`,null,g(v(u)(`agentProfiles.sharedTasks`,{count:e.count})),1)]))),128))]),!W.value&&!Mt.value.length?(a(),s(`p`,wt,g(v(u)(`agentProfiles.noCollaborators`)),1)):x(``,!0)])],8,pt),[[_,q.value===`collaborators`]]),R.value.memoryScope===`reviewed_agent`?l((a(),s(`section`,{key:5,id:`agent-panel-conversations`,class:`agent-profile-panel`,role:`tabpanel`,"aria-labelledby":`agent-tab-conversations`,"aria-hidden":q.value!==`conversations`,tabindex:`0`},[S(`section`,Et,[(a(),d(ae,{key:R.value.agentId,"personal-space-id":w.value,"agent-id":R.value.agentId,projects:me.value},null,8,[`personal-space-id`,`agent-id`,`projects`]))])],8,Tt)),[[_,q.value===`conversations`]]):x(``,!0),l(S(`section`,{id:`agent-panel-management`,class:`agent-profile-panel`,role:`tabpanel`,"aria-labelledby":`agent-tab-management`,"aria-hidden":q.value!==`management`,tabindex:`0`},[S(`section`,Ot,[S(`h2`,null,g(v(u)(`agentProfiles.advanced`)),1),S(`p`,kt,g(v(u)(`agentProfiles.locked`)),1),S(`div`,At,[Z.value?(a(),d(v(O),{key:0,class:`quiet-button`,to:`/employees/${encodeURIComponent(Z.value.id)}`},{default:n(()=>[b(g(v(u)(`agentProfiles.workbench`)),1)]),_:1},8,[`to`])):x(``,!0),c(v(O),{class:`quiet-button`,to:{path:`/project-agents/manage`,query:{agent:R.value.agentId}}},{default:n(()=>[b(g(v(u)(`agentProfiles.advanced`)),1)]),_:1},8,[`to`])])])],8,Dt),[[_,q.value===`management`]]),S(`footer`,jt,[Z.value?(a(),d(v(O),{key:0,to:`/employees/${encodeURIComponent(Z.value.id)}`},{default:n(()=>[b(g(v(u)(`agentProfiles.workbench`)),1)]),_:1},8,[`to`])):x(``,!0),c(v(O),{to:{path:`/project-agents/manage`,query:{agent:R.value.agentId}}},{default:n(()=>[b(g(v(u)(`agentProfiles.advanced`)),1)]),_:1},8,[`to`])])],64)):(a(),s(`p`,ve,g(v(u)(`agentProfiles.unavailable`)),1))],8,ge))}});export{B as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{B as e,E as t,H as n,I as r,N as i,P as a,Q as o,S as s,T as c,U as l,a as u,b as d,f,g as p,h as m,it as h,ot as g,p as _,rt as v,v as y,w as b,x,y as S}from"./i18n-CVFhT_k7.js";import{t as C}from"./console-D7GHOMEC.js";import{n as w,o as T}from"./client-CR-W5Wzp.js";import{t as E}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{h as D,m as O}from"./useApi-CROJJdhE-BYhbjaZB.js";import{t as k}from"./vue-router-DaxrQwX3.js";import{t as A}from"./UiSelect-CMR0QqF6.js";import{t as j}from"./AgentHand-D_RafKOM.js";import{a as M,i as N,n as P,t as F}from"./profile-model-BQO4zNs9.js";import{a as I,o as ee,r as L}from"./agent-pins-BcJ_qr8n.js";import{n as R,t as z}from"./agent-work-summary-C-yW7x7A.js";import{a as B,s as te}from"./catalog-DbXv0_bR.js";/* empty css */import{t as ne}from"./ProjectAgentFirstTask-BcxqmKXQ.js";import{n as V,t as re}from"./EmployeeRecruitDialog-1QevD4Qv.js";var ie={class:`ui-card agent-card`},ae={class:`agent-card-topline`},oe={class:`agent-portrait small`,"aria-hidden":`true`},se={class:`agent-directory-name`},ce={key:0,class:`ui-badge fla-employee-number`},H={key:1,class:`ui-badge ui-badge--accent agent-card-role`},U=[`data-membership-status`],W=[`data-work-status`,`aria-label`],G=[`aria-label`,`aria-pressed`,`title`,`disabled`],K={key:1,viewBox:`0 0 24 24`,"aria-hidden":`true`,focusable:`false`},q={class:`agent-card-responsibility`},le={key:0,class:`agent-inline-skills`},J={class:`agent-card-meta`},Y={class:`agent-card-projects`},X={key:0,class:`agent-card-project-list`},ue={key:0,class:`ui-badge agent-card-project-count`},Z={key:1,class:`ui-badge`},Q={key:2,class:`agent-card-no-project`},de=E(t({__name:`AgentCard`,props:{agent:{},spaceId:{},projectNames:{},managesAllProjects:{type:Boolean},workSummary:{},workState:{},pinned:{type:Boolean},pinPending:{type:Boolean}},emits:[`toggle-pin`],setup(e,{emit:t}){let i=e,o=t,l=y(()=>F(i.agent)),f=y(()=>M(i.agent)),_=y(()=>f.value.slice(0,2).map(e=>i.projectNames?.[e]||e)),C=y(()=>Math.max(f.value.length-2,0)),w=y(()=>i.agent.profile.capabilities.slice(0,3)),E=y(()=>`is-${i.agent.profile.status}`),D=y(()=>u(`projectAgents.status.${i.agent.profile.status}`)),O=y(()=>i.workSummary?i.workSummary.status:i.workState===`loading`?`loading`:i.workState===`error`?`unavailable`:i.workState===`incomplete`?`unreported`:`none`),A=y(()=>`is-${O.value}`),N=y(()=>({coordinator:u(`agentProfiles.roles.projectManager`),hr:u(`agentProfiles.roles.hr`)})[i.agent.profile.agentType]??``);function I(e,t,n){let r=u(e,n);return r===e?t:r}let ee=y(()=>I(`agentRedesign.membershipStatus`,`Member · ${D.value}`,{status:D.value})),R=y(()=>{let e={awaiting_recruitment:`Awaiting recruitment`,queued:`Queued`,running:`Running`,paused:`Paused`,awaiting_review:`Awaiting review`,blocked:`Blocked`,none:u(`agentProfiles.idle`),loading:`Loading work status`,unreported:`Partial status`,unavailable:`Unavailable`}[O.value];return I(`agentRedesign.workStatus.${O.value}`,e??`Work status unavailable`)}),z=y(()=>i.pinPending?L(`saving`,`Saving Agent pin…`):i.pinned?L(`unpin`,`Unpin Agent`):L(`pin`,`Pin Agent`));function B(){o(`toggle-pin`,!i.pinned)}return(t,i)=>(a(),s(`article`,ie,[S(`div`,ae,[S(`span`,oe,g(e.agent.profile.occupationEmoji||l.value.slice(0,1)),1),S(`div`,se,[c(v(k),{to:v(P)(e.spaceId,e.agent.agentId),"aria-label":`${l.value} · ${v(u)(`agentProfiles.profile`)}`},{default:n(()=>[b(g(l.value),1)]),_:1},8,[`to`,`aria-label`]),e.agent.employeeNumber?(a(),s(`span`,ce,`FLA `+g(e.agent.employeeNumber),1)):x(``,!0),N.value?(a(),s(`span`,H,g(N.value),1)):x(``,!0),c(j,{"agent-id":e.agent.agentId},null,8,[`agent-id`])]),e.agent.profile.status===`active`?x(``,!0):(a(),s(`span`,{key:0,class:h([`ui-badge agent-card-status agent-card-membership-status`,E.value]),"data-membership-status":e.agent.profile.status},g(ee.value),11,U)),e.agent.profile.status===`active`||![`none`,`loading`].includes(O.value)?(a(),s(`span`,{key:1,class:h([`agent-card-work-status`,A.value]),"data-work-status":O.value,"aria-label":`${v(u)(`agentRedesign.workStatus.label`)} · ${R.value}`},g(R.value),11,W)):x(``,!0),S(`button`,{class:`agent-card-pin quiet-button`,"data-agent-pin-toggle":``,type:`button`,"aria-label":z.value,"aria-pressed":!!e.pinned,title:z.value,disabled:e.pinPending,onClick:m(B,[`stop`])},[e.pinPending?(a(),d(T,{key:0,variant:`inline`,label:z.value},null,8,[`label`])):(a(),s(`svg`,K,[...i[0]||=[S(`path`,{d:`m8 4 8 8m-9.5-6.5 9 9m-9-9L4 9l4.5 1.5L12 14l-1.5 4.5L12 20l2-5 4.5-3.5L20 10l-4.5-1.5L14 4.5 12 3z`},null,-1)]]))],8,G)]),S(`p`,q,g(e.agent.profile.responsibility),1),w.value.length?(a(),s(`div`,le,[(a(!0),s(p,null,r(w.value,e=>(a(),s(`span`,{key:e},g(e),1))),128))])):x(``,!0),S(`div`,J,[S(`div`,Y,[_.value.length?(a(),s(`div`,X,[(a(!0),s(p,null,r(_.value,e=>(a(),s(`span`,{key:e,class:`ui-badge`},g(e),1))),128)),C.value?(a(),s(`span`,ue,` +`+g(C.value),1)):x(``,!0)])):e.managesAllProjects?(a(),s(`span`,Z,g(v(u)(`agentProfiles.allProjects`)),1)):(a(),s(`span`,Q,g(v(u)(`agentProfiles.noProject`)),1))]),c(v(k),{class:`agent-directory-open`,to:v(P)(e.spaceId,e.agent.agentId),"aria-label":`${l.value} · ${v(u)(`agentProfiles.profile`)}`},{default:n(()=>[b(g(v(u)(`agentProfiles.profile`))+` → `,1)]),_:1},8,[`to`,`aria-label`])])]))}}),[[`__scopeId`,`data-v-c836383e`]]);function fe(t){let n=o({}),r=o(!1),i=o(``),a=o(`idle`),s=new Map,c=0;async function l(){let e=++c,o=t.value;if(i.value=``,!o){n.value={},r.value=!1,a.value=`idle`;return}let l=s.get(o);l?n.value=l:Object.keys(n.value).length&&(n.value={}),r.value=!0,a.value=`loading`;try{let r=await w(`/api/project-agent-tasks?${new URLSearchParams({personalSpaceId:o,limit:`200`})}`);if(e!==c||t.value!==o)return;let i=R(r,o);s.set(o,i),n.value=i,a.value=z(r)?`ready`:`incomplete`}catch(n){if(e!==c||t.value!==o)return;i.value=n instanceof Error?n.message:u(`agentProfiles.loadError`),a.value=`error`}finally{e===c&&t.value===o&&(r.value=!1)}}return e(t,l,{immediate:!0}),{summaries:n,loading:r,error:i,state:a,load:l}}var pe=[`src`],me=E(t({__name:`EmployeeWorkbenchLinks`,props:{personalSpaceId:{}},setup(t){let i=t;e(()=>i.personalSpaceId,e=>{te(e===`current`?``:e)},{immediate:!0});let o=y(()=>B.value.filter(e=>e.agentId&&e.agentStatus===`active`&&(e.runtime||e.workbench?.kind===`native`)));return(e,t)=>(a(!0),s(p,null,r(o.value,e=>(a(),d(v(k),{key:e.id,class:`ui-button employee-workbench-link`,to:`/employees/${encodeURIComponent(e.id)}`,title:v(u)(`agentProfiles.workbench`)},{default:n(()=>[v(V)(e.id)?(a(),s(`img`,{key:0,src:v(V)(e.id),alt:``,"aria-hidden":`true`},null,8,pe)):x(``,!0),b(` `+g(e.name)+` · `+g(e.role),1)]),_:2},1032,[`to`,`title`]))),128))}}),[[`__scopeId`,`data-v-4906fde1`]]),he=[`aria-label`],ge={class:`ui-toolbar agents-directory-heading`},_e={key:0,class:`agents-directory-count`},ve={key:1,class:`agents-directory-count`,"aria-hidden":`true`},ye={class:`agent-profile-actions`},be=[`disabled`],xe={key:0,class:`agent-directory-pin-error`,role:`alert`},Se={key:2,class:`agent-directory-work-error`,role:`status`},Ce={class:`ui-toolbar agents-directory-filters`},we={class:`agents-directory-search`},Te={class:`sr-only`},Ee=[`placeholder`],De={key:4,role:`alert`,class:`ui-card ui-empty agent-profile-empty`},Oe={key:5,class:`ui-card ui-empty agent-profile-empty`},ke={key:6,class:`agents-directory-grid`},$=E(t({__name:`AgentsDirectoryPage`,setup(t){let n=C(),m=O(),h=D(),b=y(()=>n.activePersonalSpace?.id??``),{agents:w,loading:E,error:k,load:j}=ee(b),R=I(b),z=R.agentIds,te=R.savingAgentId,V=R.error,ie=y(()=>L(`retry`,`Retry`)),{summaries:ae,loading:oe,error:se,state:ce,load:H}=fe(b),U=o(typeof m.query.q==`string`?m.query.q:``),W=o(`all`),G=o(typeof m.query.project==`string`?[m.query.project]:[]),K=o(!1),q=y(()=>B.value.some(e=>!e.fixed)),le=e=>B.value.some(t=>t.agentId===e&&t.management?.mode===`all`),J=y(()=>(n.state?.personalProjects??[]).filter(e=>e.personal_space_id===b.value)),Y=y(()=>J.value.map(e=>({value:e.project_id,label:e.profile.name}))),X=y(()=>Object.fromEntries(Y.value.map(e=>[e.value,e.label]))),ue=y(()=>[{value:`all`,label:u(`agentProfiles.allStatus`)},...[`active`,`inactive`,`archived`].map(e=>({value:e,label:u(`projectAgents.status.${e}`)}))]),Z=y(()=>w.value.filter(e=>(W.value===`all`||e.profile.status===W.value)&&(!G.value.length||M(e).some(e=>G.value.includes(e)))&&N([F(e),e.employeeNumber?`FLA ${e.employeeNumber}`:``,e.profile.responsibility,...e.profile.capabilities,...M(e).map(e=>X.value[e]||e)].join(` `),U.value)).sort((e,t)=>F(e).localeCompare(F(t)))),Q=y(()=>E.value||oe.value||n.runtimeStatus===`loading`),pe=e=>ae.value[e];async function $(e,t){await R.setPinned(e,t)}i(()=>{n.runtimeStatus===`idle`&&n.refresh()}),e([b,()=>m.query.agent],([e,t])=>{if(e&&typeof t==`string`){let{agent:n,...r}=m.query;h.replace({path:typeof m.query.task==`string`?`/project-agents/manage`:P(e,t),query:typeof m.query.task==`string`?m.query:r})}},{immediate:!0}),e(b,(e,t)=>{t&&(U.value=``,G.value=[],W.value=`all`)});async function Ae(e){K.value=!1,await h.push(P(b.value,e.agent.agentId))}async function je(){if(n.state){await Promise.allSettled([j(),H()]);return}await n.refresh(),await Promise.allSettled([j(),H()])}return(e,t)=>(a(),s(`section`,{class:`view agents-directory`,"aria-label":v(u)(`agentProfiles.title`)},[S(`header`,ge,[!Q.value||v(w).length?(a(),s(`p`,_e,g(v(u)(`agentProfiles.members`,{count:v(w).length})),1)):(a(),s(`span`,ve,`\xA0`)),S(`div`,ye,[Q.value&&v(w).length?(a(),d(T,{key:0,variant:`inline`,label:v(u)(`agentRedesign.refreshing`)},null,8,[`label`])):x(``,!0),c(me,{"personal-space-id":b.value||`current`},null,8,[`personal-space-id`]),q.value?(a(),s(`button`,{key:1,type:`button`,class:`primary-button`,disabled:!b.value,onClick:t[0]||=e=>K.value=!0},g(v(u)(`employees.recruit`)),9,be)):x(``,!0)])]),v(V)?(a(),s(`p`,xe,[S(`span`,null,g(v(V)),1),S(`button`,{class:`quiet-button`,type:`button`,onClick:t[1]||=e=>v(R).load({force:!0})},g(ie.value),1)])):x(``,!0),!Q.value&&!v(k)&&v(n).runtimeStatus===`ready`&&!J.value.length?(a(),d(ne,{key:1,"personal-space-id":b.value},null,8,[`personal-space-id`])):x(``,!0),v(se)?(a(),s(`p`,Se,[S(`span`,null,g(v(u)(`agentRedesign.workStatus.refreshError`)),1),S(`button`,{class:`quiet-button`,type:`button`,onClick:t[2]||=(...e)=>v(H)&&v(H)(...e)},g(v(u)(`agentProfiles.retry`)),1)])):x(``,!0),S(`div`,Ce,[S(`label`,we,[S(`span`,Te,g(v(u)(`agentProfiles.search`)),1),l(S(`input`,{"onUpdate:modelValue":t[3]||=e=>U.value=e,type:`search`,maxlength:`160`,placeholder:v(u)(`agentProfiles.search`)},null,8,Ee),[[f,U.value]])]),c(A,{modelValue:G.value,"onUpdate:modelValue":t[4]||=e=>G.value=e,class:`agents-directory-select`,multiple:``,options:Y.value,label:v(u)(`employees.filterLabel`),placeholder:v(u)(`employees.allProjectsFilter`)},null,8,[`modelValue`,`options`,`label`,`placeholder`]),c(A,{modelValue:W.value,"onUpdate:modelValue":t[5]||=e=>W.value=e,class:`agents-directory-select`,options:ue.value,label:v(u)(`projectAgents.fields.status`)},null,8,[`modelValue`,`options`,`label`])]),Q.value&&!v(w).length?(a(),d(T,{key:3,label:v(u)(`agentProfiles.loading`)},null,8,[`label`])):x(``,!0),v(k)||v(n).runtimeStatus===`error`?l((a(),s(`div`,De,[S(`p`,null,g(v(k)||v(u)(`agentProfiles.loadError`)),1),S(`button`,{class:`quiet-button`,type:`button`,onClick:je},g(v(u)(`agentProfiles.retry`)),1)],512)),[[_,!Q.value||v(w).length===0]]):x(``,!0),!Q.value&&!Z.value.length&&!v(k)&&v(n).runtimeStatus!==`error`?(a(),s(`p`,Oe,g(v(u)(v(w).length?`agentProfiles.noMatch`:`agentProfiles.noAgents`)),1)):x(``,!0),Z.value.length?(a(),s(`ul`,ke,[(a(!0),s(p,null,r(Z.value,e=>(a(),s(`li`,{key:e.agentId},[c(de,{agent:e,"space-id":b.value,"project-names":X.value,"manages-all-projects":le(e.agentId),"work-summary":pe(e.agentId),"work-state":v(ce),pinned:v(z).includes(e.agentId),"pin-pending":v(te)===e.agentId,onTogglePin:t=>$(e.agentId,t)},null,8,[`agent`,`space-id`,`project-names`,`manages-all-projects`,`work-summary`,`work-state`,`pinned`,`pin-pending`,`onTogglePin`])]))),128))])):x(``,!0),c(re,{open:K.value,"personal-space-id":b.value,projects:J.value,"default-project-ids":G.value??[],onClose:t[6]||=e=>K.value=!1,onRecruited:Ae},null,8,[`open`,`personal-space-id`,`projects`,`default-project-ids`])],8,he))}}),[[`__scopeId`,`data-v-56bb6321`]]);export{$ as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.agent-card-pin[data-v-c836383e]{width:var(--control-height-sm);min-height:var(--control-height-sm);color:var(--color-muted);flex:none;padding:0}.agent-card-pin[data-v-c836383e]:hover:not(:disabled),.agent-card-pin[aria-pressed=true][data-v-c836383e]{color:var(--color-accent)}.agent-card-pin[aria-pressed=true][data-v-c836383e]{border-color:var(--color-accent-line);background:var(--color-accent-soft)}.agent-card-pin svg[data-v-c836383e]{fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.5px;width:16px;height:16px}.agent-card-pin[aria-pressed=true] svg[data-v-c836383e]{fill:currentColor;stroke:var(--color-on-accent)}.agent-card-pin[data-v-c836383e] .growth-loading--inline{justify-content:center;width:100%}.agent-card-pin[data-v-c836383e] .growth-loading__label{clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}.employee-workbench-link img[data-v-4906fde1]{object-fit:cover;border-radius:5px;width:18px;height:18px}.agent-directory-pin-error[data-v-56bb6321]{justify-content:space-between;align-items:center;gap:var(--space-3,12px);margin:calc(var(--space-6,24px) * -1) 0 var(--space-4,16px);color:var(--color-danger);font-size:13px;display:flex}.agent-directory-pin-error .quiet-button[data-v-56bb6321]{min-height:var(--control-height-sm);padding:4px 9px;font-size:12px}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{B as e,C as t,E as n,H as r,I as i,P as a,Q as o,S as s,T as c,a as l,b as u,g as d,it as ee,ot as f,rt as p,v as m,w as h,x as g,y as _}from"./i18n-CVFhT_k7.js";import{i as te,o as ne}from"./client-CR-W5Wzp.js";import{t as v}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as y,t as re}from"./UiDialog-CvDxg3B1.js";import{t as b}from"./vue-router-DaxrQwX3.js";import{t as x}from"./UiSelect-CMR0QqF6.js";import{n as ie}from"./paths-CDREouhi.js";import{a as ae,o as oe,r as se,s as ce}from"./catalog-DbXv0_bR.js";import{t as le}from"./ProjectScopePicker-yodM7lF_.js";var S={jefa:`/assets/jefa-avatar-Dew42td5.webp`,bole:`/assets/bole-avatar-CVIr-bU_.webp`};function C(e){return S[e]}var ue={key:1,role:`alert`,class:`ui-dialog__error employee-message`},de={key:2,class:`ui-muted`},fe={class:`employee-profile`},pe={class:`employee-avatar`,"aria-hidden":`true`},me=[`src`],he={class:`ui-meta`},ge={key:2,class:`employee-scope`},_e=[`aria-label`],ve=[`data-scope`,`aria-checked`,`tabindex`,`disabled`,`onClick`],ye={class:`ui-meta`,role:`status`},be={key:3,class:`ui-meta`},xe={key:4,class:`ui-meta`},Se={key:5,class:`ui-meta`},Ce=[`aria-label`],we={class:`employee-title-controls`},Te={class:`ui-meta`},Ee={class:`employee-title-example`},De={class:`ui-meta`},Oe=[`aria-label`],ke={class:`ui-meta`},Ae={key:8,class:`ui-dialog__error`,role:`alert`},je={key:10,class:`employee-success`,role:`status`},w=v(n({__name:`EmployeeRecruitDialog`,props:{open:{type:Boolean},personalSpaceId:{},projects:{},defaultProjectId:{},defaultProjectIds:{},templateId:{}},emits:[`close`,`recruited`],setup(n,{emit:v}){let S=n,w=v,T=o([]),E=o([]),D=o(`selected`),O=o([]),k=o(`auto`),A=o(`emoji`),Me=o(``),j=o(``),M=o(!1),N=o(!1),P=o(``),F=o(!1),I=o(``),L=o(null),R=o([]),z=o(``),B=m(()=>S.templateId?R.value:R.value.filter(e=>!e.fixed)),V=m(()=>S.templateId?B.value.find(e=>e.id===S.templateId):B.value.find(e=>e.id===P.value)??B.value[0]),Ne=m({get:()=>V.value?.id??``,set:e=>{P.value=e}}),Pe=m(()=>V.value?.agentId?l(`employees.manageProjectsTitle`,{name:V.value.name}):l(`employees.recruit`)),H=m(()=>S.projects.filter(e=>e.profile.lifecycle!==`archived`).map(e=>({id:e.project_id,name:e.profile.name}))),U=m(()=>V.value?.management!==void 0),W=m({get:()=>D.value===`all`?H.value.filter(e=>!O.value.includes(e.id)).map(e=>e.id):T.value,set:e=>{if(D.value===`all`){let t=new Set(H.value.map(e=>e.id));O.value=[...O.value.filter(e=>!t.has(e)),...H.value.filter(t=>!e.includes(t.id)).map(e=>e.id)]}else T.value=e}}),G=m(()=>({mode:D.value,projectIds:D.value===`selected`?[...T.value].sort():[],excludedProjectIds:D.value===`all`?[...O.value].sort():[],titleMode:k.value,titleStyle:A.value})),Fe=m(()=>[`auto`,`suggest`,`off`].map(e=>({value:e,label:l(`employees.titles.${e}`)}))),Ie=m(()=>[`emoji`,`text`].map(e=>({value:e,label:l(`employees.titles.${e}`)}))),K=m(()=>new Set(E.value)),Le=m(()=>[...K.value].filter(e=>!W.value.includes(e))),Re=m(()=>!!(V.value?.agentStatus&&V.value.agentStatus!==`active`)),q=m(()=>V.value?.agentStatus===`active`&&(U.value?JSON.stringify(G.value)===Me.value&&(D.value===`all`||T.value.length===K.value.size&&T.value.every(e=>K.value.has(e))):T.value.length===K.value.size&&T.value.every(e=>K.value.has(e)))),ze=m(()=>F.value?l(`employees.recruiting`):Re.value?l(`employees.rehire`,{name:V.value?.name??``}):q.value||V.value?.agentId?l(`employees.assign`):l(`employees.recruitName`,{name:V.value?.name??``})),J=m(()=>V.value&&W.value.length?`/employees/${encodeURIComponent(V.value.id)}?project=${encodeURIComponent(W.value[0])}`:``),Y=0;e([()=>S.open,()=>S.personalSpaceId,()=>S.templateId],([e])=>{Y+=1,e&&Z(!0)},{immediate:!0}),e(P,()=>{S.open&&!M.value&&X(!0)}),e(G,()=>{I.value=N.value?I.value:``,L.value=null},{flush:`sync`});function X(e=!1){let t=new Set(H.value.map(e=>e.id));E.value=[...new Set((V.value?.assignments??[]).filter(e=>e.status===`active`&&t.has(e.personalProjectId)).map(e=>e.personalProjectId))];let n=e&&!V.value?.agentId?S.defaultProjectIds??(S.defaultProjectId?[S.defaultProjectId]:[]):[];T.value=[...new Set([...E.value,...n.filter(e=>t.has(e))])];let r=V.value?.management;D.value=r?.mode??`selected`,O.value=[...r?.excludedProjectIds??[]],k.value=r?.titleMode??`auto`,A.value=r?.titleStyle??`emoji`,r?.mode===`selected`&&V.value?.agentId&&(T.value=r.projectIds.filter(e=>t.has(e))),r?.mode===`all`&&V.value?.agentId&&(E.value=[...W.value]),Me.value=JSON.stringify(G.value),j.value=V.value?.assignmentsVersion??``,N.value=!1,I.value=``,L.value=null}async function Z(e=!1){let t=++Y;M.value=!0,R.value=[],z.value=``;try{let n=await oe(S.personalSpaceId);if(t!==Y||!S.open)return;R.value=n,X(e)}catch(e){t===Y&&S.open&&(R.value=[],z.value=se(e))}finally{t===Y&&(M.value=!1)}}function Q(){F.value||w(`close`)}async function Be(){if(!V.value||V.value.identityConflict||!S.personalSpaceId||F.value||M.value||N.value||!j.value||q.value)return;F.value=!0,I.value=``;let e=V.value.id;try{let t=await te(`/api/employee-templates/${encodeURIComponent(e)}/recruit`,{personalSpaceId:S.personalSpaceId,...U.value?{management:G.value}:{personalProjectIds:[...T.value]},replaceAssignments:!0,expectedAssignmentsVersion:j.value,...Re.value?{reactivate:!0}:{}});await ce(S.personalSpaceId),R.value=[...ae.value],X(),L.value=t,w(`recruited`,t)}catch(e){I.value=se(e);try{let t=JSON.parse(e instanceof Error?e.message:``);N.value=t.code===`assignment_scope_conflict`||t.code===`assignment_update_incomplete`}catch{}}finally{F.value=!1}}function $(e){e===`selected`&&(T.value=[...W.value]),D.value=e}function Ve(e){if(!(F.value||M.value||N.value)&&[`ArrowLeft`,`ArrowRight`,`Home`,`End`].includes(e.key)){e.preventDefault();let t=e.key===`Home`?`all`:e.key===`End`||D.value===`all`?`selected`:`all`;$(t),e.currentTarget.querySelector(`[data-scope="${t}"]`)?.focus()}}return(e,o)=>(a(),u(re,{open:n.open,class:`employee-recruit-dialog`,title:Pe.value,busy:F.value,form:``,onClose:Q,onSubmit:Be},t({default:r(()=>[M.value&&!B.value.length?(a(),u(ne,{key:0,variant:`compact`,label:p(l)(`employees.loading`)},null,8,[`label`])):z.value?(a(),s(`div`,ue,[_(`p`,null,f(z.value),1),c(y,{size:`sm`,onClick:o[0]||=e=>Z(!0)},{default:r(()=>[h(f(p(l)(`employees.retry`)),1)]),_:1})])):V.value?(a(),s(d,{key:3},[B.value.length>1&&!S.templateId?(a(),u(x,{key:0,modelValue:Ne.value,"onUpdate:modelValue":o[1]||=e=>Ne.value=e,field:``,"control-id":`employee-template`,label:p(l)(`employees.choose`),options:B.value.map(e=>({value:e.id,label:e.name,meta:e.role})),disabled:F.value||M.value},null,8,[`modelValue`,`label`,`options`,`disabled`])):g(``,!0),_(`div`,fe,[_(`span`,pe,[p(C)(V.value.id)?(a(),s(`img`,{key:0,src:p(C)(V.value.id),alt:``},null,8,me)):(a(),s(d,{key:1},[h(f(V.value.name.slice(0,1)),1)],64))]),_(`div`,null,[_(`h3`,null,[h(f(V.value.name)+` `,1),_(`span`,null,f(V.value.role),1)]),_(`p`,null,f(V.value.description),1),_(`p`,he,f(V.value.capabilities.join(` · `)),1)])]),M.value?(a(),u(ne,{key:1,variant:`compact`,label:p(l)(`employees.loadingScope`)},null,8,[`label`])):g(``,!0),U.value?(a(),s(`div`,ge,[_(`div`,{class:`ui-segmented`,role:`radiogroup`,"aria-label":p(l)(`employees.scope.rule`),onKeydown:Ve},[(a(),s(d,null,i([`all`,`selected`],e=>_(`button`,{key:e,type:`button`,role:`radio`,"data-scope":e,"aria-checked":D.value===e,tabindex:D.value===e?0:-1,disabled:F.value||M.value||N.value,onClick:t=>$(e)},f(p(l)(`employees.scope.${e===`all`?`continuousAll`:`onlySelected`}`)),9,ve)),64))],40,_e),_(`p`,ye,f(D.value===`all`?p(l)(`employees.scope.allHint`,{name:V.value.name}):p(l)(`employees.scope.selectedHint`)),1)])):g(``,!0),c(le,{modelValue:W.value,"onUpdate:modelValue":o[2]||=e=>W.value=e,projects:H.value,inline:``,hint:D.value===`all`?p(l)(`employees.scope.excludeHint`):void 0,disabled:F.value||M.value||N.value},null,8,[`modelValue`,`projects`,`hint`,`disabled`]),D.value===`all`&&O.value.length?(a(),s(`p`,be,f(p(l)(`employees.scope.excludedCount`,{count:O.value.length})),1)):g(``,!0),H.value.length?g(``,!0):(a(),s(`p`,xe,[h(f(p(l)(`employees.noProjects`))+` `,1),c(p(b),{to:p(ie)(n.personalSpaceId,`directory`),onClick:Q},{default:r(()=>[h(f(p(l)(`employees.createProject`)),1)]),_:1},8,[`to`])])),Le.value.length&&!L.value?(a(),s(`p`,Se,f(p(l)(`employees.scopeRemoved`,{count:Le.value.length})),1)):g(``,!0),U.value&&V.value.permissions.includes(`session.title`)?(a(),s(`section`,{key:6,class:`employee-title-settings`,"aria-label":p(l)(`employees.titles.heading`)},[_(`h3`,null,f(p(l)(`employees.titles.heading`)),1),_(`div`,we,[c(x,{modelValue:k.value,"onUpdate:modelValue":o[3]||=e=>k.value=e,field:``,"control-id":`employee-title-mode`,label:p(l)(`employees.titles.mode`),options:Fe.value,disabled:F.value||M.value||N.value},null,8,[`modelValue`,`label`,`options`,`disabled`]),c(x,{modelValue:A.value,"onUpdate:modelValue":o[4]||=e=>A.value=e,field:``,"control-id":`employee-title-style`,label:p(l)(`employees.titles.style`),options:Ie.value,disabled:F.value||M.value||N.value||k.value===`off`},null,8,[`modelValue`,`label`,`options`,`disabled`])]),_(`p`,Te,[h(f(p(l)(`employees.titles.example`))+` `,1),_(`span`,Ee,`【P1|`+f(A.value===`emoji`?`🔧 `:``)+`FIX|`+f(p(l)(`employees.titles.exampleTask`))+`】`,1)]),_(`p`,De,f(p(l)(`employees.titles.boundary`)),1)],8,Ce)):g(``,!0),_(`section`,{class:`employee-permissions`,"aria-label":p(l)(`employees.permissions`)},[_(`strong`,null,f(p(l)(`employees.permissions`)),1),_(`ul`,null,[(a(!0),s(d,null,i(V.value.permissions,e=>(a(),s(`li`,{key:e},f(e===`board.read`?p(l)(`employees.boardRead`):e===`board.write`?p(l)(`employees.boardWrite`):e===`session.title`?p(l)(`employees.titles.heading`):e),1))),128))]),_(`p`,ke,f(p(l)(`employees.noExecutor`)),1)],8,Oe),V.value.runtime?(a(),s(`p`,{key:7,class:ee([`employee-runtime`,{"is-warning":V.value.runtimeStatus!==`ready`}])},f(V.value.runtimeStatus===`ready`?p(l)(`employees.hostReady`):p(l)(`employees.installRequired`)),3)):g(``,!0),I.value||V.value.identityConflict?(a(),s(`p`,Ae,f(I.value||p(l)(`employees.errors.identity_conflict`)),1)):g(``,!0),N.value?(a(),u(y,{key:9,size:`sm`,disabled:M.value,onClick:o[5]||=e=>Z()},{default:r(()=>[h(f(p(l)(`employees.reloadScope`)),1)]),_:1},8,[`disabled`])):g(``,!0),L.value?(a(),s(`div`,je,[_(`strong`,null,f(p(l)(`employees.scopeSaved`)),1),_(`p`,null,f(D.value===`all`?p(l)(`employees.scope.successAll`,{count:W.value.length}):W.value.length?p(l)(`employees.successMultiple`,{count:W.value.length}):p(l)(`employees.successUnassigned`)),1)])):g(``,!0)],64)):(a(),s(`p`,de,f(p(l)(`employees.noTemplates`)),1))]),_:2},[V.value&&!z.value?{name:`footer`,fn:r(()=>[c(y,{variant:`ghost`,disabled:F.value,onClick:Q},{default:r(()=>[h(f(p(l)(`employees.cancel`)),1)]),_:1},8,[`disabled`]),q.value&&J.value&&!F.value&&!M.value&&!N.value&&V.value.runtimeStatus===`ready`?(a(),u(p(b),{key:0,class:`ui-button ui-button--primary`,to:J.value,onClick:Q},{default:r(()=>[h(f(p(l)(`employees.open`)),1)]),_:1},8,[`to`])):(a(),u(y,{key:1,variant:`primary`,type:`submit`,busy:F.value,"busy-label":ze.value,disabled:M.value||N.value||!j.value||q.value||V.value.identityConflict||!n.personalSpaceId},{default:r(()=>[h(f(ze.value),1)]),_:1},8,[`busy`,`busy-label`,`disabled`]))]),key:`0`}:void 0]),1032,[`open`,`title`,`busy`]))}}),[[`__scopeId`,`data-v-4e6fb0a1`]]);export{C as n,w as t};
|