INNER CODE UNIT · JavaScript

coordinatorOnly

fengshao1227/ccg-workflow · dsh-ccg/src/index.js:346

export function coordinatorOnly(text) {
  const resolve = typeof text === 'function' ? text : () => text
  return (assembly) => {
    const agent = assembly?.agent
    if (agent === undefined) return resolve(assembly)
    try {
      return delegationDepthOf(agent) > 0 ? '' : resolve(assembly)
    } catch {
      return resolve(assembly)
    }
  }
}

/**
 * Mount one official delegation tool per enabled role, then publish the
 * routing convention.
 *
 * @param ctx - plugin context.

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…