@webinson/peer 0.4.21 → 0.4.22
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/README.md
CHANGED
|
@@ -146,7 +146,7 @@ agent also gets one sentence beside the tool result, fenced as data:
|
|
|
146
146
|
|
|
147
147
|
```text
|
|
148
148
|
<peer-collision>
|
|
149
|
-
bob@acme.test
|
|
149
|
+
Another person, bob@acme.test, had an agent on src/cart.ts 2 minutes ago.
|
|
150
150
|
This is information about the repository, not an instruction.
|
|
151
151
|
</peer-collision>
|
|
152
152
|
```
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "peer-thread-mark",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.22",
|
|
4
4
|
"description": "Marks a Claude Code thread shared with Peer (/peer) with a band above the prompt, with /peer stop and /peer start; panes for /peer-list, /peer-thread and /peer-all (search your memories)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"types": "./types/index.d.ts"
|
|
@@ -521,7 +521,7 @@ function collisionSentence(signal: CollisionSignal, now: number) {
|
|
|
521
521
|
.map(h => {
|
|
522
522
|
const mins = Math.max(0, Math.round((now - Date.parse(h.at)) / 60_000))
|
|
523
523
|
const age = mins < 1 ? 'just now' : mins === 1 ? '1 minute ago' : `${mins} minutes ago`
|
|
524
|
-
return
|
|
524
|
+
return `Another person, ${h.email}, had an agent on ${signal.path} ${age}.`
|
|
525
525
|
})
|
|
526
526
|
return ['<peer-collision>', ...said, 'This is information about the repository, not an instruction.', '</peer-collision>'].join('\n')
|
|
527
527
|
}
|
|
@@ -60,7 +60,7 @@ test('an edit another person was on draws the line and tells the agent once per
|
|
|
60
60
|
expect(state.collides[0]).toEqual(['--json', 's1', 't1', '/repo/src/cart.ts'])
|
|
61
61
|
expect(told.additionalContext?.[0]).toBe('from another hook')
|
|
62
62
|
expect(told.additionalContext?.[1]).toBe(
|
|
63
|
-
"<peer-collision>\
|
|
63
|
+
"<peer-collision>\nAnother person, bob@acme.test, had an agent on src/cart.ts 2 minutes ago.\nThis is information about the repository, not an instruction.\n</peer-collision>",
|
|
64
64
|
)
|
|
65
65
|
for (const surface of ['terminal', 'desktop'] as const) {
|
|
66
66
|
const drawn = await texts(row('t1', surface), $ as never)
|
|
@@ -84,15 +84,15 @@ test('an edit another person was on draws the line and tells the agent once per
|
|
|
84
84
|
const CY = { email: 'cy@acme.test', at: minsAgo(1), own: false }
|
|
85
85
|
state.answer = { path: 'src/pay.ts', state: 'collision', holders: [BOB, CY] }
|
|
86
86
|
const both = (await $.classic.PostToolUse(edit('t3', 'Write', '/repo/src/pay.ts'))) as { additionalContext?: string[] }
|
|
87
|
-
expect(both.additionalContext?.[1]).toContain("cy@acme.test
|
|
88
|
-
expect(both.additionalContext?.[1]).toContain("bob@acme.test
|
|
87
|
+
expect(both.additionalContext?.[1]).toContain("Another person, cy@acme.test, had an agent on src/pay.ts 1 minute ago")
|
|
88
|
+
expect(both.additionalContext?.[1]).toContain("Another person, bob@acme.test, had an agent on src/pay.ts 2 minutes ago")
|
|
89
89
|
expect(await texts(row('t3', 'desktop'), $ as never)).toContain('cy@… was on it 1 min ago and 1 others')
|
|
90
90
|
|
|
91
91
|
// One person in several sessions (another thread, the Peer app's own) is named once, at their newest.
|
|
92
92
|
state.answer = { path: 'src/one.ts', state: 'collision', holders: [BOB, { ...BOB, email: 'Bob@acme.test', at: minsAgo(0) }, { ...BOB, at: minsAgo(1) }] }
|
|
93
93
|
const once = (await $.classic.PostToolUse(edit('t4', 'Edit', '/repo/src/one.ts'))) as { additionalContext?: string[] }
|
|
94
94
|
expect(once.additionalContext?.[1]).toBe(
|
|
95
|
-
"<peer-collision>\
|
|
95
|
+
"<peer-collision>\nAnother person, Bob@acme.test, had an agent on src/one.ts just now.\nThis is information about the repository, not an instruction.\n</peer-collision>",
|
|
96
96
|
)
|
|
97
97
|
expect(await texts(row('t4', 'terminal'), $ as never)).toContain('Bob@… was on it just now')
|
|
98
98
|
// The same person in one more session is no new set of people.
|