@yaks/browse 0.0.0-stage → 0.2.36

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 (271) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +324 -2
  3. package/_dist/app.d.ts +8 -0
  4. package/_dist/app.d.ts.map +1 -0
  5. package/_dist/cli.d.ts +16 -0
  6. package/_dist/cli.d.ts.map +1 -0
  7. package/_dist/hosting.d.ts +24 -0
  8. package/_dist/hosting.d.ts.map +1 -0
  9. package/_dist/mod.d.ts +7 -0
  10. package/_dist/mod.d.ts.map +1 -0
  11. package/_dist/types.d.ts +5 -0
  12. package/_dist/types.d.ts.map +1 -0
  13. package/_dist/url.d.ts +2 -0
  14. package/_dist/url.d.ts.map +1 -0
  15. package/app.js +10 -0
  16. package/app.js.map +1 -0
  17. package/app.ts +10 -0
  18. package/browser-links.js +22 -0
  19. package/browser-links.js.map +1 -0
  20. package/browser-links.ts +28 -0
  21. package/cli.js +172 -0
  22. package/cli.js.map +1 -0
  23. package/cli.ts +168 -0
  24. package/client.js +748 -0
  25. package/client.js.map +1 -0
  26. package/client.ts +734 -0
  27. package/clipboard.js +18 -0
  28. package/clipboard.js.map +1 -0
  29. package/clipboard.ts +17 -0
  30. package/commands.js +1157 -0
  31. package/commands.js.map +1 -0
  32. package/commands.ts +1108 -0
  33. package/components/Ansi.tsx +160 -0
  34. package/components/App.tsx +446 -0
  35. package/components/Canvas.tsx +625 -0
  36. package/components/Card.tsx +276 -0
  37. package/components/Chat.tsx +205 -0
  38. package/components/Configuration.tsx +218 -0
  39. package/components/Decision.tsx +49 -0
  40. package/components/Dot.tsx +52 -0
  41. package/components/Entity.tsx +609 -0
  42. package/components/Fault.tsx +43 -0
  43. package/components/Filter.tsx +103 -0
  44. package/components/Keybindings.tsx +100 -0
  45. package/components/Keys.tsx +67 -0
  46. package/components/Markdown.tsx +90 -0
  47. package/components/Navigation.tsx +161 -0
  48. package/components/New.tsx +490 -0
  49. package/components/Peek.tsx +168 -0
  50. package/components/Prio.tsx +20 -0
  51. package/components/Run.tsx +263 -0
  52. package/components/Search.tsx +280 -0
  53. package/components/Stamp.tsx +44 -0
  54. package/components/Status.tsx +514 -0
  55. package/components/Sync.tsx +173 -0
  56. package/components/Tile.tsx +50 -0
  57. package/components/answered.js +23 -0
  58. package/components/answered.js.map +1 -0
  59. package/components/answered.ts +25 -0
  60. package/components/comp.js +11 -0
  61. package/components/comp.js.map +1 -0
  62. package/components/comp.ts +10 -0
  63. package/components/drag.js +173 -0
  64. package/components/drag.js.map +1 -0
  65. package/components/drag.ts +198 -0
  66. package/components/fields.tsx +90 -0
  67. package/components/fixtures/README.md +10 -0
  68. package/components/fixtures/archetypes.json +3646 -0
  69. package/components/hits.js +63 -0
  70. package/components/hits.js.map +1 -0
  71. package/components/hits.ts +84 -0
  72. package/components/icons.tsx +177 -0
  73. package/components/inspect.tsx +331 -0
  74. package/components/mount.ts +79 -0
  75. package/components/nav.tsx +479 -0
  76. package/components/offers.js +26 -0
  77. package/components/offers.js.map +1 -0
  78. package/components/offers.ts +54 -0
  79. package/components/page.js +21 -0
  80. package/components/page.js.map +1 -0
  81. package/components/page.ts +18 -0
  82. package/components/read.js +5 -0
  83. package/components/read.js.map +1 -0
  84. package/components/read.ts +7 -0
  85. package/components/registry.js +285 -0
  86. package/components/registry.js.map +1 -0
  87. package/components/registry.ts +317 -0
  88. package/components/session_status.tsx +115 -0
  89. package/components/subscriptions.js +149 -0
  90. package/components/subscriptions.js.map +1 -0
  91. package/components/subscriptions.ts +161 -0
  92. package/components/title.tsx +21 -0
  93. package/components/useQuery.js +166 -0
  94. package/components/useQuery.js.map +1 -0
  95. package/components/useQuery.ts +211 -0
  96. package/components/views/Board.tsx +450 -0
  97. package/components/views/BoardTile.tsx +65 -0
  98. package/components/views/Dashboard.tsx +148 -0
  99. package/components/views/Debug.tsx +445 -0
  100. package/components/views/Dependency.tsx +51 -0
  101. package/components/views/Entry.tsx +500 -0
  102. package/components/views/Gist.tsx +28 -0
  103. package/components/views/Inline.tsx +54 -0
  104. package/components/views/Json.tsx +19 -0
  105. package/components/views/Layout.tsx +211 -0
  106. package/components/views/List.tsx +238 -0
  107. package/components/views/Md.tsx +43 -0
  108. package/components/views/Media.tsx +48 -0
  109. package/components/views/Memory.tsx +32 -0
  110. package/components/views/Relate.tsx +205 -0
  111. package/components/views/Search.tsx +42 -0
  112. package/components/views/Session.tsx +850 -0
  113. package/components/views/SessionManage.tsx +127 -0
  114. package/components/views/Show.tsx +758 -0
  115. package/components/views/Shown.tsx +72 -0
  116. package/components/views/Split.tsx +58 -0
  117. package/components/views/TaskTile.tsx +37 -0
  118. package/components/views/Title.tsx +105 -0
  119. package/components/views/Wake.tsx +77 -0
  120. package/components/views/Web.tsx +49 -0
  121. package/components/wells.js +30 -0
  122. package/components/wells.js.map +1 -0
  123. package/components/wells.ts +33 -0
  124. package/configuration.js +38 -0
  125. package/configuration.js.map +1 -0
  126. package/configuration.ts +41 -0
  127. package/decision_sync.js +88 -0
  128. package/decision_sync.js.map +1 -0
  129. package/decision_sync.ts +93 -0
  130. package/deno.json +1 -0
  131. package/domain-host.tsx +108 -0
  132. package/edge.js +193 -0
  133. package/edge.js.map +1 -0
  134. package/edge.ts +196 -0
  135. package/entry_log.js +241 -0
  136. package/entry_log.js.map +1 -0
  137. package/entry_log.ts +214 -0
  138. package/failure.js +22 -0
  139. package/failure.js.map +1 -0
  140. package/failure.ts +34 -0
  141. package/front.json +61 -0
  142. package/highlight.js +143 -0
  143. package/highlight.js.map +1 -0
  144. package/highlight.ts +149 -0
  145. package/history.js +68 -0
  146. package/history.js.map +1 -0
  147. package/history.ts +72 -0
  148. package/host_commands.js +107 -0
  149. package/host_commands.js.map +1 -0
  150. package/host_commands.ts +38 -0
  151. package/hosting.js +53 -0
  152. package/hosting.js.map +1 -0
  153. package/hosting.ts +72 -0
  154. package/idb.js +14 -0
  155. package/idb.js.map +1 -0
  156. package/idb.ts +15 -0
  157. package/index.js +232 -0
  158. package/index.js.map +1 -0
  159. package/index.ts +252 -0
  160. package/keybindings.js +136 -0
  161. package/keybindings.js.map +1 -0
  162. package/keybindings.ts +37 -0
  163. package/kit.js +103 -0
  164. package/kit.js.map +1 -0
  165. package/kit.ts +119 -0
  166. package/layout.js +254 -0
  167. package/layout.js.map +1 -0
  168. package/layout.ts +210 -0
  169. package/legacy_outbox.js +53 -0
  170. package/legacy_outbox.js.map +1 -0
  171. package/legacy_outbox.ts +63 -0
  172. package/live.js +2883 -0
  173. package/live.js.map +1 -0
  174. package/live.ts +3334 -0
  175. package/live_archetypes.js +92 -0
  176. package/live_archetypes.js.map +1 -0
  177. package/live_archetypes.ts +113 -0
  178. package/live_client.js +145 -0
  179. package/live_client.js.map +1 -0
  180. package/live_client.ts +120 -0
  181. package/main.tsx +5 -0
  182. package/mod.js +7 -0
  183. package/mod.js.map +1 -0
  184. package/mod.ts +7 -0
  185. package/mount.tsx +50 -0
  186. package/navigation.js +120 -0
  187. package/navigation.js.map +1 -0
  188. package/navigation.ts +152 -0
  189. package/near.js +83 -0
  190. package/near.js.map +1 -0
  191. package/near.ts +83 -0
  192. package/new.js +295 -0
  193. package/new.js.map +1 -0
  194. package/new.ts +361 -0
  195. package/outbox.js +112 -0
  196. package/outbox.js.map +1 -0
  197. package/outbox.ts +129 -0
  198. package/owner.js +39 -0
  199. package/owner.js.map +1 -0
  200. package/owner.ts +37 -0
  201. package/package.json +81 -4
  202. package/paste.js +157 -0
  203. package/paste.js.map +1 -0
  204. package/paste.ts +122 -0
  205. package/props.js +303 -0
  206. package/props.js.map +1 -0
  207. package/props.ts +358 -0
  208. package/providers.js +136 -0
  209. package/providers.js.map +1 -0
  210. package/providers.ts +194 -0
  211. package/query.js +987 -0
  212. package/query.js.map +1 -0
  213. package/query.ts +1113 -0
  214. package/remote.js +37 -0
  215. package/remote.js.map +1 -0
  216. package/remote.ts +46 -0
  217. package/resolver.js +149 -0
  218. package/resolver.js.map +1 -0
  219. package/resolver.ts +213 -0
  220. package/rfc2047.js +37 -0
  221. package/rfc2047.js.map +1 -0
  222. package/rfc2047.ts +40 -0
  223. package/row_holds.js +107 -0
  224. package/row_holds.js.map +1 -0
  225. package/row_holds.ts +93 -0
  226. package/served.ts +42 -0
  227. package/session_worktree.js +7 -0
  228. package/session_worktree.js.map +1 -0
  229. package/session_worktree.ts +16 -0
  230. package/sessions.js +57 -0
  231. package/sessions.js.map +1 -0
  232. package/sessions.ts +53 -0
  233. package/sha.js +161 -0
  234. package/sha.js.map +1 -0
  235. package/sha.ts +164 -0
  236. package/styles.css +2823 -0
  237. package/subs.js +36 -0
  238. package/subs.js.map +1 -0
  239. package/subs.ts +40 -0
  240. package/terminal-route.js +13 -0
  241. package/terminal-route.js.map +1 -0
  242. package/terminal-route.ts +17 -0
  243. package/terminal.js +251 -0
  244. package/terminal.js.map +1 -0
  245. package/terminal.ts +186 -0
  246. package/time.js +142 -0
  247. package/time.js.map +1 -0
  248. package/time.ts +133 -0
  249. package/title.js +25 -0
  250. package/title.js.map +1 -0
  251. package/title.ts +50 -0
  252. package/tui/doc.ts +6 -0
  253. package/tui/testing.ts +19 -0
  254. package/twin.js +11 -0
  255. package/twin.js.map +1 -0
  256. package/twin.ts +13 -0
  257. package/types.js +456 -0
  258. package/types.js.map +1 -0
  259. package/types.ts +1370 -0
  260. package/url.js +77 -0
  261. package/url.js.map +1 -0
  262. package/url.ts +85 -0
  263. package/verb.js +82 -0
  264. package/verb.js.map +1 -0
  265. package/verb.ts +137 -0
  266. package/warmth.js +41 -0
  267. package/warmth.js.map +1 -0
  268. package/warmth.ts +54 -0
  269. package/wire.js +86 -0
  270. package/wire.js.map +1 -0
  271. package/wire.ts +63 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigation.js","sources":["./navigation.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,4EAA4E;AAC5E,6DAA6D;AAC7D,2EAA2E;AAC3E,kEAAkE;AAClE,4EAA4E;AAC5E,0EAA0E;AA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QAAY,MAAM;MAAW;KAAE,GAC/D,EAAE;GACP,CAAA;AAED,uEAAuE,GACvE,OAAO,IAAI,UAAU,CAAC,IAAY;EAChC,IAAI,MAAM,IAAI,IAAI,IAAI;EACtB,IAAI,OAAO,IAAI,QAAQ,GAAG,CAAC,IAAI,MAAM,IAAI,MAAM,KAAK,IAAI,MAAM;EAC9D,OAAO,IAAI,IAAI,CAAC,CAAC,IAAM,EAAE,IAAI,IAAI;AACnC,EAAC"}
