vine-context 0.0.1 → 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.
Files changed (34) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +279 -3
  3. package/dist/apps/shell.html +149 -0
  4. package/dist/apps/views.html +144 -0
  5. package/dist/cli.js +7825 -0
  6. package/dist/cli.js.map +1 -0
  7. package/examples/data/graphs/party/.cypherlite/schema/schema.cypher +5 -0
  8. package/examples/data/graphs/party/.cypherlite.lock +1 -0
  9. package/examples/data/graphs/party/.cypherlite.writer +0 -0
  10. package/examples/data/graphs/party/manifest.json +215 -0
  11. package/examples/data/graphs/party/nodes/0-262144-7987dd27c85668d4810609133f705907.parquet +0 -0
  12. package/examples/data/graphs/party/wal/.cypherlite.lock +1 -0
  13. package/examples/data/graphs/party/wal/.cypherlite.writer +0 -0
  14. package/examples/data/graphs/party/wal/00000002.log +0 -0
  15. package/examples/data/hosts/party/changes.jsonl +19 -0
  16. package/examples/data/hosts/party/group.json +5 -0
  17. package/examples/data/hosts/party/sharing.json +1 -0
  18. package/examples/data/identity.json +4 -0
  19. package/models/temporal-claims/instructions.md +78 -0
  20. package/models/temporal-claims/model.yaml +99 -0
  21. package/models/temporal-claims/tools.yaml +344 -0
  22. package/package.json +71 -3
  23. package/plugin/.claude-plugin/plugin.json +8 -0
  24. package/plugin/.codex-plugin/plugin.json +17 -0
  25. package/plugin/.mcp.json +8 -0
  26. package/plugin/codex/hooks.json +11 -0
  27. package/plugin/commands/join.md +22 -0
  28. package/plugin/hooks/hooks.json +11 -0
  29. package/plugin/hooks/register.tsx +2310 -0
  30. package/plugin/hooks/vine-hook.mjs +25 -0
  31. package/plugin/skills/join-context-graph/SKILL.md +36 -0
  32. package/plugin/skills/vine-context/SKILL.md +235 -0
  33. package/plugin/tests/context-graph.test.tsx +830 -0
  34. package/plugin/types/index.d.ts +165 -0
