delimit-cli 4.0.6 → 4.1.1

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.
@@ -439,6 +439,39 @@ program
439
439
  });
440
440
  });
441
441
 
442
+ program
443
+ .command('think [question...]')
444
+ .description('Run multi-model deliberation on a question')
445
+ .action(async (questionParts) => {
446
+ const question = Array.isArray(questionParts) ? questionParts.join(' ').trim() : '';
447
+ if (!question) {
448
+ console.log(chalk.yellow('Usage: delimit think <question>'));
449
+ console.log(chalk.gray('Example: delimit think "Should we use REST or GraphQL for the new API?"'));
450
+ return;
451
+ }
452
+ console.log(chalk.blue('Deliberating...'));
453
+ console.log(chalk.gray(`Question: ${question}`));
454
+ try {
455
+ const result = execSync(
456
+ `python3 -c "import sys; sys.path.insert(0, '${continuityContext.serverDir}'); from ai.deliberation import deliberate; import json; r = deliberate(question='${question.replace(/'/g, "\\'")}'); print(json.dumps(r, indent=2))"`,
457
+ { encoding: 'utf-8', timeout: 120000, cwd: continuityContext.serverDir }
458
+ );
459
+ const parsed = JSON.parse(result);
460
+ if (parsed.error) {
461
+ console.log(chalk.red(`Error: ${parsed.error}`));
462
+ } else if (parsed.synthesis) {
463
+ console.log(chalk.green('\nConsensus:'));
464
+ console.log(parsed.synthesis);
465
+ if (parsed.verdict) console.log(chalk.blue(`\nVerdict: ${parsed.verdict}`));
466
+ if (parsed.confidence) console.log(chalk.gray(`Confidence: ${parsed.confidence}`));
467
+ } else {
468
+ console.log(JSON.stringify(parsed, null, 2));
469
+ }
470
+ } catch (e) {
471
+ console.log(chalk.red(`Deliberation failed: ${e.message}`));
472
+ }
473
+ });
474
+
442
475
  program
443
476
  .command('open [venture]')
444
477
  .description('Open a venture session without changing directories')
@@ -61,10 +61,6 @@ def dispatch_task(
61
61
  tools_needed: Optional[List[str]] = None,
62
62
  constraints: Optional[List[str]] = None,
63
63
  context: str = "",
64
- task_type: str = "",
65
- venture: str = "",
66
- variables: Optional[Dict[str, Any]] = None,
67
- external_key: str = "",
68
64
  ) -> Dict[str, Any]:
69
65
  """Create a tracked agent task.
70
66
 
@@ -82,23 +78,6 @@ def dispatch_task(
82
78
  if priority not in VALID_PRIORITIES:
83
79
  return {"error": f"priority must be one of: {', '.join(sorted(VALID_PRIORITIES))}"}
84
80
 
85
- tasks = _load_tasks()
86
-
87
- normalized_external_key = external_key.strip()
88
- if normalized_external_key:
89
- for existing in tasks.values():
90
- if existing.get("external_key") != normalized_external_key:
91
- continue
92
- if existing.get("status") in ("dispatched", "in_progress", "handed_off", "done"):
93
- prompt = _build_agent_prompt(existing)
94
- return {
95
- "status": "deduped",
96
- "task_id": existing["id"],
97
- "task": existing,
98
- "agent_prompt": prompt,
99
- "message": f"Task {existing['id']} already exists for {normalized_external_key}",
100
- }
101
-
102
81
  task_id = f"AGT-{uuid.uuid4().hex[:8].upper()}"
103
82
 
104
83
  task = {
@@ -110,10 +89,6 @@ def dispatch_task(
110
89
  "tools_needed": tools_needed or [],
111
90
  "constraints": constraints or [],
112
91
  "context": context.strip(),
113
- "task_type": task_type.strip(),
114
- "venture": venture.strip(),
115
- "variables": variables or {},
116
- "external_key": normalized_external_key,
117
92
  "status": "dispatched",
118
93
  "created_at": time.strftime("%Y-%m-%dT%H:%M:%SZ"),
119
94
  "updated_at": time.strftime("%Y-%m-%dT%H:%M:%SZ"),
@@ -122,6 +97,7 @@ def dispatch_task(
122
97
  "handoffs": [],
123
98
  }
124
99
 
100
+ tasks = _load_tasks()
125
101
  tasks[task_id] = task
126
102
  _save_tasks(tasks)
127
103
 
@@ -159,11 +135,6 @@ def _build_agent_prompt(task: Dict[str, Any]) -> str:
159
135
  if task.get("context"):
160
136
  lines.append(f"\n**Context:**\n{task['context']}")
161
137
 
162
- if task.get("variables"):
163
- lines.append("\n**Variables:**")
164
- for key, value in task["variables"].items():
165
- lines.append(f"- {key}: {value}")
166
-
167
138
  if task.get("tools_needed"):
168
139
  lines.append(f"\n**Tools needed:** {', '.join(task['tools_needed'])}")
169
140
 
@@ -476,10 +447,7 @@ def get_agent_dashboard() -> Dict[str, Any]:
476
447
  "tasks": [
477
448
  {"id": t["id"], "title": t["title"], "status": t["status"],
478
449
  "priority": t.get("priority", "P1"),
479
- "linked_ledger": t.get("linked_ledger_items", []),
480
- "task_type": t.get("task_type", ""),
481
- "venture": t.get("venture", ""),
482
- "variables": t.get("variables", {})}
450
+ "linked_ledger": t.get("linked_ledger_items", [])}
483
451
  for t in model_tasks
484
452
  ],
485
453
  }