spawn method

String spawn({
  1. required String request,
  2. String? conversationId,
  3. String? systemPrompt,
  4. String? allowedTools,
  5. bool yolo = true,
  6. String? model,
  7. bool headless = true,
})

Implementation

String spawn({
  required String request,
  String? conversationId,
  String? systemPrompt,
  String? allowedTools,
  bool yolo = true,
  String? model,
  bool headless = true,
}) {
  final pConversation = conversationId != null
      ? ' ${resume(conversationId)}'
      : '';
  final pSystemPrompt = systemPrompt != null
      ? ' ${this.systemPrompt(systemPrompt)}'
      : '';
  final pTools = allowedTools != null
      ? ' ${this.allowedTools(allowedTools)}'
      : '';
  final pYolo = '${yolo ? ' ${this.yolo}' : ''}';
  final pModel = model != null ? ' ${this.model(model)}' : '';
  final pHeadless = headless && this.headless != null
      ? ' ${this.headless}'
      : '';
  return '$command'
      '$pConversation'
      '$pSystemPrompt'
      '$pTools'
      '$pYolo'
      '$pModel'
      '$pHeadless'
      '$request';
}