import type { CapabilityWorkspaceEntry } from './capability-workspace.js'; import type { ResolvedClawclawBehaviorSource } from '../runtime/clawclaw/plugins/behavior/behavior-source.js'; import type { ResolvedClawclawPerceptionSource } from '../runtime/clawclaw/plugins/perception/perception-source.js'; export function behaviorOperationName(source: T, entry: CapabilityWorkspaceEntry): T { return { ...source, id: entry.runtimeId, declaredId: source.declaredId ?? source.id, ...(entry.hub ? { resourceId: entry.hub.resourceId } : {}), display: { name: entry.title, description: entry.description }, workingCopyPath: source.workingCopyPath ?? source.sourcePath }; } export function perceptionOperationName(source: T, entry: CapabilityWorkspaceEntry): T { return { ...source, id: entry.runtimeId, declaredId: source.declaredId ?? source.id, display: { name: entry.title, description: entry.description }, workingCopyPath: source.workingCopyPath ?? source.sourcePath, manifest: { ...source.manifest, id: entry.runtimeId } }; }