diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 0dfb6668..47e2ff81 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,19 +1,19 @@ lockVersion: 2.0.0 id: 664aaca5-a41f-4434-8f2a-642dba92fe68 management: - docChecksum: 6c50d3df7af689ff921a7b236aa524a5 + docChecksum: d6e9b5d31ada1f8279238ac182b9677c docVersion: 0.9.0 - speakeasyVersion: 1.797.0 - generationVersion: 2.937.18 - releaseVersion: 0.20.14 - configChecksum: d9cb7ab50c1f4b07cde71f7ab0ca3af3 + speakeasyVersion: 1.798.0 + generationVersion: 2.938.0 + releaseVersion: 0.20.15 + configChecksum: 3de58a52604f95a542d0fa314c5a4d8f repoURL: https://github.com/gleanwork/api-client-typescript.git installationURL: https://github.com/gleanwork/api-client-typescript published: true persistentEdits: - generation_id: 142dc4d1-5a78-4fd8-80a4-5103b1edd127 - pristine_commit_hash: 3dca366c231a559182ec75dc5e24a096275f09d0 - pristine_tree_hash: 7c8847de936cc9419eac3ba9a14a143ae9ec4b89 + generation_id: 4d9e8996-6809-4d6e-b733-586b97ad98b0 + pristine_commit_hash: 2ad2b4f2be0891d9c100729c1f703ca2b0751031 + pristine_tree_hash: deb5e72cd19bcab4a0bce94f8242057bb2df3222 features: typescript: acceptHeaders: 2.81.2 @@ -1225,6 +1225,10 @@ trackedFiles: id: 445fa998586d last_write_checksum: sha1:fa7cf5be12ee52cad694b001c494e67ebd47e32c pristine_git_object: 65aa0121f919fca695d0648635d2081c17a2b4af + docs/models/components/executionmode.md: + id: b048e1e1962a + last_write_checksum: sha1:d849c3b7afc66815fc5aaa1d168f07738aa64009 + pristine_git_object: cf562e29856462a8752a891b815003ffcff0f204 docs/models/components/exportinfo.md: id: 7b4a50bf6885 last_write_checksum: sha1:f98d483e964b430e78e2a3cd75050b054b640c74 @@ -1311,24 +1315,24 @@ trackedFiles: pristine_git_object: 2d773c43730426ba979a2509498cc8367493d9e6 docs/models/components/feedrequestcategory.md: id: 801f1c3c64d4 - last_write_checksum: sha1:ec8d2af7f5d37c0271c8225edd77eac5b4287013 - pristine_git_object: 68b21990d7a45133b8205faefb21fb241ebedb88 + last_write_checksum: sha1:70580d1c048629378fb9f03b133ee8c0431b85f5 + pristine_git_object: 525c3f56e765bc9311e605b1d8ace9e19b0def11 docs/models/components/feedrequestoptions.md: id: 76c5e4412304 last_write_checksum: sha1:9d026d140bef548159ac576066007ccc73ab5cee pristine_git_object: d36f4c0ede1e69c9b152b812a2aa33da8ec6c08a docs/models/components/feedresponse.md: id: a781b46b0647 - last_write_checksum: sha1:da222a4b97b497b5386ab018ca0c6e0dd24272f6 - pristine_git_object: e0d78966cfc548106d853e46efd75b329ca6f816 + last_write_checksum: sha1:f33a1b2123cf8bc8d99c01525a589a03fdfae6c1 + pristine_git_object: 29916453e23683d26fbc54ae9d62fb9d2c9b1bbe docs/models/components/feedresult.md: id: c3084f56c0cc - last_write_checksum: sha1:e445a6fe92a6c85aa16d4846e00a51c58e51d7d9 - pristine_git_object: df7d2fa20be8fa42c459812643f04fb6f71db3fb + last_write_checksum: sha1:247be5752ffc1ae191c3ab821eea00c26017e714 + pristine_git_object: bb2f4557e8237c5fa32904df0cf85e024e7ed55a docs/models/components/feedresultcategory.md: id: 94c0249352b4 - last_write_checksum: sha1:dc78a1fb1088f5947fdd25546b6d808b40af38d9 - pristine_git_object: 120f229d33e29016e72a6b2ac5d087fe62b46cda + last_write_checksum: sha1:d4df7056ccdd3331011c0a6f2edf06257b6876ff + pristine_git_object: d8bc8a1ca7768ee376a6f1455a9266e1583e08e4 docs/models/components/fieldscope.md: id: 23caffb85bb7 last_write_checksum: sha1:b90b2a0fba0f78b414366202e56a1637a8a8793f @@ -1659,8 +1663,8 @@ trackedFiles: pristine_git_object: 796fa0574cd02b5ca3a7046196a7cc4a214eeda0 docs/models/components/justificationtype.md: id: 5a15880767a5 - last_write_checksum: sha1:35f96eb4d97a1926cbef4ca6447282878e779fbb - pristine_git_object: a4a63343c1ffeda4165ad3b18d0cfb5c8a522817 + last_write_checksum: sha1:b1564a1b9496a03485ec69c7868e7a0796669c40 + pristine_git_object: d0678b542acb4058857df29f60db11367111c97a docs/models/components/knowledgetype.md: id: cf27a7cefa69 last_write_checksum: sha1:6e94f203bb1d3a0d12f0bdb0119bf36301536e8d @@ -1975,8 +1979,28 @@ trackedFiles: pristine_git_object: bd3f84687067c5539f9af71fff8f1896bb444cd9 docs/models/components/platformagentruncreaterequest.md: id: ad098fb679da - last_write_checksum: sha1:5c1b3224323236f070463d16e7616887cd8c5de8 - pristine_git_object: 046c9b4e41ef0b4ed1e090ec03fd60f75be5d6cb + last_write_checksum: sha1:f2c7c1d4eba42a628ea65bfe1e79cd8da0e3a389 + pristine_git_object: 67748f705ea9523db2c60d277f1c7b2382b2bd6c + docs/models/components/platformagentrunerror.md: + id: 0e3dd8d17013 + last_write_checksum: sha1:a88fde5d491bc295c1a561c1fa6be73924816bb9 + pristine_git_object: 7a9a7f117e5d83f3a412d67dd407d33eefb40d62 + docs/models/components/platformagentrunresponse.md: + id: 833fcfdb1aaf + last_write_checksum: sha1:6e8c9f9792b93ea0f8ff81197b90a8cf2dd71e47 + pristine_git_object: 44bde417b5459007570c0026a5affd749cd6e985 + docs/models/components/platformagentrunstate.md: + id: 6870c89b0b95 + last_write_checksum: sha1:8f1c150ea78620230f18c5b1fb7cdbcfcabd277f + pristine_git_object: 70207a83c50048982749b403c6e69de3e79c08f5 + docs/models/components/platformagentruntoolapproval.md: + id: 83826de1dc3c + last_write_checksum: sha1:a0cd714803dc1c8dfcac667cff06c8cd89dc6e4e + pristine_git_object: adb173b15eb467c582f84c5927ac5d84ec8daf29 + docs/models/components/platformagentruntoolapprovaltype.md: + id: edcbfd54e97f + last_write_checksum: sha1:7c6ea2d2782353f1810219081b61a40e537d725f + pristine_git_object: 6d8b1a2d7b2f147f55c77512b751f79d74f2ca30 docs/models/components/platformagentrunwaitresponse.md: id: 5a1e78680e6a last_write_checksum: sha1:1e06fbea33a12fa4c471d42869c6d3d14c83caad @@ -2073,6 +2097,10 @@ trackedFiles: id: d433e7bbef35 last_write_checksum: sha1:0b361bb9d55596a0022878ef1aa91c9e782c5870 pristine_git_object: 137d0c8608eb32b8672c234a91b6f18739ed2d21 + docs/models/components/platformchatjsonschemaformat.md: + id: 2c0f3b566ae6 + last_write_checksum: sha1:0ce9c5daa0a08fbff9e96e0d76e4f094c8430461 + pristine_git_object: d84f3bb520d168fd3891ee4e16c0dad02f4da3db docs/models/components/platformchatoutputmessage.md: id: 06f5e11e058a last_write_checksum: sha1:1be8e49ede9b8bc5cd2e0c6147a7a39384a61dda @@ -2087,8 +2115,8 @@ trackedFiles: pristine_git_object: c8d864be2b9327f48625725498c435ca5d7c69f6 docs/models/components/platformchatoutputtextcontent.md: id: 41ecc87e478f - last_write_checksum: sha1:0cf363611390743f1e05a653e3a1f8a0e12705f8 - pristine_git_object: 9f1c7036acde7a2301713719d83e7240e677a73c + last_write_checksum: sha1:76804e184de2f993af939bb93ba7e9b61db50732 + pristine_git_object: c2c05ca27928f89ce74931bb774701f903c6b801 docs/models/components/platformchatoutputtextcontenttype.md: id: 12dc2e11fdf6 last_write_checksum: sha1:e7a572736c4dd5b42dbb316dd1760f90cd779f7f @@ -2177,6 +2205,10 @@ trackedFiles: id: 2d12925cd635 last_write_checksum: sha1:a6742572666ef27e241ac6e9b503019c0f64f9aa pristine_git_object: 9913c75af077b020de46d856843c3cf0d5649903 + docs/models/components/platformchattextformat.md: + id: e5fc35b91179 + last_write_checksum: sha1:e4c6abd1a72983bc011729993041ad7fbb9c1b21 + pristine_git_object: 9b27fffc86c2184e2a1e551e281616f534d32009 docs/models/components/platformcontentschedulewebhookevent.md: id: 889cf2a8f5f3 last_write_checksum: sha1:ad520f9a5eee0ac3352505900f82e35803e96090 @@ -2193,6 +2225,10 @@ trackedFiles: id: a9c5d462f657 last_write_checksum: sha1:b08713402f3469d1d0d316f88340de39ca5c542d pristine_git_object: 57a2bed10e6ac3df1de2384d51973f2529ef9ec4 + docs/models/components/platformdurableagentrun.md: + id: b4bf0f58bc45 + last_write_checksum: sha1:7b10453be5b342c913e02f829cccced2da81f565 + pristine_git_object: 5e45f201738373b21882588d8d68558e2835f473 docs/models/components/platformfilter.md: id: 97ac5bc59c2c last_write_checksum: sha1:e80ec75f5fbf157e2287cf4ff04fd667dea2c9e3 @@ -2833,6 +2869,10 @@ trackedFiles: id: 6f79f182392b last_write_checksum: sha1:1b5ac4410857b43ab7ec47d69a452dc5f2d0143c pristine_git_object: 36c4253cfbae64bbb6875faf2e8dbc3d7d042b50 + docs/models/components/structuredoutput.md: + id: ca8639e22ee5 + last_write_checksum: sha1:f32b3aee80df4be0f6309f7e8f6e11e0eaa18903 + pristine_git_object: fa655cfa3b2f3058bcff0c8ebf546bb3146b5112 docs/models/components/structuredresult.md: id: e48e5e4cdd13 last_write_checksum: sha1:14bee5629983464513a82e8aa7a5ff60a2b3ba65 @@ -3539,32 +3579,52 @@ trackedFiles: pristine_git_object: 9d15ac85c9127a875116ff980fbcc2b36e378e04 docs/models/operations/platformagentscreaterunresponse.md: id: aa686cb7fdf0 - last_write_checksum: sha1:4c8a256e177c89489099936f7a7f1e8768f93eb3 - pristine_git_object: a6ff4cd483a4f002c97a315f08e635fbed15c852 + last_write_checksum: sha1:664c3f481361b7d58d6299fd6d53385e0ce677aa + pristine_git_object: 2af705415ca4f3defc85c562ca21836e4d53b81c docs/models/operations/platformagentsgetrequest.md: id: 706ad4a6bd32 last_write_checksum: sha1:72db0892e6d0df09575a56a7e3d5471cf4d5e023 pristine_git_object: b02fac98bcf52fdde3818163b1e835006fac955e + docs/models/operations/platformagentsgetrunrequest.md: + id: 390cf892ae0a + last_write_checksum: sha1:a13189989b8c1e659893bbb50b24f9076c14ef14 + pristine_git_object: 21091714485f5933d89509ab02b42107ff255ccb docs/models/operations/platformagentsgetschemasrequest.md: id: 58d615b7c78f last_write_checksum: sha1:fb7d9247173ad2c3f07def425cb55ad447f31006 pristine_git_object: 8afdfa5959f9d40e6bfae72293d9485fdd5f143a + docs/models/operations/platformchatcreateformat.md: + id: f472fd6ab7ef + last_write_checksum: sha1:7838c78255e048cf30bca1f202f1e6ec44e64a55 + pristine_git_object: 0079624bed9dc67e57488ea569647fc5e4a8911a docs/models/operations/platformchatcreateinput.md: id: 30dd49c63c34 last_write_checksum: sha1:b84e23b26eb042cfca1bcd894a12b11c4b7e9dd0 pristine_git_object: 50ceb94725f4ee275ef5430f8e6b756f44b2947a docs/models/operations/platformchatcreaterequest.md: id: e3b4683f75d8 - last_write_checksum: sha1:36cea3fd51a5168e5bce0bed4298d7647acdd344 - pristine_git_object: f13a0c0f1cf4c47d4d5dab473a5ce092e69a17d4 + last_write_checksum: sha1:a805db02b7381859e005b51249066959f5df8418 + pristine_git_object: 6e7d38f1a7baecb7d468028ef6cfd5c8cf255483 + docs/models/operations/platformchatcreatestreamformat.md: + id: 9f0d72f05096 + last_write_checksum: sha1:bb4c3a598166fe6dd7996d135775af8b014a1d3c + pristine_git_object: acb9a86b99922381c5b3c2f3f3dedaba756a7bf5 docs/models/operations/platformchatcreatestreaminput.md: id: 4282b848314f last_write_checksum: sha1:c31769fe4d329e12861cf4d51567973b0271d8b2 pristine_git_object: a23ee7f283a439cf260082064534773e5eb7b99f docs/models/operations/platformchatcreatestreamrequest.md: id: bf073c591777 - last_write_checksum: sha1:6adf75533c0f61313b1531cd077d018f760eb627 - pristine_git_object: 83b15c9886e606f92157a002a013b764ab951e33 + last_write_checksum: sha1:d4e07acdfdcb1ab0ffa45d75efdb197208048740 + pristine_git_object: d06e7dadb8b87b1dc18da225f993430555fd785a + docs/models/operations/platformchatcreatestreamtext.md: + id: 5e6e2b9eeb59 + last_write_checksum: sha1:47fd813260b23400ad20f0c9690ef985a33f60bc + pristine_git_object: f7c9444fbc25717456347aeb3a84c707151b37d6 + docs/models/operations/platformchatcreatetext.md: + id: 419ceefc2ea7 + last_write_checksum: sha1:e9415f5cd77710ec94f691837c1026bd042ae477 + pristine_git_object: 9e53fb99223c8c53acbaa2a3187c526536e7bd97 docs/models/operations/platformsearchfiltersrequest.md: id: fb15f593735d last_write_checksum: sha1:f2d1bd989b9012c481f0131bb912764e6ac1b702 @@ -3755,8 +3815,8 @@ trackedFiles: pristine_git_object: d660077d81220a7f0b093725c504fc9ed2db65ac docs/sdks/agents/README.md: id: 5965d8232fd8 - last_write_checksum: sha1:ae186b17e322b825bf77e554276c9fda52c8a90f - pristine_git_object: b1224201574023cd4e8000e718ac5eea6546aa7e + last_write_checksum: sha1:924da26ab032a885396539e6a63497c27e69c2f7 + pristine_git_object: 8e3022b5362b9cd72aab34ad9f2b8a75e8ffbddc docs/sdks/announcements/README.md: id: 3d2e130a217c last_write_checksum: sha1:9955e9b871a2deaa2c17cd1c92fb4d34f7e05138 @@ -3767,8 +3827,8 @@ trackedFiles: pristine_git_object: dbb0cc043da9d3b3fe0387ec06cad2212a5eda07 docs/sdks/chat/README.md: id: 393193527c2c - last_write_checksum: sha1:728d9061313af106b16832589cd4647a43bd45d6 - pristine_git_object: 48e140defbeb9f33e8e81a2eb87783c15824325b + last_write_checksum: sha1:946e8e0d33d15899dbbaa09770024c9b09cd9cdf + pristine_git_object: 733e5d5109d9fbc1960b607225895b5d39feebb2 docs/sdks/clientagents/README.md: id: 8e00e6d6b64e last_write_checksum: sha1:abbda5fa02447e90a47f933b543666bf94f3ed97 @@ -3911,20 +3971,20 @@ trackedFiles: pristine_git_object: 5a2797590d4be351d62915017d5b2a0f853537c8 jsr.json: id: 7f6ab7767282 - last_write_checksum: sha1:014a6b1cd47b80f26e05e2168041e3c7c345f0cb - pristine_git_object: 18e54741e97591460d704576a5940554fadccb63 + last_write_checksum: sha1:2291c0ec4e19539de3393812e9843273b58f2710 + pristine_git_object: 3d3d6c97488c9273485eae66ec4d7fdc127d06e4 package.json: id: 7030d0b2f71b - last_write_checksum: sha1:709b5aacfa6b62efd6f9e312d2af0b4773842637 - pristine_git_object: 6c303ad31805ed2274dba1e2ca855bc0b1bbda7d + last_write_checksum: sha1:e5251702cee5c4197a0e86e2a0ac1632a99e2d2c + pristine_git_object: 39340b245db6d590cf34ca7793b0570cadbe2497 src/__tests__/activities.test.ts: id: 65fa859b8f59 last_write_checksum: sha1:756bc40095f4495bbf62739b8218bb4a559a24f2 pristine_git_object: b35dd997cba626160e8f3d19dde1b1a151e6ad85 src/__tests__/agents.test.ts: id: 3cec9af43334 - last_write_checksum: sha1:d4ac1946c581b57cec49a4aa26a7ef9e4b019ba7 - pristine_git_object: 36eba32b1aa82e1f302222c10a7064dc7f649343 + last_write_checksum: sha1:b3506c853c78f3a8049619e09763e73307f10fe8 + pristine_git_object: e458e90bf5350751a4dd38610e857cfe5f63d385 src/__tests__/announcements.test.ts: id: 1fbbe739ff78 last_write_checksum: sha1:775233d320d0d015e40c78c7b6634e45c634d033 @@ -3943,8 +4003,8 @@ trackedFiles: pristine_git_object: fa4dad795dadc97500b9b2c5971bfc00b040b7e4 src/__tests__/chat.test.ts: id: bf83434eb7e7 - last_write_checksum: sha1:8c3df1fe4fe7d023ed1b1418d3446edd950e9f46 - pristine_git_object: 4ddce49969c4a145890706e50ef440063bb5304b + last_write_checksum: sha1:b69c22fa55ac448d788b48f42d3b309fb412c2e2 + pristine_git_object: 24edde034c02a3b57da1253532d4493ccb7bb93f src/__tests__/clientactivity.test.ts: id: 763dd50c7493 last_write_checksum: sha1:ba2524258d92b2768d107c5f3492552e317ff471 @@ -4031,8 +4091,8 @@ trackedFiles: pristine_git_object: d252821b825c62856886e3ab9287181d7ef7f9de src/__tests__/messages.test.ts: id: 39e293f09219 - last_write_checksum: sha1:c78b09c09e64da0655a3e0ecbadabe82980ef7d1 - pristine_git_object: f390543460d7bd3c678c17579e755b9e06faac16 + last_write_checksum: sha1:35170c1c2c6d5e4a4dca5a35ae5d74d602f5294c + pristine_git_object: 01382f0c48dc70391beb3802de74c92eb8480822 src/__tests__/mockserver/.gitignore: id: 4a7fc421b6b6 last_write_checksum: sha1:228e1b05712a973948fd771323a2140a3b355ff4 @@ -4087,8 +4147,8 @@ trackedFiles: pristine_git_object: af3a6d136d837850b34ed893a8faf800ea114721 src/__tests__/mockserver/internal/handler/generated_handlers.go: id: e6f590a8ce11 - last_write_checksum: sha1:447773fdfed679f8320a119aff6e536fe92a3515 - pristine_git_object: 010a384f34c7c716520ce6e62261c2fb4b5e548a + last_write_checksum: sha1:48f21fdf35b820df9d04553b18a1c3a16a9fec56 + pristine_git_object: f73ba128894f3e78f41711168cd03aa09e19a57b src/__tests__/mockserver/internal/handler/pathdeleterestapiindexcustommetadataschemagroupname.go: id: ef047f0e0f32 last_write_checksum: sha1:187ff16d05efa1c937632f61dd3f49e49691d5ff @@ -4101,6 +4161,10 @@ trackedFiles: id: cb3e9dff49b4 last_write_checksum: sha1:47dc233b6278547f5eaf1352daf99b6e546a0348 pristine_git_object: 3e63328587f0a6513d83e949148e330a4f621bf4 + src/__tests__/mockserver/internal/handler/pathgetapiagentsagentidrunsrunid.go: + id: b6f113ba98ea + last_write_checksum: sha1:684058e2116df6d2711f6d91b1f552757747cf9a + pristine_git_object: 379c28f2fd52aff82d58567d7a982b4f87c22970 src/__tests__/mockserver/internal/handler/pathgetapiagentsagentidschemas.go: id: e095cf890e73 last_write_checksum: sha1:dec4b7dbf683ac9ab16c749e9e2bf7d1f29b0046 @@ -4447,8 +4511,8 @@ trackedFiles: pristine_git_object: 759610d9e14b656b2a8671c25618d94bd6dd13fb src/__tests__/mockserver/internal/handler/pathpostrestapiv1createcollection.go: id: a5a57be97594 - last_write_checksum: sha1:018cc7286107290e649b6b3b03aa3dbb954fac49 - pristine_git_object: 673b01bb8e674296a9eaae2e614c08d07b3700a2 + last_write_checksum: sha1:9b962c4ca4d653411bc410023c49401518b209fe + pristine_git_object: a4b193767e8924ecc8a22aa8df6d0030f8786874 src/__tests__/mockserver/internal/handler/pathpostrestapiv1createshortcut.go: id: 440deca160f6 last_write_checksum: sha1:e2bba9884dd04f8d9b158c88fb32ff9f06687846 @@ -5627,12 +5691,12 @@ trackedFiles: pristine_git_object: eaa87413391e44f74a2647a75d861904a051a1af src/__tests__/mockserver/internal/sdk/models/components/feedentry.go: id: 809547cb5c68 - last_write_checksum: sha1:23a2ad4ff5d44a8b2199fc3ed7c1b6b7bca575bf - pristine_git_object: 9fb0df090704c28d506d35624ab0e2925eea12c3 + last_write_checksum: sha1:91cd702bc15940bc76a703739dddbf67c06b5326 + pristine_git_object: 6af5ac9c9881a586d8c8935afab17bf694062abc src/__tests__/mockserver/internal/sdk/models/components/feedrequest.go: id: f7bd2c505cff - last_write_checksum: sha1:4b37812c6d88485dca8e4bd18b9107684c22e883 - pristine_git_object: bce628a86b817713c99c1181fc692eed9d97728f + last_write_checksum: sha1:303929b771b987029156ddcc9b286025d8e6013d + pristine_git_object: 26021404a652e56e75e8037d9cba115b2c3474bf src/__tests__/mockserver/internal/sdk/models/components/feedrequestoptions.go: id: d6a1872334df last_write_checksum: sha1:1ab14ce889dc4f6a8cd018f5ef731ee05e3c4f3a @@ -5643,8 +5707,8 @@ trackedFiles: pristine_git_object: c92a344643e978700da31b2f24afaf9d14fd8d69 src/__tests__/mockserver/internal/sdk/models/components/feedresult.go: id: 90772ce61c8a - last_write_checksum: sha1:e6e573f707360e4607a376a8a43358ada78833f9 - pristine_git_object: 744f95f9454aa1554cc9a6ecfddd26cd46d4575b + last_write_checksum: sha1:c05b5cfe234ead29653740f8fce2b0b0c01f03c5 + pristine_git_object: b3c0414f7a5325b08b4393a9e544914cd1cf326d src/__tests__/mockserver/internal/sdk/models/components/followupaction.go: id: b87db474fc6a last_write_checksum: sha1:94c11e6ccb0d238213354241dff0baa101808b64 @@ -6135,8 +6199,24 @@ trackedFiles: pristine_git_object: fdba97e5fd3304a2ca7ae62a2f0ec80d7b270aad src/__tests__/mockserver/internal/sdk/models/components/platformagentruncreaterequest.go: id: 7c8f470c623b - last_write_checksum: sha1:60b37c960fdf0f54a55fd18e847ff809f575c73b - pristine_git_object: 754c8c6a72841c04ea5b1a08aa27bbba7a51499f + last_write_checksum: sha1:0066c5f8ab276c8176b9cfc25fbd8219143c1c60 + pristine_git_object: 09923c9a617b452cb307a0ba04fa2adb71066d13 + src/__tests__/mockserver/internal/sdk/models/components/platformagentrunerror.go: + id: bb8b5992e98d + last_write_checksum: sha1:42d6c633c95b9383fe42190c64e0bdac0d3f0f67 + pristine_git_object: 34afbbdfbad05cabaf4447260ee2aac04a9789f2 + src/__tests__/mockserver/internal/sdk/models/components/platformagentrunresponse.go: + id: 4ac930221f8b + last_write_checksum: sha1:11df19ed8a06e45434350e1f1b13ee014926aaa6 + pristine_git_object: dc751244820071c8425682c41381f87da68711ef + src/__tests__/mockserver/internal/sdk/models/components/platformagentrunstate.go: + id: 31e5314c4b6b + last_write_checksum: sha1:bf6db37884c0635c897c7ece20458a4b169c596e + pristine_git_object: c8ffdbf1ff7618862ec1e306b81970505bc7ab1d + src/__tests__/mockserver/internal/sdk/models/components/platformagentruntoolapproval.go: + id: 20134105d6ce + last_write_checksum: sha1:7b5dd0b728fded3369a5a19e803d698f4afb6bb7 + pristine_git_object: 3b1437b418436202b1b1a256dff77bc2c297341b src/__tests__/mockserver/internal/sdk/models/components/platformagentrunwaitresponse.go: id: 949626f75f93 last_write_checksum: sha1:239b3f36488b7d9f367cc23a149bd723bebec529 @@ -6193,14 +6273,18 @@ trackedFiles: id: 3073b8cf092d last_write_checksum: sha1:6340f73e5bffac9a724f8eb9f6a73082273cf080 pristine_git_object: 27fa64cbf8a93a7d9825b49f1637ae119e78315e + src/__tests__/mockserver/internal/sdk/models/components/platformchatjsonschemaformat.go: + id: 894f1f95fef3 + last_write_checksum: sha1:10e586048b7f30b47bc97cee22dd28bfca02e371 + pristine_git_object: af91cf875d24c490c927294bf3b4f5b97cc01bb8 src/__tests__/mockserver/internal/sdk/models/components/platformchatoutputmessage.go: id: b4782e0cffe9 last_write_checksum: sha1:c28b34c8f32a7306dfd8521ec87741281c09d13c pristine_git_object: 39e8b75049e28450aee57a7e7655d2cd254330e4 src/__tests__/mockserver/internal/sdk/models/components/platformchatoutputtextcontent.go: id: 3bd4856d4753 - last_write_checksum: sha1:5880a1f9527a41dd0d8b1f91ded48bad9e7f932f - pristine_git_object: 7b5437eb4ffb05b35d98d706bd6896089def9771 + last_write_checksum: sha1:75dab771147cd287c989446ce8955714e6002b55 + pristine_git_object: 94d84904ce58f8066e0bdbc4a4a2c20689f805e7 src/__tests__/mockserver/internal/sdk/models/components/platformchatpersonsource.go: id: 3b8c301f9600 last_write_checksum: sha1:9e5f72c1a5d130516f17326db5ea40100385e413 @@ -6261,6 +6345,10 @@ trackedFiles: id: d479ff5cdb9b last_write_checksum: sha1:d8d94a820f7d0ad33d97f08745ecebc525649491 pristine_git_object: c237c010741a1d07f7b0ee645761232f9967e2d8 + src/__tests__/mockserver/internal/sdk/models/components/platformchattextformat.go: + id: 26e47a3c7596 + last_write_checksum: sha1:e3d5de0a1aad36226a8a852a8c07f4d4b962b85e + pristine_git_object: 580903ad493bf182419fe34ec942ab2c7147f1ef src/__tests__/mockserver/internal/sdk/models/components/platformcontentschedulewebhookevent.go: id: 1dec110fbea1 last_write_checksum: sha1:af9daf2078ac7a31ea3edaff07b8523d137e2da7 @@ -6277,6 +6365,10 @@ trackedFiles: id: e3d51bf15c74 last_write_checksum: sha1:9b662addab70bcef961ddde90a2676ff6d3f9585 pristine_git_object: 44d3586595ad0514956530ebccbf75d163912e18 + src/__tests__/mockserver/internal/sdk/models/components/platformdurableagentrun.go: + id: 3df53a73fb3e + last_write_checksum: sha1:988c18ddfa6cbdbe28254acbb2cbf36e2c69dc51 + pristine_git_object: a55759624a3438339b47f04083152d78f4544302 src/__tests__/mockserver/internal/sdk/models/components/platformfilter.go: id: 81cb594b3436 last_write_checksum: sha1:6323c368b8503432e07b7d6ca7fde8d535332a88 @@ -7427,12 +7519,16 @@ trackedFiles: pristine_git_object: 529a1b3d847adc250f1ece0b932e457b5be76c08 src/__tests__/mockserver/internal/sdk/models/operations/platformagentscreaterun.go: id: cfdbe175ae56 - last_write_checksum: sha1:20b76e0d5371f6e5801a3c18d0515dd3dad247b3 - pristine_git_object: 5f0f5cd94cf9b088a826f40b47f58960f3a383da + last_write_checksum: sha1:6bc9e89a13f949495d512742347fd942bdf4198a + pristine_git_object: ddecae80c3066807a798f89bfa0b80f506b44794 src/__tests__/mockserver/internal/sdk/models/operations/platformagentsget.go: id: 76aa63b8cbba last_write_checksum: sha1:1825260fda21a35299c430fcac6b04dfc8799fee pristine_git_object: 5eb7082b4dfe7c2ae86976571e292291444acce5 + src/__tests__/mockserver/internal/sdk/models/operations/platformagentsgetrun.go: + id: 8f52c48c9967 + last_write_checksum: sha1:b2a6c1f7107daa542224f5c96754dabe943b08ee + pristine_git_object: 3bb63424c34bbf5400285f4246fb7379fa8bd8c6 src/__tests__/mockserver/internal/sdk/models/operations/platformagentsgetschemas.go: id: d8573939e7a1 last_write_checksum: sha1:c695ec1872fe32f41ef7d7e8d28c2012d4632770 @@ -7443,12 +7539,12 @@ trackedFiles: pristine_git_object: 400797ac0ae0d3518c1e2fd0e75fad70ad0e9373 src/__tests__/mockserver/internal/sdk/models/operations/platformchatcreate.go: id: d7591a37d7a3 - last_write_checksum: sha1:090ca9e2b300412ae5bb0a992896767786572a53 - pristine_git_object: 439b883ac06eecea9bc1b9915c423577c8034842 + last_write_checksum: sha1:7a009b5742642df30ca9511fae5ec1b59d9ce877 + pristine_git_object: 12c116d75651b774880c630d995425300d6b544d src/__tests__/mockserver/internal/sdk/models/operations/platformchatcreatestream.go: id: cb5c539bf53d - last_write_checksum: sha1:876a7bb48f2e7b1f1c302b114ff98b03dccb6d45 - pristine_git_object: b4b32f8fbcdbb138a0d340ba8dda8c46abff392e + last_write_checksum: sha1:5ef470df5c006a512a3f9281cae9be175dadc1e8 + pristine_git_object: 68b74befa78b34fe9bc9deefdf0b8a6545c07ecf src/__tests__/mockserver/internal/sdk/models/operations/platformsearch.go: id: 8d5d0787d271 last_write_checksum: sha1:9fd7d66f3b3832e327c5943481aabf7a8f81578d @@ -7919,8 +8015,8 @@ trackedFiles: pristine_git_object: 80853fce6d86d20766336fb2fd27c8669cd12ca8 src/__tests__/summarize.test.ts: id: 3105d6ebc7eb - last_write_checksum: sha1:39a95f8e2dbf712d3fde584995a14c6b9e3c558a - pristine_git_object: 3e8e82d2b767b5b77874cd53052ed647ca3c82f3 + last_write_checksum: sha1:d79eae17ee05748429dfed33d0edd0ee43a42cfa + pristine_git_object: 73c8d34a7b25b9967a4fbe7fa97e6aa57d45d352 src/__tests__/testclient.ts: id: f142c080bff8 last_write_checksum: sha1:3a38647391f52221c009a9273eebf90793b3d430 @@ -7947,12 +8043,16 @@ trackedFiles: pristine_git_object: 98cadc8fe5496bfbf22b46cf0c81ff4daad6f2c9 src/funcs/agentsCreateRun.ts: id: 806c3e535dd1 - last_write_checksum: sha1:74e2c30d6a2315471a0ac7613e64c93e36f4e049 - pristine_git_object: c3a02e5d83bdec43293f4238d425c50278e688c0 + last_write_checksum: sha1:c113a5e2580d9eb089cd2d6e1f78ad89a0bc209a + pristine_git_object: a9559fc206eb18d1280d2e1a596068cc4a69bf9c src/funcs/agentsGet.ts: id: ee72478b2e87 last_write_checksum: sha1:3795b137684423944b81ba30e2b18d1488ebaf26 pristine_git_object: 62be41a887b1468daa563c7dbef183254f979b55 + src/funcs/agentsGetRun.ts: + id: a0674cb41f42 + last_write_checksum: sha1:619793f023510a53dbacb140cf5d71cbf99324f1 + pristine_git_object: fd6d1d55155e39f4f96bbc8d24db22c3c727a2e8 src/funcs/agentsGetSchemas.ts: id: edd2ff0bf57f last_write_checksum: sha1:f09bcbf657dab65ffb2cf7fc9c8dfc345e5b0f17 @@ -8635,8 +8735,8 @@ trackedFiles: pristine_git_object: 42d9739ab67c2fec0689f83777ffa5e1f875e5d5 src/lib/config.ts: id: 320761608fb3 - last_write_checksum: sha1:272b8f760ceb6e823200e76f575a81123bddd10f - pristine_git_object: 9bbf7a8c4a072a90fad9ac79dd361b7c752f1037 + last_write_checksum: sha1:47bd9c2f9cd18d00001121baa1bd4e659641a8d3 + pristine_git_object: 8c256eefc25c25a951213c18a27ba14b9d8960cc src/lib/encodings.ts: id: 3bd8ead98afd last_write_checksum: sha1:d1917169abb226ccb0d2e93fd211a1d2987822b4 @@ -9643,12 +9743,12 @@ trackedFiles: pristine_git_object: 3fb6f14548eb0f546d0fdfcbac4ea9af834b9687 src/models/components/feedentry.ts: id: 47faae0fec45 - last_write_checksum: sha1:1da196aba1004cabc5b905c84e2f453d57a436d4 - pristine_git_object: 73ee8838bae708f8f6f3923bb52f4285a7bed24f + last_write_checksum: sha1:8d22c9dbbbad67a7f3c004f42309d29794c12d27 + pristine_git_object: 2d903bca986a4c0d7f72e8ab7bcc15e02d408c06 src/models/components/feedrequest.ts: id: e18410d4ffd4 - last_write_checksum: sha1:ea210a9a7cf63d9bdb328ed8c941de05f6b43ef0 - pristine_git_object: c9ff8e7b841fabc4b33b6020021df0bbd7a3b110 + last_write_checksum: sha1:385672e69e5c40962a08032b4b0459549ffea0f0 + pristine_git_object: 5fc4173412ecfb8e345db790bb9bc1e75e6da46f src/models/components/feedrequestoptions.ts: id: 684c93eb4ff3 last_write_checksum: sha1:339180c553629e9c992c1f5819612effd7d692e7 @@ -9659,8 +9759,8 @@ trackedFiles: pristine_git_object: ec512af99670430c927b57b2fcb360c620f56cf7 src/models/components/feedresult.ts: id: 94d90ce484f6 - last_write_checksum: sha1:f2f4af14dad0f7bfab3e17ead44d795ed1b96e45 - pristine_git_object: 49c52ace6e142edc88d37d57f8f29a73e4ba3a21 + last_write_checksum: sha1:296e32a5a80b5f912254d9941372ed6491c5b2dd + pristine_git_object: ff97d24f95003443a0ef452ef7c69690aa4cb14c src/models/components/followupaction.ts: id: 0b8a71fb6ea2 last_write_checksum: sha1:ea9d1e5a53384164dc8d63d3ff831a332a5f2fed @@ -9851,8 +9951,8 @@ trackedFiles: pristine_git_object: dcb8bad1c6e1addd393690e78a63631baa47f7be src/models/components/index.ts: id: 0aa842dce54d - last_write_checksum: sha1:7f94056559e53d42083895679e961770cd86081a - pristine_git_object: 07faad8f16b44a640c236b9ed29766538cdae457 + last_write_checksum: sha1:6e5ccfb61b96a905ee5ebbf4e3716e155558ea0b + pristine_git_object: 7d246daf200bb527f5faccdf389c5c3d2a1c7e8a src/models/components/indexdocumentrequest.ts: id: deb13e2cdc65 last_write_checksum: sha1:33e2093c7fcdd3c90ef45c48e7b79c4cb2aea6e5 @@ -10151,8 +10251,24 @@ trackedFiles: pristine_git_object: ac0cece6b4014922d8b75a2d6684d9037fbc8e9c src/models/components/platformagentruncreaterequest.ts: id: 0aaec5605e0b - last_write_checksum: sha1:085f16126e7589c77649100b6c033842d4d0b0a5 - pristine_git_object: ff82f069bf69d31f54da79356d2c107b17a99393 + last_write_checksum: sha1:a9d168faf6864648d33553368369de617f8e4127 + pristine_git_object: 129cb72ce57c5d248c9947ba66591f45ce69cae5 + src/models/components/platformagentrunerror.ts: + id: 81741b7bd9d6 + last_write_checksum: sha1:37d71345932c23ceb7e772851c22d592b4f23830 + pristine_git_object: a5715f25838fa672963db7321cd71d1fc6403d7f + src/models/components/platformagentrunresponse.ts: + id: ba105014a846 + last_write_checksum: sha1:2367f5d816f5aaf1e38cb8070a70cbcb1d0ebad3 + pristine_git_object: 95a601252bdd18d94828dc93dabefab000739b38 + src/models/components/platformagentrunstate.ts: + id: 7ca67400bb0f + last_write_checksum: sha1:fb3c11211509a7187bb2210360a707015105405d + pristine_git_object: e806fd9e4c52b1d6ef2074ebc300f25df32c596b + src/models/components/platformagentruntoolapproval.ts: + id: 95f98723f5af + last_write_checksum: sha1:cc7e7733e9fc27ad7cdd10c613f5fdc4402a2e97 + pristine_git_object: 526a48044d76dcf28110cb2fc76f83340ed9aea3 src/models/components/platformagentrunwaitresponse.ts: id: 123f244b0399 last_write_checksum: sha1:ac85dc29aa6b907b7b2b1a194f6933c197691d3a @@ -10209,14 +10325,18 @@ trackedFiles: id: 3cfc29b0d268 last_write_checksum: sha1:469269643f005fe9038eb96ce7122acc34a9795e pristine_git_object: 1705d965980a233631e8aa0cfadc750cbf2bc92f + src/models/components/platformchatjsonschemaformat.ts: + id: c7086d714c13 + last_write_checksum: sha1:207d4424bd93bc927c12b5601edda6bde0ae0023 + pristine_git_object: e620df58caee56b51cf50c47d9f4c4aa39019bd0 src/models/components/platformchatoutputmessage.ts: id: 99912ae2c54e last_write_checksum: sha1:a318403ec231b9664f318bcbd1f9d9238f303cfc pristine_git_object: ee68330ac7c2f750966d893ff0c78b60a2557191 src/models/components/platformchatoutputtextcontent.ts: id: aef245149405 - last_write_checksum: sha1:a5dbe41374fc347e2fb7d79844128425c5c098d6 - pristine_git_object: fef0736f1c1e63f44de0703246d5c2aca6967850 + last_write_checksum: sha1:21ad531df92141e2609250c4b55d192c43de4e2b + pristine_git_object: 02f6a05c0a65a1ae09b2df60f8d11aac628576c4 src/models/components/platformchatpersonsource.ts: id: 9e78924ff10b last_write_checksum: sha1:6923603f31b0958784cbb488d30f338a647b74d4 @@ -10277,6 +10397,10 @@ trackedFiles: id: bd824a2d14c5 last_write_checksum: sha1:f58efc8e0f817bf68a2f2c77f90e9811de06f9cd pristine_git_object: 6982973162a59ae209ee7b8558608826463d1de1 + src/models/components/platformchattextformat.ts: + id: 6dad34f1fc6d + last_write_checksum: sha1:81df9379ed107b5d358bfa84d911ad24fe5db19d + pristine_git_object: f76809c9f884f886334e20d2c752173cccb52ca8 src/models/components/platformcontentschedulewebhookevent.ts: id: 09ece847f0e0 last_write_checksum: sha1:f5cb89eff83e5d2ce251139de76897aa70b00e79 @@ -10293,6 +10417,10 @@ trackedFiles: id: 0aee86e6607b last_write_checksum: sha1:7e5c09c1d94fabfeb6d3ac53b054726aed45158f pristine_git_object: 7414099e93cb322804c4231055fbd28ce6ec2775 + src/models/components/platformdurableagentrun.ts: + id: d363786a8762 + last_write_checksum: sha1:2c93b0de198f7b44ee854ec5f912aab9ddd2a614 + pristine_git_object: 190f90a430fa973bd68562fce26412f5d8ee7db0 src/models/components/platformfilter.ts: id: 606c0824e0d8 last_write_checksum: sha1:5634e3231510ea3ee9fa3fbe00e310a25e951df2 @@ -11415,8 +11543,8 @@ trackedFiles: pristine_git_object: 1c27ef9389cbaa8c4f5746b46d0684aac766b4d6 src/models/operations/index.ts: id: 0d9ffaf774d2 - last_write_checksum: sha1:7c59e2725226a995d5c36faa3db3b92a78819a49 - pristine_git_object: e1435f5ef4551611bbcb92016a118496f7ffd473 + last_write_checksum: sha1:a8ea835e0445c74d0ceb2da0665e0919d1a55c94 + pristine_git_object: a61337de74cc12df9d92f959dae7812e1d67990f src/models/operations/insights.ts: id: 7bef0edaab32 last_write_checksum: sha1:37db16bc7603defd715210dfd8c12de88bde8b72 @@ -11467,24 +11595,28 @@ trackedFiles: pristine_git_object: 3061f609df0947e3bd1b061e94e422677dc556d3 src/models/operations/platformagentscreaterun.ts: id: 51a44ec04f7d - last_write_checksum: sha1:4217923ae24058c816e6e73af855a17ca5065d57 - pristine_git_object: 70e7208b83e2c9b63a86680bccb3311440fda7a8 + last_write_checksum: sha1:2941b46894bdea206588bfc28be8cefe06760b11 + pristine_git_object: abfeb33859bea1dd3ad5539520c5205c554eac00 src/models/operations/platformagentsget.ts: id: a1a38c3fd799 last_write_checksum: sha1:f919dcaf07ce07901d09cb6643b7062662e75bd3 pristine_git_object: a08c0a6a18fc2e69a49c54644ec15410cf2b3e2b + src/models/operations/platformagentsgetrun.ts: + id: 49839848ed07 + last_write_checksum: sha1:f415d1e19559f8b1136ad041acb70db10fe2a4b9 + pristine_git_object: a3bcaca6c7e369cc7fbadcb7cf18d75c289f8919 src/models/operations/platformagentsgetschemas.ts: id: c025879102b3 last_write_checksum: sha1:65d7361ac886e2c8f3200c6cc3141daf78ba1eac pristine_git_object: 69bd1349edebd305537e0ec66afbe70db4e9aa14 src/models/operations/platformchatcreate.ts: id: 61f71943248c - last_write_checksum: sha1:d7ad67c4d2e69fe5bb895fc673f6bea5da3fe8b5 - pristine_git_object: c78b6a8a106faab54a2b3f105c9550eb70a61d77 + last_write_checksum: sha1:d3244864e0902598b85daa1f50f1aa9dd2d2d797 + pristine_git_object: abdc52608f4df3e1fa0d4e9542efc6786c8e4295 src/models/operations/platformchatcreatestream.ts: id: 7b911127469b - last_write_checksum: sha1:6530528ad97a315746ac9fb44940e3e92cddbcef - pristine_git_object: c06337a78b72bb729bb64238ee910c997610e5eb + last_write_checksum: sha1:b52047d6e39ad9d833c4b68b257f910da7c25591 + pristine_git_object: 3b1f8a1721afd5c7c8940117c1a22ae94073f1a2 src/models/operations/platformsearchfilters.ts: id: 40fe427dde80 last_write_checksum: sha1:1fe72e92d082f160e9107be4f8129c6a84a372b5 @@ -11655,8 +11787,8 @@ trackedFiles: pristine_git_object: 01b38b63d6e5cf3d4fa51c0758d0b4b242d08bb2 src/react-query/agentsCreateRun.ts: id: b1268b5938b6 - last_write_checksum: sha1:10759988efcc08a6711d8d7d664d0c994c5a520c - pristine_git_object: 49dba4cfe0c4eb4c98a87288d763cf33ba095b1b + last_write_checksum: sha1:795489d4954230f17b02d4bc25f68fdd9facc31e + pristine_git_object: 066631ff906e75a3ded70c6e55460668376c457e src/react-query/agentsGet.core.ts: id: bf202f112850 last_write_checksum: sha1:ae2d4c525fe9ac849bcfafdec85702496dce2954 @@ -11665,6 +11797,14 @@ trackedFiles: id: 9dfa72974fdb last_write_checksum: sha1:405d20dd150bcea730d6eaad9556c3e559819d33 pristine_git_object: 4f13d0842c263131fa835901e506bac2a1984895 + src/react-query/agentsGetRun.core.ts: + id: b5f0a2ec4f34 + last_write_checksum: sha1:067c3942dc4d6d18f7692eee0a0949ab2eecdae2 + pristine_git_object: 1833a23879bfd02824366e3e75d4fd1605b7f0eb + src/react-query/agentsGetRun.ts: + id: 50ee42338ff5 + last_write_checksum: sha1:13d5343424edf54883f8381c46accd072ed2ef3d + pristine_git_object: fe3d1b31546829be53e18df5cfccbb0a9bcbcf3f src/react-query/agentsGetSchemas.core.ts: id: fcd506067f82 last_write_checksum: sha1:f8e5c3f43d73005e77b45cd753919ffd7ac8f31d @@ -12123,8 +12263,8 @@ trackedFiles: pristine_git_object: 7ea1d5c56f074fe08998790eed62e014c840891b src/react-query/index.ts: id: 9e975471aa65 - last_write_checksum: sha1:b059e53ac460fcf6fb8079740dacdd9bfde48a8e - pristine_git_object: 2cff4e7a36a28dee0b2c52db48bd7db500f2fa2c + last_write_checksum: sha1:aeb3b255f1f6abf718e3a4ed285a2ad321b96b87 + pristine_git_object: ba0a8f811f20e563645561cb012c83647f56f0e4 src/react-query/indexingAuthenticationRotateToken.ts: id: e56c0845e38e last_write_checksum: sha1:035d7baae9a7fd7c32f69211cfe85b0f6ccbbf8c @@ -12463,8 +12603,8 @@ trackedFiles: pristine_git_object: 22d7e4d2d9a50eed24ca462edf35cc26d5cb2d7c src/sdk/agents.ts: id: a103cd018c9b - last_write_checksum: sha1:cb63d1026f4069277ef5ea5fbcf856a5fdf95c16 - pristine_git_object: 69da82eba0c6b7f371093809067cd53fc0d2a9da + last_write_checksum: sha1:05eb76b9ca7ca3782d7a89659b645d4da4f8abef + pristine_git_object: 012c2a572f5b6142983281efc4fd9f686af04561 src/sdk/announcements.ts: id: bab6954d6fdf last_write_checksum: sha1:93294e5724028d07a0f9796519179222808b89a9 @@ -13646,7 +13786,7 @@ examples: path: agent_id: "" requestBody: - application/json: {"messages": [{"role": "USER", "content": [{"text": "What is our parental leave policy?", "type": "text"}]}], "stream": false} + application/json: {"messages": [{"role": "USER", "content": [{"text": "What is our parental leave policy?", "type": "text"}]}], "stream": false, "execution_mode": "REQUEST_BOUND"} responses: "200": application/json: {"run": {"agent_id": "", "messages": [{"role": "USER", "content": []}], "status": "error"}, "messages": [{"role": "USER", "content": []}], "request_id": ""} @@ -13657,6 +13797,8 @@ examples: application/problem+json: {"type": "https://developer.glean.com/errors/invalid-cursor", "title": "Invalid Pagination Cursor", "status": 400, "detail": "The provided cursor has expired. Start a new search to get a fresh cursor.\n", "code": "invalid_cursor", "documentation_url": "https://developer.glean.com/errors/invalid-cursor", "request_id": "req_7f8a9b0c1d2e", "errors": [{"pointer": "/messages/0/role", "detail": "Must be one of: USER, GLEAN_AI.", "code": "invalid_cursor"}]} "422": application/problem+json: {"type": "https://developers.glean.com/errors/invalid-cursor", "title": "Invalid Pagination Cursor", "status": 400, "detail": "The provided cursor has expired. Start a new search to get a fresh cursor.\n", "code": "invalid_cursor", "documentation_url": "https://developers.glean.com/errors/invalid-cursor", "request_id": "req_7f8a9b0c1d2e", "errors": [{"pointer": "/messages/0/role", "detail": "Must be one of: USER, GLEAN_AI.", "code": "invalid_cursor"}], "authentication_suggestions": []} + "201": + application/json: {"run": {"run_id": "", "agent_id": "", "state": "REQUIRES_INPUT", "created_at": "2025-06-25T09:13:22.201Z", "updated_at": "2024-01-10T17:12:38.186Z", "pending_interactions": []}, "request_id": ""} platform-search: speakeasy-default-platform-search: requestBody: @@ -13811,7 +13953,7 @@ examples: platform-chat-create: speakeasy-default-platform-chat-create: requestBody: - application/json: {"input": "What is our parental leave policy?", "stream": false, "store": true} + application/json: {"input": "Summarize our parental leave policy as JSON.", "stream": false, "store": true, "text": {"format": {"type": "JSON_SCHEMA", "name": "policy_summary", "schema": {"type": "object", "properties": {"eligible_employees": {"type": "string"}, "duration_weeks": {"type": "integer"}}, "required": ["eligible_employees", "duration_weeks"]}, "strict": true}}} responses: "200": application/json: {"id": "", "object": "RESPONSE", "created_at": "2026-05-19T05:32:52.505Z", "status": "COMPLETED", "output": [{"type": "MESSAGE", "role": "ASSISTANT", "content": [{"type": "OUTPUT_TEXT", "text": ""}]}], "store": false, "request_id": ""} @@ -14038,12 +14180,25 @@ examples: platform-chat-create-stream: speakeasy-default-platform-chat-create-stream: requestBody: - application/json: {"input": "What is our parental leave policy?", "stream": true, "store": true} + application/json: {"input": "Summarize our parental leave policy as JSON.", "stream": true, "store": true, "text": {"format": {"type": "JSON_SCHEMA", "name": "policy_summary", "schema": {"type": "object", "properties": {"eligible_employees": {"type": "string"}, "duration_weeks": {"type": "integer"}}, "required": ["eligible_employees", "duration_weeks"]}, "strict": true}}} responses: "400": application/problem+json: {"type": "https://developers.glean.com/errors/invalid-cursor", "title": "Invalid Pagination Cursor", "status": 400, "detail": "The provided cursor has expired. Start a new search to get a fresh cursor.\n", "code": "invalid_cursor", "documentation_url": "https://developers.glean.com/errors/invalid-cursor", "request_id": "req_7f8a9b0c1d2e", "errors": [{"pointer": "/messages/0/role", "detail": "Must be one of: USER, GLEAN_AI.", "code": "invalid_cursor"}]} "500": application/problem+json: {"type": "https://developers.glean.com/errors/invalid-cursor", "title": "Invalid Pagination Cursor", "status": 400, "detail": "The provided cursor has expired. Start a new search to get a fresh cursor.\n", "code": "invalid_cursor", "documentation_url": "https://developers.glean.com/errors/invalid-cursor", "request_id": "req_7f8a9b0c1d2e", "errors": [{"pointer": "/messages/0/role", "detail": "Must be one of: USER, GLEAN_AI.", "code": "invalid_cursor"}]} + platform-agents-get-run: + speakeasy-default-platform-agents-get-run: + parameters: + path: + agent_id: "{agent_id}" + run_id: "{run_id}" + responses: + "200": + application/json: {"run": {"run_id": "", "agent_id": "", "state": "CANCELLING", "created_at": "2025-02-20T06:37:06.101Z", "updated_at": "2025-06-13T07:24:18.599Z", "pending_interactions": []}, "request_id": ""} + "400": + application/problem+json: {"type": "https://developers.glean.com/errors/invalid-cursor", "title": "Invalid Pagination Cursor", "status": 400, "detail": "The provided cursor has expired. Start a new search to get a fresh cursor.\n", "code": "invalid_cursor", "documentation_url": "https://developers.glean.com/errors/invalid-cursor", "request_id": "req_7f8a9b0c1d2e", "errors": [{"pointer": "/messages/0/role", "detail": "Must be one of: USER, GLEAN_AI.", "code": "invalid_cursor"}]} + "500": + application/problem+json: {"type": "https://developers.glean.com/errors/invalid-cursor", "title": "Invalid Pagination Cursor", "status": 400, "detail": "The provided cursor has expired. Start a new search to get a fresh cursor.\n", "code": "invalid_cursor", "documentation_url": "https://developers.glean.com/errors/invalid-cursor", "request_id": "req_7f8a9b0c1d2e", "errors": [{"pointer": "/messages/0/role", "detail": "Must be one of: USER, GLEAN_AI.", "code": "invalid_cursor"}]} examplesVersion: 1.0.2 generatedTests: activity: "2025-05-05T15:08:35-05:00" @@ -14242,7 +14397,8 @@ generatedTests: platform-trigger-presets-get: "2026-08-21T02:36:10Z" platform-trigger-presets-input-values-list: "2026-08-21T02:36:10Z" platform-trigger-presets-events-search: "2026-08-21T02:36:10Z" -releaseNotes: "## Typescript SDK Changes:\n* `glean.agents.createRun()`: `response.run.messages[].content[].annotations` **Added**\n* `glean.client.agents.import()`: `request.importAgentRequest` **Changed**\n* `glean.client.agents.run()`: `response.run.messages[].content[].annotations` **Added**\n* `glean.client.search.retrieveFeed()`: \n * `request.feedRequest.categories[]` **Changed**\n * `response.results[]` **Changed**\n" + platform-agents-get-run: "2026-09-22T19:07:09Z" +releaseNotes: "## Typescript SDK Changes:\n* `glean.agents.createRun()`: \n * `request.platformAgentRunCreateRequest.executionMode` **Added**\n * `response.status[201]` **Added** (Breaking ⚠️)\n* `glean.agents.getRun()`: **Added**\n* `glean.chat.create()`: \n * `request.text` **Added**\n * `response.output[].content[].structuredOutput` **Added**\n* `glean.client.search.retrieveFeed()`: \n * `request.feedRequest.categories[]` **Changed**\n * `response.results[]` **Changed**\n" generatedFiles: - .devcontainer/README.md - .devcontainer/devcontainer.json diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 2ebd1c3d..e7cb71b2 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -35,7 +35,7 @@ generation: generateNewTests: true skipResponseBodyAssertions: true typescript: - version: 0.20.14 + version: 0.20.15 acceptHeaderEnum: true additionalDependencies: dependencies: {} diff --git a/.speakeasy/glean-merged-spec.yaml b/.speakeasy/glean-merged-spec.yaml index 7ee55ac5..4b11d616 100644 --- a/.speakeasy/glean-merged-spec.yaml +++ b/.speakeasy/glean-merged-spec.yaml @@ -2,8 +2,8 @@ openapi: 3.1.0 info: version: "0.9.0" title: Glean API - x-source-commit-sha: 5f1d873383438dc574c1075f9476915610e56875 - x-open-api-commit-sha: 6a8c8e16bbbca13a130766a72f307fb373b8256a + x-source-commit-sha: 8f42e777806876b3b03e36e55819028289be3f93 + x-open-api-commit-sha: d5ffe37692ede6640ab35274e0ee5aad842dfa03 description: | # Introduction In addition to the data sources that Glean has built-in support for, Glean also provides a REST API that enables customers to put arbitrary content in the search index. This is useful, for example, for doing permissions-aware search over content in internal tools that reside on-prem as well as for searching over applications that Glean does not currently support first class. In addition these APIs allow the customer to push organization data (people info, organization structure etc) into Glean. @@ -179,7 +179,7 @@ paths: - Agents summary: Create agent run description: | - Execute an agent run. Set `stream` to true to receive server-sent events; otherwise the response contains the final agent messages. + Execute an agent run. By default, set `stream` to true to receive server-sent events; otherwise the response contains the final agent messages. Set `execution_mode` to `DURABLE` to persist a new run and return its initial snapshot with HTTP 201 without waiting for execution. Poll the agent-scoped GET run endpoint for progress. Durable execution continues after an HTTP disconnect, but is not automatically resumed after a QE restart or crash. An active turn becomes overdue more than 40 minutes after acceptance (a 30-minute execution timeout plus 10 minutes of grace). The next GET of the run marks the overdue turn FAILED without replay; there is no periodic sweep. Without a GET, the stored run can remain RUNNING. Failure does not prove that external tool work has stopped. Paused runs are not expired. Each POST creates a new run; retrying a POST can create another execution. A run tracks one workflow execution; automatic background-subagent wake turns are separate executions, not continuations tracked by this run ID. operationId: platform-agents-create-run x-visibility: Public x-codegen-request-body-name: payload @@ -214,7 +214,6 @@ paths: id: 1 event: message data: {"messages":[{"role":"GLEAN_AI","content":[{"text":"Hello","type":"text"}]}]} - id: 2 event: message data: {"messages":[{"role":"GLEAN_AI","content":[{"text":", I can help with HR policy questions.","type":"text"}]}]} @@ -222,6 +221,13 @@ paths: id: 3 event: run.failed data: {"error":{"type":"https://developers.glean.com/errors/spend-limit-exceeded","title":"Spend Limit Exceeded","status":403,"detail":"You've reached the monthly limit set by your admin.","code":"spend_limit_exceeded","request_id":"req_123","documentation_url":"https://developers.glean.com/errors/spend-limit-exceeded"}} + "201": + description: | + Durable run persisted and started. The snapshot is immediately retrievable through GET /api/agents/{agent_id}/runs/{run_id}. Execution failures appear in the run state. + content: + application/json: + schema: + $ref: "#/components/schemas/PlatformAgentRunResponse" "400": $ref: "#/components/responses/PlatformBadRequest" "401": @@ -252,6 +258,61 @@ paths: x-speakeasy-name-override: createRun security: - APIToken: [] + /api/agents/{agent_id}/runs/{run_id}: + get: + tags: + - Agents + summary: Get agent run + description: | + Retrieve a persisted workflow execution owned by the authenticated user. The run must belong to the specified agent, and the user must still have access to that agent. Unknown runs, runs owned by another user, and mismatched agent/run identifiers return 404. Requires the agents.run scope. Executions without a persisted workflow record are not available through this endpoint. + operationId: platform-agents-get-run + x-visibility: Public + parameters: + - in: path + name: agent_id + description: ID of the agent that owns the run. + required: true + example: "{agent_id}" + schema: + type: string + minLength: 1 + maxLength: 256 + - in: path + name: run_id + description: ID of the durable run to retrieve. + required: true + example: "{run_id}" + schema: + type: string + minLength: 1 + maxLength: 256 + responses: + "200": + description: Current persisted run snapshot. A failed execution is still a successful retrieval. + content: + application/json: + schema: + $ref: "#/components/schemas/PlatformAgentRunResponse" + "400": + $ref: "#/components/responses/PlatformBadRequest" + "401": + $ref: "#/components/responses/PlatformUnauthorized" + "403": + $ref: "#/components/responses/PlatformForbidden" + "404": + $ref: "#/components/responses/PlatformNotFound" + "408": + $ref: "#/components/responses/PlatformRequestTimeout" + "429": + $ref: "#/components/responses/PlatformTooManyRequests" + "500": + $ref: "#/components/responses/PlatformInternalServerError" + "503": + $ref: "#/components/responses/PlatformServiceUnavailable" + x-speakeasy-group: agents + x-speakeasy-name-override: getRun + security: + - APIToken: [] /api/chat: post: tags: @@ -7351,8 +7412,16 @@ components: additionalProperties: true stream: type: boolean - description: Whether to stream the run response as server-sent events. + description: Whether to stream the run response as server-sent events. Not supported in DURABLE mode. default: false + execution_mode: + type: string + enum: + - REQUEST_BOUND + - DURABLE + default: REQUEST_BOUND + description: | + REQUEST_BOUND preserves the existing wait/stream behavior. DURABLE starts a fresh, persisted execution with a 30-minute execution timeout and returns immediately. DURABLE requires stream to be false or omitted and does not accept metadata.chat_session_id. It does not bypass tool approval requirements or provide automatic QE-crash resumption. Expiry is read-triggered: the next GET of the run marks an active turn FAILED if more than 40 minutes have passed since the turn was accepted. There is no periodic sweep, so the stored run can remain RUNNING until it is read. Expiry never replays execution or expires approval-paused runs, and failure does not prove that external tool work has stopped. PlatformAgentRunCreate: type: object required: @@ -7404,6 +7473,124 @@ components: request_id: type: string description: Platform-generated request ID for support correlation. + PlatformAgentRunState: + type: string + enum: + - QUEUED + - RUNNING + - REQUIRES_INPUT + - SUCCEEDED + - FAILED + - CANCELLING + - CANCELLED + - EXPIRED + description: State of the persisted workflow execution. REQUIRES_INPUT is nonterminal. + PlatformAgentRunToolApproval: + type: object + description: Pending approval for a specific persisted tool invocation and its arguments. + required: + - interaction_id + - type + - display_name + - description + - arguments + properties: + interaction_id: + type: string + description: Identifies this specific invocation approval, not the tool definition. + type: + type: string + enum: + - TOOL_APPROVAL + description: Interaction type identifying a tool execution approval request. + tool_id: + type: string + description: Platform tool identifier when recorded. Omitted for requests without one, such as some MCP tools. + display_name: + type: string + description: Display name of the tool requesting approval. + description: + type: string + description: Description of the tool associated with this approval request. + arguments: + type: object + additionalProperties: true + description: Arguments from the persisted approval request. Older platform tools use flattened parameters. + expires_at: + type: string + format: date-time + description: Approval deadline, when one is set. Omitted when the approval has no expiration. + PlatformAgentRunError: + type: object + description: Caller-safe details of an agent run execution failure. + required: + - code + - message + properties: + code: + type: string + description: Machine-readable execution failure code. + message: + type: string + description: Caller-safe execution failure description. + PlatformDurableAgentRun: + type: object + description: Agent run state, pending tool approvals, and output available independently of the creation request. + required: + - run_id + - agent_id + - state + - created_at + - updated_at + - pending_interactions + properties: + run_id: + type: string + description: ID of the run, preserved across approval continuations. + agent_id: + type: string + description: ID of the agent that owns the run. + state: + $ref: "#/components/schemas/PlatformAgentRunState" + description: Current lifecycle state of the run. + created_at: + type: string + format: date-time + description: Timestamp when the run was first persisted. + updated_at: + type: string + format: date-time + description: | + Latest persisted activity timestamp across the execution and its messages, including checkpoint messages. This is not a worker heartbeat or an exact state-transition timestamp. + expires_at: + type: string + format: date-time + description: Execution deadline, when one is set. Not the run history retention deadline. + pending_interactions: + type: array + description: Unanswered tool approvals when the run is in REQUIRES_INPUT. Empty in other states. + items: + $ref: "#/components/schemas/PlatformAgentRunToolApproval" + output: + type: object + additionalProperties: true + description: Accumulated text-only agent output under the messages key, when available. + error: + $ref: "#/components/schemas/PlatformAgentRunError" + description: Caller-safe failure details when the run is in FAILED. + PlatformAgentRunResponse: + type: object + description: Persisted agent run snapshot with a request ID for support correlation. + required: + - run + - request_id + properties: + run: + $ref: "#/components/schemas/PlatformDurableAgentRun" + description: Current persisted snapshot of the requested agent run. + request_id: + type: string + description: Platform-generated request ID for support correlation. PlatformAuthenticationSuggestion: type: object description: One tool the caller must authorize before the agent can run. @@ -7444,13 +7631,72 @@ components: content: type: string minLength: 1 + PlatformChatTextFormat: + type: object + additionalProperties: false + description: Unconstrained plain-text assistant output. + required: + - type + properties: + type: + type: string + description: Discriminator. Must be TEXT. + enum: + - TEXT + PlatformChatJsonSchemaFormat: + type: object + additionalProperties: false + description: Constrains the assistant response to a caller-supplied JSON Schema. + required: + - type + - name + - schema + properties: + type: + type: string + description: Discriminator. Must be JSON_SCHEMA. + enum: + - JSON_SCHEMA + name: + type: string + minLength: 1 + maxLength: 64 + description: A stable identifier for the schema. + description: + type: string + maxLength: 1024 + description: An optional human-readable description of the schema. + schema: + type: object + additionalProperties: true + description: A JSON Schema object describing the desired output shape. + strict: + type: boolean + default: true + description: | + When true, the provider validates the response against the schema. Unsupported by some providers; defaults to true. PlatformChatCreateRequest: type: object additionalProperties: false required: - input example: - input: What is our parental leave policy? + input: Summarize our parental leave policy as JSON. + text: + format: + type: JSON_SCHEMA + name: policy_summary + schema: + type: object + properties: + eligible_employees: + type: string + duration_weeks: + type: integer + required: + - eligible_employees + - duration_weeks + strict: true properties: input: description: | @@ -7477,6 +7723,18 @@ components: minLength: 1 description: | Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`. + text: + type: object + additionalProperties: false + description: | + Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true. + properties: + format: + description: | + Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. + oneOf: + - $ref: "#/components/schemas/PlatformChatTextFormat" + - $ref: "#/components/schemas/PlatformChatJsonSchemaFormat" PlatformChatStreamResponseId: type: string minLength: 1 @@ -7496,6 +7754,12 @@ components: - OUTPUT_TEXT text: type: string + structured_output: + type: + - object + - "null" + description: | + Parsed and validated JSON object when structured output was requested. Present only when the request included `text.format.type: JSON_SCHEMA`. annotations: type: array items: @@ -16128,6 +16392,8 @@ components: - EDIT_DOC - CHAT_TO_ARTIFACT - SHARE_ARTIFACT + - CREATE_AGENT + - MANAGER_INVITE description: Categories of content requested. An allowlist gives flexibility to request content separately or together. requestOptions: $ref: '#/components/schemas/FeedRequestOptions' @@ -16603,6 +16869,8 @@ components: - EDIT_DOC - CHAT_TO_ARTIFACT - SHARE_ARTIFACT + - CREATE_AGENT + - MANAGER_INVITE description: Type of the justification. justification: type: string @@ -16701,6 +16969,8 @@ components: - EDIT_DOC - CHAT_TO_ARTIFACT - SHARE_ARTIFACT + - CREATE_AGENT + - MANAGER_INVITE description: Category of the result, one of the requested categories in incoming request. primaryEntry: $ref: '#/components/schemas/FeedEntry' diff --git a/.speakeasy/tests.arazzo.yaml b/.speakeasy/tests.arazzo.yaml index 5cf19970..ee17e590 100644 --- a/.speakeasy/tests.arazzo.yaml +++ b/.speakeasy/tests.arazzo.yaml @@ -164670,6 +164670,7 @@ workflows: requestBody: contentType: application/json payload: + execution_mode: REQUEST_BOUND messages: - content: - text: What is our parental leave policy? @@ -164933,9 +164934,24 @@ workflows: requestBody: contentType: application/json payload: - input: What is our parental leave policy? + input: Summarize our parental leave policy as JSON. store: true stream: false + text: + format: + name: policy_summary + schema: + properties: + duration_weeks: + type: integer + eligible_employees: + type: string + required: + - eligible_employees + - duration_weeks + type: object + strict: true + type: JSON_SCHEMA successCriteria: - condition: $statusCode == 200 - condition: $response.header.Content-Type == application/json @@ -165344,3 +165360,23 @@ workflows: type: simple x-speakeasy-test-group: triggers x-speakeasy-test-rebuild: true + - workflowId: platform-agents-get-run + steps: + - stepId: test + operationId: platform-agents-get-run + parameters: + - name: agent_id + in: path + value: '{agent_id}' + - name: run_id + in: path + value: '{run_id}' + successCriteria: + - condition: $statusCode == 200 + - condition: $response.header.Content-Type == application/json + - context: $response.body + condition: | + {"run":{"run_id":"","agent_id":"","state":"CANCELLING","created_at":"2025-02-20T06:37:06.101Z","updated_at":"2025-06-13T07:24:18.599Z","pending_interactions":[]},"request_id":""} + type: simple + x-speakeasy-test-group: agents + x-speakeasy-test-rebuild: true diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index f4f8219c..34ef2eff 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,9 +1,9 @@ -speakeasyVersion: 1.797.0 +speakeasyVersion: 1.798.0 sources: Glean API: sourceNamespace: glean-api-specs - sourceRevisionDigest: sha256:1f470e422d6b202bf6bb80cc2e4b73077b7dab6d476cda804245fc0402ea42f1 - sourceBlobDigest: sha256:8919e7ffe50c1ca78844cd89c216e8ab3c54a8e0003bd5072e7fe3cd35fb192c + sourceRevisionDigest: sha256:88d2bf2cb0dc64862b19d8b94fbe1b0fcd48e1c0bbb599eee2652a14f9360947 + sourceBlobDigest: sha256:e1969f660ed944921bc964277ca42738783d270c3536417f4a83b83438fefa22 tags: - latest Glean Client API: @@ -17,10 +17,10 @@ targets: glean: source: Glean API sourceNamespace: glean-api-specs - sourceRevisionDigest: sha256:1f470e422d6b202bf6bb80cc2e4b73077b7dab6d476cda804245fc0402ea42f1 - sourceBlobDigest: sha256:8919e7ffe50c1ca78844cd89c216e8ab3c54a8e0003bd5072e7fe3cd35fb192c + sourceRevisionDigest: sha256:88d2bf2cb0dc64862b19d8b94fbe1b0fcd48e1c0bbb599eee2652a14f9360947 + sourceBlobDigest: sha256:e1969f660ed944921bc964277ca42738783d270c3536417f4a83b83438fefa22 codeSamplesNamespace: glean-api-specs-typescript-code-samples - codeSamplesRevisionDigest: sha256:1643817955ea280485c29d96f92a6d2cdbeb373316da14030508b50af39af7c7 + codeSamplesRevisionDigest: sha256:488102bc9299ce4f158b44c2b3d8b81438f89e279ce6bc4b81cedac224e36f0c workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index 2ae8fb10..5060ded7 100644 --- a/README.md +++ b/README.md @@ -266,6 +266,7 @@ For more information on obtaining the appropriate token type, please contact you * [get](docs/sdks/agents/README.md#get) - Get agent * [getSchemas](docs/sdks/agents/README.md#getschemas) - Get agent schemas * [createRun](docs/sdks/agents/README.md#createrun) - Create agent run +* [getRun](docs/sdks/agents/README.md#getrun) - Get agent run ### [Chat](docs/sdks/chat/README.md) @@ -554,6 +555,7 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md). - [`agentsCreateRun`](docs/sdks/agents/README.md#createrun) - Create agent run - [`agentsGet`](docs/sdks/agents/README.md#get) - Get agent +- [`agentsGetRun`](docs/sdks/agents/README.md#getrun) - Get agent run - [`agentsGetSchemas`](docs/sdks/agents/README.md#getschemas) - Get agent schemas - [`agentsSearch`](docs/sdks/agents/README.md#search) - Search agents - [`chatCreate`](docs/sdks/chat/README.md#create) - Create a chat response @@ -752,6 +754,7 @@ To learn about this feature and how to get started, check - [`useAgentsCreateRunMutation`](docs/sdks/agents/README.md#createrun) - Create agent run - [`useAgentsGet`](docs/sdks/agents/README.md#get) - Get agent +- [`useAgentsGetRun`](docs/sdks/agents/README.md#getrun) - Get agent run - [`useAgentsGetSchemas`](docs/sdks/agents/README.md#getschemas) - Get agent schemas - [`useAgentsSearchMutation`](docs/sdks/agents/README.md#search) - Search agents - [`useChatCreateMutation`](docs/sdks/chat/README.md#create) - Create a chat response @@ -944,7 +947,29 @@ const glean = new Glean({ async function run() { const result = await glean.chat.createStream({ - input: "What is our parental leave policy?", + input: "Summarize our parental leave policy as JSON.", + text: { + format: { + type: "JSON_SCHEMA", + name: "policy_summary", + schema: { + "type": "object", + "properties": { + "eligible_employees": { + "type": "string", + }, + "duration_weeks": { + "type": "integer", + }, + }, + "required": [ + "eligible_employees", + "duration_weeks", + ], + }, + strict: true, + }, + }, }); for await (const event of result) { diff --git a/RELEASES.md b/RELEASES.md index 5276d906..1a0b6945 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1028,4 +1028,14 @@ Based on: ### Generated - [typescript v0.20.14] . ### Releases -- [NPM v0.20.14] https://www.npmjs.com/package/@gleanwork/api-client/v/0.20.14 - . \ No newline at end of file +- [NPM v0.20.14] https://www.npmjs.com/package/@gleanwork/api-client/v/0.20.14 - . + +## 2026-09-22 19:03:16 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.798.0 (2.938.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v0.20.15] . +### Releases +- [NPM v0.20.15] https://www.npmjs.com/package/@gleanwork/api-client/v/0.20.15 - . \ No newline at end of file diff --git a/docs/models/components/executionmode.md b/docs/models/components/executionmode.md new file mode 100644 index 00000000..cf562e29 --- /dev/null +++ b/docs/models/components/executionmode.md @@ -0,0 +1,18 @@ +# ExecutionMode + +REQUEST_BOUND preserves the existing wait/stream behavior. DURABLE starts a fresh, persisted execution with a 30-minute execution timeout and returns immediately. DURABLE requires stream to be false or omitted and does not accept metadata.chat_session_id. It does not bypass tool approval requirements or provide automatic QE-crash resumption. Expiry is read-triggered: the next GET of the run marks an active turn FAILED if more than 40 minutes have passed since the turn was accepted. There is no periodic sweep, so the stored run can remain RUNNING until it is read. Expiry never replays execution or expires approval-paused runs, and failure does not prove that external tool work has stopped. + + +## Example Usage + +```typescript +import { ExecutionMode } from "@gleanwork/api-client/models/components"; + +let value: ExecutionMode = "REQUEST_BOUND"; +``` + +## Values + +```typescript +"REQUEST_BOUND" | "DURABLE" +``` \ No newline at end of file diff --git a/docs/models/components/feedrequestcategory.md b/docs/models/components/feedrequestcategory.md index 68b21990..525c3f56 100644 --- a/docs/models/components/feedrequestcategory.md +++ b/docs/models/components/feedrequestcategory.md @@ -5,11 +5,11 @@ ```typescript import { FeedRequestCategory } from "@gleanwork/api-client/models/components"; -let value: FeedRequestCategory = "MID_DAY_CATCH_UP"; +let value: FeedRequestCategory = "QUERY_SUGGESTION"; ``` ## Values ```typescript -"DOCUMENT_SUGGESTION" | "DOCUMENT_SUGGESTION_SCENARIO" | "TRENDING_DOCUMENT" | "VERIFICATION_REMINDER" | "EVENT" | "ANNOUNCEMENT" | "MENTION" | "DATASOURCE_AFFINITY" | "RECENT" | "COMPANY_RESOURCE" | "EXPERIMENTAL" | "PEOPLE_CELEBRATIONS" | "DISPLAYABLE_LIST" | "SOCIAL_LINK" | "EXTERNAL_TASKS" | "WORKFLOW_COLLECTIONS" | "ZERO_STATE_CHAT_SUGGESTION" | "ZERO_STATE_CHAT_TOOL_SUGGESTION" | "ZERO_STATE_WORKFLOW_CREATED_BY_ME" | "ZERO_STATE_WORKFLOW_FAVORITES" | "ZERO_STATE_WORKFLOW_POPULAR" | "ZERO_STATE_WORKFLOW_RECENT" | "ZERO_STATE_WORKFLOW_SUGGESTION" | "PERSONALIZED_CHAT_SUGGESTION" | "DAILY_DIGEST" | "PODCAST" | "TASK" | "PLAN_MY_DAY" | "END_MY_DAY" | "STARTER_KIT" | "MEETING_PREP_AUTOMATION" | "MID_DAY_CATCH_UP" | "QUERY_SUGGESTION" | "COWORK_CUJ_PROMO" | "CARD_STACK_PROMO" | "WEEKLY_MEETINGS" | "FOLLOW_UP" | "MILESTONE_TIMELINE_CHECK" | "PROJECT_DISCUSSION_DIGEST" | "PROJECT_FOCUS_BLOCK" | "PROJECT_NEXT_STEP" | "DEMO_CARD" | "RESOLVE_MEETING_CONFLICT" | "FINDING_MEETING_ROOM" | "OOO_PLANNER" | "OOO_CATCH_UP" | "ADMIN_HEALTH_CENTER" | "KNOWLEDGE_GAP" | "ARTIFACT_CREATION" | "EDIT_DOC" | "CHAT_TO_ARTIFACT" | "SHARE_ARTIFACT" +"DOCUMENT_SUGGESTION" | "DOCUMENT_SUGGESTION_SCENARIO" | "TRENDING_DOCUMENT" | "VERIFICATION_REMINDER" | "EVENT" | "ANNOUNCEMENT" | "MENTION" | "DATASOURCE_AFFINITY" | "RECENT" | "COMPANY_RESOURCE" | "EXPERIMENTAL" | "PEOPLE_CELEBRATIONS" | "DISPLAYABLE_LIST" | "SOCIAL_LINK" | "EXTERNAL_TASKS" | "WORKFLOW_COLLECTIONS" | "ZERO_STATE_CHAT_SUGGESTION" | "ZERO_STATE_CHAT_TOOL_SUGGESTION" | "ZERO_STATE_WORKFLOW_CREATED_BY_ME" | "ZERO_STATE_WORKFLOW_FAVORITES" | "ZERO_STATE_WORKFLOW_POPULAR" | "ZERO_STATE_WORKFLOW_RECENT" | "ZERO_STATE_WORKFLOW_SUGGESTION" | "PERSONALIZED_CHAT_SUGGESTION" | "DAILY_DIGEST" | "PODCAST" | "TASK" | "PLAN_MY_DAY" | "END_MY_DAY" | "STARTER_KIT" | "MEETING_PREP_AUTOMATION" | "MID_DAY_CATCH_UP" | "QUERY_SUGGESTION" | "COWORK_CUJ_PROMO" | "CARD_STACK_PROMO" | "WEEKLY_MEETINGS" | "FOLLOW_UP" | "MILESTONE_TIMELINE_CHECK" | "PROJECT_DISCUSSION_DIGEST" | "PROJECT_FOCUS_BLOCK" | "PROJECT_NEXT_STEP" | "DEMO_CARD" | "RESOLVE_MEETING_CONFLICT" | "FINDING_MEETING_ROOM" | "OOO_PLANNER" | "OOO_CATCH_UP" | "ADMIN_HEALTH_CENTER" | "KNOWLEDGE_GAP" | "ARTIFACT_CREATION" | "EDIT_DOC" | "CHAT_TO_ARTIFACT" | "SHARE_ARTIFACT" | "CREATE_AGENT" | "MANAGER_INVITE" ``` \ No newline at end of file diff --git a/docs/models/components/feedresponse.md b/docs/models/components/feedresponse.md index e0d78966..29916453 100644 --- a/docs/models/components/feedresponse.md +++ b/docs/models/components/feedresponse.md @@ -9,7 +9,7 @@ let value: FeedResponse = { serverTimestamp: 603266, results: [ { - category: "ANNOUNCEMENT", + category: "MENTION", primaryEntry: { title: "", createdBy: { diff --git a/docs/models/components/feedresult.md b/docs/models/components/feedresult.md index df7d2fa2..bb2f4557 100644 --- a/docs/models/components/feedresult.md +++ b/docs/models/components/feedresult.md @@ -6,7 +6,7 @@ import { FeedResult } from "@gleanwork/api-client/models/components"; let value: FeedResult = { - category: "PROJECT_NEXT_STEP", + category: "DEMO_CARD", primaryEntry: { title: "", createdBy: { diff --git a/docs/models/components/feedresultcategory.md b/docs/models/components/feedresultcategory.md index 120f229d..d8bc8a1c 100644 --- a/docs/models/components/feedresultcategory.md +++ b/docs/models/components/feedresultcategory.md @@ -7,7 +7,7 @@ Category of the result, one of the requested categories in incoming request. ```typescript import { FeedResultCategory } from "@gleanwork/api-client/models/components"; -let value: FeedResultCategory = "CARD_STACK_PROMO"; +let value: FeedResultCategory = "FOLLOW_UP"; // Open enum: unrecognized values are captured as Unrecognized ``` @@ -15,5 +15,5 @@ let value: FeedResultCategory = "CARD_STACK_PROMO"; ## Values ```typescript -"DOCUMENT_SUGGESTION" | "DOCUMENT_SUGGESTION_SCENARIO" | "TRENDING_DOCUMENT" | "USE_CASE" | "VERIFICATION_REMINDER" | "EVENT" | "ANNOUNCEMENT" | "MENTION" | "DATASOURCE_AFFINITY" | "RECENT" | "COMPANY_RESOURCE" | "EXPERIMENTAL" | "PEOPLE_CELEBRATIONS" | "SOCIAL_LINK" | "EXTERNAL_TASKS" | "DISPLAYABLE_LIST" | "ZERO_STATE_CHAT_SUGGESTION" | "ZERO_STATE_CHAT_TOOL_SUGGESTION" | "ZERO_STATE_WORKFLOW_CREATED_BY_ME" | "ZERO_STATE_WORKFLOW_FAVORITES" | "ZERO_STATE_WORKFLOW_POPULAR" | "ZERO_STATE_WORKFLOW_RECENT" | "ZERO_STATE_WORKFLOW_SUGGESTION" | "PERSONALIZED_CHAT_SUGGESTION" | "DAILY_DIGEST" | "PODCAST" | "TASK" | "PLAN_MY_DAY" | "END_MY_DAY" | "STARTER_KIT" | "MEETING_PREP_AUTOMATION" | "MID_DAY_CATCH_UP" | "QUERY_SUGGESTION" | "COWORK_CUJ_PROMO" | "CARD_STACK_PROMO" | "WEEKLY_MEETINGS" | "FOLLOW_UP" | "MILESTONE_TIMELINE_CHECK" | "PROJECT_DISCUSSION_DIGEST" | "PROJECT_FOCUS_BLOCK" | "PROJECT_NEXT_STEP" | "DEMO_CARD" | "RESOLVE_MEETING_CONFLICT" | "FINDING_MEETING_ROOM" | "OOO_PLANNER" | "OOO_CATCH_UP" | "ADMIN_HEALTH_CENTER" | "KNOWLEDGE_GAP" | "ARTIFACT_CREATION" | "EDIT_DOC" | "CHAT_TO_ARTIFACT" | "SHARE_ARTIFACT" | Unrecognized +"DOCUMENT_SUGGESTION" | "DOCUMENT_SUGGESTION_SCENARIO" | "TRENDING_DOCUMENT" | "USE_CASE" | "VERIFICATION_REMINDER" | "EVENT" | "ANNOUNCEMENT" | "MENTION" | "DATASOURCE_AFFINITY" | "RECENT" | "COMPANY_RESOURCE" | "EXPERIMENTAL" | "PEOPLE_CELEBRATIONS" | "SOCIAL_LINK" | "EXTERNAL_TASKS" | "DISPLAYABLE_LIST" | "ZERO_STATE_CHAT_SUGGESTION" | "ZERO_STATE_CHAT_TOOL_SUGGESTION" | "ZERO_STATE_WORKFLOW_CREATED_BY_ME" | "ZERO_STATE_WORKFLOW_FAVORITES" | "ZERO_STATE_WORKFLOW_POPULAR" | "ZERO_STATE_WORKFLOW_RECENT" | "ZERO_STATE_WORKFLOW_SUGGESTION" | "PERSONALIZED_CHAT_SUGGESTION" | "DAILY_DIGEST" | "PODCAST" | "TASK" | "PLAN_MY_DAY" | "END_MY_DAY" | "STARTER_KIT" | "MEETING_PREP_AUTOMATION" | "MID_DAY_CATCH_UP" | "QUERY_SUGGESTION" | "COWORK_CUJ_PROMO" | "CARD_STACK_PROMO" | "WEEKLY_MEETINGS" | "FOLLOW_UP" | "MILESTONE_TIMELINE_CHECK" | "PROJECT_DISCUSSION_DIGEST" | "PROJECT_FOCUS_BLOCK" | "PROJECT_NEXT_STEP" | "DEMO_CARD" | "RESOLVE_MEETING_CONFLICT" | "FINDING_MEETING_ROOM" | "OOO_PLANNER" | "OOO_CATCH_UP" | "ADMIN_HEALTH_CENTER" | "KNOWLEDGE_GAP" | "ARTIFACT_CREATION" | "EDIT_DOC" | "CHAT_TO_ARTIFACT" | "SHARE_ARTIFACT" | "CREATE_AGENT" | "MANAGER_INVITE" | Unrecognized ``` \ No newline at end of file diff --git a/docs/models/components/justificationtype.md b/docs/models/components/justificationtype.md index a4a63343..d0678b54 100644 --- a/docs/models/components/justificationtype.md +++ b/docs/models/components/justificationtype.md @@ -7,7 +7,7 @@ Type of the justification. ```typescript import { JustificationType } from "@gleanwork/api-client/models/components"; -let value: JustificationType = "PODCAST"; +let value: JustificationType = "TASK"; // Open enum: unrecognized values are captured as Unrecognized ``` @@ -15,5 +15,5 @@ let value: JustificationType = "PODCAST"; ## Values ```typescript -"FREQUENTLY_ACCESSED" | "RECENTLY_ACCESSED" | "TRENDING_DOCUMENT" | "VERIFICATION_REMINDER" | "SUGGESTED_DOCUMENT" | "EMPTY_STATE_SUGGESTION" | "FRECENCY_SCORED" | "SERVER_GENERATED" | "USE_CASE" | "UPDATE_SINCE_LAST_VIEW" | "RECENTLY_STARTED" | "EVENT" | "USER_MENTION" | "ANNOUNCEMENT" | "EXTERNAL_ANNOUNCEMENT" | "POPULARITY_BASED_TRENDING" | "COMPANY_RESOURCE" | "EVENT_DOCUMENT_FROM_CONTENT" | "EVENT_DOCUMENT_FROM_SEARCH" | "VISIT_AFFINITY_SCORED" | "SUGGESTED_APP" | "SUGGESTED_PERSON" | "ACTIVITY_HIGHLIGHT" | "SAVED_SEARCH" | "SUGGESTED_CHANNEL" | "PEOPLE_CELEBRATIONS" | "SOCIAL_LINK" | "ZERO_STATE_CHAT_SUGGESTION" | "ZERO_STATE_CHAT_TOOL_SUGGESTION" | "ZERO_STATE_PROMPT_TEMPLATE_SUGGESTION" | "ZERO_STATE_STATIC_WORKFLOW_SUGGESTION" | "ZERO_STATE_AGENT_SUGGESTION" | "PERSONALIZED_CHAT_SUGGESTION" | "DAILY_DIGEST" | "PODCAST" | "TASK" | "PLAN_MY_DAY" | "END_MY_DAY" | "STARTER_KIT_EXTENSION" | "STARTER_KIT_ORG_CHART" | "STARTER_KIT_ADD_DOC" | "MEETING_RECAP" | "MEETING_ROOM" | "MEETING_PREP_AUTOMATION" | "ACTIVE_DISCUSSION" | "MID_DAY_CATCH_UP" | "QUERY_SUGGESTION" | "COWORK_CUJ_PROMO" | "CARD_STACK_PROMO" | "WEEKLY_MEETINGS" | "FOLLOW_UP" | "MILESTONE_TIMELINE_CHECK" | "PROJECT_DISCUSSION_DIGEST" | "PROJECT_FOCUS_BLOCK" | "PROJECT_NEXT_STEP" | "DEMO_CARD" | "RESOLVE_MEETING_CONFLICT" | "FINDING_MEETING_ROOM" | "OOO_PLANNER" | "OOO_CATCH_UP" | "ADMIN_HEALTH_CENTER" | "KNOWLEDGE_GAP" | "ARTIFACT_CREATION" | "EDIT_DOC" | "CHAT_TO_ARTIFACT" | "SHARE_ARTIFACT" | Unrecognized +"FREQUENTLY_ACCESSED" | "RECENTLY_ACCESSED" | "TRENDING_DOCUMENT" | "VERIFICATION_REMINDER" | "SUGGESTED_DOCUMENT" | "EMPTY_STATE_SUGGESTION" | "FRECENCY_SCORED" | "SERVER_GENERATED" | "USE_CASE" | "UPDATE_SINCE_LAST_VIEW" | "RECENTLY_STARTED" | "EVENT" | "USER_MENTION" | "ANNOUNCEMENT" | "EXTERNAL_ANNOUNCEMENT" | "POPULARITY_BASED_TRENDING" | "COMPANY_RESOURCE" | "EVENT_DOCUMENT_FROM_CONTENT" | "EVENT_DOCUMENT_FROM_SEARCH" | "VISIT_AFFINITY_SCORED" | "SUGGESTED_APP" | "SUGGESTED_PERSON" | "ACTIVITY_HIGHLIGHT" | "SAVED_SEARCH" | "SUGGESTED_CHANNEL" | "PEOPLE_CELEBRATIONS" | "SOCIAL_LINK" | "ZERO_STATE_CHAT_SUGGESTION" | "ZERO_STATE_CHAT_TOOL_SUGGESTION" | "ZERO_STATE_PROMPT_TEMPLATE_SUGGESTION" | "ZERO_STATE_STATIC_WORKFLOW_SUGGESTION" | "ZERO_STATE_AGENT_SUGGESTION" | "PERSONALIZED_CHAT_SUGGESTION" | "DAILY_DIGEST" | "PODCAST" | "TASK" | "PLAN_MY_DAY" | "END_MY_DAY" | "STARTER_KIT_EXTENSION" | "STARTER_KIT_ORG_CHART" | "STARTER_KIT_ADD_DOC" | "MEETING_RECAP" | "MEETING_ROOM" | "MEETING_PREP_AUTOMATION" | "ACTIVE_DISCUSSION" | "MID_DAY_CATCH_UP" | "QUERY_SUGGESTION" | "COWORK_CUJ_PROMO" | "CARD_STACK_PROMO" | "WEEKLY_MEETINGS" | "FOLLOW_UP" | "MILESTONE_TIMELINE_CHECK" | "PROJECT_DISCUSSION_DIGEST" | "PROJECT_FOCUS_BLOCK" | "PROJECT_NEXT_STEP" | "DEMO_CARD" | "RESOLVE_MEETING_CONFLICT" | "FINDING_MEETING_ROOM" | "OOO_PLANNER" | "OOO_CATCH_UP" | "ADMIN_HEALTH_CENTER" | "KNOWLEDGE_GAP" | "ARTIFACT_CREATION" | "EDIT_DOC" | "CHAT_TO_ARTIFACT" | "SHARE_ARTIFACT" | "CREATE_AGENT" | "MANAGER_INVITE" | Unrecognized ``` \ No newline at end of file diff --git a/docs/models/components/platformagentruncreaterequest.md b/docs/models/components/platformagentruncreaterequest.md index 046c9b4e..67748f70 100644 --- a/docs/models/components/platformagentruncreaterequest.md +++ b/docs/models/components/platformagentruncreaterequest.md @@ -25,9 +25,10 @@ let value: PlatformAgentRunCreateRequest = { ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `input` | Record | :heavy_minus_sign: | Input fields for an input-form triggered agent. | -| `messages` | [components.PlatformMessageInput](../../models/components/platformmessageinput.md)[] | :heavy_minus_sign: | Messages to pass to the agent. When provided, the array MUST contain at least one message and each message MUST specify a valid `role` and non-empty `content`.
| -| `metadata` | Record | :heavy_minus_sign: | Metadata to pass to the agent. | -| `stream` | *boolean* | :heavy_minus_sign: | Whether to stream the run response as server-sent events. | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `input` | Record | :heavy_minus_sign: | Input fields for an input-form triggered agent. | +| `messages` | [components.PlatformMessageInput](../../models/components/platformmessageinput.md)[] | :heavy_minus_sign: | Messages to pass to the agent. When provided, the array MUST contain at least one message and each message MUST specify a valid `role` and non-empty `content`.
| +| `metadata` | Record | :heavy_minus_sign: | Metadata to pass to the agent. | +| `stream` | *boolean* | :heavy_minus_sign: | Whether to stream the run response as server-sent events. Not supported in DURABLE mode. | +| `executionMode` | [components.ExecutionMode](../../models/components/executionmode.md) | :heavy_minus_sign: | REQUEST_BOUND preserves the existing wait/stream behavior. DURABLE starts a fresh, persisted execution with a 30-minute execution timeout and returns immediately. DURABLE requires stream to be false or omitted and does not accept metadata.chat_session_id. It does not bypass tool approval requirements or provide automatic QE-crash resumption. Expiry is read-triggered: the next GET of the run marks an active turn FAILED if more than 40 minutes have passed since the turn was accepted. There is no periodic sweep, so the stored run can remain RUNNING until it is read. Expiry never replays execution or expires approval-paused runs, and failure does not prove that external tool work has stopped.
| \ No newline at end of file diff --git a/docs/models/components/platformagentrunerror.md b/docs/models/components/platformagentrunerror.md new file mode 100644 index 00000000..7a9a7f11 --- /dev/null +++ b/docs/models/components/platformagentrunerror.md @@ -0,0 +1,21 @@ +# PlatformAgentRunError + +Caller-safe details of an agent run execution failure. + +## Example Usage + +```typescript +import { PlatformAgentRunError } from "@gleanwork/api-client/models/components"; + +let value: PlatformAgentRunError = { + code: "", + message: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| `code` | *string* | :heavy_check_mark: | Machine-readable execution failure code. | +| `message` | *string* | :heavy_check_mark: | Caller-safe execution failure description. | \ No newline at end of file diff --git a/docs/models/components/platformagentrunresponse.md b/docs/models/components/platformagentrunresponse.md new file mode 100644 index 00000000..44bde417 --- /dev/null +++ b/docs/models/components/platformagentrunresponse.md @@ -0,0 +1,28 @@ +# PlatformAgentRunResponse + +Persisted agent run snapshot with a request ID for support correlation. + +## Example Usage + +```typescript +import { PlatformAgentRunResponse } from "@gleanwork/api-client/models/components"; + +let value: PlatformAgentRunResponse = { + run: { + run_id: "", + agent_id: "", + state: "RUNNING", + created_at: new Date("2025-07-02T11:33:51.838Z"), + updated_at: new Date("2024-12-21T16:46:41.143Z"), + pending_interactions: [], + }, + request_id: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `run` | [components.PlatformDurableAgentRun](../../models/components/platformdurableagentrun.md) | :heavy_check_mark: | Agent run state, pending tool approvals, and output available independently of the creation request. | +| `requestId` | *string* | :heavy_check_mark: | Platform-generated request ID for support correlation. | \ No newline at end of file diff --git a/docs/models/components/platformagentrunstate.md b/docs/models/components/platformagentrunstate.md new file mode 100644 index 00000000..70207a83 --- /dev/null +++ b/docs/models/components/platformagentrunstate.md @@ -0,0 +1,19 @@ +# PlatformAgentRunState + +State of the persisted workflow execution. REQUIRES_INPUT is nonterminal. + +## Example Usage + +```typescript +import { PlatformAgentRunState } from "@gleanwork/api-client/models/components"; + +let value: PlatformAgentRunState = "CANCELLING"; + +// Open enum: unrecognized values are captured as Unrecognized +``` + +## Values + +```typescript +"QUEUED" | "RUNNING" | "REQUIRES_INPUT" | "SUCCEEDED" | "FAILED" | "CANCELLING" | "CANCELLED" | "EXPIRED" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/components/platformagentruntoolapproval.md b/docs/models/components/platformagentruntoolapproval.md new file mode 100644 index 00000000..adb173b1 --- /dev/null +++ b/docs/models/components/platformagentruntoolapproval.md @@ -0,0 +1,29 @@ +# PlatformAgentRunToolApproval + +Pending approval for a specific persisted tool invocation and its arguments. + +## Example Usage + +```typescript +import { PlatformAgentRunToolApproval } from "@gleanwork/api-client/models/components"; + +let value: PlatformAgentRunToolApproval = { + interaction_id: "", + type: "TOOL_APPROVAL", + display_name: "Kadin25", + description: "fowl jovially publication in beneath duh openly until", + arguments: {}, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `interactionId` | *string* | :heavy_check_mark: | Identifies this specific invocation approval, not the tool definition. | +| `type` | [components.PlatformAgentRunToolApprovalType](../../models/components/platformagentruntoolapprovaltype.md) | :heavy_check_mark: | Interaction type identifying a tool execution approval request. | +| `toolId` | *string* | :heavy_minus_sign: | Platform tool identifier when recorded. Omitted for requests without one, such as some MCP tools. | +| `displayName` | *string* | :heavy_check_mark: | Display name of the tool requesting approval. | +| `description` | *string* | :heavy_check_mark: | Description of the tool associated with this approval request. | +| `arguments` | Record | :heavy_check_mark: | Arguments from the persisted approval request. Older platform tools use flattened parameters. | +| `expiresAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | Approval deadline, when one is set. Omitted when the approval has no expiration. | \ No newline at end of file diff --git a/docs/models/components/platformagentruntoolapprovaltype.md b/docs/models/components/platformagentruntoolapprovaltype.md new file mode 100644 index 00000000..6d8b1a2d --- /dev/null +++ b/docs/models/components/platformagentruntoolapprovaltype.md @@ -0,0 +1,17 @@ +# PlatformAgentRunToolApprovalType + +Interaction type identifying a tool execution approval request. + +## Example Usage + +```typescript +import { PlatformAgentRunToolApprovalType } from "@gleanwork/api-client/models/components"; + +let value: PlatformAgentRunToolApprovalType = "TOOL_APPROVAL"; +``` + +## Values + +```typescript +"TOOL_APPROVAL" +``` \ No newline at end of file diff --git a/docs/models/components/platformchatjsonschemaformat.md b/docs/models/components/platformchatjsonschemaformat.md new file mode 100644 index 00000000..d84f3bb5 --- /dev/null +++ b/docs/models/components/platformchatjsonschemaformat.md @@ -0,0 +1,29 @@ +# PlatformChatJsonSchemaFormat + +Constrains the assistant response to a caller-supplied JSON Schema. + +## Example Usage + +```typescript +import { PlatformChatJsonSchemaFormat } from "@gleanwork/api-client/models/components"; + +let value: PlatformChatJsonSchemaFormat = { + type: "JSON_SCHEMA", + name: "", + schema: { + "key": "", + "key1": "", + "key2": "", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `type` | *"JSON_SCHEMA"* | :heavy_check_mark: | Discriminator. Must be JSON_SCHEMA. | +| `name` | *string* | :heavy_check_mark: | A stable identifier for the schema. | +| `description` | *string* | :heavy_minus_sign: | An optional human-readable description of the schema. | +| `schema` | Record | :heavy_check_mark: | A JSON Schema object describing the desired output shape. | +| `strict` | *boolean* | :heavy_minus_sign: | When true, the provider validates the response against the schema. Unsupported by some providers; defaults to true.
| \ No newline at end of file diff --git a/docs/models/components/platformchatoutputtextcontent.md b/docs/models/components/platformchatoutputtextcontent.md index 9f1c7036..c2c05ca2 100644 --- a/docs/models/components/platformchatoutputtextcontent.md +++ b/docs/models/components/platformchatoutputtextcontent.md @@ -13,8 +13,9 @@ let value: PlatformChatOutputTextContent = { ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `type` | [components.PlatformChatOutputTextContentType](../../models/components/platformchatoutputtextcontenttype.md) | :heavy_check_mark: | N/A | -| `text` | *string* | :heavy_check_mark: | N/A | -| `annotations` | [components.PlatformChatCitationAnnotation](../../models/components/platformchatcitationannotation.md)[] | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | +| `type` | [components.PlatformChatOutputTextContentType](../../models/components/platformchatoutputtextcontenttype.md) | :heavy_check_mark: | N/A | +| `text` | *string* | :heavy_check_mark: | N/A | +| `structuredOutput` | [components.StructuredOutput](../../models/components/structuredoutput.md) | :heavy_minus_sign: | Parsed and validated JSON object when structured output was requested. Present only when the request included `text.format.type: JSON_SCHEMA`.
| +| `annotations` | [components.PlatformChatCitationAnnotation](../../models/components/platformchatcitationannotation.md)[] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/platformchattextformat.md b/docs/models/components/platformchattextformat.md new file mode 100644 index 00000000..9b27fffc --- /dev/null +++ b/docs/models/components/platformchattextformat.md @@ -0,0 +1,19 @@ +# PlatformChatTextFormat + +Unconstrained plain-text assistant output. + +## Example Usage + +```typescript +import { PlatformChatTextFormat } from "@gleanwork/api-client/models/components"; + +let value: PlatformChatTextFormat = { + type: "TEXT", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | +| `type` | *"TEXT"* | :heavy_check_mark: | Discriminator. Must be TEXT. | \ No newline at end of file diff --git a/docs/models/components/platformdurableagentrun.md b/docs/models/components/platformdurableagentrun.md new file mode 100644 index 00000000..5e45f201 --- /dev/null +++ b/docs/models/components/platformdurableagentrun.md @@ -0,0 +1,32 @@ +# PlatformDurableAgentRun + +Agent run state, pending tool approvals, and output available independently of the creation request. + +## Example Usage + +```typescript +import { PlatformDurableAgentRun } from "@gleanwork/api-client/models/components"; + +let value: PlatformDurableAgentRun = { + run_id: "", + agent_id: "", + state: "CANCELLING", + created_at: new Date("2025-12-31T22:33:04.077Z"), + updated_at: new Date("2025-09-06T14:47:47.909Z"), + pending_interactions: [], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `runId` | *string* | :heavy_check_mark: | ID of the run, preserved across approval continuations. | +| `agentId` | *string* | :heavy_check_mark: | ID of the agent that owns the run. | +| `state` | [components.PlatformAgentRunState](../../models/components/platformagentrunstate.md) | :heavy_check_mark: | State of the persisted workflow execution. REQUIRES_INPUT is nonterminal. | +| `createdAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | Timestamp when the run was first persisted. | +| `updatedAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | Latest persisted activity timestamp across the execution and its messages, including checkpoint messages. This is not a worker heartbeat or an exact state-transition timestamp.
| +| `expiresAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | Execution deadline, when one is set. Not the run history retention deadline. | +| `pendingInteractions` | [components.PlatformAgentRunToolApproval](../../models/components/platformagentruntoolapproval.md)[] | :heavy_check_mark: | Unanswered tool approvals when the run is in REQUIRES_INPUT. Empty in other states. | +| `output` | Record | :heavy_minus_sign: | Accumulated text-only agent output under the messages key, when available. | +| `error` | [components.PlatformAgentRunError](../../models/components/platformagentrunerror.md) | :heavy_minus_sign: | Caller-safe details of an agent run execution failure. | \ No newline at end of file diff --git a/docs/models/components/structuredoutput.md b/docs/models/components/structuredoutput.md new file mode 100644 index 00000000..fa655cfa --- /dev/null +++ b/docs/models/components/structuredoutput.md @@ -0,0 +1,17 @@ +# StructuredOutput + +Parsed and validated JSON object when structured output was requested. Present only when the request included `text.format.type: JSON_SCHEMA`. + + +## Example Usage + +```typescript +import { StructuredOutput } from "@gleanwork/api-client/models/components"; + +let value: StructuredOutput = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/platformagentscreaterunresponse.md b/docs/models/operations/platformagentscreaterunresponse.md index a6ff4cd4..2af70541 100644 --- a/docs/models/operations/platformagentscreaterunresponse.md +++ b/docs/models/operations/platformagentscreaterunresponse.md @@ -33,3 +33,19 @@ const value: components.PlatformAgentRunWaitResponse = { const value: string = ""; ``` +### `components.PlatformAgentRunResponse` + +```typescript +const value: components.PlatformAgentRunResponse = { + run: { + run_id: "", + agent_id: "", + state: "RUNNING", + created_at: new Date("2025-07-02T11:33:51.838Z"), + updated_at: new Date("2024-12-21T16:46:41.143Z"), + pending_interactions: [], + }, + request_id: "", +}; +``` + diff --git a/docs/models/operations/platformagentsgetrunrequest.md b/docs/models/operations/platformagentsgetrunrequest.md new file mode 100644 index 00000000..21091714 --- /dev/null +++ b/docs/models/operations/platformagentsgetrunrequest.md @@ -0,0 +1,19 @@ +# PlatformAgentsGetRunRequest + +## Example Usage + +```typescript +import { PlatformAgentsGetRunRequest } from "@gleanwork/api-client/models/operations"; + +let value: PlatformAgentsGetRunRequest = { + agent_id: "{agent_id}", + run_id: "{run_id}", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- | +| `agentId` | *string* | :heavy_check_mark: | ID of the agent that owns the run. | {agent_id} | +| `runId` | *string* | :heavy_check_mark: | ID of the durable run to retrieve. | {run_id} | \ No newline at end of file diff --git a/docs/models/operations/platformchatcreateformat.md b/docs/models/operations/platformchatcreateformat.md new file mode 100644 index 00000000..0079624b --- /dev/null +++ b/docs/models/operations/platformchatcreateformat.md @@ -0,0 +1,30 @@ +# PlatformChatCreateFormat + +Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. + + + +## Supported Types + +### `components.PlatformChatTextFormat` + +```typescript +const value: components.PlatformChatTextFormat = { + type: "TEXT", +}; +``` + +### `components.PlatformChatJsonSchemaFormat` + +```typescript +const value: components.PlatformChatJsonSchemaFormat = { + type: "JSON_SCHEMA", + name: "", + schema: { + "key": "", + "key1": "", + "key2": "", + }, +}; +``` + diff --git a/docs/models/operations/platformchatcreaterequest.md b/docs/models/operations/platformchatcreaterequest.md index f13a0c0f..6e7d38f1 100644 --- a/docs/models/operations/platformchatcreaterequest.md +++ b/docs/models/operations/platformchatcreaterequest.md @@ -6,15 +6,38 @@ import { PlatformChatCreateRequest } from "@gleanwork/api-client/models/operations"; let value: PlatformChatCreateRequest = { - input: "What is our parental leave policy?", + input: "Summarize our parental leave policy as JSON.", + text: { + format: { + type: "JSON_SCHEMA", + name: "policy_summary", + schema: { + "type": "object", + "properties": { + "eligible_employees": { + "type": "string", + }, + "duration_weeks": { + "type": "integer", + }, + }, + "required": [ + "eligible_employees", + "duration_weeks", + ], + }, + strict: true, + }, + }, }; ``` ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | -| `input` | *operations.PlatformChatCreateInput* | :heavy_check_mark: | Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`.
| -| `stream` | *false* | :heavy_minus_sign: | N/A | -| `store` | *boolean* | :heavy_minus_sign: | When true (default), persist the interaction and return a `conversation_id`. When false, run ephemerally with no persistence.
| -| `conversationId` | *string* | :heavy_minus_sign: | Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`.
| \ No newline at end of file +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `input` | *operations.PlatformChatCreateInput* | :heavy_check_mark: | Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`.
| +| `stream` | *false* | :heavy_minus_sign: | N/A | +| `store` | *boolean* | :heavy_minus_sign: | When true (default), persist the interaction and return a `conversation_id`. When false, run ephemerally with no persistence.
| +| `conversationId` | *string* | :heavy_minus_sign: | Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`.
| +| `text` | [operations.PlatformChatCreateText](../../models/operations/platformchatcreatetext.md) | :heavy_minus_sign: | Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true.
| \ No newline at end of file diff --git a/docs/models/operations/platformchatcreatestreamformat.md b/docs/models/operations/platformchatcreatestreamformat.md new file mode 100644 index 00000000..acb9a86b --- /dev/null +++ b/docs/models/operations/platformchatcreatestreamformat.md @@ -0,0 +1,30 @@ +# PlatformChatCreateStreamFormat + +Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. + + + +## Supported Types + +### `components.PlatformChatTextFormat` + +```typescript +const value: components.PlatformChatTextFormat = { + type: "TEXT", +}; +``` + +### `components.PlatformChatJsonSchemaFormat` + +```typescript +const value: components.PlatformChatJsonSchemaFormat = { + type: "JSON_SCHEMA", + name: "", + schema: { + "key": "", + "key1": "", + "key2": "", + }, +}; +``` + diff --git a/docs/models/operations/platformchatcreatestreamrequest.md b/docs/models/operations/platformchatcreatestreamrequest.md index 83b15c98..d06e7dad 100644 --- a/docs/models/operations/platformchatcreatestreamrequest.md +++ b/docs/models/operations/platformchatcreatestreamrequest.md @@ -6,15 +6,38 @@ import { PlatformChatCreateStreamRequest } from "@gleanwork/api-client/models/operations"; let value: PlatformChatCreateStreamRequest = { - input: "What is our parental leave policy?", + input: "Summarize our parental leave policy as JSON.", + text: { + format: { + type: "JSON_SCHEMA", + name: "policy_summary", + schema: { + "type": "object", + "properties": { + "eligible_employees": { + "type": "string", + }, + "duration_weeks": { + "type": "integer", + }, + }, + "required": [ + "eligible_employees", + "duration_weeks", + ], + }, + strict: true, + }, + }, }; ``` ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | -| `input` | *operations.PlatformChatCreateStreamInput* | :heavy_check_mark: | Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`.
| -| `stream` | *true* | :heavy_minus_sign: | N/A | -| `store` | *boolean* | :heavy_minus_sign: | When true (default), persist the interaction and return a `conversation_id`. When false, run ephemerally with no persistence.
| -| `conversationId` | *string* | :heavy_minus_sign: | Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`.
| \ No newline at end of file +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `input` | *operations.PlatformChatCreateStreamInput* | :heavy_check_mark: | Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`.
| +| `stream` | *true* | :heavy_minus_sign: | N/A | +| `store` | *boolean* | :heavy_minus_sign: | When true (default), persist the interaction and return a `conversation_id`. When false, run ephemerally with no persistence.
| +| `conversationId` | *string* | :heavy_minus_sign: | Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`.
| +| `text` | [operations.PlatformChatCreateStreamText](../../models/operations/platformchatcreatestreamtext.md) | :heavy_minus_sign: | Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true.
| \ No newline at end of file diff --git a/docs/models/operations/platformchatcreatestreamtext.md b/docs/models/operations/platformchatcreatestreamtext.md new file mode 100644 index 00000000..f7c9444f --- /dev/null +++ b/docs/models/operations/platformchatcreatestreamtext.md @@ -0,0 +1,18 @@ +# PlatformChatCreateStreamText + +Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true. + + +## Example Usage + +```typescript +import { PlatformChatCreateStreamText } from "@gleanwork/api-client/models/operations"; + +let value: PlatformChatCreateStreamText = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | +| `format` | *operations.PlatformChatCreateStreamFormat* | :heavy_minus_sign: | Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema.
| \ No newline at end of file diff --git a/docs/models/operations/platformchatcreatetext.md b/docs/models/operations/platformchatcreatetext.md new file mode 100644 index 00000000..9e53fb99 --- /dev/null +++ b/docs/models/operations/platformchatcreatetext.md @@ -0,0 +1,18 @@ +# PlatformChatCreateText + +Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true. + + +## Example Usage + +```typescript +import { PlatformChatCreateText } from "@gleanwork/api-client/models/operations"; + +let value: PlatformChatCreateText = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | +| `format` | *operations.PlatformChatCreateFormat* | :heavy_minus_sign: | Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema.
| \ No newline at end of file diff --git a/docs/sdks/agents/README.md b/docs/sdks/agents/README.md index b1224201..8e3022b5 100644 --- a/docs/sdks/agents/README.md +++ b/docs/sdks/agents/README.md @@ -8,6 +8,7 @@ * [get](#get) - Get agent * [getSchemas](#getschemas) - Get agent schemas * [createRun](#createrun) - Create agent run +* [getRun](#getrun) - Get agent run ## search @@ -305,7 +306,7 @@ import { ## createRun -Execute an agent run. Set `stream` to true to receive server-sent events; otherwise the response contains the final agent messages. +Execute an agent run. By default, set `stream` to true to receive server-sent events; otherwise the response contains the final agent messages. Set `execution_mode` to `DURABLE` to persist a new run and return its initial snapshot with HTTP 201 without waiting for execution. Poll the agent-scoped GET run endpoint for progress. Durable execution continues after an HTTP disconnect, but is not automatically resumed after a QE restart or crash. An active turn becomes overdue more than 40 minutes after acceptance (a 30-minute execution timeout plus 10 minutes of grace). The next GET of the run marks the overdue turn FAILED without replay; there is no periodic sweep. Without a GET, the stored run can remain RUNNING. Failure does not prove that external tool work has stopped. Paused runs are not expired. Each POST creates a new run; retrying a POST can create another execution. A run tracks one workflow execution; automatic background-subagent wake turns are separate executions, not continuations tracked by this run ID. ### Example Usage @@ -416,4 +417,105 @@ import { | errors.PlatformUnauthorizedAgentToolsProblemError | 422 | application/problem+json | | errors.PlatformProblemDetailError | 400, 401, 403, 404, 408, 409, 413, 429 | application/problem+json | | errors.PlatformProblemDetailError | 500, 503 | application/problem+json | -| errors.GleanError | 4XX, 5XX | \*/\* | \ No newline at end of file +| errors.GleanError | 4XX, 5XX | \*/\* | + +## getRun + +Retrieve a persisted workflow execution owned by the authenticated user. The run must belong to the specified agent, and the user must still have access to that agent. Unknown runs, runs owned by another user, and mismatched agent/run identifiers return 404. Requires the agents.run scope. Executions without a persisted workflow record are not available through this endpoint. + + +### Example Usage + + +```typescript +import { Glean } from "@gleanwork/api-client"; + +const glean = new Glean({ + apiToken: process.env["GLEAN_API_TOKEN"] ?? "", +}); + +async function run() { + const result = await glean.agents.getRun("{agent_id}", "{run_id}"); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { GleanCore } from "@gleanwork/api-client/core.js"; +import { agentsGetRun } from "@gleanwork/api-client/funcs/agentsGetRun.js"; + +// Use `GleanCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const glean = new GleanCore({ + apiToken: process.env["GLEAN_API_TOKEN"] ?? "", +}); + +async function run() { + const res = await agentsGetRun(glean, "{agent_id}", "{run_id}"); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("agentsGetRun failed:", res.error); + } +} + +run(); +``` + +### React hooks and utilities + +This method can be used in React components through the following hooks and +associated utilities. + +> Check out [this guide][hook-guide] for information about each of the utilities +> below and how to get started using React hooks. + +[hook-guide]: ../../../REACT_QUERY.md + +```tsx +import { + // Query hooks for fetching data. + useAgentsGetRun, + useAgentsGetRunSuspense, + + // Utility for prefetching data during server-side rendering and in React + // Server Components that will be immediately available to client components + // using the hooks. + prefetchAgentsGetRun, + + // Utilities to invalidate the query cache for this query in response to + // mutations and other user actions. + invalidateAgentsGetRun, + invalidateAllAgentsGetRun, +} from "@gleanwork/api-client/react-query/agentsGetRun.js"; +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `agentId` | *string* | :heavy_check_mark: | ID of the agent that owns the run. | {agent_id} | +| `runId` | *string* | :heavy_check_mark: | ID of the durable run to retrieve. | {run_id} | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | | + +### Response + +**Promise\<[components.PlatformAgentRunResponse](../../models/components/platformagentrunresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.PlatformProblemDetailError | 400, 401, 403, 404, 408, 429 | application/problem+json | +| errors.PlatformProblemDetailError | 500, 503 | application/problem+json | +| errors.GleanError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/chat/README.md b/docs/sdks/chat/README.md index 48e140de..733e5d51 100644 --- a/docs/sdks/chat/README.md +++ b/docs/sdks/chat/README.md @@ -24,7 +24,29 @@ const glean = new Glean({ async function run() { const result = await glean.chat.create({ - input: "What is our parental leave policy?", + input: "Summarize our parental leave policy as JSON.", + text: { + format: { + type: "JSON_SCHEMA", + name: "policy_summary", + schema: { + "type": "object", + "properties": { + "eligible_employees": { + "type": "string", + }, + "duration_weeks": { + "type": "integer", + }, + }, + "required": [ + "eligible_employees", + "duration_weeks", + ], + }, + strict: true, + }, + }, }); console.log(result); @@ -49,7 +71,29 @@ const glean = new GleanCore({ async function run() { const res = await chatCreate(glean, { - input: "What is our parental leave policy?", + input: "Summarize our parental leave policy as JSON.", + text: { + format: { + type: "JSON_SCHEMA", + name: "policy_summary", + schema: { + "type": "object", + "properties": { + "eligible_employees": { + "type": "string", + }, + "duration_weeks": { + "type": "integer", + }, + }, + "required": [ + "eligible_employees", + "duration_weeks", + ], + }, + strict: true, + }, + }, }); if (res.ok) { const { value: result } = res; @@ -117,7 +161,29 @@ const glean = new Glean({ async function run() { const result = await glean.chat.createStream({ - input: "What is our parental leave policy?", + input: "Summarize our parental leave policy as JSON.", + text: { + format: { + type: "JSON_SCHEMA", + name: "policy_summary", + schema: { + "type": "object", + "properties": { + "eligible_employees": { + "type": "string", + }, + "duration_weeks": { + "type": "integer", + }, + }, + "required": [ + "eligible_employees", + "duration_weeks", + ], + }, + strict: true, + }, + }, }); for await (const event of result) { @@ -144,7 +210,29 @@ const glean = new GleanCore({ async function run() { const res = await chatCreateStream(glean, { - input: "What is our parental leave policy?", + input: "Summarize our parental leave policy as JSON.", + text: { + format: { + type: "JSON_SCHEMA", + name: "policy_summary", + schema: { + "type": "object", + "properties": { + "eligible_employees": { + "type": "string", + }, + "duration_weeks": { + "type": "integer", + }, + }, + "required": [ + "eligible_employees", + "duration_weeks", + ], + }, + strict: true, + }, + }, }); if (res.ok) { const { value: result } = res; diff --git a/examples/package-lock.json b/examples/package-lock.json index ea5e1aff..69130fb1 100644 --- a/examples/package-lock.json +++ b/examples/package-lock.json @@ -18,7 +18,7 @@ }, "..": { "name": "@gleanwork/api-client", - "version": "0.20.14", + "version": "0.20.15", "dependencies": { "zod": "^3.25.0 || ^4.0.0" }, diff --git a/jsr.json b/jsr.json index 18e54741..3d3d6c97 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "@gleanwork/api-client", - "version": "0.20.14", + "version": "0.20.15", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/package-lock.json b/package-lock.json index bf4d170f..957b0d19 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@gleanwork/api-client", - "version": "0.20.14", + "version": "0.20.15", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@gleanwork/api-client", - "version": "0.20.14", + "version": "0.20.15", "dependencies": { "zod": "^3.25.0 || ^4.0.0" }, diff --git a/package.json b/package.json index 6c303ad3..39340b24 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@gleanwork/api-client", - "version": "0.20.14", + "version": "0.20.15", "author": "Speakeasy", "tshy": { "sourceDialects": [ diff --git a/src/__tests__/agents.test.ts b/src/__tests__/agents.test.ts index 36eba32b..e458e90b 100644 --- a/src/__tests__/agents.test.ts +++ b/src/__tests__/agents.test.ts @@ -134,3 +134,16 @@ test("Agents Platform Agents Create Run", async () => { }, ""); expect(result).toBeDefined(); }); + +test("Agents Platform Agents Get Run", async () => { + const testHttpClient = createTestHTTPClient("platform-agents-get-run"); + + const glean = new Glean({ + serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080", + httpClient: testHttpClient, + apiToken: process.env["GLEAN_API_TOKEN"] ?? "value", + }); + + const result = await glean.agents.getRun("{agent_id}", "{run_id}"); + expect(result).toBeDefined(); +}); diff --git a/src/__tests__/chat.test.ts b/src/__tests__/chat.test.ts index 4ddce499..24edde03 100644 --- a/src/__tests__/chat.test.ts +++ b/src/__tests__/chat.test.ts @@ -17,7 +17,29 @@ test("Chat Platform Chat Create", async () => { }); const result = await glean.chat.create({ - input: "What is our parental leave policy?", + input: "Summarize our parental leave policy as JSON.", + text: { + format: { + type: "JSON_SCHEMA", + name: "policy_summary", + schema: { + "properties": { + "duration_weeks": { + "type": "integer", + }, + "eligible_employees": { + "type": "string", + }, + }, + "required": [ + "eligible_employees", + "duration_weeks", + ], + "type": "object", + }, + strict: true, + }, + }, }); expect(result).toBeDefined(); }); diff --git a/src/__tests__/messages.test.ts b/src/__tests__/messages.test.ts index f3905434..01382f0c 100644 --- a/src/__tests__/messages.test.ts +++ b/src/__tests__/messages.test.ts @@ -20,7 +20,7 @@ test("Messages Messages", async () => { idType: "CONVERSATION_ID", id: "", timestampMillis: 558834, - datasource: "FACEBOOKWORKPLACE", + datasource: "SLACKENTGRID", }); expect(result).toBeDefined(); }); diff --git a/src/__tests__/mockserver/internal/handler/generated_handlers.go b/src/__tests__/mockserver/internal/handler/generated_handlers.go index 010a384f..f73ba128 100644 --- a/src/__tests__/mockserver/internal/handler/generated_handlers.go +++ b/src/__tests__/mockserver/internal/handler/generated_handlers.go @@ -16,6 +16,7 @@ func GeneratedHandlers(ctx context.Context, dir *logging.HTTPFileDirectory, rt * NewGeneratedHandler(ctx, http.MethodDelete, "/rest/api/index/custom-metadata/schema/{groupName}", pathDeleteRestAPIIndexCustomMetadataSchemaGroupName(dir, rt)), NewGeneratedHandler(ctx, http.MethodDelete, "/rest/api/index/document/{docId}/custom-metadata/{groupName}", pathDeleteRestAPIIndexDocumentDocIDCustomMetadataGroupName(dir, rt)), NewGeneratedHandler(ctx, http.MethodGet, "/api/agents/{agent_id}", pathGetAPIAgentsAgentID(dir, rt)), + NewGeneratedHandler(ctx, http.MethodGet, "/api/agents/{agent_id}/runs/{run_id}", pathGetAPIAgentsAgentIDRunsRunID(dir, rt)), NewGeneratedHandler(ctx, http.MethodGet, "/api/agents/{agent_id}/schemas", pathGetAPIAgentsAgentIDSchemas(dir, rt)), NewGeneratedHandler(ctx, http.MethodGet, "/api/search/filters", pathGetAPISearchFilters(dir, rt)), NewGeneratedHandler(ctx, http.MethodGet, "/api/skills", pathGetAPISkills(dir, rt)), diff --git a/src/__tests__/mockserver/internal/handler/pathgetapiagentsagentidrunsrunid.go b/src/__tests__/mockserver/internal/handler/pathgetapiagentsagentidrunsrunid.go new file mode 100644 index 00000000..379c28f2 --- /dev/null +++ b/src/__tests__/mockserver/internal/handler/pathgetapiagentsagentidrunsrunid.go @@ -0,0 +1,74 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: b6f113ba98ea + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/types" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathGetAPIAgentsAgentIDRunsRunID(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "platform-agents-get-run[0]": + dir.HandlerFunc("platform-agents-get-run", testPlatformAgentsGetRunPlatformAgentsGetRun0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testPlatformAgentsGetRunPlatformAgentsGetRun0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.PlatformAgentRunResponse = &components.PlatformAgentRunResponse{ + Run: components.PlatformDurableAgentRun{ + RunID: "", + AgentID: "", + State: components.PlatformAgentRunStateCancelling, + CreatedAt: types.MustTimeFromString("2025-02-20T06:37:06.101Z"), + UpdatedAt: types.MustTimeFromString("2025-06-13T07:24:18.599Z"), + PendingInteractions: []components.PlatformAgentRunToolApproval{}, + }, + RequestID: "", + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/src/__tests__/mockserver/internal/handler/pathpostrestapiv1createcollection.go b/src/__tests__/mockserver/internal/handler/pathpostrestapiv1createcollection.go index 673b01bb..a4b19376 100644 --- a/src/__tests__/mockserver/internal/handler/pathpostrestapiv1createcollection.go +++ b/src/__tests__/mockserver/internal/handler/pathpostrestapiv1createcollection.go @@ -57,14 +57,14 @@ func testCreatecollectionCreatecollection0(w http.ResponseWriter, req *http.Requ operations.ResponseBody2{ Collection: &components.Collection{ Name: "", - Description: "whole busily jive hawk gee basic minus hence", + Description: "motionless whenever paintwork import over cuckoo", AddedRoles: []components.UserRoleSpecification{ components.UserRoleSpecification{ Person: &components.Person{ Name: "George Clooney", ObfuscatedID: "abc123", }, - Role: components.UserRoleAnswerModerator, + Role: components.UserRoleOwner, }, }, RemovedRoles: []components.UserRoleSpecification{ @@ -91,7 +91,7 @@ func testCreatecollectionCreatecollection0(w http.ResponseWriter, req *http.Requ }, }, }, - ID: 158969, + ID: 363711, Creator: &components.Person{ Name: "George Clooney", ObfuscatedID: "abc123", @@ -102,7 +102,7 @@ func testCreatecollectionCreatecollection0(w http.ResponseWriter, req *http.Requ }, Items: []components.CollectionItem{ components.CollectionItem{ - CollectionID: 110375, + CollectionID: 570197, CreatedBy: &components.Person{ Name: "George Clooney", ObfuscatedID: "abc123", @@ -279,13 +279,13 @@ func testCreatecollectionCreatecollection0(w http.ResponseWriter, req *http.Requ Name: "George Clooney", ObfuscatedID: "abc123", }, - Role: components.UserRoleEditor, + Role: components.UserRoleAnswerModerator, }, }, }, Collection: &components.Collection{ Name: "", - Description: "wedge colorfully orientate rally", + Description: "athwart skateboard newsstand farm bourgeoisie ah how elliptical aha well-to-do", AudienceFilters: []components.FacetFilter{ components.FacetFilter{ FieldName: types.String("type"), @@ -301,7 +301,7 @@ func testCreatecollectionCreatecollection0(w http.ResponseWriter, req *http.Requ }, }, }, - ID: 131797, + ID: 643990, Creator: &components.Person{ Name: "George Clooney", ObfuscatedID: "abc123", @@ -313,7 +313,7 @@ func testCreatecollectionCreatecollection0(w http.ResponseWriter, req *http.Requ Children: []components.Collection{ components.Collection{ Name: "", - Description: "outside yippee sidetrack mature regularly mouser inject worth", + Description: "woot purse salty even as advanced", AudienceFilters: []components.FacetFilter{ components.FacetFilter{ FieldName: types.String("type"), @@ -329,7 +329,7 @@ func testCreatecollectionCreatecollection0(w http.ResponseWriter, req *http.Requ }, }, }, - ID: 149448, + ID: 359978, Creator: &components.Person{ Name: "George Clooney", ObfuscatedID: "abc123", @@ -341,7 +341,7 @@ func testCreatecollectionCreatecollection0(w http.ResponseWriter, req *http.Requ }, }, }, - ItemType: components.CollectionItemItemTypeCollection, + ItemType: components.CollectionItemItemTypeURL, }, }, }, diff --git a/src/__tests__/mockserver/internal/sdk/models/components/feedentry.go b/src/__tests__/mockserver/internal/sdk/models/components/feedentry.go index 9fb0df09..6af5ac9c 100644 --- a/src/__tests__/mockserver/internal/sdk/models/components/feedentry.go +++ b/src/__tests__/mockserver/internal/sdk/models/components/feedentry.go @@ -123,6 +123,8 @@ const ( JustificationTypeEditDoc JustificationType = "EDIT_DOC" JustificationTypeChatToArtifact JustificationType = "CHAT_TO_ARTIFACT" JustificationTypeShareArtifact JustificationType = "SHARE_ARTIFACT" + JustificationTypeCreateAgent JustificationType = "CREATE_AGENT" + JustificationTypeManagerInvite JustificationType = "MANAGER_INVITE" ) func (e JustificationType) ToPointer() *JustificationType { @@ -265,6 +267,10 @@ func (e *JustificationType) UnmarshalJSON(data []byte) error { case "CHAT_TO_ARTIFACT": fallthrough case "SHARE_ARTIFACT": + fallthrough + case "CREATE_AGENT": + fallthrough + case "MANAGER_INVITE": *e = JustificationType(v) return nil default: diff --git a/src/__tests__/mockserver/internal/sdk/models/components/feedrequest.go b/src/__tests__/mockserver/internal/sdk/models/components/feedrequest.go index bce628a8..26021404 100644 --- a/src/__tests__/mockserver/internal/sdk/models/components/feedrequest.go +++ b/src/__tests__/mockserver/internal/sdk/models/components/feedrequest.go @@ -63,6 +63,8 @@ const ( FeedRequestCategoryEditDoc FeedRequestCategory = "EDIT_DOC" FeedRequestCategoryChatToArtifact FeedRequestCategory = "CHAT_TO_ARTIFACT" FeedRequestCategoryShareArtifact FeedRequestCategory = "SHARE_ARTIFACT" + FeedRequestCategoryCreateAgent FeedRequestCategory = "CREATE_AGENT" + FeedRequestCategoryManagerInvite FeedRequestCategory = "MANAGER_INVITE" ) func (e FeedRequestCategory) ToPointer() *FeedRequestCategory { @@ -177,6 +179,10 @@ func (e *FeedRequestCategory) UnmarshalJSON(data []byte) error { case "CHAT_TO_ARTIFACT": fallthrough case "SHARE_ARTIFACT": + fallthrough + case "CREATE_AGENT": + fallthrough + case "MANAGER_INVITE": *e = FeedRequestCategory(v) return nil default: diff --git a/src/__tests__/mockserver/internal/sdk/models/components/feedresult.go b/src/__tests__/mockserver/internal/sdk/models/components/feedresult.go index 744f95f9..b3c0414f 100644 --- a/src/__tests__/mockserver/internal/sdk/models/components/feedresult.go +++ b/src/__tests__/mockserver/internal/sdk/models/components/feedresult.go @@ -64,6 +64,8 @@ const ( FeedResultCategoryEditDoc FeedResultCategory = "EDIT_DOC" FeedResultCategoryChatToArtifact FeedResultCategory = "CHAT_TO_ARTIFACT" FeedResultCategoryShareArtifact FeedResultCategory = "SHARE_ARTIFACT" + FeedResultCategoryCreateAgent FeedResultCategory = "CREATE_AGENT" + FeedResultCategoryManagerInvite FeedResultCategory = "MANAGER_INVITE" ) func (e FeedResultCategory) ToPointer() *FeedResultCategory { @@ -178,6 +180,10 @@ func (e *FeedResultCategory) UnmarshalJSON(data []byte) error { case "CHAT_TO_ARTIFACT": fallthrough case "SHARE_ARTIFACT": + fallthrough + case "CREATE_AGENT": + fallthrough + case "MANAGER_INVITE": *e = FeedResultCategory(v) return nil default: diff --git a/src/__tests__/mockserver/internal/sdk/models/components/platformagentruncreaterequest.go b/src/__tests__/mockserver/internal/sdk/models/components/platformagentruncreaterequest.go index 754c8c6a..09923c9a 100644 --- a/src/__tests__/mockserver/internal/sdk/models/components/platformagentruncreaterequest.go +++ b/src/__tests__/mockserver/internal/sdk/models/components/platformagentruncreaterequest.go @@ -4,9 +4,38 @@ package components import ( + "encoding/json" + "fmt" "mockserver/internal/sdk/utils" ) +// ExecutionMode - REQUEST_BOUND preserves the existing wait/stream behavior. DURABLE starts a fresh, persisted execution with a 30-minute execution timeout and returns immediately. DURABLE requires stream to be false or omitted and does not accept metadata.chat_session_id. It does not bypass tool approval requirements or provide automatic QE-crash resumption. Expiry is read-triggered: the next GET of the run marks an active turn FAILED if more than 40 minutes have passed since the turn was accepted. There is no periodic sweep, so the stored run can remain RUNNING until it is read. Expiry never replays execution or expires approval-paused runs, and failure does not prove that external tool work has stopped. +type ExecutionMode string + +const ( + ExecutionModeRequestBound ExecutionMode = "REQUEST_BOUND" + ExecutionModeDurable ExecutionMode = "DURABLE" +) + +func (e ExecutionMode) ToPointer() *ExecutionMode { + return &e +} +func (e *ExecutionMode) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "REQUEST_BOUND": + fallthrough + case "DURABLE": + *e = ExecutionMode(v) + return nil + default: + return fmt.Errorf("invalid value for ExecutionMode: %v", v) + } +} + // PlatformAgentRunCreateRequest - Request to run an agent. A request MUST supply either `messages` (a non-empty conversation) or `input` (for input-form triggered agents). type PlatformAgentRunCreateRequest struct { // Input fields for an input-form triggered agent. @@ -16,8 +45,11 @@ type PlatformAgentRunCreateRequest struct { Messages []PlatformMessageInput `json:"messages,omitempty"` // Metadata to pass to the agent. Metadata map[string]any `json:"metadata,omitempty"` - // Whether to stream the run response as server-sent events. + // Whether to stream the run response as server-sent events. Not supported in DURABLE mode. Stream *bool `default:"false" json:"stream"` + // REQUEST_BOUND preserves the existing wait/stream behavior. DURABLE starts a fresh, persisted execution with a 30-minute execution timeout and returns immediately. DURABLE requires stream to be false or omitted and does not accept metadata.chat_session_id. It does not bypass tool approval requirements or provide automatic QE-crash resumption. Expiry is read-triggered: the next GET of the run marks an active turn FAILED if more than 40 minutes have passed since the turn was accepted. There is no periodic sweep, so the stored run can remain RUNNING until it is read. Expiry never replays execution or expires approval-paused runs, and failure does not prove that external tool work has stopped. + // + ExecutionMode *ExecutionMode `default:"REQUEST_BOUND" json:"execution_mode"` } func (p PlatformAgentRunCreateRequest) MarshalJSON() ([]byte, error) { @@ -58,3 +90,10 @@ func (o *PlatformAgentRunCreateRequest) GetStream() *bool { } return o.Stream } + +func (o *PlatformAgentRunCreateRequest) GetExecutionMode() *ExecutionMode { + if o == nil { + return nil + } + return o.ExecutionMode +} diff --git a/src/__tests__/mockserver/internal/sdk/models/components/platformagentrunerror.go b/src/__tests__/mockserver/internal/sdk/models/components/platformagentrunerror.go new file mode 100644 index 00000000..34afbbdf --- /dev/null +++ b/src/__tests__/mockserver/internal/sdk/models/components/platformagentrunerror.go @@ -0,0 +1,26 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: bb8b5992e98d + +package components + +// PlatformAgentRunError - Caller-safe details of an agent run execution failure. +type PlatformAgentRunError struct { + // Machine-readable execution failure code. + Code string `json:"code"` + // Caller-safe execution failure description. + Message string `json:"message"` +} + +func (o *PlatformAgentRunError) GetCode() string { + if o == nil { + return "" + } + return o.Code +} + +func (o *PlatformAgentRunError) GetMessage() string { + if o == nil { + return "" + } + return o.Message +} diff --git a/src/__tests__/mockserver/internal/sdk/models/components/platformagentrunresponse.go b/src/__tests__/mockserver/internal/sdk/models/components/platformagentrunresponse.go new file mode 100644 index 00000000..dc751244 --- /dev/null +++ b/src/__tests__/mockserver/internal/sdk/models/components/platformagentrunresponse.go @@ -0,0 +1,26 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: 4ac930221f8b + +package components + +// PlatformAgentRunResponse - Persisted agent run snapshot with a request ID for support correlation. +type PlatformAgentRunResponse struct { + // Agent run state, pending tool approvals, and output available independently of the creation request. + Run PlatformDurableAgentRun `json:"run"` + // Platform-generated request ID for support correlation. + RequestID string `json:"request_id"` +} + +func (o *PlatformAgentRunResponse) GetRun() PlatformDurableAgentRun { + if o == nil { + return PlatformDurableAgentRun{} + } + return o.Run +} + +func (o *PlatformAgentRunResponse) GetRequestID() string { + if o == nil { + return "" + } + return o.RequestID +} diff --git a/src/__tests__/mockserver/internal/sdk/models/components/platformagentrunstate.go b/src/__tests__/mockserver/internal/sdk/models/components/platformagentrunstate.go new file mode 100644 index 00000000..c8ffdbf1 --- /dev/null +++ b/src/__tests__/mockserver/internal/sdk/models/components/platformagentrunstate.go @@ -0,0 +1,54 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: 31e5314c4b6b + +package components + +import ( + "encoding/json" + "fmt" +) + +// PlatformAgentRunState - State of the persisted workflow execution. REQUIRES_INPUT is nonterminal. +type PlatformAgentRunState string + +const ( + PlatformAgentRunStateQueued PlatformAgentRunState = "QUEUED" + PlatformAgentRunStateRunning PlatformAgentRunState = "RUNNING" + PlatformAgentRunStateRequiresInput PlatformAgentRunState = "REQUIRES_INPUT" + PlatformAgentRunStateSucceeded PlatformAgentRunState = "SUCCEEDED" + PlatformAgentRunStateFailed PlatformAgentRunState = "FAILED" + PlatformAgentRunStateCancelling PlatformAgentRunState = "CANCELLING" + PlatformAgentRunStateCancelled PlatformAgentRunState = "CANCELLED" + PlatformAgentRunStateExpired PlatformAgentRunState = "EXPIRED" +) + +func (e PlatformAgentRunState) ToPointer() *PlatformAgentRunState { + return &e +} +func (e *PlatformAgentRunState) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "QUEUED": + fallthrough + case "RUNNING": + fallthrough + case "REQUIRES_INPUT": + fallthrough + case "SUCCEEDED": + fallthrough + case "FAILED": + fallthrough + case "CANCELLING": + fallthrough + case "CANCELLED": + fallthrough + case "EXPIRED": + *e = PlatformAgentRunState(v) + return nil + default: + return fmt.Errorf("invalid value for PlatformAgentRunState: %v", v) + } +} diff --git a/src/__tests__/mockserver/internal/sdk/models/components/platformagentruntoolapproval.go b/src/__tests__/mockserver/internal/sdk/models/components/platformagentruntoolapproval.go new file mode 100644 index 00000000..3b1437b4 --- /dev/null +++ b/src/__tests__/mockserver/internal/sdk/models/components/platformagentruntoolapproval.go @@ -0,0 +1,113 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: 20134105d6ce + +package components + +import ( + "encoding/json" + "fmt" + "mockserver/internal/sdk/utils" + "time" +) + +// PlatformAgentRunToolApprovalType - Interaction type identifying a tool execution approval request. +type PlatformAgentRunToolApprovalType string + +const ( + PlatformAgentRunToolApprovalTypeToolApproval PlatformAgentRunToolApprovalType = "TOOL_APPROVAL" +) + +func (e PlatformAgentRunToolApprovalType) ToPointer() *PlatformAgentRunToolApprovalType { + return &e +} +func (e *PlatformAgentRunToolApprovalType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "TOOL_APPROVAL": + *e = PlatformAgentRunToolApprovalType(v) + return nil + default: + return fmt.Errorf("invalid value for PlatformAgentRunToolApprovalType: %v", v) + } +} + +// PlatformAgentRunToolApproval - Pending approval for a specific persisted tool invocation and its arguments. +type PlatformAgentRunToolApproval struct { + // Identifies this specific invocation approval, not the tool definition. + InteractionID string `json:"interaction_id"` + // Interaction type identifying a tool execution approval request. + Type PlatformAgentRunToolApprovalType `json:"type"` + // Platform tool identifier when recorded. Omitted for requests without one, such as some MCP tools. + ToolID *string `json:"tool_id,omitempty"` + // Display name of the tool requesting approval. + DisplayName string `json:"display_name"` + // Description of the tool associated with this approval request. + Description string `json:"description"` + // Arguments from the persisted approval request. Older platform tools use flattened parameters. + Arguments map[string]any `json:"arguments"` + // Approval deadline, when one is set. Omitted when the approval has no expiration. + ExpiresAt *time.Time `json:"expires_at,omitempty"` +} + +func (p PlatformAgentRunToolApproval) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *PlatformAgentRunToolApproval) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, []string{"interaction_id", "type", "display_name", "description", "arguments"}); err != nil { + return err + } + return nil +} + +func (o *PlatformAgentRunToolApproval) GetInteractionID() string { + if o == nil { + return "" + } + return o.InteractionID +} + +func (o *PlatformAgentRunToolApproval) GetType() PlatformAgentRunToolApprovalType { + if o == nil { + return PlatformAgentRunToolApprovalType("") + } + return o.Type +} + +func (o *PlatformAgentRunToolApproval) GetToolID() *string { + if o == nil { + return nil + } + return o.ToolID +} + +func (o *PlatformAgentRunToolApproval) GetDisplayName() string { + if o == nil { + return "" + } + return o.DisplayName +} + +func (o *PlatformAgentRunToolApproval) GetDescription() string { + if o == nil { + return "" + } + return o.Description +} + +func (o *PlatformAgentRunToolApproval) GetArguments() map[string]any { + if o == nil { + return map[string]any{} + } + return o.Arguments +} + +func (o *PlatformAgentRunToolApproval) GetExpiresAt() *time.Time { + if o == nil { + return nil + } + return o.ExpiresAt +} diff --git a/src/__tests__/mockserver/internal/sdk/models/components/platformchatjsonschemaformat.go b/src/__tests__/mockserver/internal/sdk/models/components/platformchatjsonschemaformat.go new file mode 100644 index 00000000..af91cf87 --- /dev/null +++ b/src/__tests__/mockserver/internal/sdk/models/components/platformchatjsonschemaformat.go @@ -0,0 +1,95 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: 894f1f95fef3 + +package components + +import ( + "encoding/json" + "fmt" + "mockserver/internal/sdk/utils" +) + +// PlatformChatJSONSchemaFormatType - Discriminator. Must be JSON_SCHEMA. +type PlatformChatJSONSchemaFormatType string + +const ( + PlatformChatJSONSchemaFormatTypeJSONSchema PlatformChatJSONSchemaFormatType = "JSON_SCHEMA" +) + +func (e PlatformChatJSONSchemaFormatType) ToPointer() *PlatformChatJSONSchemaFormatType { + return &e +} +func (e *PlatformChatJSONSchemaFormatType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "JSON_SCHEMA": + *e = PlatformChatJSONSchemaFormatType(v) + return nil + default: + return fmt.Errorf("invalid value for PlatformChatJSONSchemaFormatType: %v", v) + } +} + +// PlatformChatJSONSchemaFormat - Constrains the assistant response to a caller-supplied JSON Schema. +type PlatformChatJSONSchemaFormat struct { + // Discriminator. Must be JSON_SCHEMA. + Type PlatformChatJSONSchemaFormatType `json:"type"` + // A stable identifier for the schema. + Name string `json:"name"` + // An optional human-readable description of the schema. + Description *string `json:"description,omitempty"` + // A JSON Schema object describing the desired output shape. + Schema map[string]any `json:"schema"` + // When true, the provider validates the response against the schema. Unsupported by some providers; defaults to true. + // + Strict *bool `default:"true" json:"strict"` +} + +func (p PlatformChatJSONSchemaFormat) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *PlatformChatJSONSchemaFormat) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, []string{"type", "name", "schema"}); err != nil { + return err + } + return nil +} + +func (o *PlatformChatJSONSchemaFormat) GetType() PlatformChatJSONSchemaFormatType { + if o == nil { + return PlatformChatJSONSchemaFormatType("") + } + return o.Type +} + +func (o *PlatformChatJSONSchemaFormat) GetName() string { + if o == nil { + return "" + } + return o.Name +} + +func (o *PlatformChatJSONSchemaFormat) GetDescription() *string { + if o == nil { + return nil + } + return o.Description +} + +func (o *PlatformChatJSONSchemaFormat) GetSchema() map[string]any { + if o == nil { + return map[string]any{} + } + return o.Schema +} + +func (o *PlatformChatJSONSchemaFormat) GetStrict() *bool { + if o == nil { + return nil + } + return o.Strict +} diff --git a/src/__tests__/mockserver/internal/sdk/models/components/platformchatoutputtextcontent.go b/src/__tests__/mockserver/internal/sdk/models/components/platformchatoutputtextcontent.go index 7b5437eb..94d84904 100644 --- a/src/__tests__/mockserver/internal/sdk/models/components/platformchatoutputtextcontent.go +++ b/src/__tests__/mockserver/internal/sdk/models/components/platformchatoutputtextcontent.go @@ -6,6 +6,7 @@ package components import ( "encoding/json" "fmt" + "mockserver/internal/sdk/optionalnullable" "mockserver/internal/sdk/utils" ) @@ -32,10 +33,28 @@ func (e *PlatformChatOutputTextContentType) UnmarshalJSON(data []byte) error { } } +// StructuredOutput - Parsed and validated JSON object when structured output was requested. Present only when the request included `text.format.type: JSON_SCHEMA`. +type StructuredOutput struct { +} + +func (s StructuredOutput) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *StructuredOutput) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, nil); err != nil { + return err + } + return nil +} + type PlatformChatOutputTextContent struct { - Type PlatformChatOutputTextContentType `json:"type"` - Text string `json:"text"` - Annotations []PlatformChatCitationAnnotation `json:"annotations,omitempty"` + Type PlatformChatOutputTextContentType `json:"type"` + Text string `json:"text"` + // Parsed and validated JSON object when structured output was requested. Present only when the request included `text.format.type: JSON_SCHEMA`. + // + StructuredOutput optionalnullable.OptionalNullable[StructuredOutput] `json:"structured_output,omitempty"` + Annotations []PlatformChatCitationAnnotation `json:"annotations,omitempty"` } func (p PlatformChatOutputTextContent) MarshalJSON() ([]byte, error) { @@ -63,6 +82,13 @@ func (o *PlatformChatOutputTextContent) GetText() string { return o.Text } +func (o *PlatformChatOutputTextContent) GetStructuredOutput() optionalnullable.OptionalNullable[StructuredOutput] { + if o == nil { + return nil + } + return o.StructuredOutput +} + func (o *PlatformChatOutputTextContent) GetAnnotations() []PlatformChatCitationAnnotation { if o == nil { return nil diff --git a/src/__tests__/mockserver/internal/sdk/models/components/platformchattextformat.go b/src/__tests__/mockserver/internal/sdk/models/components/platformchattextformat.go new file mode 100644 index 00000000..580903ad --- /dev/null +++ b/src/__tests__/mockserver/internal/sdk/models/components/platformchattextformat.go @@ -0,0 +1,58 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: 26e47a3c7596 + +package components + +import ( + "encoding/json" + "fmt" + "mockserver/internal/sdk/utils" +) + +// PlatformChatTextFormatType - Discriminator. Must be TEXT. +type PlatformChatTextFormatType string + +const ( + PlatformChatTextFormatTypeText PlatformChatTextFormatType = "TEXT" +) + +func (e PlatformChatTextFormatType) ToPointer() *PlatformChatTextFormatType { + return &e +} +func (e *PlatformChatTextFormatType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "TEXT": + *e = PlatformChatTextFormatType(v) + return nil + default: + return fmt.Errorf("invalid value for PlatformChatTextFormatType: %v", v) + } +} + +// PlatformChatTextFormat - Unconstrained plain-text assistant output. +type PlatformChatTextFormat struct { + // Discriminator. Must be TEXT. + Type PlatformChatTextFormatType `json:"type"` +} + +func (p PlatformChatTextFormat) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *PlatformChatTextFormat) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, []string{"type"}); err != nil { + return err + } + return nil +} + +func (o *PlatformChatTextFormat) GetType() PlatformChatTextFormatType { + if o == nil { + return PlatformChatTextFormatType("") + } + return o.Type +} diff --git a/src/__tests__/mockserver/internal/sdk/models/components/platformdurableagentrun.go b/src/__tests__/mockserver/internal/sdk/models/components/platformdurableagentrun.go new file mode 100644 index 00000000..a5575962 --- /dev/null +++ b/src/__tests__/mockserver/internal/sdk/models/components/platformdurableagentrun.go @@ -0,0 +1,106 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: 3df53a73fb3e + +package components + +import ( + "mockserver/internal/sdk/utils" + "time" +) + +// PlatformDurableAgentRun - Agent run state, pending tool approvals, and output available independently of the creation request. +type PlatformDurableAgentRun struct { + // ID of the run, preserved across approval continuations. + RunID string `json:"run_id"` + // ID of the agent that owns the run. + AgentID string `json:"agent_id"` + // State of the persisted workflow execution. REQUIRES_INPUT is nonterminal. + State PlatformAgentRunState `json:"state"` + // Timestamp when the run was first persisted. + CreatedAt time.Time `json:"created_at"` + // Latest persisted activity timestamp across the execution and its messages, including checkpoint messages. This is not a worker heartbeat or an exact state-transition timestamp. + // + UpdatedAt time.Time `json:"updated_at"` + // Execution deadline, when one is set. Not the run history retention deadline. + ExpiresAt *time.Time `json:"expires_at,omitempty"` + // Unanswered tool approvals when the run is in REQUIRES_INPUT. Empty in other states. + PendingInteractions []PlatformAgentRunToolApproval `json:"pending_interactions"` + // Accumulated text-only agent output under the messages key, when available. + Output map[string]any `json:"output,omitempty"` + // Caller-safe details of an agent run execution failure. + Error *PlatformAgentRunError `json:"error,omitempty"` +} + +func (p PlatformDurableAgentRun) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *PlatformDurableAgentRun) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, []string{"run_id", "agent_id", "state", "created_at", "updated_at", "pending_interactions"}); err != nil { + return err + } + return nil +} + +func (o *PlatformDurableAgentRun) GetRunID() string { + if o == nil { + return "" + } + return o.RunID +} + +func (o *PlatformDurableAgentRun) GetAgentID() string { + if o == nil { + return "" + } + return o.AgentID +} + +func (o *PlatformDurableAgentRun) GetState() PlatformAgentRunState { + if o == nil { + return PlatformAgentRunState("") + } + return o.State +} + +func (o *PlatformDurableAgentRun) GetCreatedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.CreatedAt +} + +func (o *PlatformDurableAgentRun) GetUpdatedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.UpdatedAt +} + +func (o *PlatformDurableAgentRun) GetExpiresAt() *time.Time { + if o == nil { + return nil + } + return o.ExpiresAt +} + +func (o *PlatformDurableAgentRun) GetPendingInteractions() []PlatformAgentRunToolApproval { + if o == nil { + return []PlatformAgentRunToolApproval{} + } + return o.PendingInteractions +} + +func (o *PlatformDurableAgentRun) GetOutput() map[string]any { + if o == nil { + return nil + } + return o.Output +} + +func (o *PlatformDurableAgentRun) GetError() *PlatformAgentRunError { + if o == nil { + return nil + } + return o.Error +} diff --git a/src/__tests__/mockserver/internal/sdk/models/operations/platformagentscreaterun.go b/src/__tests__/mockserver/internal/sdk/models/operations/platformagentscreaterun.go index 5f0f5cd9..ddecae80 100644 --- a/src/__tests__/mockserver/internal/sdk/models/operations/platformagentscreaterun.go +++ b/src/__tests__/mockserver/internal/sdk/models/operations/platformagentscreaterun.go @@ -33,6 +33,9 @@ type PlatformAgentsCreateRunResponse struct { PlatformAgentRunWaitResponse *components.PlatformAgentRunWaitResponse // Successful response. Res *string + // Durable run persisted and started. The snapshot is immediately retrievable through GET /api/agents/{agent_id}/runs/{run_id}. Execution failures appear in the run state. + // + PlatformAgentRunResponse *components.PlatformAgentRunResponse } func (o *PlatformAgentsCreateRunResponse) GetHTTPMeta() components.HTTPMetadata { @@ -55,3 +58,10 @@ func (o *PlatformAgentsCreateRunResponse) GetRes() *string { } return o.Res } + +func (o *PlatformAgentsCreateRunResponse) GetPlatformAgentRunResponse() *components.PlatformAgentRunResponse { + if o == nil { + return nil + } + return o.PlatformAgentRunResponse +} diff --git a/src/__tests__/mockserver/internal/sdk/models/operations/platformagentsgetrun.go b/src/__tests__/mockserver/internal/sdk/models/operations/platformagentsgetrun.go new file mode 100644 index 00000000..3bb63424 --- /dev/null +++ b/src/__tests__/mockserver/internal/sdk/models/operations/platformagentsgetrun.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: 8f52c48c9967 + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PlatformAgentsGetRunRequest struct { + // ID of the agent that owns the run. + AgentID string `pathParam:"style=simple,explode=false,name=agent_id"` + // ID of the durable run to retrieve. + RunID string `pathParam:"style=simple,explode=false,name=run_id"` +} + +func (o *PlatformAgentsGetRunRequest) GetAgentID() string { + if o == nil { + return "" + } + return o.AgentID +} + +func (o *PlatformAgentsGetRunRequest) GetRunID() string { + if o == nil { + return "" + } + return o.RunID +} + +type PlatformAgentsGetRunResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Current persisted run snapshot. A failed execution is still a successful retrieval. + PlatformAgentRunResponse *components.PlatformAgentRunResponse +} + +func (o *PlatformAgentsGetRunResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *PlatformAgentsGetRunResponse) GetPlatformAgentRunResponse() *components.PlatformAgentRunResponse { + if o == nil { + return nil + } + return o.PlatformAgentRunResponse +} diff --git a/src/__tests__/mockserver/internal/sdk/models/operations/platformchatcreate.go b/src/__tests__/mockserver/internal/sdk/models/operations/platformchatcreate.go index 439b883a..12c116d7 100644 --- a/src/__tests__/mockserver/internal/sdk/models/operations/platformchatcreate.go +++ b/src/__tests__/mockserver/internal/sdk/models/operations/platformchatcreate.go @@ -4,6 +4,7 @@ package operations import ( + "encoding/json" "errors" "fmt" "mockserver/internal/sdk/models/components" @@ -75,6 +76,120 @@ func (u PlatformChatCreateInput) MarshalJSON() ([]byte, error) { return nil, errors.New("could not marshal union type PlatformChatCreateInput: all fields are null") } +type PlatformChatCreateFormatType string + +const ( + PlatformChatCreateFormatTypeText PlatformChatCreateFormatType = "TEXT" + PlatformChatCreateFormatTypeJSONSchema PlatformChatCreateFormatType = "JSON_SCHEMA" +) + +// PlatformChatCreateFormat - Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. +type PlatformChatCreateFormat struct { + PlatformChatTextFormat *components.PlatformChatTextFormat `queryParam:"inline"` + PlatformChatJSONSchemaFormat *components.PlatformChatJSONSchemaFormat `queryParam:"inline"` + + Type PlatformChatCreateFormatType +} + +func CreatePlatformChatCreateFormatText(text components.PlatformChatTextFormat) PlatformChatCreateFormat { + typ := PlatformChatCreateFormatTypeText + + typStr := components.PlatformChatTextFormatType(typ) + text.Type = typStr + + return PlatformChatCreateFormat{ + PlatformChatTextFormat: &text, + Type: typ, + } +} + +func CreatePlatformChatCreateFormatJSONSchema(jsonSchema components.PlatformChatJSONSchemaFormat) PlatformChatCreateFormat { + typ := PlatformChatCreateFormatTypeJSONSchema + + typStr := components.PlatformChatJSONSchemaFormatType(typ) + jsonSchema.Type = typStr + + return PlatformChatCreateFormat{ + PlatformChatJSONSchemaFormat: &jsonSchema, + Type: typ, + } +} + +func (u *PlatformChatCreateFormat) UnmarshalJSON(data []byte) error { + + type discriminator struct { + Type string `json:"type"` + } + + dis := new(discriminator) + if err := json.Unmarshal(data, &dis); err != nil { + return fmt.Errorf("could not unmarshal discriminator: %w", err) + } + + switch dis.Type { + case "TEXT": + platformChatTextFormat := new(components.PlatformChatTextFormat) + if err := utils.UnmarshalJSON(data, &platformChatTextFormat, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == TEXT) type components.PlatformChatTextFormat within PlatformChatCreateFormat: %w", string(data), err) + } + + u.PlatformChatTextFormat = platformChatTextFormat + u.Type = PlatformChatCreateFormatTypeText + return nil + case "JSON_SCHEMA": + platformChatJSONSchemaFormat := new(components.PlatformChatJSONSchemaFormat) + if err := utils.UnmarshalJSON(data, &platformChatJSONSchemaFormat, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == JSON_SCHEMA) type components.PlatformChatJSONSchemaFormat within PlatformChatCreateFormat: %w", string(data), err) + } + + u.PlatformChatJSONSchemaFormat = platformChatJSONSchemaFormat + u.Type = PlatformChatCreateFormatTypeJSONSchema + return nil + } + + return fmt.Errorf("could not unmarshal `%s` into any supported union types for PlatformChatCreateFormat", string(data)) +} + +func (u PlatformChatCreateFormat) MarshalJSON() ([]byte, error) { + if u.PlatformChatTextFormat != nil { + return utils.MarshalJSON(u.PlatformChatTextFormat, "", true) + } + + if u.PlatformChatJSONSchemaFormat != nil { + return utils.MarshalJSON(u.PlatformChatJSONSchemaFormat, "", true) + } + + return nil, errors.New("could not marshal union type PlatformChatCreateFormat: all fields are null") +} + +// PlatformChatCreateText - Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true. +type PlatformChatCreateText struct { + // Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. + // + Format *PlatformChatCreateFormat `json:"format,omitempty"` +} + +func (o *PlatformChatCreateText) GetFormat() *PlatformChatCreateFormat { + if o == nil { + return nil + } + return o.Format +} + +func (o *PlatformChatCreateText) GetFormatText() *components.PlatformChatTextFormat { + if v := o.GetFormat(); v != nil { + return v.PlatformChatTextFormat + } + return nil +} + +func (o *PlatformChatCreateText) GetFormatJSONSchema() *components.PlatformChatJSONSchemaFormat { + if v := o.GetFormat(); v != nil { + return v.PlatformChatJSONSchemaFormat + } + return nil +} + type PlatformChatCreateRequest struct { // Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`. // @@ -86,6 +201,9 @@ type PlatformChatCreateRequest struct { // Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`. // ConversationID *string `json:"conversation_id,omitempty"` + // Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true. + // + Text *PlatformChatCreateText `json:"text,omitempty"` } func (p PlatformChatCreateRequest) MarshalJSON() ([]byte, error) { @@ -124,6 +242,13 @@ func (o *PlatformChatCreateRequest) GetConversationID() *string { return o.ConversationID } +func (o *PlatformChatCreateRequest) GetText() *PlatformChatCreateText { + if o == nil { + return nil + } + return o.Text +} + type PlatformChatCreateResponse struct { HTTPMeta components.HTTPMetadata `json:"-"` // Successful response. diff --git a/src/__tests__/mockserver/internal/sdk/models/operations/platformchatcreatestream.go b/src/__tests__/mockserver/internal/sdk/models/operations/platformchatcreatestream.go index b4b32f8f..68b74bef 100644 --- a/src/__tests__/mockserver/internal/sdk/models/operations/platformchatcreatestream.go +++ b/src/__tests__/mockserver/internal/sdk/models/operations/platformchatcreatestream.go @@ -4,6 +4,7 @@ package operations import ( + "encoding/json" "errors" "fmt" "mockserver/internal/sdk/models/components" @@ -76,6 +77,120 @@ func (u PlatformChatCreateStreamInput) MarshalJSON() ([]byte, error) { return nil, errors.New("could not marshal union type PlatformChatCreateStreamInput: all fields are null") } +type PlatformChatCreateStreamFormatType string + +const ( + PlatformChatCreateStreamFormatTypeText PlatformChatCreateStreamFormatType = "TEXT" + PlatformChatCreateStreamFormatTypeJSONSchema PlatformChatCreateStreamFormatType = "JSON_SCHEMA" +) + +// PlatformChatCreateStreamFormat - Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. +type PlatformChatCreateStreamFormat struct { + PlatformChatTextFormat *components.PlatformChatTextFormat `queryParam:"inline"` + PlatformChatJSONSchemaFormat *components.PlatformChatJSONSchemaFormat `queryParam:"inline"` + + Type PlatformChatCreateStreamFormatType +} + +func CreatePlatformChatCreateStreamFormatText(text components.PlatformChatTextFormat) PlatformChatCreateStreamFormat { + typ := PlatformChatCreateStreamFormatTypeText + + typStr := components.PlatformChatTextFormatType(typ) + text.Type = typStr + + return PlatformChatCreateStreamFormat{ + PlatformChatTextFormat: &text, + Type: typ, + } +} + +func CreatePlatformChatCreateStreamFormatJSONSchema(jsonSchema components.PlatformChatJSONSchemaFormat) PlatformChatCreateStreamFormat { + typ := PlatformChatCreateStreamFormatTypeJSONSchema + + typStr := components.PlatformChatJSONSchemaFormatType(typ) + jsonSchema.Type = typStr + + return PlatformChatCreateStreamFormat{ + PlatformChatJSONSchemaFormat: &jsonSchema, + Type: typ, + } +} + +func (u *PlatformChatCreateStreamFormat) UnmarshalJSON(data []byte) error { + + type discriminator struct { + Type string `json:"type"` + } + + dis := new(discriminator) + if err := json.Unmarshal(data, &dis); err != nil { + return fmt.Errorf("could not unmarshal discriminator: %w", err) + } + + switch dis.Type { + case "TEXT": + platformChatTextFormat := new(components.PlatformChatTextFormat) + if err := utils.UnmarshalJSON(data, &platformChatTextFormat, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == TEXT) type components.PlatformChatTextFormat within PlatformChatCreateStreamFormat: %w", string(data), err) + } + + u.PlatformChatTextFormat = platformChatTextFormat + u.Type = PlatformChatCreateStreamFormatTypeText + return nil + case "JSON_SCHEMA": + platformChatJSONSchemaFormat := new(components.PlatformChatJSONSchemaFormat) + if err := utils.UnmarshalJSON(data, &platformChatJSONSchemaFormat, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == JSON_SCHEMA) type components.PlatformChatJSONSchemaFormat within PlatformChatCreateStreamFormat: %w", string(data), err) + } + + u.PlatformChatJSONSchemaFormat = platformChatJSONSchemaFormat + u.Type = PlatformChatCreateStreamFormatTypeJSONSchema + return nil + } + + return fmt.Errorf("could not unmarshal `%s` into any supported union types for PlatformChatCreateStreamFormat", string(data)) +} + +func (u PlatformChatCreateStreamFormat) MarshalJSON() ([]byte, error) { + if u.PlatformChatTextFormat != nil { + return utils.MarshalJSON(u.PlatformChatTextFormat, "", true) + } + + if u.PlatformChatJSONSchemaFormat != nil { + return utils.MarshalJSON(u.PlatformChatJSONSchemaFormat, "", true) + } + + return nil, errors.New("could not marshal union type PlatformChatCreateStreamFormat: all fields are null") +} + +// PlatformChatCreateStreamText - Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true. +type PlatformChatCreateStreamText struct { + // Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. + // + Format *PlatformChatCreateStreamFormat `json:"format,omitempty"` +} + +func (o *PlatformChatCreateStreamText) GetFormat() *PlatformChatCreateStreamFormat { + if o == nil { + return nil + } + return o.Format +} + +func (o *PlatformChatCreateStreamText) GetFormatText() *components.PlatformChatTextFormat { + if v := o.GetFormat(); v != nil { + return v.PlatformChatTextFormat + } + return nil +} + +func (o *PlatformChatCreateStreamText) GetFormatJSONSchema() *components.PlatformChatJSONSchemaFormat { + if v := o.GetFormat(); v != nil { + return v.PlatformChatJSONSchemaFormat + } + return nil +} + type PlatformChatCreateStreamRequest struct { // Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`. // @@ -87,6 +202,9 @@ type PlatformChatCreateStreamRequest struct { // Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`. // ConversationID *string `json:"conversation_id,omitempty"` + // Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true. + // + Text *PlatformChatCreateStreamText `json:"text,omitempty"` } func (p PlatformChatCreateStreamRequest) MarshalJSON() ([]byte, error) { @@ -125,6 +243,13 @@ func (o *PlatformChatCreateStreamRequest) GetConversationID() *string { return o.ConversationID } +func (o *PlatformChatCreateStreamRequest) GetText() *PlatformChatCreateStreamText { + if o == nil { + return nil + } + return o.Text +} + type PlatformChatCreateStreamResponse struct { HTTPMeta components.HTTPMetadata `json:"-"` // Successful response. diff --git a/src/__tests__/summarize.test.ts b/src/__tests__/summarize.test.ts index 3e8e82d2..73c8d34a 100644 --- a/src/__tests__/summarize.test.ts +++ b/src/__tests__/summarize.test.ts @@ -19,10 +19,10 @@ test("Summarize Summarize", async () => { const result = await glean.client.documents.summarize({ documentSpecs: [ { - url: "https://huge-gym.net/", + url: "https://ashamed-alert.biz/", }, { - ugcType: "COLLECTIONS", + ugcType: "ARTIFACTS", ugcId: "", }, ], diff --git a/src/funcs/agentsCreateRun.ts b/src/funcs/agentsCreateRun.ts index c3a02e5d..a9559fc2 100644 --- a/src/funcs/agentsCreateRun.ts +++ b/src/funcs/agentsCreateRun.ts @@ -37,7 +37,7 @@ export enum CreateRunAcceptEnum { * Create agent run * * @remarks - * Execute an agent run. Set `stream` to true to receive server-sent events; otherwise the response contains the final agent messages. + * Execute an agent run. By default, set `stream` to true to receive server-sent events; otherwise the response contains the final agent messages. Set `execution_mode` to `DURABLE` to persist a new run and return its initial snapshot with HTTP 201 without waiting for execution. Poll the agent-scoped GET run endpoint for progress. Durable execution continues after an HTTP disconnect, but is not automatically resumed after a QE restart or crash. An active turn becomes overdue more than 40 minutes after acceptance (a 30-minute execution timeout plus 10 minutes of grace). The next GET of the run marks the overdue turn FAILED without replay; there is no periodic sweep. Without a GET, the stored run can remain RUNNING. Failure does not prove that external tool work has stopped. Paused runs are not expired. Each POST creates a new run; retrying a POST can create another execution. A run tracks one workflow execution; automatic background-subagent wake turns are separate executions, not continuations tracked by this run ID. */ export function agentsCreateRun( client: GleanCore, @@ -190,6 +190,7 @@ async function $do( M.text(200, operations.PlatformAgentsCreateRunResponse$inboundSchema, { ctype: "text/event-stream", }), + M.json(201, operations.PlatformAgentsCreateRunResponse$inboundSchema), M.jsonErr( 422, errors.PlatformUnauthorizedAgentToolsProblemError$inboundSchema, diff --git a/src/funcs/agentsGetRun.ts b/src/funcs/agentsGetRun.ts new file mode 100644 index 00000000..fd6d1d55 --- /dev/null +++ b/src/funcs/agentsGetRun.ts @@ -0,0 +1,198 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: a0674cb41f42 + */ + +import { GleanCore } from "../core.js"; +import { encodeSimple } from "../lib/encodings.js"; +import { matchStatusCode } from "../lib/http.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { GleanBaseError } from "../models/errors/gleanbaseerror.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Get agent run + * + * @remarks + * Retrieve a persisted workflow execution owned by the authenticated user. The run must belong to the specified agent, and the user must still have access to that agent. Unknown runs, runs owned by another user, and mismatched agent/run identifiers return 404. Requires the agents.run scope. Executions without a persisted workflow record are not available through this endpoint. + */ +export function agentsGetRun( + client: GleanCore, + agentId: string, + runId: string, + options?: RequestOptions, +): APIPromise< + Result< + components.PlatformAgentRunResponse, + | errors.PlatformProblemDetailError + | GleanBaseError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + agentId, + runId, + options, + )); +} + +async function $do( + client: GleanCore, + agentId: string, + runId: string, + options?: RequestOptions, +): Promise< + [ + Result< + components.PlatformAgentRunResponse, + | errors.PlatformProblemDetailError + | GleanBaseError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const input: operations.PlatformAgentsGetRunRequest = { + agent_id: agentId, + run_id: runId, + }; + + const parsed = safeParse( + input, + (value) => + operations.PlatformAgentsGetRunRequest$outboundSchema.parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = null; + + const pathParams = { + agent_id: encodeSimple("agent_id", payload.agent_id, { + explode: false, + charEncoding: "percent", + }), + run_id: encodeSimple("run_id", payload.run_id, { + explode: false, + charEncoding: "percent", + }), + }; + const path = pathToFunc("/api/agents/{agent_id}/runs/{run_id}")(pathParams); + + const headers = new Headers(compactMap({ + Accept: "application/json", + })); + + const secConfig = await extractSecurity(client._options.apiToken); + const securityInput = secConfig == null ? {} : { apiToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "platform-agents-get-run", + oAuth2Scopes: null, + + resolvedSecurity: requestSecurity, + + securitySource: client._options.apiToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "GET", + baseURL: options?.serverURL, + path: path, + headers: headers, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + isErrorStatusCode: (statusCode: number) => + matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + components.PlatformAgentRunResponse, + | errors.PlatformProblemDetailError + | GleanBaseError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, components.PlatformAgentRunResponse$inboundSchema), + M.jsonErr( + [400, 401, 403, 404, 408, 429], + errors.PlatformProblemDetailError$inboundSchema, + { ctype: "application/problem+json" }, + ), + M.jsonErr([500, 503], errors.PlatformProblemDetailError$inboundSchema, { + ctype: "application/problem+json", + }), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/lib/config.ts b/src/lib/config.ts index 307340d0..768e7dc2 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -73,8 +73,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", openapiDocVersion: "0.9.0", - sdkVersion: "0.20.14", - genVersion: "2.937.18", + sdkVersion: "0.20.15", + genVersion: "2.938.0", userAgent: - "speakeasy-sdk/typescript 0.20.14 2.937.18 0.9.0 @gleanwork/api-client", + "speakeasy-sdk/typescript 0.20.15 2.938.0 0.9.0 @gleanwork/api-client", } as const; diff --git a/src/models/components/feedentry.ts b/src/models/components/feedentry.ts index 73ee8838..2d903bca 100644 --- a/src/models/components/feedentry.ts +++ b/src/models/components/feedentry.ts @@ -132,6 +132,8 @@ export const JustificationType = { EditDoc: "EDIT_DOC", ChatToArtifact: "CHAT_TO_ARTIFACT", ShareArtifact: "SHARE_ARTIFACT", + CreateAgent: "CREATE_AGENT", + ManagerInvite: "MANAGER_INVITE", } as const; /** * Type of the justification. diff --git a/src/models/components/feedrequest.ts b/src/models/components/feedrequest.ts index c9ff8e7b..5fc41734 100644 --- a/src/models/components/feedrequest.ts +++ b/src/models/components/feedrequest.ts @@ -69,6 +69,8 @@ export const FeedRequestCategory = { EditDoc: "EDIT_DOC", ChatToArtifact: "CHAT_TO_ARTIFACT", ShareArtifact: "SHARE_ARTIFACT", + CreateAgent: "CREATE_AGENT", + ManagerInvite: "MANAGER_INVITE", } as const; export type FeedRequestCategory = ClosedEnum; diff --git a/src/models/components/feedresult.ts b/src/models/components/feedresult.ts index 49c52ace..ff97d24f 100644 --- a/src/models/components/feedresult.ts +++ b/src/models/components/feedresult.ts @@ -67,6 +67,8 @@ export const FeedResultCategory = { EditDoc: "EDIT_DOC", ChatToArtifact: "CHAT_TO_ARTIFACT", ShareArtifact: "SHARE_ARTIFACT", + CreateAgent: "CREATE_AGENT", + ManagerInvite: "MANAGER_INVITE", } as const; /** * Category of the result, one of the requested categories in incoming request. diff --git a/src/models/components/index.ts b/src/models/components/index.ts index 07faad8f..7d246daf 100644 --- a/src/models/components/index.ts +++ b/src/models/components/index.ts @@ -366,6 +366,10 @@ export * from "./platformagentexecutionstatus.js"; export * from "./platformagentgetresponse.js"; export * from "./platformagentrun.js"; export * from "./platformagentruncreaterequest.js"; +export * from "./platformagentrunerror.js"; +export * from "./platformagentrunresponse.js"; +export * from "./platformagentrunstate.js"; +export * from "./platformagentruntoolapproval.js"; export * from "./platformagentrunwaitresponse.js"; export * from "./platformagentschemasresponse.js"; export * from "./platformagentssearchrequest.js"; @@ -380,6 +384,7 @@ export * from "./platformchatdocumentsource.js"; export * from "./platformchatfailedresponse.js"; export * from "./platformchatfilesource.js"; export * from "./platformchatinputmessage.js"; +export * from "./platformchatjsonschemaformat.js"; export * from "./platformchatoutputmessage.js"; export * from "./platformchatoutputtextcontent.js"; export * from "./platformchatpersonsource.js"; @@ -397,10 +402,12 @@ export * from "./platformchatstreamresponsecreated.js"; export * from "./platformchatstreamresponsecreatedserversentevent.js"; export * from "./platformchatstreamresponsefailed.js"; export * from "./platformchatstreamresponsefailedserversentevent.js"; +export * from "./platformchattextformat.js"; export * from "./platformcontentschedulewebhookevent.js"; export * from "./platformcontenttype.js"; export * from "./platformdatasourcefilterinfo.js"; export * from "./platformdocumentchangewebhookevent.js"; +export * from "./platformdurableagentrun.js"; export * from "./platformfilter.js"; export * from "./platformfilterfieldinfo.js"; export * from "./platformfilteroperator.js"; diff --git a/src/models/components/platformagentruncreaterequest.ts b/src/models/components/platformagentruncreaterequest.ts index ff82f069..129cb72c 100644 --- a/src/models/components/platformagentruncreaterequest.ts +++ b/src/models/components/platformagentruncreaterequest.ts @@ -4,12 +4,29 @@ */ import * as z from "zod/v3"; +import { ClosedEnum } from "../../types/enums.js"; import { PlatformMessageInput, PlatformMessageInput$Outbound, PlatformMessageInput$outboundSchema, } from "./platformmessageinput.js"; +/** + * REQUEST_BOUND preserves the existing wait/stream behavior. DURABLE starts a fresh, persisted execution with a 30-minute execution timeout and returns immediately. DURABLE requires stream to be false or omitted and does not accept metadata.chat_session_id. It does not bypass tool approval requirements or provide automatic QE-crash resumption. Expiry is read-triggered: the next GET of the run marks an active turn FAILED if more than 40 minutes have passed since the turn was accepted. There is no periodic sweep, so the stored run can remain RUNNING until it is read. Expiry never replays execution or expires approval-paused runs, and failure does not prove that external tool work has stopped. + * + * @remarks + */ +export const ExecutionMode = { + RequestBound: "REQUEST_BOUND", + Durable: "DURABLE", +} as const; +/** + * REQUEST_BOUND preserves the existing wait/stream behavior. DURABLE starts a fresh, persisted execution with a 30-minute execution timeout and returns immediately. DURABLE requires stream to be false or omitted and does not accept metadata.chat_session_id. It does not bypass tool approval requirements or provide automatic QE-crash resumption. Expiry is read-triggered: the next GET of the run marks an active turn FAILED if more than 40 minutes have passed since the turn was accepted. There is no periodic sweep, so the stored run can remain RUNNING until it is read. Expiry never replays execution or expires approval-paused runs, and failure does not prove that external tool work has stopped. + * + * @remarks + */ +export type ExecutionMode = ClosedEnum; + /** * Request to run an agent. A request MUST supply either `messages` (a non-empty conversation) or `input` (for input-form triggered agents). * @@ -31,17 +48,29 @@ export type PlatformAgentRunCreateRequest = { */ metadata?: { [k: string]: any } | undefined; /** - * Whether to stream the run response as server-sent events. + * Whether to stream the run response as server-sent events. Not supported in DURABLE mode. */ stream?: boolean | undefined; + /** + * REQUEST_BOUND preserves the existing wait/stream behavior. DURABLE starts a fresh, persisted execution with a 30-minute execution timeout and returns immediately. DURABLE requires stream to be false or omitted and does not accept metadata.chat_session_id. It does not bypass tool approval requirements or provide automatic QE-crash resumption. Expiry is read-triggered: the next GET of the run marks an active turn FAILED if more than 40 minutes have passed since the turn was accepted. There is no periodic sweep, so the stored run can remain RUNNING until it is read. Expiry never replays execution or expires approval-paused runs, and failure does not prove that external tool work has stopped. + * + * @remarks + */ + execution_mode?: ExecutionMode | undefined; }; +/** @internal */ +export const ExecutionMode$outboundSchema: z.ZodNativeEnum< + typeof ExecutionMode +> = z.nativeEnum(ExecutionMode); + /** @internal */ export type PlatformAgentRunCreateRequest$Outbound = { input?: { [k: string]: any } | undefined; messages?: Array | undefined; metadata?: { [k: string]: any } | undefined; stream: boolean; + execution_mode: string; }; /** @internal */ @@ -54,6 +83,7 @@ export const PlatformAgentRunCreateRequest$outboundSchema: z.ZodType< messages: z.array(PlatformMessageInput$outboundSchema).optional(), metadata: z.record(z.any()).optional(), stream: z.boolean().default(false), + execution_mode: ExecutionMode$outboundSchema.default("REQUEST_BOUND"), }); export function platformAgentRunCreateRequestToJSON( diff --git a/src/models/components/platformagentrunerror.ts b/src/models/components/platformagentrunerror.ts new file mode 100644 index 00000000..a5715f25 --- /dev/null +++ b/src/models/components/platformagentrunerror.ts @@ -0,0 +1,43 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 81741b7bd9d6 + */ + +import * as z from "zod/v3"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +/** + * Caller-safe details of an agent run execution failure. + */ +export type PlatformAgentRunError = { + /** + * Machine-readable execution failure code. + */ + code: string; + /** + * Caller-safe execution failure description. + */ + message: string; +}; + +/** @internal */ +export const PlatformAgentRunError$inboundSchema: z.ZodType< + PlatformAgentRunError, + z.ZodTypeDef, + unknown +> = z.object({ + code: z.string(), + message: z.string(), +}); + +export function platformAgentRunErrorFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => PlatformAgentRunError$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'PlatformAgentRunError' from JSON`, + ); +} diff --git a/src/models/components/platformagentrunresponse.ts b/src/models/components/platformagentrunresponse.ts new file mode 100644 index 00000000..95a60125 --- /dev/null +++ b/src/models/components/platformagentrunresponse.ts @@ -0,0 +1,47 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: ba105014a846 + */ + +import * as z from "zod/v3"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { + PlatformDurableAgentRun, + PlatformDurableAgentRun$inboundSchema, +} from "./platformdurableagentrun.js"; + +/** + * Persisted agent run snapshot with a request ID for support correlation. + */ +export type PlatformAgentRunResponse = { + /** + * Agent run state, pending tool approvals, and output available independently of the creation request. + */ + run: PlatformDurableAgentRun; + /** + * Platform-generated request ID for support correlation. + */ + request_id: string; +}; + +/** @internal */ +export const PlatformAgentRunResponse$inboundSchema: z.ZodType< + PlatformAgentRunResponse, + z.ZodTypeDef, + unknown +> = z.object({ + run: PlatformDurableAgentRun$inboundSchema, + request_id: z.string(), +}); + +export function platformAgentRunResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => PlatformAgentRunResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'PlatformAgentRunResponse' from JSON`, + ); +} diff --git a/src/models/components/platformagentrunstate.ts b/src/models/components/platformagentrunstate.ts new file mode 100644 index 00000000..e806fd9e --- /dev/null +++ b/src/models/components/platformagentrunstate.ts @@ -0,0 +1,33 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 7ca67400bb0f + */ + +import * as z from "zod/v3"; +import * as openEnums from "../../types/enums.js"; +import { OpenEnum } from "../../types/enums.js"; + +/** + * State of the persisted workflow execution. REQUIRES_INPUT is nonterminal. + */ +export const PlatformAgentRunState = { + Queued: "QUEUED", + Running: "RUNNING", + RequiresInput: "REQUIRES_INPUT", + Succeeded: "SUCCEEDED", + Failed: "FAILED", + Cancelling: "CANCELLING", + Cancelled: "CANCELLED", + Expired: "EXPIRED", +} as const; +/** + * State of the persisted workflow execution. REQUIRES_INPUT is nonterminal. + */ +export type PlatformAgentRunState = OpenEnum; + +/** @internal */ +export const PlatformAgentRunState$inboundSchema: z.ZodType< + PlatformAgentRunState, + z.ZodTypeDef, + unknown +> = openEnums.inboundSchema(PlatformAgentRunState); diff --git a/src/models/components/platformagentruntoolapproval.ts b/src/models/components/platformagentruntoolapproval.ts new file mode 100644 index 00000000..526a4804 --- /dev/null +++ b/src/models/components/platformagentruntoolapproval.ts @@ -0,0 +1,88 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 95f98723f5af + */ + +import * as z from "zod/v3"; +import { safeParse } from "../../lib/schemas.js"; +import { ClosedEnum } from "../../types/enums.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +/** + * Interaction type identifying a tool execution approval request. + */ +export const PlatformAgentRunToolApprovalType = { + ToolApproval: "TOOL_APPROVAL", +} as const; +/** + * Interaction type identifying a tool execution approval request. + */ +export type PlatformAgentRunToolApprovalType = ClosedEnum< + typeof PlatformAgentRunToolApprovalType +>; + +/** + * Pending approval for a specific persisted tool invocation and its arguments. + */ +export type PlatformAgentRunToolApproval = { + /** + * Identifies this specific invocation approval, not the tool definition. + */ + interaction_id: string; + /** + * Interaction type identifying a tool execution approval request. + */ + type: PlatformAgentRunToolApprovalType; + /** + * Platform tool identifier when recorded. Omitted for requests without one, such as some MCP tools. + */ + tool_id?: string | undefined; + /** + * Display name of the tool requesting approval. + */ + display_name: string; + /** + * Description of the tool associated with this approval request. + */ + description: string; + /** + * Arguments from the persisted approval request. Older platform tools use flattened parameters. + */ + arguments: { [k: string]: any }; + /** + * Approval deadline, when one is set. Omitted when the approval has no expiration. + */ + expires_at?: Date | undefined; +}; + +/** @internal */ +export const PlatformAgentRunToolApprovalType$inboundSchema: z.ZodNativeEnum< + typeof PlatformAgentRunToolApprovalType +> = z.nativeEnum(PlatformAgentRunToolApprovalType); + +/** @internal */ +export const PlatformAgentRunToolApproval$inboundSchema: z.ZodType< + PlatformAgentRunToolApproval, + z.ZodTypeDef, + unknown +> = z.object({ + interaction_id: z.string(), + type: PlatformAgentRunToolApprovalType$inboundSchema, + tool_id: z.string().optional(), + display_name: z.string(), + description: z.string(), + arguments: z.record(z.any()), + expires_at: z.string().datetime({ offset: true }).transform(v => new Date(v)) + .optional(), +}); + +export function platformAgentRunToolApprovalFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => PlatformAgentRunToolApproval$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'PlatformAgentRunToolApproval' from JSON`, + ); +} diff --git a/src/models/components/platformchatjsonschemaformat.ts b/src/models/components/platformchatjsonschemaformat.ts new file mode 100644 index 00000000..e620df58 --- /dev/null +++ b/src/models/components/platformchatjsonschemaformat.ts @@ -0,0 +1,66 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: c7086d714c13 + */ + +import * as z from "zod/v3"; + +/** + * Constrains the assistant response to a caller-supplied JSON Schema. + */ +export type PlatformChatJsonSchemaFormat = { + /** + * Discriminator. Must be JSON_SCHEMA. + */ + type: "JSON_SCHEMA"; + /** + * A stable identifier for the schema. + */ + name: string; + /** + * An optional human-readable description of the schema. + */ + description?: string | undefined; + /** + * A JSON Schema object describing the desired output shape. + */ + schema: { [k: string]: any }; + /** + * When true, the provider validates the response against the schema. Unsupported by some providers; defaults to true. + * + * @remarks + */ + strict?: boolean | undefined; +}; + +/** @internal */ +export type PlatformChatJsonSchemaFormat$Outbound = { + type: "JSON_SCHEMA"; + name: string; + description?: string | undefined; + schema: { [k: string]: any }; + strict: boolean; +}; + +/** @internal */ +export const PlatformChatJsonSchemaFormat$outboundSchema: z.ZodType< + PlatformChatJsonSchemaFormat$Outbound, + z.ZodTypeDef, + PlatformChatJsonSchemaFormat +> = z.object({ + type: z.literal("JSON_SCHEMA"), + name: z.string(), + description: z.string().optional(), + schema: z.record(z.any()), + strict: z.boolean().default(true), +}); + +export function platformChatJsonSchemaFormatToJSON( + platformChatJsonSchemaFormat: PlatformChatJsonSchemaFormat, +): string { + return JSON.stringify( + PlatformChatJsonSchemaFormat$outboundSchema.parse( + platformChatJsonSchemaFormat, + ), + ); +} diff --git a/src/models/components/platformchatoutputtextcontent.ts b/src/models/components/platformchatoutputtextcontent.ts index fef0736f..02f6a05c 100644 --- a/src/models/components/platformchatoutputtextcontent.ts +++ b/src/models/components/platformchatoutputtextcontent.ts @@ -20,9 +20,22 @@ export type PlatformChatOutputTextContentType = ClosedEnum< typeof PlatformChatOutputTextContentType >; +/** + * Parsed and validated JSON object when structured output was requested. Present only when the request included `text.format.type: JSON_SCHEMA`. + * + * @remarks + */ +export type StructuredOutput = {}; + export type PlatformChatOutputTextContent = { type: PlatformChatOutputTextContentType; text: string; + /** + * Parsed and validated JSON object when structured output was requested. Present only when the request included `text.format.type: JSON_SCHEMA`. + * + * @remarks + */ + structured_output?: StructuredOutput | null | undefined; annotations?: Array | undefined; }; @@ -31,6 +44,23 @@ export const PlatformChatOutputTextContentType$inboundSchema: z.ZodNativeEnum< typeof PlatformChatOutputTextContentType > = z.nativeEnum(PlatformChatOutputTextContentType); +/** @internal */ +export const StructuredOutput$inboundSchema: z.ZodType< + StructuredOutput, + z.ZodTypeDef, + unknown +> = z.object({}); + +export function structuredOutputFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => StructuredOutput$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'StructuredOutput' from JSON`, + ); +} + /** @internal */ export const PlatformChatOutputTextContent$inboundSchema: z.ZodType< PlatformChatOutputTextContent, @@ -39,6 +69,8 @@ export const PlatformChatOutputTextContent$inboundSchema: z.ZodType< > = z.object({ type: PlatformChatOutputTextContentType$inboundSchema, text: z.string(), + structured_output: z.nullable(z.lazy(() => StructuredOutput$inboundSchema)) + .optional(), annotations: z.array(PlatformChatCitationAnnotation$inboundSchema).optional(), }); diff --git a/src/models/components/platformchattextformat.ts b/src/models/components/platformchattextformat.ts new file mode 100644 index 00000000..f76809c9 --- /dev/null +++ b/src/models/components/platformchattextformat.ts @@ -0,0 +1,38 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 6dad34f1fc6d + */ + +import * as z from "zod/v3"; + +/** + * Unconstrained plain-text assistant output. + */ +export type PlatformChatTextFormat = { + /** + * Discriminator. Must be TEXT. + */ + type: "TEXT"; +}; + +/** @internal */ +export type PlatformChatTextFormat$Outbound = { + type: "TEXT"; +}; + +/** @internal */ +export const PlatformChatTextFormat$outboundSchema: z.ZodType< + PlatformChatTextFormat$Outbound, + z.ZodTypeDef, + PlatformChatTextFormat +> = z.object({ + type: z.literal("TEXT"), +}); + +export function platformChatTextFormatToJSON( + platformChatTextFormat: PlatformChatTextFormat, +): string { + return JSON.stringify( + PlatformChatTextFormat$outboundSchema.parse(platformChatTextFormat), + ); +} diff --git a/src/models/components/platformdurableagentrun.ts b/src/models/components/platformdurableagentrun.ts new file mode 100644 index 00000000..190f90a4 --- /dev/null +++ b/src/models/components/platformdurableagentrun.ts @@ -0,0 +1,93 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: d363786a8762 + */ + +import * as z from "zod/v3"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { + PlatformAgentRunError, + PlatformAgentRunError$inboundSchema, +} from "./platformagentrunerror.js"; +import { + PlatformAgentRunState, + PlatformAgentRunState$inboundSchema, +} from "./platformagentrunstate.js"; +import { + PlatformAgentRunToolApproval, + PlatformAgentRunToolApproval$inboundSchema, +} from "./platformagentruntoolapproval.js"; + +/** + * Agent run state, pending tool approvals, and output available independently of the creation request. + */ +export type PlatformDurableAgentRun = { + /** + * ID of the run, preserved across approval continuations. + */ + run_id: string; + /** + * ID of the agent that owns the run. + */ + agent_id: string; + /** + * State of the persisted workflow execution. REQUIRES_INPUT is nonterminal. + */ + state: PlatformAgentRunState; + /** + * Timestamp when the run was first persisted. + */ + created_at: Date; + /** + * Latest persisted activity timestamp across the execution and its messages, including checkpoint messages. This is not a worker heartbeat or an exact state-transition timestamp. + * + * @remarks + */ + updated_at: Date; + /** + * Execution deadline, when one is set. Not the run history retention deadline. + */ + expires_at?: Date | undefined; + /** + * Unanswered tool approvals when the run is in REQUIRES_INPUT. Empty in other states. + */ + pending_interactions: Array; + /** + * Accumulated text-only agent output under the messages key, when available. + */ + output?: { [k: string]: any } | undefined; + /** + * Caller-safe details of an agent run execution failure. + */ + error?: PlatformAgentRunError | undefined; +}; + +/** @internal */ +export const PlatformDurableAgentRun$inboundSchema: z.ZodType< + PlatformDurableAgentRun, + z.ZodTypeDef, + unknown +> = z.object({ + run_id: z.string(), + agent_id: z.string(), + state: PlatformAgentRunState$inboundSchema, + created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), + updated_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), + expires_at: z.string().datetime({ offset: true }).transform(v => new Date(v)) + .optional(), + pending_interactions: z.array(PlatformAgentRunToolApproval$inboundSchema), + output: z.record(z.any()).optional(), + error: PlatformAgentRunError$inboundSchema.optional(), +}); + +export function platformDurableAgentRunFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => PlatformDurableAgentRun$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'PlatformDurableAgentRun' from JSON`, + ); +} diff --git a/src/models/operations/index.ts b/src/models/operations/index.ts index e1435f5e..a61337de 100644 --- a/src/models/operations/index.ts +++ b/src/models/operations/index.ts @@ -76,6 +76,7 @@ export * from "./people.js"; export * from "./pin.js"; export * from "./platformagentscreaterun.js"; export * from "./platformagentsget.js"; +export * from "./platformagentsgetrun.js"; export * from "./platformagentsgetschemas.js"; export * from "./platformchatcreate.js"; export * from "./platformchatcreatestream.js"; diff --git a/src/models/operations/platformagentscreaterun.ts b/src/models/operations/platformagentscreaterun.ts index 70e7208b..abfeb338 100644 --- a/src/models/operations/platformagentscreaterun.ts +++ b/src/models/operations/platformagentscreaterun.ts @@ -19,6 +19,7 @@ export type PlatformAgentsCreateRunRequest = { }; export type PlatformAgentsCreateRunResponse = + | components.PlatformAgentRunResponse | components.PlatformAgentRunWaitResponse | string; @@ -60,6 +61,7 @@ export const PlatformAgentsCreateRunResponse$inboundSchema: z.ZodType< z.ZodTypeDef, unknown > = z.union([ + components.PlatformAgentRunResponse$inboundSchema, components.PlatformAgentRunWaitResponse$inboundSchema, z.string(), ]); diff --git a/src/models/operations/platformagentsgetrun.ts b/src/models/operations/platformagentsgetrun.ts new file mode 100644 index 00000000..a3bcaca6 --- /dev/null +++ b/src/models/operations/platformagentsgetrun.ts @@ -0,0 +1,43 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 49839848ed07 + */ + +import * as z from "zod/v3"; + +export type PlatformAgentsGetRunRequest = { + /** + * ID of the agent that owns the run. + */ + agent_id: string; + /** + * ID of the durable run to retrieve. + */ + run_id: string; +}; + +/** @internal */ +export type PlatformAgentsGetRunRequest$Outbound = { + agent_id: string; + run_id: string; +}; + +/** @internal */ +export const PlatformAgentsGetRunRequest$outboundSchema: z.ZodType< + PlatformAgentsGetRunRequest$Outbound, + z.ZodTypeDef, + PlatformAgentsGetRunRequest +> = z.object({ + agent_id: z.string(), + run_id: z.string(), +}); + +export function platformAgentsGetRunRequestToJSON( + platformAgentsGetRunRequest: PlatformAgentsGetRunRequest, +): string { + return JSON.stringify( + PlatformAgentsGetRunRequest$outboundSchema.parse( + platformAgentsGetRunRequest, + ), + ); +} diff --git a/src/models/operations/platformchatcreate.ts b/src/models/operations/platformchatcreate.ts index c78b6a8a..abdc5260 100644 --- a/src/models/operations/platformchatcreate.ts +++ b/src/models/operations/platformchatcreate.ts @@ -15,6 +15,32 @@ export type PlatformChatCreateInput = | string | Array; +/** + * Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. + * + * @remarks + */ +export type PlatformChatCreateFormat = + | components.PlatformChatTextFormat + | components.PlatformChatJsonSchemaFormat; + +/** + * Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true. + * + * @remarks + */ +export type PlatformChatCreateText = { + /** + * Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. + * + * @remarks + */ + format?: + | components.PlatformChatTextFormat + | components.PlatformChatJsonSchemaFormat + | undefined; +}; + export type PlatformChatCreateRequest = { /** * Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`. @@ -35,6 +61,12 @@ export type PlatformChatCreateRequest = { * @remarks */ conversation_id?: string | undefined; + /** + * Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true. + * + * @remarks + */ + text?: PlatformChatCreateText | undefined; }; /** @internal */ @@ -60,12 +92,64 @@ export function platformChatCreateInputToJSON( ); } +/** @internal */ +export type PlatformChatCreateFormat$Outbound = + | components.PlatformChatTextFormat$Outbound + | components.PlatformChatJsonSchemaFormat$Outbound; + +/** @internal */ +export const PlatformChatCreateFormat$outboundSchema: z.ZodType< + PlatformChatCreateFormat$Outbound, + z.ZodTypeDef, + PlatformChatCreateFormat +> = z.union([ + components.PlatformChatTextFormat$outboundSchema, + components.PlatformChatJsonSchemaFormat$outboundSchema, +]); + +export function platformChatCreateFormatToJSON( + platformChatCreateFormat: PlatformChatCreateFormat, +): string { + return JSON.stringify( + PlatformChatCreateFormat$outboundSchema.parse(platformChatCreateFormat), + ); +} + +/** @internal */ +export type PlatformChatCreateText$Outbound = { + format?: + | components.PlatformChatTextFormat$Outbound + | components.PlatformChatJsonSchemaFormat$Outbound + | undefined; +}; + +/** @internal */ +export const PlatformChatCreateText$outboundSchema: z.ZodType< + PlatformChatCreateText$Outbound, + z.ZodTypeDef, + PlatformChatCreateText +> = z.object({ + format: z.union([ + components.PlatformChatTextFormat$outboundSchema, + components.PlatformChatJsonSchemaFormat$outboundSchema, + ]).optional(), +}); + +export function platformChatCreateTextToJSON( + platformChatCreateText: PlatformChatCreateText, +): string { + return JSON.stringify( + PlatformChatCreateText$outboundSchema.parse(platformChatCreateText), + ); +} + /** @internal */ export type PlatformChatCreateRequest$Outbound = { input: string | Array; stream: false; store: boolean; conversation_id?: string | undefined; + text?: PlatformChatCreateText$Outbound | undefined; }; /** @internal */ @@ -81,6 +165,7 @@ export const PlatformChatCreateRequest$outboundSchema: z.ZodType< stream: z.literal(false).default(false as const), store: z.boolean().default(true), conversation_id: z.string().optional(), + text: z.lazy(() => PlatformChatCreateText$outboundSchema).optional(), }); export function platformChatCreateRequestToJSON( diff --git a/src/models/operations/platformchatcreatestream.ts b/src/models/operations/platformchatcreatestream.ts index c06337a7..3b1f8a17 100644 --- a/src/models/operations/platformchatcreatestream.ts +++ b/src/models/operations/platformchatcreatestream.ts @@ -15,6 +15,32 @@ export type PlatformChatCreateStreamInput = | string | Array; +/** + * Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. + * + * @remarks + */ +export type PlatformChatCreateStreamFormat = + | components.PlatformChatTextFormat + | components.PlatformChatJsonSchemaFormat; + +/** + * Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true. + * + * @remarks + */ +export type PlatformChatCreateStreamText = { + /** + * Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. + * + * @remarks + */ + format?: + | components.PlatformChatTextFormat + | components.PlatformChatJsonSchemaFormat + | undefined; +}; + export type PlatformChatCreateStreamRequest = { /** * Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`. @@ -35,6 +61,12 @@ export type PlatformChatCreateStreamRequest = { * @remarks */ conversation_id?: string | undefined; + /** + * Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true. + * + * @remarks + */ + text?: PlatformChatCreateStreamText | undefined; }; /** @internal */ @@ -62,12 +94,68 @@ export function platformChatCreateStreamInputToJSON( ); } +/** @internal */ +export type PlatformChatCreateStreamFormat$Outbound = + | components.PlatformChatTextFormat$Outbound + | components.PlatformChatJsonSchemaFormat$Outbound; + +/** @internal */ +export const PlatformChatCreateStreamFormat$outboundSchema: z.ZodType< + PlatformChatCreateStreamFormat$Outbound, + z.ZodTypeDef, + PlatformChatCreateStreamFormat +> = z.union([ + components.PlatformChatTextFormat$outboundSchema, + components.PlatformChatJsonSchemaFormat$outboundSchema, +]); + +export function platformChatCreateStreamFormatToJSON( + platformChatCreateStreamFormat: PlatformChatCreateStreamFormat, +): string { + return JSON.stringify( + PlatformChatCreateStreamFormat$outboundSchema.parse( + platformChatCreateStreamFormat, + ), + ); +} + +/** @internal */ +export type PlatformChatCreateStreamText$Outbound = { + format?: + | components.PlatformChatTextFormat$Outbound + | components.PlatformChatJsonSchemaFormat$Outbound + | undefined; +}; + +/** @internal */ +export const PlatformChatCreateStreamText$outboundSchema: z.ZodType< + PlatformChatCreateStreamText$Outbound, + z.ZodTypeDef, + PlatformChatCreateStreamText +> = z.object({ + format: z.union([ + components.PlatformChatTextFormat$outboundSchema, + components.PlatformChatJsonSchemaFormat$outboundSchema, + ]).optional(), +}); + +export function platformChatCreateStreamTextToJSON( + platformChatCreateStreamText: PlatformChatCreateStreamText, +): string { + return JSON.stringify( + PlatformChatCreateStreamText$outboundSchema.parse( + platformChatCreateStreamText, + ), + ); +} + /** @internal */ export type PlatformChatCreateStreamRequest$Outbound = { input: string | Array; stream: true; store: boolean; conversation_id?: string | undefined; + text?: PlatformChatCreateStreamText$Outbound | undefined; }; /** @internal */ @@ -83,6 +171,7 @@ export const PlatformChatCreateStreamRequest$outboundSchema: z.ZodType< stream: z.literal(true).default(true as const), store: z.boolean().default(true), conversation_id: z.string().optional(), + text: z.lazy(() => PlatformChatCreateStreamText$outboundSchema).optional(), }); export function platformChatCreateStreamRequestToJSON( diff --git a/src/react-query/agentsCreateRun.ts b/src/react-query/agentsCreateRun.ts index 49dba4cf..066631ff 100644 --- a/src/react-query/agentsCreateRun.ts +++ b/src/react-query/agentsCreateRun.ts @@ -59,7 +59,7 @@ export type AgentsCreateRunMutationError = * Create agent run * * @remarks - * Execute an agent run. Set `stream` to true to receive server-sent events; otherwise the response contains the final agent messages. + * Execute an agent run. By default, set `stream` to true to receive server-sent events; otherwise the response contains the final agent messages. Set `execution_mode` to `DURABLE` to persist a new run and return its initial snapshot with HTTP 201 without waiting for execution. Poll the agent-scoped GET run endpoint for progress. Durable execution continues after an HTTP disconnect, but is not automatically resumed after a QE restart or crash. An active turn becomes overdue more than 40 minutes after acceptance (a 30-minute execution timeout plus 10 minutes of grace). The next GET of the run marks the overdue turn FAILED without replay; there is no periodic sweep. Without a GET, the stored run can remain RUNNING. Failure does not prove that external tool work has stopped. Paused runs are not expired. Each POST creates a new run; retrying a POST can create another execution. A run tracks one workflow execution; automatic background-subagent wake turns are separate executions, not continuations tracked by this run ID. */ export function useAgentsCreateRunMutation( options?: MutationHookOptions< diff --git a/src/react-query/agentsGetRun.core.ts b/src/react-query/agentsGetRun.core.ts new file mode 100644 index 00000000..1833a238 --- /dev/null +++ b/src/react-query/agentsGetRun.core.ts @@ -0,0 +1,73 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: b5f0a2ec4f34 + */ + +import { + QueryClient, + QueryFunctionContext, + QueryKey, +} from "@tanstack/react-query"; +import { GleanCore } from "../core.js"; +import { agentsGetRun } from "../funcs/agentsGetRun.js"; +import { combineSignals } from "../lib/primitives.js"; +import { RequestOptions } from "../lib/sdks.js"; +import * as components from "../models/components/index.js"; +import { unwrapAsync } from "../types/fp.js"; +export type AgentsGetRunQueryData = components.PlatformAgentRunResponse; + +export function prefetchAgentsGetRun( + queryClient: QueryClient, + client$: GleanCore, + agentId: string, + runId: string, + options?: RequestOptions, +): Promise { + return queryClient.prefetchQuery({ + ...buildAgentsGetRunQuery( + client$, + agentId, + runId, + options, + ), + }); +} + +export function buildAgentsGetRunQuery( + client$: GleanCore, + agentId: string, + runId: string, + options?: RequestOptions, +): { + queryKey: QueryKey; + queryFn: (context: QueryFunctionContext) => Promise; +} { + return { + queryKey: queryKeyAgentsGetRun(agentId, runId), + queryFn: async function agentsGetRunQueryFn( + ctx, + ): Promise { + const sig = combineSignals( + ctx.signal, + options?.signal, + options?.fetchOptions?.signal, + ); + const mergedOptions = { + ...options?.fetchOptions, + ...options, + signal: sig, + }; + + return unwrapAsync(agentsGetRun( + client$, + agentId, + runId, + mergedOptions, + )); + }, + }; +} + +export function queryKeyAgentsGetRun(agentId: string, runId: string): QueryKey { + return ["@gleanwork/api-client", "agents", "getRun", agentId, runId]; +} diff --git a/src/react-query/agentsGetRun.ts b/src/react-query/agentsGetRun.ts new file mode 100644 index 00000000..fe3d1b31 --- /dev/null +++ b/src/react-query/agentsGetRun.ts @@ -0,0 +1,133 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 50ee42338ff5 + */ + +import { + InvalidateQueryFilters, + QueryClient, + useQuery, + UseQueryResult, + useSuspenseQuery, + UseSuspenseQueryResult, +} from "@tanstack/react-query"; +import { GleanBaseError } from "../models/errors/gleanbaseerror.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import { useGleanContext } from "./_context.js"; +import { + QueryHookOptions, + SuspenseQueryHookOptions, + TupleToPrefixes, +} from "./_types.js"; +import { + AgentsGetRunQueryData, + buildAgentsGetRunQuery, + prefetchAgentsGetRun, + queryKeyAgentsGetRun, +} from "./agentsGetRun.core.js"; +export { + type AgentsGetRunQueryData, + buildAgentsGetRunQuery, + prefetchAgentsGetRun, + queryKeyAgentsGetRun, +}; + +export type AgentsGetRunQueryError = + | errors.PlatformProblemDetailError + | GleanBaseError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError; + +/** + * Get agent run + * + * @remarks + * Retrieve a persisted workflow execution owned by the authenticated user. The run must belong to the specified agent, and the user must still have access to that agent. Unknown runs, runs owned by another user, and mismatched agent/run identifiers return 404. Requires the agents.run scope. Executions without a persisted workflow record are not available through this endpoint. + */ +export function useAgentsGetRun( + agentId: string, + runId: string, + options?: QueryHookOptions, +): UseQueryResult { + const client = useGleanContext(); + return useQuery({ + ...buildAgentsGetRunQuery( + client, + agentId, + runId, + options, + ), + ...options, + }); +} + +/** + * Get agent run + * + * @remarks + * Retrieve a persisted workflow execution owned by the authenticated user. The run must belong to the specified agent, and the user must still have access to that agent. Unknown runs, runs owned by another user, and mismatched agent/run identifiers return 404. Requires the agents.run scope. Executions without a persisted workflow record are not available through this endpoint. + */ +export function useAgentsGetRunSuspense( + agentId: string, + runId: string, + options?: SuspenseQueryHookOptions< + AgentsGetRunQueryData, + AgentsGetRunQueryError + >, +): UseSuspenseQueryResult { + const client = useGleanContext(); + return useSuspenseQuery({ + ...buildAgentsGetRunQuery( + client, + agentId, + runId, + options, + ), + ...options, + }); +} + +export function setAgentsGetRunData( + client: QueryClient, + queryKeyBase: [agentId: string, runId: string], + data: AgentsGetRunQueryData, +): AgentsGetRunQueryData | undefined { + const key = queryKeyAgentsGetRun(...queryKeyBase); + + return client.setQueryData(key, data); +} + +export function invalidateAgentsGetRun( + client: QueryClient, + queryKeyBase: TupleToPrefixes<[agentId: string, runId: string]>, + filters?: Omit, +): Promise { + return client.invalidateQueries({ + ...filters, + queryKey: ["@gleanwork/api-client", "agents", "getRun", ...queryKeyBase], + }); +} + +export function invalidateAllAgentsGetRun( + client: QueryClient, + filters?: Omit, +): Promise { + return client.invalidateQueries({ + ...filters, + queryKey: ["@gleanwork/api-client", "agents", "getRun"], + }); +} diff --git a/src/react-query/index.ts b/src/react-query/index.ts index 2cff4e7a..ba0a8f81 100644 --- a/src/react-query/index.ts +++ b/src/react-query/index.ts @@ -8,6 +8,7 @@ export * from "./_types.js"; export * from "./agentsCreateRun.js"; export * from "./agentsGet.js"; +export * from "./agentsGetRun.js"; export * from "./agentsGetSchemas.js"; export * from "./agentsSearch.js"; export * from "./chatCreate.js"; diff --git a/src/sdk/agents.ts b/src/sdk/agents.ts index 69da82eb..012c2a57 100644 --- a/src/sdk/agents.ts +++ b/src/sdk/agents.ts @@ -8,6 +8,7 @@ import { CreateRunAcceptEnum, } from "../funcs/agentsCreateRun.js"; import { agentsGet } from "../funcs/agentsGet.js"; +import { agentsGetRun } from "../funcs/agentsGetRun.js"; import { agentsGetSchemas } from "../funcs/agentsGetSchemas.js"; import { agentsSearch } from "../funcs/agentsSearch.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; @@ -75,7 +76,7 @@ export class Agents extends ClientSDK { * Create agent run * * @remarks - * Execute an agent run. Set `stream` to true to receive server-sent events; otherwise the response contains the final agent messages. + * Execute an agent run. By default, set `stream` to true to receive server-sent events; otherwise the response contains the final agent messages. Set `execution_mode` to `DURABLE` to persist a new run and return its initial snapshot with HTTP 201 without waiting for execution. Poll the agent-scoped GET run endpoint for progress. Durable execution continues after an HTTP disconnect, but is not automatically resumed after a QE restart or crash. An active turn becomes overdue more than 40 minutes after acceptance (a 30-minute execution timeout plus 10 minutes of grace). The next GET of the run marks the overdue turn FAILED without replay; there is no periodic sweep. Without a GET, the stored run can remain RUNNING. Failure does not prove that external tool work has stopped. Paused runs are not expired. Each POST creates a new run; retrying a POST can create another execution. A run tracks one workflow execution; automatic background-subagent wake turns are separate executions, not continuations tracked by this run ID. */ async createRun( platformAgentRunCreateRequest: components.PlatformAgentRunCreateRequest, @@ -89,4 +90,23 @@ export class Agents extends ClientSDK { options, )); } + + /** + * Get agent run + * + * @remarks + * Retrieve a persisted workflow execution owned by the authenticated user. The run must belong to the specified agent, and the user must still have access to that agent. Unknown runs, runs owned by another user, and mismatched agent/run identifiers return 404. Requires the agents.run scope. Executions without a persisted workflow record are not available through this endpoint. + */ + async getRun( + agentId: string, + runId: string, + options?: RequestOptions, + ): Promise { + return unwrapAsync(agentsGetRun( + this, + agentId, + runId, + options, + )); + } }