Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions ts/packages/agents/browser/src/agent/agentServiceHandlers.mts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,25 @@ export function createAgentInvokeHandlers(
getMemoryService().getSourceContent(params),
memoryGetSourceKnowledge: ({ corpusId, sourceId }) =>
getMemoryService().getSourceKnowledge(corpusId, sourceId),
memoryListSourceKnowledgeSuppressions: ({ corpusId, sourceId }) => {
const operation =
getMemoryService().listSourceKnowledgeSuppressions;
if (!operation)
throw new Error("Knowledge curation is unavailable");
return operation.call(getMemoryService(), corpusId, sourceId);
},
memorySuppressSourceKnowledge: (params) => {
const operation = getMemoryService().suppressSourceKnowledge;
if (!operation)
throw new Error("Knowledge curation is unavailable");
return operation.call(getMemoryService(), params);
},
memoryRestoreSourceKnowledge: (params) => {
const operation = getMemoryService().restoreSourceKnowledge;
if (!operation)
throw new Error("Knowledge curation is unavailable");
return operation.call(getMemoryService(), params);
},
memoryImportDocument: ({
corpusId,
title,
Expand Down
22 changes: 22 additions & 0 deletions ts/packages/agents/browserControlRpc/src/serviceTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,12 @@ export type MemoryCenterReindexResult = {
indexVersion: string;
};

export type MemoryCenterKnowledgeSuppression = {
sourceId: string;
kind: "entity" | "topic";
name: string;
};

export type MemoryCenterActivityType =
| "visited"
| "bookmarked"
Expand Down Expand Up @@ -271,6 +277,22 @@ export type MemoryCenterInvokeFunctions = {
corpusId: string;
sourceId: string;
}): Promise<MemoryCenterKnowledge>;
memoryListSourceKnowledgeSuppressions(params: {
corpusId: string;
sourceId: string;
}): Promise<MemoryCenterKnowledgeSuppression[]>;
memorySuppressSourceKnowledge(params: {
corpusId: string;
sourceId: string;
kind: MemoryCenterKnowledgeSuppression["kind"];
name: string;
}): Promise<MemoryCenterKnowledgeSuppression[]>;
memoryRestoreSourceKnowledge(params: {
corpusId: string;
sourceId: string;
kind: MemoryCenterKnowledgeSuppression["kind"];
name: string;
}): Promise<MemoryCenterKnowledgeSuppression[]>;
memoryImportDocument(params: {
corpusId: string;
title: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ export function createAllHandlers(): AllServiceWorkerInvokeFunctions {
forward("memoryGetSourceContent", params),
memoryGetSourceKnowledge: (params) =>
forward("memoryGetSourceKnowledge", params),
memoryListSourceKnowledgeSuppressions: (params) =>
forward("memoryListSourceKnowledgeSuppressions", params),
memorySuppressSourceKnowledge: (params) =>
forward("memorySuppressSourceKnowledge", params),
memoryRestoreSourceKnowledge: (params) =>
forward("memoryRestoreSourceKnowledge", params),
memoryImportDocument: (params) =>
forward("memoryImportDocument", params),
memoryReplaceSource: (params) => forward("memoryReplaceSource", params),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,20 +70,27 @@ main {

.toolbar {
display: flex;
flex-direction: row;
flex-wrap: wrap;
align-items: end;
gap: 10px;
margin-bottom: 14px;
}

.toolbar label {
min-width: 280px;
min-width: min(280px, 100%);
flex: 1 1 240px;
}

.toolbar .summary {
margin-left: auto;
color: var(--muted);
}

.toolbar > button {
flex: 0 0 auto;
}

label {
display: grid;
gap: 5px;
Expand Down Expand Up @@ -128,6 +135,14 @@ button.danger {
background: var(--danger);
}

.icon-button {
width: 34px;
height: 34px;
padding: 0;
font-size: 20px;
line-height: 1;
}

.workspace {
display: grid;
grid-template-columns: minmax(220px, 0.75fr) minmax(420px, 1.6fr) minmax(
Expand Down Expand Up @@ -331,6 +346,39 @@ h3 {
gap: 5px;
}

.source-details,
.hidden-knowledge {
margin: 10px 0;
border-top: 1px solid var(--border);
}

.source-details summary,
.hidden-knowledge summary {
padding: 10px 0;
color: var(--muted);
cursor: pointer;
font-weight: 650;
}

.editor-tabs {
display: flex;
gap: 2px;
border-bottom: 1px solid var(--border);
}

.editor-tab {
margin-bottom: -1px;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
background: var(--background);
}

.editor-tab.active {
border-bottom-color: var(--surface);
background: var(--surface);
font-weight: 650;
}

.revision {
padding: 7px;
border-left: 3px solid var(--border);
Expand All @@ -347,6 +395,21 @@ h3 {
line-height: 1.45;
}

.markdown-preview {
min-height: 270px;
padding: 12px;
overflow-wrap: anywhere;
border: 1px solid #cbd0d8;
border-top: 0;
line-height: 1.55;
}

.markdown-preview pre {
padding: 10px;
overflow: auto;
background: var(--background);
}

.content-actions {
margin-top: 8px;
}
Expand All @@ -358,11 +421,24 @@ h3 {
}

.chip {
padding: 4px 7px;
display: inline-flex;
align-items: center;
gap: 4px;
padding: 4px 5px 4px 7px;
border-radius: 12px;
background: #eef0ff;
}

.chip-remove {
width: 22px;
height: 22px;
padding: 0;
border: 0;
border-radius: 50%;
background: transparent;
line-height: 1;
}

.empty {
color: var(--muted);
font-style: italic;
Expand Down Expand Up @@ -460,7 +536,6 @@ dialog .checkbox {
}

@media (max-width: 720px) {
.toolbar,
.workspace,
.side-column,
.howto-workspace {
Expand All @@ -470,5 +545,10 @@ dialog .checkbox {

.toolbar .summary {
margin-left: 0;
flex-basis: 100%;
}

.toolbar label {
flex-basis: 100%;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,15 @@ <h1>Memory Center</h1>
Corpus
<select id="corpusSelect"></select>
</label>
<button id="refreshButton" type="button">Refresh</button>
<button
id="refreshButton"
class="icon-button"
type="button"
aria-label="Refresh corpus"
title="Refresh corpus"
>
↻
</button>
<button id="createCorpusButton" class="primary" type="button">
Create corpus
</button>
Expand Down Expand Up @@ -76,21 +84,49 @@ <h2 id="sourceTitle">Select a source</h2>
</button>
</div>
</div>
<dl id="sourceMetadata" class="metadata"></dl>
<h3>Revisions</h3>
<div id="revisionList" class="revision-list empty">
No source selected.
</div>
<details class="source-details">
<summary>Source details and revisions</summary>
<dl id="sourceMetadata" class="metadata"></dl>
<h3>Revisions</h3>
<div id="revisionList" class="revision-list empty">
No source selected.
</div>
</details>
<div class="content-heading">
<h3>Content</h3>
<span id="contentRange"></span>
</div>
<div class="editor-tabs" role="tablist" aria-label="Content view">
<button
id="writeTab"
class="editor-tab active"
type="button"
role="tab"
aria-selected="true"
>
Write
</button>
<button
id="previewTab"
class="editor-tab"
type="button"
role="tab"
aria-selected="false"
>
Preview
</button>
</div>
<textarea
id="contentEditor"
aria-label="Source content"
spellcheck="false"
disabled
></textarea>
<div
id="contentPreview"
class="markdown-preview hidden"
role="tabpanel"
></div>
<div class="content-actions">
<button id="contentPrevious" type="button" disabled>
Previous content
Expand Down Expand Up @@ -120,12 +156,26 @@ <h3>Relationships</h3>
<div id="relationshipList" class="knowledge-list empty">
No source selected.
</div>
<details class="hidden-knowledge">
<summary>
Hidden knowledge <span id="suppressionCount"></span>
</summary>
<div id="suppressionList" class="knowledge-list empty">None</div>
</details>
</section>

<section class="card jobs-panel">
<div class="section-heading">
<h2>Jobs</h2>
<button id="refreshJobsButton" type="button">Refresh</button>
<button
id="refreshJobsButton"
class="icon-button"
type="button"
aria-label="Refresh jobs"
title="Refresh jobs"
>
↻
</button>
</div>
<div id="jobList" class="list"></div>
<div class="pager">
Expand Down
Loading
Loading