@hanzo/rooms 0.1.13 → 0.1.15

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/dist/Contents.js CHANGED
@@ -18,6 +18,9 @@ import { BAD } from './lib/mix.js';
18
18
  export function standing(f) {
19
19
  switch (f.status) {
20
20
  case 'ready':
21
+ // Ready means read; while its vectors fill in, search by meaning grows.
22
+ if (f.stage === 'embed' && f.passages)
23
+ return `Indexed · ${f.sections ?? 0} sections · vectors ${Math.floor(((f.embedded ?? 0) / f.passages) * 100)}%`;
21
24
  return `Indexed · ${f.sections ?? 0} sections`;
22
25
  case 'stored':
23
26
  return 'Kept, not indexed';
package/dist/Drive.js CHANGED
@@ -8,6 +8,7 @@ import { useAi } from './lib/ai.js';
8
8
  import { empty, useOpen } from './open.js';
9
9
  import { attach, channel } from './pane.js';
10
10
  import { useRooms } from './host.js';
11
+ import { org } from './lib/session.js';
11
12
  import { Badge, Contents, Hits } from './Contents.js';
12
13
  import { weigh as size } from './lib/attach.js';
13
14
  import { dropped, filesIn, forget, pool, register, search, settled, slug, upload, } from './lib/files.js';
@@ -120,7 +121,10 @@ export function Drive() {
120
121
  const workspace = currentOrg?.displayName || currentOrg?.name || 'hanzo';
121
122
  // THE WORKSPACE'S BUCKET is the one named for the org: where a file put into a
122
123
  // chat lands (lib/files `workspace`), so it is where Drive opens.
123
- const home = currentOrg?.name ? slug(currentOrg.name) : null;
124
+ // The org is the one the chat uploads under (`org()`), read the same way, so
125
+ // the bucket a chat file landed in is the bucket Drive opens.
126
+ const scope = org() ?? currentOrg?.name ?? null;
127
+ const home = scope ? slug(scope) : null;
124
128
  const [navSection, setNavSection] = useState('my-drive');
125
129
  const [viewMode, setViewMode] = useState('list');
126
130
  const [searchQuery, setSearchQuery] = useState('');
@@ -207,7 +211,7 @@ export function Drive() {
207
211
  if (!live)
208
212
  return;
209
213
  setIndex(new Map(list.map((f) => [f.key, f])));
210
- if (list.some((f) => !settled(f)))
214
+ if (list.some((f) => !settled(f) || f.stage === 'embed'))
211
215
  clock = setTimeout(pass, 4000);
212
216
  })
213
217
  .catch(() => { });
@@ -254,9 +258,9 @@ export function Drive() {
254
258
  if (!client)
255
259
  return;
256
260
  empty();
257
- attach(channel({ room, thread: null, agent: null }), [f], { api: client, org: currentOrg?.name ?? null });
261
+ attach(channel({ room, thread: null, agent: null }), [f], { api: client, org: scope });
258
262
  router.push('/chat');
259
- }, [client, room, currentOrg, router]);
263
+ }, [client, room, scope, router]);
260
264
  // WHAT IS AT THIS LEVEL. The store's listing takes `recursive`; passing
261
265
  // `delimiter` (S3's own word) is silently ignored, so a flat listing came
262
266
  // back and every folder read as a file.
package/dist/RightPane.js CHANGED
@@ -103,13 +103,8 @@ function outputs(said) {
103
103
  said.forEach((m, turn) => {
104
104
  if (m.role !== 'assistant')
105
105
  return;
106
- // Files a turn carried by reference: their names in the turn, their bytes in the workspace.
107
- const read = told(words(m));
108
- for (const f of read.carried?.attached ?? []) {
109
- out.push({ id: `sw${turn}.${f.id}`, name: f.name, kind: f.type.startsWith('image/') ? 'image' : 'file', file: f.id, mime: f.type });
110
- }
111
106
  let n = 0;
112
- for (const [, info, body] of read.text.matchAll(FENCE)) {
107
+ for (const [, info, body] of words(m).matchAll(FENCE)) {
113
108
  n += 1;
114
109
  const named = fenceName(info, n);
115
110
  out.push({
@@ -139,8 +134,13 @@ function sources(said, held) {
139
134
  pictures(m).forEach((href, i) => {
140
135
  out.push({ id: `s${turn}.${i}`, name: 'Attached image', kind: 'image', href });
141
136
  });
137
+ // Files a turn carried by reference: their names in the turn, their bytes in the workspace.
138
+ const read = told(words(m));
139
+ for (const f of read.carried?.attached ?? []) {
140
+ out.push({ id: `sw${turn}.${f.id}`, name: f.name, kind: f.type.startsWith('image/') ? 'image' : 'file', file: f.id, mime: f.type });
141
+ }
142
142
  let n = 0;
143
- for (const [, info, body] of words(m).matchAll(FENCE)) {
143
+ for (const [, info, body] of read.text.matchAll(FENCE)) {
144
144
  n += 1;
145
145
  const named = info.trim();
146
146
  if (!suffix(named))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanzo/rooms",
3
- "version": "0.1.13",
3
+ "version": "0.1.15",
4
4
  "description": "The workspace rooms — Home, Chat, Inbox, Contacts, Meet, Cal, Drive, Board, Work, Bots — and the frame that holds them, once, for every Hanzo surface.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",