@gotcos/glasses-server 6.99.20 → 6.99.29

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 (65) hide show
  1. package/CHANGELOG.md +257 -0
  2. package/docs/work-orchestrator.md +20 -0
  3. package/package.json +1 -1
  4. package/server/index.ts +48 -5
  5. package/server/lib/agent-session-output-images.ts +280 -0
  6. package/server/lib/agent-session-store.ts +3 -1
  7. package/server/lib/agent-session-turns.ts +18 -7
  8. package/server/lib/client-liveness.ts +38 -3
  9. package/server/lib/codex-subagent-activity.ts +36 -0
  10. package/server/lib/g2-turn-provenance.ts +679 -0
  11. package/server/lib/media-store.ts +41 -2
  12. package/server/lib/permission-broker.ts +94 -17
  13. package/server/lib/queue-turn-evidence.ts +19 -2
  14. package/server/lib/session-halt.ts +15 -1
  15. package/server/lib/session-stream-events.ts +4 -0
  16. package/server/lib/session-subagents.ts +155 -0
  17. package/server/lib/session-turn-attachments.ts +245 -0
  18. package/server/lib/thread-turn-queue-deliver.ts +17 -2
  19. package/server/lib/thread-turn-queue.ts +10 -0
  20. package/server/lib/today-brief.ts +731 -0
  21. package/server/lib/turn-file-store.ts +202 -0
  22. package/server/lib/turn-footer.ts +81 -0
  23. package/server/lib/web-control-static.ts +226 -0
  24. package/server/lib/web-memories-bridge.ts +9 -8
  25. package/server/lib/web-pet-choice.ts +225 -0
  26. package/server/lib/web-pet.ts +226 -0
  27. package/server/lib/work-lens-rounds.ts +29 -4
  28. package/server/routes/agent-session-bindings.ts +164 -16
  29. package/server/routes/agent-sessions.ts +77 -8
  30. package/server/routes/client-instance.ts +12 -1
  31. package/server/routes/cursor-stop-followup.ts +30 -1
  32. package/server/routes/g2-turns.ts +46 -0
  33. package/server/routes/health.ts +9 -0
  34. package/server/routes/media.ts +32 -8
  35. package/server/routes/permission-broker.ts +47 -4
  36. package/server/routes/thread-turn-queue.ts +148 -8
  37. package/server/routes/today-brief.ts +148 -0
  38. package/server/routes/web-control.ts +110 -7
  39. package/server/routes/work-lens-rounds.ts +19 -5
  40. package/server/web-control/app.css +26 -5
  41. package/server/web-control/app.js +1351 -177
  42. package/server/web-control/control.css +1 -1
  43. package/server/web-control/index.html +31 -13
  44. package/server/web-control/memories/memory-workspace.js +1 -1
  45. package/server/web-control/panes/cos-chat.css +22 -0
  46. package/server/web-control/panes/cos-chat.js +264 -48
  47. package/server/web-control/panes/meetings.css +15 -2
  48. package/server/web-control/panes/meetings.js +20 -9
  49. package/server/web-control/panes/memories.css +291 -0
  50. package/server/web-control/panes/memories.js +2208 -0
  51. package/server/web-control/panes/questions.css +39 -1
  52. package/server/web-control/panes/questions.js +419 -64
  53. package/server/web-control/panes/reader-media.js +154 -0
  54. package/server/web-control/panes/sessions.css +2 -0
  55. package/server/web-control/panes/settings.js +136 -6
  56. package/server/web-control/panes/today-actions.css +167 -0
  57. package/server/web-control/panes/today-actions.js +1303 -0
  58. package/server/web-control/panes/work.css +54 -0
  59. package/server/web-control/panes/work.js +1037 -18
  60. package/server/web-control/shell.js +6 -2
  61. package/server/web-control/theme.js +0 -2
  62. package/server/web-control/memories/memories-app.js +0 -1561
  63. package/server/web-control/memories/memories-theme.css +0 -73
  64. package/server/web-control/memories/memories.html +0 -72
  65. package/server/web-control/memories/memory-stewardship.js +0 -63
@@ -309,7 +309,7 @@ button.cx-set-row:hover { background: var(--qopen); }
309
309
  @media (min-width: 1100px) { .cx-set-name { font-size: 14px; } }
310
310
  @media (min-width: 1100px) { .rail-settings[aria-current='page'] { background: var(--rail-active); border: 1px solid var(--panel-border); } }
311
311
 
