vine-context 0.1.0 → 0.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.
@@ -124,9 +124,9 @@ function engine(on: any, calls: Calls, prompts: string[] = [], state: unknown =
124
124
  on('mcp.call', (_: unknown, e: any) => {
125
125
  calls.push({ tool: e.tool, args: e.args })
126
126
  if (failing[e.tool]) return { value: { content: [{ type: 'text', text: failing[e.tool] }], isError: true } }
127
- if (e.tool === 'context_activity') return { value: { content: [{ type: 'text', text: JSON.stringify(state) }], isError: false, structuredContent: state } }
128
- if (e.tool === 'context_details') {
129
- const d = { ...DETAILS, name: e.args.name, in_chat: e.args.name === 'team', writes_here: e.args.name === 'team' }
127
+ if (e.tool === 'recent') return { value: { content: [{ type: 'text', text: JSON.stringify(state) }], isError: false, structuredContent: state } }
128
+ if (e.tool === 'context_info') {
129
+ const d = { ...DETAILS, name: e.args.context, in_chat: e.args.context === 'team', writes_here: e.args.context === 'team' }
130
130
  return { value: { content: [{ type: 'text', text: JSON.stringify(d) }], isError: false, structuredContent: d } }
131
131
  }
132
132
  if (e.tool === 'search') {
@@ -137,7 +137,7 @@ function engine(on: any, calls: Calls, prompts: string[] = [], state: unknown =
137
137
  return { value: { content: [{ type: 'text', text: '{}' }], isError: false } }
138
138
  })
139
139
  }
140
- const acts = (calls: Calls) => calls.filter(c => c.tool !== 'context_activity' && c.tool !== 'search')
140
+ const acts = (calls: Calls) => calls.filter(c => c.tool !== 'recent' && c.tool !== 'search')
141
141
 
142
142
  test('the band shows loading until the server answers', async ($, on) => {
143
143
  engine(on, [])
@@ -203,7 +203,7 @@ test('the overview says what needs you, hands steering to the agent, and opens i
203
203
  expect((await desk.find({ key: 'fold-needs' }))?.text).toMatch(/^Show fewer things ▴/)
204
204
  expect(await desk.find({ type: 'Text', text: /bob replaced your claim c_old/ })).toBeDefined()
205
205
  await desk.press({ key: 'undo-change-x1' })
206
- expect(calls).toContainEqual({ tool: 'take_back', args: { id: 'x1' } })
206
+ expect(calls).toContainEqual({ tool: 'withdraw', args: { id: 'x1', undo_only: true } })
207
207
 
208
208
  await desk.press({ key: 'catch-up' })
209
209
  expect(prompts.at(-1)).toMatch(/^Catch me up on the context 'team'/)
@@ -284,7 +284,7 @@ test('editing the description takes the whole panel; claims show conflicts and h
284
284
  await desk.press({ key: 'edit-description' })
285
285
  expect(await desk.find({ key: 'tab-claims' })).toBeUndefined()
286
286
  await desk.input({ key: 'describe', text: 'What the team knows about checkout', kind: 'submit' })
287
- expect(calls).toContainEqual({ tool: 'describe_context', args: { description: 'What the team knows about checkout', context: 'team' } })
287
+ expect(calls).toContainEqual({ tool: 'update_context', args: { purpose: 'What the team knows about checkout', context: 'team' } })
288
288
 
289
289
  await desk.press({ key: 'tab-claims' })
290
290
  expect((await desk.find({ key: 'tab-claims' }))?.props.variant).toBe('primary')
@@ -295,7 +295,7 @@ test('editing the description takes the whole panel; claims show conflicts and h
295
295
  await desk.press({ key: 'keep-c_bob-over-c_cache' })
296
296
  expect(prompts.at(-1)).toMatch(/The claims c_bob \("The deploy caused it"\) and c_cache \("The cache caused it"\) contradict each other\. c_bob is the one that's right[\s\S]*withdraw c_cache/)
297
297
  await desk.press({ key: 'undo-c_held' })
298
- expect(calls).toContainEqual({ tool: 'take_back', args: { id: 'x1' } })
298
+ expect(calls).toContainEqual({ tool: 'withdraw', args: { id: 'x1', undo_only: true } })
299
299
 
300
300
  // History: what was believed before, and why it no longer stands.
301
301
  await desk.press({ key: 'scope-history' })
@@ -335,7 +335,7 @@ test('the people tab confirms a removal on its own, and invites to this context'
335
335
  expect(await desk.find({ type: 'Text', text: /Remove carol\?/ })).toBeDefined()
336
336
  expect(await desk.find({ key: 'invite' })).toBeUndefined()
337
337
  await desk.press({ key: 'confirm-cccc-dddd-eeee' })
338
- expect(calls).toContainEqual({ tool: 'remove_peer', args: { name: 'carol' } })
338
+ expect(calls).toContainEqual({ tool: 'manage_member', args: { action: 'remove', name: 'carol' } })
339
339
  // The open join codes, each to copy or cancel; making one is its own step.
340
340
  expect(await desk.find({ type: 'Text', text: /2 waiting/ })).toBeDefined()
341
341
  expect(await desk.find({ type: 'Text', text: /For Sam · contributor · expires in 23h/ })).toBeDefined()
@@ -344,7 +344,7 @@ test('the people tab confirms a removal on its own, and invites to this context'
344
344
  await desk.press({ key: 'copy-inv_1' })
345
345
  expect(prompts).toContain('copied: Join my context graph: /vine-context:join vine1_room.secret')
346
346
  await desk.press({ key: 'cancel-inv_2' })
347
- expect(calls).toContainEqual({ tool: 'revoke_invite', args: { id: 'inv_2' } })
347
+ expect(calls).toContainEqual({ tool: 'manage_member', args: { action: 'revoke_invite', invite: 'inv_2' } })
348
348
  await desk.press({ key: 'invite' })
349
349
  expect(await desk.find({ type: 'Text', text: /Invite someone to team/ })).toBeDefined()
350
350
  expect(await desk.find({ key: 'rename' })).toBeUndefined()
@@ -366,9 +366,9 @@ test('the people tab confirms a removal on its own, and invites to this context'
366
366
  await desk.press({ key: 'rename' })
367
367
  expect(await desk.find({ key: 'invite' })).toBeUndefined()
368
368
  await desk.input({ key: 'my-name', text: 'Ally', kind: 'submit' })
369
- expect(calls).toContainEqual({ tool: 'set_my_name', args: { name: 'Ally' } })
369
+ expect(calls).toContainEqual({ tool: 'update_context', args: { my_name: 'Ally' } })
370
370
  await desk.press({ key: 'sync-toggle' })
371
- expect(calls).toContainEqual({ tool: 'stop_sharing', args: {} })
371
+ expect(calls).toContainEqual({ tool: 'sharing', args: { action: 'off' } })
372
372
  await desk.unmount()
373
373
  })
374
374
 
@@ -385,9 +385,9 @@ test('the Contexts view turns contexts on and off, creates one in its own step,
385
385
  // A long name can push the toggle to its own line, never past the card's edge.
386
386
  expect((await desk.find({ key: 'ctx-head-team' }))?.props.flexWrap).toBe('wrap')
387
387
  await desk.press({ key: 'toggle-own' })
388
- expect(calls).toContainEqual({ tool: 'add_context', args: { name: 'own' } })
388
+ expect(calls).toContainEqual({ tool: 'use_context', args: { name: 'own', mode: 'add' } })
389
389
  await desk.press({ key: 'toggle-team' })
390
- expect(calls).toContainEqual({ tool: 'remove_context', args: { name: 'team' } })
390
+ expect(calls).toContainEqual({ tool: 'use_context', args: { name: 'team', mode: 'remove' } })
391
391
  // Each context has its own pin for the chat's folder, whose path keeps its end.
392
392
  // The folder shows as much of its path as the pane has room for.
393
393
  expect((await desk.find({ key: 'pin-team' }))?.text).toBe('📌 Turn on for new chats in /Users/alice/work/shop/services/checkout')
@@ -419,7 +419,7 @@ test('the Contexts view turns contexts on and off, creates one in its own step,
419
419
  expect(calls.some(c => c.args.name === 'ops-notes')).toBe(false)
420
420
  await desk.input({ key: 'new-description', text: 'Runbooks and on-call notes', kind: 'change' })
421
421
  await desk.press({ key: 'create-context' })
422
- expect(calls).toContainEqual({ tool: 'add_context', args: { name: 'ops-notes', description: 'Runbooks and on-call notes' } })
422
+ expect(calls).toContainEqual({ tool: 'use_context', args: { name: 'ops-notes', description: 'Runbooks and on-call notes', mode: 'add' } })
423
423
  expect(await desk.find({ key: 'new-name' })).toBeUndefined()
424
424
 
425
425
  // Cancel leaves the list as it was.
@@ -450,7 +450,7 @@ test('a context opens from the list on its tabs or its Settings tab, an off one
450
450
  await desk.press({ key: 'switch' })
451
451
  await desk.press({ key: 'name-team' })
452
452
  expect(await desk.find({ key: 'tab-overview' })).toBeDefined() // open, on the tab it was left on
453
- expect(calls.some(c => c.tool === 'context_details')).toBe(false)
453
+ expect(calls.some(c => c.tool === 'context_info')).toBe(false)
454
454
  await desk.press({ key: 'switch' })
455
455
  expect(await desk.find({ key: 'details-team' })).toBeUndefined()
456
456
  await desk.press({ key: 'open-team' })
@@ -459,7 +459,7 @@ test('a context opens from the list on its tabs or its Settings tab, an off one
459
459
  await desk.press({ key: 'switch' })
460
460
  await desk.press({ key: 'settings-team' })
461
461
  expect((await desk.find({ key: 'tab-settings' }))?.props.variant).toBe('primary')
462
- expect(calls).toContainEqual({ tool: 'context_details', args: { name: 'team' } })
462
+ expect(calls).toContainEqual({ tool: 'context_info', args: { context: 'team', details: true } })
463
463
  expect(await desk.find({ type: 'Text', text: /6 claims · 2 questions · 2 replies/ })).toBeDefined()
464
464
  expect(await desk.find({ type: 'Text', text: /Syncing · 3 members · 1 of the others online now · 2 join codes not used yet/ })).toBeDefined()
465
465
  // The id every member shares sits under this machine's name for it.
@@ -480,7 +480,7 @@ test('a context opens from the list on its tabs or its Settings tab, an off one
480
480
  expect(await desk.find({ key: 'edit-description' })).toBeUndefined()
481
481
  expect(await desk.find({ key: 'detail-offline-team' })).toBeUndefined()
482
482
  await desk.press({ key: 'sync-toggle' })
483
- expect(calls.some(c => c.tool === 'stop_sharing')).toBe(true)
483
+ expect(calls.some(c => c.tool === 'sharing')).toBe(true)
484
484
  await desk.press({ key: 'detail-invite-team' })
485
485
  expect(await desk.find({ type: 'Text', text: /Invite someone to team/ })).toBeDefined()
486
486
  // A way out of a step leads with the ‹ caret, like Back.
@@ -492,17 +492,17 @@ test('a context opens from the list on its tabs or its Settings tab, an off one
492
492
  await desk.press({ key: 'switch' })
493
493
  expect(await desk.find({ key: 'open-own' })).toBeUndefined()
494
494
  await desk.press({ key: 'settings-own' })
495
- expect(calls).toContainEqual({ tool: 'context_details', args: { name: 'own' } })
495
+ expect(calls).toContainEqual({ tool: 'context_info', args: { context: 'own', details: true } })
496
496
  expect(await desk.find({ key: 'tab-settings' })).toBeUndefined()
497
497
  // Its page is the same Settings as an open context's: its name and description change here, and it can be shared.
498
498
  expect(await desk.find({ key: 'name-row-own' })).toBeDefined()
499
499
  await desk.press({ key: 'describe-own' })
500
500
  expect(await desk.find({ type: 'Text', text: /Describe own/ })).toBeDefined()
501
501
  await desk.input({ key: 'describe', text: 'My own notes', kind: 'submit' })
502
- expect(calls).toContainEqual({ tool: 'describe_context', args: { description: 'My own notes', context: 'own' } })
502
+ expect(calls).toContainEqual({ tool: 'update_context', args: { purpose: 'My own notes', context: 'own' } })
503
503
  expect(await desk.find({ key: 'ask-delete-own' })).toBeDefined() // back on its page
504
504
  await desk.press({ key: 'detail-offline-own' })
505
- expect(calls).toContainEqual({ tool: 'stop_sharing', args: { context: 'own' } })
505
+ expect(calls).toContainEqual({ tool: 'sharing', args: { action: 'off', context: 'own' } })
506
506
  await desk.press({ key: 'detail-invite-own' })
507
507
  expect(await desk.find({ type: 'Text', text: /Invite someone to own/ })).toBeDefined()
508
508
  await desk.input({ key: 'invite-note', text: 'Sam', kind: 'submit' })
@@ -516,9 +516,9 @@ test('a context opens from the list on its tabs or its Settings tab, an off one
516
516
  expect(await desk.find({ type: 'Text', text: /Rename own/ })).toBeDefined()
517
517
  await desk.input({ key: 'rename-context-own', text: 'team', kind: 'submit' })
518
518
  expect(await desk.find({ type: 'Text', text: /already a context 'team'/ })).toBeDefined()
519
- expect(calls.some(c => c.tool === 'rename_context')).toBe(false)
519
+ expect(calls.some(c => c.tool === 'update_context')).toBe(false)
520
520
  await desk.input({ key: 'rename-context-own', text: 'My Notes', kind: 'submit' })
521
- expect(calls).toContainEqual({ tool: 'rename_context', args: { name: 'own', to: 'my-notes' } })
521
+ expect(calls).toContainEqual({ tool: 'update_context', args: { context: 'own', rename_to: 'my-notes' } })
522
522
  // (This fake server keeps calling it 'own', so the page closes back to the list.)
523
523
  await desk.press({ key: 'settings-own' })
524
524
 
@@ -553,7 +553,7 @@ test('a context opens from the list on its tabs or its Settings tab, an off one
553
553
 
554
554
  test('an action that fails says why, and the next poll doesn\'t clear it', async ($, on) => {
555
555
  const calls: Calls = []
556
- engine(on, calls, [], ACTIVITY, { stop_sharing: 'The graph host failed to start', context_details: 'The embedder is not installed' })
556
+ engine(on, calls, [], ACTIVITY, { sharing: 'The graph host failed to start', context_info: 'The embedder is not installed' })
557
557
  await $.session.start(START)
558
558
  await $.command.run(RUN)
559
559
  const desk = await $.ui.mount({ ...PANE, surface: 'desktop' })
@@ -621,9 +621,9 @@ test('with several contexts, the band lists them and the panel shows one at a ti
621
621
  expect(await desk.find({ key: 'view-infra' })).toBeDefined()
622
622
  await desk.press({ key: 'tab-claims' })
623
623
  await desk.press({ key: 'undo-c_held' })
624
- expect(calls).toContainEqual({ tool: 'take_back', args: { id: 'x1', context: 'team' } })
624
+ expect(calls).toContainEqual({ tool: 'withdraw', args: { id: 'x1', undo_only: true, context: 'team' } })
625
625
  await desk.press({ key: 'view-infra' })
626
- expect(calls.some(c => c.tool === 'context_activity' && c.args.context === 'infra')).toBe(true)
626
+ expect(calls.some(c => c.tool === 'recent' && c.args.context === 'infra')).toBe(true)
627
627
  await desk.unmount()
628
628
  })
629
629
 
@@ -651,7 +651,7 @@ test('every view draws in the terminal too, and a reader gets no way to write',
651
651
  // Offline shows on the Overview, with the way back.
652
652
  expect(await term.find({ type: 'Text', text: /You’re offline/ })).toBeDefined()
653
653
  await term.press({ key: 'go-online' })
654
- expect(calls).toContainEqual({ tool: 'start_sharing', args: {} })
654
+ expect(calls).toContainEqual({ tool: 'sharing', args: { action: 'on' } })
655
655
  expect(await term.find({ key: 'save-chat' })).toBeUndefined()
656
656
  for (const tab of ['questions', 'claims', 'people', 'overview']) {
657
657
  await term.press({ key: `tab-${tab}` })
@@ -678,7 +678,7 @@ test('the band says what is wrong, instead of loading forever, when the server k
678
678
  on('clock.now', () => ({ value: now }))
679
679
  on('ui.status', () => ({ value: undefined }))
680
680
  on('session.start', (_: unknown, e: any) => ({ cwd: e.cwd }))
681
- on('mcp.call', () => ({ value: { content: [{ type: 'text', text: 'Tool context_activity not found' }], isError: true } }))
681
+ on('mcp.call', () => ({ value: { content: [{ type: 'text', text: 'Tool recent not found' }], isError: true } }))
682
682
  on('ui.open', () => ({ value: { isPlaced: true } }))
683
683
  await $.session.start(START)
684
684
  await $.command.run(RUN)
@@ -74,7 +74,7 @@ export type Invite = {
74
74
  expires_at: string
75
75
  }
76
76
 
77
- /** One of this machine's contexts in full (the server's `context_details`), for the panel's details view. */
77
+ /** One of this machine's contexts in full (the server's `context_info` with `details`), for the panel's details view. */
78
78
  export type ContextDetails = {
79
79
  name: string
80
80
  id: string | null
@@ -133,7 +133,7 @@ declare module 'claude-code' {
133
133
  creating: { error: string | null } | null
134
134
  /** A context that's off for this chat (by name), shown on its own page: it can't be opened. Null is the list. */
135
135
  managing: string | null
136
- /** The details (`context_details`) of that context, or of the open context's Settings tab, once the server has answered. */
136
+ /** The details (`context_info` with `details`) of that context, or of the open context's Settings tab, once the server has answered. */
137
137
  details: ContextDetails | null
138
138
  /** The context whose deletion is being confirmed (the panel shows only that), with what's wrong with what was typed. */
139
139
  deleting: { name: string; error: string | null } | null