sideby 0.33.0 → 0.35.0

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.
Files changed (38) hide show
  1. package/dist/build.json +1 -1
  2. package/dist/src/cli/commands.d.ts +2 -0
  3. package/dist/src/cli/commands.js +67 -17
  4. package/dist/src/cli/json-schemas.js +11 -3
  5. package/dist/src/cli/main.js +11 -5
  6. package/dist/src/core/cli-commands.js +2 -2
  7. package/dist/src/core/live-sessions.d.ts +4 -0
  8. package/dist/src/core/live-sessions.js +17 -3
  9. package/dist/src/core/messages.d.ts +9 -0
  10. package/dist/src/core/messages.js +36 -2
  11. package/dist/src/core/session-status.d.ts +55 -0
  12. package/dist/src/core/session-status.js +59 -0
  13. package/dist/src/core/unattended-retry.d.ts +39 -0
  14. package/dist/src/core/unattended-retry.js +107 -0
  15. package/dist/src/core/unattended.d.ts +2 -2
  16. package/dist/src/core/unattended.js +10 -2
  17. package/dist/src/families/claude/deliver.js +6 -2
  18. package/dist/src/families/claude/messaging.d.ts +8 -1
  19. package/dist/src/families/claude/messaging.js +15 -3
  20. package/dist/src/families/messaging.d.ts +6 -0
  21. package/dist/src/handoff/messages.js +1 -1
  22. package/dist/src/panel/i18n.d.ts +13 -0
  23. package/dist/src/panel/i18n.js +35 -9
  24. package/dist/src/panel/page-logic.d.ts +49 -5
  25. package/dist/src/panel/page-logic.js +74 -10
  26. package/dist/src/panel/page-script.js +59 -17
  27. package/dist/src/panel/page-styles.js +11 -0
  28. package/dist/src/unattended/hook.d.ts +4 -0
  29. package/dist/src/unattended/hook.js +86 -2
  30. package/package.json +1 -1
  31. package/schemas/new.json +4 -1
  32. package/schemas/sessions.json +22 -1
  33. package/skills/sideby/SKILL.md +2 -2
  34. package/skills/sideby/references/accounts.md +10 -0
  35. package/skills/sideby/references/ai-tasks.md +1 -1
  36. package/skills/sideby/references/sessions.md +1 -1
  37. package/skills/sideby/references/setup.md +1 -1
  38. package/skills/sideby/references/unattended.md +4 -2
@@ -5,7 +5,7 @@ import { groupsToAccept } from '../core/inbound.js';
5
5
  import { quotaIsStale } from '../core/quota-levels.js';
6
6
  import { remoteControlTodo } from '../core/remote-control.js';
7
7
  import { catalogMatchLevel, catalogNorm, searchCatalog } from '../core/search-catalog.js';