@@ -0,0 +1,165 @@
1
+ // What the vine-context mod keeps in $.state: the latest activity and
2
+ // snapshot of this chat's context from the MCP server, and the panel's choices.
3
+
4
+ export type Person = {
5
+ name: string
6
+ fingerprint: string
7
+ role: 'reader' | 'contributor' | 'admin' | null
8
+ you: boolean
9
+ creator: boolean
10
+ online: boolean
11
+ /** When they joined (absent from older servers). */
12
+ joined_at?: string
13
+ agent: string | null
14
+ platform: string | null
15
+ }
16
+
17
+ export type Change = {
18
+ id: string
19
+ kind: string
20
+ at: string
21
+ by: string
22
+ mine: boolean
23
+ summary: string
24
+ node: string | null
25
+ held: boolean
26
+ shared_at: string | null
27
+ }
28
+
29
+ export type GraphNode = {
30
+ id: string
31
+ key: string
32
+ label: 'Claim' | 'Question' | 'Reply'
33
+ title: string
34
+ ended: boolean
35
+ props: Record<string, unknown>
36
+ }
37
+
38
+ export type GraphEdge = { type: string; source: string; target: string }
39
+
40
+ export type Activity = {
41
+ using: string
42
+ graph: string
43
+ created_by: string | null
44
+ you: { name: string; role: Person['role']; fingerprint: string }
45
+ sharing: boolean
46
+ online: string[]
47
+ members: number
48
+ people: Person[]
49
+ relays_up: number
50
+ changes: number
51
+ recent: Change[]
52
+ /** The context this activity is about (the one the panel shows). */
53
+ context: string
54
+ description: string | null
55
+ /** This chat's contexts: usually one. */
56
+ contexts: { name: string; description: string | null; role: Person['role']; writes_here: boolean }[]
57
+ /** The folder this chat started in, and whether new chats there start with this chat's contexts. */
58
+ /** `pinned`: the contexts new chats in that folder start with (absent from older servers). */
59
+ folder: { folder: string; linked: boolean; pinned?: string[] } | null
60
+ your_contexts: string[]
61
+ digest: { at: string; lines: string[] }[]
62
+ /** An admin's open join codes, newest first (absent for other roles). */
63
+ invites?: Invite[]
64
+ snapshot?: { nodes: GraphNode[]; edges: GraphEdge[]; truncated: boolean }
65
+ }
66
+
67
+ /** A join code waiting for its one person. */
68
+ export type Invite = {
69
+ id: string
70
+ label: string | null
71
+ role: 'reader' | 'contributor' | 'admin'
72
+ code: string
73
+ created_at: string
74
+ expires_at: string
75
+ }
76
+
77
+ /** One of this machine's contexts in full (the server's `context_info` with `details`), for the panel's details view. */
78
+ export type ContextDetails = {
79
+ name: string
80
+ id: string | null
81
+ description: string | null
82
+ role: Person['role']
83
+ /** Whether you made it. */
84
+ yours: boolean
85
+ created_by: string | null
86
+ in_chat: boolean
87
+ writes_here: boolean
88
+ sharing: boolean
89
+ members: number
90
+ /** How many of the other members are online. */
91
+ online: number
92
+ /** How many items of each kind it holds, withdrawn ones included. */
93
+ items: Record<string, number>
94
+ changes: number
95
+ held: number
96
+ /** Join codes waiting to be used; null unless you're an admin. */
97
+ open_invites: number | null
98
+ stored_at: string
99
+ }
100
+
101
+ export type Tab = 'overview' | 'questions' | 'claims' | 'people' | 'settings'
102
+
103
+ /** What the Questions and Claims lists show: the words to match, and which part of each list. */
104
+ export type Filters = {
105
+ text: string
106
+ claims: 'current' | 'mine' | 'conflicts' | 'history'
107
+ questions: 'open' | 'answered' | 'mine'
108
+ }
109
+
110
+ /**
111
+ * What the server's search (meaning plus keywords) found for the filter's text
112
+ * in a context, best first: item ids, or null while it's looking.
113
+ */
114
+ export type Found = { text: string; context: string; ids: string[] | null; failed?: boolean }
115
+
116
+ /** The latest line from someone else, for the band. */
117
+ export type Latest = { by: string; summary: string; at: string }
118
+
119
+ declare module 'claude-code' {
120
+ interface PluginState {
121
+ 'vine-context': {
122
+ activity: Shaped<Activity | null>
123
+ latest: Latest | null
124
+ tab: Shaped<Tab>
125
+ /** The invite just made (its id), marked in the list until another is made. */
126
+ code: string | null
127
+ /** The new-invite step: the context it's for (on or off for this chat) and the role picked; null while it's closed. A value from before it named the context is ignored. */
128
+ inviting: { name: string; role: Invite['role'] } | null
129
+ notice: string | null
130
+ error: string | null
131
+ confirmRemove: string | null
132
+ /** The new-context step (the panel shows only that), with what's wrong with what was typed; null while it's closed. */
133
+ creating: { error: string | null } | null
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
+ managing: string | null
136
+ /** The details (`context_info` with `details`) of that context, or of the open context's Settings tab, once the server has answered. */
137
+ details: ContextDetails | null
138
+ /** The context whose deletion is being confirmed (the panel shows only that), with what's wrong with what was typed. */
139
+ deleting: { name: string; error: string | null } | null
140
+ /** The context whose description is being edited (the panel shows only that); false while no one is. A `true` from before it named the context is ignored. */
141
+ editing: string | boolean
142
+ /** The context being renamed on this machine (the panel shows only that); null while none is. */
143
+ renamingContext: string | null
144
+ /** Whether the panel shows the chat's contexts, to turn on and off, instead of a context. */
145
+ switching: boolean
146
+ /** Which of the chat's contexts the panel shows; null is the one writes go to. */
147
+ viewing: string | null
148
+ /** Counts up while the band waits for the server, to animate "loading…". */
149
+ tick: number
150
+ /** The item (a claim's or question's id) the panel shows on its own; null is the lists. */
151
+ detail: string | null
152
+ /** Whether your name is being changed (the panel shows only that). */
153
+ renaming: boolean
154
+ filters: Filters
155
+ /** The search behind the filter's text: the lists add its best matches to those that share its words. */
156
+ found: Found | null
157
+ /** How many more items than the first page a list shows. */
158
+ more: number
159
+ /** The folded parts the person has opened ("3 more ▾"), by id: everything else shows only its first few. */
160
+ folds: string[]
161
+ /** With no context in this chat (there's no default): the contexts on this machine to choose from. Null while it has one. */
162
+ unattached: string[] | null
163
+ }
164
+ }
165
+ }