| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <pstm-uri>/discoveries</pstm-uri>
- <pstm-template>main</pstm-template>
- <script>
- // The search box filters CLIENT-SIDE, like the task page's
- // selects: the Statum entrypoint fetch never carries the page's
- // own query string to the server, so the box filters the
- // rendered rows directly (case-insensitive substring over the
- // body, the same search the daemon's search_discoveries tool
- // performs server-side). A `?q=` on a direct entrypoint hit
- // pre-seeds the box (DiscoveriesEntrypoint reads it).
- if (window.statum) {
- (function () {
- 'use strict';
- window.discoveryRowVisible = function (row) {
- var needle = (window.discoveryQuery || '').toLowerCase();
- if (!needle) return true;
- return (row.body || '').toLowerCase().indexOf(needle) !== -1;
- };
- window.setDiscoveryQuery = function (value) {
- window.discoveryQuery = value || '';
- var box = document.getElementById('discovery-q');
- if (box && box.value !== window.discoveryQuery) {
- box.value = window.discoveryQuery;
- }
- document.body.setAttribute('data-discovery-bump',
- String(Date.now()));
- };
- })();
- }
- </script>
- </head>
- <body>
- <section>
- <h2>Discoveries</h2>
- <p class="text-muted">The fleet's editable knowledge base of non-project facts — compiler
- quirks, library behaviours, tool flags, protocol gotchas. Agents search this
- before working with a technology and refine notes in place; you can do the same.</p>
- <p stm-if="discoveries == null">Loading…</p>
- <div stm-if="discoveries != null">
- <form class="cluster" onsubmit="window.setDiscoveryQuery(document.getElementById('discovery-q').value); return false;">
- <div class="field"><label for="discovery-q">Search</label>
- <input type="search" id="discovery-q"
- stm-attribute.value="discoveries.query"
- placeholder="meson, valac, sqlite…">
- <button type="submit">Search</button></div>
- </form>
- <div stm-for-discovery-in="discoveries.discoveries" stm-key="discovery.id"
- stm-if="window.discoveryRowVisible(discovery)" class="card">
- <div class="md" stm-markdown="discovery.body">body</div>
- <p class="text-muted">Created <span stm-text="discovery.created_display">when</span><span
- stm-if="discovery.updated_display != ''"> · Updated <span
- stm-text="discovery.updated_display">when</span></span></p>
- <details>
- <summary>Edit</summary>
- <form stm-action="discovery.update">
- <input type="hidden" name="discovery_id" stm-attribute.value="discovery.id">
- <div class="field"><label>Body</label>
- <textarea name="body" rows="6" stm-attribute.value="discovery.body"></textarea></div>
- <button type="submit">Save</button>
- </form>
- </details>
- <form class="cluster">
- <button type="button" stm-action="discovery.delete"
- stm-confirm="Delete this discovery?">Delete</button>
- </form>
- </div>
- <p stm-if="discoveries.discoveries.length == 0" class="text-muted">
- No discoveries yet — the knowledge base starts empty and grows as agents
- record what they learn.</p>
- <p stm-if="discoveries.more > 0" class="text-muted">… and <span
- stm-text="discoveries.more">n</span> more (narrow the search).</p>
- </div>
- </section>
- </body>
- </html>
|