8
- import { aiTaskAccounts, aliasArgsOf, aliasIssue, askBridge, askBridged, askCopy, attentionReasons, attentionWhy, autostartNote, bindingWindow, cacheHitRate, canLeaveLocal, categoryOrder, codeSwapOutcome, dotsKeepKeyboard, enableOutcome, fileSize, fixPrompt, foldSkips, foldToolCalls, formatDuration, handoffChangeOf, handoffHintAccount, handoffTaskFacts, hiddenIn, highlightParts, histFilters, historyEmpty, historyWhen, hotkeyFromKey, hotkeyPressKind, inDisplayOrder, loginClusters, loginKey, longWindow, maskEmail, matchesQuery, mdBlocks, mdInline, menuPlacement, mergeDaily, mergeUsage, messageChip, messageNews, messageToCheck, networkTaskFacts, newAccountDir, nextReset, panelFixes, panelHint, panelLang, panelMigration, panelPrefs, passedWindow, pinnedIn, quotaAskable, quotaHighLevel, quotaPressure, radioStep, reloadForBuild, remoteControlSummary, reorder, resetWhen, rowBadge, runCodeSwap, saveHandoffChange, sendBlock, sendFileProblem, sendResultView, sessionAge, sessionLabelParts, shortCwd, shortSessionLabel, sortAccounts, sortSessions, steadyOrder, stripSecrets, suggestAlias, suggestName, switchFailure, tailInView, taskFindings, uaDayRuns, uaGroupPending, uaOnChoices, uaParseClock, uaPickTime, uaSameSlot, uaShouldRead, uaSlotNight, uaStatusParts, uaStepClock, uaToggleDay, uaWaitingCount, uaWhen, updatedAge, widthFollower, widthTier, windowState, withPinned, } from './page-logic.js';
8
+ import { accountTitle, aiTaskAccounts, aliasArgsOf, aliasIssue, aliasPrefix, askBridge, askBridged, askCopy, attentionReasons, attentionWhy, autostartNote, bindingWindow, cacheHitRate, canLeaveLocal, categoryOrder, codeSwapOutcome, dotsKeepKeyboard, enableOutcome, fileSize, fixPrompt, foldSkips, foldToolCalls, formatDuration, handoffChangeOf, handoffHintAccount, handoffTaskFacts, hiddenIn, highlightParts, histFilters, historyEmpty, historyWhen, hotkeyFromKey, hotkeyPressKind, inDisplayOrder, loginClusters, loginKey, longWindow, maskEmail, matchesQuery, mdBlocks, mdInline, menuPlacement, mergeDaily, mergeUsage, messageChip, messageNews, messageToCheck, networkTaskFacts, newAccountDir, nextReset, orderedAliases, panelFixes, panelHint, panelLang, panelMigration, panelPrefs, passedWindow, pinnedIn, quotaAskable, quotaHighLevel, quotaPressure, radioStep, reloadForBuild, remoteControlSummary, reorder, resetWhen, rowBadge, runCodeSwap, saveHandoffChange, sendBlock, sendFileProblem, sendResultView, sessionAge, sessionLabelParts, sessionRowShape, shortCwd, shortSessionLabel, sortAccounts, sortSessions, steadyOrder, stripSecrets, suggestAlias, suggestName, switchFailure, tailInView, taskFindings, uaDayRuns, uaGroupPending, uaOnChoices, uaParseClock, uaPickTime, uaSameSlot, uaShouldRead, uaSlotNight, uaStatusParts, uaStepClock, uaToggleDay, uaWaitingCount, uaWhen, updatedAge, vendorAlias, widthFollower, widthTier, windowState, withPinned, } from './page-logic.js';
9
9
  const LOGIC = [
10
10
  quotaIsStale,
11
11
  catalogNorm,
@@ -21,6 +21,10 @@ const LOGIC = [
21
21
  taskFindings,
22
22
  aliasArgsOf,
23
23
  aliasIssue,
24
+ aliasPrefix,
25
+ orderedAliases,
26
+ accountTitle,
27
+ vendorAlias,
24
28
  attentionReasons,
25
29
  attentionWhy,
26
30
  quotaHighLevel,
@@ -82,6 +86,7 @@ const LOGIC = [
82
86
  sendResultView,
83
87
  sessionAge,
84
88
  sessionLabelParts,
89
+ sessionRowShape,
85
90
  shortCwd,
86
91
  shortSessionLabel,
87
92
  sortAccounts,
@@ -1515,12 +1520,12 @@ const MAIN = String.raw `
1515
1520
  if (k === 'api') return h('span', { class: 'tag tag-warn', title: t('tip.api.body') }, t('acct.api'))
1516
1521
  return null
1517
1522
  }
1518
- // The short command, as quiet text after the name; every alias and its arguments are on hover.
1519
- function aliasText(a) {
1520
- const all = a.aliases || []
1521
- if (!all.length) return null
1522
- const lines = all.map((x) => { const args = aliasArgsOf(a, x); return x + ' · ' + (args ? t('acct.aliasArgs', { args: args.join(' ') }) : t('acct.alias')) })
1523
- return h('span', { class: 'alias', title: lines.join('\n') }, all[0])
1523
+ // An Account's short commands, as quiet text after its title: those that only start it first, then those with Host
1524
+ // arguments; each says on hover what it adds. A card too narrow for all of them ends in an ellipsis.
1525
+ function aliasText(a, list) {
1526
+ if (!list.length) return null
1527
+ const line = (x) => { const args = aliasArgsOf(a, x); return x + ' · ' + (args ? t('acct.aliasArgs', { args: args.join(' ') }) : t('acct.alias')) }
1528
+ return h('span', { class: 'aliases', title: list.map(line).join('\n') }, list.map((x) => h('span', { class: 'alias', title: line(x) }, x)))
1524
1529
  }
1525
1530
  // A Same Login row (spec §3.21) gets a link mark after the name; what it means is on hover.
1526
1531
  function loginMark(members) {
@@ -1532,11 +1537,13 @@ const MAIN = String.raw `
1532
1537
  // opts.linked: the directories a card marks as one login without speaking for them (its badge stays its own).
1533
1538
  function nameLine(a, members, opts) {
1534
1539
  const o = opts || {}
1540
+ // An API Account with a short command is named by it (cc-kimi); its ref is in the line under it.
1541
+ const named = accountTitle(a)
1535
1542
  return h('div', { class: 'ident-name' },
1536
1543
  pinSlot(a),
1537
- h('span', { class: 'name', title: a.name }, a.name),
1544
+ h('span', { class: 'name', title: named.byAlias ? t('acct.titleAlias', { alias: named.title, ref: a.ref }) : a.name }, named.title),
1538
1545
  loginMark(o.linked || members),
1539
- aliasText(a),
1546
+ aliasText(a, named.aliases),
1540
1547
  hiddenMark(isHidden(a) && !famHidden(a.family)),
1541
1548
  statusBadge(a, members))
1542
1549
  }
@@ -3590,7 +3597,8 @@ const MAIN = String.raw `
3590
3597
  p.title ? h('span', { class: 'sess-title' }, p.title) : null,
3591
3598
  h('span', { class: 'mono sess-id' }, p.id)),
3592
3599
  h('div', { class: 'sess-sub muted small' },
3593
- h('span', { class: 'sess-status' }, h('span', { class: 'dot sess-dot', 'aria-hidden': 'true' }), t('spage.status.' + status)),
3600
+ sessStatus(s, status),
3601
+ s.reason === 'pending-decision' && status === 'needs-you' ? h('button', { class: 'chip chip-sm chip-warn chip-btn sess-decision', type: 'button', 'data-key': 'sess-decision-' + s.sessionId, 'data-tip': t('spage.decisionTip'), onclick: () => setPage('unattended') }, t('spage.decision'), icon('chevron')) : null,
3594
3602
  chip ? msgChip(chip, msg, s) : null,
3595
3603
  s.guessed ? h('span', { class: 'chip sess-guessed', tabindex: '0', 'data-tip': t('spage.guessedTip') }, t('spage.guessed')) : null,
3596
3604
  runChip(s),
@@ -3598,6 +3606,11 @@ const MAIN = String.raw `
3598
3606
  h('span', { class: 'sess-age', 'data-age': s.sessionId }, sessAgeText(s)))),
3599
3607
  h('div', { class: 'sess-actions' }, copyBtn, sendBtn, more)), liveMenu)
3600
3608
  }
3609
+ // The status, and why a Session needs the user when sideby knows (spec §3.32 step 1's table).
3610
+ function sessStatus(s, status) {
3611
+ const why = status === 'needs-you' && ['host-waits', 'pending-decision', 'message-to-approve', 'message-to-paste'].includes(s.reason) ? t('spage.why.' + s.reason) : null
3612
+ return h('span', { class: 'sess-status', tabindex: why ? '0' : null, 'data-tip': why }, h('span', { class: 'dot sess-dot', 'aria-hidden': 'true' }), t('spage.status.' + status))
3613
+ }
3601
3614
  // The latest Message's state on a row. One that waits for a paste opens what to paste and why, so the line is never
3602
3615
  // only in the dialog that sent it.
