Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
feat(macrod): ratatui control panel serving in-process (#6031)
Eric Hayes0284a5c972f2
diff --git a/.sqlx/query-e96a236012ba6dd58242b1973f5f3a5b7f8d3ff33ddee6b3ba1ce00b690d28d1.json b/.sqlx/query-e96a236012ba6dd58242b1973f5f3a5b7f8d3ff33ddee6b3ba1ce00b690d28d1.jsonnew file mode 100644index 0000000000..95bf8b0638--- /dev/null+++ b/.sqlx/query-e96a236012ba6dd58242b1973f5f3a5b7f8d3ff33ddee6b3ba1ce00b690d28d1.json@@ -0,0 +1,76 @@+{+ "db_name": "PostgreSQL",+ "query": "\n SELECT\n s.id AS session_id,\n s.bot_id,\n b.name AS bot_name,\n b.handle AS bot_handle,\n s.name,\n s.status,\n s.model,\n s.owner_id,\n s.created_at,\n s.modified_at\n FROM agent_session s\n JOIN agent_configs ac ON ac.bot_id = s.bot_id\n JOIN bots b ON b.id = s.bot_id\n WHERE ac.harness_id = $1\n ORDER BY s.modified_at DESC\n LIMIT 50\n ",+ "describe": {+ "columns": [+ {+ "ordinal": 0,+ "name": "session_id",+ "type_info": "Uuid"+ },+ {+ "ordinal": 1,+ "name": "bot_id",+ "type_info": "Uuid"+ },+ {+ "ordinal": 2,+ "name": "bot_name",+ "type_info": "Text"+ },+ {+ "ordinal": 3,+ "name": "bot_handle",+ "type_info": "Text"+ },+ {+ "ordinal": 4,+ "name": "name",+ "type_info": "Text"+ },+ {+ "ordinal": 5,+ "name": "status",+ "type_info": "Text"+ },+ {+ "ordinal": 6,+ "name": "model",+ "type_info": "Text"+ },+ {+ "ordinal": 7,+ "name": "owner_id",+ "type_info": "Text"+ },+ {+ "ordinal": 8,+ "name": "created_at",+ "type_info": "Timestamptz"+ },+ {+ "ordinal": 9,+ "name": "modified_at",+ "type_info": "Timestamptz"+ }+ ],+ "parameters": {+ "Left": [+ "Uuid"+ ]+ },+ "nullable": [+ false,+ false,+ false,+ false,+ false,+ false,+ false,+ false,+ false,+ false+ ]+ },+ "hash": "e96a236012ba6dd58242b1973f5f3a5b7f8d3ff33ddee6b3ba1ce00b690d28d1"+}diff --git a/Cargo.lock b/Cargo.lockindex e0f345a1d6..021d44b57e 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -184,7 +184,7 @@ dependencies = ["github","http 1.4.0","http-body-util",- "lru",+ "lru 0.16.4","macro_auth","macro_db_client","macro_user_id",@@ -968,7 +968,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "8454c8a44ce2cb9cc7e7fae67fc6128465b343b92c6631e94beca3c8d1524ea5"dependencies = ["concolor",- "unicode-width 0.2.2",+ "unicode-width 0.2.0","yansi",]@@ -1145,7 +1145,7 @@ dependencies = ["handlebars","http 1.4.0","indexmap 2.14.0",- "lru",+ "lru 0.16.4","mime","multer","num-traits",@@ -1916,7 +1916,7 @@ dependencies = ["http 0.2.12","http 1.4.0","http-body 1.0.1",- "lru",+ "lru 0.16.4","percent-encoding","regex-lite","sha2 0.11.0",@@ -2926,7 +2926,7 @@ dependencies = ["apollo-compiler","apollo-parser","chrono",- "lru",+ "lru 0.16.4","maybe_send","pollster","postcard",@@ -3170,12 +3170,27 @@ dependencies = ["thiserror 2.0.18",]+[[package]]+name = "cassowary"+version = "0.3.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "df8670b8c7b9dae1793364eafadf7239c40d669904660c5960d74cfd80b46a53"+[[package]]name = "cast"version = "0.3.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5"+[[package]]+name = "castaway"+version = "0.2.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "dec551ab6e7578819132c713a93c022a05d60159dc86e7a7050223577484c55a"+dependencies = [+ "rustversion",+]+[[package]]name = "cc"version = "1.2.62"@@ -3544,12 +3559,14 @@ dependencies = ["channels","chrono","clap",+ "crossterm 0.28.1","dashmap","harness_id","harnesses","macro_event_broker","macro_user_id","macro_uuid",+ "ratatui","reqwest 0.13.4","rootcause","rustls 0.23.40",@@ -3560,10 +3577,13 @@ dependencies = ["tokio","tokio-retry","tokio-tungstenite 0.28.0",+ "tokio-util","toml 0.8.23",+ "toml_edit 0.22.27","tower 0.5.3","tracing","tracing-subscriber",+ "uuid","webhook","webhook_signature","workspace-hack",@@ -3651,6 +3671,20 @@ dependencies = ["workspace-hack",]+[[package]]+name = "compact_str"+version = "0.8.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7fd622ebbb56a5b2ccb651b32b911cdeb2a9b4b11776b2473bf26a26a286244e"+dependencies = [+ "castaway",+ "cfg-if",+ "itoa",+ "rustversion",+ "ryu",+ "static_assertions",+]+[[package]]name = "complete_graph"version = "0.1.0"@@ -3849,7 +3883,7 @@ dependencies = ["encode_unicode","libc","once_cell",- "unicode-width 0.2.2",+ "unicode-width 0.2.0","windows-sys 0.59.0",]@@ -3861,7 +3895,7 @@ checksum = "4fe5f465a4f6fee88fad41b85d990f84c835335e85b5d9e6e63e0d06d28cba7c"dependencies = ["encode_unicode","libc",- "unicode-width 0.2.2",+ "unicode-width 0.2.0","windows-sys 0.61.2",]@@ -4286,6 +4320,22 @@ dependencies = ["winapi",]+[[package]]+name = "crossterm"+version = "0.28.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "829d955a0bb380ef178a640b91779e3987da38c9aea133b20614cfed8cdea9c6"+dependencies = [+ "bitflags 2.11.1",+ "crossterm_winapi",+ "mio 1.2.0",+ "parking_lot",+ "rustix 0.38.44",+ "signal-hook",+ "signal-hook-mio",+ "winapi",+]+[[package]]name = "crossterm_winapi"version = "0.9.1"@@ -4493,6 +4543,16 @@ dependencies = ["darling_macro 0.23.0",]+[[package]]+name = "darling"+version = "0.24.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ed17f5901b6630b993ca003def43f2f8ef4014fc13b047b57aad617ff32bc2ec"+dependencies = [+ "darling_core 0.24.1",+ "darling_macro 0.24.1",+]+[[package]]name = "darling_core"version = "0.20.11"@@ -4534,6 +4594,19 @@ dependencies = ["syn 2.0.117",]+[[package]]+name = "darling_core"+version = "0.24.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6837e2cf7485aaae18f86181d2f0e9a7ed297a025e220aeabf63fdebd3a2ddff"+dependencies = [+ "ident_case",+ "proc-macro2",+ "quote",+ "strsim",+ "syn 3.0.3",+]+[[package]]name = "darling_macro"version = "0.20.11"@@ -4567,6 +4640,17 @@ dependencies = ["syn 2.0.117",]+[[package]]+name = "darling_macro"+version = "0.24.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2ac7135c3ef02b2f7833bbeb1be5ba7f966dcde8a87c6b87f65a778d71a02785"+dependencies = [+ "darling_core 0.24.1",+ "quote",+ "syn 3.0.3",+]+[[package]]name = "dashmap"version = "6.2.1"@@ -6750,7 +6834,7 @@ version = "0.2.24"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "cfe4fbac503b8d1f88e6676011885f34b7174f46e59956bba534ba83abded4df"dependencies = [- "unicode-width 0.2.2",+ "unicode-width 0.2.0",][[package]]@@ -7667,7 +7751,7 @@ dependencies = ["html5ever 0.38.0","tendril 0.5.0","thiserror 2.0.18",- "unicode-width 0.2.2",+ "unicode-width 0.2.0",][[package]]@@ -8378,7 +8462,7 @@ checksum = "9433806cd6b4ec1aba79c021c7e4c58fb4c3b9977c085062e611ac929998fb0c"dependencies = ["console 0.16.4","portable-atomic",- "unicode-width 0.2.2",+ "unicode-width 0.2.0","unit-prefix","web-time",]@@ -8423,7 +8507,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "0fddf93031af70e75410a2511ec04d49e758ed2f26dad3404a934e0fb45cc12a"dependencies = ["bitflags 2.11.1",- "crossterm",+ "crossterm 0.25.0","dyn-clone","fuzzy-matcher","fxhash",@@ -8448,6 +8532,19 @@ dependencies = ["walkdir",]+[[package]]+name = "instability"+version = "0.3.13"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2bf84e73fa6f27f299dec58e13223cf70db80da872eb921d4f6138342a0eabc8"+dependencies = [+ "darling 0.24.1",+ "indoc",+ "proc-macro2",+ "quote",+ "syn 3.0.3",+]+[[package]]name = "instant"version = "0.1.13"@@ -9382,6 +9479,15 @@ dependencies = ["serde",]+[[package]]+name = "lru"+version = "0.12.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38"+dependencies = [+ "hashbrown 0.15.5",+]+[[package]]name = "lru"version = "0.16.4"@@ -10307,6 +10413,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "50b7e5b27aa02a74bac8c3f23f448f8d87ff11f92d3aac1a6ed369ee08cc56c1"dependencies = ["libc",+ "log","wasi 0.11.1+wasi-snapshot-preview1","windows-sys 0.61.2",]@@ -12975,6 +13082,27 @@ dependencies = ["rustversion",]+[[package]]+name = "ratatui"+version = "0.29.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "eabd94c2f37801c20583fc49dd5cd6b0ba68c716787c2dd6ed18571e1e63117b"+dependencies = [+ "bitflags 2.11.1",+ "cassowary",+ "compact_str",+ "crossterm 0.28.1",+ "indoc",+ "instability",+ "itertools 0.13.0",+ "lru 0.12.5",+ "paste",+ "strum 0.26.3",+ "unicode-segmentation",+ "unicode-truncate",+ "unicode-width 0.2.0",+]+[[package]]name = "rate_limit"version = "0.1.0"@@ -14839,6 +14967,7 @@ checksum = "b75a19a7a740b25bc7944bdee6172368f988763b744e3d4dfe753f6b4ece40cc"dependencies = ["libc","mio 0.8.11",+ "mio 1.2.0","signal-hook",]@@ -17007,6 +17136,17 @@ version = "1.13.2"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "9629274872b2bfaf8d66f5f15725007f635594914870f65218920345aa11aa8c"+[[package]]+name = "unicode-truncate"+version = "1.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b3644627a5af5fa321c95b9b235a72fd24cd29c648c2c379431e6628655627bf"+dependencies = [+ "itertools 0.13.0",+ "unicode-segmentation",+ "unicode-width 0.1.14",+]+[[package]]name = "unicode-width"version = "0.1.14"@@ -17015,9 +17155,9 @@ checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af"[[package]]name = "unicode-width"-version = "0.2.2"+version = "0.2.0"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254"+checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd"[[package]]name = "unicode-xid"@@ -18350,6 +18490,7 @@ dependencies = ["idna","indexmap 2.14.0","ipnet",+ "itertools 0.13.0","lazy_static","libc","linux-raw-sys 0.12.1",@@ -18357,6 +18498,7 @@ dependencies = ["memchr","mime_guess","miniz_oxide",+ "mio 1.2.0","num-bigint","num-integer","num-traits",@@ -18401,6 +18543,7 @@ dependencies = ["serde_with_macros","sha1 0.10.6","sha2 0.10.9",+ "signal-hook-mio","simd-adler32","slab","smallvec",diff --git a/Cargo.toml b/Cargo.tomlindex 351c26263f..d8412d375b 100644--- a/Cargo.toml+++ b/Cargo.toml@@ -175,6 +175,7 @@ chrono-tz = { version = "0.10.4", features = ["serde"] }clap = { version = "4.5.20", features = ["derive"] }cloudfront_sign = "0.3.0"constant_time_eq = "0.3.1"+crossterm = "0.28"cookie = "0.18.1"cron = "0.16.0"csv = "1"@@ -240,6 +241,7 @@ postcard = { version = "1", features = ["use-std"] }pollster = "0.4"quote = "1"rand = "0.9.0"+ratatui = "0.29"# uses vendored to fix lambda builds failing.rdkafka = { version = "0.37", default-features = false, features = ["cmake-build",@@ -299,6 +301,7 @@ tower-http = { version = "0.6.1", features = ["trace",] }toml = "0.8"+toml_edit = "0.22"tracing = "0.1.44"tracing-opentelemetry = "0.32.1"tracing-subscriber = { version = "0.3.22", features = ["env-filter", "json"] }diff --git a/apps/web/src/lib/service-clients/service-agent-harness/generated/schemas/createAgentSessionRequest.ts b/apps/web/src/lib/service-clients/service-agent-harness/generated/schemas/createAgentSessionRequest.tsindex 7ad86766e9..dac6f5c896 100644--- a/apps/web/src/lib/service-clients/service-agent-harness/generated/schemas/createAgentSessionRequest.ts+++ b/apps/web/src/lib/service-clients/service-agent-harness/generated/schemas/createAgentSessionRequest.ts@@ -39,8 +39,9 @@ in-process one acts on them today; `agent_harness`'s `AgentKind`records what each of the others will need to. */instructions?: CreateAgentSessionRequestInstructions;/** The user who owns the session. Ignored for user callers, who always-own their own sessions; required for bot callers without verified-acting-user claims.+own their own sessions, and for harness callers, whose verified acting+user (owner or confirmed team member) owns the session instead;+required for bot callers without verified acting-user claims.For bot callers this is a claim, not a verified fact: it is scoped tothe bot's own sessions, but the named user owns the session on thediff --git a/apps/web/src/lib/service-clients/service-agent-harness/generated/schemas/createAgentSessionRequestOwner.ts b/apps/web/src/lib/service-clients/service-agent-harness/generated/schemas/createAgentSessionRequestOwner.tsindex 87040125c8..9a7c2a79a8 100644--- a/apps/web/src/lib/service-clients/service-agent-harness/generated/schemas/createAgentSessionRequestOwner.ts+++ b/apps/web/src/lib/service-clients/service-agent-harness/generated/schemas/createAgentSessionRequestOwner.ts@@ -7,8 +7,9 @@/*** The user who owns the session. Ignored for user callers, who always-own their own sessions; required for bot callers without verified-acting-user claims.+own their own sessions, and for harness callers, whose verified acting+user (owner or confirmed team member) owns the session instead;+required for bot callers without verified acting-user claims.For bot callers this is a claim, not a verified fact: it is scoped tothe bot's own sessions, but the named user owns the session on thediff --git a/apps/web/src/lib/service-clients/service-agent-harness/openapi.json b/apps/web/src/lib/service-clients/service-agent-harness/openapi.jsonindex 37eb500ab3..e261a2ebfc 100644--- a/apps/web/src/lib/service-clients/service-agent-harness/openapi.json+++ b/apps/web/src/lib/service-clients/service-agent-harness/openapi.json@@ -835,7 +835,7 @@},"owner": {"type": ["string", "null"],- "description": "The user who owns the session. Ignored for user callers, who always\nown their own sessions; required for bot callers without verified\nacting-user claims.\n\nFor bot callers this is a claim, not a verified fact: it is scoped to\nthe bot's own sessions, but the named user owns the session on the\nbot's say-so."+ "description": "The user who owns the session. Ignored for user callers, who always\nown their own sessions, and for harness callers, whose verified acting\nuser (owner or confirmed team member) owns the session instead;\nrequired for bot callers without verified acting-user claims.\n\nFor bot callers this is a claim, not a verified fact: it is scoped to\nthe bot's own sessions, but the named user owns the session on the\nbot's say-so."},"prompt": {"type": ["string", "null"],diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/harnessSession.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/harnessSession.tsnew file mode 100644index 0000000000..32b41a380e--- /dev/null+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/harnessSession.ts@@ -0,0 +1,33 @@+/**+ * Generated by orval v7.21.0 🍺+ * Do not edit manually.+ * document_storage_service+ * OpenAPI spec version: 0.1.0+ */+import type { BotId } from './botId';++/**+ * An agent session running on a harness, as listed for the daemon's UI.+ */+export interface HarnessSession {+ /** The agent's `@` handle. */+ bot_handle: string;+ /** The agent the session runs for. */+ bot_id: BotId;+ /** The agent's display name. */+ bot_name: string;+ /** Creation timestamp. */+ created_at: string;+ /** Model the session was opened with. */+ model: string;+ /** Last-activity timestamp. */+ modified_at: string;+ /** The session's display name. */+ name: string;+ /** The user the session belongs to. */+ owner_id: string;+ /** The session id. */+ session_id: string;+ /** Session lifecycle status, e.g. `no_messages`, `active`. */+ status: string;+}diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/index.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/index.tsindex d3025e9f88..aed1112cd4 100644--- a/apps/web/src/lib/service-clients/service-storage/generated/schemas/index.ts+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/index.ts@@ -766,6 +766,7 @@ export * from './harnessOwnerOneOf';export * from './harnessOwnerOneOfThree';export * from './harnessOwnerOneOfThreeType';export * from './harnessOwnerOneOfType';+export * from './harnessSession';export * from './hashMap';export * from './hashMapOneOf';export * from './hashMapOneOfAllOf';diff --git a/apps/web/src/lib/service-clients/service-storage/generated/zod.ts b/apps/web/src/lib/service-clients/service-storage/generated/zod.tsindex 953a51b874..dac0ef851b 100644--- a/apps/web/src/lib/service-clients/service-storage/generated/zod.ts+++ b/apps/web/src/lib/service-clients/service-storage/generated/zod.ts@@ -8413,6 +8413,47 @@ export const listHarnessesResponseItem = zod);export const listHarnessesResponse = zod.array(listHarnessesResponseItem);+/**+ * @summary Handler for `GET /harnesses/me`.+ */+export const getSelfHarnessResponse = zod+ .object({+ connected: zod+ .boolean()+ .describe('Whether the daemon currently holds a runtime connection.'),+ created_at: zod.iso.datetime({}).describe('Creation timestamp.'),+ created_by: zod.string().describe('User that registered this harness.'),+ id: zod.string(),+ kind: zod.string().describe('Runtime kind. Currently always `macrod`.'),+ last_connected_at: zod.iso+ .datetime({})+ .nullish()+ .describe('When the daemon last attached a runtime connection.'),+ name: zod.string().describe('Display name.'),+ owner: zod+ .union([+ zod+ .object({+ type: zod.enum(['user']),+ user_id: zod.string().describe('Owner user id.'),+ })+ .describe('User-owned (private) harness.'),+ zod+ .object({+ team_id: zod.uuid().describe('Owner team id.'),+ type: zod.enum(['team']),+ })+ .describe('Team-owned harness, usable by every team member.'),+ ])+ .describe(+ 'Harness owner.\n\nExactly one of a user or a team, mirroring the bots owner pattern. There\nare no system harnesses.'+ ),+ updated_at: zod.iso.datetime({}).describe('Update timestamp.'),+ })+ .describe(+ 'A registered user-run harness.\n\nClients deserialize this, so both derives are used.'+ );+/*** @summary Handler for `GET /harnesses/me/agents`.*/@@ -8427,6 +8468,31 @@ export const listHarnessAgentsResponse = zod.array(listHarnessAgentsResponseItem);+/**+ * @summary Handler for `GET /harnesses/me/sessions`.+ */+export const listHarnessSessionsResponseItem = zod+ .object({+ bot_handle: zod.string().describe("The agent's `@` handle."),+ bot_id: zod.string(),+ bot_name: zod.string().describe("The agent's display name."),+ created_at: zod.iso.datetime({}).describe('Creation timestamp.'),+ model: zod.string().describe('Model the session was opened with.'),+ modified_at: zod.iso.datetime({}).describe('Last-activity timestamp.'),+ name: zod.string().describe("The session's display name."),+ owner_id: zod.string().describe('The user the session belongs to.'),+ session_id: zod.uuid().describe('The session id.'),+ status: zod+ .string()+ .describe('Session lifecycle status, e.g. `no_messages`, `active`.'),+ })+ .describe(+ "An agent session running on a harness, as listed for the daemon's UI."+ );+export const listHarnessSessionsResponse = zod.array(+ listHarnessSessionsResponseItem+);+/*** @summary Handler for `DELETE /harnesses/{harness_id}`.*/diff --git a/apps/web/src/lib/service-clients/service-storage/openapi.json b/apps/web/src/lib/service-clients/service-storage/openapi.jsonindex 9337378ff8..41083163ad 100644--- a/apps/web/src/lib/service-clients/service-storage/openapi.json+++ b/apps/web/src/lib/service-clients/service-storage/openapi.json@@ -9000,6 +9000,96 @@}}},+ "/harnesses/me": {+ "get": {+ "tags": ["harnesses"],+ "summary": "Handler for `GET /harnesses/me`.",+ "operationId": "get_self_harness",+ "responses": {+ "200": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/Harness"+ }+ }+ }+ },+ "401": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ErrorResponse"+ }+ }+ }+ },+ "404": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ErrorResponse"+ }+ }+ }+ },+ "500": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ErrorResponse"+ }+ }+ }+ }+ }+ },+ "delete": {+ "tags": ["harnesses"],+ "summary": "Handler for `DELETE /harnesses/me`.",+ "description": "A daemon retiring itself: the valid credential is the authorization.",+ "operationId": "delete_self_harness",+ "responses": {+ "204": {+ "description": ""+ },+ "401": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ErrorResponse"+ }+ }+ }+ },+ "404": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ErrorResponse"+ }+ }+ }+ },+ "500": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ErrorResponse"+ }+ }+ }+ }+ }+ }+ },"/harnesses/me/agents": {"get": {"tags": ["harnesses"],@@ -9042,6 +9132,48 @@}}},+ "/harnesses/me/sessions": {+ "get": {+ "tags": ["harnesses"],+ "summary": "Handler for `GET /harnesses/me/sessions`.",+ "operationId": "list_harness_sessions",+ "responses": {+ "200": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "type": "array",+ "items": {+ "$ref": "#/components/schemas/HarnessSession"+ }+ }+ }+ }+ },+ "401": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ErrorResponse"+ }+ }+ }+ },+ "500": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ErrorResponse"+ }+ }+ }+ }+ }+ }+ },"/harnesses/{harness_id}": {"delete": {"tags": ["harnesses"],@@ -21335,6 +21467,67 @@],"description": "Harness owner.\n\nExactly one of a user or a team, mirroring the bots owner pattern. There\nare no system harnesses."},+ "HarnessSession": {+ "type": "object",+ "description": "An agent session running on a harness, as listed for the daemon's UI.",+ "required": [+ "session_id",+ "bot_id",+ "bot_name",+ "bot_handle",+ "name",+ "status",+ "model",+ "owner_id",+ "created_at",+ "modified_at"+ ],+ "properties": {+ "bot_handle": {+ "type": "string",+ "description": "The agent's `@` handle."+ },+ "bot_id": {+ "$ref": "#/components/schemas/BotId",+ "description": "The agent the session runs for."+ },+ "bot_name": {+ "type": "string",+ "description": "The agent's display name."+ },+ "created_at": {+ "type": "string",+ "format": "date-time",+ "description": "Creation timestamp."+ },+ "model": {+ "type": "string",+ "description": "Model the session was opened with."+ },+ "modified_at": {+ "type": "string",+ "format": "date-time",+ "description": "Last-activity timestamp."+ },+ "name": {+ "type": "string",+ "description": "The session's display name."+ },+ "owner_id": {+ "type": "string",+ "description": "The user the session belongs to."+ },+ "session_id": {+ "type": "string",+ "format": "uuid",+ "description": "The session id."+ },+ "status": {+ "type": "string",+ "description": "Session lifecycle status, e.g. `no_messages`, `active`."+ }+ }+ },"HashMap": {"type": "object","additionalProperties": {diff --git a/crates/agent_harness/src/domain/ports.rs b/crates/agent_harness/src/domain/ports.rsindex 4d95d29508..2c948584b3 100644--- a/crates/agent_harness/src/domain/ports.rs+++ b/crates/agent_harness/src/domain/ports.rs@@ -160,6 +160,15 @@ pub trait RuntimeConnections: Send + Sync + 'static {bot: BotId,session: AgentSessionId,) -> impl Future<Output = Option<RuntimeAttachment<Self::Connector>>> + Send;++ /// The harness a bot's sessions currently bind to, without attaching+ /// anything. `None` for an unbound bot. Same resolution as [`bind`], for+ /// callers that need to know which harness serves a bot rather than to+ /// route to it.+ fn bound_harness(+ &self,+ bot: BotId,+ ) -> impl Future<Output = anyhow::Result<Option<HarnessId>>> + Send;}/// Mints the one secret a sandbox is given, and the config that points it atdiff --git a/crates/agent_harness/src/domain/service.rs b/crates/agent_harness/src/domain/service.rsindex fbf5303f26..0b75cb9a66 100644--- a/crates/agent_harness/src/domain/service.rs+++ b/crates/agent_harness/src/domain/service.rs@@ -396,6 +396,21 @@ where.await.map_err(into_session_error)}++ async fn session_harness(+ &self,+ id: AgentSessionId,+ ) -> agent_session::domain::error::Result<Option<harness_id::HarnessId>> {+ // The row is the source of truth for which bot the session runs, and+ // the binding resolves the bot's current harness the same way `bind`+ // does at delivery time.+ let session = self.inner.sessions.get_session(id).await?;+ self.inner+ .runtimes+ .bound_harness(session.bot_id)+ .await+ .map_err(AgentSessionError::Unknown)+ }}/// External sessions create the row and announce - the magic-chip messagediff --git a/crates/agent_harness/src/outbound/runtime_registry.rs b/crates/agent_harness/src/outbound/runtime_registry.rsindex 33ace29517..2df9a1e97f 100644--- a/crates/agent_harness/src/outbound/runtime_registry.rs+++ b/crates/agent_harness/src/outbound/runtime_registry.rs@@ -179,4 +179,8 @@ where.map(|entry| Arc::clone(&entry))?;Some(connection.bind(session).await)}++ async fn bound_harness(&self, bot: BotId) -> anyhow::Result<Option<HarnessId>> {+ self.bindings.harness_for(bot).await+ }}diff --git a/crates/agent_session/src/domain/ports.rs b/crates/agent_session/src/domain/ports.rsindex 0ed3fff4cc..6edbc9a85c 100644--- a/crates/agent_session/src/domain/ports.rs+++ b/crates/agent_session/src/domain/ports.rs@@ -472,4 +472,16 @@ pub trait AgentSessionNotificationRecipient: Send + Sync + 'static {id: AgentSessionId,size: SandboxSize,) -> impl Future<Output = Result<()>> + Send;++ /// The harness currently bound to serve this session, resolved through its+ /// bot's binding. `None` for a managed session or an unbound bot.+ ///+ /// The control routes use it to confine a harness caller to the sessions+ /// its own daemon serves: ownership alone would let a harness that merely+ /// acts for a user drive or delete sessions another harness serves for the+ /// same user.+ fn session_harness(+ &self,+ id: AgentSessionId,+ ) -> impl Future<Output = Result<Option<harness_id::HarnessId>>> + Send;}diff --git a/crates/agent_session/src/inbound/axum_router.rs b/crates/agent_session/src/inbound/axum_router.rsindex e238ef4798..379c7b3951 100644--- a/crates/agent_session/src/inbound/axum_router.rs+++ b/crates/agent_session/src/inbound/axum_router.rs@@ -500,6 +500,28 @@ pub async fn rename_agent_session_handler<Ok(StatusCode::NO_CONTENT)}+/// Confine a harness caller to the sessions its own daemon serves.+///+/// The access extractor already proved the caller owns the session, but owning+/// it is not enough for a harness: a harness that merely acts for a user could+/// otherwise drive, resize or delete a session a *different* harness serves+/// for that same user (and reach managed sessions no daemon serves at all).+/// User and bot callers are unrestricted here - their reach is the access+/// extractor's call. A harness may act only when the session's bot binds to it.+async fn ensure_harness_serves_session<R: AgentSessionNotificationRecipient>(+ caller: &UserBotOrHarnessAuthorization,+ recipient: &R,+ session_id: AgentSessionId,+) -> Result<(), AgentSessionApiError> {+ let UserBotOrHarnessAuthorization::Harness(harness) = caller else {+ return Ok(());+ };+ if recipient.session_harness(session_id).await? != Some(harness.harness_id) {+ return Err(AgentSessionError::Forbidden.into());+ }+ Ok(())+}+#[utoipa::path(post,path = "/agent-sessions/{session_id}/control",@@ -539,6 +561,13 @@ pub async fn control_agent_session_handler<Path(session_id): Path<Uuid>,Json(req): Json<ControlRequest>,) -> Result<Json<AgentActionId>, AgentSessionApiError> {+ ensure_harness_serves_session(+ &caller.authorization,+ state.recipient.as_ref(),+ AgentSessionId::new_from_uuid(session_id),+ )+ .await?;+let actor = caller.authorization.acting_user()@@ -580,13 +609,15 @@ pub async fn delete_agent_session_handler<>(_access: AgentSessionAccessLevelExtractor<OwnerAccessLevel, Access, Auth>,State(state): State<AgentSessionControlState<R, Access, Auth>>,+ caller: MacroAuthorizationExtractor<Auth, UserBotOrHarness>,Path(session_id): Path<Uuid>,) -> Result<StatusCode, AgentSessionApiError> {- state- .recipient- .session_deleted(AgentSessionId::new_from_uuid(session_id))+ let session_id = AgentSessionId::new_from_uuid(session_id);+ ensure_harness_serves_session(&caller.authorization, state.recipient.as_ref(), session_id).await?;+ state.recipient.session_deleted(session_id).await?;+Ok(StatusCode::OK)}@@ -621,12 +652,17 @@ pub async fn put_agent_session_sandbox_size_handler<>(_access: AgentSessionAccessLevelExtractor<OwnerAccessLevel, Access, Auth>,State(state): State<AgentSessionControlState<R, Access, Auth>>,+ caller: MacroAuthorizationExtractor<Auth, UserBotOrHarness>,Path(session_id): Path<Uuid>,Json(req): Json<SandboxSizeBody>,) -> Result<Json<SandboxSizeBody>, AgentSessionApiError> {+ let session_id = AgentSessionId::new_from_uuid(session_id);+ ensure_harness_serves_session(&caller.authorization, state.recipient.as_ref(), session_id)+ .await?;+state.recipient- .set_sandbox_size(AgentSessionId::new_from_uuid(session_id), req.size)+ .set_sandbox_size(session_id, req.size).await?;Ok(Json(req))}@@ -928,8 +964,9 @@ pub struct CreateAgentSessionRequest {/// optional: having it cloned there is the runtime operator's job.pub repo_url: Option<String>,/// The user who owns the session. Ignored for user callers, who always- /// own their own sessions; required for bot callers without verified- /// acting-user claims.+ /// own their own sessions, and for harness callers, whose verified acting+ /// user (owner or confirmed team member) owns the session instead;+ /// required for bot callers without verified acting-user claims.////// For bot callers this is a claim, not a verified fact: it is scoped to/// the bot's own sessions, but the named user owns the session on the@@ -1141,23 +1178,20 @@ fn resolve_bot(/// Resolve the user who owns the session.///-/// A user caller always owns their own sessions. A bot caller's verified-/// acting user wins when present; otherwise the body's claimed owner is-/// accepted (see [`CreateAgentSessionRequest::owner`] for the trust model). A-/// harness caller always has a verified acting user - the harness owner by-/// default - so the body's claim wins for it the way it does for bots: the-/// daemon opens sessions for whoever mentioned the agent, and channel-scoped-/// mention senders need not be verifiable against harness ownership.+/// A user caller always owns their own sessions. A harness caller always has a+/// verified acting user - the owner for a private harness, a confirmed team+/// member for a team one (the harness authorizer checks the forwarded+/// `x-macro-harness-for-macro-user-id` claim against ownership) - and that+/// verified user owns the session; the body's `owner` claim is never trusted+/// for it. This matches the control endpoint, which already acts only for that+/// verified user: a session that could not later be prompted for its owner is+/// one that should never have been created for that owner. A bot caller's+/// verified acting user wins when present; otherwise the body's claimed owner+/// is accepted (see [`CreateAgentSessionRequest::owner`] for the trust model).fn resolve_owner(caller: &UserBotOrHarnessAuthorization,claimed: Option<String>,) -> Result<MacroUserIdStr<'static>, CreateSessionApiError> {- if let UserBotOrHarnessAuthorization::Harness(_) = caller- && let Some(claimed) = claimed- {- return MacroUserIdStr::try_from(claimed)- .map_err(|_| CreateSessionApiError::UnparseableOwner);- }if let Some(user) = caller.acting_user() {return Ok(user.macro_user_id.clone());}diff --git a/crates/agent_session/src/inbound/axum_router/test.rs b/crates/agent_session/src/inbound/axum_router/test.rsindex 4f88deab58..14f46e159e 100644--- a/crates/agent_session/src/inbound/axum_router/test.rs+++ b/crates/agent_session/src/inbound/axum_router/test.rs@@ -5,10 +5,10 @@ use axum::http::{Request, header};use chrono::Utc;use macro_authorization::{BOT_SCOPE_HEADER, BOT_TOKEN_HEADER, BotActingUserClaims, BotAuthentication, BotAuthorizer,- BotScope, HARNESS_TOKEN_HEADER, HarnessAuthentication, HarnessAuthorizationOwner,- HarnessAuthorizer, InternalAuthConfig, JwtValidator, MacroAuthorizationError,- MacroAuthorizationServiceImpl, MacroUserAuthentication, NoUserApiKeyAuthorizer,- ValidatedIdentity,+ BotScope, HARNESS_FOR_MACRO_USER_ID_HEADER, HARNESS_TOKEN_HEADER, HarnessAuthentication,+ HarnessAuthorizationOwner, HarnessAuthorizer, InternalAuthConfig, JwtValidator,+ MacroAuthorizationError, MacroAuthorizationServiceImpl, MacroUserAuthentication,+ NoUserApiKeyAuthorizer, ValidatedIdentity,};use rootcause::Report;use std::sync::{Arc, Mutex};@@ -267,6 +267,17 @@ fn as_harness(request_body: String) -> Request<Body> {.unwrap()}+/// A harness request that forwards a verified acting-user claim, the way the+/// daemon does for the user who mentioned the agent.+fn as_harness_for(user: &str, request_body: String) -> Request<Body> {+ Request::post("/")+ .header(header::CONTENT_TYPE, "application/json")+ .header(HARNESS_TOKEN_HEADER, HARNESS_TOKEN)+ .header(HARNESS_FOR_MACRO_USER_ID_HEADER, user)+ .body(Body::from(request_body))+ .unwrap()+}+fn as_user(user: &str, request_body: String) -> Request<Body> {Request::post("/").header(header::CONTENT_TYPE, "application/json")@@ -357,8 +368,29 @@ async fn a_bot_may_not_name_another_bot() {}#[tokio::test]-async fn a_harness_opens_a_session_for_a_bound_agent() {+async fn a_harness_session_is_owned_by_its_verified_acting_user() {let opener = Arc::new(RecordingOpener::default());+ // The daemon forwards the mention sender as a verified acting-user claim;+ // that user - not the token's default owner - owns the session.+ let request = as_harness_for(+ STRANGER,+ body(Some(BotId::TEST_A.as_uuid()), "/srv/agent", None),+ );++ let response = router(opener.clone()).oneshot(request).await.unwrap();++ assert_eq!(response.status(), StatusCode::CREATED);+ let opened = opener.opened.lock().unwrap();+ assert_eq!(opened[0].bot_id, BotId::TEST_A);+ assert_eq!(opened[0].owner.as_ref(), STRANGER);+}++#[tokio::test]+async fn a_harness_may_not_own_a_session_by_an_unverified_body_claim() {+ let opener = Arc::new(RecordingOpener::default());+ // No forwarded claim, so the harness acts as its verified default owner.+ // The body's `owner` is a claim the harness cannot verify and must be+ // ignored - otherwise a daemon could plant sessions in any account.let request = as_harness(body(Some(BotId::TEST_A.as_uuid()),"/srv/agent",@@ -370,9 +402,7 @@ async fn a_harness_opens_a_session_for_a_bound_agent() {assert_eq!(response.status(), StatusCode::CREATED);let opened = opener.opened.lock().unwrap();assert_eq!(opened[0].bot_id, BotId::TEST_A);- // The body's claimed owner wins for harness callers: the daemon opens- // sessions for whoever mentioned the agent.- assert_eq!(opened[0].owner.as_ref(), STRANGER);+ assert_eq!(opened[0].owner.as_ref(), OWNER);}#[tokio::test]diff --git a/crates/coding_agent_worker/Cargo.toml b/crates/coding_agent_worker/Cargo.tomlindex e65b51731e..fc97b757d8 100644--- a/crates/coding_agent_worker/Cargo.toml+++ b/crates/coding_agent_worker/Cargo.toml@@ -23,12 +23,14 @@ bot_id = { path = "../bot_id" }bots = { path = "../bots", default-features = false }chrono = { workspace = true }clap = { workspace = true }+crossterm = { workspace = true }harness_id = { path = "../harness_id" }harnesses = { path = "../harnesses", default-features = false }dashmap = { workspace = true }macro_event_broker = { path = "../macro_event_broker", default-features = false }macro_user_id = { path = "../macro_user_id" }macro_uuid = { path = "../macro_uuid" }+ratatui = { workspace = true }reqwest = { workspace = true }rootcause = { workspace = true }# The gateway dial is `wss` on every deployment but a local stack, and@@ -40,9 +42,12 @@ strum = { workspace = true }thiserror = { workspace = true }tokio = { workspace = true, features = ["macros", "process", "rt-multi-thread", "signal", "time"] }tokio-retry = { workspace = true }+tokio-util = { workspace = true, features = ["rt"] }tokio-tungstenite = { workspace = true }toml = { workspace = true }+toml_edit = { workspace = true }tracing = { workspace = true }+uuid = { workspace = true }tracing-subscriber = { workspace = true }webhook = { path = "../webhook", default-features = false }webhook_signature = { path = "../webhook_signature" }diff --git a/crates/coding_agent_worker/config.example.toml b/crates/coding_agent_worker/config.example.tomlindex 50250dbd3d..0df5a62abd 100644--- a/crates/coding_agent_worker/config.example.toml+++ b/crates/coding_agent_worker/config.example.toml@@ -1,9 +1,9 @@# Everything a coding agent daemon needs to serve one harness's sessions.#-# Deliberately credential-free: run `macrod login` (or just `macrod` on a-# fresh setup) to pair this daemon with a Macro deployment. Pairing prints a-# code, you approve it in the web app (choosing private or team), and the-# minted credential is kept in `macro.credentials.json` next to this file.+# Deliberately credential-free: `macrod` starts unpaired and the control+# panel offers pairing (press p). Pairing shows a code, you approve it in the+# web app (choosing private or team), and the minted credential is kept in+# `macro.credentials.json` next to this file.[macro]# Base URL of the agent-harness service. Its ws(s) twin hosts the runtimediff --git a/crates/coding_agent_worker/justfile b/crates/coding_agent_worker/justfileindex 854b407c59..96d28adf6c 100644--- a/crates/coding_agent_worker/justfile+++ b/crates/coding_agent_worker/justfile@@ -1,7 +1,7 @@-# Run the coding agent daemon.+# Run the coding agent daemon - one command, the control panel.#-# just serve-# RUST_LOG=coding_agent_worker=trace just serve # tap the ACP wire+# just run+# RUST_LOG=coding_agent_worker=trace just run # tap the ACP wire (Logs tab)## Reads the repo-root macro.toml by default; override with CONFIG=/path/to.toml.@@ -10,8 +10,9 @@ CONFIG := env("CONFIG", justfile_directory() + "/../../macro.toml")ROOT := justfile_directory() + "/../.."SCRIPTS := ROOT + "/tooling/xtask/crates/xtask_workflows/src/workflows/scripts"-# Serve this bot's agent sessions: webhook receiver, one connection, one harness.-serve:+# Serve this harness's agent sessions inside the control panel: registration,+# bound agents, live sessions, config, pairing, and logs - one process.+run:SQLX_OFFLINE=true cargo run -p coding_agent_worker -- --config {{ CONFIG }}# Build the release `macrod` the way the tag workflow does, and prove it is asdiff --git a/crates/coding_agent_worker/src/config.rs b/crates/coding_agent_worker/src/config.rsindex 8181ae5f3a..e6ace5e63d 100644--- a/crates/coding_agent_worker/src/config.rs+++ b/crates/coding_agent_worker/src/config.rs@@ -2,9 +2,9 @@//! serves, the webhook server it listens on, and the harness it runs per//! session. See `config.example.toml` at the crate root.//!-//! Deliberately credential-free: identity comes from pairing (`macrod login`,-//! or the first `macrod` run), which persists the harness credential in a-//! state file next to this config.+//! Deliberately credential-free: identity comes from pairing (press `p` in+//! the control panel), which persists the harness credential in a state file+//! next to this config.use serde::Deserialize;use std::path::{Path, PathBuf};diff --git a/crates/coding_agent_worker/src/daemon.rs b/crates/coding_agent_worker/src/daemon.rsnew file mode 100644index 0000000000..ac3f0a1cf6--- /dev/null+++ b/crates/coding_agent_worker/src/daemon.rs@@ -0,0 +1,200 @@+//! The serving core, packaged so it can be started, stopped, and restarted.+//!+//! The control panel owns exactly one of these, restarting it when the+//! credential changes (a re-pair) and stopping it when the harness is+//! removed - which is what makes the TUI and the daemon one process.++use std::path::{Path, PathBuf};+use std::sync::Arc;+use std::time::Duration;++use rootcause::prelude::ResultExt as _;+use tokio_util::sync::CancellationToken;++use crate::config::Config;+use crate::dispatch::Dispatcher;+use crate::outbound::agent_session::HarnessApi;+use crate::outbound::credentials::HarnessCredentials;+use crate::outbound::registration::FeedReconciler;+use crate::runtime::Runtime;+use crate::webhook::{WebhookState, webhook_router};++/// How often the bound-agent set is re-read and the feed reconciled to it, so+/// a newly bound agent starts triggering without a restart. Short on purpose:+/// a mention sent before the feed covers the new agent is dropped for good,+/// so this interval is the worst-case window where a brand-new agent is deaf.+const FEED_RECONCILE_INTERVAL: Duration = Duration::from_secs(10);++/// A running serving core: webhook receiver, feed reconciler, harness bridge.+pub struct Daemon {+ cancel: CancellationToken,+ task: tokio::task::JoinHandle<rootcause::Result<()>>,+}++impl Daemon {+ /// Bind the webhook server and start serving in background tasks.+ ///+ /// Returns once the listener is bound (so a failed bind is an immediate+ /// error, not a background log line); the serving itself runs until+ /// [`Daemon::stop`] or the task fails.+ pub async fn start(+ config: Config,+ credentials: HarnessCredentials,+ config_path: &Path,+ ) -> rootcause::Result<Self> {+ // The ACP launch config carries command, args, and env but no working+ // directory, and every session this daemon serves runs in the one+ // configured workspace - so the daemon's own cwd is the harness's cwd.+ std::env::set_current_dir(&config.workspace.path).context(format!(+ "failed to enter the workspace directory {}",+ config.workspace.path.display()+ ))?;++ let cancel = CancellationToken::new();++ // The feed: make sure one exists, points here, covers the bound+ // agents, and we hold its secret. An explicit config secret skips+ // registration entirely (manual setups).+ let reconciler = Arc::new(FeedReconciler::new(+ &config.macro_api,+ &config.server,+ credentials.clone(),+ config_path,+ ));+ let signing_secret = Arc::new(std::sync::RwLock::new(String::new()));+ match &config.server.signing_secret {+ Some(secret) => {+ *signing_secret.write().expect("signing secret lock") = secret.clone();+ }+ None => {+ // `None` is a daemon with nothing bound yet: it serves anyway,+ // and the reconcile loop registers the feed the moment an+ // agent is bound in the app.+ let initial = reconciler+ .ensure_feed()+ .await+ .context("failed to register this harness's trigger feed")?;+ if let Some(feed) = &initial {+ *signing_secret.write().expect("signing secret lock") =+ feed.signing_secret.clone();+ }+ // Validation probes the endpoint, so it can only pass once we+ // serve; request it from the side once the listener is up,+ // and keep the feed covering the bound-agent set from then on.+ let reconciler = Arc::clone(&reconciler);+ let signing_secret = Arc::clone(&signing_secret);+ let cancel = cancel.clone();+ tokio::spawn(async move {+ let mut current = None;+ if let Some(feed) = initial {+ if !feed.is_valid {+ reconciler.request_validation(&feed.webhook_id).await;+ }+ current = Some(feed.webhook_id);+ }+ tokio::select! {+ () = reconcile_forever(reconciler, signing_secret, current) => {}+ () = cancel.cancelled() => {}+ }+ });+ }+ }++ let api = HarnessApi::new(&config.macro_api, &credentials);+ let runtime = Runtime::new(&config.macro_api, &credentials, config.harness.clone());+ let app = webhook_router(WebhookState {+ executor: Dispatcher::new(api, runtime, config.workspace.clone()),+ signing_secret: Arc::clone(&signing_secret),+ });++ let port = config.server.port;+ let listener = tokio::net::TcpListener::bind(("0.0.0.0", port))+ .await+ .context(format!(+ "failed to bind the webhook server to port {port} - is another macrod \+ (a separate `macrod` serve, or another tui) already running?"+ ))?;+ tracing::info!(+ port,+ pid = std::process::id(),+ api = %config.macro_api.api_url,+ harness_id = %credentials.harness_id,+ harness = %config.harness.command,+ workspace = %config.workspace.path.display(),+ "daemon listening for agent triggers"+ );++ let shutdown = cancel.clone();+ let task = tokio::spawn(async move {+ axum::serve(listener, app)+ .with_graceful_shutdown(async move { shutdown.cancelled().await })+ .await+ .context("the webhook server stopped")?;+ Ok(())+ });++ Ok(Self { cancel, task })+ }++ /// Whether the serving task is still alive.+ pub fn is_running(&self) -> bool {+ !self.task.is_finished()+ }++ /// Stop serving: unbind the webhook port and end the reconcile loop.+ ///+ /// A live harness bridge (the WebSocket + spawned harness process) is not+ /// torn down here; it dies with the process, and a restarted daemon's+ /// fresh dial displaces it at the gateway.+ pub async fn stop(self) {+ self.cancel.cancel();+ let _ = self.task.await;+ tracing::info!("daemon stopped");+ }+}++/// Absolute form of the config path, so a `chdir` into the workspace never+/// re-points relative reads and writes of the config and its state files.+pub fn absolute_config_path(config_path: &Path) -> PathBuf {+ std::path::absolute(config_path).unwrap_or_else(|_| config_path.to_owned())+}++/// Keep the feed covering the bound-agent set: registered once anything is+/// bound, replaced (along with the secret the receiver verifies with) when+/// the set or endpoint changes, and dropped when nothing is bound any more.+async fn reconcile_forever(+ reconciler: Arc<FeedReconciler>,+ signing_secret: Arc<std::sync::RwLock<String>>,+ mut current_webhook_id: Option<String>,+) {+ loop {+ tokio::time::sleep(FEED_RECONCILE_INTERVAL).await;+ match reconciler.ensure_feed().await {+ Ok(Some(feed)) => {+ if current_webhook_id.as_deref() != Some(feed.webhook_id.as_str()) {+ tracing::info!(webhook_id = %feed.webhook_id, "trigger feed registered");+ *signing_secret.write().expect("signing secret lock") =+ feed.signing_secret.clone();+ if !feed.is_valid {+ reconciler.request_validation(&feed.webhook_id).await;+ }+ current_webhook_id = Some(feed.webhook_id);+ }+ }+ Ok(None) => {+ if current_webhook_id.take().is_some() {+ // Drop the secret with the feed: retaining it would keep+ // verifying deliveries signed for a webhook the server has+ // already deleted. Empty fails closed (see+ // `webhook_signature::verify`), which is correct while+ // nothing is bound to serve.+ signing_secret.write().expect("signing secret lock").clear();+ tracing::info!("trigger feed removed; no agents are bound any more");+ }+ }+ Err(error) => {+ tracing::warn!(error = ?error, "trigger feed reconciliation failed; will retry");+ }+ }+ }+}diff --git a/crates/coding_agent_worker/src/dispatch.rs b/crates/coding_agent_worker/src/dispatch.rsindex 35aff72c20..42f03555f2 100644--- a/crates/coding_agent_worker/src/dispatch.rs+++ b/crates/coding_agent_worker/src/dispatch.rs@@ -71,7 +71,7 @@ impl WorkExecutor for Dispatcher {// there is nothing to state here.instructions: None,};- let created = match self.api.create_session(&request).await {+ let created = match self.api.create_session(&request, &sender).await {Ok(created) => created,// A redelivered mention: the thread's session exists.// Resume serving it - the first attempt may have dieddiff --git a/crates/coding_agent_worker/src/main.rs b/crates/coding_agent_worker/src/main.rsindex e51a955b85..70177ff829 100644--- a/crates/coding_agent_worker/src/main.rs+++ b/crates/coding_agent_worker/src/main.rs@@ -1,246 +1,68 @@//! The coding agent daemon: serve a registered harness's agent sessions from//! this machine.//!-//! First run pairs the daemon with a Macro deployment: it prints a code, the-//! user approves it in the web app (choosing private or team), and the minted-//! harness credential is persisted next to the config. Every run after that-//! boots a signed-webhook receiver and waits. Each `agent_trigger.new`-//! delivery opens a session over the harness service's API, dials its-//! runtime gateway, spawns the configured harness in ACP mode, bridges its-//! stdio to the websocket, and forwards the mention as the first prompt;-//! `agent_trigger.existing` deliveries forward follow-up messages, redialing-//! first when the bridge is gone.+//! `macrod` is one process and one command: the serving core (webhook+//! receiver, feed reconciler, harness bridge) running inside a terminal+//! control panel that shows what it is serving - the registration, the agents+//! bound to it, their sessions, and the daemon's own logs - and manages its+//! own pairing, config, and retirement.+//!+//! A first run starts unpaired: the panel offers pairing (press `p`), the+//! user approves the printed code in the web app, and the minted harness+//! credential is persisted next to the config. Once paired, each+//! `agent_trigger.new` delivery opens a session over the harness service's+//! API, dials its runtime gateway, spawns the configured harness in ACP mode,+//! bridges its stdio to the websocket, and forwards the mention as the first+//! prompt; `agent_trigger.existing` deliveries forward follow-up messages,+//! redialing first when the bridge is gone.mod config;+mod daemon;mod dispatch;mod harness;mod outbound;mod runtime;+mod tui;mod webhook;-use clap::{Parser, Subcommand};-use config::Config;-use rootcause::prelude::ResultExt as _;+use clap::Parser;use std::path::PathBuf;use std::process::ExitCode;-use std::sync::Arc;-use std::time::Duration;--use crate::dispatch::Dispatcher;-use crate::outbound::agent_session::HarnessApi;-use crate::outbound::credentials::{CredentialStore as _, FileCredentialStore, HarnessCredentials};-use crate::outbound::pairing;-use crate::outbound::registration::FeedReconciler;-use crate::runtime::Runtime;-use crate::webhook::{WebhookState, webhook_router};-/// How often the bound-agent set is re-read and the feed reconciled to it, so-/// a teammate's newly bound agent starts triggering without a restart.-const FEED_RECONCILE_INTERVAL: Duration = Duration::from_secs(60);+use crate::daemon::absolute_config_path;-/// Serve a harness's agent sessions: host the webhook receiver, bridge each-/// triggered session to a harness process.+/// Serve a harness's agent sessions inside the control panel: registration,+/// bound agents, live sessions, config editing, pairing, removal, and logs -+/// one process.#[derive(Parser)]#[command(name = "macrod", version)]struct Args {/// Path to the daemon's TOML config.#[arg(long, default_value = "macro.toml")]config: PathBuf,- #[command(subcommand)]- command: Option<Command>,-}--/// What to do; none means serve.-#[derive(Subcommand)]-enum Command {- /// Pair this daemon with a Macro deployment, replacing any stored- /// credential.- Login,}#[tokio::main]async fn main() -> ExitCode {- tracing_subscriber::fmt()- .with_env_filter(- tracing_subscriber::EnvFilter::try_from_default_env()- .unwrap_or_else(|_| tracing_subscriber::EnvFilter::new("info")),- )- .init();-// Dialing a `wss` gateway needs a process-wide provider, and rustls// installs none by itself. Before any dial, and idempotent: an error only// means somebody already did this.let _ = rustls::crypto::aws_lc_rs::default_provider().install_default();let args = Args::parse();- let outcome = match args.command {- Some(Command::Login) => login(&args.config).await,- None => run(&args.config).await,- };- match outcome {+ // The daemon chdirs into the workspace, so the config path must stop+ // being relative before anything re-reads or rewrites it.+ let config_path = absolute_config_path(&args.config);++ // The TUI owns the terminal, so its logs go to a ring buffer it renders.+ let logs = tui::LogBuffer::install();+ match tui::run(&config_path, logs).await {Ok(()) => ExitCode::SUCCESS,Err(error) => {- tracing::error!(error = ?error, "daemon exited with an error");+ // The ring buffer dies with the process and the terminal is+ // restored by now, so the exit error goes straight to stderr.+ eprintln!("macrod exited with an error: {error:?}");ExitCode::FAILURE}}}--/// Pair (or re-pair) and persist the credential.-async fn login(config_path: &std::path::Path) -> rootcause::Result<()> {- let config = Config::load(config_path)?;- let store = FileCredentialStore::for_config(config_path);- if let Some(existing) = store.load()? {- println!(- "Replacing the stored credential for harness {} - the old harness row stays listed until you remove it in Settings -> Harness.",- existing.harness_id- );- }- let credentials = pair_and_save(&config, &store).await?;- println!(- "Run `macrod` to start serving harness {}.",- credentials.harness_id- );- Ok(())-}--async fn pair_and_save(- config: &Config,- store: &FileCredentialStore,-) -> rootcause::Result<HarnessCredentials> {- let credentials = pairing::pair(config).await?;- store.save(&credentials)?;- println!("Credentials saved to {}.", store.path().display());- Ok(credentials)-}--async fn run(config_path: &std::path::Path) -> rootcause::Result<()> {- let config = Config::load(config_path)?;-- // Identity: from the pairing state file, pairing interactively on a- // first run so `macrod` with a fresh config walks straight into setup.- let store = FileCredentialStore::for_config(config_path);- let credentials = match store.load()? {- Some(credentials) => credentials,- None => {- println!("No credentials found - pairing this daemon first.");- pair_and_save(&config, &store).await?- }- };-- // The ACP launch config carries command, args, and env but no working- // directory, and every session this daemon serves runs in the one- // configured workspace - so the daemon's own cwd is the harness's cwd.- std::env::set_current_dir(&config.workspace.path).context(format!(- "failed to enter the workspace directory {}",- config.workspace.path.display()- ))?;-- // The feed: make sure one exists, points here, covers the bound agents,- // and we hold its secret. An explicit config secret skips registration- // entirely (manual setups).- let reconciler = Arc::new(FeedReconciler::new(- &config.macro_api,- &config.server,- credentials.clone(),- config_path,- ));- let signing_secret = Arc::new(std::sync::RwLock::new(String::new()));- match &config.server.signing_secret {- Some(secret) => {- *signing_secret.write().expect("signing secret lock") = secret.clone();- }- None => {- // `None` is a daemon with nothing bound yet: it serves anyway,- // and the reconcile loop registers the feed the moment an agent- // is bound in the app.- let initial = reconciler- .ensure_feed()- .await- .context("failed to register this harness's trigger feed")?;- if let Some(feed) = &initial {- *signing_secret.write().expect("signing secret lock") = feed.signing_secret.clone();- }- // Validation probes the endpoint, so it can only pass once we- // serve; request it from the side once the listener is up, and- // keep the feed covering the bound-agent set from then on.- let reconciler = Arc::clone(&reconciler);- let signing_secret = Arc::clone(&signing_secret);- tokio::spawn(async move {- let mut current = None;- if let Some(feed) = initial {- if !feed.is_valid {- reconciler.request_validation(&feed.webhook_id).await;- }- current = Some(feed.webhook_id);- }- reconcile_forever(reconciler, signing_secret, current).await;- });- }- }-- let api = HarnessApi::new(&config.macro_api, &credentials);- let runtime = Runtime::new(&config.macro_api, &credentials, config.harness.clone());- let app = webhook_router(WebhookState {- executor: Dispatcher::new(api, runtime, config.workspace.clone()),- signing_secret: Arc::clone(&signing_secret),- });-- let port = config.server.port;- let listener = tokio::net::TcpListener::bind(("0.0.0.0", port))- .await- .context(format!("failed to bind the webhook server to port {port}"))?;- tracing::info!(- port,- api = %config.macro_api.api_url,- harness_id = %credentials.harness_id,- harness = %config.harness.command,- workspace = %config.workspace.path.display(),- "daemon listening for agent triggers"- );-- axum::serve(listener, app)- .with_graceful_shutdown(shutdown_signal())- .await- .context("the webhook server stopped")?;- Ok(())-}--/// Keep the feed covering the bound-agent set: registered once anything is-/// bound, replaced (along with the secret the receiver verifies with) when-/// the set or endpoint changes, and dropped when nothing is bound any more.-async fn reconcile_forever(- reconciler: Arc<FeedReconciler>,- signing_secret: Arc<std::sync::RwLock<String>>,- mut current_webhook_id: Option<String>,-) {- loop {- tokio::time::sleep(FEED_RECONCILE_INTERVAL).await;- match reconciler.ensure_feed().await {- Ok(Some(feed)) => {- if current_webhook_id.as_deref() != Some(feed.webhook_id.as_str()) {- tracing::info!(webhook_id = %feed.webhook_id, "trigger feed registered");- *signing_secret.write().expect("signing secret lock") =- feed.signing_secret.clone();- if !feed.is_valid {- reconciler.request_validation(&feed.webhook_id).await;- }- current_webhook_id = Some(feed.webhook_id);- }- }- Ok(None) => {- if current_webhook_id.take().is_some() {- tracing::info!("trigger feed removed; no agents are bound any more");- }- }- Err(error) => {- tracing::warn!(error = ?error, "trigger feed reconciliation failed; will retry");- }- }- }-}--async fn shutdown_signal() {- let _ = tokio::signal::ctrl_c().await;- tracing::info!("shutting down");-}diff --git a/crates/coding_agent_worker/src/outbound/agent_session.rs b/crates/coding_agent_worker/src/outbound/agent_session.rsindex 898f37f533..647ccf1d20 100644--- a/crates/coding_agent_worker/src/outbound/agent_session.rs+++ b/crates/coding_agent_worker/src/outbound/agent_session.rs@@ -56,7 +56,13 @@ impl HarnessApi {}}- /// Open an external session for one of this harness's bound agents.+ /// Open an external session for one of this harness's bound agents,+ /// acting for the user who mentioned the agent.+ ///+ /// The acting-user header is what the service verifies the session's owner+ /// against (owner for a private harness, a team member for a team one), so+ /// it carries the sender the way the control calls do - the body's `owner`+ /// is not trusted for a harness caller.////// A thread routes to at most one of a bot's sessions, so a redelivered/// mention lands on [`ApiError::ThreadSessionExists`] carrying the@@ -64,11 +70,13 @@ impl HarnessApi {pub async fn create_session(&self,request: &CreateAgentSessionRequest,+ acting_user: &MacroUserIdStr<'static>,) -> Result<CreateAgentSessionResponse, ApiError> {let response = self.http.post(format!("{}/agent-sessions", self.base)).header(HARNESS_TOKEN_HEADER, &self.token)+ .header(HARNESS_ACTING_USER_HEADER, acting_user.as_ref()).json(request).send().await?;@@ -127,7 +135,7 @@ async fn refuse_errors(response: reqwest::Response) -> Result<reqwest::Response,if status == StatusCode::UNAUTHORIZED || status == StatusCode::FORBIDDEN {tracing::error!(%status,- "the server refused this harness's credentials; run `macrod login` to re-pair"+ "the server refused this harness's credentials; press p to re-pair");}Err(ApiError::Refused { status, message })diff --git a/crates/coding_agent_worker/src/outbound/credentials.rs b/crates/coding_agent_worker/src/outbound/credentials.rsindex b0b8c67111..c46c28bbd3 100644--- a/crates/coding_agent_worker/src/outbound/credentials.rs+++ b/crates/coding_agent_worker/src/outbound/credentials.rs@@ -61,7 +61,8 @@ impl FileCredentialStore {}}- /// Where the file lives, for messages that tell the user about it.+ /// Where the file lives, so tests can inspect and corrupt it.+ #[cfg(test)]pub fn path(&self) -> &Path {&self.path}diff --git a/crates/coding_agent_worker/src/outbound/pairing.rs b/crates/coding_agent_worker/src/outbound/pairing.rsindex 7b361cc5a4..5a1bd34796 100644--- a/crates/coding_agent_worker/src/outbound/pairing.rs+++ b/crates/coding_agent_worker/src/outbound/pairing.rs@@ -1,133 +1,112 @@//! The daemon's half of device-code pairing: ask for a code, tell the user//! where to approve it, poll until the credential is released.--use std::time::Duration;+//!+//! [`PairingClient`] speaks the HTTP protocol without printing anything; the+//! control panel drives it frame by frame.use harnesses::domain::models::{- ClaimPairingRequest, ClaimedPairing, CreatePairingRequest, CreatedPairing,+ ClaimPairingRequest, ClaimedPairing, CreatePairingRequest, CreatedPairing, HarnessOwner,RequestedHarnessScope,};use reqwest::StatusCode;use rootcause::prelude::ResultExt as _;+use uuid::Uuid;use crate::config::Config;use crate::outbound::credentials::{HarnessCredentials, HarnessScope};-/// How long past the server-stated expiry polling keeps trying: zero. The-/// server keeps an approved pairing claimable, so expiry here only ends the-/// wait for a user who never approved.-const POLL_GRACE: Duration = Duration::ZERO;--/// Walk the whole pairing flow interactively and return minted credentials.-///-/// Prints the code and approval link to stdout on purpose: this is the one-/// conversation the daemon has with a human.-pub async fn pair(config: &Config) -> rootcause::Result<HarnessCredentials> {- let http = reqwest::Client::new();- let base = config- .macro_api- .storage_url- .trim_end_matches('/')- .to_owned();+/// One claim poll's answer.+#[derive(Debug)]+pub enum ClaimStatus {+ /// Not approved yet; poll again.+ Pending,+ /// Approved: the minted credential, released exactly once.+ Claimed(HarnessCredentials),+ /// The pairing can no longer be claimed (expired or already used).+ Gone(String),+}- let name = config- .identity- .name- .clone()- .or_else(local_hostname)- .unwrap_or_else(|| "macrod".to_owned());- let host = host_info();- let scope = match config.identity.scope {- crate::config::IdentityScope::Private => RequestedHarnessScope::Private,- crate::config::IdentityScope::Team => RequestedHarnessScope::Team,- };+/// The pairing protocol against one deployment, print-free.+pub struct PairingClient {+ http: reqwest::Client,+ base: String,+}- let response = http- .post(format!("{base}/harness-pairings"))- .json(&CreatePairingRequest {- name,- host: Some(host),- scope: Some(scope),- })- .send()- .await- .context("could not reach the service to start pairing")?;- if !response.status().is_success() {- let status = response.status();- let message = response.text().await.unwrap_or_default();- rootcause::bail!("the service refused to start pairing ({status}): {message}");+impl PairingClient {+ /// A client for the deployment the config names.+ pub fn new(config: &Config) -> Self {+ Self {+ http: reqwest::Client::new(),+ base: config+ .macro_api+ .storage_url+ .trim_end_matches('/')+ .to_owned(),+ }}- let pairing: CreatedPairing = response- .json()- .await- .context("could not read the pairing the service created")?;- let approval_url = config.macro_api.pairing_approval_url(&pairing.code);- let expires_in = (pairing.expires_at - chrono::Utc::now())- .to_std()- .unwrap_or_default();- println!();- println!(" Your pairing code: {}", pairing.code);- let scope_word = match scope {- RequestedHarnessScope::Private => "private",- RequestedHarnessScope::Team => "team",- };- println!();- println!(" Open {approval_url}");- println!(" and approve this daemon (confirm the code; it asks to be {scope_word}).");- println!();- println!(- " Waiting for approval... (expires in {} minutes)",- expires_in.as_secs() / 60- );+ /// Open a pairing using the config's identity.+ pub async fn start(&self, config: &Config) -> rootcause::Result<CreatedPairing> {+ let name = config+ .identity+ .name+ .clone()+ .or_else(local_hostname)+ .unwrap_or_else(|| "macrod".to_owned());+ let scope = match config.identity.scope {+ crate::config::IdentityScope::Private => RequestedHarnessScope::Private,+ crate::config::IdentityScope::Team => RequestedHarnessScope::Team,+ };- let poll_interval = Duration::from_secs(pairing.poll_interval_seconds.max(1));- let deadline = tokio::time::Instant::now() + expires_in + POLL_GRACE;- loop {- tokio::time::sleep(poll_interval).await;- if tokio::time::Instant::now() > deadline {- rootcause::bail!(- "the pairing expired before it was approved; run `macrod login` to start over"- );+ let response = self+ .http+ .post(format!("{}/harness-pairings", self.base))+ .json(&CreatePairingRequest {+ name,+ host: Some(host_info()),+ scope: Some(scope),+ })+ .send()+ .await+ .context("could not reach the service to start pairing")?;+ if !response.status().is_success() {+ let status = response.status();+ let message = response.text().await.unwrap_or_default();+ rootcause::bail!("the service refused to start pairing ({status}): {message}");}+ Ok(response+ .json()+ .await+ .context("could not read the pairing the service created")?)+ }- let response = http- .post(format!(- "{base}/harness-pairings/{}/claim",- pairing.pairing_id- ))+ /// Poll the claim once.+ pub async fn claim(+ &self,+ pairing_id: Uuid,+ device_secret: &str,+ ) -> rootcause::Result<ClaimStatus> {+ let response = self+ .http+ .post(format!("{}/harness-pairings/{pairing_id}/claim", self.base)).json(&ClaimPairingRequest {- device_secret: pairing.device_secret.clone(),+ device_secret: device_secret.to_owned(),}).send().await.context("could not reach the service to poll the pairing")?;match response.status() {- StatusCode::ACCEPTED => continue,+ StatusCode::ACCEPTED => Ok(ClaimStatus::Pending),StatusCode::OK => {let claimed: ClaimedPairing = response.json().await.context("could not read the claimed credential")?;- let scope = match claimed.harness.owner {- harnesses::domain::models::HarnessOwner::User { .. } => HarnessScope::User,- harnesses::domain::models::HarnessOwner::Team { .. } => HarnessScope::Team,- };- println!(- "Approved. This machine is now the harness \"{}\" ({}).",- claimed.harness.name, claimed.harness.id- );- return Ok(HarnessCredentials {- harness_id: claimed.harness.id,- token: claimed.token,- scope,- });- }- StatusCode::GONE => {- rootcause::bail!(- "the pairing is no longer claimable (expired or already used); run `macrod login` to start over"- );+ Ok(ClaimStatus::Claimed(credentials_from(claimed)))}+ StatusCode::GONE => Ok(ClaimStatus::Gone(+ "the pairing is no longer claimable (expired or already used)".to_owned(),+ )),status => {let message = response.text().await.unwrap_or_default();rootcause::bail!("the service refused the pairing poll ({status}): {message}");@@ -136,6 +115,18 @@ pub async fn pair(config: &Config) -> rootcause::Result<HarnessCredentials> {}}+fn credentials_from(claimed: ClaimedPairing) -> HarnessCredentials {+ let scope = match claimed.harness.owner {+ HarnessOwner::User { .. } => HarnessScope::User,+ HarnessOwner::Team { .. } => HarnessScope::Team,+ };+ HarnessCredentials {+ harness_id: claimed.harness.id,+ token: claimed.token,+ scope,+ }+}+fn local_hostname() -> Option<String> {std::process::Command::new("hostname").output()diff --git a/crates/coding_agent_worker/src/outbound/registration.rs b/crates/coding_agent_worker/src/outbound/registration.rsindex f3dc409db7..f19180a067 100644--- a/crates/coding_agent_worker/src/outbound/registration.rs+++ b/crates/coding_agent_worker/src/outbound/registration.rs@@ -171,6 +171,12 @@ impl<S: FeedStateStore> FeedReconciler<S> {.await.context(format!("could not reach the service to {what}"))?;let status = response.status();+ if status == reqwest::StatusCode::UNAUTHORIZED || status == reqwest::StatusCode::FORBIDDEN {+ rootcause::bail!(+ "the service refused this harness's credentials ({status}) while trying to \+ {what}; the harness was likely removed - press p to pair again"+ );+ }if !status.is_success() {let message = response.text().await.unwrap_or_default();rootcause::bail!("the service answered {status} to {what}: {message}");diff --git a/crates/coding_agent_worker/src/runtime.rs b/crates/coding_agent_worker/src/runtime.rsindex 8bb158d86a..96a94d66de 100644--- a/crates/coding_agent_worker/src/runtime.rs+++ b/crates/coding_agent_worker/src/runtime.rs@@ -182,7 +182,7 @@ fn worth_redialing(error: &tungstenite::Error) -> bool {{tracing::error!(status = %response.status(),- "the gateway refused this harness's credentials; run `macrod login` to re-pair"+ "the gateway refused this harness's credentials; press p to re-pair");}return false;diff --git a/crates/coding_agent_worker/src/tui.rs b/crates/coding_agent_worker/src/tui.rsnew file mode 100644index 0000000000..d1d4e35974--- /dev/null+++ b/crates/coding_agent_worker/src/tui.rs@@ -0,0 +1,614 @@+//! The macrod control panel: one process that serves and shows itself.+//!+//! `macrod` runs the serving core (webhook receiver, feed reconciler,+//! harness bridge) inside a terminal UI that shows what the server knows+//! about this harness - its registration, the agents bound to it, their+//! sessions, and the daemon's own logs - and drives its lifecycle: edit+//! `macro.toml`, pair (or re-pair, restarting the core on the new+//! credential), and retire the harness.++mod api;+mod config_form;+mod process;+mod ui;++use std::path::{Path, PathBuf};+use std::time::{Duration, Instant};++use crossterm::event::{Event as TermEvent, KeyCode, KeyEvent, KeyEventKind, KeyModifiers};+use harnesses::domain::models::CreatedPairing;+use rootcause::prelude::ResultExt as _;++use crate::config::Config;+use crate::daemon::Daemon;+use crate::outbound::credentials::{CredentialStore as _, FileCredentialStore, HarnessCredentials};+use crate::outbound::pairing::{ClaimStatus, PairingClient};+use crate::outbound::registration;++use api::{HarnessSelfApi, Snapshot};+use config_form::{ConfigForm, FIELDS, FieldKind};++/// How often the dashboard re-reads the server.+const REFRESH_EVERY: Duration = Duration::from_secs(3);+/// Spinner cadence and input latency budget.+const TICK: Duration = Duration::from_millis(120);++/// The daemon's own log lines, rendered by the Logs tab.+///+/// The TUI owns the terminal, so tracing must not write to it; this is the+/// sink the subscriber writes into instead.+#[derive(Clone, Default)]+pub struct LogBuffer {+ lines: std::sync::Arc<std::sync::Mutex<std::collections::VecDeque<String>>>,+}++impl LogBuffer {+ const CAPACITY: usize = 500;++ /// Install the global tracing subscriber writing into a fresh buffer.+ pub fn install() -> Self {+ let buffer = Self::default();+ let sink = buffer.clone();+ tracing_subscriber::fmt()+ .with_env_filter(+ tracing_subscriber::EnvFilter::try_from_default_env()+ .unwrap_or_else(|_| tracing_subscriber::EnvFilter::new("info")),+ )+ .with_ansi(false)+ .with_writer(move || sink.clone())+ .init();+ buffer+ }++ /// The most recent lines, oldest first.+ pub(crate) fn tail(&self, count: usize) -> Vec<String> {+ let lines = self.lines.lock().expect("log buffer lock");+ lines.iter().rev().take(count).rev().cloned().collect()+ }+}++impl std::io::Write for LogBuffer {+ fn write(&mut self, bytes: &[u8]) -> std::io::Result<usize> {+ let mut lines = self.lines.lock().expect("log buffer lock");+ for line in String::from_utf8_lossy(bytes).lines() {+ if line.trim().is_empty() {+ continue;+ }+ if lines.len() == Self::CAPACITY {+ lines.pop_front();+ }+ lines.push_back(line.to_owned());+ }+ Ok(bytes.len())+ }++ fn flush(&mut self) -> std::io::Result<()> {+ Ok(())+ }+}++/// Which tab is showing.+#[derive(Debug, Clone, Copy, PartialEq, Eq)]+pub(crate) enum Tab {+ Overview,+ Sessions,+ Config,+ Logs,+}++impl Tab {+ const ALL: [Tab; 4] = [Tab::Overview, Tab::Sessions, Tab::Config, Tab::Logs];++ pub(crate) fn title(self) -> &'static str {+ match self {+ Tab::Overview => "Overview",+ Tab::Sessions => "Sessions",+ Tab::Config => "Config",+ Tab::Logs => "Logs",+ }+ }++ fn next(self) -> Tab {+ match self {+ Tab::Overview => Tab::Sessions,+ Tab::Sessions => Tab::Config,+ Tab::Config => Tab::Logs,+ Tab::Logs => Tab::Overview,+ }+ }+}++/// A modal claiming the keyboard, when one is up.+pub(crate) enum Mode {+ /// Browsing; keys act on the current tab.+ Normal,+ /// Editing one config field's value.+ EditField {+ /// Index into [`FIELDS`].+ index: usize,+ /// The text being typed.+ buffer: String,+ },+ /// Confirming harness removal.+ ConfirmDelete,+ /// A pairing in flight: code shown, waiting for approval.+ Pairing {+ /// The open pairing.+ created: CreatedPairing,+ /// When the claim was last polled.+ last_poll: Instant,+ },+}++/// Everything the UI renders from.+pub(crate) struct App {+ pub(crate) config_path: PathBuf,+ pub(crate) config: Config,+ pub(crate) credentials: Option<HarnessCredentials>,+ pub(crate) snapshot: Snapshot,+ /// This process's pid - the TUI and the daemon are this one process.+ pub(crate) pid: u32,+ /// The spawned harness child, when serving and one is found.+ pub(crate) harness_process: Option<process::Child>,+ pub(crate) tab: Tab,+ pub(crate) mode: Mode,+ pub(crate) selected_field: usize,+ pub(crate) form: ConfigForm,+ pub(crate) status: Option<(String, bool)>,+ pub(crate) spinner: usize,+ pub(crate) logs: LogBuffer,+ pub(crate) daemon: Option<Daemon>,+ last_refresh: Option<Instant>,+ quit: bool,+}++impl App {+ fn load(config_path: &Path, logs: LogBuffer) -> rootcause::Result<Self> {+ let config = Config::load(config_path)?;+ let credentials = FileCredentialStore::for_config(config_path).load()?;+ let form = ConfigForm::load(config_path)?;+ Ok(Self {+ config_path: config_path.to_owned(),+ config,+ credentials,+ snapshot: Snapshot::default(),+ pid: std::process::id(),+ harness_process: None,+ tab: Tab::Overview,+ mode: Mode::Normal,+ selected_field: 0,+ form,+ status: None,+ spinner: 0,+ logs,+ daemon: None,+ last_refresh: None,+ quit: false,+ })+ }++ /// Whether the in-process serving core is up.+ pub(crate) fn serving(&self) -> bool {+ self.daemon.as_ref().is_some_and(Daemon::is_running)+ }++ /// (Re)start the serving core on the current config and credential.+ async fn restart_daemon(&mut self) {+ if let Some(daemon) = self.daemon.take() {+ daemon.stop().await;+ }+ let Some(credentials) = self.credentials.clone() else {+ return;+ };+ match Daemon::start(self.config.clone(), credentials, &self.config_path).await {+ Ok(daemon) => self.daemon = Some(daemon),+ Err(error) => self.fail(format!("daemon failed to start: {error}")),+ }+ }++ /// Stop the serving core, if it is up.+ async fn stop_daemon(&mut self) {+ if let Some(daemon) = self.daemon.take() {+ daemon.stop().await;+ }+ }++ /// The approval URL of the pairing in flight, when one is.+ fn pairing_url(&self) -> Option<String> {+ match &self.mode {+ Mode::Pairing { created, .. } => {+ Some(self.config.macro_api.pairing_approval_url(&created.code))+ }+ _ => None,+ }+ }++ pub(crate) fn paired(&self) -> bool {+ self.credentials.is_some()+ }++ fn api(&self) -> Option<HarnessSelfApi> {+ self.credentials+ .as_ref()+ .map(|credentials| HarnessSelfApi::new(&self.config, credentials))+ }++ fn ok(&mut self, message: impl Into<String>) {+ self.status = Some((message.into(), false));+ }++ fn fail(&mut self, message: impl Into<String>) {+ self.status = Some((message.into(), true));+ }++ async fn refresh(&mut self) {+ // Local process facts refresh with the dashboard, not with the network.+ self.harness_process = if self.serving() {+ process::harness_child(&self.config.harness.command)+ } else {+ None+ };+ let Some(api) = self.api() else {+ self.snapshot = Snapshot::default();+ return;+ };+ match api.snapshot().await {+ Ok(snapshot) => {+ self.snapshot = snapshot;+ self.last_refresh = Some(Instant::now());+ }+ Err(error) => self.fail(format!("refresh failed: {error}")),+ }+ }++ async fn maybe_refresh(&mut self) {+ let due = self+ .last_refresh+ .is_none_or(|last| last.elapsed() >= REFRESH_EVERY);+ if due {+ self.refresh().await;+ }+ }++ async fn start_pairing(&mut self) {+ // Re-read the config so an edit saved a moment ago (a new name or+ // scope) is what this pairing asks for.+ match Config::load(&self.config_path) {+ Ok(config) => self.config = config,+ Err(error) => return self.fail(format!("config reload failed: {error}")),+ }+ let client = PairingClient::new(&self.config);+ match client.start(&self.config).await {+ Ok(created) => {+ // The approval page pre-fills the code, so opening the+ // browser is usually the whole remaining gesture.+ let url = self.config.macro_api.pairing_approval_url(&created.code);+ open_in_browser(&url);+ self.mode = Mode::Pairing {+ created,+ last_poll: Instant::now(),+ };+ }+ Err(error) => self.fail(format!("pairing failed to start: {error}")),+ }+ }++ async fn poll_pairing(&mut self) {+ // Copy what the poll needs out of the mode first, so the network call+ // below is free to report back into `self`.+ let (pairing_id, device_secret) = {+ let Mode::Pairing { created, last_poll } = &mut self.mode else {+ return;+ };+ let interval = Duration::from_secs(created.poll_interval_seconds.max(1));+ if last_poll.elapsed() < interval {+ return;+ }+ *last_poll = Instant::now();+ if created.expires_at <= chrono::Utc::now() {+ self.mode = Mode::Normal;+ return self.fail("the pairing expired before it was approved");+ }+ (created.pairing_id, created.device_secret.clone())+ };+ let client = PairingClient::new(&self.config);+ match client.claim(pairing_id, &device_secret).await {+ Ok(ClaimStatus::Pending) => {}+ Ok(ClaimStatus::Claimed(credentials)) => {+ let store = FileCredentialStore::for_config(&self.config_path);+ if let Err(error) = store.save(&credentials) {+ self.mode = Mode::Normal;+ return self.fail(format!("could not save credentials: {error}"));+ }+ self.credentials = Some(credentials);+ self.mode = Mode::Normal;+ self.restart_daemon().await;+ if self.serving() {+ self.ok("paired and serving");+ }+ self.refresh().await;+ }+ Ok(ClaimStatus::Gone(reason)) => {+ self.mode = Mode::Normal;+ self.fail(reason);+ }+ Err(error) => {+ self.mode = Mode::Normal;+ self.fail(format!("pairing poll failed: {error}"));+ }+ }+ }++ async fn delete_harness(&mut self) {+ let Some(api) = self.api() else {+ return self.fail("not paired");+ };+ if let Err(error) = api.delete_self().await {+ return self.fail(format!("{error}"));+ }+ // The credential is dead either way; stop serving with it and drop+ // the local state that belonged to it so the next pairing starts+ // clean.+ self.stop_daemon().await;+ let _ = std::fs::remove_file(crate::outbound::credentials::credentials_path(+ &self.config_path,+ ));+ let _ = std::fs::remove_file(registration::state_path(&self.config_path));+ self.credentials = None;+ self.snapshot = Snapshot::default();+ self.ok("harness removed - press p to pair again");+ }++ async fn on_key(&mut self, key: KeyEvent) {+ if key.kind != KeyEventKind::Press {+ return;+ }+ // Ctrl-C always quits, whatever is up.+ if key.code == KeyCode::Char('c') && key.modifiers.contains(KeyModifiers::CONTROL) {+ self.quit = true;+ return;+ }++ match self.mode {+ Mode::Normal => self.on_normal_key(key).await,+ Mode::ConfirmDelete => {+ self.mode = Mode::Normal;+ if matches!(key.code, KeyCode::Char('y') | KeyCode::Char('Y')) {+ self.delete_harness().await;+ }+ }+ Mode::Pairing { .. } => match key.code {+ KeyCode::Esc => {+ self.mode = Mode::Normal;+ self.ok("pairing abandoned; the code expires on its own");+ }+ KeyCode::Char('o') => {+ let url = self.pairing_url();+ if let Some(url) = url {+ if open_in_browser(&url) {+ self.ok("opened the approval page");+ } else {+ self.fail("could not open a browser; use the printed link");+ }+ }+ }+ KeyCode::Char('c') => {+ let code = match &self.mode {+ Mode::Pairing { created, .. } => Some(created.code.clone()),+ _ => None,+ };+ if let Some(code) = code {+ if copy_to_clipboard(&code) {+ self.ok(format!("copied {code}"));+ } else {+ self.fail("no clipboard tool found; select the code to copy it");+ }+ }+ }+ _ => {}+ },+ Mode::EditField { .. } => self.on_edit_key(key).await,+ }+ }++ async fn on_edit_key(&mut self, key: KeyEvent) {+ let Mode::EditField { index, buffer } = &mut self.mode else {+ return;+ };+ match key.code {+ KeyCode::Esc => self.mode = Mode::Normal,+ KeyCode::Backspace => {+ buffer.pop();+ }+ KeyCode::Char(ch) => buffer.push(ch),+ KeyCode::Enter => {+ let index = *index;+ let input = buffer.clone();+ self.mode = Mode::Normal;+ self.commit_edit(index, input).await;+ }+ _ => {}+ }+ }++ async fn commit_edit(&mut self, index: usize, input: String) {+ let field = &FIELDS[index];+ if let Err(message) = self.form.apply(field, &input) {+ return self.fail(message);+ }+ match self.form.save() {+ Ok(()) => match Config::load(&self.config_path) {+ Ok(config) => {+ self.config = config;+ // The core reads config at start, so a save while serving+ // means a restart to apply it.+ if self.serving() {+ self.restart_daemon().await;+ self.ok("saved and applied");+ } else {+ self.ok("saved");+ }+ }+ Err(error) => self.fail(format!("saved, but reload failed: {error}")),+ },+ Err(error) => {+ // Reload the form so the rejected edit does not linger in the+ // document.+ if let Ok(form) = ConfigForm::load(&self.config_path) {+ self.form = form;+ }+ self.fail(format!("{error}"));+ }+ }+ }++ async fn on_normal_key(&mut self, key: KeyEvent) {+ match key.code {+ KeyCode::Char('q') => self.quit = true,+ KeyCode::Tab => self.tab = self.tab.next(),+ KeyCode::Char('1') => self.tab = Tab::Overview,+ KeyCode::Char('2') => self.tab = Tab::Sessions,+ KeyCode::Char('3') => self.tab = Tab::Config,+ KeyCode::Char('4') => self.tab = Tab::Logs,+ KeyCode::Char('r') => {+ self.last_refresh = None;+ self.maybe_refresh().await;+ }+ KeyCode::Char('p') => self.start_pairing().await,+ KeyCode::Char('d') if self.paired() => self.mode = Mode::ConfirmDelete,+ KeyCode::Up | KeyCode::Char('k') if self.tab == Tab::Config => {+ self.selected_field = self.selected_field.saturating_sub(1);+ }+ KeyCode::Down | KeyCode::Char('j') if self.tab == Tab::Config => {+ self.selected_field = (self.selected_field + 1).min(FIELDS.len() - 1);+ }+ KeyCode::Enter if self.tab == Tab::Config => {+ let field = &FIELDS[self.selected_field];+ if field.kind == FieldKind::Scope {+ // Toggle rather than type: the only values are the two.+ let next = if self.form.display(field) == "team" {+ "private"+ } else {+ "team"+ };+ if self.form.apply(field, next).is_ok() {+ match self.form.save() {+ Ok(()) => self.ok(format!("scope: {next} (applies at next pairing)")),+ Err(error) => self.fail(format!("{error}")),+ }+ }+ } else {+ self.mode = Mode::EditField {+ index: self.selected_field,+ buffer: self.form.display(field),+ };+ }+ }+ _ => {}+ }+ }+}++/// Run the control panel - and the daemon inside it - until the user quits.+pub async fn run(config_path: &Path, logs: LogBuffer) -> rootcause::Result<()> {+ let mut app = App::load(config_path, logs)?;++ let (input_tx, mut input_rx) = tokio::sync::mpsc::unbounded_channel();+ // A dedicated thread owns the blocking crossterm read; the loop below+ // stays async and free to poll the network.+ std::thread::spawn(move || {+ while let Ok(event) = crossterm::event::read() {+ if input_tx.send(event).is_err() {+ return;+ }+ }+ });++ let mut terminal = ratatui::init();+ let outcome = run_loop(&mut terminal, &mut app, &mut input_rx).await;+ ratatui::restore();+ outcome+}++/// Open a URL in the default browser, reporting whether the spawn worked.+fn open_in_browser(url: &str) -> bool {+ #[cfg(target_os = "macos")]+ let launcher = "open";+ #[cfg(not(target_os = "macos"))]+ let launcher = "xdg-open";+ std::process::Command::new(launcher)+ .arg(url)+ .stdout(std::process::Stdio::null())+ .stderr(std::process::Stdio::null())+ .spawn()+ .is_ok()+}++/// Put text on the system clipboard, reporting whether a tool was found.+fn copy_to_clipboard(text: &str) -> bool {+ use std::io::Write as _;+ #[cfg(target_os = "macos")]+ let candidates: &[&[&str]] = &[&["pbcopy"]];+ #[cfg(not(target_os = "macos"))]+ let candidates: &[&[&str]] = &[&["wl-copy"], &["xclip", "-selection", "clipboard"]];+ for candidate in candidates {+ let spawned = std::process::Command::new(candidate[0])+ .args(&candidate[1..])+ .stdin(std::process::Stdio::piped())+ .stdout(std::process::Stdio::null())+ .stderr(std::process::Stdio::null())+ .spawn();+ if let Ok(mut child) = spawned {+ let wrote = child+ .stdin+ .take()+ .and_then(|mut stdin| stdin.write_all(text.as_bytes()).ok())+ .is_some();+ if wrote && child.wait().is_ok_and(|status| status.success()) {+ return true;+ }+ }+ }+ false+}++async fn run_loop(+ terminal: &mut ratatui::DefaultTerminal,+ app: &mut App,+ input: &mut tokio::sync::mpsc::UnboundedReceiver<TermEvent>,+) -> rootcause::Result<()> {+ let mut tick = tokio::time::interval(TICK);+ // Paired already? Start serving before the first frame.+ if app.paired() {+ app.restart_daemon().await;+ }+ app.refresh().await;++ loop {+ terminal+ .draw(|frame| ui::render(frame, app))+ .context("failed to draw the terminal UI")?;++ tokio::select! {+ event = input.recv() => {+ match event {+ Some(TermEvent::Key(key)) => app.on_key(key).await,+ Some(_) => {}+ None => return Ok(()),+ }+ }+ _ = tick.tick() => {+ app.spinner = app.spinner.wrapping_add(1);+ app.poll_pairing().await;+ if matches!(app.mode, Mode::Normal) {+ app.maybe_refresh().await;+ }+ }+ }++ if app.quit {+ app.stop_daemon().await;+ return Ok(());+ }+ }+}diff --git a/crates/coding_agent_worker/src/tui/api.rs b/crates/coding_agent_worker/src/tui/api.rsnew file mode 100644index 0000000000..b71f8ab235--- /dev/null+++ b/crates/coding_agent_worker/src/tui/api.rs@@ -0,0 +1,116 @@+//! The TUI's read/act client against the harness APIs, as the harness.++use harnesses::domain::models::{Harness, HarnessAgent, HarnessSession};+use reqwest::StatusCode;+use rootcause::prelude::ResultExt as _;++use crate::config::Config;+use crate::outbound::credentials::HarnessCredentials;++const HARNESS_TOKEN_HEADER: &str = "x-macro-harness-token";++/// What the server currently knows about this daemon.+#[derive(Debug, Clone, Default)]+pub struct Snapshot {+ /// The harness registration, when the credential still names a live one.+ pub harness: Option<Harness>,+ /// Agents bound to it.+ pub agents: Vec<HarnessAgent>,+ /// Recent sessions on those agents, newest first.+ pub sessions: Vec<HarnessSession>,+}++/// Client for the harness self endpoints.+pub struct HarnessSelfApi {+ http: reqwest::Client,+ base: String,+ token: String,+}++impl HarnessSelfApi {+ /// A client for the deployment the config names, with this credential.+ pub fn new(config: &Config, credentials: &HarnessCredentials) -> Self {+ Self {+ http: reqwest::Client::new(),+ base: config+ .macro_api+ .storage_url+ .trim_end_matches('/')+ .to_owned(),+ token: credentials.token.clone(),+ }+ }++ async fn read<T: serde::de::DeserializeOwned>(+ &self,+ what: &'static str,+ path: &str,+ ) -> rootcause::Result<Option<T>> {+ let response = self+ .http+ .get(format!("{}{path}", self.base))+ .header(HARNESS_TOKEN_HEADER, &self.token)+ .send()+ .await+ .context(format!("could not reach the service to {what}"))?;+ // A dead credential (revoked harness) answers 401; surface that as+ // "no harness" rather than an error so the UI offers re-pairing.+ if response.status() == StatusCode::UNAUTHORIZED+ || response.status() == StatusCode::NOT_FOUND+ {+ return Ok(None);+ }+ let status = response.status();+ if !status.is_success() {+ let message = response.text().await.unwrap_or_default();+ rootcause::bail!("the service answered {status} to {what}: {message}");+ }+ Ok(Some(response.json().await.context(format!(+ "could not read the service's answer to {what}"+ ))?))+ }++ /// Everything the dashboard shows, in one round of calls.+ pub async fn snapshot(&self) -> rootcause::Result<Snapshot> {+ let Some(harness) = self+ .read::<Harness>("identify the harness", "/harnesses/me")+ .await?+ else {+ return Ok(Snapshot::default());+ };+ let agents = self+ .read::<Vec<HarnessAgent>>("list bound agents", "/harnesses/me/agents")+ .await?+ .unwrap_or_default();+ let sessions = self+ .read::<Vec<HarnessSession>>("list sessions", "/harnesses/me/sessions")+ .await?+ .unwrap_or_default();+ Ok(Snapshot {+ harness: Some(harness),+ agents,+ sessions,+ })+ }++ /// Retire this harness: soft-delete it and revoke its credential.+ pub async fn delete_self(&self) -> rootcause::Result<()> {+ let response = self+ .http+ .delete(format!("{}/harnesses/me", self.base))+ .header(HARNESS_TOKEN_HEADER, &self.token)+ .send()+ .await+ .context("could not reach the service to remove the harness")?;+ let status = response.status();+ // Already gone counts as done: the goal is "this credential is dead".+ if !status.is_success()+ && status != StatusCode::NOT_FOUND+ && status != StatusCode::UNAUTHORIZED+ {+ let message = response.text().await.unwrap_or_default();+ rootcause::bail!("the service refused to remove the harness ({status}): {message}");+ }+ Ok(())+ }+}diff --git a/crates/coding_agent_worker/src/tui/config_form.rs b/crates/coding_agent_worker/src/tui/config_form.rsnew file mode 100644index 0000000000..92d5d9c212--- /dev/null+++ b/crates/coding_agent_worker/src/tui/config_form.rs@@ -0,0 +1,208 @@+//! The editable view of `macro.toml` the TUI's Config tab presents.+//!+//! Edits go through `toml_edit` so the user's comments and layout survive a+//! save. Every field is validated the same way the daemon's own loader is:+//! the whole document is re-parsed as [`crate::config::Config`] before it is+//! written, so the TUI cannot save a config `macrod` would refuse to boot.++use std::path::{Path, PathBuf};++use rootcause::prelude::ResultExt as _;+use toml_edit::{DocumentMut, Item, value};++/// One editable field: where it lives in the TOML and how to show it.+#[derive(Debug, Clone, Copy, PartialEq, Eq)]+pub struct Field {+ /// Display label.+ pub label: &'static str,+ /// `[section]` the key lives in.+ pub section: &'static str,+ /// Key within the section.+ pub key: &'static str,+ /// How the value is edited and rendered.+ pub kind: FieldKind,+}++/// How a field's value is represented while editing.+#[derive(Debug, Clone, Copy, PartialEq, Eq)]+pub enum FieldKind {+ /// A plain string.+ Text,+ /// A string that may be absent; an empty edit removes the key.+ OptionalText,+ /// An integer port.+ Port,+ /// A string array, edited comma-separated.+ List,+ /// `private` / `team`, toggled rather than typed.+ Scope,+}++/// Every field the Config tab exposes, in display order.+pub const FIELDS: &[Field] = &[+ Field {+ label: "Harness name",+ section: "identity",+ key: "name",+ kind: FieldKind::OptionalText,+ },+ Field {+ label: "Scope",+ section: "identity",+ key: "scope",+ kind: FieldKind::Scope,+ },+ Field {+ label: "Harness command",+ section: "harness",+ key: "command",+ kind: FieldKind::Text,+ },+ Field {+ label: "Harness args",+ section: "harness",+ key: "args",+ kind: FieldKind::List,+ },+ Field {+ label: "Workspace path",+ section: "workspace",+ key: "path",+ kind: FieldKind::Text,+ },+ Field {+ label: "Workspace repo URL",+ section: "workspace",+ key: "repo_url",+ kind: FieldKind::OptionalText,+ },+ Field {+ label: "Agent-harness API URL",+ section: "macro",+ key: "api_url",+ kind: FieldKind::Text,+ },+ Field {+ label: "Storage API URL",+ section: "macro",+ key: "storage_url",+ kind: FieldKind::Text,+ },+ Field {+ label: "Web app URL",+ section: "macro",+ key: "web_url",+ kind: FieldKind::OptionalText,+ },+ Field {+ label: "Webhook port",+ section: "server",+ key: "port",+ kind: FieldKind::Port,+ },+ Field {+ label: "Webhook public URL",+ section: "server",+ key: "public_url",+ kind: FieldKind::Text,+ },+];++/// The config document being viewed and edited.+pub struct ConfigForm {+ path: PathBuf,+ doc: DocumentMut,+}++impl ConfigForm {+ /// Load the config file into an editable document.+ pub fn load(path: &Path) -> rootcause::Result<Self> {+ let raw = std::fs::read_to_string(path)+ .context(format!("failed to read config at {}", path.display()))?;+ let doc = raw+ .parse::<DocumentMut>()+ .context(format!("invalid TOML at {}", path.display()))?;+ Ok(Self {+ path: path.to_owned(),+ doc,+ })+ }++ /// The current display value of a field.+ pub fn display(&self, field: &Field) -> String {+ let item = self+ .doc+ .get(field.section)+ .and_then(|section| section.get(field.key));+ match (field.kind, item) {+ (FieldKind::List, Some(Item::Value(value))) => value+ .as_array()+ .map(|array| {+ array+ .iter()+ .filter_map(|entry| entry.as_str())+ .collect::<Vec<_>>()+ .join(", ")+ })+ .unwrap_or_default(),+ (FieldKind::Port, Some(Item::Value(value))) => value+ .as_integer()+ .map(|port| port.to_string())+ .unwrap_or_default(),+ (FieldKind::Scope, item) => item.and_then(Item::as_str).unwrap_or("private").to_owned(),+ (_, Some(Item::Value(value))) => value.as_str().unwrap_or_default().to_owned(),+ _ => String::new(),+ }+ }++ /// Apply an edited value to a field, in memory.+ pub fn apply(&mut self, field: &Field, input: &str) -> Result<(), String> {+ let input = input.trim();+ let section = self.doc[field.section].or_insert(toml_edit::table());+ match field.kind {+ FieldKind::Text => {+ if input.is_empty() {+ return Err(format!("{} must not be empty", field.label));+ }+ section[field.key] = value(input);+ }+ FieldKind::OptionalText => {+ if input.is_empty() {+ if let Some(table) = section.as_table_like_mut() {+ table.remove(field.key);+ }+ } else {+ section[field.key] = value(input);+ }+ }+ FieldKind::Port => {+ let port: u16 = input+ .parse()+ .map_err(|_| format!("{} must be a port number", field.label))?;+ section[field.key] = value(i64::from(port));+ }+ FieldKind::List => {+ let mut array = toml_edit::Array::new();+ for entry in input.split(',').map(str::trim).filter(|s| !s.is_empty()) {+ array.push(entry);+ }+ section[field.key] = value(array);+ }+ FieldKind::Scope => match input {+ "private" | "team" => section[field.key] = value(input),+ other => return Err(format!("scope must be private or team, not {other}")),+ },+ }+ Ok(())+ }++ /// Validate the whole document as a daemon config and write it out.+ pub fn save(&self) -> rootcause::Result<()> {+ let rendered = self.doc.to_string();+ toml::from_str::<crate::config::Config>(&rendered)+ .context("the edited config would not load; the value was rejected before writing")?;+ std::fs::write(&self.path, rendered)+ .context(format!("failed to write config at {}", self.path.display()))?;+ Ok(())+ }+}diff --git a/crates/coding_agent_worker/src/tui/process.rs b/crates/coding_agent_worker/src/tui/process.rsnew file mode 100644index 0000000000..489c00cb01--- /dev/null+++ b/crates/coding_agent_worker/src/tui/process.rs@@ -0,0 +1,59 @@+//! Best-effort discovery of the harness child process, for display.+//!+//! The ACP SDK spawns the harness inside its connection and keeps the child+//! handle to itself, so the only way to name its pid is to look at this+//! process's own children. Display-only: `None` here says nothing reliable+//! about whether a harness is running.++#[cfg(test)]+mod test;++/// A direct child of this process: pid and command basename.+pub(crate) type Child = (u32, String);++/// The pid and name of the spawned harness process, when one can be found.+pub(crate) fn harness_child(harness_command: &str) -> Option<Child> {+ let output = std::process::Command::new("ps")+ .args(["-axo", "pid=,ppid=,comm="])+ .output()+ .ok()?;+ let table = String::from_utf8_lossy(&output.stdout);+ pick(children(&table, std::process::id()), harness_command)+}++/// Direct children of `parent` in a `ps -axo pid=,ppid=,comm=` table.+fn children(table: &str, parent: u32) -> Vec<Child> {+ table+ .lines()+ .filter_map(|line| {+ let mut fields = line.split_whitespace();+ let pid: u32 = fields.next()?.parse().ok()?;+ let ppid: u32 = fields.next()?.parse().ok()?;+ // The command may itself contain spaces; the rest of the row is it.+ let command = fields.collect::<Vec<_>>().join(" ");+ (ppid == parent && !command.is_empty()).then(|| (pid, basename(&command)))+ })+ .collect()+}++/// Which child is the harness: the one named like the configured command, or+/// the only child there is - wrapper launchers (`npx`, `uvx`) run the agent+/// under another name, and with one child there is nothing else it could be.+fn pick(children: Vec<Child>, harness_command: &str) -> Option<Child> {+ let target = basename(harness_command);+ if let Some(found) = children.iter().find(|(_, name)| *name == target) {+ return Some(found.clone());+ }+ if children.len() == 1 {+ return children.into_iter().next();+ }+ None+}++/// The last path component, or the whole string when it has none.+fn basename(command: &str) -> String {+ std::path::Path::new(command)+ .file_name()+ .map(|name| name.to_string_lossy().into_owned())+ .unwrap_or_else(|| command.to_owned())+}diff --git a/crates/coding_agent_worker/src/tui/process/test.rs b/crates/coding_agent_worker/src/tui/process/test.rsnew file mode 100644index 0000000000..ac550bdc01--- /dev/null+++ b/crates/coding_agent_worker/src/tui/process/test.rs@@ -0,0 +1,37 @@+use super::*;++const TABLE: &str = "\+ 1 0 /sbin/launchd+ 400 1 /usr/sbin/sshd+ 500 400 /opt/homebrew/bin/fish+ 600 500 /Users/eric/.cargo/bin/macrod+ 601 600 /usr/local/bin/claude+ 602 600 pbcopy+ 700 1 ps+";++#[test]+fn children_reads_only_the_direct_children() {+ assert_eq!(+ children(TABLE, 600),+ vec![(601, "claude".to_owned()), (602, "pbcopy".to_owned())]+ );+}++#[test]+fn pick_finds_the_child_named_like_the_command() {+ let found = pick(children(TABLE, 600), "/usr/local/bin/claude");+ assert_eq!(found, Some((601, "claude".to_owned())));+}++#[test]+fn pick_takes_a_lone_child_whatever_its_name() {+ let found = pick(vec![(900, "node".to_owned())], "npx");+ assert_eq!(found, Some((900, "node".to_owned())));+}++#[test]+fn pick_names_nothing_when_ambiguous() {+ let ambiguous = vec![(900, "node".to_owned()), (901, "pbcopy".to_owned())];+ assert_eq!(pick(ambiguous, "npx"), None);+}diff --git a/crates/coding_agent_worker/src/tui/ui.rs b/crates/coding_agent_worker/src/tui/ui.rsnew file mode 100644index 0000000000..321d56ab3c--- /dev/null+++ b/crates/coding_agent_worker/src/tui/ui.rs@@ -0,0 +1,538 @@+//! Rendering for the macrod control panel. Pure: reads [`App`], draws frames.++use chrono::{DateTime, Utc};+use harnesses::domain::models::HarnessOwner;+use ratatui::Frame;+use ratatui::layout::{Alignment, Constraint, Direction, Layout, Rect};+use ratatui::style::{Color, Modifier, Style, Stylize as _};+use ratatui::text::{Line, Span};+use ratatui::widgets::{+ Block, BorderType, Borders, Cell, Clear, List, ListItem, Padding, Paragraph, Row, Table, Tabs,+ Wrap,+};++use super::config_form::FIELDS;+use super::{App, Mode, Tab};++const ACCENT: Color = Color::Cyan;+const OK: Color = Color::Green;+const WARN: Color = Color::Yellow;+const ERR: Color = Color::Red;+const DIM: Color = Color::DarkGray;+const SPINNER: [&str; 8] = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧"];++pub(crate) fn render(frame: &mut Frame, app: &App) {+ let [header, tabs, body, footer] = Layout::default()+ .direction(Direction::Vertical)+ .constraints([+ Constraint::Length(3),+ Constraint::Length(1),+ Constraint::Min(3),+ Constraint::Length(1),+ ])+ .areas(frame.area());++ render_header(frame, app, header);+ render_tabs(frame, app, tabs);+ match app.tab {+ Tab::Overview => render_overview(frame, app, body),+ Tab::Sessions => render_sessions(frame, app, body),+ Tab::Config => render_config(frame, app, body),+ Tab::Logs => render_logs(frame, app, body),+ }+ render_footer(frame, app, footer);++ match &app.mode {+ Mode::ConfirmDelete => render_confirm_delete(frame, app),+ Mode::Pairing { created, .. } => render_pairing(frame, app, created),+ Mode::Normal | Mode::EditField { .. } => {}+ }+}++fn render_header(frame: &mut Frame, app: &App, area: Rect) {+ let (dot, dot_style, state) = match &app.snapshot.harness {+ Some(harness) if harness.connected => ("●", Style::new().fg(OK), "connected"),+ Some(_) => ("●", Style::new().fg(WARN), "paired, runtime not dialed in"),+ None if app.paired() => ("○", Style::new().fg(WARN), "paired, unreachable"),+ None => ("○", Style::new().fg(DIM), "not paired"),+ };+ let name = app+ .snapshot+ .harness+ .as_ref()+ .map(|harness| harness.name.clone())+ .or_else(|| app.config.identity.name.clone())+ .unwrap_or_else(|| "macrod".to_owned());++ let serving: Vec<Span> = if app.serving() {+ vec![+ Span::styled(" ⏵ serving ", Style::new().fg(OK)),+ Span::styled(format!(":{}", app.config.server.port), Style::new().fg(DIM)),+ ]+ } else if app.paired() {+ vec![Span::styled(" ⏸ daemon stopped", Style::new().fg(ERR))]+ } else {+ Vec::new()+ };+ let mut spans = vec![+ Span::styled(" macrod ", Style::new().fg(Color::Black).bg(ACCENT).bold()),+ Span::raw(" "),+ Span::styled(name, Style::new().bold()),+ Span::raw(" "),+ Span::styled(dot, dot_style),+ Span::raw(" "),+ Span::styled(state, Style::new().fg(DIM)),+ ];+ spans.extend(serving);+ spans.push(Span::styled(+ format!(" pid {}", app.pid),+ Style::new().fg(DIM),+ ));+ let title = Line::from(spans);+ let block = Block::default()+ .borders(Borders::ALL)+ .border_type(BorderType::Rounded)+ .border_style(Style::new().fg(DIM));+ frame.render_widget(Paragraph::new(title).block(block), area);+}++fn render_tabs(frame: &mut Frame, app: &App, area: Rect) {+ let titles = Tab::ALL+ .iter()+ .enumerate()+ .map(|(index, tab)| Line::from(format!(" {} {} ", index + 1, tab.title())));+ let selected = Tab::ALL.iter().position(|tab| *tab == app.tab).unwrap_or(0);+ let tabs = Tabs::new(titles)+ .select(selected)+ .style(Style::new().fg(DIM))+ .highlight_style(Style::new().fg(ACCENT).add_modifier(Modifier::BOLD))+ .divider("│");+ frame.render_widget(tabs, area);+}++fn render_overview(frame: &mut Frame, app: &App, area: Rect) {+ let [left, right] = Layout::default()+ .direction(Direction::Horizontal)+ .constraints([Constraint::Percentage(55), Constraint::Percentage(45)])+ .areas(area);++ let mut lines: Vec<Line> = Vec::new();+ match &app.snapshot.harness {+ Some(harness) => {+ let scope = match &harness.owner {+ HarnessOwner::User { .. } => Span::styled("private", Style::new().fg(WARN)),+ HarnessOwner::Team { .. } => Span::styled("team", Style::new().fg(ACCENT)),+ };+ lines.push(field(+ "Name",+ Span::styled(&harness.name, Style::new().bold()),+ ));+ lines.push(field("Scope", scope));+ lines.push(field(+ "Id",+ Span::styled(harness.id.to_string(), Style::new().fg(DIM)),+ ));+ lines.push(field(+ "Last connected",+ Span::raw(+ harness+ .last_connected_at+ .map(ago)+ .unwrap_or_else(|| "never".to_owned()),+ ),+ ));+ lines.push(field("Registered by", Span::raw(&harness.created_by)));+ if app.serving() {+ lines.push(field(+ "Harness proc",+ match &app.harness_process {+ Some((pid, name)) => Span::raw(format!("{name} · pid {pid}")),+ None => Span::styled(+ "not spawned - starts on the first trigger",+ Style::new().fg(DIM).italic(),+ ),+ },+ ));+ }+ lines.push(Line::raw(""));+ lines.push(Line::styled(+ if app.serving() {+ "Serving from this window; the dot turns green once a session dials in."+ } else {+ "The daemon is not running; check the Logs tab for why."+ },+ Style::new().fg(DIM),+ ));+ }+ None if app.paired() => {+ lines.push(Line::styled(+ "Credentials on disk, but the server does not know this harness.",+ Style::new().fg(WARN),+ ));+ lines.push(Line::raw("It was likely removed. Press p to pair again."));+ }+ None => {+ lines.push(Line::styled(+ "This daemon is not paired yet.",+ Style::new().bold(),+ ));+ lines.push(Line::raw(""));+ lines.push(Line::from(vec![+ Span::raw("Press "),+ Span::styled("p", Style::new().fg(ACCENT).bold()),+ Span::raw(" to pair it with "),+ Span::styled(&app.config.macro_api.web_url, Style::new().fg(DIM)),+ ]));+ }+ }+ frame.render_widget(+ Paragraph::new(lines)+ .wrap(Wrap { trim: false })+ .block(card("Harness")),+ left,+ );++ let agents: Vec<ListItem> = if app.snapshot.agents.is_empty() {+ vec![ListItem::new(Line::styled(+ if app.paired() {+ "No agents bound yet - create one in Settings → Agents."+ } else {+ "Agents appear here once paired."+ },+ Style::new().fg(DIM),+ ))]+ } else {+ app.snapshot+ .agents+ .iter()+ .map(|agent| {+ ListItem::new(Line::from(vec![+ Span::styled(format!("@{}", agent.handle), Style::new().fg(ACCENT).bold()),+ Span::raw(" "),+ Span::raw(agent.name.clone()),+ ]))+ })+ .collect()+ };+ frame.render_widget(+ List::new(agents).block(card(format!(+ "Bound agents ({})",+ app.snapshot.agents.len()+ ))),+ right,+ );+}++fn render_sessions(frame: &mut Frame, app: &App, area: Rect) {+ if app.snapshot.sessions.is_empty() {+ let message = if app.paired() {+ "No sessions yet - @mention a bound agent in a channel."+ } else {+ "Sessions appear here once paired."+ };+ frame.render_widget(+ Paragraph::new(Line::styled(message, Style::new().fg(DIM))).block(card("Sessions")),+ area,+ );+ return;+ }++ let header = Row::new(["Agent", "Session", "Status", "Model", "Owner", "Updated"])+ .style(Style::new().fg(DIM).add_modifier(Modifier::BOLD));+ let rows = app.snapshot.sessions.iter().map(|session| {+ Row::new(vec![+ Cell::from(Span::styled(+ format!("@{}", session.bot_handle),+ Style::new().fg(ACCENT),+ )),+ Cell::from(session.name.clone()),+ Cell::from(Span::styled(+ session.status.clone(),+ status_style(&session.status),+ )),+ Cell::from(session.model.clone()),+ Cell::from(Span::styled(session.owner_id.clone(), Style::new().fg(DIM))),+ Cell::from(ago(session.modified_at)),+ ])+ });+ let table = Table::new(+ rows,+ [+ Constraint::Length(14),+ Constraint::Min(18),+ Constraint::Length(14),+ Constraint::Length(12),+ Constraint::Min(16),+ Constraint::Length(10),+ ],+ )+ .header(header)+ .column_spacing(2)+ .block(card(format!("Sessions ({})", app.snapshot.sessions.len())));+ frame.render_widget(table, area);+}++fn render_config(frame: &mut Frame, app: &App, area: Rect) {+ let editing = match &app.mode {+ Mode::EditField { index, buffer } => Some((*index, buffer.as_str())),+ _ => None,+ };++ let items: Vec<ListItem> = FIELDS+ .iter()+ .enumerate()+ .map(|(index, definition)| {+ let selected = index == app.selected_field;+ let marker = if selected { "▸ " } else { " " };+ let label_style = if selected {+ Style::new().fg(ACCENT).bold()+ } else {+ Style::new()+ };+ let value: Span = match editing {+ Some((edit_index, buffer)) if edit_index == index => Span::styled(+ format!("{buffer}▏"),+ Style::new().fg(Color::Black).bg(ACCENT),+ ),+ _ => {+ let shown = app.form.display(definition);+ if shown.is_empty() {+ Span::styled("(unset)", Style::new().fg(DIM).italic())+ } else {+ Span::raw(shown)+ }+ }+ };+ ListItem::new(Line::from(vec![+ Span::styled(format!("{marker}{:<22}", definition.label), label_style),+ value,+ ]))+ })+ .collect();++ frame.render_widget(+ List::new(items).block(card(format!(+ "macro.toml · {}",+ app.config_path.display()+ ))),+ area,+ );+}++fn render_logs(frame: &mut Frame, app: &App, area: Rect) {+ let capacity = area.height.saturating_sub(2) as usize;+ let lines: Vec<Line> = app+ .logs+ .tail(capacity.max(1))+ .into_iter()+ .map(|line| {+ let style = if line.contains("ERROR") {+ Style::new().fg(ERR)+ } else if line.contains("WARN") {+ Style::new().fg(WARN)+ } else {+ Style::new().fg(DIM)+ };+ Line::styled(line, style)+ })+ .collect();+ let body: Vec<Line> = if lines.is_empty() {+ vec![Line::styled(+ "Nothing logged yet - triggers and dials show up here.",+ Style::new().fg(DIM),+ )]+ } else {+ lines+ };+ frame.render_widget(Paragraph::new(body).block(card("Daemon logs")), area);+}++fn render_footer(frame: &mut Frame, app: &App, area: Rect) {+ let line = if let Some((message, is_error)) = &app.status {+ Line::styled(+ format!(" {message}"),+ Style::new().fg(if *is_error { ERR } else { OK }),+ )+ } else {+ let hints: &[(&str, &str)] = match (&app.mode, app.tab) {+ (Mode::EditField { .. }, _) => &[("enter", "save"), ("esc", "cancel")],+ (Mode::ConfirmDelete, _) => &[("y", "remove"), ("esc", "keep")],+ (Mode::Pairing { .. }, _) => {+ &[("o", "open link"), ("c", "copy code"), ("esc", "abandon")]+ }+ (_, Tab::Config) => &[+ ("↑↓", "select"),+ ("enter", "edit/toggle"),+ ("tab", "next tab"),+ ("q", "quit"),+ ],+ _ => &[+ ("p", "pair"),+ ("d", "remove harness"),+ ("r", "refresh"),+ ("tab", "next tab"),+ ("q", "quit"),+ ],+ };+ let mut spans = Vec::new();+ for (key, action) in hints {+ spans.push(Span::styled(+ format!(" {key} "),+ Style::new().fg(Color::Black).bg(DIM),+ ));+ spans.push(Span::styled(format!(" {action} "), Style::new().fg(DIM)));+ }+ Line::from(spans)+ };+ frame.render_widget(Paragraph::new(line), area);+}++fn render_confirm_delete(frame: &mut Frame, app: &App) {+ let area = centered(52, 8, frame.area());+ frame.render_widget(Clear, area);+ let name = app+ .snapshot+ .harness+ .as_ref()+ .map(|harness| harness.name.as_str())+ .unwrap_or("this harness");+ let text = vec![+ Line::raw(""),+ Line::from(vec![+ Span::raw("Remove "),+ Span::styled(name, Style::new().bold()),+ Span::raw("?"),+ ]),+ Line::styled(+ "Agents bound to it stop running until it is re-paired.",+ Style::new().fg(DIM),+ ),+ Line::raw(""),+ Line::from(vec![+ Span::styled(" y ", Style::new().fg(Color::Black).bg(ERR)),+ Span::raw(" remove "),+ Span::styled(" esc ", Style::new().fg(Color::Black).bg(DIM)),+ Span::raw(" keep"),+ ]),+ ];+ frame.render_widget(+ Paragraph::new(text)+ .alignment(Alignment::Center)+ .block(modal("Remove harness", ERR)),+ area,+ );+}++fn render_pairing(+ frame: &mut Frame,+ app: &App,+ created: &harnesses::domain::models::CreatedPairing,+) {+ let url = app.config.macro_api.pairing_approval_url(&created.code);+ let width = (url.len() as u16 + 6).clamp(56, frame.area().width.saturating_sub(4));+ let area = centered(width, 12, frame.area());+ frame.render_widget(Clear, area);+ let minutes = (created.expires_at - Utc::now()).num_minutes().max(0);+ let spinner = SPINNER[app.spinner % SPINNER.len()];++ // The code and the URL are rendered as plain contiguous runs on their own+ // lines, left-aligned: that keeps them selectable for copy-paste and lets+ // terminals linkify the URL for cmd/ctrl+click.+ let text = vec![+ Line::raw(""),+ Line::from(vec![+ Span::styled(" code ", Style::new().fg(DIM)),+ Span::styled(+ created.code.clone(),+ Style::new().fg(ACCENT).add_modifier(Modifier::BOLD),+ ),+ Span::styled(" (c to copy)", Style::new().fg(DIM)),+ ]),+ Line::from(vec![+ Span::styled(" link ", Style::new().fg(DIM)),+ Span::styled(url, Style::new().underlined()),+ ]),+ Line::raw(""),+ Line::styled(+ " The browser opened to the approval page with the code",+ Style::new().fg(DIM),+ ),+ Line::styled(+ " pre-filled - confirm it matches, then approve.",+ Style::new().fg(DIM),+ ),+ Line::raw(""),+ Line::from(vec![+ Span::raw(" "),+ Span::styled(spinner, Style::new().fg(ACCENT)),+ Span::styled(+ format!(" waiting for approval · expires in {minutes} min"),+ Style::new().fg(DIM),+ ),+ ]),+ ];+ frame.render_widget(+ Paragraph::new(text)+ .alignment(Alignment::Left)+ .block(modal("Pair this daemon", ACCENT)),+ area,+ );+}++fn card(title: impl Into<String>) -> Block<'static> {+ Block::default()+ .title(format!(" {} ", title.into()))+ .title_style(Style::new().fg(ACCENT).bold())+ .borders(Borders::ALL)+ .border_type(BorderType::Rounded)+ .border_style(Style::new().fg(DIM))+ .padding(Padding::horizontal(1))+}++fn modal(title: &str, color: Color) -> Block<'static> {+ Block::default()+ .title(format!(" {title} "))+ .title_style(Style::new().fg(color).bold())+ .borders(Borders::ALL)+ .border_type(BorderType::Double)+ .border_style(Style::new().fg(color))+}++fn field<'a>(label: &str, value: Span<'a>) -> Line<'a> {+ Line::from(vec![+ Span::styled(format!("{label:<16}"), Style::new().fg(DIM)),+ value,+ ])+}++fn status_style(status: &str) -> Style {+ // The session status vocabulary: `event` is a live session, `no_messages`+ // one that never heard anything, `disconnected` one whose runtime is gone.+ match status {+ "event" => Style::new().fg(OK),+ "no_messages" => Style::new().fg(DIM),+ "disconnected" => Style::new().fg(ERR),+ _ => Style::new().fg(WARN),+ }+}++fn ago(when: DateTime<Utc>) -> String {+ let seconds = (Utc::now() - when).num_seconds().max(0);+ match seconds {+ 0..=59 => format!("{seconds}s ago"),+ 60..=3599 => format!("{}m ago", seconds / 60),+ 3600..=86_399 => format!("{}h ago", seconds / 3600),+ _ => format!("{}d ago", seconds / 86_400),+ }+}++fn centered(width: u16, height: u16, area: Rect) -> Rect {+ let width = width.min(area.width.saturating_sub(2));+ let height = height.min(area.height.saturating_sub(2));+ Rect {+ x: area.x + (area.width.saturating_sub(width)) / 2,+ y: area.y + (area.height.saturating_sub(height)) / 2,+ width,+ height,+ }+}diff --git a/crates/harnesses/src/domain/models.rs b/crates/harnesses/src/domain/models.rsindex 9300ad0eea..b25daad715 100644--- a/crates/harnesses/src/domain/models.rs+++ b/crates/harnesses/src/domain/models.rs@@ -192,6 +192,32 @@ pub struct HarnessAgent {pub handle: String,}+/// An agent session running on a harness, as listed for the daemon's UI.+#[derive(Debug, Clone, Serialize, Deserialize)]+#[cfg_attr(feature = "inbound", derive(utoipa::ToSchema))]+pub struct HarnessSession {+ /// The session id.+ pub session_id: Uuid,+ /// The agent the session runs for.+ pub bot_id: BotId,+ /// The agent's display name.+ pub bot_name: String,+ /// The agent's `@` handle.+ pub bot_handle: String,+ /// The session's display name.+ pub name: String,+ /// Session lifecycle status, e.g. `no_messages`, `active`.+ pub status: String,+ /// Model the session was opened with.+ pub model: String,+ /// The user the session belongs to.+ pub owner_id: String,+ /// Creation timestamp.+ pub created_at: DateTime<Utc>,+ /// Last-activity timestamp.+ pub modified_at: DateTime<Utc>,+}+/// Persisted pairing state consumed by the domain service.#[derive(Debug, Clone, PartialEq, Eq)]pub enum PairingStatus {diff --git a/crates/harnesses/src/domain/ports.rs b/crates/harnesses/src/domain/ports.rsindex 8ec98a6b82..af91ec33c4 100644--- a/crates/harnesses/src/domain/ports.rs+++ b/crates/harnesses/src/domain/ports.rs@@ -10,8 +10,8 @@ use uuid::Uuid;use super::models::{ApprovePairingRequest, ClaimOutcome, ClaimPairingRequest, CreatePairingRequest, CreatedPairing,- Harness, HarnessAgent, HarnessOwner, PairingClaimFacts, PairingDetails, PairingStatus,- RequestedHarnessScope,+ Harness, HarnessAgent, HarnessOwner, HarnessSession, PairingClaimFacts, PairingDetails,+ PairingStatus, RequestedHarnessScope,};/// A pairing row to persist.@@ -156,6 +156,12 @@ pub trait HarnessRepo: Send + Sync + 'static {&self,harness_id: HarnessId,) -> impl Future<Output = Result<Vec<HarnessAgent>, Self::Err>> + Send;++ /// List recent sessions of agents bound to a harness, newest first.+ fn list_sessions(+ &self,+ harness_id: HarnessId,+ ) -> impl Future<Output = Result<Vec<HarnessSession>, Self::Err>> + Send;}/// Harness service.@@ -206,6 +212,27 @@ pub trait HarnessService: Send + Sync + 'static {&self,harness_id: HarnessId,) -> impl Future<Output = Result<Vec<HarnessAgent>, HarnessError>> + Send;++ /// The authenticated harness's own registration.+ fn get_self(+ &self,+ harness_id: HarnessId,+ ) -> impl Future<Output = Result<Harness, HarnessError>> + Send;++ /// Retire the authenticated harness: soft-delete it and revoke its tokens.+ ///+ /// Holding a valid credential is the whole authorization - the daemon may+ /// always retire itself.+ fn delete_self(+ &self,+ harness_id: HarnessId,+ ) -> impl Future<Output = Result<(), HarnessError>> + Send;++ /// List recent sessions of agents bound to the authenticated harness.+ fn list_sessions(+ &self,+ harness_id: HarnessId,+ ) -> impl Future<Output = Result<Vec<HarnessSession>, HarnessError>> + Send;}/// Harness service error.diff --git a/crates/harnesses/src/domain/service.rs b/crates/harnesses/src/domain/service.rsindex ff60e58272..281d1e4fdc 100644--- a/crates/harnesses/src/domain/service.rs+++ b/crates/harnesses/src/domain/service.rs@@ -13,8 +13,8 @@ use uuid::Uuid;use super::{models::{ApprovePairingRequest, ClaimOutcome, ClaimPairingRequest, ClaimedPairing,- CreatePairingRequest, CreatedPairing, Harness, HarnessAgent, HarnessOwner, PairingDetails,- PairingStatus,+ CreatePairingRequest, CreatedPairing, Harness, HarnessAgent, HarnessOwner, HarnessSession,+ PairingDetails, PairingStatus,},ports::{HarnessError, HarnessRepo, HarnessService, NewHarness, NewPairing},tokens,@@ -146,7 +146,9 @@ where)))}- #[tracing::instrument(skip(self), err)]+ // `code` is the user-facing device secret for the pairing's 15-minute+ // window; it must never reach a span field or a log line.+ #[tracing::instrument(skip(self, code), err)]async fn get_pairing(&self, code: &str) -> Result<PairingDetails, HarnessError> {let code = tokens::normalize_pairing_code(code).ok_or_else(|| HarnessError::BadRequest("malformed pairing code".to_owned()))?;@@ -169,7 +171,8 @@ whereOk(pairing.details)}- #[tracing::instrument(skip(self, req), fields(caller = %caller), err)]+ // Skip `code` (the device secret) and `req`; the caller is safe to record.+ #[tracing::instrument(skip(self, req, code), fields(caller = %caller), err)]async fn approve_pairing(&self,caller: MacroUserIdStr<'static>,@@ -328,4 +331,40 @@ where.await.map_err(Into::into)?)}++ #[tracing::instrument(skip(self), err)]+ async fn get_self(&self, harness_id: HarnessId) -> Result<Harness, HarnessError> {+ self.repo+ .get_harness(harness_id)+ .await+ .map_err(Into::into)?+ .ok_or_else(|| HarnessError::NotFound("unknown harness".to_owned()))+ }++ #[tracing::instrument(skip(self), err)]+ async fn delete_self(&self, harness_id: HarnessId) -> Result<(), HarnessError> {+ // The valid credential that authenticated this call is the whole+ // authorization: a daemon may always retire itself.+ if !self+ .repo+ .delete_harness(harness_id)+ .await+ .map_err(Into::into)?+ {+ return Err(HarnessError::NotFound("unknown harness".to_owned()));+ }+ Ok(())+ }++ #[tracing::instrument(skip(self), err)]+ async fn list_sessions(+ &self,+ harness_id: HarnessId,+ ) -> Result<Vec<HarnessSession>, HarnessError> {+ Ok(self+ .repo+ .list_sessions(harness_id)+ .await+ .map_err(Into::into)?)+ }}diff --git a/crates/harnesses/src/domain/service/test.rs b/crates/harnesses/src/domain/service/test.rsindex 2c1b980c09..fe1953557b 100644--- a/crates/harnesses/src/domain/service/test.rs+++ b/crates/harnesses/src/domain/service/test.rs@@ -173,6 +173,13 @@ impl HarnessRepo for FakeRepo {) -> Result<Vec<HarnessAgent>, Self::Err> {Ok(Vec::new())}++ async fn list_sessions(+ &self,+ _harness_id: HarnessId,+ ) -> Result<Vec<HarnessSession>, Self::Err> {+ Ok(Vec::new())+ }}fn service(repo: FakeRepo) -> HarnessServiceImpl<FakeRepo> {diff --git a/crates/harnesses/src/inbound/axum_router.rs b/crates/harnesses/src/inbound/axum_router.rsindex 3b77b42f35..87b8175c14 100644--- a/crates/harnesses/src/inbound/axum_router.rs+++ b/crates/harnesses/src/inbound/axum_router.rs@@ -21,7 +21,8 @@ use uuid::Uuid;use crate::domain::{models::{ApprovePairingRequest, ClaimOutcome, ClaimPairingRequest, ClaimedPairing,- CreatePairingRequest, CreatedPairing, Harness, HarnessAgent, PairingDetails,+ CreatePairingRequest, CreatedPairing, Harness, HarnessAgent, HarnessSession,+ PairingDetails,},ports::{HarnessError, HarnessService},};@@ -100,10 +101,19 @@ wherepost(claim_pairing_handler::<S, Auth>),).route("/harnesses", get(list_harnesses_handler::<S, Auth>))+ .route("/harnesses/me", get(get_self_harness_handler::<S, Auth>))+ .route(+ "/harnesses/me",+ delete(delete_self_harness_handler::<S, Auth>),+ ).route("/harnesses/me/agents",get(list_bound_agents_handler::<S, Auth>),)+ .route(+ "/harnesses/me/sessions",+ get(list_harness_sessions_handler::<S, Auth>),+ ).route("/harnesses/{harness_id}",delete(delete_harness_handler::<S, Auth>),@@ -291,6 +301,81 @@ pub async fn delete_harness_handler<S: HarnessService, Auth: MacroAuthorizationSOk(StatusCode::NO_CONTENT)}+/// Handler for `GET /harnesses/me`.+#[utoipa::path(+ get,+ tag = "harnesses",+ operation_id = "get_self_harness",+ path = "/harnesses/me",+ responses(+ (status = 200, body = Harness),+ (status = 401, body = ErrorResponse),+ (status = 404, body = ErrorResponse),+ (status = 500, body = ErrorResponse),+ )+)]+pub async fn get_self_harness_handler<S: HarnessService, Auth: MacroAuthorizationService>(+ State(state): State<HarnessesRouterState<S, Auth>>,+ authorization: MacroAuthorizationExtractor<Auth, HarnessOnly>,+) -> Result<Json<Harness>, HarnessesHandlerErr> {+ Ok(Json(+ state+ .service+ .get_self(authorization.authorization.harness_id)+ .await?,+ ))+}++/// Handler for `DELETE /harnesses/me`.+///+/// A daemon retiring itself: the valid credential is the authorization.+#[utoipa::path(+ delete,+ tag = "harnesses",+ operation_id = "delete_self_harness",+ path = "/harnesses/me",+ responses(+ (status = 204),+ (status = 401, body = ErrorResponse),+ (status = 404, body = ErrorResponse),+ (status = 500, body = ErrorResponse),+ )+)]+pub async fn delete_self_harness_handler<S: HarnessService, Auth: MacroAuthorizationService>(+ State(state): State<HarnessesRouterState<S, Auth>>,+ authorization: MacroAuthorizationExtractor<Auth, HarnessOnly>,+) -> Result<StatusCode, HarnessesHandlerErr> {+ state+ .service+ .delete_self(authorization.authorization.harness_id)+ .await?;+ Ok(StatusCode::NO_CONTENT)+}++/// Handler for `GET /harnesses/me/sessions`.+#[utoipa::path(+ get,+ tag = "harnesses",+ operation_id = "list_harness_sessions",+ path = "/harnesses/me/sessions",+ responses(+ (status = 200, body = Vec<HarnessSession>),+ (status = 401, body = ErrorResponse),+ (status = 500, body = ErrorResponse),+ )+)]+pub async fn list_harness_sessions_handler<S: HarnessService, Auth: MacroAuthorizationService>(+ State(state): State<HarnessesRouterState<S, Auth>>,+ authorization: MacroAuthorizationExtractor<Auth, HarnessOnly>,+) -> Result<Json<Vec<HarnessSession>>, HarnessesHandlerErr> {+ Ok(Json(+ state+ .service+ .list_sessions(authorization.authorization.harness_id)+ .await?,+ ))+}+/// Handler for `GET /harnesses/me/agents`.#[utoipa::path(get,diff --git a/crates/harnesses/src/outbound/pg_harness_repo.rs b/crates/harnesses/src/outbound/pg_harness_repo.rsindex f2fcb936a8..32e24e8d1e 100644--- a/crates/harnesses/src/outbound/pg_harness_repo.rs+++ b/crates/harnesses/src/outbound/pg_harness_repo.rs@@ -13,8 +13,8 @@ use uuid::Uuid;use crate::domain::{models::{- Harness, HarnessAgent, HarnessOwner, PairingClaimFacts, PairingDetails, PairingStatus,- RequestedHarnessScope,+ Harness, HarnessAgent, HarnessOwner, HarnessSession, PairingClaimFacts, PairingDetails,+ PairingStatus, RequestedHarnessScope,},ports::{HarnessRepo, NewHarness, NewPairing, OpenPairingCounts, PairingRow},};@@ -473,4 +473,48 @@ impl HarnessRepo for PgHarnessRepo {}).collect())}++ async fn list_sessions(&self, harness_id: HarnessId) -> Result<Vec<HarnessSession>, Self::Err> {+ let rows = sqlx::query!(+ r#"+ SELECT+ s.id AS session_id,+ s.bot_id,+ b.name AS bot_name,+ b.handle AS bot_handle,+ s.name,+ s.status,+ s.model,+ s.owner_id,+ s.created_at,+ s.modified_at+ FROM agent_session s+ JOIN agent_configs ac ON ac.bot_id = s.bot_id+ JOIN bots b ON b.id = s.bot_id+ WHERE ac.harness_id = $1+ ORDER BY s.modified_at DESC+ LIMIT 50+ "#,+ harness_id.as_uuid(),+ )+ .fetch_all(&self.pool)+ .await+ .context("failed to list harness sessions")?;++ Ok(rows+ .into_iter()+ .map(|row| HarnessSession {+ session_id: row.session_id,+ bot_id: bot_id::BotId::new_from_uuid(row.bot_id),+ bot_name: row.bot_name,+ bot_handle: row.bot_handle,+ name: row.name,+ status: row.status,+ model: row.model,+ owner_id: row.owner_id,+ created_at: row.created_at,+ modified_at: row.modified_at,+ })+ .collect())+ }}diff --git a/crates/harnesses/src/outbound/pg_harness_repo/tests.rs b/crates/harnesses/src/outbound/pg_harness_repo/tests.rsindex 8152369376..83bbf12dfc 100644--- a/crates/harnesses/src/outbound/pg_harness_repo/tests.rs+++ b/crates/harnesses/src/outbound/pg_harness_repo/tests.rs@@ -387,3 +387,118 @@ async fn bound_agents_lists_only_live_agents_of_this_harness(pool: PgPool) {assert_eq!(agents[0].bot_id.as_uuid(), bot_id);assert_eq!(agents[0].name, "Bound agent");}++#[sqlx::test(migrator = "MACRO_DB_MIGRATIONS")]+async fn sessions_list_only_this_harness_newest_first(pool: PgPool) {+ let repo = PgHarnessRepo::new(pool.clone());+ // Sessions reference their owner row.+ insert_user(&pool, OWNER_ID).await;+ let harness_id = Uuid::new_v4();+ sqlx::query!(+ r#"+ INSERT INTO harnesses (id, name, owner_user_id, created_by)+ VALUES ($1, 'mine', $2, $2)+ "#,+ harness_id,+ OWNER_ID,+ )+ .execute(&pool)+ .await+ .unwrap();++ let bot_id = Uuid::new_v4();+ sqlx::query!(+ r#"+ INSERT INTO bots (id, kind, owner_user_id, name, handle, has_agent)+ VALUES ($1, 'owned', $2, 'Bound agent', $3, true)+ "#,+ bot_id,+ OWNER_ID,+ format!("bound-{bot_id}"),+ )+ .execute(&pool)+ .await+ .unwrap();+ sqlx::query!(+ r#"+ INSERT INTO agent_configs (bot_id, instructions, harness, default_model, channel_scope, harness_id)+ VALUES ($1, 'prompt', 'macrod', 'default', 'all', $2)+ "#,+ bot_id,+ harness_id,+ )+ .execute(&pool)+ .await+ .unwrap();++ for (offset, status, event_name) in [+ (2_i32, "no_messages", None),+ (1_i32, "event", Some("prompted")),+ ] {+ sqlx::query!(+ r#"+ INSERT INTO agent_session+ (id, owner_id, bot_id, model, harness, workspace, status, status_event_name,+ created_at, modified_at)+ VALUES ($1, $2, $3, 'default', 'macrod', '/workspace', $4, $5,+ now() - make_interval(mins => $6), now() - make_interval(mins => $6))+ "#,+ Uuid::new_v4(),+ OWNER_ID,+ bot_id,+ status,+ event_name as Option<&str>,+ offset,+ )+ .execute(&pool)+ .await+ .unwrap();+ }++ // A session on a bot bound to no harness stays invisible.+ let other_bot = Uuid::new_v4();+ sqlx::query!(+ r#"+ INSERT INTO bots (id, kind, owner_user_id, name, handle, has_agent)+ VALUES ($1, 'owned', $2, 'Other agent', $3, true)+ "#,+ other_bot,+ OWNER_ID,+ format!("other-{other_bot}"),+ )+ .execute(&pool)+ .await+ .unwrap();+ sqlx::query!(+ r#"+ INSERT INTO agent_configs (bot_id, instructions, harness, default_model, channel_scope)+ VALUES ($1, 'prompt', 'in-memory', 'default', 'all')+ "#,+ other_bot,+ )+ .execute(&pool)+ .await+ .unwrap();+ sqlx::query!(+ r#"+ INSERT INTO agent_session (id, owner_id, bot_id, model, harness, workspace)+ VALUES ($1, $2, $3, 'default', 'in-memory', '/workspace')+ "#,+ Uuid::new_v4(),+ OWNER_ID,+ other_bot,+ )+ .execute(&pool)+ .await+ .unwrap();++ let sessions = repo+ .list_sessions(HarnessId::new_from_uuid(harness_id))+ .await+ .unwrap();+ assert_eq!(sessions.len(), 2);+ assert_eq!(sessions[0].status, "event");+ assert_eq!(sessions[1].status, "no_messages");+ assert_eq!(sessions[0].bot_name, "Bound agent");+ assert_eq!(sessions[0].owner_id, OWNER_ID);+}diff --git a/crates/webhook_signature/src/lib.rs b/crates/webhook_signature/src/lib.rsindex 70adaedaca..d9288d7f99 100644--- a/crates/webhook_signature/src/lib.rs+++ b/crates/webhook_signature/src/lib.rs@@ -36,8 +36,15 @@ pub fn sign(secret: &str, timestamp: &str, raw_body: &[u8]) -> Option<String> {}/// Verify a delivery's `x-macro-signature` value in constant time.+///+/// An empty secret can never verify: HMAC accepts a zero-length key, so a+/// caller that has not yet learned its real secret would otherwise accept+/// signatures anyone could forge. Fail closed instead.#[must_use]pub fn verify(secret: &str, timestamp: &str, raw_body: &[u8], signature: &str) -> bool {+ if secret.is_empty() {+ return false;+ }let Some(hex_digest) = signature.strip_prefix("v1=") else {return false;};diff --git a/crates/webhook_signature/src/test.rs b/crates/webhook_signature/src/test.rsindex 8a7550528e..d7844e813c 100644--- a/crates/webhook_signature/src/test.rs+++ b/crates/webhook_signature/src/test.rs@@ -17,6 +17,15 @@ fn tampering_fails_verification() {assert!(!verify("secret", "1755188000", b"{\"a\":1}", "nope"));}+#[test]+fn an_empty_secret_never_verifies() {+ // A receiver that has not yet learned its real secret holds `""`. HMAC+ // would happily key on an empty slice, so verification must reject it+ // outright - otherwise anyone could forge a delivery it would accept.+ let forged = sign("", "1755188000", b"{\"a\":1}").unwrap();+ assert!(!verify("", "1755188000", b"{\"a\":1}", &forged));+}+/// Pin the digest so the scheme can never drift from the TS verifier/// (`packages/sdk/src/events/verify.ts`) without a test moving.#[test]diff --git a/crates/workspace-hack/Cargo.toml b/crates/workspace-hack/Cargo.tomlindex 35bc3c2e06..73dc7a64f3 100644--- a/crates/workspace-hack/Cargo.toml+++ b/crates/workspace-hack/Cargo.toml@@ -73,6 +73,7 @@ hyper-rustls-adf3d7031871b0af = { package = "hyper-rustls", version = "0.24", dehyper-util = { version = "0.1", features = ["client-legacy", "client-proxy", "http1", "http2", "server", "service"] }idna = { version = "1" }indexmap = { version = "2", features = ["serde"] }+itertools = { version = "0.13" }lazy_static = { version = "1", default-features = false, features = ["spin_no_std"] }libc = { version = "0.2", features = ["extra_traits"] }log = { version = "0.4", default-features = false, features = ["std"] }@@ -206,6 +207,7 @@ hyper-rustls-adf3d7031871b0af = { package = "hyper-rustls", version = "0.24", dehyper-util = { version = "0.1", features = ["client-legacy", "client-proxy", "http1", "http2", "server", "service"] }idna = { version = "1" }indexmap = { version = "2", features = ["serde"] }+itertools = { version = "0.13" }lazy_static = { version = "1", default-features = false, features = ["spin_no_std"] }libc = { version = "0.2", features = ["extra_traits"] }log = { version = "0.4", default-features = false, features = ["std"] }@@ -261,7 +263,7 @@ sqlx-core = { version = "0.8", features = ["_rt-tokio", "_tls-rustls-ring-webpkisqlx-postgres = { version = "0.8", default-features = false, features = ["any", "chrono", "json", "migrate", "offline", "uuid"] }stable_deref_trait = { version = "1" }subtle = { version = "2" }-syn-7b89eefb6aaa9bf3 = { package = "syn", version = "3", features = ["visit-mut"] }+syn-7b89eefb6aaa9bf3 = { package = "syn", version = "3", features = ["extra-traits", "full", "visit-mut"] }syn-dff4ba8e3ae991db = { package = "syn", version = "1", features = ["extra-traits", "fold", "full"] }syn-f595c2ba2a3f28df = { package = "syn", version = "2", features = ["extra-traits", "fold", "full", "visit", "visit-mut"] }sync_wrapper = { version = "1", default-features = false, features = ["futures"] }@@ -295,9 +297,11 @@ hyper-rustls-754bda37e0fb3874 = { package = "hyper-rustls", version = "0.27", dehyper-util = { version = "0.1", default-features = false, features = ["client-proxy-system"] }ipnet = { version = "2", features = ["serde"] }linux-raw-sys = { version = "0.12", default-features = false, features = ["auxvec", "elf", "errno", "general", "if_ether", "ioctl", "net", "netlink", "no_std", "prctl", "system", "xdp"] }+mio = { version = "1", features = ["net", "os-ext"] }once_cell = { version = "1", default-features = false, features = ["critical-section"] }rand-93f6ce9d446188ac = { package = "rand", version = "0.10" }rustix = { version = "1", features = ["event", "fs", "net", "pipe", "process", "system", "time"] }+signal-hook-mio = { version = "0.2", default-features = false, features = ["support-v0_8", "support-v1_0"] }spin = { version = "0.9" }tokio-rustls = { version = "0.26", default-features = false, features = ["aws-lc-rs", "ring"] }tokio-util = { version = "0.7", default-features = false, features = ["io-util"] }@@ -314,9 +318,11 @@ hyper-rustls-754bda37e0fb3874 = { package = "hyper-rustls", version = "0.27", dehyper-util = { version = "0.1", default-features = false, features = ["client-proxy-system"] }ipnet = { version = "2", features = ["serde"] }linux-raw-sys = { version = "0.12", default-features = false, features = ["auxvec", "elf", "errno", "general", "if_ether", "ioctl", "net", "netlink", "no_std", "prctl", "system", "xdp"] }+mio = { version = "1", features = ["net", "os-ext"] }once_cell = { version = "1", default-features = false, features = ["critical-section"] }rand-93f6ce9d446188ac = { package = "rand", version = "0.10" }rustix = { version = "1", features = ["event", "fs", "net", "pipe", "process", "system", "time"] }+signal-hook-mio = { version = "0.2", default-features = false, features = ["support-v0_8", "support-v1_0"] }spin = { version = "0.9" }tokio-rustls = { version = "0.26", default-features = false, features = ["aws-lc-rs", "ring"] }tokio-util = { version = "0.7", default-features = false, features = ["io-util"] }@@ -333,10 +339,12 @@ getrandom-9fbad63c4bcf4a8f = { package = "getrandom", version = "0.4", default-fhyper-rustls-754bda37e0fb3874 = { package = "hyper-rustls", version = "0.27", default-features = false, features = ["aws-lc-rs", "http1", "http2", "native-tokio", "ring", "tls12", "webpki-tokio"] }hyper-util = { version = "0.1", default-features = false, features = ["client-proxy-system"] }ipnet = { version = "2", features = ["serde"] }+mio = { version = "1", features = ["net", "os-ext"] }once_cell = { version = "1", default-features = false, features = ["critical-section"] }rand-93f6ce9d446188ac = { package = "rand", version = "0.10" }rustix = { version = "1", features = ["event", "fs", "net", "pipe", "process", "system", "time"] }security-framework-sys = { version = "2" }+signal-hook-mio = { version = "0.2", default-features = false, features = ["support-v0_8", "support-v1_0"] }tokio-rustls = { version = "0.26", default-features = false, features = ["aws-lc-rs", "ring"] }tokio-util = { version = "0.7", default-features = false, features = ["io-util"] }tower = { version = "0.5", default-features = false, features = ["retry", "timeout"] }@@ -352,10 +360,12 @@ getrandom-9fbad63c4bcf4a8f = { package = "getrandom", version = "0.4", default-fhyper-rustls-754bda37e0fb3874 = { package = "hyper-rustls", version = "0.27", default-features = false, features = ["aws-lc-rs", "http1", "http2", "native-tokio", "ring", "tls12", "webpki-tokio"] }hyper-util = { version = "0.1", default-features = false, features = ["client-proxy-system"] }ipnet = { version = "2", features = ["serde"] }+mio = { version = "1", features = ["net", "os-ext"] }once_cell = { version = "1", default-features = false, features = ["critical-section"] }rand-93f6ce9d446188ac = { package = "rand", version = "0.10" }rustix = { version = "1", features = ["event", "fs", "net", "pipe", "process", "system", "time"] }security-framework-sys = { version = "2" }+signal-hook-mio = { version = "0.2", default-features = false, features = ["support-v0_8", "support-v1_0"] }tokio-rustls = { version = "0.26", default-features = false, features = ["aws-lc-rs", "ring"] }tokio-util = { version = "0.7", default-features = false, features = ["io-util"] }tower = { version = "0.5", default-features = false, features = ["retry", "timeout"] }diff --git a/packages/sdk/generated/agent-harness/types.gen.ts b/packages/sdk/generated/agent-harness/types.gen.tsindex dda25db2fe..1984a14e10 100644--- a/packages/sdk/generated/agent-harness/types.gen.ts+++ b/packages/sdk/generated/agent-harness/types.gen.ts@@ -223,8 +223,9 @@ export type CreateAgentSessionRequest = {instructions?: string | null;/*** The user who owns the session. Ignored for user callers, who always- * own their own sessions; required for bot callers without verified- * acting-user claims.+ * own their own sessions, and for harness callers, whose verified acting+ * user (owner or confirmed team member) owns the session instead;+ * required for bot callers without verified acting-user claims.** For bot callers this is a claim, not a verified fact: it is scoped to* the bot's own sessions, but the named user owns the session on thediff --git a/packages/sdk/generated/storage/index.ts b/packages/sdk/generated/storage/index.tsindex f67d820cbd..79e3cdc8d1 100644--- a/packages/sdk/generated/storage/index.ts+++ b/packages/sdk/generated/storage/index.ts@@ -1,4 +1,4 @@// This file is auto-generated by @hey-api/openapi-tsexport { type Options, Sdk } from './sdk.gen';-export type { AccessLevel, ActiveCallsResponse, ActiveCallSummary, ActivityType, AddFavoriteData, AddFavoriteError, AddFavoriteErrors, AddFavoriteRequest, AddFavoriteResponse, AddFavoriteResponses, AddParticipantsData, AddParticipantsError, AddParticipantsErrors, AddParticipantsRequest, AddParticipantsResponses, AddPinHandlerData, AddPinHandlerError, AddPinHandlerErrors, AddPinHandlerResponse, AddPinHandlerResponses, AddPinRequest, Agent, AgentChannelScope, Anchor, AnchorId, AnchorRequest, AnchorResponse, AnnotationIncrementalUpdate, ApiActivity, ApiAttachmentChannelReference, ApiAttachmentEntityReference, ApiAttachmentGenericReference, ApiChannelAttachment, ApiChannelAttachmentsPage, ApiChannelContextMessage, ApiChannelDetail, ApiChannelListMessage, ApiChannelListPage, ApiChannelListParticipant, ApiChannelListType, ApiChannelMessage, ApiChannelMessageKind, ApiChannelMessagesPage, ApiChannelParticipant, ApiChannelWithLatest, ApiCountedReaction, ApiEntityFilterAst, ApiGroupByField, ApiGroupMeta, ApiMessageAttachment, ApiMessageSender, ApiMessageSenderType, ApiParticipantListRole, ApiParticipantRole, ApiPropertyEntityType, ApiResolvedChannelMessage, ApiThreadInfo, ApiThreadReply, ApproveHarnessPairingData, ApproveHarnessPairingError, ApproveHarnessPairingErrors, ApproveHarnessPairingResponse, ApproveHarnessPairingResponses, ApprovePairingRequest, AttendeeResponseStatus, BasicDocument, BasicDocumentSubType, BomPart, Bot, BotChannel, BotChannelType, BotId, BotKind, BotOwner, BotToken, BranchNameResponse, BTreeMap, BulkWakeupRequest, BulkWakeupResponse, BulkWakeupSyncServiceDocumentsData, BulkWakeupSyncServiceDocumentsErrors, BulkWakeupSyncServiceDocumentsResponse, BulkWakeupSyncServiceDocumentsResponses, CalendarAttendee, CalendarEvent, CalendarEventFilters, CalendarMentionEvent, CalendarMentionPreviewItem, CalendarMentionPreviewKind, CalendarMentionPreviewRequest, CalendarMentionPreviewRequestItem, CalendarMentionPreviewResponse, CalendarOccurrence, CalendarOccurrenceItem, CalendarOccurrenceResponse, CalendarSyncStatus, CallActiveResponse, CallFilters, CallRecord, CallRecordParticipant, CallRecordPreview, CallRecordPreviewData, CallRecordTranscriptSegment, CallStatus, CallTokenResponse, CallWebhookData, CallWebhookError, CallWebhookErrors, CallWebhookResponses, Channel, ChannelCreatedMetadata, ChannelDeletedMetadata, ChannelEventAttachment, ChannelFilters, ChannelJoinCodeResponse, ChannelMentionedMetadata, ChannelMessage, ChannelMessageAttachmentCreatedMetadata, ChannelMessageAttachmentRemovedMetadata, ChannelMessageDeletedMetadata, ChannelMessageFilters, ChannelMessagePatchedMetadata, ChannelMessagePostedMetadata, ChannelParticipant, ChannelParticipantAddedMetadata, ChannelParticipantRemovedMetadata, ChannelPreview, ChannelPreviewData, ChannelSender, ChannelSharePermission, ChannelThreadFilters, ChannelTopicEvent, ChannelType, ChannelUpdatedMetadata, ChannelWebhookRequest, ChannelWebhookResponse, ChannelWithParticipants, Chat, ChatFilters, CheckActiveCallData, CheckActiveCallError, CheckActiveCallErrors, CheckActiveCallResponse, CheckActiveCallResponses, ClaimedPairing, ClaimHarnessPairingData, ClaimHarnessPairingError, ClaimHarnessPairingErrors, ClaimHarnessPairingResponse, ClaimHarnessPairingResponses, ClaimPairingRequest, ClientOptions, CloudStorageItemType, CollabSurfaceResponse, CollabSurfaceTokenResponse, Comment, CommentThread, ConferenceProvider, CopyDocumentData, CopyDocumentError, CopyDocumentErrors, CopyDocumentQueryParams, CopyDocumentRequest, CopyDocumentResponse, CopyDocumentResponse2, CopyDocumentResponses, CreateAgentData, CreateAgentError, CreateAgentErrors, CreateAgentRequest, CreateAgentResponse, CreateAgentResponses, CreateAnchorData, CreateAnchorError, CreateAnchorErrors, CreateAnchorResponse, CreateAnchorResponses, CreateBotRequest, CreateBulkDocumentResponse, CreateBulkDocumentResponseData, CreateChannelData, CreateChannelError, CreateChannelErrors, CreateChannelRequest, CreateChannelResponse, CreateChannelResponse2, CreateChannelResponses, CreateChannelScopedBotData, CreateChannelScopedBotError, CreateChannelScopedBotErrors, CreateChannelScopedBotRequest, CreateChannelScopedBotResponse, CreateChannelScopedBotResponse2, CreateChannelScopedBotResponses, CreateCollabSurfaceTokenData, CreateCollabSurfaceTokenError, CreateCollabSurfaceTokenErrors, CreateCollabSurfaceTokenResponse, CreateCollabSurfaceTokenResponses, CreateCommentData, CreateCommentError, CreateCommentErrors, CreateCommentRequest, CreateCommentResponse, CreateCommentResponse2, CreateCommentResponses, CreateCrmCommentData, CreateCrmCommentError, CreateCrmCommentErrors, CreateCrmCommentRequest, CreateCrmCommentResponse, CreateCrmCommentResponses, CreateCrmCompanyData, CreateCrmCompanyError, CreateCrmCompanyErrors, CreateCrmCompanyRequest, CreateCrmCompanyResponse, CreateCrmCompanyResponses, CreateCrmContactData, CreateCrmContactError, CreateCrmContactErrors, CreateCrmContactRequest, CreateCrmContactResponse, CreateCrmContactResponses, CreateDocumentData, CreateDocumentError, CreateDocumentErrors, CreateDocumentRequest, CreateDocumentResponse, CreateDocumentResponseData, CreateDocumentResponses, CreatedPairing, CreatedUserApiKey, CreateEntityMentionData, CreateEntityMentionError, CreateEntityMentionErrors, CreateEntityMentionRequest, CreateEntityMentionResponse, CreateEntityMentionResponse2, CreateEntityMentionResponses, CreateHarnessPairingData, CreateHarnessPairingError, CreateHarnessPairingErrors, CreateHarnessPairingResponse, CreateHarnessPairingResponses, CreateInstructionsDocumentResponse, CreateInstructionsHandlerData, CreateInstructionsHandlerError, CreateInstructionsHandlerErrors, CreateInstructionsHandlerResponse, CreateInstructionsHandlerResponses, CreateMarkdownDocumentRequest, CreateMarkdownDocumentResponse, CreateMarkdownHandlerData, CreateMarkdownHandlerError, CreateMarkdownHandlerErrors, CreateMarkdownHandlerResponse, CreateMarkdownHandlerResponses, CreatePairingRequest, CreateProjectHandlerData, CreateProjectHandlerError, CreateProjectHandlerErrors, CreateProjectHandlerResponse, CreateProjectHandlerResponses, CreateProjectRequest, CreateProjectResponse, CreateReminderData, CreateReminderError, CreateReminderErrors, CreateReminderRequest, CreateReminderResponse, CreateReminderResponses, CreateSkillHandlerData, CreateSkillHandlerError, CreateSkillHandlerErrors, CreateSkillHandlerResponse, CreateSkillHandlerResponses, CreateSkillRequest, CreateSkillResponse, CreateSnippetHandlerData, CreateSnippetHandlerError, CreateSnippetHandlerErrors, CreateSnippetHandlerResponse, CreateSnippetHandlerResponses, CreateSnippetRequest, CreateSnippetResponse, CreateTaskHandlerData, CreateTaskHandlerError, CreateTaskHandlerErrors, CreateTaskHandlerResponse, CreateTaskHandlerResponses, CreateTaskRequest, CreateTaskResponse, CreateUnthreadedAnchorRequest, CreateUnthreadedAnchorResponse, CreateUnthreadedPdfAnchorRequest, CreateUserApiKeyData, CreateUserApiKeyError, CreateUserApiKeyErrors, CreateUserApiKeyRequest, CreateUserApiKeyResponse, CreateUserApiKeyResponses, CreateViewHandlerData, CreateViewHandlerError, CreateViewHandlerErrors, CreateViewHandlerResponse, CreateViewHandlerResponses, CreateViewRequest, CreateWebhookData, CreateWebhookError, CreateWebhookErrors, CreateWebhookRequest, CreateWebhookResponse, CreateWebhookResponse2, CreateWebhookResponses, CrmComment, CrmCommentEntityType, CrmCommentThread, CrmCompanyFilters, CrmCompanyResponse, CrmContactResponse, CrmDomainResponse, CrmPermissionRole, CrmTeamSettingsResponse, CrmThread, CustomSpeakerAssignment, DataType, DeleteAnchorData, DeleteAnchorError, DeleteAnchorErrors, DeleteAnchorInfo, DeleteAnchorResponse, DeleteAnchorResponses, DeleteCallRecordData, DeleteCallRecordError, DeleteCallRecordErrors, DeleteCallRecordResponse, DeleteCallRecordResponses, DeleteChannelData, DeleteChannelError, DeleteChannelErrors, DeleteChannelResponse, DeleteChannelResponses, DeleteCollabSurfaceData, DeleteCollabSurfaceError, DeleteCollabSurfaceErrors, DeleteCollabSurfaceResponse, DeleteCollabSurfaceResponses, DeleteCommentData, DeleteCommentError, DeleteCommentErrors, DeleteCommentRequest, DeleteCommentResponse, DeleteCommentResponse2, DeleteCommentResponses, DeleteCrmCommentData, DeleteCrmCommentError, DeleteCrmCommentErrors, DeleteCrmCommentResponse, DeleteCrmCommentResponses, DeleteCrmCommentResult, DeleteDocumentData, DeleteDocumentError, DeleteDocumentErrors, DeleteDocumentResponse, DeleteDocumentResponses, DeleteEntityMentionData, DeleteEntityMentionError, DeleteEntityMentionErrors, DeleteEntityMentionResponse, DeleteEntityMentionResponse2, DeleteEntityMentionResponses, DeleteHarnessData, DeleteHarnessError, DeleteHarnessErrors, DeleteHarnessResponse, DeleteHarnessResponses, DeleteHistoryHandlerData, DeleteHistoryHandlerError, DeleteHistoryHandlerErrors, DeleteHistoryHandlerResponse, DeleteHistoryHandlerResponses, DeleteMessageData, DeleteMessageError, DeleteMessageErrors, DeleteMessageQuery, DeleteMessageResponse, DeleteMessageResponses, DeleteProjectHandlerData, DeleteProjectHandlerError, DeleteProjectHandlerErrors, DeleteProjectHandlerResponse, DeleteProjectHandlerResponses, DeleteReminderData, DeleteReminderError, DeleteReminderErrors, DeleteReminderResponse, DeleteReminderResponses, DeleteThreadInfo, DeleteUnthreadedAnchorRequest, DeleteUnthreadedAnchorResponse, DeleteUnthreadedPdfAnchorRequest, DeleteUserApiKeyData, DeleteUserApiKeyError, DeleteUserApiKeyErrors, DeleteUserApiKeyResponse, DeleteUserApiKeyResponses, DeleteUserDocumentViewLocationData, DeleteUserDocumentViewLocationError, DeleteUserDocumentViewLocationErrors, DeleteUserDocumentViewLocationResponse, DeleteUserDocumentViewLocationResponses, DeleteViewHandlerData, DeleteViewHandlerError, DeleteViewHandlerErrors, DeleteViewHandlerResponses, DeleteWebhookData, DeleteWebhookError, DeleteWebhookErrors, DeleteWebhookResponse, DeleteWebhookResponses, DocumentBasic, DocumentContent, DocumentContentLocation, DocumentContentState, DocumentContentUploadedMetadata, DocumentCopiedMetadata, DocumentCreatedMetadata, DocumentDeletedMetadata, DocumentFilters, DocumentInteractionMetadata, DocumentMetadata, DocumentMetadataWithContent, DocumentPermissionsToken, DocumentPermissionsTokenRequest, DocumentPermissionsTokenResponse, DocumentPreview, DocumentPreviewData, DocumentPreviewDataSubType, DocumentPurgedMetadata, DocumentResponse, DocumentResponseMetadata, DocumentResponseMetadataWithContent, DocumentStorageServiceApiVersion, DocumentSubType, DocumentSyncContentUpdatedMetadata, DocumentTeamShareResponse, DocumentTopicEvent, DocumentUpdatedMetadata, EditAnchorData, EditAnchorError, EditAnchorErrors, EditAnchorRequest, EditAnchorResponse, EditAnchorResponse2, EditAnchorResponses, EditCallRecordData, EditCallRecordError, EditCallRecordErrors, EditCallRecordRequest, EditCallRecordResponse, EditCallRecordResponses, EditCallTranscriptData, EditCallTranscriptError, EditCallTranscriptErrors, EditCallTranscriptRequest, EditCallTranscriptResponse, EditCallTranscriptResponses, EditCommentData, EditCommentError, EditCommentErrors, EditCommentRequest, EditCommentResponse, EditCommentResponse2, EditCommentResponses, EditCrmCommentData, EditCrmCommentError, EditCrmCommentErrors, EditCrmCommentRequest, EditCrmCommentResponse, EditCrmCommentResponses, EditDocumentData, EditDocumentError, EditDocumentErrors, EditDocumentResponse, EditDocumentResponse2, EditDocumentResponses, EditDocumentServiceArgs, EditPdfAnchorRequest, EditPdfPlaceableCommentAnchorRequest, EditProjectV2Data, EditProjectV2Error, EditProjectV2Errors, EditProjectV2Response, EditProjectV2Responses, EditThreadV2Data, EditThreadV2Error, EditThreadV2Errors, EditThreadV2Response, EditThreadV2Responses, EmailFilters, EmptyResponse, EnsureCollabSurfaceData, EnsureCollabSurfaceError, EnsureCollabSurfaceErrors, EnsureCollabSurfaceRequest, EnsureCollabSurfaceResponse, EnsureCollabSurfaceResponses, EntityFilters, EntityPermission, EntityPermissionResponse, EntityReference, EntityType, ErrorResponse, EventReminderOverride, EventReminders, EventStatus, EventTime, EventTransparency, EventType, EventVisibility, ExcludedDefaultView, ExcludeDefaultViewHandlerData, ExcludeDefaultViewHandlerError, ExcludeDefaultViewHandlerErrors, ExcludeDefaultViewHandlerResponses, ExcludeDefaultViewRequest, ExportDocumentData, ExportDocumentError, ExportDocumentErrors, ExportDocumentResponse, ExportDocumentResponse2, ExportDocumentResponses, Favorite, FavoriteEntityRef, FavoritesList, FileSystemNodeWithIds, FileType, FileTypeUpdate, FolderItem, ForeignEntity, ForeignEntityFilters, GenericErrorResponse, GenericResponse, GenericSuccessResponse, GetActiveCallsData, GetActiveCallsError, GetActiveCallsErrors, GetActiveCallsResponse, GetActiveCallsResponses, GetActivityData, GetActivityError, GetActivityErrors, GetActivityResponse, GetActivityResponses, GetAttachmentReferencesData, GetAttachmentReferencesError, GetAttachmentReferencesErrors, GetAttachmentReferencesResponse, GetAttachmentReferencesResponse2, GetAttachmentReferencesResponses, GetBatchCallRecordPreviewData, GetBatchCallRecordPreviewError, GetBatchCallRecordPreviewErrors, GetBatchCallRecordPreviewRequest, GetBatchCallRecordPreviewResponse, GetBatchCallRecordPreviewResponse2, GetBatchCallRecordPreviewResponses, GetBatchChannelPreviewData, GetBatchChannelPreviewError, GetBatchChannelPreviewErrors, GetBatchChannelPreviewRequest, GetBatchChannelPreviewResponse, GetBatchChannelPreviewResponse2, GetBatchChannelPreviewResponses, GetBatchPreviewHandlerData, GetBatchPreviewHandlerError, GetBatchPreviewHandlerErrors, GetBatchPreviewHandlerResponse, GetBatchPreviewHandlerResponses, GetBatchPreviewRequest, GetBatchPreviewResponse, GetBatchProjectPreviewData, GetBatchProjectPreviewError, GetBatchProjectPreviewErrors, GetBatchProjectPreviewRequest, GetBatchProjectPreviewResponse, GetBatchProjectPreviewResponse2, GetBatchProjectPreviewResponses, GetCallRecordData, GetCallRecordError, GetCallRecordErrors, GetCallRecordResponse, GetCallRecordResponses, GetChannelAttachmentsData, GetChannelAttachmentsError, GetChannelAttachmentsErrors, GetChannelAttachmentsResponse, GetChannelAttachmentsResponses, GetChannelData, GetChannelError, GetChannelErrors, GetChannelJoinLinkData, GetChannelJoinLinkError, GetChannelJoinLinkErrors, GetChannelJoinLinkResponse, GetChannelJoinLinkResponses, GetChannelMessagesData, GetChannelMessagesError, GetChannelMessagesErrors, GetChannelMessagesResponse, GetChannelMessagesResponses, GetChannelParticipantsData, GetChannelParticipantsError, GetChannelParticipantsErrors, GetChannelParticipantsResponse, GetChannelParticipantsResponses, GetChannelResponse, GetChannelResponses, GetChannelsData, GetChannelsError, GetChannelsErrors, GetChannelsResponse, GetChannelsResponses, GetCollabSurfaceData, GetCollabSurfaceError, GetCollabSurfaceErrors, GetCollabSurfaceResponse, GetCollabSurfaceResponses, GetCompanyData, GetCompanyError, GetCompanyErrors, GetCompanyResponse, GetCompanyResponses, GetContactByEmailData, GetContactByEmailError, GetContactByEmailErrors, GetContactByEmailResponse, GetContactByEmailResponse2, GetContactByEmailResponses, GetContactData, GetContactError, GetContactErrors, GetContactResponse, GetContactResponses, GetCrmTeamSettingsData, GetCrmTeamSettingsError, GetCrmTeamSettingsErrors, GetCrmTeamSettingsResponse, GetCrmTeamSettingsResponses, GetDocumentAnchorsData, GetDocumentAnchorsError, GetDocumentAnchorsErrors, GetDocumentAnchorsResponse, GetDocumentAnchorsResponses, GetDocumentBranchNameData, GetDocumentBranchNameError, GetDocumentBranchNameErrors, GetDocumentBranchNameResponse, GetDocumentBranchNameResponses, GetDocumentByTeamSlugData, GetDocumentByTeamSlugError, GetDocumentByTeamSlugErrors, GetDocumentByTeamSlugResponse, GetDocumentByTeamSlugResponses, GetDocumentCommentsData, GetDocumentCommentsError, GetDocumentCommentsErrors, GetDocumentCommentsResponse, GetDocumentCommentsResponses, GetDocumentData, GetDocumentError, GetDocumentErrors, GetDocumentGithubPullRequestsData, GetDocumentGithubPullRequestsError, GetDocumentGithubPullRequestsErrors, GetDocumentGithubPullRequestsResponse, GetDocumentGithubPullRequestsResponses, GetDocumentKeyResponse, GetDocumentKeyResponseData, GetDocumentListHandlerData, GetDocumentListHandlerError, GetDocumentListHandlerErrors, GetDocumentListHandlerResponse, GetDocumentListHandlerResponses, GetDocumentListResult, GetDocumentLocationV3Data, GetDocumentLocationV3Error, GetDocumentLocationV3Errors, GetDocumentLocationV3Response, GetDocumentLocationV3Responses, GetDocumentPermissionsResponseDataV2, GetDocumentPermissionsTokenData, GetDocumentPermissionsTokenError, GetDocumentPermissionsTokenErrors, GetDocumentPermissionsTokenResponse, GetDocumentPermissionsTokenResponses, GetDocumentPermissionsV2Data, GetDocumentPermissionsV2Error, GetDocumentPermissionsV2Errors, GetDocumentPermissionsV2Response, GetDocumentPermissionsV2Responses, GetDocumentProcessingResult, GetDocumentProcessingResultData, GetDocumentProcessingResultError, GetDocumentProcessingResultErrors, GetDocumentProcessingResultResponse, GetDocumentProcessingResultResponse2, GetDocumentProcessingResultResponses, GetDocumentResponse, GetDocumentResponse2, GetDocumentResponseData, GetDocumentResponses, GetDocumentSearchResponse, GetDocumentShortIdData, GetDocumentShortIdError, GetDocumentShortIdErrors, GetDocumentShortIdResponse, GetDocumentShortIdResponses, GetDocumentsResponse, GetDocumentTeamShareData, GetDocumentTeamShareError, GetDocumentTeamShareErrors, GetDocumentTeamShareResponse, GetDocumentTeamShareResponses, GetDocumentUserAccessLevelResponse, GetDocumentVersionData, GetDocumentVersionError, GetDocumentVersionErrors, GetDocumentVersionResponse, GetDocumentVersionResponses, GetDocumentViewsHandlerData, GetDocumentViewsHandlerError, GetDocumentViewsHandlerErrors, GetDocumentViewsHandlerResponse, GetDocumentViewsHandlerResponses, GetEntityPermissionData, GetEntityPermissionErrors, GetEntityPermissionResponse, GetEntityPermissionResponses, GetForeignEntityData, GetForeignEntityError, GetForeignEntityErrors, GetForeignEntityResponse, GetForeignEntityResponses, GetHarnessPairingData, GetHarnessPairingError, GetHarnessPairingErrors, GetHarnessPairingResponse, GetHarnessPairingResponses, GetHistoryHandlerData, GetHistoryHandlerError, GetHistoryHandlerErrors, GetHistoryHandlerResponse, GetHistoryHandlerResponses, GetInstructionsDocumentResponse, GetInstructionsHandlerData, GetInstructionsHandlerError, GetInstructionsHandlerErrors, GetInstructionsHandlerResponse, GetInstructionsHandlerResponses, GetItemsSoupData, GetItemsSoupError, GetItemsSoupErrors, GetItemsSoupResponse, GetItemsSoupResponses, GetLocationHandlerData, GetLocationHandlerError, GetLocationHandlerErrors, GetLocationHandlerResponse, GetLocationHandlerResponses, GetMessageWithContextData, GetMessageWithContextError, GetMessageWithContextErrors, GetMessageWithContextResponse, GetMessageWithContextResponse2, GetMessageWithContextResponses, GetOrCreateAction, GetOrCreateCallData, GetOrCreateCallError, GetOrCreateCallErrors, GetOrCreateCallResponse, GetOrCreateCallResponses, GetOrCreateChannelResponse, GetOrCreateDmData, GetOrCreateDmError, GetOrCreateDmErrors, GetOrCreateDmRequest, GetOrCreateDmResponse, GetOrCreateDmResponses, GetOrCreatePrivateData, GetOrCreatePrivateError, GetOrCreatePrivateErrors, GetOrCreatePrivateRequest, GetOrCreatePrivateResponse, GetOrCreatePrivateResponses, GetPendingProjectsHandlerData, GetPendingProjectsHandlerError, GetPendingProjectsHandlerErrors, GetPendingProjectsHandlerResponse, GetPendingProjectsHandlerResponses, GetPinsHandlerData, GetPinsHandlerError, GetPinsHandlerErrors, GetPinsHandlerResponse, GetPinsHandlerResponses, GetPinsResponse, GetProjectContentHandlerData, GetProjectContentHandlerError, GetProjectContentHandlerErrors, GetProjectContentHandlerResponse, GetProjectContentHandlerResponses, GetProjectContentResponse, GetProjectHandlerData, GetProjectHandlerError, GetProjectHandlerErrors, GetProjectHandlerResponse, GetProjectHandlerResponses, GetProjectPermissionsV2Data, GetProjectPermissionsV2Error, GetProjectPermissionsV2Errors, GetProjectPermissionsV2Response, GetProjectPermissionsV2Responses, GetProjectResponse, GetProjectResponseData, GetProjectsHandlerData, GetProjectsHandlerError, GetProjectsHandlerErrors, GetProjectsHandlerResponse, GetProjectsHandlerResponses, GetProjectsResponse, GetProjectUserAccessLevelData, GetProjectUserAccessLevelError, GetProjectUserAccessLevelErrors, GetProjectUserAccessLevelResponse, GetProjectUserAccessLevelResponses, GetReminderData, GetReminderError, GetReminderErrors, GetReminderResponse, GetReminderResponses, GetRingStatusData, GetRingStatusError, GetRingStatusErrors, GetRingStatusResponse, GetRingStatusResponses, GetSelfBotData, GetSelfBotError, GetSelfBotErrors, GetSelfBotResponse, GetSelfBotResponses, GetSystemSkillsHandlerData, GetSystemSkillsHandlerError, GetSystemSkillsHandlerErrors, GetSystemSkillsHandlerResponse, GetSystemSkillsHandlerResponses, GetThreadRepliesData, GetThreadRepliesError, GetThreadRepliesErrors, GetThreadRepliesResponse, GetThreadRepliesResponses, GetUserDocumentsHandlerData, GetUserDocumentsHandlerError, GetUserDocumentsHandlerErrors, GetUserDocumentsHandlerResponse, GetUserDocumentsHandlerResponses, GetUserDocumentViewLocationData, GetUserDocumentViewLocationError, GetUserDocumentViewLocationErrors, GetUserDocumentViewLocationResponse, GetUserDocumentViewLocationResponses, GetUserHistoryResponse, GetViewsHandlerData, GetViewsHandlerError, GetViewsHandlerErrors, GetViewsHandlerResponse, GetViewsHandlerResponses, GetWebhookData, GetWebhookError, GetWebhookErrors, GetWebhookResponse, GetWebhookResponses, GithubPullRequest, GithubPullRequestCheckRun, GithubPullRequestComment, GithubPullRequestsResponse, GroupedInitialParams, GroupedPageParams, GroupedSoupGroupPage, GroupedSoupInitialPage, GroupedSoupPage, GroupedSoupSort, HandlerData, HandlerError, HandlerErrors, HandlerResponse, HandlerResponses, Harness, HarnessAgent, HarnessId, HarnessOwner, HashMap, HealthHandlerData, HealthHandlerResponse, HealthHandlerResponses, HighlightType, IngestTranscriptData, IngestTranscriptError, IngestTranscriptErrors, IngestTranscriptResponses, InitializeUserDocumentsData, InitializeUserDocumentsError, InitializeUserDocumentsErrors, InitializeUserDocumentsResponse, InitializeUserDocumentsResponses, InstallSyncData, InstallSyncErrors, InteractionReason, Item, ItemWithUserAccessLevel, JobProcessingResultHandlerData, JobProcessingResultHandlerError, JobProcessingResultHandlerErrors, JobProcessingResultHandlerResponse, JobProcessingResultHandlerResponses, JoinChannelByCodeData, JoinChannelByCodeError, JoinChannelByCodeErrors, JoinChannelByCodeResponses, JoinChannelData, JoinChannelError, JoinChannelErrors, JoinChannelResponses, LatestMessage, LeaveCallResponse, LeaveChannelData, LeaveChannelError, LeaveChannelErrors, LeaveChannelResponses, LeaveOrEndCallData, LeaveOrEndCallError, LeaveOrEndCallErrors, LeaveOrEndCallResponse, LeaveOrEndCallResponses, LinkShare, ListAgentsData, ListAgentsError, ListAgentsErrors, ListAgentsResponse, ListAgentsResponses, ListBotChannelsData, ListBotChannelsError, ListBotChannelsErrors, ListBotChannelsResponse, ListBotChannelsResponses, ListCompanyContactsData, ListCompanyContactsError, ListCompanyContactsErrors, ListCompanyContactsResponse, ListCompanyContactsResponses, ListCrmCommentsData, ListCrmCommentsError, ListCrmCommentsErrors, ListCrmCommentsResponse, ListCrmCommentsResponses, ListFavoritesData, ListFavoritesError, ListFavoritesErrors, ListFavoritesResponse, ListFavoritesResponses, ListHarnessAgentsData, ListHarnessAgentsError, ListHarnessAgentsErrors, ListHarnessAgentsResponse, ListHarnessAgentsResponses, ListHarnessesData, ListHarnessesError, ListHarnessesErrors, ListHarnessesResponse, ListHarnessesResponses, ListOccurrencesData, ListOccurrencesErrors, ListOccurrencesResponse, ListOccurrencesResponses, ListRemindersData, ListRemindersError, ListRemindersErrors, ListRemindersResponse, ListRemindersResponses, ListUserApiKeysData, ListUserApiKeysError, ListUserApiKeysErrors, ListUserApiKeysResponse, ListUserApiKeysResponses, ListWebhooksData, ListWebhooksError, ListWebhooksErrors, ListWebhooksResponse, ListWebhooksResponse2, ListWebhooksResponses, LocationResponseData, LocationResponseV3, MacroUserIdStr, MentionPreviewsData, MentionPreviewsErrors, MentionPreviewsResponse, MentionPreviewsResponses, Mentions, NewChannelAttachment, NotificationFilters, PairingDetails, Params, ParticipantRole, PatchBotRequest, PatchChannelData, PatchChannelError, PatchChannelErrors, PatchChannelRequest, PatchChannelResponse, PatchChannelResponses, PatchMessageData, PatchMessageError, PatchMessageErrors, PatchMessageRequest, PatchMessageResponse, PatchMessageResponses, PatchProjectRequestV2, PatchThreadRequestV2, PatchViewHandlerData, PatchViewHandlerError, PatchViewHandlerErrors, PatchViewHandlerResponses, PatchWebhookData, PatchWebhookError, PatchWebhookErrors, PatchWebhookRequest, PatchWebhookResponse, PatchWebhookResponses, PdfAnchor, PdfAnchorId, PdfAnchorRequest, PdfHighlightAnchor, PdfHighlightAnchorRequest, PdfHighlightRect, PdfHighlightRectAnchorRequest, PdfPlaceableCommentAnchor, PdfPlaceableCommentAnchorRequest, PendingClaimResponse, PermanentlyDeleteDocumentData, PermanentlyDeleteDocumentError, PermanentlyDeleteDocumentErrors, PermanentlyDeleteDocumentResponse, PermanentlyDeleteDocumentResponses, PermanentlyDeleteProjectData, PermanentlyDeleteProjectError, PermanentlyDeleteProjectErrors, PermanentlyDeleteProjectResponse, PermanentlyDeleteProjectResponses, PinnedItem, PinRequest, PostActivityData, PostActivityError, PostActivityErrors, PostActivityRequest, PostActivityResponse, PostActivityResponses, PostChannelBotWebhookData, PostChannelBotWebhookError, PostChannelBotWebhookErrors, PostChannelBotWebhookResponse, PostChannelBotWebhookResponses, PostChannelMessagesData, PostChannelMessagesError, PostChannelMessagesErrors, PostChannelMessagesResponse, PostChannelMessagesResponses, PostGroupedSoupAstGroupPageRequest, PostGroupedSoupAstInitialRequest, PostGroupedSoupAstRequest, PostItemsSoupAstData, PostItemsSoupAstError, PostItemsSoupAstErrors, PostItemsSoupAstGroupedData, PostItemsSoupAstGroupedError, PostItemsSoupAstGroupedErrors, PostItemsSoupAstGroupedResponse, PostItemsSoupAstGroupedResponses, PostItemsSoupAstResponse, PostItemsSoupAstResponses, PostItemsSoupData, PostItemsSoupError, PostItemsSoupErrors, PostItemsSoupResponse, PostItemsSoupResponses, PostMessageData, PostMessageError, PostMessageErrors, PostMessageRequest, PostMessageResponse, PostMessageResponse2, PostMessageResponses, PostReactionData, PostReactionError, PostReactionErrors, PostReactionRequest, PostReactionResponse, PostReactionResponses, PostSoupAstRequest, PostSoupRequest, PostTypingData, PostTypingError, PostTypingErrors, PostTypingRequest, PostTypingResponse, PostTypingResponses, PresaveDocumentHandlerData, PresaveDocumentHandlerError, PresaveDocumentHandlerErrors, PresaveDocumentHandlerResponse, PresaveDocumentHandlerResponses, PreSaveDocumentRequest, PreSaveDocumentResponse, PreSaveDocumentResponseData, PresignedUrl, Project, ProjectDeleteResponseData, ProjectDocumentStatus, ProjectFilters, ProjectPreview, ProjectPreviewData, PropertyDefinition, PropertyFilter, PropertyInput, PropertyOwner, PropertyValue, PutCrmTeamSettingsData, PutCrmTeamSettingsError, PutCrmTeamSettingsErrors, PutCrmTeamSettingsResponse, PutCrmTeamSettingsResponses, ReactionAction, RecentlyDeletedData, RecentlyDeletedError, RecentlyDeletedErrors, RecentlyDeletedResponse, RecentlyDeletedResponseData, RecentlyDeletedResponses, Reminder, ReminderFilters, ReminderSchedule, RemindersList, RemoveBotFromChannelByBotData, RemoveBotFromChannelByBotError, RemoveBotFromChannelByBotErrors, RemoveBotFromChannelByBotResponse, RemoveBotFromChannelByBotResponses, RemoveFavoriteByEntityData, RemoveFavoriteByEntityError, RemoveFavoriteByEntityErrors, RemoveFavoriteByEntityResponses, RemoveParticipantsData, RemoveParticipantsError, RemoveParticipantsErrors, RemoveParticipantsRequest, RemoveParticipantsResponses, RemovePinHandlerData, RemovePinHandlerError, RemovePinHandlerErrors, RemovePinHandlerResponse, RemovePinHandlerResponses, ReorderFavoritesData, ReorderFavoritesError, ReorderFavoritesErrors, ReorderFavoritesRequest, ReorderFavoritesResponses, ReorderPinRequest, ReorderPinsHandlerData, ReorderPinsHandlerError, ReorderPinsHandlerErrors, ReorderPinsHandlerResponse, ReorderPinsHandlerResponses, RequestedHarnessScope, ResolveChannelMessageData, ResolveChannelMessageError, ResolveChannelMessageErrors, ResolveChannelMessageResponse, ResolveChannelMessageResponses, RevertDeleteDocumentData, RevertDeleteDocumentError, RevertDeleteDocumentErrors, RevertDeleteDocumentResponse, RevertDeleteDocumentResponses, RevertDeleteProjectData, RevertDeleteProjectError, RevertDeleteProjectErrors, RevertDeleteProjectResponse, RevertDeleteProjectResponses, RingStatus, RingStatusResponse, S3ObjectInfo, SaveBomPart, SaveDocumentHandlerData, SaveDocumentHandlerError, SaveDocumentHandlerErrors, SaveDocumentHandlerResponse, SaveDocumentHandlerResponses, SaveDocumentRequest, SaveDocumentResponse, SaveDocumentResponseData, SetCompanyHiddenData, SetCompanyHiddenError, SetCompanyHiddenErrors, SetCompanyHiddenRequest, SetCompanyHiddenResponse, SetCompanyHiddenResponses, SetCompanyNameRequest, SetContactHiddenData, SetContactHiddenError, SetContactHiddenErrors, SetContactHiddenRequest, SetContactHiddenResponse, SetContactHiddenResponses, SetContactNameRequest, SetCrmCompanyNameData, SetCrmCompanyNameError, SetCrmCompanyNameErrors, SetCrmCompanyNameResponse, SetCrmCompanyNameResponses, SetCrmContactNameData, SetCrmContactNameError, SetCrmContactNameErrors, SetCrmContactNameResponse, SetCrmContactNameResponses, SetDocumentTeamShareData, SetDocumentTeamShareError, SetDocumentTeamShareErrors, SetDocumentTeamShareRequest, SetDocumentTeamShareResponse, SetDocumentTeamShareResponses, SetEmailSyncData, SetEmailSyncError, SetEmailSyncErrors, SetEmailSyncRequest, SetEmailSyncResponse, SetEmailSyncResponses, SetPropertyValue, SharedEmailFilter, SharePermissionV2, ShortIdResponse, SimpleMention, SimpleSaveData, SimpleSaveError, SimpleSaveErrors, SimpleSaveResponse, SimpleSaveResponses, SoupApiItem, SoupApiSort, SoupApiSortDirection, SoupAttachment, SoupCalendarEventSoupPropertiesField, SoupCalendarEventTime, SoupCallRecordParticipant, SoupCallRecordSoupPropertiesField, SoupChannel, SoupChannelThread, SoupChatSoupPropertiesField, SoupContact, SoupCountedReaction, SoupCrmCompanySoupPropertiesField, SoupCrmDomain, SoupDocumentSoupPropertiesField, SoupDocumentSubType, SoupEmailThreadPreview, SoupEnrichedEmailThreadPreviewSoupPropertiesField, SoupForeignEntity, SoupItem, SoupLabel, SoupLabelListVisibility, SoupLabelType, SoupMessageAttachment, SoupMessageListVisibility, SoupMessageSender, SoupMessageSenderType, SoupPage, SoupProjectSoupPropertiesField, SoupPropertiesField, SoupProperty, SoupReminderReference, SoupReminderSchedule, SoupReminderSoupPropertiesField, SoupThreadInfo, SoupThreadReply, StarterDocumentsResponse, String, SuccessResponse, SurfaceState, SyncServiceVersionId, SystemSkillSummary, TagFilterMode, TaskFilters, TeamRole, Thread, ThreadResponse, ToggleShareWithTeamData, ToggleShareWithTeamError, ToggleShareWithTeamErrors, ToggleShareWithTeamResponse, ToggleShareWithTeamResponses, TranscriptSegmentRequest, TypedSuccessResponse, TypedSuccessResponseGetDocumentResponseData, TypingAction, UnthreadedPdfUuidRequest, UpdateAgentData, UpdateAgentError, UpdateAgentErrors, UpdateAgentRequest, UpdateAgentResponse, UpdateAgentResponses, UpdateChannelSharePermission, UpdateCrmTeamSettingsRequest, UpdateOperation, UpdateReminderData, UpdateReminderError, UpdateReminderErrors, UpdateReminderRequest, UpdateReminderResponse, UpdateReminderResponses, UpdateSharePermissionRequestV2, UploadDocumentStatus, UploadExtractFolderHandlerData, UploadExtractFolderHandlerError, UploadExtractFolderHandlerErrors, UploadExtractFolderHandlerResponse, UploadExtractFolderHandlerResponses, UploadExtractFolderRequest, UploadFolderHandlerData, UploadFolderHandlerError, UploadFolderHandlerErrors, UploadFolderHandlerResponse, UploadFolderHandlerResponses, UploadFolderRequest, UpsertHistoryHandlerData, UpsertHistoryHandlerError, UpsertHistoryHandlerErrors, UpsertHistoryHandlerResponse, UpsertHistoryHandlerResponses, UpsertUserDocumentViewLocationData, UpsertUserDocumentViewLocationError, UpsertUserDocumentViewLocationErrors, UpsertUserDocumentViewLocationRequest, UpsertUserDocumentViewLocationResponse, UpsertUserDocumentViewLocationResponses, UserApiKeyId, UserApiKeyInfo, UserApiKeysList, UserDocumentsResponse, UserDocumentViewLocation, UserDocumentViewLocationResponse, UserPinsResponse, UserViewsResponse, ValidateDocumentPermissionsTokenData, ValidateDocumentPermissionsTokenError, ValidateDocumentPermissionsTokenErrors, ValidateDocumentPermissionsTokenResponse, ValidateDocumentPermissionsTokenResponses, ValidateWebhookData, ValidateWebhookError, ValidateWebhookErrors, ValidateWebhookResponse, ValidateWebhookResponse2, ValidateWebhookResponses, Vec, View, ViewPatch, ViewsResponse, Webhook, WebhookEvent, WebhookFilter, WebhookScope, WebhookStatus, WebhookValidationTestEvent, WithCallId, WithChannelId, WithDocumentId, WithProjectId } from './types.gen';+export type { AccessLevel, ActiveCallsResponse, ActiveCallSummary, ActivityType, AddFavoriteData, AddFavoriteError, AddFavoriteErrors, AddFavoriteRequest, AddFavoriteResponse, AddFavoriteResponses, AddParticipantsData, AddParticipantsError, AddParticipantsErrors, AddParticipantsRequest, AddParticipantsResponses, AddPinHandlerData, AddPinHandlerError, AddPinHandlerErrors, AddPinHandlerResponse, AddPinHandlerResponses, AddPinRequest, Agent, AgentChannelScope, Anchor, AnchorId, AnchorRequest, AnchorResponse, AnnotationIncrementalUpdate, ApiActivity, ApiAttachmentChannelReference, ApiAttachmentEntityReference, ApiAttachmentGenericReference, ApiChannelAttachment, ApiChannelAttachmentsPage, ApiChannelContextMessage, ApiChannelDetail, ApiChannelListMessage, ApiChannelListPage, ApiChannelListParticipant, ApiChannelListType, ApiChannelMessage, ApiChannelMessageKind, ApiChannelMessagesPage, ApiChannelParticipant, ApiChannelWithLatest, ApiCountedReaction, ApiEntityFilterAst, ApiGroupByField, ApiGroupMeta, ApiMessageAttachment, ApiMessageSender, ApiMessageSenderType, ApiParticipantListRole, ApiParticipantRole, ApiPropertyEntityType, ApiResolvedChannelMessage, ApiThreadInfo, ApiThreadReply, ApproveHarnessPairingData, ApproveHarnessPairingError, ApproveHarnessPairingErrors, ApproveHarnessPairingResponse, ApproveHarnessPairingResponses, ApprovePairingRequest, AttendeeResponseStatus, BasicDocument, BasicDocumentSubType, BomPart, Bot, BotChannel, BotChannelType, BotId, BotKind, BotOwner, BotToken, BranchNameResponse, BTreeMap, BulkWakeupRequest, BulkWakeupResponse, BulkWakeupSyncServiceDocumentsData, BulkWakeupSyncServiceDocumentsErrors, BulkWakeupSyncServiceDocumentsResponse, BulkWakeupSyncServiceDocumentsResponses, CalendarAttendee, CalendarEvent, CalendarEventFilters, CalendarMentionEvent, CalendarMentionPreviewItem, CalendarMentionPreviewKind, CalendarMentionPreviewRequest, CalendarMentionPreviewRequestItem, CalendarMentionPreviewResponse, CalendarOccurrence, CalendarOccurrenceItem, CalendarOccurrenceResponse, CalendarSyncStatus, CallActiveResponse, CallFilters, CallRecord, CallRecordParticipant, CallRecordPreview, CallRecordPreviewData, CallRecordTranscriptSegment, CallStatus, CallTokenResponse, CallWebhookData, CallWebhookError, CallWebhookErrors, CallWebhookResponses, Channel, ChannelCreatedMetadata, ChannelDeletedMetadata, ChannelEventAttachment, ChannelFilters, ChannelJoinCodeResponse, ChannelMentionedMetadata, ChannelMessage, ChannelMessageAttachmentCreatedMetadata, ChannelMessageAttachmentRemovedMetadata, ChannelMessageDeletedMetadata, ChannelMessageFilters, ChannelMessagePatchedMetadata, ChannelMessagePostedMetadata, ChannelParticipant, ChannelParticipantAddedMetadata, ChannelParticipantRemovedMetadata, ChannelPreview, ChannelPreviewData, ChannelSender, ChannelSharePermission, ChannelThreadFilters, ChannelTopicEvent, ChannelType, ChannelUpdatedMetadata, ChannelWebhookRequest, ChannelWebhookResponse, ChannelWithParticipants, Chat, ChatFilters, CheckActiveCallData, CheckActiveCallError, CheckActiveCallErrors, CheckActiveCallResponse, CheckActiveCallResponses, ClaimedPairing, ClaimHarnessPairingData, ClaimHarnessPairingError, ClaimHarnessPairingErrors, ClaimHarnessPairingResponse, ClaimHarnessPairingResponses, ClaimPairingRequest, ClientOptions, CloudStorageItemType, CollabSurfaceResponse, CollabSurfaceTokenResponse, Comment, CommentThread, ConferenceProvider, CopyDocumentData, CopyDocumentError, CopyDocumentErrors, CopyDocumentQueryParams, CopyDocumentRequest, CopyDocumentResponse, CopyDocumentResponse2, CopyDocumentResponses, CreateAgentData, CreateAgentError, CreateAgentErrors, CreateAgentRequest, CreateAgentResponse, CreateAgentResponses, CreateAnchorData, CreateAnchorError, CreateAnchorErrors, CreateAnchorResponse, CreateAnchorResponses, CreateBotRequest, CreateBulkDocumentResponse, CreateBulkDocumentResponseData, CreateChannelData, CreateChannelError, CreateChannelErrors, CreateChannelRequest, CreateChannelResponse, CreateChannelResponse2, CreateChannelResponses, CreateChannelScopedBotData, CreateChannelScopedBotError, CreateChannelScopedBotErrors, CreateChannelScopedBotRequest, CreateChannelScopedBotResponse, CreateChannelScopedBotResponse2, CreateChannelScopedBotResponses, CreateCollabSurfaceTokenData, CreateCollabSurfaceTokenError, CreateCollabSurfaceTokenErrors, CreateCollabSurfaceTokenResponse, CreateCollabSurfaceTokenResponses, CreateCommentData, CreateCommentError, CreateCommentErrors, CreateCommentRequest, CreateCommentResponse, CreateCommentResponse2, CreateCommentResponses, CreateCrmCommentData, CreateCrmCommentError, CreateCrmCommentErrors, CreateCrmCommentRequest, CreateCrmCommentResponse, CreateCrmCommentResponses, CreateCrmCompanyData, CreateCrmCompanyError, CreateCrmCompanyErrors, CreateCrmCompanyRequest, CreateCrmCompanyResponse, CreateCrmCompanyResponses, CreateCrmContactData, CreateCrmContactError, CreateCrmContactErrors, CreateCrmContactRequest, CreateCrmContactResponse, CreateCrmContactResponses, CreateDocumentData, CreateDocumentError, CreateDocumentErrors, CreateDocumentRequest, CreateDocumentResponse, CreateDocumentResponseData, CreateDocumentResponses, CreatedPairing, CreatedUserApiKey, CreateEntityMentionData, CreateEntityMentionError, CreateEntityMentionErrors, CreateEntityMentionRequest, CreateEntityMentionResponse, CreateEntityMentionResponse2, CreateEntityMentionResponses, CreateHarnessPairingData, CreateHarnessPairingError, CreateHarnessPairingErrors, CreateHarnessPairingResponse, CreateHarnessPairingResponses, CreateInstructionsDocumentResponse, CreateInstructionsHandlerData, CreateInstructionsHandlerError, CreateInstructionsHandlerErrors, CreateInstructionsHandlerResponse, CreateInstructionsHandlerResponses, CreateMarkdownDocumentRequest, CreateMarkdownDocumentResponse, CreateMarkdownHandlerData, CreateMarkdownHandlerError, CreateMarkdownHandlerErrors, CreateMarkdownHandlerResponse, CreateMarkdownHandlerResponses, CreatePairingRequest, CreateProjectHandlerData, CreateProjectHandlerError, CreateProjectHandlerErrors, CreateProjectHandlerResponse, CreateProjectHandlerResponses, CreateProjectRequest, CreateProjectResponse, CreateReminderData, CreateReminderError, CreateReminderErrors, CreateReminderRequest, CreateReminderResponse, CreateReminderResponses, CreateSkillHandlerData, CreateSkillHandlerError, CreateSkillHandlerErrors, CreateSkillHandlerResponse, CreateSkillHandlerResponses, CreateSkillRequest, CreateSkillResponse, CreateSnippetHandlerData, CreateSnippetHandlerError, CreateSnippetHandlerErrors, CreateSnippetHandlerResponse, CreateSnippetHandlerResponses, CreateSnippetRequest, CreateSnippetResponse, CreateTaskHandlerData, CreateTaskHandlerError, CreateTaskHandlerErrors, CreateTaskHandlerResponse, CreateTaskHandlerResponses, CreateTaskRequest, CreateTaskResponse, CreateUnthreadedAnchorRequest, CreateUnthreadedAnchorResponse, CreateUnthreadedPdfAnchorRequest, CreateUserApiKeyData, CreateUserApiKeyError, CreateUserApiKeyErrors, CreateUserApiKeyRequest, CreateUserApiKeyResponse, CreateUserApiKeyResponses, CreateViewHandlerData, CreateViewHandlerError, CreateViewHandlerErrors, CreateViewHandlerResponse, CreateViewHandlerResponses, CreateViewRequest, CreateWebhookData, CreateWebhookError, CreateWebhookErrors, CreateWebhookRequest, CreateWebhookResponse, CreateWebhookResponse2, CreateWebhookResponses, CrmComment, CrmCommentEntityType, CrmCommentThread, CrmCompanyFilters, CrmCompanyResponse, CrmContactResponse, CrmDomainResponse, CrmPermissionRole, CrmTeamSettingsResponse, CrmThread, CustomSpeakerAssignment, DataType, DeleteAnchorData, DeleteAnchorError, DeleteAnchorErrors, DeleteAnchorInfo, DeleteAnchorResponse, DeleteAnchorResponses, DeleteCallRecordData, DeleteCallRecordError, DeleteCallRecordErrors, DeleteCallRecordResponse, DeleteCallRecordResponses, DeleteChannelData, DeleteChannelError, DeleteChannelErrors, DeleteChannelResponse, DeleteChannelResponses, DeleteCollabSurfaceData, DeleteCollabSurfaceError, DeleteCollabSurfaceErrors, DeleteCollabSurfaceResponse, DeleteCollabSurfaceResponses, DeleteCommentData, DeleteCommentError, DeleteCommentErrors, DeleteCommentRequest, DeleteCommentResponse, DeleteCommentResponse2, DeleteCommentResponses, DeleteCrmCommentData, DeleteCrmCommentError, DeleteCrmCommentErrors, DeleteCrmCommentResponse, DeleteCrmCommentResponses, DeleteCrmCommentResult, DeleteDocumentData, DeleteDocumentError, DeleteDocumentErrors, DeleteDocumentResponse, DeleteDocumentResponses, DeleteEntityMentionData, DeleteEntityMentionError, DeleteEntityMentionErrors, DeleteEntityMentionResponse, DeleteEntityMentionResponse2, DeleteEntityMentionResponses, DeleteHarnessData, DeleteHarnessError, DeleteHarnessErrors, DeleteHarnessResponse, DeleteHarnessResponses, DeleteHistoryHandlerData, DeleteHistoryHandlerError, DeleteHistoryHandlerErrors, DeleteHistoryHandlerResponse, DeleteHistoryHandlerResponses, DeleteMessageData, DeleteMessageError, DeleteMessageErrors, DeleteMessageQuery, DeleteMessageResponse, DeleteMessageResponses, DeleteProjectHandlerData, DeleteProjectHandlerError, DeleteProjectHandlerErrors, DeleteProjectHandlerResponse, DeleteProjectHandlerResponses, DeleteReminderData, DeleteReminderError, DeleteReminderErrors, DeleteReminderResponse, DeleteReminderResponses, DeleteSelfHarnessData, DeleteSelfHarnessError, DeleteSelfHarnessErrors, DeleteSelfHarnessResponse, DeleteSelfHarnessResponses, DeleteThreadInfo, DeleteUnthreadedAnchorRequest, DeleteUnthreadedAnchorResponse, DeleteUnthreadedPdfAnchorRequest, DeleteUserApiKeyData, DeleteUserApiKeyError, DeleteUserApiKeyErrors, DeleteUserApiKeyResponse, DeleteUserApiKeyResponses, DeleteUserDocumentViewLocationData, DeleteUserDocumentViewLocationError, DeleteUserDocumentViewLocationErrors, DeleteUserDocumentViewLocationResponse, DeleteUserDocumentViewLocationResponses, DeleteViewHandlerData, DeleteViewHandlerError, DeleteViewHandlerErrors, DeleteViewHandlerResponses, DeleteWebhookData, DeleteWebhookError, DeleteWebhookErrors, DeleteWebhookResponse, DeleteWebhookResponses, DocumentBasic, DocumentContent, DocumentContentLocation, DocumentContentState, DocumentContentUploadedMetadata, DocumentCopiedMetadata, DocumentCreatedMetadata, DocumentDeletedMetadata, DocumentFilters, DocumentInteractionMetadata, DocumentMetadata, DocumentMetadataWithContent, DocumentPermissionsToken, DocumentPermissionsTokenRequest, DocumentPermissionsTokenResponse, DocumentPreview, DocumentPreviewData, DocumentPreviewDataSubType, DocumentPurgedMetadata, DocumentResponse, DocumentResponseMetadata, DocumentResponseMetadataWithContent, DocumentStorageServiceApiVersion, DocumentSubType, DocumentSyncContentUpdatedMetadata, DocumentTeamShareResponse, DocumentTopicEvent, DocumentUpdatedMetadata, EditAnchorData, EditAnchorError, EditAnchorErrors, EditAnchorRequest, EditAnchorResponse, EditAnchorResponse2, EditAnchorResponses, EditCallRecordData, EditCallRecordError, EditCallRecordErrors, EditCallRecordRequest, EditCallRecordResponse, EditCallRecordResponses, EditCallTranscriptData, EditCallTranscriptError, EditCallTranscriptErrors, EditCallTranscriptRequest, EditCallTranscriptResponse, EditCallTranscriptResponses, EditCommentData, EditCommentError, EditCommentErrors, EditCommentRequest, EditCommentResponse, EditCommentResponse2, EditCommentResponses, EditCrmCommentData, EditCrmCommentError, EditCrmCommentErrors, EditCrmCommentRequest, EditCrmCommentResponse, EditCrmCommentResponses, EditDocumentData, EditDocumentError, EditDocumentErrors, EditDocumentResponse, EditDocumentResponse2, EditDocumentResponses, EditDocumentServiceArgs, EditPdfAnchorRequest, EditPdfPlaceableCommentAnchorRequest, EditProjectV2Data, EditProjectV2Error, EditProjectV2Errors, EditProjectV2Response, EditProjectV2Responses, EditThreadV2Data, EditThreadV2Error, EditThreadV2Errors, EditThreadV2Response, EditThreadV2Responses, EmailFilters, EmptyResponse, EnsureCollabSurfaceData, EnsureCollabSurfaceError, EnsureCollabSurfaceErrors, EnsureCollabSurfaceRequest, EnsureCollabSurfaceResponse, EnsureCollabSurfaceResponses, EntityFilters, EntityPermission, EntityPermissionResponse, EntityReference, EntityType, ErrorResponse, EventReminderOverride, EventReminders, EventStatus, EventTime, EventTransparency, EventType, EventVisibility, ExcludedDefaultView, ExcludeDefaultViewHandlerData, ExcludeDefaultViewHandlerError, ExcludeDefaultViewHandlerErrors, ExcludeDefaultViewHandlerResponses, ExcludeDefaultViewRequest, ExportDocumentData, ExportDocumentError, ExportDocumentErrors, ExportDocumentResponse, ExportDocumentResponse2, ExportDocumentResponses, Favorite, FavoriteEntityRef, FavoritesList, FileSystemNodeWithIds, FileType, FileTypeUpdate, FolderItem, ForeignEntity, ForeignEntityFilters, GenericErrorResponse, GenericResponse, GenericSuccessResponse, GetActiveCallsData, GetActiveCallsError, GetActiveCallsErrors, GetActiveCallsResponse, GetActiveCallsResponses, GetActivityData, GetActivityError, GetActivityErrors, GetActivityResponse, GetActivityResponses, GetAttachmentReferencesData, GetAttachmentReferencesError, GetAttachmentReferencesErrors, GetAttachmentReferencesResponse, GetAttachmentReferencesResponse2, GetAttachmentReferencesResponses, GetBatchCallRecordPreviewData, GetBatchCallRecordPreviewError, GetBatchCallRecordPreviewErrors, GetBatchCallRecordPreviewRequest, GetBatchCallRecordPreviewResponse, GetBatchCallRecordPreviewResponse2, GetBatchCallRecordPreviewResponses, GetBatchChannelPreviewData, GetBatchChannelPreviewError, GetBatchChannelPreviewErrors, GetBatchChannelPreviewRequest, GetBatchChannelPreviewResponse, GetBatchChannelPreviewResponse2, GetBatchChannelPreviewResponses, GetBatchPreviewHandlerData, GetBatchPreviewHandlerError, GetBatchPreviewHandlerErrors, GetBatchPreviewHandlerResponse, GetBatchPreviewHandlerResponses, GetBatchPreviewRequest, GetBatchPreviewResponse, GetBatchProjectPreviewData, GetBatchProjectPreviewError, GetBatchProjectPreviewErrors, GetBatchProjectPreviewRequest, GetBatchProjectPreviewResponse, GetBatchProjectPreviewResponse2, GetBatchProjectPreviewResponses, GetCallRecordData, GetCallRecordError, GetCallRecordErrors, GetCallRecordResponse, GetCallRecordResponses, GetChannelAttachmentsData, GetChannelAttachmentsError, GetChannelAttachmentsErrors, GetChannelAttachmentsResponse, GetChannelAttachmentsResponses, GetChannelData, GetChannelError, GetChannelErrors, GetChannelJoinLinkData, GetChannelJoinLinkError, GetChannelJoinLinkErrors, GetChannelJoinLinkResponse, GetChannelJoinLinkResponses, GetChannelMessagesData, GetChannelMessagesError, GetChannelMessagesErrors, GetChannelMessagesResponse, GetChannelMessagesResponses, GetChannelParticipantsData, GetChannelParticipantsError, GetChannelParticipantsErrors, GetChannelParticipantsResponse, GetChannelParticipantsResponses, GetChannelResponse, GetChannelResponses, GetChannelsData, GetChannelsError, GetChannelsErrors, GetChannelsResponse, GetChannelsResponses, GetCollabSurfaceData, GetCollabSurfaceError, GetCollabSurfaceErrors, GetCollabSurfaceResponse, GetCollabSurfaceResponses, GetCompanyData, GetCompanyError, GetCompanyErrors, GetCompanyResponse, GetCompanyResponses, GetContactByEmailData, GetContactByEmailError, GetContactByEmailErrors, GetContactByEmailResponse, GetContactByEmailResponse2, GetContactByEmailResponses, GetContactData, GetContactError, GetContactErrors, GetContactResponse, GetContactResponses, GetCrmTeamSettingsData, GetCrmTeamSettingsError, GetCrmTeamSettingsErrors, GetCrmTeamSettingsResponse, GetCrmTeamSettingsResponses, GetDocumentAnchorsData, GetDocumentAnchorsError, GetDocumentAnchorsErrors, GetDocumentAnchorsResponse, GetDocumentAnchorsResponses, GetDocumentBranchNameData, GetDocumentBranchNameError, GetDocumentBranchNameErrors, GetDocumentBranchNameResponse, GetDocumentBranchNameResponses, GetDocumentByTeamSlugData, GetDocumentByTeamSlugError, GetDocumentByTeamSlugErrors, GetDocumentByTeamSlugResponse, GetDocumentByTeamSlugResponses, GetDocumentCommentsData, GetDocumentCommentsError, GetDocumentCommentsErrors, GetDocumentCommentsResponse, GetDocumentCommentsResponses, GetDocumentData, GetDocumentError, GetDocumentErrors, GetDocumentGithubPullRequestsData, GetDocumentGithubPullRequestsError, GetDocumentGithubPullRequestsErrors, GetDocumentGithubPullRequestsResponse, GetDocumentGithubPullRequestsResponses, GetDocumentKeyResponse, GetDocumentKeyResponseData, GetDocumentListHandlerData, GetDocumentListHandlerError, GetDocumentListHandlerErrors, GetDocumentListHandlerResponse, GetDocumentListHandlerResponses, GetDocumentListResult, GetDocumentLocationV3Data, GetDocumentLocationV3Error, GetDocumentLocationV3Errors, GetDocumentLocationV3Response, GetDocumentLocationV3Responses, GetDocumentPermissionsResponseDataV2, GetDocumentPermissionsTokenData, GetDocumentPermissionsTokenError, GetDocumentPermissionsTokenErrors, GetDocumentPermissionsTokenResponse, GetDocumentPermissionsTokenResponses, GetDocumentPermissionsV2Data, GetDocumentPermissionsV2Error, GetDocumentPermissionsV2Errors, GetDocumentPermissionsV2Response, GetDocumentPermissionsV2Responses, GetDocumentProcessingResult, GetDocumentProcessingResultData, GetDocumentProcessingResultError, GetDocumentProcessingResultErrors, GetDocumentProcessingResultResponse, GetDocumentProcessingResultResponse2, GetDocumentProcessingResultResponses, GetDocumentResponse, GetDocumentResponse2, GetDocumentResponseData, GetDocumentResponses, GetDocumentSearchResponse, GetDocumentShortIdData, GetDocumentShortIdError, GetDocumentShortIdErrors, GetDocumentShortIdResponse, GetDocumentShortIdResponses, GetDocumentsResponse, GetDocumentTeamShareData, GetDocumentTeamShareError, GetDocumentTeamShareErrors, GetDocumentTeamShareResponse, GetDocumentTeamShareResponses, GetDocumentUserAccessLevelResponse, GetDocumentVersionData, GetDocumentVersionError, GetDocumentVersionErrors, GetDocumentVersionResponse, GetDocumentVersionResponses, GetDocumentViewsHandlerData, GetDocumentViewsHandlerError, GetDocumentViewsHandlerErrors, GetDocumentViewsHandlerResponse, GetDocumentViewsHandlerResponses, GetEntityPermissionData, GetEntityPermissionErrors, GetEntityPermissionResponse, GetEntityPermissionResponses, GetForeignEntityData, GetForeignEntityError, GetForeignEntityErrors, GetForeignEntityResponse, GetForeignEntityResponses, GetHarnessPairingData, GetHarnessPairingError, GetHarnessPairingErrors, GetHarnessPairingResponse, GetHarnessPairingResponses, GetHistoryHandlerData, GetHistoryHandlerError, GetHistoryHandlerErrors, GetHistoryHandlerResponse, GetHistoryHandlerResponses, GetInstructionsDocumentResponse, GetInstructionsHandlerData, GetInstructionsHandlerError, GetInstructionsHandlerErrors, GetInstructionsHandlerResponse, GetInstructionsHandlerResponses, GetItemsSoupData, GetItemsSoupError, GetItemsSoupErrors, GetItemsSoupResponse, GetItemsSoupResponses, GetLocationHandlerData, GetLocationHandlerError, GetLocationHandlerErrors, GetLocationHandlerResponse, GetLocationHandlerResponses, GetMessageWithContextData, GetMessageWithContextError, GetMessageWithContextErrors, GetMessageWithContextResponse, GetMessageWithContextResponse2, GetMessageWithContextResponses, GetOrCreateAction, GetOrCreateCallData, GetOrCreateCallError, GetOrCreateCallErrors, GetOrCreateCallResponse, GetOrCreateCallResponses, GetOrCreateChannelResponse, GetOrCreateDmData, GetOrCreateDmError, GetOrCreateDmErrors, GetOrCreateDmRequest, GetOrCreateDmResponse, GetOrCreateDmResponses, GetOrCreatePrivateData, GetOrCreatePrivateError, GetOrCreatePrivateErrors, GetOrCreatePrivateRequest, GetOrCreatePrivateResponse, GetOrCreatePrivateResponses, GetPendingProjectsHandlerData, GetPendingProjectsHandlerError, GetPendingProjectsHandlerErrors, GetPendingProjectsHandlerResponse, GetPendingProjectsHandlerResponses, GetPinsHandlerData, GetPinsHandlerError, GetPinsHandlerErrors, GetPinsHandlerResponse, GetPinsHandlerResponses, GetPinsResponse, GetProjectContentHandlerData, GetProjectContentHandlerError, GetProjectContentHandlerErrors, GetProjectContentHandlerResponse, GetProjectContentHandlerResponses, GetProjectContentResponse, GetProjectHandlerData, GetProjectHandlerError, GetProjectHandlerErrors, GetProjectHandlerResponse, GetProjectHandlerResponses, GetProjectPermissionsV2Data, GetProjectPermissionsV2Error, GetProjectPermissionsV2Errors, GetProjectPermissionsV2Response, GetProjectPermissionsV2Responses, GetProjectResponse, GetProjectResponseData, GetProjectsHandlerData, GetProjectsHandlerError, GetProjectsHandlerErrors, GetProjectsHandlerResponse, GetProjectsHandlerResponses, GetProjectsResponse, GetProjectUserAccessLevelData, GetProjectUserAccessLevelError, GetProjectUserAccessLevelErrors, GetProjectUserAccessLevelResponse, GetProjectUserAccessLevelResponses, GetReminderData, GetReminderError, GetReminderErrors, GetReminderResponse, GetReminderResponses, GetRingStatusData, GetRingStatusError, GetRingStatusErrors, GetRingStatusResponse, GetRingStatusResponses, GetSelfBotData, GetSelfBotError, GetSelfBotErrors, GetSelfBotResponse, GetSelfBotResponses, GetSelfHarnessData, GetSelfHarnessError, GetSelfHarnessErrors, GetSelfHarnessResponse, GetSelfHarnessResponses, GetSystemSkillsHandlerData, GetSystemSkillsHandlerError, GetSystemSkillsHandlerErrors, GetSystemSkillsHandlerResponse, GetSystemSkillsHandlerResponses, GetThreadRepliesData, GetThreadRepliesError, GetThreadRepliesErrors, GetThreadRepliesResponse, GetThreadRepliesResponses, GetUserDocumentsHandlerData, GetUserDocumentsHandlerError, GetUserDocumentsHandlerErrors, GetUserDocumentsHandlerResponse, GetUserDocumentsHandlerResponses, GetUserDocumentViewLocationData, GetUserDocumentViewLocationError, GetUserDocumentViewLocationErrors, GetUserDocumentViewLocationResponse, GetUserDocumentViewLocationResponses, GetUserHistoryResponse, GetViewsHandlerData, GetViewsHandlerError, GetViewsHandlerErrors, GetViewsHandlerResponse, GetViewsHandlerResponses, GetWebhookData, GetWebhookError, GetWebhookErrors, GetWebhookResponse, GetWebhookResponses, GithubPullRequest, GithubPullRequestCheckRun, GithubPullRequestComment, GithubPullRequestsResponse, GroupedInitialParams, GroupedPageParams, GroupedSoupGroupPage, GroupedSoupInitialPage, GroupedSoupPage, GroupedSoupSort, HandlerData, HandlerError, HandlerErrors, HandlerResponse, HandlerResponses, Harness, HarnessAgent, HarnessId, HarnessOwner, HarnessSession, HashMap, HealthHandlerData, HealthHandlerResponse, HealthHandlerResponses, HighlightType, IngestTranscriptData, IngestTranscriptError, IngestTranscriptErrors, IngestTranscriptResponses, InitializeUserDocumentsData, InitializeUserDocumentsError, InitializeUserDocumentsErrors, InitializeUserDocumentsResponse, InitializeUserDocumentsResponses, InstallSyncData, InstallSyncErrors, InteractionReason, Item, ItemWithUserAccessLevel, JobProcessingResultHandlerData, JobProcessingResultHandlerError, JobProcessingResultHandlerErrors, JobProcessingResultHandlerResponse, JobProcessingResultHandlerResponses, JoinChannelByCodeData, JoinChannelByCodeError, JoinChannelByCodeErrors, JoinChannelByCodeResponses, JoinChannelData, JoinChannelError, JoinChannelErrors, JoinChannelResponses, LatestMessage, LeaveCallResponse, LeaveChannelData, LeaveChannelError, LeaveChannelErrors, LeaveChannelResponses, LeaveOrEndCallData, LeaveOrEndCallError, LeaveOrEndCallErrors, LeaveOrEndCallResponse, LeaveOrEndCallResponses, LinkShare, ListAgentsData, ListAgentsError, ListAgentsErrors, ListAgentsResponse, ListAgentsResponses, ListBotChannelsData, ListBotChannelsError, ListBotChannelsErrors, ListBotChannelsResponse, ListBotChannelsResponses, ListCompanyContactsData, ListCompanyContactsError, ListCompanyContactsErrors, ListCompanyContactsResponse, ListCompanyContactsResponses, ListCrmCommentsData, ListCrmCommentsError, ListCrmCommentsErrors, ListCrmCommentsResponse, ListCrmCommentsResponses, ListFavoritesData, ListFavoritesError, ListFavoritesErrors, ListFavoritesResponse, ListFavoritesResponses, ListHarnessAgentsData, ListHarnessAgentsError, ListHarnessAgentsErrors, ListHarnessAgentsResponse, ListHarnessAgentsResponses, ListHarnessesData, ListHarnessesError, ListHarnessesErrors, ListHarnessesResponse, ListHarnessesResponses, ListHarnessSessionsData, ListHarnessSessionsError, ListHarnessSessionsErrors, ListHarnessSessionsResponse, ListHarnessSessionsResponses, ListOccurrencesData, ListOccurrencesErrors, ListOccurrencesResponse, ListOccurrencesResponses, ListRemindersData, ListRemindersError, ListRemindersErrors, ListRemindersResponse, ListRemindersResponses, ListUserApiKeysData, ListUserApiKeysError, ListUserApiKeysErrors, ListUserApiKeysResponse, ListUserApiKeysResponses, ListWebhooksData, ListWebhooksError, ListWebhooksErrors, ListWebhooksResponse, ListWebhooksResponse2, ListWebhooksResponses, LocationResponseData, LocationResponseV3, MacroUserIdStr, MentionPreviewsData, MentionPreviewsErrors, MentionPreviewsResponse, MentionPreviewsResponses, Mentions, NewChannelAttachment, NotificationFilters, PairingDetails, Params, ParticipantRole, PatchBotRequest, PatchChannelData, PatchChannelError, PatchChannelErrors, PatchChannelRequest, PatchChannelResponse, PatchChannelResponses, PatchMessageData, PatchMessageError, PatchMessageErrors, PatchMessageRequest, PatchMessageResponse, PatchMessageResponses, PatchProjectRequestV2, PatchThreadRequestV2, PatchViewHandlerData, PatchViewHandlerError, PatchViewHandlerErrors, PatchViewHandlerResponses, PatchWebhookData, PatchWebhookError, PatchWebhookErrors, PatchWebhookRequest, PatchWebhookResponse, PatchWebhookResponses, PdfAnchor, PdfAnchorId, PdfAnchorRequest, PdfHighlightAnchor, PdfHighlightAnchorRequest, PdfHighlightRect, PdfHighlightRectAnchorRequest, PdfPlaceableCommentAnchor, PdfPlaceableCommentAnchorRequest, PendingClaimResponse, PermanentlyDeleteDocumentData, PermanentlyDeleteDocumentError, PermanentlyDeleteDocumentErrors, PermanentlyDeleteDocumentResponse, PermanentlyDeleteDocumentResponses, PermanentlyDeleteProjectData, PermanentlyDeleteProjectError, PermanentlyDeleteProjectErrors, PermanentlyDeleteProjectResponse, PermanentlyDeleteProjectResponses, PinnedItem, PinRequest, PostActivityData, PostActivityError, PostActivityErrors, PostActivityRequest, PostActivityResponse, PostActivityResponses, PostChannelBotWebhookData, PostChannelBotWebhookError, PostChannelBotWebhookErrors, PostChannelBotWebhookResponse, PostChannelBotWebhookResponses, PostChannelMessagesData, PostChannelMessagesError, PostChannelMessagesErrors, PostChannelMessagesResponse, PostChannelMessagesResponses, PostGroupedSoupAstGroupPageRequest, PostGroupedSoupAstInitialRequest, PostGroupedSoupAstRequest, PostItemsSoupAstData, PostItemsSoupAstError, PostItemsSoupAstErrors, PostItemsSoupAstGroupedData, PostItemsSoupAstGroupedError, PostItemsSoupAstGroupedErrors, PostItemsSoupAstGroupedResponse, PostItemsSoupAstGroupedResponses, PostItemsSoupAstResponse, PostItemsSoupAstResponses, PostItemsSoupData, PostItemsSoupError, PostItemsSoupErrors, PostItemsSoupResponse, PostItemsSoupResponses, PostMessageData, PostMessageError, PostMessageErrors, PostMessageRequest, PostMessageResponse, PostMessageResponse2, PostMessageResponses, PostReactionData, PostReactionError, PostReactionErrors, PostReactionRequest, PostReactionResponse, PostReactionResponses, PostSoupAstRequest, PostSoupRequest, PostTypingData, PostTypingError, PostTypingErrors, PostTypingRequest, PostTypingResponse, PostTypingResponses, PresaveDocumentHandlerData, PresaveDocumentHandlerError, PresaveDocumentHandlerErrors, PresaveDocumentHandlerResponse, PresaveDocumentHandlerResponses, PreSaveDocumentRequest, PreSaveDocumentResponse, PreSaveDocumentResponseData, PresignedUrl, Project, ProjectDeleteResponseData, ProjectDocumentStatus, ProjectFilters, ProjectPreview, ProjectPreviewData, PropertyDefinition, PropertyFilter, PropertyInput, PropertyOwner, PropertyValue, PutCrmTeamSettingsData, PutCrmTeamSettingsError, PutCrmTeamSettingsErrors, PutCrmTeamSettingsResponse, PutCrmTeamSettingsResponses, ReactionAction, RecentlyDeletedData, RecentlyDeletedError, RecentlyDeletedErrors, RecentlyDeletedResponse, RecentlyDeletedResponseData, RecentlyDeletedResponses, Reminder, ReminderFilters, ReminderSchedule, RemindersList, RemoveBotFromChannelByBotData, RemoveBotFromChannelByBotError, RemoveBotFromChannelByBotErrors, RemoveBotFromChannelByBotResponse, RemoveBotFromChannelByBotResponses, RemoveFavoriteByEntityData, RemoveFavoriteByEntityError, RemoveFavoriteByEntityErrors, RemoveFavoriteByEntityResponses, RemoveParticipantsData, RemoveParticipantsError, RemoveParticipantsErrors, RemoveParticipantsRequest, RemoveParticipantsResponses, RemovePinHandlerData, RemovePinHandlerError, RemovePinHandlerErrors, RemovePinHandlerResponse, RemovePinHandlerResponses, ReorderFavoritesData, ReorderFavoritesError, ReorderFavoritesErrors, ReorderFavoritesRequest, ReorderFavoritesResponses, ReorderPinRequest, ReorderPinsHandlerData, ReorderPinsHandlerError, ReorderPinsHandlerErrors, ReorderPinsHandlerResponse, ReorderPinsHandlerResponses, RequestedHarnessScope, ResolveChannelMessageData, ResolveChannelMessageError, ResolveChannelMessageErrors, ResolveChannelMessageResponse, ResolveChannelMessageResponses, RevertDeleteDocumentData, RevertDeleteDocumentError, RevertDeleteDocumentErrors, RevertDeleteDocumentResponse, RevertDeleteDocumentResponses, RevertDeleteProjectData, RevertDeleteProjectError, RevertDeleteProjectErrors, RevertDeleteProjectResponse, RevertDeleteProjectResponses, RingStatus, RingStatusResponse, S3ObjectInfo, SaveBomPart, SaveDocumentHandlerData, SaveDocumentHandlerError, SaveDocumentHandlerErrors, SaveDocumentHandlerResponse, SaveDocumentHandlerResponses, SaveDocumentRequest, SaveDocumentResponse, SaveDocumentResponseData, SetCompanyHiddenData, SetCompanyHiddenError, SetCompanyHiddenErrors, SetCompanyHiddenRequest, SetCompanyHiddenResponse, SetCompanyHiddenResponses, SetCompanyNameRequest, SetContactHiddenData, SetContactHiddenError, SetContactHiddenErrors, SetContactHiddenRequest, SetContactHiddenResponse, SetContactHiddenResponses, SetContactNameRequest, SetCrmCompanyNameData, SetCrmCompanyNameError, SetCrmCompanyNameErrors, SetCrmCompanyNameResponse, SetCrmCompanyNameResponses, SetCrmContactNameData, SetCrmContactNameError, SetCrmContactNameErrors, SetCrmContactNameResponse, SetCrmContactNameResponses, SetDocumentTeamShareData, SetDocumentTeamShareError, SetDocumentTeamShareErrors, SetDocumentTeamShareRequest, SetDocumentTeamShareResponse, SetDocumentTeamShareResponses, SetEmailSyncData, SetEmailSyncError, SetEmailSyncErrors, SetEmailSyncRequest, SetEmailSyncResponse, SetEmailSyncResponses, SetPropertyValue, SharedEmailFilter, SharePermissionV2, ShortIdResponse, SimpleMention, SimpleSaveData, SimpleSaveError, SimpleSaveErrors, SimpleSaveResponse, SimpleSaveResponses, SoupApiItem, SoupApiSort, SoupApiSortDirection, SoupAttachment, SoupCalendarEventSoupPropertiesField, SoupCalendarEventTime, SoupCallRecordParticipant, SoupCallRecordSoupPropertiesField, SoupChannel, SoupChannelThread, SoupChatSoupPropertiesField, SoupContact, SoupCountedReaction, SoupCrmCompanySoupPropertiesField, SoupCrmDomain, SoupDocumentSoupPropertiesField, SoupDocumentSubType, SoupEmailThreadPreview, SoupEnrichedEmailThreadPreviewSoupPropertiesField, SoupForeignEntity, SoupItem, SoupLabel, SoupLabelListVisibility, SoupLabelType, SoupMessageAttachment, SoupMessageListVisibility, SoupMessageSender, SoupMessageSenderType, SoupPage, SoupProjectSoupPropertiesField, SoupPropertiesField, SoupProperty, SoupReminderReference, SoupReminderSchedule, SoupReminderSoupPropertiesField, SoupThreadInfo, SoupThreadReply, StarterDocumentsResponse, String, SuccessResponse, SurfaceState, SyncServiceVersionId, SystemSkillSummary, TagFilterMode, TaskFilters, TeamRole, Thread, ThreadResponse, ToggleShareWithTeamData, ToggleShareWithTeamError, ToggleShareWithTeamErrors, ToggleShareWithTeamResponse, ToggleShareWithTeamResponses, TranscriptSegmentRequest, TypedSuccessResponse, TypedSuccessResponseGetDocumentResponseData, TypingAction, UnthreadedPdfUuidRequest, UpdateAgentData, UpdateAgentError, UpdateAgentErrors, UpdateAgentRequest, UpdateAgentResponse, UpdateAgentResponses, UpdateChannelSharePermission, UpdateCrmTeamSettingsRequest, UpdateOperation, UpdateReminderData, UpdateReminderError, UpdateReminderErrors, UpdateReminderRequest, UpdateReminderResponse, UpdateReminderResponses, UpdateSharePermissionRequestV2, UploadDocumentStatus, UploadExtractFolderHandlerData, UploadExtractFolderHandlerError, UploadExtractFolderHandlerErrors, UploadExtractFolderHandlerResponse, UploadExtractFolderHandlerResponses, UploadExtractFolderRequest, UploadFolderHandlerData, UploadFolderHandlerError, UploadFolderHandlerErrors, UploadFolderHandlerResponse, UploadFolderHandlerResponses, UploadFolderRequest, UpsertHistoryHandlerData, UpsertHistoryHandlerError, UpsertHistoryHandlerErrors, UpsertHistoryHandlerResponse, UpsertHistoryHandlerResponses, UpsertUserDocumentViewLocationData, UpsertUserDocumentViewLocationError, UpsertUserDocumentViewLocationErrors, UpsertUserDocumentViewLocationRequest, UpsertUserDocumentViewLocationResponse, UpsertUserDocumentViewLocationResponses, UserApiKeyId, UserApiKeyInfo, UserApiKeysList, UserDocumentsResponse, UserDocumentViewLocation, UserDocumentViewLocationResponse, UserPinsResponse, UserViewsResponse, ValidateDocumentPermissionsTokenData, ValidateDocumentPermissionsTokenError, ValidateDocumentPermissionsTokenErrors, ValidateDocumentPermissionsTokenResponse, ValidateDocumentPermissionsTokenResponses, ValidateWebhookData, ValidateWebhookError, ValidateWebhookErrors, ValidateWebhookResponse, ValidateWebhookResponse2, ValidateWebhookResponses, Vec, View, ViewPatch, ViewsResponse, Webhook, WebhookEvent, WebhookFilter, WebhookScope, WebhookStatus, WebhookValidationTestEvent, WithCallId, WithChannelId, WithDocumentId, WithProjectId } from './types.gen';diff --git a/packages/sdk/generated/storage/sdk.gen.ts b/packages/sdk/generated/storage/sdk.gen.tsindex 1a99837c8c..70e61c57b0 100644--- a/packages/sdk/generated/storage/sdk.gen.ts+++ b/packages/sdk/generated/storage/sdk.gen.ts@@ -2,7 +2,7 @@import type { Client, ClientMeta, Options as Options2, RequestResult, TDataShape } from './client';import { client } from './client.gen';-import type { AddFavoriteData, AddFavoriteErrors, AddFavoriteResponses, AddParticipantsData, AddParticipantsErrors, AddParticipantsResponses, AddPinHandlerData, AddPinHandlerErrors, AddPinHandlerResponses, ApproveHarnessPairingData, ApproveHarnessPairingErrors, ApproveHarnessPairingResponses, BulkWakeupSyncServiceDocumentsData, BulkWakeupSyncServiceDocumentsErrors, BulkWakeupSyncServiceDocumentsResponses, CallWebhookData, CallWebhookErrors, CallWebhookResponses, CheckActiveCallData, CheckActiveCallErrors, CheckActiveCallResponses, ClaimHarnessPairingData, ClaimHarnessPairingErrors, ClaimHarnessPairingResponses, CopyDocumentData, CopyDocumentErrors, CopyDocumentResponses, CreateAgentData, CreateAgentErrors, CreateAgentResponses, CreateAnchorData, CreateAnchorErrors, CreateAnchorResponses, CreateChannelData, CreateChannelErrors, CreateChannelResponses, CreateChannelScopedBotData, CreateChannelScopedBotErrors, CreateChannelScopedBotResponses, CreateCollabSurfaceTokenData, CreateCollabSurfaceTokenErrors, CreateCollabSurfaceTokenResponses, CreateCommentData, CreateCommentErrors, CreateCommentResponses, CreateCrmCommentData, CreateCrmCommentErrors, CreateCrmCommentResponses, CreateCrmCompanyData, CreateCrmCompanyErrors, CreateCrmCompanyResponses, CreateCrmContactData, CreateCrmContactErrors, CreateCrmContactResponses, CreateDocumentData, CreateDocumentErrors, CreateDocumentResponses, CreateEntityMentionData, CreateEntityMentionErrors, CreateEntityMentionResponses, CreateHarnessPairingData, CreateHarnessPairingErrors, CreateHarnessPairingResponses, CreateInstructionsHandlerData, CreateInstructionsHandlerErrors, CreateInstructionsHandlerResponses, CreateMarkdownHandlerData, CreateMarkdownHandlerErrors, CreateMarkdownHandlerResponses, CreateProjectHandlerData, CreateProjectHandlerErrors, CreateProjectHandlerResponses, CreateReminderData, CreateReminderErrors, CreateReminderResponses, CreateSkillHandlerData, CreateSkillHandlerErrors, CreateSkillHandlerResponses, CreateSnippetHandlerData, CreateSnippetHandlerErrors, CreateSnippetHandlerResponses, CreateTaskHandlerData, CreateTaskHandlerErrors, CreateTaskHandlerResponses, CreateUserApiKeyData, CreateUserApiKeyErrors, CreateUserApiKeyResponses, CreateViewHandlerData, CreateViewHandlerErrors, CreateViewHandlerResponses, CreateWebhookData, CreateWebhookErrors, CreateWebhookResponses, DeleteAnchorData, DeleteAnchorErrors, DeleteAnchorResponses, DeleteCallRecordData, DeleteCallRecordErrors, DeleteCallRecordResponses, DeleteChannelData, DeleteChannelErrors, DeleteChannelResponses, DeleteCollabSurfaceData, DeleteCollabSurfaceErrors, DeleteCollabSurfaceResponses, DeleteCommentData, DeleteCommentErrors, DeleteCommentResponses, DeleteCrmCommentData, DeleteCrmCommentErrors, DeleteCrmCommentResponses, DeleteDocumentData, DeleteDocumentErrors, DeleteDocumentResponses, DeleteEntityMentionData, DeleteEntityMentionErrors, DeleteEntityMentionResponses, DeleteHarnessData, DeleteHarnessErrors, DeleteHarnessResponses, DeleteHistoryHandlerData, DeleteHistoryHandlerErrors, DeleteHistoryHandlerResponses, DeleteMessageData, DeleteMessageErrors, DeleteMessageResponses, DeleteProjectHandlerData, DeleteProjectHandlerErrors, DeleteProjectHandlerResponses, DeleteReminderData, DeleteReminderErrors, DeleteReminderResponses, DeleteUserApiKeyData, DeleteUserApiKeyErrors, DeleteUserApiKeyResponses, DeleteUserDocumentViewLocationData, DeleteUserDocumentViewLocationErrors, DeleteUserDocumentViewLocationResponses, DeleteViewHandlerData, DeleteViewHandlerErrors, DeleteViewHandlerResponses, DeleteWebhookData, DeleteWebhookErrors, DeleteWebhookResponses, EditAnchorData, EditAnchorErrors, EditAnchorResponses, EditCallRecordData, EditCallRecordErrors, EditCallRecordResponses, EditCallTranscriptData, EditCallTranscriptErrors, EditCallTranscriptResponses, EditCommentData, EditCommentErrors, EditCommentResponses, EditCrmCommentData, EditCrmCommentErrors, EditCrmCommentResponses, EditDocumentData, EditDocumentErrors, EditDocumentResponses, EditProjectV2Data, EditProjectV2Errors, EditProjectV2Responses, EditThreadV2Data, EditThreadV2Errors, EditThreadV2Responses, EnsureCollabSurfaceData, EnsureCollabSurfaceErrors, EnsureCollabSurfaceResponses, ExcludeDefaultViewHandlerData, ExcludeDefaultViewHandlerErrors, ExcludeDefaultViewHandlerResponses, ExportDocumentData, ExportDocumentErrors, ExportDocumentResponses, GetActiveCallsData, GetActiveCallsErrors, GetActiveCallsResponses, GetActivityData, GetActivityErrors, GetActivityResponses, GetAttachmentReferencesData, GetAttachmentReferencesErrors, GetAttachmentReferencesResponses, GetBatchCallRecordPreviewData, GetBatchCallRecordPreviewErrors, GetBatchCallRecordPreviewResponses, GetBatchChannelPreviewData, GetBatchChannelPreviewErrors, GetBatchChannelPreviewResponses, GetBatchPreviewHandlerData, GetBatchPreviewHandlerErrors, GetBatchPreviewHandlerResponses, GetBatchProjectPreviewData, GetBatchProjectPreviewErrors, GetBatchProjectPreviewResponses, GetCallRecordData, GetCallRecordErrors, GetCallRecordResponses, GetChannelAttachmentsData, GetChannelAttachmentsErrors, GetChannelAttachmentsResponses, GetChannelData, GetChannelErrors, GetChannelJoinLinkData, GetChannelJoinLinkErrors, GetChannelJoinLinkResponses, GetChannelMessagesData, GetChannelMessagesErrors, GetChannelMessagesResponses, GetChannelParticipantsData, GetChannelParticipantsErrors, GetChannelParticipantsResponses, GetChannelResponses, GetChannelsData, GetChannelsErrors, GetChannelsResponses, GetCollabSurfaceData, GetCollabSurfaceErrors, GetCollabSurfaceResponses, GetCompanyData, GetCompanyErrors, GetCompanyResponses, GetContactByEmailData, GetContactByEmailErrors, GetContactByEmailResponses, GetContactData, GetContactErrors, GetContactResponses, GetCrmTeamSettingsData, GetCrmTeamSettingsErrors, GetCrmTeamSettingsResponses, GetDocumentAnchorsData, GetDocumentAnchorsErrors, GetDocumentAnchorsResponses, GetDocumentBranchNameData, GetDocumentBranchNameErrors, GetDocumentBranchNameResponses, GetDocumentByTeamSlugData, GetDocumentByTeamSlugErrors, GetDocumentByTeamSlugResponses, GetDocumentCommentsData, GetDocumentCommentsErrors, GetDocumentCommentsResponses, GetDocumentData, GetDocumentErrors, GetDocumentGithubPullRequestsData, GetDocumentGithubPullRequestsErrors, GetDocumentGithubPullRequestsResponses, GetDocumentListHandlerData, GetDocumentListHandlerErrors, GetDocumentListHandlerResponses, GetDocumentLocationV3Data, GetDocumentLocationV3Errors, GetDocumentLocationV3Responses, GetDocumentPermissionsTokenData, GetDocumentPermissionsTokenErrors, GetDocumentPermissionsTokenResponses, GetDocumentPermissionsV2Data, GetDocumentPermissionsV2Errors, GetDocumentPermissionsV2Responses, GetDocumentProcessingResultData, GetDocumentProcessingResultErrors, GetDocumentProcessingResultResponses, GetDocumentResponses, GetDocumentShortIdData, GetDocumentShortIdErrors, GetDocumentShortIdResponses, GetDocumentTeamShareData, GetDocumentTeamShareErrors, GetDocumentTeamShareResponses, GetDocumentVersionData, GetDocumentVersionErrors, GetDocumentVersionResponses, GetDocumentViewsHandlerData, GetDocumentViewsHandlerErrors, GetDocumentViewsHandlerResponses, GetEntityPermissionData, GetEntityPermissionErrors, GetEntityPermissionResponses, GetForeignEntityData, GetForeignEntityErrors, GetForeignEntityResponses, GetHarnessPairingData, GetHarnessPairingErrors, GetHarnessPairingResponses, GetHistoryHandlerData, GetHistoryHandlerErrors, GetHistoryHandlerResponses, GetInstructionsHandlerData, GetInstructionsHandlerErrors, GetInstructionsHandlerResponses, GetItemsSoupData, GetItemsSoupErrors, GetItemsSoupResponses, GetLocationHandlerData, GetLocationHandlerErrors, GetLocationHandlerResponses, GetMessageWithContextData, GetMessageWithContextErrors, GetMessageWithContextResponses, GetOrCreateCallData, GetOrCreateCallErrors, GetOrCreateCallResponses, GetOrCreateDmData, GetOrCreateDmErrors, GetOrCreateDmResponses, GetOrCreatePrivateData, GetOrCreatePrivateErrors, GetOrCreatePrivateResponses, GetPendingProjectsHandlerData, GetPendingProjectsHandlerErrors, GetPendingProjectsHandlerResponses, GetPinsHandlerData, GetPinsHandlerErrors, GetPinsHandlerResponses, GetProjectContentHandlerData, GetProjectContentHandlerErrors, GetProjectContentHandlerResponses, GetProjectHandlerData, GetProjectHandlerErrors, GetProjectHandlerResponses, GetProjectPermissionsV2Data, GetProjectPermissionsV2Errors, GetProjectPermissionsV2Responses, GetProjectsHandlerData, GetProjectsHandlerErrors, GetProjectsHandlerResponses, GetProjectUserAccessLevelData, GetProjectUserAccessLevelErrors, GetProjectUserAccessLevelResponses, GetReminderData, GetReminderErrors, GetReminderResponses, GetRingStatusData, GetRingStatusErrors, GetRingStatusResponses, GetSelfBotData, GetSelfBotErrors, GetSelfBotResponses, GetSystemSkillsHandlerData, GetSystemSkillsHandlerErrors, GetSystemSkillsHandlerResponses, GetThreadRepliesData, GetThreadRepliesErrors, GetThreadRepliesResponses, GetUserDocumentsHandlerData, GetUserDocumentsHandlerErrors, GetUserDocumentsHandlerResponses, GetUserDocumentViewLocationData, GetUserDocumentViewLocationErrors, GetUserDocumentViewLocationResponses, GetViewsHandlerData, GetViewsHandlerErrors, GetViewsHandlerResponses, GetWebhookData, GetWebhookErrors, GetWebhookResponses, HandlerData, HandlerErrors, HandlerResponses, HealthHandlerData, HealthHandlerResponses, IngestTranscriptData, IngestTranscriptErrors, IngestTranscriptResponses, InitializeUserDocumentsData, InitializeUserDocumentsErrors, InitializeUserDocumentsResponses, InstallSyncData, InstallSyncErrors, JobProcessingResultHandlerData, JobProcessingResultHandlerErrors, JobProcessingResultHandlerResponses, JoinChannelByCodeData, JoinChannelByCodeErrors, JoinChannelByCodeResponses, JoinChannelData, JoinChannelErrors, JoinChannelResponses, LeaveChannelData, LeaveChannelErrors, LeaveChannelResponses, LeaveOrEndCallData, LeaveOrEndCallErrors, LeaveOrEndCallResponses, ListAgentsData, ListAgentsErrors, ListAgentsResponses, ListBotChannelsData, ListBotChannelsErrors, ListBotChannelsResponses, ListCompanyContactsData, ListCompanyContactsErrors, ListCompanyContactsResponses, ListCrmCommentsData, ListCrmCommentsErrors, ListCrmCommentsResponses, ListFavoritesData, ListFavoritesErrors, ListFavoritesResponses, ListHarnessAgentsData, ListHarnessAgentsErrors, ListHarnessAgentsResponses, ListHarnessesData, ListHarnessesErrors, ListHarnessesResponses, ListOccurrencesData, ListOccurrencesErrors, ListOccurrencesResponses, ListRemindersData, ListRemindersErrors, ListRemindersResponses, ListUserApiKeysData, ListUserApiKeysErrors, ListUserApiKeysResponses, ListWebhooksData, ListWebhooksErrors, ListWebhooksResponses, MentionPreviewsData, MentionPreviewsErrors, MentionPreviewsResponses, PatchChannelData, PatchChannelErrors, PatchChannelResponses, PatchMessageData, PatchMessageErrors, PatchMessageResponses, PatchViewHandlerData, PatchViewHandlerErrors, PatchViewHandlerResponses, PatchWebhookData, PatchWebhookErrors, PatchWebhookResponses, PermanentlyDeleteDocumentData, PermanentlyDeleteDocumentErrors, PermanentlyDeleteDocumentResponses, PermanentlyDeleteProjectData, PermanentlyDeleteProjectErrors, PermanentlyDeleteProjectResponses, PostActivityData, PostActivityErrors, PostActivityResponses, PostChannelBotWebhookData, PostChannelBotWebhookErrors, PostChannelBotWebhookResponses, PostChannelMessagesData, PostChannelMessagesErrors, PostChannelMessagesResponses, PostItemsSoupAstData, PostItemsSoupAstErrors, PostItemsSoupAstGroupedData, PostItemsSoupAstGroupedErrors, PostItemsSoupAstGroupedResponses, PostItemsSoupAstResponses, PostItemsSoupData, PostItemsSoupErrors, PostItemsSoupResponses, PostMessageData, PostMessageErrors, PostMessageResponses, PostReactionData, PostReactionErrors, PostReactionResponses, PostTypingData, PostTypingErrors, PostTypingResponses, PresaveDocumentHandlerData, PresaveDocumentHandlerErrors, PresaveDocumentHandlerResponses, PutCrmTeamSettingsData, PutCrmTeamSettingsErrors, PutCrmTeamSettingsResponses, RecentlyDeletedData, RecentlyDeletedErrors, RecentlyDeletedResponses, RemoveBotFromChannelByBotData, RemoveBotFromChannelByBotErrors, RemoveBotFromChannelByBotResponses, RemoveFavoriteByEntityData, RemoveFavoriteByEntityErrors, RemoveFavoriteByEntityResponses, RemoveParticipantsData, RemoveParticipantsErrors, RemoveParticipantsResponses, RemovePinHandlerData, RemovePinHandlerErrors, RemovePinHandlerResponses, ReorderFavoritesData, ReorderFavoritesErrors, ReorderFavoritesResponses, ReorderPinsHandlerData, ReorderPinsHandlerErrors, ReorderPinsHandlerResponses, ResolveChannelMessageData, ResolveChannelMessageErrors, ResolveChannelMessageResponses, RevertDeleteDocumentData, RevertDeleteDocumentErrors, RevertDeleteDocumentResponses, RevertDeleteProjectData, RevertDeleteProjectErrors, RevertDeleteProjectResponses, SaveDocumentHandlerData, SaveDocumentHandlerErrors, SaveDocumentHandlerResponses, SetCompanyHiddenData, SetCompanyHiddenErrors, SetCompanyHiddenResponses, SetContactHiddenData, SetContactHiddenErrors, SetContactHiddenResponses, SetCrmCompanyNameData, SetCrmCompanyNameErrors, SetCrmCompanyNameResponses, SetCrmContactNameData, SetCrmContactNameErrors, SetCrmContactNameResponses, SetDocumentTeamShareData, SetDocumentTeamShareErrors, SetDocumentTeamShareResponses, SetEmailSyncData, SetEmailSyncErrors, SetEmailSyncResponses, SimpleSaveData, SimpleSaveErrors, SimpleSaveResponses, ToggleShareWithTeamData, ToggleShareWithTeamErrors, ToggleShareWithTeamResponses, UpdateAgentData, UpdateAgentErrors, UpdateAgentResponses, UpdateReminderData, UpdateReminderErrors, UpdateReminderResponses, UploadExtractFolderHandlerData, UploadExtractFolderHandlerErrors, UploadExtractFolderHandlerResponses, UploadFolderHandlerData, UploadFolderHandlerErrors, UploadFolderHandlerResponses, UpsertHistoryHandlerData, UpsertHistoryHandlerErrors, UpsertHistoryHandlerResponses, UpsertUserDocumentViewLocationData, UpsertUserDocumentViewLocationErrors, UpsertUserDocumentViewLocationResponses, ValidateDocumentPermissionsTokenData, ValidateDocumentPermissionsTokenErrors, ValidateDocumentPermissionsTokenResponses, ValidateWebhookData, ValidateWebhookErrors, ValidateWebhookResponses } from './types.gen';+import type { AddFavoriteData, AddFavoriteErrors, AddFavoriteResponses, AddParticipantsData, AddParticipantsErrors, AddParticipantsResponses, AddPinHandlerData, AddPinHandlerErrors, AddPinHandlerResponses, ApproveHarnessPairingData, ApproveHarnessPairingErrors, ApproveHarnessPairingResponses, BulkWakeupSyncServiceDocumentsData, BulkWakeupSyncServiceDocumentsErrors, BulkWakeupSyncServiceDocumentsResponses, CallWebhookData, CallWebhookErrors, CallWebhookResponses, CheckActiveCallData, CheckActiveCallErrors, CheckActiveCallResponses, ClaimHarnessPairingData, ClaimHarnessPairingErrors, ClaimHarnessPairingResponses, CopyDocumentData, CopyDocumentErrors, CopyDocumentResponses, CreateAgentData, CreateAgentErrors, CreateAgentResponses, CreateAnchorData, CreateAnchorErrors, CreateAnchorResponses, CreateChannelData, CreateChannelErrors, CreateChannelResponses, CreateChannelScopedBotData, CreateChannelScopedBotErrors, CreateChannelScopedBotResponses, CreateCollabSurfaceTokenData, CreateCollabSurfaceTokenErrors, CreateCollabSurfaceTokenResponses, CreateCommentData, CreateCommentErrors, CreateCommentResponses, CreateCrmCommentData, CreateCrmCommentErrors, CreateCrmCommentResponses, CreateCrmCompanyData, CreateCrmCompanyErrors, CreateCrmCompanyResponses, CreateCrmContactData, CreateCrmContactErrors, CreateCrmContactResponses, CreateDocumentData, CreateDocumentErrors, CreateDocumentResponses, CreateEntityMentionData, CreateEntityMentionErrors, CreateEntityMentionResponses, CreateHarnessPairingData, CreateHarnessPairingErrors, CreateHarnessPairingResponses, CreateInstructionsHandlerData, CreateInstructionsHandlerErrors, CreateInstructionsHandlerResponses, CreateMarkdownHandlerData, CreateMarkdownHandlerErrors, CreateMarkdownHandlerResponses, CreateProjectHandlerData, CreateProjectHandlerErrors, CreateProjectHandlerResponses, CreateReminderData, CreateReminderErrors, CreateReminderResponses, CreateSkillHandlerData, CreateSkillHandlerErrors, CreateSkillHandlerResponses, CreateSnippetHandlerData, CreateSnippetHandlerErrors, CreateSnippetHandlerResponses, CreateTaskHandlerData, CreateTaskHandlerErrors, CreateTaskHandlerResponses, CreateUserApiKeyData, CreateUserApiKeyErrors, CreateUserApiKeyResponses, CreateViewHandlerData, CreateViewHandlerErrors, CreateViewHandlerResponses, CreateWebhookData, CreateWebhookErrors, CreateWebhookResponses, DeleteAnchorData, DeleteAnchorErrors, DeleteAnchorResponses, DeleteCallRecordData, DeleteCallRecordErrors, DeleteCallRecordResponses, DeleteChannelData, DeleteChannelErrors, DeleteChannelResponses, DeleteCollabSurfaceData, DeleteCollabSurfaceErrors, DeleteCollabSurfaceResponses, DeleteCommentData, DeleteCommentErrors, DeleteCommentResponses, DeleteCrmCommentData, DeleteCrmCommentErrors, DeleteCrmCommentResponses, DeleteDocumentData, DeleteDocumentErrors, DeleteDocumentResponses, DeleteEntityMentionData, DeleteEntityMentionErrors, DeleteEntityMentionResponses, DeleteHarnessData, DeleteHarnessErrors, DeleteHarnessResponses, DeleteHistoryHandlerData, DeleteHistoryHandlerErrors, DeleteHistoryHandlerResponses, DeleteMessageData, DeleteMessageErrors, DeleteMessageResponses, DeleteProjectHandlerData, DeleteProjectHandlerErrors, DeleteProjectHandlerResponses, DeleteReminderData, DeleteReminderErrors, DeleteReminderResponses, DeleteSelfHarnessData, DeleteSelfHarnessErrors, DeleteSelfHarnessResponses, DeleteUserApiKeyData, DeleteUserApiKeyErrors, DeleteUserApiKeyResponses, DeleteUserDocumentViewLocationData, DeleteUserDocumentViewLocationErrors, DeleteUserDocumentViewLocationResponses, DeleteViewHandlerData, DeleteViewHandlerErrors, DeleteViewHandlerResponses, DeleteWebhookData, DeleteWebhookErrors, DeleteWebhookResponses, EditAnchorData, EditAnchorErrors, EditAnchorResponses, EditCallRecordData, EditCallRecordErrors, EditCallRecordResponses, EditCallTranscriptData, EditCallTranscriptErrors, EditCallTranscriptResponses, EditCommentData, EditCommentErrors, EditCommentResponses, EditCrmCommentData, EditCrmCommentErrors, EditCrmCommentResponses, EditDocumentData, EditDocumentErrors, EditDocumentResponses, EditProjectV2Data, EditProjectV2Errors, EditProjectV2Responses, EditThreadV2Data, EditThreadV2Errors, EditThreadV2Responses, EnsureCollabSurfaceData, EnsureCollabSurfaceErrors, EnsureCollabSurfaceResponses, ExcludeDefaultViewHandlerData, ExcludeDefaultViewHandlerErrors, ExcludeDefaultViewHandlerResponses, ExportDocumentData, ExportDocumentErrors, ExportDocumentResponses, GetActiveCallsData, GetActiveCallsErrors, GetActiveCallsResponses, GetActivityData, GetActivityErrors, GetActivityResponses, GetAttachmentReferencesData, GetAttachmentReferencesErrors, GetAttachmentReferencesResponses, GetBatchCallRecordPreviewData, GetBatchCallRecordPreviewErrors, GetBatchCallRecordPreviewResponses, GetBatchChannelPreviewData, GetBatchChannelPreviewErrors, GetBatchChannelPreviewResponses, GetBatchPreviewHandlerData, GetBatchPreviewHandlerErrors, GetBatchPreviewHandlerResponses, GetBatchProjectPreviewData, GetBatchProjectPreviewErrors, GetBatchProjectPreviewResponses, GetCallRecordData, GetCallRecordErrors, GetCallRecordResponses, GetChannelAttachmentsData, GetChannelAttachmentsErrors, GetChannelAttachmentsResponses, GetChannelData, GetChannelErrors, GetChannelJoinLinkData, GetChannelJoinLinkErrors, GetChannelJoinLinkResponses, GetChannelMessagesData, GetChannelMessagesErrors, GetChannelMessagesResponses, GetChannelParticipantsData, GetChannelParticipantsErrors, GetChannelParticipantsResponses, GetChannelResponses, GetChannelsData, GetChannelsErrors, GetChannelsResponses, GetCollabSurfaceData, GetCollabSurfaceErrors, GetCollabSurfaceResponses, GetCompanyData, GetCompanyErrors, GetCompanyResponses, GetContactByEmailData, GetContactByEmailErrors, GetContactByEmailResponses, GetContactData, GetContactErrors, GetContactResponses, GetCrmTeamSettingsData, GetCrmTeamSettingsErrors, GetCrmTeamSettingsResponses, GetDocumentAnchorsData, GetDocumentAnchorsErrors, GetDocumentAnchorsResponses, GetDocumentBranchNameData, GetDocumentBranchNameErrors, GetDocumentBranchNameResponses, GetDocumentByTeamSlugData, GetDocumentByTeamSlugErrors, GetDocumentByTeamSlugResponses, GetDocumentCommentsData, GetDocumentCommentsErrors, GetDocumentCommentsResponses, GetDocumentData, GetDocumentErrors, GetDocumentGithubPullRequestsData, GetDocumentGithubPullRequestsErrors, GetDocumentGithubPullRequestsResponses, GetDocumentListHandlerData, GetDocumentListHandlerErrors, GetDocumentListHandlerResponses, GetDocumentLocationV3Data, GetDocumentLocationV3Errors, GetDocumentLocationV3Responses, GetDocumentPermissionsTokenData, GetDocumentPermissionsTokenErrors, GetDocumentPermissionsTokenResponses, GetDocumentPermissionsV2Data, GetDocumentPermissionsV2Errors, GetDocumentPermissionsV2Responses, GetDocumentProcessingResultData, GetDocumentProcessingResultErrors, GetDocumentProcessingResultResponses, GetDocumentResponses, GetDocumentShortIdData, GetDocumentShortIdErrors, GetDocumentShortIdResponses, GetDocumentTeamShareData, GetDocumentTeamShareErrors, GetDocumentTeamShareResponses, GetDocumentVersionData, GetDocumentVersionErrors, GetDocumentVersionResponses, GetDocumentViewsHandlerData, GetDocumentViewsHandlerErrors, GetDocumentViewsHandlerResponses, GetEntityPermissionData, GetEntityPermissionErrors, GetEntityPermissionResponses, GetForeignEntityData, GetForeignEntityErrors, GetForeignEntityResponses, GetHarnessPairingData, GetHarnessPairingErrors, GetHarnessPairingResponses, GetHistoryHandlerData, GetHistoryHandlerErrors, GetHistoryHandlerResponses, GetInstructionsHandlerData, GetInstructionsHandlerErrors, GetInstructionsHandlerResponses, GetItemsSoupData, GetItemsSoupErrors, GetItemsSoupResponses, GetLocationHandlerData, GetLocationHandlerErrors, GetLocationHandlerResponses, GetMessageWithContextData, GetMessageWithContextErrors, GetMessageWithContextResponses, GetOrCreateCallData, GetOrCreateCallErrors, GetOrCreateCallResponses, GetOrCreateDmData, GetOrCreateDmErrors, GetOrCreateDmResponses, GetOrCreatePrivateData, GetOrCreatePrivateErrors, GetOrCreatePrivateResponses, GetPendingProjectsHandlerData, GetPendingProjectsHandlerErrors, GetPendingProjectsHandlerResponses, GetPinsHandlerData, GetPinsHandlerErrors, GetPinsHandlerResponses, GetProjectContentHandlerData, GetProjectContentHandlerErrors, GetProjectContentHandlerResponses, GetProjectHandlerData, GetProjectHandlerErrors, GetProjectHandlerResponses, GetProjectPermissionsV2Data, GetProjectPermissionsV2Errors, GetProjectPermissionsV2Responses, GetProjectsHandlerData, GetProjectsHandlerErrors, GetProjectsHandlerResponses, GetProjectUserAccessLevelData, GetProjectUserAccessLevelErrors, GetProjectUserAccessLevelResponses, GetReminderData, GetReminderErrors, GetReminderResponses, GetRingStatusData, GetRingStatusErrors, GetRingStatusResponses, GetSelfBotData, GetSelfBotErrors, GetSelfBotResponses, GetSelfHarnessData, GetSelfHarnessErrors, GetSelfHarnessResponses, GetSystemSkillsHandlerData, GetSystemSkillsHandlerErrors, GetSystemSkillsHandlerResponses, GetThreadRepliesData, GetThreadRepliesErrors, GetThreadRepliesResponses, GetUserDocumentsHandlerData, GetUserDocumentsHandlerErrors, GetUserDocumentsHandlerResponses, GetUserDocumentViewLocationData, GetUserDocumentViewLocationErrors, GetUserDocumentViewLocationResponses, GetViewsHandlerData, GetViewsHandlerErrors, GetViewsHandlerResponses, GetWebhookData, GetWebhookErrors, GetWebhookResponses, HandlerData, HandlerErrors, HandlerResponses, HealthHandlerData, HealthHandlerResponses, IngestTranscriptData, IngestTranscriptErrors, IngestTranscriptResponses, InitializeUserDocumentsData, InitializeUserDocumentsErrors, InitializeUserDocumentsResponses, InstallSyncData, InstallSyncErrors, JobProcessingResultHandlerData, JobProcessingResultHandlerErrors, JobProcessingResultHandlerResponses, JoinChannelByCodeData, JoinChannelByCodeErrors, JoinChannelByCodeResponses, JoinChannelData, JoinChannelErrors, JoinChannelResponses, LeaveChannelData, LeaveChannelErrors, LeaveChannelResponses, LeaveOrEndCallData, LeaveOrEndCallErrors, LeaveOrEndCallResponses, ListAgentsData, ListAgentsErrors, ListAgentsResponses, ListBotChannelsData, ListBotChannelsErrors, ListBotChannelsResponses, ListCompanyContactsData, ListCompanyContactsErrors, ListCompanyContactsResponses, ListCrmCommentsData, ListCrmCommentsErrors, ListCrmCommentsResponses, ListFavoritesData, ListFavoritesErrors, ListFavoritesResponses, ListHarnessAgentsData, ListHarnessAgentsErrors, ListHarnessAgentsResponses, ListHarnessesData, ListHarnessesErrors, ListHarnessesResponses, ListHarnessSessionsData, ListHarnessSessionsErrors, ListHarnessSessionsResponses, ListOccurrencesData, ListOccurrencesErrors, ListOccurrencesResponses, ListRemindersData, ListRemindersErrors, ListRemindersResponses, ListUserApiKeysData, ListUserApiKeysErrors, ListUserApiKeysResponses, ListWebhooksData, ListWebhooksErrors, ListWebhooksResponses, MentionPreviewsData, MentionPreviewsErrors, MentionPreviewsResponses, PatchChannelData, PatchChannelErrors, PatchChannelResponses, PatchMessageData, PatchMessageErrors, PatchMessageResponses, PatchViewHandlerData, PatchViewHandlerErrors, PatchViewHandlerResponses, PatchWebhookData, PatchWebhookErrors, PatchWebhookResponses, PermanentlyDeleteDocumentData, PermanentlyDeleteDocumentErrors, PermanentlyDeleteDocumentResponses, PermanentlyDeleteProjectData, PermanentlyDeleteProjectErrors, PermanentlyDeleteProjectResponses, PostActivityData, PostActivityErrors, PostActivityResponses, PostChannelBotWebhookData, PostChannelBotWebhookErrors, PostChannelBotWebhookResponses, PostChannelMessagesData, PostChannelMessagesErrors, PostChannelMessagesResponses, PostItemsSoupAstData, PostItemsSoupAstErrors, PostItemsSoupAstGroupedData, PostItemsSoupAstGroupedErrors, PostItemsSoupAstGroupedResponses, PostItemsSoupAstResponses, PostItemsSoupData, PostItemsSoupErrors, PostItemsSoupResponses, PostMessageData, PostMessageErrors, PostMessageResponses, PostReactionData, PostReactionErrors, PostReactionResponses, PostTypingData, PostTypingErrors, PostTypingResponses, PresaveDocumentHandlerData, PresaveDocumentHandlerErrors, PresaveDocumentHandlerResponses, PutCrmTeamSettingsData, PutCrmTeamSettingsErrors, PutCrmTeamSettingsResponses, RecentlyDeletedData, RecentlyDeletedErrors, RecentlyDeletedResponses, RemoveBotFromChannelByBotData, RemoveBotFromChannelByBotErrors, RemoveBotFromChannelByBotResponses, RemoveFavoriteByEntityData, RemoveFavoriteByEntityErrors, RemoveFavoriteByEntityResponses, RemoveParticipantsData, RemoveParticipantsErrors, RemoveParticipantsResponses, RemovePinHandlerData, RemovePinHandlerErrors, RemovePinHandlerResponses, ReorderFavoritesData, ReorderFavoritesErrors, ReorderFavoritesResponses, ReorderPinsHandlerData, ReorderPinsHandlerErrors, ReorderPinsHandlerResponses, ResolveChannelMessageData, ResolveChannelMessageErrors, ResolveChannelMessageResponses, RevertDeleteDocumentData, RevertDeleteDocumentErrors, RevertDeleteDocumentResponses, RevertDeleteProjectData, RevertDeleteProjectErrors, RevertDeleteProjectResponses, SaveDocumentHandlerData, SaveDocumentHandlerErrors, SaveDocumentHandlerResponses, SetCompanyHiddenData, SetCompanyHiddenErrors, SetCompanyHiddenResponses, SetContactHiddenData, SetContactHiddenErrors, SetContactHiddenResponses, SetCrmCompanyNameData, SetCrmCompanyNameErrors, SetCrmCompanyNameResponses, SetCrmContactNameData, SetCrmContactNameErrors, SetCrmContactNameResponses, SetDocumentTeamShareData, SetDocumentTeamShareErrors, SetDocumentTeamShareResponses, SetEmailSyncData, SetEmailSyncErrors, SetEmailSyncResponses, SimpleSaveData, SimpleSaveErrors, SimpleSaveResponses, ToggleShareWithTeamData, ToggleShareWithTeamErrors, ToggleShareWithTeamResponses, UpdateAgentData, UpdateAgentErrors, UpdateAgentResponses, UpdateReminderData, UpdateReminderErrors, UpdateReminderResponses, UploadExtractFolderHandlerData, UploadExtractFolderHandlerErrors, UploadExtractFolderHandlerResponses, UploadFolderHandlerData, UploadFolderHandlerErrors, UploadFolderHandlerResponses, UpsertHistoryHandlerData, UpsertHistoryHandlerErrors, UpsertHistoryHandlerResponses, UpsertUserDocumentViewLocationData, UpsertUserDocumentViewLocationErrors, UpsertUserDocumentViewLocationResponses, ValidateDocumentPermissionsTokenData, ValidateDocumentPermissionsTokenErrors, ValidateDocumentPermissionsTokenResponses, ValidateWebhookData, ValidateWebhookErrors, ValidateWebhookResponses } from './types.gen';export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options2<TData, ThrowOnError, TResponse> & {/**@@ -1526,6 +1526,22 @@ export class Sdk extends HeyApiClient {return (options?.client ?? this.client).get<ListHarnessesResponses, ListHarnessesErrors, ThrowOnError>({ url: '/harnesses', ...options });}+ /**+ * Handler for `DELETE /harnesses/me`.+ *+ * A daemon retiring itself: the valid credential is the authorization.+ */+ public deleteSelfHarness<ThrowOnError extends boolean = false>(options?: Options<DeleteSelfHarnessData, ThrowOnError>): RequestResult<DeleteSelfHarnessResponses, DeleteSelfHarnessErrors, ThrowOnError> {+ return (options?.client ?? this.client).delete<DeleteSelfHarnessResponses, DeleteSelfHarnessErrors, ThrowOnError>({ url: '/harnesses/me', ...options });+ }++ /**+ * Handler for `GET /harnesses/me`.+ */+ public getSelfHarness<ThrowOnError extends boolean = false>(options?: Options<GetSelfHarnessData, ThrowOnError>): RequestResult<GetSelfHarnessResponses, GetSelfHarnessErrors, ThrowOnError> {+ return (options?.client ?? this.client).get<GetSelfHarnessResponses, GetSelfHarnessErrors, ThrowOnError>({ url: '/harnesses/me', ...options });+ }+/*** Handler for `GET /harnesses/me/agents`.*/@@ -1533,6 +1549,13 @@ export class Sdk extends HeyApiClient {return (options?.client ?? this.client).get<ListHarnessAgentsResponses, ListHarnessAgentsErrors, ThrowOnError>({ url: '/harnesses/me/agents', ...options });}+ /**+ * Handler for `GET /harnesses/me/sessions`.+ */+ public listHarnessSessions<ThrowOnError extends boolean = false>(options?: Options<ListHarnessSessionsData, ThrowOnError>): RequestResult<ListHarnessSessionsResponses, ListHarnessSessionsErrors, ThrowOnError> {+ return (options?.client ?? this.client).get<ListHarnessSessionsResponses, ListHarnessSessionsErrors, ThrowOnError>({ url: '/harnesses/me/sessions', ...options });+ }+/*** Handler for `DELETE /harnesses/{harness_id}`.*/diff --git a/packages/sdk/generated/storage/types.gen.ts b/packages/sdk/generated/storage/types.gen.tsindex 53870054a1..09b3ef6ec8 100644--- a/packages/sdk/generated/storage/types.gen.ts+++ b/packages/sdk/generated/storage/types.gen.ts@@ -5904,6 +5904,52 @@ export type HarnessOwner = {type: 'team';};+/**+ * An agent session running on a harness, as listed for the daemon's UI.+ */+export type HarnessSession = {+ /**+ * The agent's `@` handle.+ */+ bot_handle: string;+ /**+ * The agent the session runs for.+ */+ bot_id: BotId;+ /**+ * The agent's display name.+ */+ bot_name: string;+ /**+ * Creation timestamp.+ */+ created_at: string;+ /**+ * Model the session was opened with.+ */+ model: string;+ /**+ * Last-activity timestamp.+ */+ modified_at: string;+ /**+ * The session's display name.+ */+ name: string;+ /**+ * The user the session belongs to.+ */+ owner_id: string;+ /**+ * The session id.+ */+ session_id: string;+ /**+ * Session lifecycle status, e.g. `no_messages`, `active`.+ */+ status: string;+};+export type HashMap = {[key: string]: (PresignedUrl & {type: 'external';@@ -12574,6 +12620,48 @@ export type ListHarnessesResponses = {export type ListHarnessesResponse = ListHarnessesResponses[keyof ListHarnessesResponses];+export type DeleteSelfHarnessData = {+ body?: never;+ path?: never;+ query?: never;+ url: '/harnesses/me';+};++export type DeleteSelfHarnessErrors = {+ 401: ErrorResponse;+ 404: ErrorResponse;+ 500: ErrorResponse;+};++export type DeleteSelfHarnessError = DeleteSelfHarnessErrors[keyof DeleteSelfHarnessErrors];++export type DeleteSelfHarnessResponses = {+ 204: void;+};++export type DeleteSelfHarnessResponse = DeleteSelfHarnessResponses[keyof DeleteSelfHarnessResponses];++export type GetSelfHarnessData = {+ body?: never;+ path?: never;+ query?: never;+ url: '/harnesses/me';+};++export type GetSelfHarnessErrors = {+ 401: ErrorResponse;+ 404: ErrorResponse;+ 500: ErrorResponse;+};++export type GetSelfHarnessError = GetSelfHarnessErrors[keyof GetSelfHarnessErrors];++export type GetSelfHarnessResponses = {+ 200: Harness;+};++export type GetSelfHarnessResponse = GetSelfHarnessResponses[keyof GetSelfHarnessResponses];+export type ListHarnessAgentsData = {body?: never;path?: never;@@ -12594,6 +12682,26 @@ export type ListHarnessAgentsResponses = {export type ListHarnessAgentsResponse = ListHarnessAgentsResponses[keyof ListHarnessAgentsResponses];+export type ListHarnessSessionsData = {+ body?: never;+ path?: never;+ query?: never;+ url: '/harnesses/me/sessions';+};++export type ListHarnessSessionsErrors = {+ 401: ErrorResponse;+ 500: ErrorResponse;+};++export type ListHarnessSessionsError = ListHarnessSessionsErrors[keyof ListHarnessSessionsErrors];++export type ListHarnessSessionsResponses = {+ 200: Array<HarnessSession>;+};++export type ListHarnessSessionsResponse = ListHarnessSessionsResponses[keyof ListHarnessSessionsResponses];+export type DeleteHarnessData = {body?: never;path: {diff --git a/packages/sdk/specs/agent-harness.json b/packages/sdk/specs/agent-harness.jsonindex 37eb500ab3..e261a2ebfc 100644--- a/packages/sdk/specs/agent-harness.json+++ b/packages/sdk/specs/agent-harness.json@@ -835,7 +835,7 @@},"owner": {"type": ["string", "null"],- "description": "The user who owns the session. Ignored for user callers, who always\nown their own sessions; required for bot callers without verified\nacting-user claims.\n\nFor bot callers this is a claim, not a verified fact: it is scoped to\nthe bot's own sessions, but the named user owns the session on the\nbot's say-so."+ "description": "The user who owns the session. Ignored for user callers, who always\nown their own sessions, and for harness callers, whose verified acting\nuser (owner or confirmed team member) owns the session instead;\nrequired for bot callers without verified acting-user claims.\n\nFor bot callers this is a claim, not a verified fact: it is scoped to\nthe bot's own sessions, but the named user owns the session on the\nbot's say-so."},"prompt": {"type": ["string", "null"],diff --git a/packages/sdk/specs/storage.json b/packages/sdk/specs/storage.jsonindex 9337378ff8..41083163ad 100644--- a/packages/sdk/specs/storage.json+++ b/packages/sdk/specs/storage.json@@ -9000,6 +9000,96 @@}}},+ "/harnesses/me": {+ "get": {+ "tags": ["harnesses"],+ "summary": "Handler for `GET /harnesses/me`.",+ "operationId": "get_self_harness",+ "responses": {+ "200": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/Harness"+ }+ }+ }+ },+ "401": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ErrorResponse"+ }+ }+ }+ },+ "404": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ErrorResponse"+ }+ }+ }+ },+ "500": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ErrorResponse"+ }+ }+ }+ }+ }+ },+ "delete": {+ "tags": ["harnesses"],+ "summary": "Handler for `DELETE /harnesses/me`.",+ "description": "A daemon retiring itself: the valid credential is the authorization.",+ "operationId": "delete_self_harness",+ "responses": {+ "204": {+ "description": ""+ },+ "401": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ErrorResponse"+ }+ }+ }+ },+ "404": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ErrorResponse"+ }+ }+ }+ },+ "500": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ErrorResponse"+ }+ }+ }+ }+ }+ }+ },"/harnesses/me/agents": {"get": {"tags": ["harnesses"],@@ -9042,6 +9132,48 @@}}},+ "/harnesses/me/sessions": {+ "get": {+ "tags": ["harnesses"],+ "summary": "Handler for `GET /harnesses/me/sessions`.",+ "operationId": "list_harness_sessions",+ "responses": {+ "200": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "type": "array",+ "items": {+ "$ref": "#/components/schemas/HarnessSession"+ }+ }+ }+ }+ },+ "401": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ErrorResponse"+ }+ }+ }+ },+ "500": {+ "description": "",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/ErrorResponse"+ }+ }+ }+ }+ }+ }+ },"/harnesses/{harness_id}": {"delete": {"tags": ["harnesses"],@@ -21335,6 +21467,67 @@],"description": "Harness owner.\n\nExactly one of a user or a team, mirroring the bots owner pattern. There\nare no system harnesses."},+ "HarnessSession": {+ "type": "object",+ "description": "An agent session running on a harness, as listed for the daemon's UI.",+ "required": [+ "session_id",+ "bot_id",+ "bot_name",+ "bot_handle",+ "name",+ "status",+ "model",+ "owner_id",+ "created_at",+ "modified_at"+ ],+ "properties": {+ "bot_handle": {+ "type": "string",+ "description": "The agent's `@` handle."+ },+ "bot_id": {+ "$ref": "#/components/schemas/BotId",+ "description": "The agent the session runs for."+ },+ "bot_name": {+ "type": "string",+ "description": "The agent's display name."+ },+ "created_at": {+ "type": "string",+ "format": "date-time",+ "description": "Creation timestamp."+ },+ "model": {+ "type": "string",+ "description": "Model the session was opened with."+ },+ "modified_at": {+ "type": "string",+ "format": "date-time",+ "description": "Last-activity timestamp."+ },+ "name": {+ "type": "string",+ "description": "The session's display name."+ },+ "owner_id": {+ "type": "string",+ "description": "The user the session belongs to."+ },+ "session_id": {+ "type": "string",+ "format": "uuid",+ "description": "The session id."+ },+ "status": {+ "type": "string",+ "description": "Session lifecycle status, e.g. `no_messages`, `active`."+ }+ }+ },"HashMap": {"type": "object","additionalProperties": {diff --git a/packages/sdk/src/coverage/skipped.ts b/packages/sdk/src/coverage/skipped.tsindex e232f9b16e..93ff317080 100644--- a/packages/sdk/src/coverage/skipped.ts+++ b/packages/sdk/src/coverage/skipped.ts@@ -321,6 +321,7 @@ export const storageBacklog = ['deleteAnchor','deleteEntityMention','deleteHarness',+ 'deleteSelfHarness','deleteReminder','deleteUserApiKey','editAnchor',@@ -336,9 +337,11 @@ export const storageBacklog = ['getProjectPermissionsV2','getProjectUserAccessLevel','getHarnessPairing',+ 'getSelfHarness','getReminder','listAgents','listHarnessAgents',+ 'listHarnessSessions','listHarnesses','listOccurrences','listReminders',diff --git a/services/document_storage_service/src/api/swagger.rs b/services/document_storage_service/src/api/swagger.rsindex 5514b2230d..9fbc527ed4 100644--- a/services/document_storage_service/src/api/swagger.rs+++ b/services/document_storage_service/src/api/swagger.rs@@ -262,6 +262,9 @@ use utoipa::OpenApi;harnesses::inbound::axum_router::list_harnesses_handler,harnesses::inbound::axum_router::delete_harness_handler,harnesses::inbound::axum_router::list_bound_agents_handler,+ harnesses::inbound::axum_router::get_self_harness_handler,+ harnesses::inbound::axum_router::delete_self_harness_handler,+ harnesses::inbound::axum_router::list_harness_sessions_handler,// botsbots::inbound::axum_router::create_agent_handler,@@ -577,6 +580,8 @@ use utoipa::OpenApi;harnesses::domain::models::Harness,harnesses::domain::models::HarnessOwner,harnesses::domain::models::HarnessAgent,+ harnesses::domain::models::HarnessSession,+ harnesses::domain::models::RequestedHarnessScope,harnesses::domain::models::CreatePairingRequest,harnesses::domain::models::CreatedPairing,harnesses::domain::models::PairingDetails,