pikiclaw 0.3.70 → 0.3.71

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/dist/bot/bot.js CHANGED
@@ -1886,12 +1886,40 @@ export class Bot {
1886
1886
  }
1887
1887
  switchEffortForChat(chatId, effort) {
1888
1888
  const cs = this.chat(chatId);
1889
- this.setEffortForAgent(cs.agent, effort);
1889
+ // "ultra" is a synthetic top rung in the effort picker, NOT a real --effort
1890
+ // value (the claude CLI rejects anything outside low|medium|high|xhigh|max).
1891
+ // It bundles "max reasoning depth + permit multi-agent Workflow
1892
+ // orchestration" — the same pairing as Claude's own `ultracode` mode. Decode
1893
+ // it here, the single apply choke point, so the rest of the pipeline only
1894
+ // ever sees a concrete effort value plus the orthogonal workflow flag.
1895
+ // Because the rungs are mutually exclusive, picking any concrete level also
1896
+ // clears the workflow opt-in (capability-gated — only claude advertises it).
1897
+ const ultra = effort === 'ultra';
1898
+ const realEffort = ultra ? 'max' : effort;
1899
+ this.setEffortForAgent(cs.agent, realEffort);
1890
1900
  const session = this.getSelectedSession(cs);
1891
1901
  if (session)
1892
- session.thinkingEffort = effort;
1893
- this.persistAgentPreference(cs.agent, 'effort', effort);
1894
- this.log(`effort switched to ${effort} for ${cs.agent} chat=${chatId}`);
1902
+ session.thinkingEffort = realEffort;
1903
+ this.persistAgentPreference(cs.agent, 'effort', realEffort);
1904
+ if (getDriverCapabilities(cs.agent).workflow) {
1905
+ this.setWorkflowEnabledForAgent(cs.agent, ultra);
1906
+ this.persistAgentPreference(cs.agent, 'workflow', ultra ? '1' : '0');
1907
+ }
1908
+ this.log(`effort switched to ${effort} (effort=${realEffort}, workflow=${ultra}) for ${cs.agent} chat=${chatId}`);
1909
+ }
1910
+ /**
1911
+ * Effort value to *display* in the picker. Workflow is orthogonal under the
1912
+ * hood, but the UI folds "max depth + workflow on" into the single synthetic
1913
+ * `ultra` rung (see {@link switchEffortForChat}), so report it as current when
1914
+ * the agent has orchestration enabled. Mirrors the decomposition above.
1915
+ */
1916
+ effortSelectionForAgent(agent) {
1917
+ const effort = this.effortForAgent(agent);
1918
+ if (!effort)
1919
+ return null;
1920
+ if (getDriverCapabilities(agent).workflow && this.workflowEnabledForAgent(agent))
1921
+ return 'ultra';
1922
+ return effort;
1895
1923
  }
1896
1924
  switchPermissionModeForChat(chatId, mode) {
1897
1925
  const cs = this.chat(chatId);
@@ -387,22 +387,20 @@ export function buildModeCommandView(bot, chatId) {
387
387
  ],
388
388
  ];
389
389
  const metaLines = [];
390
- if (!isClaude && !supportsWorkflow)
390
+ if (!isClaude)
391
391
  metaLines.push('Permission mode is only available for Claude.');
392
+ // Workflow orchestration is no longer a standalone toggle here — it folded
393
+ // into the effort picker as the top "Ultra" rung (max depth + multi-agent
394
+ // fan-out). Surface its state and point users to /models so the capability
395
+ // stays discoverable.
392
396
  if (supportsWorkflow) {
393
- metaLines.push(`Workflow orchestration: ${workflowOn ? 'On' : 'Off'} — multi-agent fan-out for large tasks.`);
394
- rows.push([
395
- { label: 'Workflow On', action: { kind: 'workflow.toggle', enabled: true },
396
- state: workflowOn ? 'current' : 'default', primary: workflowOn },
397
- { label: 'Workflow Off', action: { kind: 'workflow.toggle', enabled: false },
398
- state: workflowOn ? 'default' : 'current', primary: !workflowOn },
399
- ]);
397
+ metaLines.push(`Workflow orchestration: ${workflowOn ? 'On (Ultra effort)' : 'Off'} — pick the Ultra rung in /models to toggle.`);
400
398
  }