3603
3616
  function msgChip(chip, msg, s) {
@@ -3651,7 +3664,7 @@ const MAIN = String.raw `
3651
3664
  sp.order = list.map((s) => s.sessionId)
3652
3665
  // Everything a row shows except its age, which renderSessionAges keeps current in place.
3653
3666
  const shape = JSON.stringify([lang, hs.opening, !d && !sp.error, sp.error ? sp.error.message : '', d ? d.problems : [],
3654
- list.map((s) => [s.sessionId, s.account, s.accountLabel, s.family, s.title, s.label, s.status, s.cwd, s.guessed, s.copy, Boolean(s.orca), s.run || null, sp.msgs[s.sessionId] ? sp.msgs[s.sessionId].status + (sp.msgs[s.sessionId].needsApproval ? '+approve' : '') : '']), inboundShape()])
3667
+ list.map((s) => sessionRowShape(s, sp.msgs[s.sessionId])), inboundShape()])
3655
3668
  if (shape === sp.drawn) { sp.pending = false; renderSessionAges(); revealSession(); return }
3656
3669
  if (sessionsMenuOpen()) { sp.pending = true; return }
3657
3670
  sp.pending = false
@@ -4838,7 +4851,7 @@ const MAIN = String.raw `
4838
4851
  const ready = fams.filter((f) => familyStatus(f) === 'ready')
4839
4852
  const pick = prefill && ready.some((f) => f.id === prefill.family) ? prefill.family : prefs.family && ready.some((f) => f.id === prefs.family) ? prefs.family : ready.length ? ready[0].id : ''
4840
4853
  // name / alias: what the user typed, or null while the field shows the suggestion (an emptied alias stays empty).
4841
- nf = { fams, family: pick, api: Boolean(prefill && prefill.api), name: null, alias: null, creating: false, result: null, error: null, els: {} }
4854
+ nf = { fams, family: pick, api: Boolean(prefill && prefill.api), vendor: '', name: null, alias: null, creating: false, result: null, error: null, els: {} }
4842
4855
  showDialog('create')
4843
4856
  renderCreate()
4844
4857
  if (nf.els.name) { nf.els.name.focus(); nf.els.name.select() }
@@ -4854,10 +4867,13 @@ const MAIN = String.raw `
4854
4867
  if (S.state && S.state.accounts.some((a) => a.ref === nf.family + ':' + name)) return t('nf.exists', { ref: nf.family + ':' + name })
4855
4868
  return ''
4856
4869
  }
4857
- // The short command offered for the typed name: the Family's alias pattern (cc001… gives cc008), if it is usable.
4870
+ // The short command offered for the typed name: for an API account the Family's prefix and the Vendor (cc-ds), shown
4871
+ // even when it cannot be used so the error under it says why; otherwise the Family's alias pattern (cc001… gives
4872
+ // cc008), if it is usable. An API account never gets a numbered one.
4858
4873
  function aliasSuggestion() {
4859
4874
  const name = nf.els.name.value.trim()
4860
4875
  if (!nf.family || !name || nameProblem()) return ''
4876
+ if (nf.api) return vendorAlias(S.state.accounts, nf.family, nf.vendor)
4861
4877
  const sug = suggestAlias(S.state.accounts, nf.family, name)
4862
4878
  return sug && !aliasIssue(sug, BOOT.aliasPattern, BOOT.reservedAliases, S.state.configAliases, nf.family + ':' + name) ? sug : ''
4863
4879
  }
@@ -4884,18 +4900,31 @@ const MAIN = String.raw `
4884
4900
  e.alias = h('input', { id: 'nf-alias', name: 'alias', type: 'text', autocomplete: 'off', autocapitalize: 'none', spellcheck: 'false', placeholder: t('nf.aliasPh'), maxlength: '64', 'aria-describedby': 'nf-alias-hint nf-alias-err', 'aria-invalid': 'false' })
4885
4901
  e.aliasHint = h('p', { class: 'field-hint', id: 'nf-alias-hint' })
4886
4902
  e.aliasErr = h('p', { class: 'field-error', id: 'nf-alias-err', role: 'alert' })
4887
- e.api = h('input', { id: 'nf-api', type: 'checkbox', 'aria-label': t('nf.api') })
4903
+ e.api = h('input', { id: 'nf-api', type: 'checkbox', 'aria-label': t('nf.api'), 'aria-controls': 'nf-vendor-field' })
4888
4904
  e.api.checked = nf.api
4905
+ e.vendor = h('input', { id: 'nf-vendor', name: 'vendor', type: 'text', autocomplete: 'off', autocapitalize: 'none', spellcheck: 'false', placeholder: t('nf.vendorPh'), maxlength: '32', 'aria-describedby': 'nf-vendor-hint' })
4906
+ e.vendor.value = nf.vendor
4907
+ // Grows in under "API key" when it is ticked; inert while folded, so Tab skips it.
4908
+ e.vendorField = h('div', { class: 'reveal' + (nf.api ? ' is-open' : ''), id: 'nf-vendor-field', inert: nf.api ? undefined : true },
4909
+ h('div', { class: 'reveal-in' }, h('div', { class: 'field' },
4910
+ h('label', { class: 'field', for: 'nf-vendor' }, h('span', null, t('nf.vendor')), e.vendor),
4911
+ h('p', { class: 'field-hint', id: 'nf-vendor-hint' }, t('nf.vendorHint')))))
4889
4912
  e.suggest = h('p', { class: 'field-hint', id: 'nf-sug' })
4890
4913
  e.error = h('p', { class: 'field-error', id: 'nf-err', role: 'alert' })
4891
4914
  e.preview = h('dl', { class: 'preview' })
4892
4915
  e.submit = h('button', { class: 'btn btn-primary', type: 'submit', form: 'nf-form', 'aria-label': t('nf.create') }, t('nf.create'))
4893
4916
  e.name.addEventListener('input', () => { nf.name = e.name.value; followAlias(); validateCreate(); renderPreview() })
4894
4917
  e.alias.addEventListener('input', () => { nf.alias = e.alias.value; validateCreate(); renderPreview() })
4918
+ e.vendor.addEventListener('input', () => { nf.vendor = e.vendor.value; followAlias(); validateCreate(); renderPreview() })
4895
4919
  e.api.addEventListener('change', () => {
4896
4920
  nf.api = e.api.checked
4921
+ e.vendorField.classList.toggle('is-open', nf.api)
4922
+ e.vendorField.inert = !nf.api
4897
4923
  // A refusal was about the old choice; the hint under it no longer applies.
4898
4924
  if (e.errNote) { e.errNote.remove(); e.errNote = null; nf.error = null }
4925
+ followAlias()
4926
+ validateCreate()
4927
+ renderPreview()
4899
4928
  })
4900
4929
  const cards = nf.fams.map((f) => {
4901
4930
  const st = familyStatus(f)
@@ -4923,10 +4952,13 @@ const MAIN = String.raw `
4923
4952
  h('span', { class: 'fam-text' }, h('span', { class: 'fam-title' }, t('ask.otherTool')), h('span', { class: 'fam-sub' }, t('ask.otherToolSub')))))),
4924
4953
  h('div', { class: 'field' }, h('label', { class: 'field', for: 'nf-name' }, h('span', null, t('nf.name')), e.name), e.suggest),
4925
4954
  // The first screen asks only for the tool and a name; the rest waits behind "More options".
4955
+ // "API key" comes before the short command: its Vendor names the short command (cc-ds).
4926
4956
  h('details', { class: 'more-opts', open: nf.api || Boolean(nf.alias) || Boolean(nf.error) || undefined },
4927
4957
  h('summary', null, t('nf.more')),
4958
+ h('div', null,
4959
+ h('div', { class: 'check-row' }, h('label', { class: 'check' }, e.api, h('span', null, h('b', null, t('nf.api')), h('span', { class: 'muted small' }, t('nf.apiHint')))), tip('api')),
4960
+ e.vendorField),
4928
4961
  h('div', { class: 'field' }, h('label', { class: 'field', for: 'nf-alias' }, h('span', null, t('nf.alias'), ' ', h('span', { class: 'muted small' }, t('nf.optional'))), e.alias), e.aliasHint, e.aliasErr),
4929
- h('div', { class: 'check-row' }, h('label', { class: 'check' }, e.api, h('span', null, h('b', null, t('nf.api')), h('span', { class: 'muted small' }, t('nf.apiHint')))), tip('api')),
4930
4962
  e.preview),
4931
4963
  e.error,
4932
4964
  e.errNote = nf.error ? errorNote(nf.error, create, nf.error.code === 'create-refused' && !nf.api ? t('nf.refusedApi') : null) : null,
@@ -4955,10 +4987,19 @@ const MAIN = String.raw `
4955
4987
  e.alias.classList.toggle('invalid', Boolean(aliasMsg))
4956
4988
  e.alias.setAttribute('aria-invalid', String(Boolean(aliasMsg)))
4957
4989
  e.aliasErr.textContent = aliasMsg
4958
- e.aliasHint.textContent = alias && alias === aliasSuggestion() ? t('nf.aliasSuggested', { host: family(nf.family).title }) : t('nf.aliasHint')
4990
+ e.aliasHint.textContent = aliasHintText(alias)
4959
4991
  if (!nf.creating) e.submit.disabled = Boolean(msg) || Boolean(aliasMsg) || !name || !nf.family
4960
4992
  return msg || aliasMsg
4961
4993
  }
4994
+ // What the line under the short command says: where a suggestion came from, or, for an API account without a
4995
+ // Vendor yet, that typing one gives cc-<vendor>.
4996
+ function aliasHintText(alias) {
4997
+ const host = nf.family ? family(nf.family).title : ''
4998
+ if (alias && alias === aliasSuggestion()) return t(nf.api ? 'nf.aliasVendor' : 'nf.aliasSuggested', { host })
4999
+ const example = nf.api && nf.family ? vendorAlias(S.state.accounts, nf.family, '<' + t('nf.vendorWord') + '>') : ''
5000
+ if (example && !alias && !nf.vendor.trim()) return t('nf.aliasVendorTip', { example })
5001
+ return t('nf.aliasHint')
5002
+ }
4962
5003
  function renderPreview() {
4963
5004
  const name = nf.els.name.value.trim()
4964
5005
  const ok = name && !nameProblem() && nf.family
@@ -5796,7 +5837,8 @@ const MAIN = String.raw `
5796
5837
  const p = uaStatusParts(st)
5797
5838
  const schedule = st.schedule || []
5798
5839
  const slotWord = p.slot !== null && schedule[p.slot] ? uaSlotWord(schedule[p.slot], p.slot) : null
5799
- if (p.state === 'on') return [t('ua.on'), p.byHand ? t('ua.byHand') : slotWord, p.noEnd ? t('ua.noEnd') : uaAt('until', p.until)]
5840
+ // State first, then the one time that matters (until when, or when it comes on), then why.
5841
+ if (p.state === 'on') return [t('ua.on'), p.noEnd ? t('ua.noEnd') : uaAt('until', p.until), p.byHand ? t('ua.byHand') : slotWord]
5800
5842
  if (p.state === 'paused') return [t('ua.paused'), p.noEnd ? t('ua.pausedOpen') : uaAt('back', p.until)]
5801
5843
  return [t('ua.off'), p.next ? uaAt('next', p.next.at) : null]
5802
5844
  }
@@ -317,6 +317,9 @@ code, .mono { font-family: var(--mono); font-size: 0.92em; }
317
317
  .ident-name { display: flex; align-items: center; gap: 6px; min-width: 0; flex-wrap: wrap; row-gap: 3px; }
318
318
  .ident-name .name { font-weight: var(--strong-weight); font-size: var(--font-size); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
319
319
  .ident-name .alias { color: var(--muted); font-family: var(--mono); font-size: 12px; white-space: nowrap; }
320
+ /* Every short command of an Account, in one line that ends in an ellipsis when a card is too narrow. */
321
+ .ident-name .aliases { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-family: var(--mono); font-size: 12px; }
322
+ .ident-name .aliases .alias + .alias { margin-left: 6px; }
320
323
  .ident-email { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
321
324
  .email-btn, .model-btn { all: unset; cursor: pointer; border-radius: 4px; }
322
325
  .model-btn:hover { color: var(--text); text-decoration: underline dotted; }
@@ -752,6 +755,14 @@ select:is(:hover, :focus) { --chevron: var(--text); }
752
755
  .check-row { display: flex; align-items: flex-start; gap: 8px; }
753
756
  .check-row .check { flex: 1; }
754
757
  .check-row .tip { margin-top: 12px; }
758
+ /* A field that belongs to a choice above it (the Vendor under "API key"): it grows in when the choice is made and
759
+ folds away when it is undone, instead of snapping the dialog. */
760
+ .reveal { display: grid; grid-template-rows: 0fr; opacity: 0; visibility: hidden; transition: grid-template-rows .18s ease, opacity .18s ease, visibility 0s .18s; }
761
+ .reveal.is-open { grid-template-rows: 1fr; opacity: 1; visibility: visible; transition: grid-template-rows .18s ease, opacity .18s ease; }
762
+ /* The side and bottom padding keep a focused input's outline inside the clipped box. */
763
+ .reveal > .reveal-in { min-height: 0; overflow: hidden; margin: 0 -4px; padding: 0 4px 4px; }
764
+ .reveal > .reveal-in > .field { padding-top: 12px; }
765
+ @media (prefers-reduced-motion: reduce) { .reveal, .reveal.is-open { transition: none; } }
755
766
  .check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--ctl-radius); transition: border-color .12s, background-color .12s; }
756
767
  .check:hover { border-color: var(--btn-hover-border); }
757
768
  .check:has(input:checked) { background: var(--accent-soft); border-color: transparent; }
@@ -5,6 +5,10 @@ export declare const ASK_TOOLS: Readonly<Record<string, string>>;
5
5
  type Env = Record<string, string | undefined>;
6
6
  export interface UnattendedHookDeps {
7
7
  now?: () => Date;
8
+ /** Turn Retry's wait; a real timer by default. */
9
+ sleep?: (ms: number) => Promise<void>;
10
+ /** Whether the Host that started the hook is gone (`ppid` 1 by default): nothing is left to wake. */
11
+ parentGone?: () => boolean;
8
12
  }
9
13
  /**
10
14
  * The question as the user should read it later: each question (with its short header) and its options' labels.
@@ -10,12 +10,16 @@
10
10
  // Claude Code's permission requests with a denial (JSON on stdout: Claude Code does not honor exit 2 for that event),
11
11
  // keeping the request as a Pending Decision too; it keeps a turn going once when the model ended it on a question
12
12
  // written as plain text (`{"decision":"block","reason":…}` on stdout), keeping the question; and it declines an MCP
13
- // server's form, keeping what the server asked. A failure before the decision is made does nothing: that is
13
+ // server's form, keeping what the server asked. In Claude it also runs in the background after a turn that failed for
14
+ // a passing reason (`StopFailure`, `asyncRewake`): it waits, then wakes the session with exit 2 so the turn goes on, at
15
+ // most three times in a row, and keeps a Pending Decision when that did not help (Turn Retry, ADR-0067). A failure
16
+ // before the decision is made does nothing: that is
14
17
  // how a session behaves without the feature (unlike `network-hook`, which blocks when it cannot tell). Once the
15
18
  // decision is to refuse, it refuses: keeping the Pending Decision and writing the reason are best effort, and their
16
19
  // failure neither allows the call nor adds any output of its own.
17
20
  import { resolvePaths } from '../core/paths.js';
18
21
  import { addPendingDecision } from '../core/unattended-pending.js';
22
+ import { clearRetryStreak, countFailure, passingFailure, RETRY_LIMIT, readRetryStreak, retryDelay, retryGaveUpText, retryMessage, } from '../core/unattended-retry.js';
19
23
  import { clockText, readUnattendedConfig, readUnattendedOverride, UNATTENDED_ENV, unattendedState, } from '../core/unattended-state.js';
20
24
  export const UNATTENDED_HOOK_COMMAND = 'sideby unattended-hook';
21
25
  /** The tool each Host's model asks the user with. */
@@ -332,12 +336,21 @@ async function decide(argv, env, input, now) {
332
336
  if (!permission && !elicitation && !stop && (event !== 'PreToolUse' || !askTool))
333
337
  return undefined;
334
338
  const paths = resolvePaths(env);
339
+ // A turn that finished ends the session's run of retried failures (Turn Retry), whether Unattended Mode is on or
340
+ // not: a wait left from earlier must never wake a session whose turn is already done.
341
+ let early;
342
+ if (stop && family === 'claude') {
343
+ early = await readInput(input);
344
+ const sessionId = text(parseObject(early)?.session_id, 256);
345
+ if (sessionId)
346
+ await clearRetryStreak(paths.stateDir, sessionId).catch(() => { });
347
+ }
335
348
  const { schedule } = await readUnattendedConfig(paths.configFile);
336
349
  const override = await readUnattendedOverride(paths.stateDir);
337
350
  const state = unattendedState({ schedule, override, now, session: env[UNATTENDED_ENV] === '1' });
338
351
  if (!state.on)
339
352
  return undefined;
340
- const raw = await readInput(input);
353
+ const raw = early ?? (await readInput(input));
341
354
  const zh = prefersChinese(env);
342
355
  const account = text(env.SIDEBY_ACCOUNT, 256);
343
356
  if (stop || elicitation) {
@@ -418,6 +431,18 @@ async function decide(argv, env, input, now) {
418
431
  * record.
419
432
  */
420
433
  export async function runUnattendedHook(argv, env, input, io, deps = {}) {
434
+ if (argv[0] === 'claude' && argv[1] === 'StopFailure') {
435
+ try {
436
+ const wake = await retryAfterFailure(env, input, deps);
437
+ if (!wake)
438
+ return 0;
439
+ io.err.write(`${wake}\n`);
440
+ return 2;
441
+ }
442
+ catch {
443
+ return 0;
444
+ }
445
+ }
421
446
  let refusal;
422
447
  const now = deps.now ? deps.now() : new Date();
423
448
  try {
@@ -454,3 +479,62 @@ export async function runUnattendedHook(argv, env, input, io, deps = {}) {
454
479
  }
455
480
  return 2;
456
481
  }
482
+ /** Whether Unattended Mode is on right now, read fresh from the Schedule and the manual state. */
483
+ async function isOn(env, now) {
484
+ const paths = resolvePaths(env);
485
+ const { schedule } = await readUnattendedConfig(paths.configFile);
486
+ const override = await readUnattendedOverride(paths.stateDir);
487
+ return unattendedState({ schedule, override, now, session: env[UNATTENDED_ENV] === '1' }).on;
488
+ }
489
+ /**
490
+ * Turn Retry (spec §3.37 item 6, ADR-0067), Claude's background `StopFailure` hook (`asyncRewake`): Claude Code runs it
491
+ * when a turn ends on an API error and ignores its output, but wakes the idle session when it exits 2, with its stderr
492
+ * as the model's next note (checked with Claude Code 2.1.316). While Unattended Mode is on and the failure is a
493
+ * passing one, it counts the failure for the session; up to `RETRY_LIMIT` in a row it waits 1, 2, then 4 minutes and
494
+ * returns the note that wakes the session. Past the limit it keeps a Pending Decision and wakes nothing. It returns
495
+ * nothing (exit 0) when the mode is off, the failure is not passing, there is no session id, or by the end of the wait
496
+ * the mode went off, the Host is gone, or another failure or a finished turn has taken over the session's streak.
497
+ */
498
+ async function retryAfterFailure(env, input, deps) {
499
+ const clock = deps.now ?? (() => new Date());
500
+ const now = clock();
501
+ const v = parseObject(await readInput(input));
502
+ if (!v)
503
+ return undefined;
504
+ const sessionId = text(v.session_id, 256);
505
+ if (!sessionId)
506
+ return undefined;
507
+ const paths = resolvePaths(env);
508
+ const error = typeof v.error === 'string' ? v.error : undefined;
509
+ const said = [text(v.last_assistant_message, 1000), text(v.error_details, 1000)].filter(Boolean).join(' ');
510
+ // A later failure that is not retried (a used-up Quota, a lasting error) or comes while the mode is off still
511
+ // takes over the session: the wait an earlier failure left must not wake it.
512
+ if (!error || !passingFailure(error, said) || !(await isOn(env, now))) {
513
+ await clearRetryStreak(paths.stateDir, sessionId).catch(() => { });
514
+ return undefined;
515
+ }
516
+ const streak = await countFailure(paths.stateDir, sessionId, now);
517
+ if (streak.count > RETRY_LIMIT) {
518
+ const account = text(env.SIDEBY_ACCOUNT, 256);
519
+ const cwd = text(v.cwd);
520
+ await clearRetryStreak(paths.stateDir, sessionId).catch(() => { });
521
+ await addPendingDecision(paths.stateDir, {
522
+ kind: 'deferred',
523
+ family: 'claude',
524
+ ...(account ? { account } : {}),
525
+ sessionId,
526
+ ...(cwd ? { cwd } : {}),
527
+ text: retryGaveUpText(error, text(v.last_assistant_message, 1000) ?? ''),
528
+ }, now, { dedupe: true }).catch(() => { });
529
+ return undefined;
530
+ }
531
+ const sleep = deps.sleep ?? ((ms) => new Promise((r) => setTimeout(r, ms)));
532
+ await sleep(retryDelay(streak.count));
533
+ if ((deps.parentGone ?? (() => process.ppid === 1))())
534
+ return undefined;
535
+ if ((await readRetryStreak(paths.stateDir, sessionId))?.token !== streak.token)
536
+ return undefined;
537
+ if (!(await isOn(env, clock())))
538
+ return undefined;
539
+ return retryMessage(error, text(v.last_assistant_message, 1000) ?? '', streak.count, prefersChinese(env));
540
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sideby",
3
- "version": "0.33.0",
3
+ "version": "0.35.0",
4
4
  "description": "Run work, personal and API-key accounts at the same time, without their configs drifting apart.",
5
5
  "license": "MIT",
6
6
  "author": "Adonis0123 (https://github.com/Adonis0123)",
package/schemas/new.json CHANGED
@@ -190,9 +190,12 @@
190
190
  },
191
191
  "aliasProblem": {
192
192
  "type": "string"
193
+ },
194
+ "aliasHint": {
195
+ "type": "string"
193
196
  }
194
197
  },
195
- "description": "Only with `--next`: the picked name, the short command that follows the existing pattern, or why that short command was left out."
198
+ "description": "Only with `--next` or `--vendor`: the name, the short command suggested for it (the existing pattern, `cc008`, for a subscription account; the prefix and the vendor, `cc-ds`, for an API account with `--vendor`), why that short command was left out (`aliasProblem`), or, when none was suggested, how to get one (`aliasHint`, such as an API account without `--vendor`)."
196
199
  },
197
200
  "pickCommandOffer": {
198
201
  "type": "object",
@@ -78,7 +78,28 @@
78
78
  "const": "unknown"
79
79
  }
80
80
  ],
81
- "description": "`needs-you`: it waits for the user (a permission or a question); `unknown` where the host does not say."
81
+ "description": "`needs-you`: the user has to act on it (`reason` says why); `busy` and `idle` as the host says; `unknown` where the host does not say. The first matching row of spec §3.32 step 1's status table."
82
+ },
83
+ "reason": {
84
+ "anyOf": [
85
+ {
86
+ "type": "string",
87
+ "const": "host-waits"
88
+ },
89
+ {
90
+ "type": "string",
91
+ "const": "pending-decision"
92
+ },
93
+ {
94
+ "type": "string",
95
+ "const": "message-to-approve"
96
+ },
97
+ {
98
+ "type": "string",
99
+ "const": "message-to-paste"
100
+ }
101
+ ],
102
+ "description": "Only with `needs-you`: the host waits for a permission or an answer; an open Pending Decision names the session (`sideby unattended pending`); a Message to it waits for the user to approve it in its terminal; or a Message to it waits to be pasted (`sideby messages`). New values may be added."
82
103
  },
83
104
  "cwd": {
84
105
  "type": "string"
@@ -2,7 +2,7 @@
2
2
  name: sideby
3
3
  description: Use when the user runs, or wants to run, several AI coding accounts (Claude Code, Codex, Grok Build, pi) side by side. Covers installing sideby and setting up a new account ("install sideby", "set up another Claude account", "add cc008", "配置一个 cc00x", "再加一个 Codex 账号"), explaining what accounts share and what stays separate ("what do my accounts share?", "这些账号共享了什么"), showing which account a session is ("show [cc001] in the status line", "加上账号标识"), finding a past session of any account ("找一下我上周改登录页的那个会话"), telling another running session something, in any account ("告诉 cc002 ……", "给跑构建的那个会话发消息"; Claude Code's own SendMessage reaches only sessions of the same account), seeing accounts, quota and usage, moving on when one hits its 5-hour or weekly limit, moving the current task to another account ("用 cc008 继续", "交回 cc008"), adding a short command (alias) or a pick command that starts whichever account has the most quota ("加个 cc"), adding an API account from a vendor's docs ("加一个 DeepSeek API 账号"), supporting a new tool, and repairing drifted account directories (skills, hooks, rules or settings not shared, wrong symlinks, credential file permissions). Drives the `sideby` CLI with `--json`; the agent does every step except browser sign-in, filling in secrets and starting interactive sessions, which it hands to the user as one command (inside an Auto Handoff session, `sideby handoff ready --to` moves the task itself).
4
4
  metadata:
5
- version: "0.33.0"
5
+ version: "0.35.0"
6
6
  requires:
7
7
  bins: [sideby, node]
8
8
  cliHelp: sideby --help
@@ -68,7 +68,7 @@ Account refs are `<family>:<name>`; a bare `<name>` works only when it is unique
68
68
  | Short commands say "command not found" in a new terminal ("cc 用不了", "短命令不生效") | `sideby shell-init setup --json` (exit 10 first) | `references/setup.md` |
69
69
  | Do something in sideby as an AI Task (the first message came from sideby or the Panel's "Let AI do it") | follow the task it names | `references/ai-tasks.md` |
70
70
  | A Portal starts AI Tasks through sideby, or one of its tasks failed (`spec-version`, `bad-cwd`, "which account would it use?") | `sideby ask --choices --json`, `sideby ask --spec - --print --json` (read only) | `references/ai-tasks.md` |
71
- | Add an API account from a vendor's address or docs link, enter its key, check it works (also with a given model: "用 glm-5.3 试一下 pi") | `sideby new <family> --next --api --json`, then the user runs `sideby key <ref>`; `sideby try <ref|short command> [--model <m>] --json` (exit 10 first) | `references/ai-tasks.md` |
71
+ | Add an API account from a vendor's address or docs link, enter its key, check it works (also with a given model: "用 glm-5.3 试一下 pi") | `sideby new <family> --next --api --vendor <slug> --json` (short command named after the vendor, `cc-ds`), then the user runs `sideby key <ref>`; `sideby try <ref|short command> [--model <m>] --json` (exit 10 first) | `references/ai-tasks.md` |
72
72
  | Support a tool sideby does not list yet, or write a plugin | `sideby plugins new <id> --json`, `sideby plugins check <id> --json` | `references/ai-tasks.md` |
73
73
  | Choose the terminal the Panel opens for AI Tasks and sign-in | `sideby terminal --json`, `sideby terminal --set <id> --json` | — |
74
74
  | Tune the auto-compact threshold ("which compaction setting costs the fewest tokens"), use the suggestion or undo it | `sideby tune --json`, `sideby tune apply` (exit 10 first), `sideby tune undo` | `references/diagnose.md` |
@@ -7,11 +7,21 @@ Check the name first: `^[a-z0-9][a-z0-9-]{0,31}$`, and not already taken (`sideb
7
7
  ```sh
8
8
  sideby new claude work # subscription account: ~/.claude-work
9
9
  sideby new claude deepseek --api # API account: ~/.claude-deepseek with a proxy.env template (mode 600)
10
+ sideby new claude --next --api --vendor ds # API account 009 with the short command cc-ds (cc001… exist)
10
11
  sideby new claude 008 --alias cc008 # also adds the short command cc008 to config aliases
11
12
  ```
12
13
 
13
14
  Only pass `--alias` when the user wants a short command. To continue their numbering (`cc001`…`cc007` for `claude:001`…`claude:007`), use `sideby new claude --next --json` instead of a name: it picks `008` and `cc008` the same way the panel does (see `setup.md`). An invalid, reserved or taken alias is refused before anything is created (error `code: "alias-invalid"`). If `alias.added` is false in `--json`, the account exists but the alias is missing: tell the user the message, do not edit the config by hand.
14
15
 
16
+ ### API accounts: name the short command after the vendor
17
+
18
+ An API account's short command says which vendor it calls (`cc-ds`, `cc-kimi`), not a number: the user tells them apart by vendor, and the name stays right when the model changes. The account name stays numbered (`claude:009`).
19
+
20
+ - Find the Vendor: from the user's words or the docs link they gave; ask only when neither says.
21
+ - Pass it as `--vendor <slug>` with `--api`. Use these slugs: `ds` (DeepSeek), `glm` (Zhipu GLM / Z.ai), `kimi` (Moonshot Kimi), `qwen` (Alibaba Qwen / Bailian), `api` (the Host's own official API, such as Anthropic's for Claude Code), `relay` (a gateway or relay in front of several vendors). Another vendor: a short lowercase name the user would recognise (`minimax`, `doubao`).
22
+ - Name by vendor, not model: `cc-kimi`, not `cc-k3`. Several models of one vendor are one account with extra short commands that pass `--model` (below, `pi-kimi`), not more accounts.
23
+ - `sideby new` builds the short command from the prefix of the user's numbered ones (`cc` from `cc001`) and the slug. Read `suggestion`: `alias` is what it added; `aliasProblem` means it was taken or invalid (a second DeepSeek account: offer `cc-ds2` with `sideby alias add`); `aliasHint` means none was added (no `--vendor`, or no prefix to build from) and says how to add one. Never invent a prefix.
24
+
15
25
  Then:
16
26
 
17
27
  - **Subscription account**: tell the user to run `sideby login claude:work` in their own terminal (for pi, `sideby login pi:<name>` starts pi; then they type `/login`). Do not run it for them.
@@ -57,7 +57,7 @@ The prompt names the account and the reason. Run `sideby quota <ref> --json` and
57
57
  sideby ships no list of vendors, addresses or model names. Take every fact from the vendor's own documentation and the Host's own docs or `--help`, and tell the user which page you used. Do not use blog posts, other tools' preset lists or your memory for an address or a model name.
58
58
 
59
59
  1. From the docs (or the link the user gave), find: the address for the Family's API format (Claude Code needs an Anthropic-compatible address, Codex an OpenAI-compatible one), the variable the key goes in, and the model names, if the Host needs one.
60
- 2. `sideby new <family> --next --api --json`. It creates `proxy.env` (mode 600) in the new account.
60
+ 2. `sideby new <family> --next --api --vendor <slug> --json`, with the vendor's slug from `accounts.md` ("API accounts": `ds`, `glm`, `kimi`, `qwen`, `api`, `relay`). It creates `proxy.env` (mode 600) in the new account and the short command `<prefix>-<slug>` (`cc-ds`); read `suggestion` for why there is none.
61
61
  3. Set every variable except the key: show the user the lines you will add to `proxy.env` and add them after they agree. Do not read the file's other lines, and never write a key into it.
62
62
  4. Tell the user to run `sideby key <ref>` in their own terminal (or click **Enter key** in the Panel). Add `--var <NAME>` when the key belongs in a variable other than the Family's default. Wait until they say it is done.
63
63
  5. Offer `sideby try <ref> --json`: it exits 10 and says which command it runs and that it costs a few tokens. After they agree, run it with `--yes`. Exit 0 means the Host answered. On 1, read the Host's message it shows and check the mistakes below.
@@ -7,7 +7,7 @@ For "which session is cc002 running", "cc002 现在在干嘛", "cc002 在哪个
7
7
  Run `sideby sessions --json` (or `sideby sessions <account|family> --json` for one account or host). Each entry of `sessions` is one running session:
8
8
 
9
9
  - `label` is the Session Label, `<account> · <the host's own title> · <first 8 of the id>`, as in `cc002 · knip cleanup · 61230c3d`. Use it when you name a session to the user; sideby never invents the title.
10
- - `status`: `needs-you` (it waits for a permission or an answer: tell the user first), `busy`, `idle`, or `unknown` where the host does not say. Sessions that need the user come first.
10
+ - `status`: `needs-you` (the user has to act on it: tell the user first), `busy`, `idle`, or `unknown` where the host does not say. Sessions that need the user come first. With `needs-you`, `reason` says why, so tell the user what to do: `host-waits` (it waits in its terminal for a permission or an answer), `pending-decision` (it asked something while Unattended Mode was on: show it with `sideby unattended pending --json`, see `unattended.md`), `message-to-approve` (a Message to it waits for the user to approve it in its terminal) or `message-to-paste` (a Message to it waits to be pasted: `sideby messages --to <session-id> --json` gives the line, see "Tell a session something" below).
11
11
  - `cwd`, `startedAt`, `updatedAt`, `transcript` (the path of its record), `resumeCommand`.
12
12
  - `guessed: true` means sideby could not tie a running Codex or pi program to a session and shows that account's newest session instead. Say "probably" when you report it.
13
13
 
@@ -9,7 +9,7 @@ For "install sideby", "set up another Claude account", "add cc008", "配置一
9
9
  5. **Create.**
10
10
  - The user gave no name, or said "cc00x" / "the next one": `sideby new <family> --next --json`. It picks the next number (`008` after `001`…`007`) and, when existing short commands show a pattern (`cc007` for `claude:007`), adds the next one (`cc008`). Read `suggestion`: `aliasProblem` means that short command was taken and left out; tell the user.
11
11
  - The user gave a name: `sideby new <family> <name> --json`; a short command they named: add `--alias <short>`.
12
- - An API account (DeepSeek, a gateway, …): add `--api`.
12
+ - An API account (DeepSeek, a gateway, …): add `--api --vendor <slug>`. Its short command is named after the vendor (`cc-ds`), never numbered. Take the vendor from the user's words or docs link, ask only if neither says, and use the slugs in `accounts.md` ("API accounts"): `ds`, `glm`, `kimi`, `qwen`, `api` for the Host's own official API, `relay` for a gateway. Without `--vendor` no short command is added (`suggestion.aliasHint` says so).
13
13
  - A short command the user did not ask for and no pattern suggests: none. Do not invent a prefix.
14
14
  6. **user: sign in or fill in the key.**
15
15
  - Subscription account: `sideby login <ref>`. It opens the Host's sign-in in their browser. For pi it starts pi; they type `/login`.
@@ -1,6 +1,6 @@
1
1
  # Unattended Mode: sessions that do not stop to wait for a person
2
2
 
3
- Unattended Mode (spec §3.37, ADR-0058) is one state for the whole computer: nobody is there to answer, so the Claude and Codex sessions sideby starts never stop to wait. While it is on, sideby's hook refuses the Host's question tool (Claude `AskUserQuestion`, Codex `request_user_input`) and tells the model to take the recommended option where the choice can be undone and to skip anything hard to undo; each refused question is kept as a **Pending Decision**. When the model ends its turn on a question written as text instead, the hook sends the session on once with the same instructions and keeps that question too. In Claude sessions it also answers "no" to every permission prompt Claude Code is about to show (even in bypass mode, and in subagents), with how to do the step without one; each refused request is kept as a Pending Decision too; and it declines MCP server forms, keeping what the server asked. Codex's own approval prompts still wait.
3
+ Unattended Mode (spec §3.37, ADR-0058) is one state for the whole computer: nobody is there to answer, so the Claude and Codex sessions sideby starts never stop to wait. While it is on, sideby's hook refuses the Host's question tool (Claude `AskUserQuestion`, Codex `request_user_input`) and tells the model to take the recommended option where the choice can be undone and to skip anything hard to undo; each refused question is kept as a **Pending Decision**. When the model ends its turn on a question written as text instead, the hook sends the session on once with the same instructions and keeps that question too. In Claude sessions it also answers "no" to every permission prompt Claude Code is about to show (even in bypass mode, and in subagents), with how to do the step without one; each refused request is kept as a Pending Decision too; and it declines MCP server forms, keeping what the server asked; and a Claude turn that failed for a passing reason (an overloaded or failing server, a dropped connection, a rate limit that is not a used-up quota) is started again after 1, 2, then 4 minutes, and after a fourth failure in a row the session is left with a Pending Decision saying why (Turn Retry, ADR-0067). Codex's own approval prompts still wait.
4
4
 
5
5
  ## Turn it on when the user is leaving
6
6
 
@@ -47,6 +47,8 @@ sideby unattended defer "deleting the old release branch is left for the user" -
47
47
 
48
48
  Then go on with the rest. Do not retry the question, and do not work around the refusal.
49
49
 
50
+ When a note from sideby says your last turn failed for a passing reason, the session was woken to go on: check what is already done (files, commits, background work), do not redo it, and continue where the turn stopped.
51
+
50
52
  ## When the user is back
51
53
 
52
54
  ```sh
@@ -55,6 +57,6 @@ sideby unattended pending --json # each question, refused permission or skipp
55
57
  sideby unattended pending done <id> --json # or --all, once the user has dealt with them
56
58
  ```
57
59
 
58
- Go through the open ones with the user (a `permission` one names the tool, for Bash only the program and the model's description of the step, and `agentType` when a subagent asked; the whole command is in the session itself). A decision with a `sessionId` can be continued in its session: `sideby sessions copy <sessionId> --as resume` copies the command. Done ones are deleted 30 days later. A plugin can be told when a stretch ends through the `unattended.ended` event (`docs/guide/plugins.md`); sideby itself sends no notification.
60
+ Go through the open ones with the user (a `deferred` one that starts "The session stopped" is a session whose turn kept failing after three retries; a `permission` one names the tool, for Bash only the program and the model's description of the step, and `agentType` when a subagent asked; the whole command is in the session itself). A decision with a `sessionId` can be continued in its session: `sideby sessions copy <sessionId> --as resume` copies the command. Done ones are deleted 30 days later. A plugin can be told when a stretch ends through the `unattended.ended` event (`docs/guide/plugins.md`); sideby itself sends no notification.
59
61
 
60
62
  The same is on the Panel's **Unattended** tab (`sideby ui`): the status with **Turn on now**, the Schedule, and the Pending Decisions with **Done**. Point the user there when they prefer clicking.