312
- /* Sign in another device: the QR the phone camera scans. */
312
+ /* Use COS on another phone or browser: the QR the phone camera scans. */
313
313
  .device-code .qr { display: block; width: 200px; height: 200px; margin: 4px 0 8px; border-radius: 8px; border: 1px solid var(--panel-border); background: #fff; }
314
314
  .device-code .qr-hint { font-weight: 600; color: var(--ink); }
315
315
 
@@ -19,6 +19,8 @@
19
19
  <link rel="stylesheet" href="/control/panes/sessions.css">
20
20
  <link rel="stylesheet" href="/control/panes/cos-chat.css">
21
21
  <link rel="stylesheet" href="/control/panes/questions.css">
22
+ <link rel="stylesheet" href="/control/panes/memories.css">
23
+ <link rel="stylesheet" href="/control/panes/today-actions.css">
22
24
  <script src="/control/theme.js"></script>
23
25
  </head>
24
26
  <body>
@@ -38,6 +40,7 @@
38
40
  <symbol id="i-photo" viewBox="0 0 24 24"><rect x="3.5" y="5" width="17" height="14" rx="2.5"/><circle cx="9" cy="10" r="1.6"/><path d="m4 17 5-4.5 3.5 3 3-2.5 4.5 4"/></symbol>
39
41
  <symbol id="i-video" viewBox="0 0 24 24"><rect x="3.5" y="6" width="12.5" height="12" rx="2.5"/><path d="m16 10.5 4.5-2.5v8L16 13.5"/></symbol>
40
42
  <symbol id="i-doc" viewBox="0 0 24 24"><path d="M7 3.5h6.5L18 8v12a.5.5 0 0 1-.5.5h-10.5A.5.5 0 0 1 6.5 20V4a.5.5 0 0 1 .5-.5z"/><path d="M13.5 3.5V8H18M9 12.5h6M9 15.5h6"/></symbol>
43
+ <symbol id="i-camera" viewBox="0 0 24 24"><path d="M4.5 8h3l1.6-2.2h5.8L16.5 8h3a1.5 1.5 0 0 1 1.5 1.5v8A1.5 1.5 0 0 1 19.5 19h-15A1.5 1.5 0 0 1 3 17.5v-8A1.5 1.5 0 0 1 4.5 8z"/><circle cx="12" cy="13.2" r="3.4"/></symbol>
41
44
  <symbol id="i-clip" viewBox="0 0 24 24"><path d="m15.5 7.5-6.8 6.8a1.8 1.8 0 0 0 2.5 2.5l7.3-7.3a3.5 3.5 0 0 0-5-5l-7.6 7.6a5.2 5.2 0 0 0 7.4 7.4l5.7-5.7"/></symbol>
42
45
  <symbol id="i-messages" viewBox="0 0 24 24"><path d="M4 7a2.5 2.5 0 0 1 2.5-2.5h11A2.5 2.5 0 0 1 20 7v7a2.5 2.5 0 0 1-2.5 2.5H10L5.5 20v-3.6A2.5 2.5 0 0 1 4 14z"/></symbol>
43
46
  <symbol id="i-usage" viewBox="0 0 24 24"><path d="M4 20h16M7 16v-4M12 16V7M17 16v-7"/></symbol>
@@ -57,7 +60,7 @@
57
60
  <div id="auth-code-block">
58
61
  <label for="auth-code">Sign-in code</label>
59
62
  <input id="auth-code" class="field code-field" type="text" inputmode="text" autocomplete="one-time-code" autocapitalize="characters" spellcheck="false" maxlength="9" placeholder="K7P3-QX9M">
60
- <p class="auth-foot" style="margin-top:8px">Scan the QR with your phone's camera. A browser that is already signed in shows one under Settings, Sign in another device. COS Control on your Mac shows one under Open COS on your phone. Or type the code shown with the QR.</p>
63
+ <p class="auth-foot" style="margin-top:8px">Scan the QR with your phone's camera. A browser that is already signed in shows one under Settings, Use COS on another phone or browser. COS Control on your Mac shows one under Open COS on your phone. Or type the code shown with the QR.</p>
61
64
  <p class="auth-foot">The glasses pairing code does not work here.</p>
62
65
  </div>
63
66
  <div id="auth-token-block" class="hidden">
@@ -126,6 +129,7 @@
126
129
  <kbd class="kbd">⌘K</kbd>
127
130
  </button>
128
131
  </div>
132
+ <div id="today-pet" class="today-pet hidden"></div>
129
133
  <div id="today-rec"></div>
130
134
  <div class="today-cols">
131
135
  <div class="today-main">
@@ -148,13 +152,14 @@
148
152
  <section class="card hidden" id="intake-card" aria-labelledby="intake-title">
149
153
  <div class="panel-head">
150
154
  <h2 id="intake-title" class="panel-title">From today's meetings<span id="intake-count" class="count"></span></h2>
151
- <button type="button" class="link-btn" data-goto="work/sort">Review</button>
155
+ <button type="button" class="link-btn" data-today="intake" data-goto="work/sort">Review</button>
152
156
  </div>
153
157
  <div id="intake-body" class="intake-body"></div>
154
158
  </section>
155
159
  <section class="card hidden" id="next-card" aria-labelledby="next-title">
156
- <div class="panel-head"><h2 id="next-title" class="panel-title">Up next</h2></div>
160
+ <div class="panel-head"><h2 id="next-title" class="panel-title">Next up</h2></div>
157
161
  <div id="next-body" class="next-up"></div>
162
+ <div id="next-actions" class="next-actions"></div>
158
163
  </section>
159
164
  </div>
160
165
  </div>
@@ -207,9 +212,7 @@
207
212
  <section id="pane-dictation" class="pane hidden" data-title="Dictation"></section>
208
213
 
209
214
  <!-- MEMORIES -->
210
- <section id="pane-memories" class="pane flush hidden" data-title="Memories">
211
- <iframe id="memories-frame" class="memories-frame" title="Memories" src="about:blank"></iframe>
212
- </section>
215
+ <section id="pane-memories" class="pane hidden" data-title="Memories"><!-- rendered by panes/memories.js --></section>
213
216
 
214
217
  <!-- SPEAKERS -->
215
218
  <section id="pane-speakers" class="pane wide hidden" data-title="Speakers"><!-- rendered by panes/speakers.js --></section>
@@ -251,8 +254,10 @@
251
254
  <div class="sheet-grip"></div>
252
255
  <form class="sheet-head" id="ask-form">
253
256
  <input id="ask-q" class="field" type="search" placeholder="Ask COS or find a session" autocomplete="off" enterkeyhint="go">
257
+ <span id="ask-clip" class="ask-clip"></span>
254
258
  <button type="button" class="link-btn" id="ask-close">Cancel</button>
255
259
  </form>
260
+ <div id="ask-files" class="cc-chips ask-files hidden" aria-live="polite"></div>
256
261
  <div id="ask-results"></div>
257
262
  </div>
258
263
  </div>
@@ -263,13 +268,26 @@
263
268
  <script src="/control/app.js"></script>
264
269
  <script src="/control/shell.js"></script>
265
270
  <script src="/control/panes/cos-chat.js"></script>
266
- <script src="/control/panes/messages.js"></script>
267
- <script src="/control/panes/threads.js"></script>
268
- <script src="/control/panes/speakers.js"></script>
269
- <script src="/control/panes/meetings.js"></script>
270
- <script src="/control/panes/work.js"></script>
271
- <script src="/control/panes/dictation.js"></script>
272
- <script src="/control/panes/settings.js"></script>
273
271
  <script src="/control/panes/questions.js"></script>
272
+ <!-- Loaded when first opened, then in the background once the page is idle (app.js ensurePane). -->
273
+ <script type="application/json" id="lazy-panes">{
274
+ "messages": "/control/panes/messages.js",
275
+ "threads": "/control/panes/threads.js",
276
+ "speakers": "/control/panes/speakers.js",
277
+ "meetings": "/control/panes/meetings.js",
278
+ "work": "/control/panes/work.js",
279
+ "dictation": "/control/panes/dictation.js",
280
+ "settings": "/control/panes/settings.js",
281
+ "memories": "/control/panes/memories.js",
282
+ "todayActions": "/control/panes/today-actions.js",
283
+ "readerMedia": "/control/panes/reader-media.js"
284
+ }</script>
285
+ <!-- The Knowledge graph explorer, loaded by panes/memories.js when the graph first opens. -->
286
+ <script type="application/json" id="memories-graph-assets">{
287
+ "css": "/control/memories/graph-explorer.css",
288
+ "d3": "/control/memories/d3.min.js",
289
+ "explorer": "/control/memories/graph-explorer.js",
290
+ "workspace": "/control/memories/memory-workspace.js"
291
+ }</script>
274
292
  </body>
275
293
  </html>
@@ -17,7 +17,7 @@
17
17
  var el=document.createElement('section');el.className='memory-investigation';
18
18
  var state={id:id(),revision:0,title:'Untitled investigation',nodes:[],links:[],anchors:[],waypoints:[],filters:{hops:3,direction:'undirected',avoid:[]},generation:null,paths:[]};
19
19
  var queuedFocus=null,editEpoch=0,lastFocus=null,selected=null,offsets={},history=[],controller=null,started=false,busy=false,requestSerial=0,saveIntents={},assertionIntent=null,separationIntent=null;
20
- el.innerHTML='<div data-role="canvas" class="cgx-host"></div><p data-role="overview-status" class="muted" role="status"></p><details class="investigation-tools" data-role="advanced"><summary>Advanced investigation</summary><div class="graph-search row"><input type="search" id="graphQuery" aria-label="Find an entity" placeholder="Find a person or idea…"><button onclick="cosApp.graphSearch()">Find points</button><span id="graphSearchStatus" class="muted"></span></div><div class="source-card"><div class="row"><input data-role="title" aria-label="Investigation title" placeholder="Investigation title"><button data-action="save">Save investigation</button><button data-action="open">Open saved</button><button data-action="new">New</button></div>'+
20
+ el.innerHTML='<div data-role="canvas" class="cgx-host"></div><p data-role="overview-status" class="muted" role="status"></p><details class="investigation-tools" data-role="advanced"><summary>Advanced investigation</summary><div class="graph-search row"><input type="search" id="graphQuery" aria-label="Find an entity" placeholder="Find a person or idea…"><button type="button" data-role="find-points">Find points</button><span id="graphSearchStatus" class="muted"></span></div><div class="source-card"><div class="row"><input data-role="title" aria-label="Investigation title" placeholder="Investigation title"><button data-action="save">Save investigation</button><button data-action="open">Open saved</button><button data-action="new">New</button></div>'+
21
21
  '<p data-role="receipt" class="muted">Draft · saved separately from standing knowledge.</p><div data-role="matches" class="row"></div>'+
22
22
  '<div class="row"><b data-role="selected">Select a point</b><button data-action="start">Set start</button><button data-action="target">Set target</button><button data-action="waypoint">Add waypoint</button><button data-action="expand">Expand point</button><button data-action="avoid">Avoid point</button><button data-action="hide">Hide point</button><button data-action="undo">Undo canvas edit</button></div>'+
23
23
  '<p data-role="anchors"></p><div data-role="waypoints" class="row"></div><div class="row"><label>Total hops <select data-role="hops" aria-label="Total hop limit"><option>3</option><option>4</option><option>5</option><option>6</option><option>7</option></select></label><label>Traversal <select data-role="direction" aria-label="Relationship direction"><option value="undirected">Undirected discovery</option><option value="directed">Known direction only</option></select></label><label>Known valid on <input data-role="valid" aria-label="Known valid on" type="date"></label><button data-action="paths">Find connections</button><button data-action="refresh">Review generation changes</button><button data-action="separate">Keep anchors separate</button></div>'+
@@ -189,8 +189,30 @@
189
189
  .cc-prep-add { position: relative; cursor: pointer; }
190
190
  .cc-prep-add:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
191
191
  .cc-prep-acts .cx-btn { height: 40px; }
192
+ @media (max-width: 480px) {
193
+ .cc-prep-acts .cx-btn { height: 44px; min-width: 44px; }
194
+ .cc-prep-head-acts button { min-height: 44px; }
195
+ }
192
196
  .cc-prep-note { margin: 0; font-size: 13px; }
193
197
  .cc-prep-note[hidden] { display: none; }
194
198
  .cc-prep.dragging .cc-prep-panel { outline: 2px dashed var(--accent); outline-offset: 4px; }
195
199
  .cc-prep { scroll-margin-top: calc(64px + var(--safe-top, 0px)); }
196
200
  @media (min-width: 860px) { .msg-right .cc-prep { padding: 10px 16px 0; max-height: 55%; overflow-y: auto; flex: none; } }
201
+
202
+ /* The Ask sheet's files (11/07, app.js askFiles): the attach kit's chips and clip beside the Ask box. */
203
+ .sheet-head .cc-attach { flex: none; height: 44px; border-radius: 12px; }
204
+ .ask-clip:empty { display: none; }
205
+ .ask-files { margin-top: 10px; }
206
+ .ask-files .ask-files-note { flex-basis: 100%; margin: 0 2px; font-size: 13px; line-height: 1.35; color: var(--sub); }
207
+ #ask-sheet .sheet.dragging { outline: 2px dashed var(--accent); outline-offset: -6px; }
208
+
209
+ /* 6.99.27: a session's reply box with files (app.js paintReaderFiles, panes/today-actions.js): the kit's chips on a row of
210
+ their own above the words, Take photo and the clip beside Fork and Send, and the limits in plain words under the chips. */
211
+ .att-composer { flex-wrap: wrap; }
212
+ .att-composer .att-files { flex: 1 1 100%; padding: 2px 0 4px; }
213
+ .att-composer .att-files.hidden { display: none; }
214
+ .att-clip, .ta-clip { display: inline-flex; gap: 6px; }
215
+ .att-clip:empty { display: none; }
216
+ .att-clip .cc-attach { height: 38px; width: 42px; border-radius: var(--radius-sm); }
217
+ .att-composer.dragging { outline: 2px dashed var(--accent); outline-offset: 4px; }
218
+ .cc-chips .att-limit { flex-basis: 100%; margin: 0 2px; font-size: 12.5px; line-height: 1.35; color: var(--sub); }