401
399
  return {
402
400
  kind: 'mode',
403
401
  title: 'Agent Mode',
404
402
  detail: `Current: ${isPlanMode ? 'Plan (read-only)' : 'Code (full access)'}`
405
- + (supportsWorkflow ? ` · Workflow ${workflowOn ? 'On' : 'Off'}` : ''),
403
+ + (supportsWorkflow && workflowOn ? ' · Ultra (workflow)' : ''),
406
404
  metaLines,
407
405
  items: [],
408
406
  rows,
@@ -515,7 +513,7 @@ export async function executeCommandAction(bot, chatId, action, opts = {}) {
515
513
  }
516
514
  case 'effort.set': {
517
515
  const chat = bot.chat(chatId);
518
- const currentEffort = bot.effortForAgent(chat.agent);
516
+ const currentEffort = bot.effortSelectionForAgent(chat.agent);
519
517
  if (action.effort === currentEffort) {
520
518
  return { kind: 'noop', message: `Already using ${action.effort} effort` };
521
519
  }
@@ -552,7 +550,7 @@ export async function executeCommandAction(bot, chatId, action, opts = {}) {
552
550
  if (!draft)
553
551
  return { kind: 'noop', message: 'No changes' };
554
552
  const currentModel = bot.modelForAgent(chat.agent);
555
- const currentEffort = bot.effortForAgent(chat.agent);
553
+ const currentEffort = bot.effortSelectionForAgent(chat.agent);
556
554
  const currentProfileId = bot.activeProfileIdForAgent(chat.agent);
557
555
  const profileChanged = (draft.profileId || null) !== (currentProfileId || null);
558
556
  const modelChanged = profileChanged
@@ -30,7 +30,7 @@ export function getStartData(bot, chatId) {
30
30
  .map(a => ({
31
31
  agent: a.agent,
32
32
  model: bot.modelForAgent(a.agent) || '(default)',
33
- effort: bot.effortForAgent(a.agent),
33
+ effort: bot.effortSelectionForAgent(a.agent),
34
34
  }));
35
35
  return {
36
36
  ...intro,
@@ -373,6 +373,10 @@ const EFFORT_LEVELS = {
373
373
  { id: 'high', label: 'High' },
374
374
  { id: 'xhigh', label: 'Very High' },
375
375
  { id: 'max', label: 'Max' },
376
+ // Synthetic top rung: "max depth + multi-agent Workflow orchestration", the
377
+ // same bundle as Claude's `ultracode` mode. Not a real --effort value — the
378
+ // bot decomposes it into (effort=max, workflow=on) at apply time.
379
+ { id: 'ultra', label: 'Ultra' },
376
380
  ],
377
381
  codex: [
378
382
  { id: 'low', label: 'Low' },
@@ -389,7 +393,9 @@ const EFFORT_LEVELS = {
389
393
  ],
390
394
  };
391
395
  function buildEffortData(bot, agent) {
392
- const currentEffort = bot.effortForAgent(agent);
396
+ // Display value folds workflow into the synthetic `ultra` rung — see
397
+ // Bot.effortSelectionForAgent.
398
+ const currentEffort = bot.effortSelectionForAgent(agent);
393
399
  if (!currentEffort)
394
400
  return null;
395
401
  const levels = EFFORT_LEVELS[agent];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pikiclaw",
3
- "version": "0.3.70",
3
+ "version": "0.3.71",
4
4
  "description": "Put the world's smartest AI agents in your pocket. Command local Claude & Gemini via IM. | 让最好用的 IM 变成你电脑上的顶级 Agent 控制台",
5
5
  "type": "module",
6
6
  "bin": {