package/navigation.ts ADDED
@@ -0,0 +1,152 @@
1
+ // The places the sidebar offers, as data: home, the destinations, and the
2
+ // schema. A destination is a page at `/?page=<key>`: a list of what a query
3
+ // finds, a package's page part above it, or that part alone.
4
+ // Browse offers the ones that read its own words (favorites, recent edits,
5
+ // sessions); a package offers its own from its `./views` facet as
6
+ // `destinations`, so a tracker lists its bugs without Browse knowing a bug.
7
+ // A favorite is a facet, so marking a task never changes its kind, id, or
8
+ // renderer.
9
+ import { queryAt, querySearch } from '@yaks/query'
10
+ import type { Vocab } from 'jsr:@yaks/vocab@0.2.36'
11
+ import type { Change, Ent } from './types.ts'
12
+
13
+ /** A page the sidebar lists, at `/?page=<key>`: what `query` finds, under the
14
+ * page part `view` draws, or that part alone. */
15
+ export type Destination = {
16
+ /** its address, `/?page=<key>` */
17
+ key: string
18
+ /** what the sidebar and the page's bar call it */
19
+ name: string
20
+ /** a Lucide icon's name */
21
+ icon: string
22
+ /** the rows it lists, filtered from the page's bar; none where its view
23
+ * is the whole page */
24
+ query?: string
25
+ /** a page part drawn above its list, by the name of its view */
26
+ view?: string
27
+ }
28
+
29
+ /** A line in the sidebar. */
30
+ export type Place = { name: string; icon: string; path: string }
31
+
32
+ export let favoriteChange = (e: Ent): Change => ({
33
+ eid: e.eid,
34
+ name: 'favorite',
35
+ comp: e.favorite ? null : {},
36
+ })
37
+
38
+ export let favoriteLabel = (e: Ent) =>
39
+ e.favorite ? 'remove from favorites' : 'add to favorites'
40
+
41
+ /** The destinations, in the sidebar's order: Browse's own personal ones
42
+ * (favorites, then what this person opened lately), each package's in config
43
+ * order, then the sessions; a key once, the first offer kept. */
44
+ export let destinations = (
45
+ vocab: Vocab,
46
+ _actor: string | undefined,
47
+ sessions: string,
48
+ contributed: Destination[],
49
+ ): Destination[] => {
50
+ let seen = new Set<string>()
51
+ return [
52
+ ...vocab.comp('favorite')
53
+ ? [{
54
+ key: 'favorites',
55
+ name: 'Favorites',
56
+ icon: 'star',
57
+ query: '.favorite *',
58
+ }]
59
+ : [],
60
+ ...vocab.comp('updated')
61
+ ? [{
62
+ key: 'recent',
63
+ name: 'Recent',
64
+ icon: 'clock',
65
+ query: '.updated * .order=-updated.at .limit=50',
66
+ }]
67
+ : [],
68
+ ...contributed,
69
+ ...sessions
70
+ ? [{
71
+ key: 'sessions',
72
+ name: 'Sessions',
73
+ icon: 'bot',
74
+ query: sessions,
75
+ view: 'Sessions.Controls',
76
+ }]
77
+ : [],
78
+ ].filter((d) => !seen.has(d.key) && !!seen.add(d.key))
79
+ }
80
+
81
+ /** The destination an address is: `/?page=<key>` and nothing else. */
82
+ export let destinationAt = (
83
+ at: string,
84
+ all: Destination[],
85
+ ): Destination | undefined => {
86
+ let page = pageAt(at)
87
+ return page ? all.find((d) => d.key == page.get('page')) : undefined
88
+ }
89
+
90
+ // Page selectors are plain parameters; query clauses carry a sigil.
91
+ // Entity-page view parameters remain on their path.
92
+ let pageAt = (at: string): URLSearchParams | undefined => {
93
+ let url = new URL(at, 'http://x')
94
+ let { query, state } = queryAt(url.search)
95
+ return url.pathname == '/' && query == null ? state : undefined
96
+ }
97
+ export let destinationPath = (key: string) =>
98
+ `/${querySearch('', { page: key })}`
99
+
100
+ /** The schema: the inspector's map of how the data is made. */
101
+ export let schemaPath = destinationPath('map')
102
+ export let configPath = destinationPath('config')
103
+ export let configAt = (at: string): boolean =>
104
+ pageAt(at)?.get('page') == 'config'
105
+ export let schemaAt = (at: string): boolean => pageAt(at)?.get('page') == 'map'
106
+
107
+ /** New entities, made in an entity or like one, each named by human id or eid. */
108
+ /// newAt('/?page=new') -> {}
109
+ /// newAt('/?page=new&in=T-1&like=T-2') -> {in: 'T-1', like: 'T-2'}
110
+ /// newAt('/?page=map') -> undefined
111
+ export let newAt = (at: string): { in?: string; like?: string } | undefined => {
112
+ let state = pageAt(at)
113
+ if (state?.get('page') != 'new') return undefined
114
+ return Object.fromEntries(
115
+ ['in', 'like'].flatMap((k) => state.get(k) ? [[k, state.get(k)!]] : []),
116
+ )
117
+ }
118
+ /// newPath({in: 'T-1', like: undefined}) -> '/?page=new&in=T-1'
119
+ export let newPath = (at: { in?: string; like?: string } = {}): string =>
120
+ `/${
121
+ querySearch('', {
122
+ page: 'new',
123
+ ...Object.fromEntries(Object.entries(at).filter(([, v]) => v)),
124
+ })
125
+ }`
126
+
127
+ /** Every line in the sidebar: home, new, the destinations, the schema. */
128
+ export let places = (
129
+ home: Place,
130
+ all: Destination[],
131
+ schema: boolean,
132
+ configuration = false,
133
+ ): Place[] => [
134
+ home,
135
+ { name: 'New', icon: 'plus', path: newPath() },
136
+ ...all.map((d) => ({
137
+ name: d.name,
138
+ icon: d.icon,
139
+ path: destinationPath(d.key),
140
+ })),
141
+ ...schema ? [{ name: 'Schema', icon: 'database', path: schemaPath }] : [],
142
+ ...configuration
143
+ ? [{ name: 'Configuration', icon: 'settings', path: configPath }]
144
+ : [],
145
+ ]
146
+
147
+ /** The sidebar line an address lights: its own, or none for a search. */
148
+ export let placeAt = (at: string, all: Place[]): Place | undefined => {
149
+ let url = new URL(at, 'http://x')
150
+ let path = url.pathname + (url.search == '?' ? '' : url.search)
151
+ return all.find((p) => p.path == path)
152
+ }
package/near.js ADDED
@@ -0,0 +1,83 @@
1
+ // The near match a failed handle lookup names. Every door takes an entity
2
+ // by something a person types — an alias, a human id, a title word — and
3
+ // when that resolves to nothing the rejection is only a teaching moment if
4
+ // it can name the thing meant: `.filed.project=tasks` is rejected while the
5
+ // project called `tasks` exists under the alias `home`.
6
+ //
7
+ // Scoring lives here; RESOLVING does not. A caller offers the winner only
8
+ // after checking the handle it would print resolves, because a suggestion
9
+ // routing nowhere costs a reader who is already confused a second wrong
10
+ // try. That is the whole reason this is cheap and safe to add.
11
+ import { CLOSE, score } from "@yaks/names";
12
+ // What a candidate answers to, and what each answer is worth. An ALIAS is
13
+ // the handle — the thing a caller types — so it carries full weight; a
14
+ // title is what they read; the title's FIRST word is how a name gets
15
+ // abbreviated (`Task Graph` → tasks).
16
+ //
17
+ // Interior title words are deliberately absent. Scoring them let a common
18
+ // noun inside somebody's sentence win outright: `tasks` matched T-97
19
+ // ("… for new tasks (title + body)") at 1.0 and beat the project named
20
+ // Task Graph. A word deep in a long title is a coincidence, and the
21
+ // untargeted pool is the whole graph, so there is always one. Where the
22
+ // title is SHORT the containment rule already reaches its later words —
23
+ // `graph` covers most of `taskgraph` — which is the case worth having.
24
+ //
25
+ // A title that is not a NAME sits out entirely: a task reads "Tasks: add
26
+ // cancelled state…", which opens with the word and means nothing by it.
27
+ //
28
+ // A word answers once, at the most it is worth: a project's alias is often
29
+ // its title, and a one-word title its own first word.
30
+ let answers = (h)=>{
31
+ let title = h.named ? h.title ?? '' : '';
32
+ let words = [
33
+ [
34
+ h.alias ?? '',
35
+ 1
36
+ ],
37
+ [
38
+ title,
39
+ 0.95
40
+ ],
41
+ [
42
+ title.split(/\s+/)[0] ?? '',
43
+ 0.85
44
+ ]
45
+ ];
46
+ return words.filter(([w], i)=>words.findIndex(([x])=>x == w) == i);
47
+ };
48
+ // Each word is scored the way @yaks/names scores a typed name: containment
49
+ // that covers most of the longer word, else edit distance. That is what
50
+ // reaches `Task Graph` from `tasks`, and leaves `jef` inside every title
51
+ // about jeff@yak.sh a coincidence.
52
+ let closeness = (v, h)=>Math.max(...answers(h).map(([w, worth])=>worth * score(v, w)));
53
+ // The best candidate for `v`, or nothing when none is close enough to be
54
+ // worth a reader's second try. A tie goes to the one carrying an ALIAS: two
55
+ // entities wear the name `Task Graph` — the project and the board over it —
56
+ // and the aliased one is the one somebody decided should be addressable by
57
+ // name. Otherwise the first one met keeps it. One pass, since the pool is
58
+ // the whole graph.
59
+ export let nearest = (v, of)=>{
60
+ let best;
61
+ for (let h of of){
62
+ let c = closeness(v, h);
63
+ if (c < CLOSE) continue;
64
+ if (!best || c > best[1] || c == best[1] && h.alias && !best[0].alias) {
65
+ best = [
66
+ h,
67
+ c
68
+ ];
69
+ }
70
+ }
71
+ return best?.[0];
72
+ };
73
+ // The offer, spelled as the caller should type it: 'home' (P-19, Task
74
+ // Graph). The handle leads because that is the part they got wrong.
75
+ export let offer = (h)=>{
76
+ let lead = h.alias ? `'${h.alias}'` : h.id;
77
+ let rest = [
78
+ h.alias && h.id,
79
+ h.title
80
+ ].filter(Boolean);
81
+ return rest.length ? `${lead} (${rest.join(', ')})` : lead;
82
+ };
83
+ //# sourceMappingURL=near.js.map
package/near.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"near.js","sources":["./near.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,yEAAyE;AACzE,2EAA2E;AAC3E,4EAA4E;AAC5E,wDAAwD;AACxD,EAAE;AACF,0EAA0E;AAC1E,0EAA0E;AAC1E,wEAAwE;AACxE,+DAA+D;AAC/D,SAAS,KAAK,EAAE,KAAK,2BAAgC;AAarD,0EAA0E;AAC1E,uEAAuE;AACvE,qEAAqE;AACrE,sCAAsC;AACtC,EAAE;AACF,0EAA0E;AAC1E,qEAAqE;AACrE,uEAAuE;AACvE,oEAAoE;AACpE,wEAAwE;AACxE,wEAAwE;AACxE,uEAAuE;AACvE,EAAE;AACF,yEAAyE;AACzE,wEAAwE;AACxE,EAAE;AACF,2EAA2E;AAC3E,sDAAsD;AACtD,IAAI,UAAU,CAAC;EACb,IAAI,QAAQ,EAAE,KAAK,GAAG,EAAE,KAAK,IAAI,KAAK;EACtC,IAAI,QAA4B;IAC9B;MAAC,EAAE,KAAK,IAAI;MAAI;KAAE;IAClB;MAAC;MAAO;KAAK;IACb;MAAC,MAAM,K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ookup names. Every door takes an entity
2
+ // by something a person types — an alias, a human id, a title word — and
3
+ // when that resolves to nothing the rejection is only a teaching moment if
4
+ // it can name the thing meant: `.filed.project=tasks` is rejected while the
5
+ // project called `tasks` exists under the alias `home`.
6
+ //
7
+ // Scoring lives here; RESOLVING does not. A caller offers the winner only
8
+ // after checking the handle it would print resolves, because a suggestion
9
+ // routing nowhere costs a reader who is already confused a second wrong
10
+ // try. That is the whole reason this is cheap and safe to add.
11
+ import { CLOSE, score } from '@yaks/names'
12
+
13
+ // What a candidate is compared by: the handle to print, plus the words a
14
+ // caller might have been reaching for. `named` says the title IS a name
15
+ // and may be matched on; without it the title still SHOWS — a reader needs
16
+ // to recognize what they are being offered — but never wins a match.
17
+ export type Handle = {
18
+ id: string
19
+ alias?: string
20
+ title?: string
21
+ named?: boolean
22
+ }
23
+
24
+ // What a candidate answers to, and what each answer is worth. An ALIAS is
25
+ // the handle — the thing a caller types — so it carries full weight; a
26
+ // title is what they read; the title's FIRST word is how a name gets
27
+ // abbreviated (`Task Graph` → tasks).
28
+ //
29
+ // Interior title words are deliberately absent. Scoring them let a common
30
+ // noun inside somebody's sentence win outright: `tasks` matched T-97
31
+ // ("… for new tasks (title + body)") at 1.0 and beat the project named
32
+ // Task Graph. A word deep in a long title is a coincidence, and the
33
+ // untargeted pool is the whole graph, so there is always one. Where the
34
+ // title is SHORT the containment rule already reaches its later words —
35
+ // `graph` covers most of `taskgraph` — which is the case worth having.
36
+ //
37
+ // A title that is not a NAME sits out entirely: a task reads "Tasks: add
38
+ // cancelled state…", which opens with the word and means nothing by it.
39
+ //
40
+ // A word answers once, at the most it is worth: a project's alias is often
41
+ // its title, and a one-word title its own first word.
42
+ let answers = (h: Handle): [string, number][] => {
43
+ let title = h.named ? h.title ?? '' : ''
44
+ let words: [string, number][] = [
45
+ [h.alias ?? '', 1],
46
+ [title, 0.95],
47
+ [title.split(/\s+/)[0] ?? '', 0.85],
48
+ ]
49
+ return words.filter(([w], i) => words.findIndex(([x]) => x == w) == i)
50
+ }
51
+
52
+ // Each word is scored the way @yaks/names scores a typed name: containment
53
+ // that covers most of the longer word, else edit distance. That is what
54
+ // reaches `Task Graph` from `tasks`, and leaves `jef` inside every title
55
+ // about jeff@yak.sh a coincidence.
56
+ let closeness = (v: string, h: Handle) =>
57
+ Math.max(...answers(h).map(([w, worth]) => worth * score(v, w)))
58
+
59
+ // The best candidate for `v`, or nothing when none is close enough to be
60
+ // worth a reader's second try. A tie goes to the one carrying an ALIAS: two
61
+ // entities wear the name `Task Graph` — the project and the board over it —
62
+ // and the aliased one is the one somebody decided should be addressable by
63
+ // name. Otherwise the first one met keeps it. One pass, since the pool is
64
+ // the whole graph.
65
+ export let nearest = <T extends Handle>(v: string, of: T[]) => {
66
+ let best: [T, number] | undefined
67
+ for (let h of of) {
68
+ let c = closeness(v, h)
69
+ if (c < CLOSE) continue
70
+ if (!best || c > best[1] || c == best[1] && h.alias && !best[0].alias) {
71
+ best = [h, c]
72
+ }
73
+ }
74
+ return best?.[0]
75
+ }
76
+
77
+ // The offer, spelled as the caller should type it: 'home' (P-19, Task
78
+ // Graph). The handle leads because that is the part they got wrong.
79
+ export let offer = (h: Handle) => {
80
+ let lead = h.alias ? `'${h.alias}'` : h.id
81
+ let rest = [h.alias && h.id, h.title].filter(Boolean)
82
+ return rest.length ? `${lead} (${rest.join(', ')})` : lead
83
+ }
package/new.js ADDED
@@ -0,0 +1,295 @@
1
+ // New entities, sketched before they are made. A sketch is what a person has
2
+ // typed toward them: the components chosen, the text typed in each property,
3
+ // and an outline whose lines become more entities, nested by `contains`. It is
4
+ // the person's draft (@yaks/draft), so it is kept as it is typed and seen in
5
+ // every interface; the batch it writes is derived from it here, whole, so it
6
+ // can be shown before it is sent. The batch names what it makes by alias
7
+ // (`$1`), and the graph mints each id, or derives it where a component's
8
+ // identity says (a link's ends and relation), so the page never guesses one.
9
+ //
10
+ // Nothing here reads the page: the vocabulary, and a reader for typed text,
11
+ // are handed in.
12
+ /** The draft a sketch is kept in: one per place it is made from.
13
+ *
14
+ * ```ts
15
+ * import { equal } from '@yaks/testing'
16
+ * equal(placeOf({}), 'new')
17
+ * equal(placeOf({ in: 'p', like: 'l' }), 'new:in:p:like:l')
18
+ * ```
19
+ */ export let placeOf = (at)=>[
20
+ 'new',
21
+ ...at.in ? [
22
+ 'in',
23
+ at.in
24
+ ] : [],
25
+ ...at.like ? [
26
+ 'like',
27
+ at.like
28
+ ] : []
29
+ ].join(':');
30
+ /// sketchOf('') -> undefined
31
+ /// sketchOf('{"comps":{"task":{}},"outline":"a"}') -> {comps: {task: {}}, outline: 'a'}
32
+ export let sketchOf = (text)=>{
33
+ if (!text) return undefined;
34
+ let s = JSON.parse(text);
35
+ return {
36
+ comps: s.comps ?? {},
37
+ outline: s.outline ?? ''
38
+ };
39
+ };
40
+ /** A sketch as its draft's text. */ export let textOf = (s)=>JSON.stringify(s);
41
+ // What a client may write: never the spine, never a word only the server
42
+ // writes.
43
+ let writable = (v, name)=>name != 'entity' && !!v.comp(name)?.wire;
44
+ // A component that records what happened to one entity (a stamp, a mark, a
45
+ // claim) is its history, not the kind of thing it is.
46
+ let history = (v, name)=>v.props(name).some((p)=>v.prop(name, p)?.stamped);
47
+ /** A blank sketch of what an entity is made of: each component it carries
48
+ * that a client may write, without its values or its history. */ export let like = (v, has)=>({
49
+ comps: Object.fromEntries(Object.keys(has).filter((n)=>writable(v, n) && !history(v, n)).map((n)=>[
50
+ n,
51
+ {}
52
+ ])),
53
+ outline: ''
54
+ });
55
+ /** A component as the owner reads one: its name and its properties. */ export let signature = (v, name)=>`${name}{${v.props(name).join(', ')}}`;
56
+ // A description's first sentence: enough to choose by.
57
+ let brief = (text = '')=>text.split(/(?<=[.;])\s/)[0];
58
+ // How well a word names a component: its name, the start of its name, inside
59
+ // its name, or inside what it is said to be. Unnamed, it doesn't.
60
+ let fit = (name, about, word)=>name == word ? 0 : name.startsWith(word) ? 1 : name.includes(word) ? 2 : about.toLowerCase().includes(word) ? 3 : Infinity;
61
+ /** The components a search names, best first, leaving out those `held`: every
62
+ * word of `q` in its name or its description. */ export let find = (v, q, held = [], most = 8)=>{
63
+ let words = q.toLowerCase().split(/\s+/).filter(Boolean);
64
+ return v.all.filter((name)=>writable(v, name) && !held.includes(name)).map((name)=>{
65
+ let about = brief(v.def(name)?.description);
66
+ let rank = Math.max(0, ...words.map((w)=>fit(name, about, w)));
67
+ return {
68
+ name,
69
+ about,
70
+ rank
71
+ };
72
+ }).filter((h)=>h.rank < Infinity).sort((a, b)=>a.rank - b.rank || a.name.localeCompare(b.name)).slice(0, most).map(({ name, about })=>({
73
+ name,
74
+ signature: signature(v, name),
75
+ about
76
+ }));
77
+ };
78
+ /** An outline's lines: each nests under the nearest line above it that is
79
+ * indented less, and a list's bullet is not part of what it says.
80
+ *
81
+ * ```ts
82
+ * import { equal } from '@yaks/testing'
83
+ * equal(lines('Plan\n - Name it\n Ask\n Buy\n\nShip'), [
84
+ * { title: 'Plan' },
85
+ * { title: 'Name it', under: 0 },
86
+ * { title: 'Ask', under: 1 },
87
+ * { title: 'Buy', under: 0 },
88
+ * { title: 'Ship' },
89
+ * ])
90
+ * ```
91
+ */ export let lines = (text)=>{
92
+ let out = [], open = [];
93
+ for (let raw of text.replaceAll('\t', ' ').split('\n')){
94
+ let title = raw.trim().replace(/^[-*+]\s+/, '');
95
+ if (!title) continue;
96
+ let indent = raw.length - raw.trimStart().length;
97
+ while(open.length && open.at(-1).indent >= indent)open.pop();
98
+ let under = open.at(-1)?.at;
99
+ open.push({
100
+ indent,
101
+ at: out.length
102
+ });
103
+ out.push(under == null ? {
104
+ title
105
+ } : {
106
+ title,
107
+ under
108
+ });
109
+ }
110
+ return out;
111
+ };
112
+ /** An outline typed into, as a key leaves it: Enter starts a line at the
113
+ * indent of the one the caret is on, Tab indents that line and Shift+Tab
114
+ * takes an indent off it. Any other key is the field's own.
115
+ *
116
+ * ```ts
117
+ * import { equal } from '@yaks/testing'
118
+ * equal(press('A\n B', 6, 'Enter'), { text: 'A\n B\n ', at: 9 })
119
+ * equal(press('A\nB', 3, 'Tab'), { text: 'A\n B', at: 5 })
120
+ * equal(press('A\n B', 5, 'Tab', true), { text: 'A\nB', at: 3 })
121
+ * equal(press('A', 1, 'x'), undefined)
122
+ * ```
123
+ */ export let press = (text, at, key, shift = false)=>{
124
+ let start = text.lastIndexOf('\n', at - 1) + 1;
125
+ let indent = /^ */.exec(text.slice(start))[0];
126
+ let put = (from, to, add, caret)=>({
127
+ text: text.slice(0, from) + add + text.slice(to),
128
+ at: caret
129
+ });
130
+ if (key == 'Enter') return put(at, at, `\n${indent}`, at + 1 + indent.length);
131
+ if (key != 'Tab') return undefined;
132
+ if (!shift) return put(start, start, ' ', at + 2);
133
+ let cut = Math.min(2, indent.length);
134
+ return put(start, start + cut, '', Math.max(start, at - cut));
135
+ };
136
+ // Every typed property read as its value; what cannot be read is said, and
137
+ // left out.
138
+ let values = (s, cx, said)=>Object.fromEntries(Object.entries(s.comps).map(([comp, typed])=>[
139
+ comp,
140
+ Object.fromEntries(Object.entries(typed).flatMap(([prop, text])=>{
141
+ if (!text.trim()) return [];
142
+ try {
143
+ return [
144
+ [
145
+ prop,
146
+ cx.read(comp, prop, text.trim())
147
+ ]
148
+ ];
149
+ } catch (e) {
150
+ said.push({
151
+ comp,
152
+ prop,
153
+ said: e instanceof Error ? e.message : String(e)
154
+ });
155
+ return [];
156
+ }
157
+ }))
158
+ ]));
159
+ // What identifies a component's entity among its kind: the properties its id
160
+ // is derived from, or else one no two of them share (a topic's name).
161
+ let keyOf = (v, name)=>{
162
+ let identity = v.identity(name);
163
+ return identity.length ? identity : v.indexes(name).flatMap((i)=>i.unique && !i.present && i.props.length == 1 ? i.props : []);
164
+ };
165
+ // Whether what was typed names the entity: a title, or what identifies it.
166
+ let named = (v, comps)=>comps.doc?.title != null || Object.entries(comps).some(([name, c])=>keyOf(v, name).some((p)=>c[p] != null));
167
+ // An outline line's entity: the sketch's values, its line the title and what
168
+ // identifies it where the sketch left that empty.
169
+ let titled = (v, comps, title)=>{
170
+ let out = {
171
+ ...comps
172
+ };
173
+ if (v.comp('doc')) out.doc = {
174
+ ...out.doc,
175
+ title
176
+ };
177
+ for (let [name, c] of Object.entries(comps)){
178
+ for (let p of keyOf(v, name)){
179
+ if (c[p] == null) out[name] = {
180
+ ...out[name],
181
+ [p]: title
182
+ };
183
+ }
184
+ }
185
+ return out;
186
+ };
187
+ // That `from` contains `to`, `ord` its place in the list.
188
+ let contains = (alias, from, to, ord)=>({
189
+ entity: {
190
+ eid: alias
191
+ },
192
+ edge: {
193
+ from,
194
+ to,
195
+ ord
196
+ },
197
+ contains: {}
198
+ });
199
+ // The `contains` edges, each list in order: one in an entity that already
200
+ // exists goes on from `cx.ord`.
201
+ let edges = (cx, links)=>{
202
+ if (!cx.vocab.comp('contains')) return [];
203
+ let next = new Map();
204
+ return links.filter((l)=>!!l[0]).map(([from, to], i)=>{
205
+ let ord = next.get(from) ?? (from == cx.in ? cx.ord ?? 0 : 0);
206
+ next.set(from, ord + 1);
207
+ return contains(`$e${i + 1}`, from, to, ord);
208
+ });
209
+ };
210
+ /**
211
+ * The batch a sketch writes. With no outline it makes one entity. With one,
212
+ * each line is an entity like the sketch, titled by its line and nested by
213
+ * `contains` as it is indented; the sketch itself is the entity they are made
214
+ * in when it names one (a title, or what identifies it). Whatever is made at
215
+ * the top goes in `cx.in`.
216
+ */ export let batch = (s, cx)=>{
217
+ let said = [];
218
+ let comps = values(s, cx, said);
219
+ let outline = lines(s.outline);
220
+ let root = Object.keys(comps).length > 0 && (!outline.length || named(cx.vocab, comps));
221
+ let alias = (line)=>`$${line + (root ? 2 : 1)}`;
222
+ let made = [
223
+ ...root ? [
224
+ {
225
+ alias: '$1'
226
+ }
227
+ ] : [],
228
+ ...outline.map((_, line)=>({
229
+ alias: alias(line),
230
+ line
231
+ }))
232
+ ];
233
+ let bundles = made.map(({ alias, line })=>({
234
+ entity: {
235
+ eid: alias
236
+ },
237
+ ...line == null ? comps : titled(cx.vocab, comps, outline[line].title)
238
+ }));
239
+ let under = (line)=>{
240
+ let up = line == null ? undefined : outline[line].under;
241
+ return line == null ? cx.in : up != null ? alias(up) : root ? '$1' : cx.in;
242
+ };
243
+ let links = made.map((m)=>[
244
+ under(m.line),
245
+ m.alias
246
+ ]);
247
+ return {
248
+ bundles: [
249
+ ...bundles,
250
+ ...edges(cx, links)
251
+ ],
252
+ said,
253
+ made
254
+ };
255
+ };
256
+ /** A bundle as one line of what a batch writes: the entity, then each
257
+ * component with what it says, an existing entity named as `name` calls it.
258
+ *
259
+ * ```ts
260
+ * import { equal } from '@yaks/testing'
261
+ * let edge = {
262
+ * entity: { eid: '$e1' },
263
+ * edge: { from: 'p', to: '$1', ord: 0 },
264
+ * contains: {},
265
+ * }
266
+ * equal(written(edge, () => 'T-9'), '$e1 edge{from: T-9, to: $1, ord: 0} contains{}')
267
+ * equal(written({ entity: { eid: '$1' }, doc: { title: 'Go' } }), '$1 doc{title: "Go"}')
268
+ * ```
269
+ */ export let written = (b, name = ()=>undefined)=>{
270
+ let face = (v)=>typeof v == 'string' && (v.startsWith('$') ? v : name(v)) || JSON.stringify(v);
271
+ let { entity, ...rest } = b;
272
+ return [
273
+ entity.eid,
274
+ ...Object.entries(rest).map(([comp, c])=>`${comp}{${Object.entries(c).map(([k, v])=>`${k}: ${face(v)}`).join(', ')}}`)
275
+ ].join(' ');
276
+ };
277
+ /** A write refused, placed where it belongs: on the field it names, when the
278
+ * sketch has that field, and on the outline line whose entity it names. A
279
+ * refusal from the server arrives as an error's `refusal`, one from the
280
+ * page's own admission as the error itself. */ export let placed = (error, b, s)=>{
281
+ let r = error?.refusal ?? error;
282
+ let line = b.made.find((m)=>m.alias == r?.eid)?.line;
283
+ let field = r?.comp && r.prop && s.comps[r.comp];
284
+ return {
285
+ ...field && {
286
+ comp: r.comp,
287
+ prop: r.prop
288
+ },
289
+ ...line != null && {
290
+ line
291
+ },
292
+ said: r?.message ?? String(error)
293
+ };
294
+ };
295
+ //# sourceMapp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