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
4 changes: 4 additions & 0 deletions .changeset/document-weak-pass-variants.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
---

docs(ui,protocol): document the six navigation / knowledge-source variants that the #4177 variant/doc gate was only ever name-checking. `apps.mdx` enumerated nine navigation item types but gave `report`, `action` and `component` a single shared sentence instead of sections; `knowledge.mdx` named `object` / `file` / `http` in a table with no example of any, leaving the per-kind keys undocumented. Each example was parsed against the real schema (`NavigationItemSchema`, `KnowledgeSourceKindSchema`) before landing. Documentation only; releases nothing.
28 changes: 28 additions & 0 deletions content/docs/protocol/knowledge.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,34 @@ Three source kinds:
| `file` | A folder in `IStorageService` | Onboarded PDFs, uploads |
| `http` | A list of remote URLs | External docs, RSS, sitemaps |

`kind` is the discriminator, and each kind carries its own keys — a key from one
kind is rejected on another:

```typescript
// object — content comes from the named fields of each matching record
source: {
kind: 'object',
object: 'kb_article',
contentFields: ['title', 'body'], // at least one, required
metadataFields: ['category', 'author'], // optional, carried onto the document
where: { status: 'published' }, // optional ObjectQL filter
}

// file — every object under a storage prefix
source: {
kind: 'file',
prefix: 'knowledge/handbook/',
mimeTypes: ['application/pdf', 'text/markdown'], // optional; omit to take all
}

// http — an explicit URL list (each must be a valid URL)
source: {
kind: 'http',
urls: ['https://docs.example.com/guide', 'https://docs.example.com/faq'],
userAgent: 'ObjectStack-KnowledgeBot/1.0', // optional
}
```

Every source binds to a named **adapter id** (e.g. `'ragflow'`,
`'memory'`). The adapter id is resolved at runtime by the plugin that
registers itself with that name. Adapter config (endpoint, dataset id,
Expand Down
48 changes: 47 additions & 1 deletion content/docs/ui/apps.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ const crmApp = {

## Navigation Items

The navigation tree supports nine item types, combined to create rich menu structures. The most common are shown below (`object`, `dashboard`, `page`, `url`, `group`, `separator`); the spec also defines `report`, `action`, and `component` items.
The navigation tree supports nine item types, combined to create rich menu structures: `object`, `dashboard`, `page`, `url`, `report`, `action`, `component`, `group` and `separator`. Each is documented below.

`type` is the discriminator: a value outside that list is rejected with the full
set of valid ones, and every other key is checked against the branch you picked
rather than against all nine.

### Object Navigation

Expand Down Expand Up @@ -121,6 +125,48 @@ Groups items into collapsible sections with children:
}
```

### Report Navigation

Links to a saved report:

```typescript
{ id: 'nav_pipeline', type: 'report', label: 'Pipeline Report', reportName: 'sales_pipeline', icon: 'file-bar-chart' }
```

### Action Navigation

Runs an action instead of navigating to a surface. The reference lives in a
nested `actionDef` block — `actionName` is **not** a top-level key on the item:

```typescript
{
id: 'nav_import',
type: 'action',
label: 'Import Records',
icon: 'upload',
actionDef: {
actionName: 'bulk_import',
params: { objectName: 'account', mode: 'upsert' },
},
}
```

`actionDef` accepts only `actionName` and `params`. `params` itself is **open by
design** — the action owns its own parameter contract, so the app schema does
not validate what goes inside it.

### Component Navigation

Renders a registered component. `componentRef` is a component-registry key, not
a file path:

```typescript
{ id: 'nav_directory', type: 'component', label: 'Directory', componentRef: 'metadata:directory', icon: 'contact' }
```

`params` is handed to the component as props and is **open by design** — the
props are the component's own contract.

### Separator

A visual divider in the navigation list. It renders no target and carries no
Expand Down
Loading