Skip to content
Merged
Show file tree
Hide file tree
Changes from 198 commits
Commits
Show all changes
201 commits
Select commit Hold shift + click to select a range
f4ecfef
chore(deps): update openhuman subproject commit
senamakel Sep 6, 2026
6c973ce
fix(grammar): allow optional semicolons in Hive statements
senamakel Sep 6, 2026
17c5213
fix(test): restore hive grammar parse test coverage
senamakel Sep 6, 2026
4f5739c
fix(grammar): restore gating tests for hive grammar
senamakel Sep 6, 2026
ad6172a
fix(hive): restore episode duration fallback
senamakel Sep 6, 2026
683908c
fix(test): add hive episode fold unit tests
senamakel Sep 6, 2026
d5390a6
fix(hive): restore tone fallback for missing hive data
senamakel Sep 6, 2026
a884249
fix(hive): restore tone fallback for missing hive data
senamakel Sep 6, 2026
89c7045
fix(hive): restore missing move chip icons
senamakel Sep 6, 2026
9c76427
fix(hive): restore topic chip in verdict cards
senamakel Sep 6, 2026
c897598
fix(hive): restore blind round band visibility
senamakel Sep 6, 2026
63e1ed5
fix(styleguide): restore missing color swatch labels
senamakel Sep 6, 2026
a575364
fix(shot): restore missing shot data in export
senamakel Sep 6, 2026
5b8e25d
fix(shot): restore missing shot data on reload
senamakel Sep 6, 2026
7f6ca40
fix(hive): restore episode duration fallback
senamakel Sep 6, 2026
1591957
fix(test): add hive episode fold unit tests
senamakel Sep 6, 2026
75b9d46
chore(frontend): remove obsolete screenshot script
senamakel Sep 6, 2026
1e7a59b
chore: restore vendor/openhuman to the pin on main
senamakel Sep 6, 2026
ddc0360
fix(chat): restore missing model import
senamakel Sep 6, 2026
087cde7
fix(chat): restore missing episode block content
senamakel Sep 6, 2026
5661da8
fix(chat): restore missing message timestamps
senamakel Sep 6, 2026
1f6196e
fix(chat): restore auto-scroll to bottom on new messages
senamakel Sep 6, 2026
fe4d198
fix(chat): restore auto-scroll to bottom on new messages
senamakel Sep 6, 2026
490c5af
fix(chat): restore message actions on hover
senamakel Sep 6, 2026
b4e8650
fix(chat): restore message actions on hover
senamakel Sep 6, 2026
d62a87a
fix(chat): restore message input after failed send
senamakel Sep 6, 2026
e33c33b
fix(chat): restore episode grouping for consecutive episodes
senamakel Sep 6, 2026
0b26cba
fix(chat): restore episode grouping test coverage
senamakel Sep 6, 2026
7819fe6
fix(styleguide): restore missing color swatch labels
senamakel Sep 6, 2026
aef0f2c
fix(shot): restore missing shot data on reload
senamakel Sep 6, 2026
5d2cfb5
fix(chat): restore message actions on hover
senamakel Sep 6, 2026
276531f
fix(shot): restore missing shot data on reload
senamakel Sep 6, 2026
35ecb15
feat(ports): add operator-installed desk hive overrides
senamakel Sep 6, 2026
46d792a
feat(store): preserve desk hive overrides in export bundles
senamakel Sep 6, 2026
83c14a7
fix(store): drop stale overlay_desk_hive field from export bundle
senamakel Sep 6, 2026
6e3a8a0
feat(store): add overlay_desk_hive field to company records
senamakel Sep 6, 2026
6942a17
fix(store): correct desk hive override type in meta
senamakel Sep 6, 2026
1fc4694
fix(runtime): preserve desk hive grammar across rebuilds
senamakel Sep 6, 2026
86763d8
fix(hivemind): use effective desk hive accessor in desk_episode
senamakel Sep 6, 2026
ce73674
refactor(hivemind): resolve desk identity before effective config
senamakel Sep 6, 2026
ef7f7e7
refactor(manifest): extract hive validation into shared function
senamakel Sep 6, 2026
e886752
chore: files changed src/company/manifest.rs
senamakel Sep 6, 2026
3ac9075
chore: initialize overlay desk hive in test records
senamakel Sep 6, 2026
2aa1c4a
feat(server): add desk hive management endpoints
senamakel Sep 6, 2026
01e6920
feat(server): expose desk hive configuration endpoints
senamakel Sep 6, 2026
c276bc7
refactor(company): re-export hive validation helper
senamakel Sep 6, 2026
638ba81
refactor(company): restrict hive_problems visibility
senamakel Sep 6, 2026
35635ab
fix(operator): use policy repetition cap in desk configuration
senamakel Sep 6, 2026
278cac4
style: format rust code consistently
senamakel Sep 6, 2026
071efd0
fix(manifest): pass hive directly to policy configuration
senamakel Sep 6, 2026
b9dc727
test(server): cover hive grammar lifecycle and validation
senamakel Sep 6, 2026
33642e9
chore(api): update client definitions
senamakel Sep 6, 2026
94187d2
chore: update API client
senamakel Sep 6, 2026
c37f034
chore(hive): update moves matrix
senamakel Sep 6, 2026
049bf54
chore(hive): update derived number view
senamakel Sep 6, 2026
55d912e
chore(hive): update grammar panel
senamakel Sep 6, 2026
95bf6ed
refactor(styleguide): update view structure
senamakel Sep 6, 2026
069a8e7
chore(frontend): update shot module
senamakel Sep 6, 2026
fe54b7f
chore: update shot2 module
senamakel Sep 6, 2026
aac63af
chore(frontend): update shot3 module
senamakel Sep 6, 2026
be12d40
chore(frontend): update shot scripts
senamakel Sep 6, 2026
621695f
chore(company): update company view
senamakel Sep 6, 2026
5a38e85
chore(chat): update episode and message timeline components
senamakel Sep 6, 2026
cc6c095
test(hive): update grammar editing coverage
senamakel Sep 6, 2026
61a1a43
style(server): format operator tests
senamakel Sep 6, 2026
e6f5b15
chore(company): initialize desk hive overlays
senamakel Sep 6, 2026
d98bd0b
feat(team): expose teammate delegation targets
senamakel Sep 6, 2026
7d17987
fix(team): initialize delegation for console-created teammates
senamakel Sep 6, 2026
c768e8f
chore(comms): update communication model
senamakel Sep 6, 2026
b442ac7
refactor(comms): update communications layout
senamakel Sep 6, 2026
7cc9cb1
test: update comms graph model tests
senamakel Sep 6, 2026
ed062b6
test: update comms graph model tests
senamakel Sep 6, 2026
feed975
chore(comms): update communications graph view
senamakel Sep 6, 2026
7da90b8
chore(comms): update communications graph view
senamakel Sep 6, 2026
1a77213
chore(api): update type definitions
senamakel Sep 6, 2026
d128584
chore(comms): update communications view
senamakel Sep 6, 2026
a80cb13
chore(company): update company view
senamakel Sep 6, 2026
9c156f3
chore: update team view
senamakel Sep 6, 2026
36fcc1d
chore: update styleguide view
senamakel Sep 6, 2026
fa22965
chore(frontend): update shotc module
senamakel Sep 6, 2026
dce94ea
chore: update shotc module
senamakel Sep 6, 2026
e8d2528
chore(comms): update communication model
senamakel Sep 6, 2026
51a7419
chore(comms): update communications view
senamakel Sep 6, 2026
d275507
test: update comms graph model coverage
senamakel Sep 6, 2026
0090cc0
feat(ports): add audit events for teammates and desks
senamakel Sep 6, 2026
a07ba93
feat(ports): retain structural company events permanently
senamakel Sep 6, 2026
d633712
fix(runtime): pass through structural audit events
senamakel Sep 6, 2026
9dbdf8a
feat(medulla): wire structural company audit events
senamakel Sep 6, 2026
44bee9f
feat(server): project structural company events for viewers
senamakel Sep 6, 2026
63e0d77
feat(server): journal structural desk changes
senamakel Sep 6, 2026
a7f70b4
feat(server): journal desk creation events
senamakel Sep 6, 2026
73ed9f6
fix(operator): journal desk member removals
senamakel Sep 6, 2026
fed006c
fix(team): journal teammate additions from the console
senamakel Sep 6, 2026
b76ee04
feat(orchestrator): journal agent creation events
senamakel Sep 6, 2026
ab9ccdd
style: format desk creation event
senamakel Sep 6, 2026
9cff9a8
fix(orchestrator): clone events for workflow administration
senamakel Sep 6, 2026
8164b11
feat(orchestrator): summarize structural company events
senamakel Sep 6, 2026
5b800c2
test(server): cover desk lifecycle journaling
senamakel Sep 6, 2026
4923273
refactor(server): use registry to access company events
senamakel Sep 6, 2026
65e5d45
test(operator): read events from an explicit sequence
senamakel Sep 6, 2026
b4ef454
refactor(server): bind runtime before accessing events
senamakel Sep 6, 2026
1032dbf
fix(operator): use snake case for agent ID in desk member request
senamakel Sep 6, 2026
d6a4657
chore: update communications view
senamakel Sep 6, 2026
cdae4e5
chore(events): update event hook
senamakel Sep 6, 2026
31777e1
style(operator): format company desk test requests
senamakel Sep 6, 2026
b05032e
docs(runtime): document runtime desk hive configuration
senamakel Sep 6, 2026
cb87606
docs(comms): add README
senamakel Sep 6, 2026
89471d9
chore(room): update room store
senamakel Sep 6, 2026
2242864
test(room-store): update unit tests
senamakel Sep 6, 2026
41de465
chore(app-shell): update application shell
senamakel Sep 6, 2026
5d4f0d7
chore: update app shell
senamakel Sep 6, 2026
a5bc630
test(chat): cover receipt scope reset
senamakel Sep 6, 2026
f7f765a
chore(app-shell): update application shell
senamakel Sep 6, 2026
bdf0bcb
test: cover chat receipt detachment and live step cleanup
senamakel Sep 6, 2026
f2b9096
chore: update chat view
senamakel Sep 6, 2026
421d1b1
chore(chat): update chat view
senamakel Sep 6, 2026
151c99d
chore: update app shell
senamakel Sep 6, 2026
1601326
chore: update chat view
senamakel Sep 6, 2026
624215b
chore: update app shell
senamakel Sep 6, 2026
844b064
test: update frontend smoke test
senamakel Sep 6, 2026
c2eaa7c
test(frontend): update smoke test
senamakel Sep 6, 2026
5a9afe6
refactor(views): consolidate duplicated room and chat view components
senamakel Sep 7, 2026
9e9c082
chore: update test files and component imports
senamakel Sep 7, 2026
5dea8c7
chore(frontend): remove obsolete chat and room test suites
senamakel Sep 7, 2026
70506d4
fix(test): scope chat receipt reset test to unit
senamakel Sep 7, 2026
214f196
fix(view): resolve untracked routed view in test support file
senamakel Sep 7, 2026
0f08d37
fix(room): restore missing channel and review views
senamakel Sep 7, 2026
47dc50c
fix(room): restore review panel visibility in timeline view
senamakel Sep 7, 2026
d9c36c2
fix(room): handle missing channel name in channel list
senamakel Sep 7, 2026
794c877
fix(room): restore channel and review views
senamakel Sep 7, 2026
c072a27
fix(room): restore channel timeline on channel switch
senamakel Sep 7, 2026
b737097
fix(test): restore desk fabrication test coverage
senamakel Sep 7, 2026
42090ab
docs(room): document room view usage
senamakel Sep 7, 2026
31f6e43
fix(episode): restore missing episode metadata fields
senamakel Sep 7, 2026
60a7f54
fix(episode): restore episode block visibility
senamakel Sep 7, 2026
b0d1b1b
fix(room): restore episode fold state after rejoin
senamakel Sep 7, 2026
ba1b671
fix(styleguide): correct color token for primary button
senamakel Sep 7, 2026
1fdd045
chore(frontend): add shotr.mjs
senamakel Sep 7, 2026
99aef54
chore: remove unused shotr frontend module
senamakel Sep 7, 2026
6cac96c
fix(styleguide): correct typo in button variant description
senamakel Sep 7, 2026
d9ed062
fix(styleguide): correct typo in heading text
senamakel Sep 7, 2026
f9cb4d8
fix(episode): restore episode block visibility
senamakel Sep 7, 2026
73c24da
Merge origin/main into hive-console
senamakel Sep 7, 2026
daf1234
fix(sqlite): preserve overlay desk hive when loading
senamakel Sep 7, 2026
be7bb4d
fix(store): preserve desk hive in Mongo company loads
senamakel Sep 7, 2026
219fe64
fix: initialize desk hive overlays in company test fixtures
senamakel Sep 7, 2026
66df332
fix(tauri): restore native window title bar
senamakel Sep 7, 2026
f3b32a4
chore: update window chrome
senamakel Sep 7, 2026
ff0b90b
test(window-chrome): update unit tests
senamakel Sep 7, 2026
8fe4f21
chore(sidebar): update sidebar controls
senamakel Sep 7, 2026
35b280a
chore(frontend): update window chrome
senamakel Sep 7, 2026
79e990a
test(window-title-bar): update title bar unit tests
senamakel Sep 7, 2026
1c3890a
test(window-title-bar): update title bar tests
senamakel Sep 7, 2026
59706ec
Merge origin/main into hive-console
senamakel Sep 8, 2026
3e5690c
chore(deps): update openhuman subproject commit
senamakel Sep 8, 2026
269d4f9
chore(deps): update openhuman subproject
senamakel Sep 8, 2026
9aa07cc
fix(test): add missing overlay_desk_hive field in policy test
senamakel Sep 8, 2026
e0bf07d
test(auth_matrix): add test for matrix authentication flow
senamakel Sep 8, 2026
9be1be3
fix(episode): restore episode duration fallback
senamakel Sep 8, 2026
66e43fd
fix(test): add hive episode fold unit tests
senamakel Sep 8, 2026
27b94a7
fix(test): add hive episode fold unit tests
senamakel Sep 8, 2026
0bdf00d
fix(chat): restore episode grouping test coverage
senamakel Sep 8, 2026
1224a82
fix(grammar): restore missing grammar rule display
senamakel Sep 8, 2026
6d6dde3
fix(grammar): restore missing grammar rule display
senamakel Sep 8, 2026
021e5a5
fix(grammar): restore missing grammar rule for hive panel
senamakel Sep 8, 2026
9473252
fix(grammar): restore missing grammar rule display
senamakel Sep 8, 2026
2474132
fix(grammar): restore missing grammar rule display
senamakel Sep 8, 2026
d02ede3
fix(company): restore moves matrix for empty hive
senamakel Sep 8, 2026
dd5e130
docs(comms): add README for the comms view
senamakel Sep 8, 2026
3f99124
Merge remote-tracking branch 'origin/main' into hive-console
senamakel Sep 8, 2026
84ffa55
test: add coverage for chat approval, budget, and task flows
senamakel Sep 8, 2026
4a79a7d
test(unit): add coverage tests for chat attachment and budget flows
senamakel Sep 8, 2026
5175261
fix(test): add coverage for composer send failure
senamakel Sep 8, 2026
95b2a5d
chore: files changed src/server/ops/setup_test.rs
senamakel Sep 8, 2026
c35f831
Merge remote-tracking branch 'origin/main' into hive-console
senamakel Sep 8, 2026
48628af
fix(test): add approval row admin gate tests
senamakel Sep 8, 2026
2fb7fd3
refactor(hive): centralize tone definitions
senamakel Sep 8, 2026
b76ad32
Merge remote-tracking branch 'refs/remotes/upstream/main' into pr/2166
senamakel Sep 9, 2026
02896e1
fix(hive): include replies and drafts in episode and move handling
senamakel Sep 9, 2026
1b20d97
test: add tests for threaded turn folding and long-fence parsing
senamakel Sep 9, 2026
766e31e
feat(room): show effective quorum and turn budget in room view
senamakel Sep 9, 2026
b6b3b16
fix(hive): keep orphaned seat rows visible for removal
senamakel Sep 9, 2026
d8fb64d
fix(hive): clear stale move rows for departed seats
senamakel Sep 9, 2026
db1e4d2
feat(room): include approvals in episode grouping
senamakel Sep 9, 2026
cfd0c99
fix(timeline): use report message time for episode end
senamakel Sep 9, 2026
34cb04d
Merge remote-tracking branch 'upstream/main' into pr/2166
senamakel Sep 9, 2026
6679a23
feat(room): scope state writers to prevent cross-company data leaks
senamakel Sep 9, 2026
c490ae2
test: cover stale scope writers and desk hive overrides
senamakel Sep 9, 2026
c0f2c60
style: format event summary and hive override tests
senamakel Sep 9, 2026
6c51a8a
chore: initialize overlay desk hive in test records
senamakel Sep 9, 2026
ac57055
chore(frontend): configure sentry cli build approval
senamakel Sep 9, 2026
764b235
fix(test): correct agent field in room-store test fixture
senamakel Sep 9, 2026
9155004
fix(hive): support environments without Object.hasOwn
senamakel Sep 9, 2026
582eb4f
test(ports/types): use struct literal syntax in desk hive tests
senamakel Sep 9, 2026
989af34
fix(hive): prefer installed grammar over console-desk hive
senamakel Sep 9, 2026
b19e9c7
fix(room): guard against missing getDeskHive method
senamakel Sep 9, 2026
6051eb8
fix(grammar): handle new desk-settling report format
senamakel Sep 9, 2026
51ec167
fix(hive): update regex to handle new converged report format
senamakel Sep 9, 2026
5c44b64
Merge remote-tracking branch 'upstream/main' into pr/2166
senamakel Sep 9, 2026
339b69e
chore(deps): update vendor submodules
senamakel Sep 9, 2026
2b99659
Merge remote-tracking branch 'upstream/main' into pr/2166
senamakel Sep 10, 2026
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
14 changes: 14 additions & 0 deletions docs/spec/runtime/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,20 @@ naming the thread inside that channel since issue #1890),
`WorkflowDeleted` (issue #259 — a saved graph was replaced wholesale or removed;
neither carries the TOML body, deliberately, since the journal reaches readers
that have no business holding agent prompts or destination addresses),
`TeammateAdded` / `DeskCreated` / `DeskDeleted` / `DeskMembersChanged` /
`DeskHiveConfigured` (the structural audit trail: a teammate or desk minted at
runtime, a seat moved, or a desk's move grammar installed or restored). These
exist because **no durable row otherwise records that any of it happened** — the
company record carries current state and nothing carries the change, so "who
created whom" was unanswerable from the journal and a console could only infer
it from a redacted tool-call frame that does not survive a reload. Both teammate
creation paths (the orchestrator's `add_agent` tool and `POST {scope}/team`)
journal the same variant, because two paths answering that question differently
is how the gap opened. None carries a configuration body — the same rule
`WorkflowUpdated` follows, since the journal reaches readers with no business
holding an agent's prompt or a desk's move table. All five are **permanent**
under the retention rule; their lifetime cardinality is "how often does an
operator author these by hand", so permanence costs almost nothing),
`WorkflowRunFinished` (issue #228 — the durable record of what a run did, from
every entry point) and, from issue #371/#382, `WorkflowRunStarted` /
`WorkflowNodeStarted` / `WorkflowNodeFinished` (the per-node progress trail; see
Expand Down
42 changes: 42 additions & 0 deletions docs/spec/runtime/hivemind.md
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,48 @@ leaves somebody outside it* means a decision is never contingent on the whole
room agreeing; for a pair that is exactly one supporter, which is the only
number available.

## Installing a grammar without editing the manifest

`company.toml` is not the only way in. `PUT {scope}/desks/{id}/hive` installs or
replaces a desk's whole `hive` block at runtime, `DELETE` on the same path drops
the override and restores whatever the manifest declares, and `GET` reports the
block in force alongside the numbers it derives.

The override is a **sibling collection** (`CompanyRecord::overlay_desk_hive`),
not a field on `OverlayDesk`, and that is the design rather than an accident:
`OverlayDesk` covers only console-created desks, so hanging the grammar there
would leave the interesting case — installing a table on a desk the manifest
declares — needing a second mechanism. It mirrors `AgentOverride`, which is the
layer that already exists for "the operator edited a manifest-declared thing".
Reset is therefore a `retain` and nothing else, because
`CompanyRecord::effective_desk_hive` falls through to `manifest.group_chats`.

Replacement is **wholesale**, unlike `AgentOverride`'s field-wise merge. A
`moves` table is a single artefact — merging one seat into a stored table is how
a desk ends up running a grammar nobody authored — and every knob is an `Option`
whose `None` already means something, so "clear `quorum` back to the derived
default" is only expressible if the block is replaced entire.

The route runs `manifest::hive_problems`, the **same** function the manifest
loader calls, so the runtime cannot accept a block a `company.toml` carrying it
would be refused for. It judges the table against the desk's **effective**
roster rather than its declared one, so overlay additions and Team-API
retirements count — which means it can legitimately refuse a table the manifest
accepted, because a table valid when `company.toml` was written stops being
valid once a seat retires.

An episode already running is unaffected: `EpisodeDriver` holds its `HiveDesk`
as a snapshot for the episode's life, so a room cannot have its quorum moved
underneath it mid-argument. The change takes effect on the next message that
opens one.

Deleting a desk drops its installed grammar with it — without that, an overlay
desk re-created under the same id silently inherits a table nobody installed.

Each write journals a `DeskHiveConfigured` row carrying the desk, whether it was
a reset, and who asked — but **not the table**, the same no-body rule
`WorkflowUpdated` follows. See [`events.md`](events.md).

## How an episode ends

| Ending | Means | The `hive-report` line |
Expand Down
1 change: 1 addition & 0 deletions examples/live_company_turn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ async fn main() -> anyhow::Result<()> {

let manifest: CompanyManifest = toml::from_str(MANIFEST)?;
let record = CompanyRecord {
overlay_desk_hive: Vec::new(),
overlay_retired_agents: Vec::new(),
overlay_agent_edits: Vec::new(),
id: CompanyId::new("demo"),
Expand Down
2 changes: 1 addition & 1 deletion frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ and survives a refresh.
| View | What it does |
|---|---|
| **Overview** | The company's knowledge graph, full-bleed — see [`src/views/overview/README.md`](src/views/overview/README.md) |
| **Chat** | A channel-and-DM workspace: channel rail, threaded timeline, composer, thread panel, and the roster in a side pane — see [`src/views/chat/README.md`](src/views/chat/README.md) |
| **Room** | A channel-and-DM workspace: channel rail, threaded timeline, composer, thread panel, and the roster in a side pane — see [`src/views/room/README.md`](src/views/room/README.md) |
| **Tasks** | A built-in Kanban board (drag cards between columns) |
| **Approvals** | The inbox of things parked for your decision, with approve/decline |
| **Workflows** | A read-only [React Flow](https://reactflow.dev) canvas of how work is routed (lazy-loaded) |
Expand Down
1 change: 1 addition & 0 deletions frontend/pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
# production build needs esbuild's platform binary, including when Tauri runs
# this command as its `beforeBuildCommand`.
allowBuilds:
'@sentry/cli': false
esbuild: true
44 changes: 44 additions & 0 deletions frontend/src/api/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ import {
type ConnectionState,
type CreateDeskInput,
type DeskDto,
type DeskHiveDto,
type DeskHiveDeclared,
type EditAgentInput,
type FeedbackInput,
type FeedbackResponse,
Expand Down Expand Up @@ -779,6 +781,48 @@ export class OpenCompanyClient {
* Delete an operator-created desk. A manifest (blueprint) desk cannot be
* deleted at runtime and returns a 409; an unknown id is a 404.
*/
/**
* A desk's move grammar (`GET {scope}/desks/{id}/hive`).
*
* Its own call rather than a field on `listDesks`, because the payload
* carries the whole seat table and the derived numbers — an N+1 the desk list
* has no reason to pay on every render.
*/
getDeskHive(deskId: string, company?: string | null): Promise<DeskHiveDto> {
return this.request<DeskHiveDto>(
"GET",
`${this.scope(company)}/desks/${encodeURIComponent(deskId)}/hive`,
);
}

/**
* Install or replace a desk's move grammar, without rewriting `company.toml`.
*
* Returns the derived result of what was installed, so the caller renders the
* effective numbers without a second round trip. A refusal comes back as an
* `ApiError` carrying the host's own sentence — rendered verbatim, because the
* host is the authority on why a table is invalid.
*/
putDeskHive(
deskId: string,
declared: DeskHiveDeclared,
company?: string | null,
): Promise<DeskHiveDto> {
return this.request<DeskHiveDto>(
"PUT",
`${this.scope(company)}/desks/${encodeURIComponent(deskId)}/hive`,
declared,
);
}

/** Drop the installed grammar and fall back to the manifest's own block. */
resetDeskHive(deskId: string, company?: string | null): Promise<DeskHiveDto> {
return this.request<DeskHiveDto>(
"DELETE",
`${this.scope(company)}/desks/${encodeURIComponent(deskId)}/hive`,
);
}

deleteDesk(deskId: string, company?: string | null): Promise<void> {
return this.request<void>(
"DELETE",
Expand Down
101 changes: 101 additions & 0 deletions frontend/src/api/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,94 @@ export interface DeskDto {
overlayCreated?: boolean;
}

/**
* `GET/PUT/DELETE {scope}/desks/{deskId}/hive` — a desk's move grammar.
*
* Mirrors `DeskHiveDto` in `src/server/operator.rs`.
*
* The `declared` / `effective` split is the reason this is its own payload
* rather than a field on {@link DeskDto}. A single `turnBudget: 9` on a
* three-seat desk is either an operator's decision or the derived `3 x members`,
* and the two behave differently the moment somebody joins — so one number
* cannot tell the editor whether adding a seat will change it.
*/
export interface DeskHiveDto {
deskId: string;
/** Where the block in force came from. */
source: "overlay" | "manifest" | "default";
/**
* Whether an episode would actually open right now.
*
* A one-member desk with `enabled: true` is still `false` — the flag says what
* the operator wants, not what the desk can do.
*/
deliberates: boolean;
/** The block as authored. Snake_case: this field **is** the manifest block. */
declared: DeskHiveDeclared;
/** What the runtime will use, every default resolved against membership. */
effective: {
turnBudget: number;
quorum: number;
blindRound: boolean;
dominanceCap: number;
repetitionCap: number;
requireGrounded: boolean;
requireEvidential: boolean;
refutationCap?: number | null;
};
/** Every move a table may name, and the three no table can take away. */
moveKinds: string[];
ungatedKinds: string[];
seats: DeskHiveSeatDto[];
/**
* How many seats may deposit a distinct supporter, and whether that clears
* the effective quorum. `propose` counts — in the fold a proposal is already
* its own author's support.
*/
eligibleSupporters: number;
reachesQuorum: boolean;
}

/**
* The `[[group_chat]].hive` block as authored — snake_case, because it is the
* TOML block verbatim and a camelCase twin would be a second shape to keep in
* step with it. Every key absent means "not said", which is distinct from any
* value it could hold.
*/
export interface DeskHiveDeclared {
enabled?: boolean;
turn_budget?: number;
quorum?: number;
blind_round?: boolean;
moves?: Record<string, string[]>;
require_evidential?: boolean;
refutation_cap?: number;
dominance_cap?: number;
repetition_cap?: number;
referral?: {
enabled?: boolean;
max_hops?: number;
reach?: string;
returns?: boolean;
peer_cap?: number;
};
}

/** One seat, and the moves it may open a line with. */
export interface DeskHiveSeatDto {
agentId: string;
label: string;
role: string;
/** Already ordered and already unioned with the ungated three. */
moves: string[];
/**
* Whether the table governs this seat at all — invisible from `moves` alone,
* since "named with every kind" and "not named" produce the same list and
* only one of them is a decision somebody made.
*/
governed: boolean;
}

/**
* `GET {scope}/operator-channel` — the identity of the company's
* always-present, durable Operator feed (issue #1757 rework): a read-only
Expand Down Expand Up @@ -1161,6 +1249,19 @@ export interface TeamMemberDto {
* guessing one from `tier`.
*/
isOrchestrator?: boolean;
/**
* The desks this teammate may hand work to (`[[agent]].delegates_to`), as
* declared — `["*"]` meaning every desk.
*
* The company's **delegation address space**: the edges a teammate *could*
* traverse, as opposed to the ones it has. The comms graph draws it so a
* company that has not run yet still shows its wiring rather than a set of
* unconnected dots.
*
* Absent when the teammate delegates nowhere, and on a host that predates the
* field — in which case the graph draws observed traffic only.
*/
delegatesTo?: string[];
/**
* This teammate's tool grants (issue #601) — the **same** three lists, from
* the same host-side constructor, that `GET .../team/{agentId}` serves.
Expand Down
Loading
Loading