@osdk/react 2.41.0 → 2.41.1-main-e39a72892d538f3130e2cd51cee05d83d11fa493

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/build/browser/aip/chatStore.js.map +1 -1
  3. package/build/browser/aip/chatStream.js +1 -1
  4. package/build/browser/aip/chatStream.js.map +1 -1
  5. package/build/browser/aip/useChat.js +1 -1
  6. package/build/browser/aip/useChat.js.map +1 -1
  7. package/build/browser/new/OsdkContext.js.map +1 -1
  8. package/build/browser/new/OsdkProvider.js.map +1 -1
  9. package/build/browser/new/UserAgentContext.js.map +1 -1
  10. package/build/browser/new/core/stableSerialize.js.map +1 -1
  11. package/build/browser/new/core/useStableObjectSet.js.map +1 -1
  12. package/build/browser/new/createCompositeExternalStore.js +1 -1
  13. package/build/browser/new/createCompositeExternalStore.js.map +1 -1
  14. package/build/browser/new/hookUtils.js.map +1 -1
  15. package/build/browser/new/makeExternalStore.js +3 -3
  16. package/build/browser/new/makeExternalStore.js.map +1 -1
  17. package/build/browser/new/platform-apis/admin/useCbacBanner.js.map +1 -1
  18. package/build/browser/new/platform-apis/admin/useCbacMarkingRestrictions.js.map +1 -1
  19. package/build/browser/new/platform-apis/admin/useCurrentFoundryUser.js.map +1 -1
  20. package/build/browser/new/platform-apis/admin/useFoundryUser.js.map +1 -1
  21. package/build/browser/new/platform-apis/admin/useFoundryUsersList.js.map +1 -1
  22. package/build/browser/new/platform-apis/admin/useMarkingCategories.js.map +1 -1
  23. package/build/browser/new/platform-apis/admin/useMarkings.js.map +1 -1
  24. package/build/browser/new/platform-apis/admin/useUserMarkings.js.map +1 -1
  25. package/build/browser/new/shapes/derivedLinksStore.js.map +1 -1
  26. package/build/browser/new/shapes/types.js.map +1 -1
  27. package/build/browser/new/shapes/useShape.js.map +1 -1
  28. package/build/browser/new/shared/storeUtils.js.map +1 -1
  29. package/build/browser/new/useDevToolsClient.js.map +1 -1
  30. package/build/browser/new/useLinks.js.map +1 -1
  31. package/build/browser/new/useObjectSet.js.map +1 -1
  32. package/build/browser/new/useOsdkAction.js.map +1 -1
  33. package/build/browser/new/useOsdkAggregation.js.map +1 -1
  34. package/build/browser/new/useOsdkFunction.js.map +1 -1
  35. package/build/browser/new/useOsdkFunctions.js.map +1 -1
  36. package/build/browser/new/useOsdkObject.js.map +1 -1
  37. package/build/browser/new/useOsdkObjects.js.map +1 -1
  38. package/build/browser/new/useRegisterUserAgent.js.map +1 -1
  39. package/build/browser/public/testing.js.map +1 -1
  40. package/build/browser/useObservableClient.js.map +1 -1
  41. package/build/browser/useOsdkClient.js.map +1 -1
  42. package/build/browser/useOsdkMetadata.js.map +1 -1
  43. package/build/browser/util/UserAgent.js +1 -1
  44. package/build/browser/util/UserAgent.js.map +1 -1
  45. package/build/browser/utils/useDebouncedCallback.js.map +1 -1
  46. package/build/browser/utils/usePlatformQuery.js.map +1 -1
  47. package/build/cjs/{chunk-SEFARM7Y.cjs → chunk-ICSJXGFL.cjs} +32 -32
  48. package/build/cjs/chunk-ICSJXGFL.cjs.map +1 -0
  49. package/build/cjs/{chunk-UKQGMTMG.cjs → chunk-O5ISVU2U.cjs} +5 -5
  50. package/build/cjs/chunk-O5ISVU2U.cjs.map +1 -0
  51. package/build/cjs/{chunk-HJHKH4B6.cjs → chunk-VQ4PS6U2.cjs} +7 -7
  52. package/build/cjs/{chunk-HJHKH4B6.cjs.map → chunk-VQ4PS6U2.cjs.map} +1 -1
  53. package/build/cjs/index.cjs +16 -16
  54. package/build/cjs/public/experimental/admin.cjs +10 -10
  55. package/build/cjs/public/experimental/aip.cjs +2 -2
  56. package/build/cjs/public/experimental/aip.cjs.map +1 -1
  57. package/build/cjs/public/experimental.cjs +17 -17
  58. package/build/cjs/public/experimental.d.cts +1 -1
  59. package/build/cjs/public/platform-apis.cjs +10 -10
  60. package/build/cjs/public/platform-apis.d.cts +7 -7
  61. package/build/esm/aip/chatStore.js.map +1 -1
  62. package/build/esm/aip/chatStream.js +1 -1
  63. package/build/esm/aip/chatStream.js.map +1 -1
  64. package/build/esm/aip/useChat.js +1 -1
  65. package/build/esm/aip/useChat.js.map +1 -1
  66. package/build/esm/new/OsdkContext.js.map +1 -1
  67. package/build/esm/new/OsdkProvider.js.map +1 -1
  68. package/build/esm/new/UserAgentContext.js.map +1 -1
  69. package/build/esm/new/core/stableSerialize.js.map +1 -1
  70. package/build/esm/new/core/useStableObjectSet.js.map +1 -1
  71. package/build/esm/new/createCompositeExternalStore.js +1 -1
  72. package/build/esm/new/createCompositeExternalStore.js.map +1 -1
  73. package/build/esm/new/hookUtils.js.map +1 -1
  74. package/build/esm/new/makeExternalStore.js +3 -3
  75. package/build/esm/new/makeExternalStore.js.map +1 -1
  76. package/build/esm/new/platform-apis/admin/useCbacBanner.js.map +1 -1
  77. package/build/esm/new/platform-apis/admin/useCbacMarkingRestrictions.js.map +1 -1
  78. package/build/esm/new/platform-apis/admin/useCurrentFoundryUser.js.map +1 -1
  79. package/build/esm/new/platform-apis/admin/useFoundryUser.js.map +1 -1
  80. package/build/esm/new/platform-apis/admin/useFoundryUsersList.js.map +1 -1
  81. package/build/esm/new/platform-apis/admin/useMarkingCategories.js.map +1 -1
  82. package/build/esm/new/platform-apis/admin/useMarkings.js.map +1 -1
  83. package/build/esm/new/platform-apis/admin/useUserMarkings.js.map +1 -1
  84. package/build/esm/new/shapes/derivedLinksStore.js.map +1 -1
  85. package/build/esm/new/shapes/types.js.map +1 -1
  86. package/build/esm/new/shapes/useShape.js.map +1 -1
  87. package/build/esm/new/shared/storeUtils.js.map +1 -1
  88. package/build/esm/new/useDevToolsClient.js.map +1 -1
  89. package/build/esm/new/useLinks.js.map +1 -1
  90. package/build/esm/new/useObjectSet.js.map +1 -1
  91. package/build/esm/new/useOsdkAction.js.map +1 -1
  92. package/build/esm/new/useOsdkAggregation.js.map +1 -1
  93. package/build/esm/new/useOsdkFunction.js.map +1 -1
  94. package/build/esm/new/useOsdkFunctions.js.map +1 -1
  95. package/build/esm/new/useOsdkObject.js.map +1 -1
  96. package/build/esm/new/useOsdkObjects.js.map +1 -1
  97. package/build/esm/new/useRegisterUserAgent.js.map +1 -1
  98. package/build/esm/public/testing.js.map +1 -1
  99. package/build/esm/useObservableClient.js.map +1 -1
  100. package/build/esm/useOsdkClient.js.map +1 -1
  101. package/build/esm/useOsdkMetadata.js.map +1 -1
  102. package/build/esm/util/UserAgent.js +1 -1
  103. package/build/esm/util/UserAgent.js.map +1 -1
  104. package/build/esm/utils/useDebouncedCallback.js.map +1 -1
  105. package/build/esm/utils/usePlatformQuery.js.map +1 -1
  106. package/build/types/aip/chatStore.d.ts.map +1 -1
  107. package/build/types/aip/chatStream.d.ts.map +1 -1
  108. package/build/types/aip/useChat.d.ts.map +1 -1
  109. package/build/types/new/OsdkProvider.d.ts.map +1 -1
  110. package/build/types/new/core/stableSerialize.d.ts.map +1 -1
  111. package/build/types/new/core/useStableObjectSet.d.ts.map +1 -1
  112. package/build/types/new/createCompositeExternalStore.d.ts +1 -1
  113. package/build/types/new/createCompositeExternalStore.d.ts.map +1 -1
  114. package/build/types/new/makeExternalStore.d.ts +2 -2
  115. package/build/types/new/makeExternalStore.d.ts.map +1 -1
  116. package/build/types/new/platform-apis/admin/useCbacBanner.d.ts.map +1 -1
  117. package/build/types/new/platform-apis/admin/useCbacMarkingRestrictions.d.ts.map +1 -1
  118. package/build/types/new/platform-apis/admin/useCurrentFoundryUser.d.ts.map +1 -1
  119. package/build/types/new/platform-apis/admin/useFoundryUser.d.ts.map +1 -1
  120. package/build/types/new/platform-apis/admin/useFoundryUsersList.d.ts.map +1 -1
  121. package/build/types/new/platform-apis/admin/useMarkingCategories.d.ts.map +1 -1
  122. package/build/types/new/platform-apis/admin/useMarkings.d.ts.map +1 -1
  123. package/build/types/new/platform-apis/admin/useUserMarkings.d.ts.map +1 -1
  124. package/build/types/new/shapes/derivedLinksStore.d.ts.map +1 -1
  125. package/build/types/new/shapes/useShape.d.ts.map +1 -1
  126. package/build/types/new/useDevToolsClient.d.ts.map +1 -1
  127. package/build/types/new/useLinks.d.ts.map +1 -1
  128. package/build/types/new/useOsdkAction.d.ts.map +1 -1
  129. package/build/types/new/useOsdkAggregation.d.ts.map +1 -1
  130. package/build/types/new/useOsdkFunction.d.ts.map +1 -1
  131. package/build/types/new/useOsdkFunctions.d.ts.map +1 -1
  132. package/build/types/new/useOsdkObject.d.ts.map +1 -1
  133. package/build/types/new/useOsdkObjects.d.ts.map +1 -1
  134. package/build/types/new/useRegisterUserAgent.d.ts.map +1 -1
  135. package/build/types/public/testing.d.ts.map +1 -1
  136. package/build/types/useObservableClient.d.ts.map +1 -1
  137. package/build/types/useOsdkClient.d.ts.map +1 -1
  138. package/build/types/useOsdkMetadata.d.ts.map +1 -1
  139. package/build/types/utils/usePlatformQuery.d.ts.map +1 -1
  140. package/package.json +9 -9
  141. package/build/cjs/chunk-SEFARM7Y.cjs.map +0 -1
  142. package/build/cjs/chunk-UKQGMTMG.cjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/usePlatformQuery.ts","../../src/new/platform-apis/admin/useCbacBanner.ts","../../src/new/platform-apis/admin/useCbacMarkingRestrictions.ts","../../src/new/platform-apis/admin/useCurrentFoundryUser.ts","../../src/new/platform-apis/admin/useFoundryUser.ts","../../src/new/platform-apis/admin/useFoundryUsersList.ts","../../src/new/platform-apis/admin/useMarkingCategories.ts","../../src/new/platform-apis/admin/useMarkings.ts","../../src/new/platform-apis/admin/useUserMarkings.ts"],"names":["React","makeExternalStore","devToolsMetadata","OsdkContext","CbacBanners","CbacMarkingRestrictionsObjects","Users","MarkingCategories","Markings"],"mappings":";;;;;;;;;;;AAkBO,SAAS,gBAAA,CAAiB;AAAA,EAC/B,KAAA;AAAA,EACA,SAAA;AAAA,EACA,OAAA,GAAU;AACZ,CAAA,EAAG;AACD,EAAA,MAAM,WAAA,GAAcA,uBAAM,MAAA,EAAO;AACjC,EAAA,MAAM,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AAOA,mBAAAA,CAAM,WAAA,CAAY,MAAA,EAAQ,cAAc,CAAA;AAAA,EACjD,CAAA,EAAG,CAAC,MAAA,EAAQ,MAAM,CAAC,CAAA;AACnB,EAAA,MAAM,QAAQ,gBAAA,CAAiB;AAAA,IAC7B,KAAA,EAAO,WAAA;AAAA,IACP,OAAA;AAAA,IACA,SAAA,EAAW;AAAA,GACZ,CAAA;AACD,EAAA,OAAO;AAAA,IACL,UAAA,EAAY,MAAM,IAAA,EAAM,IAAA;AAAA,IACxB,WAAW,KAAA,CAAM,SAAA;AAAA,IACjB,OAAO,KAAA,CAAM,KAAA;AAAA,IACb,SAAS,KAAA,CAAM;AAAA,GACjB;AACF","file":"chunk-HJHKH4B6.cjs","sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport { devToolsMetadata, makeExternalStore } from \"../new/makeExternalStore.js\";\nexport function usePlatformQuery({\n query,\n queryName,\n enabled = true\n}) {\n const observerRef = React.useRef();\n const handleQuery = React.useCallback(() => {\n const observer = observerRef.current;\n if (observer == null) return;\n observer.next({\n status: \"loading\",\n data: undefined\n });\n query().then(data => {\n observer.next({\n status: \"success\",\n data\n });\n }).catch(err => {\n observer.error(err);\n });\n }, [query]);\n const {\n subscribe,\n getSnapShot\n } = React.useMemo(() => {\n if (!enabled) {\n return makeExternalStore(() => ({\n unsubscribe: () => {}\n }), devToolsMetadata({\n hookType: \"usePlatformQuery\",\n objectType: queryName\n }));\n }\n return makeExternalStore(observer => {\n observerRef.current = observer;\n handleQuery();\n return {\n unsubscribe: () => {\n observerRef.current = undefined;\n }\n };\n }, devToolsMetadata({\n hookType: \"usePlatformQuery\",\n objectType: queryName\n }));\n }, [enabled, queryName, handleQuery]);\n const payload = React.useSyncExternalStore(subscribe, getSnapShot);\n let error;\n if (payload && \"error\" in payload && payload.error != null) {\n error = payload.error;\n } else if (payload?.status === \"error\") {\n error = new Error(`Failed to query platform API: ${queryName}`);\n }\n return {\n data: payload?.data,\n isLoading: enabled ? payload?.status === \"loading\" || !payload : false,\n error,\n refetch: handleQuery\n };\n}","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { CbacBanners } from \"@osdk/foundry.admin\";\nimport React from \"react\";\nimport { usePlatformQuery } from \"../../../utils/usePlatformQuery.js\";\nimport { OsdkContext } from \"../../OsdkContext.js\";\n/**\n * Get the CBAC banner data for the given marking IDs.\n * @param options Options to control the query.\n */\nexport function useCbacBanner({\n markingIds,\n enabled: externalEnabled = true\n}) {\n const {\n client\n } = React.useContext(OsdkContext);\n const stableMarkingIds = React.useMemo(() => markingIds, [JSON.stringify(markingIds)]);\n const enabled = stableMarkingIds.length > 0 && externalEnabled;\n const handleQuery = React.useCallback(() => {\n return CbacBanners.get(client, {\n markingIds: stableMarkingIds,\n preview: true\n });\n }, [client, stableMarkingIds]);\n const query = usePlatformQuery({\n query: handleQuery,\n enabled,\n queryName: \"cbac-banner\"\n });\n const banner = React.useMemo(() => {\n if (query.data == null) {\n return undefined;\n }\n return {\n classificationString: query.data.classificationString,\n textColor: query.data.textColor,\n backgroundColors: query.data.backgroundColors,\n markingIds: query.data.markings\n };\n }, [query.data]);\n return {\n banner,\n isLoading: query.isLoading,\n error: query.error,\n refetch: query.refetch\n };\n}","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { CbacMarkingRestrictionsObjects } from \"@osdk/foundry.admin\";\nimport React from \"react\";\nimport { usePlatformQuery } from \"../../../utils/usePlatformQuery.js\";\nimport { OsdkContext } from \"../../OsdkContext.js\";\n/**\n * Get CBAC marking restrictions (implied, disallowed, required) for the given marking IDs.\n * @param options Options to control the query.\n */\nexport function useCbacMarkingRestrictions({\n markingIds,\n enabled: externalEnabled = true\n}) {\n const {\n client\n } = React.useContext(OsdkContext);\n const stableMarkingIds = React.useMemo(() => markingIds, [JSON.stringify(markingIds)]);\n const enabled = stableMarkingIds.length > 0 && externalEnabled;\n const handleQuery = React.useCallback(() => {\n return CbacMarkingRestrictionsObjects.get(client, {\n markingIds: stableMarkingIds,\n preview: true\n });\n }, [client, stableMarkingIds]);\n const query = usePlatformQuery({\n query: handleQuery,\n enabled,\n queryName: \"cbac-marking-restrictions\"\n });\n const restrictions = React.useMemo(() => {\n if (query.data == null) {\n return undefined;\n }\n return {\n disallowedMarkings: query.data.disallowedMarkings.map(String),\n impliedMarkings: query.data.impliedMarkings.map(String),\n requiredMarkings: query.data.requiredMarkings.map(group => group.map(String)),\n userSatisfiesMarkings: query.data.userSatisfiesMarkings,\n isValid: query.data.isValid\n };\n }, [query.data]);\n return {\n restrictions,\n isLoading: query.isLoading,\n error: query.error,\n refetch: query.refetch\n };\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Users } from \"@osdk/foundry.admin\";\nimport React from \"react\";\nimport { usePlatformQuery } from \"../../../utils/usePlatformQuery.js\";\nimport { OsdkContext } from \"../../OsdkContext.js\";\n/**\n * Get the currently signed in User.\n * @param options Options to control the query.\n */\nexport function useCurrentFoundryUser({\n enabled = true\n} = {}) {\n const {\n client\n } = React.useContext(OsdkContext);\n const handleQuery = React.useCallback(() => Users.getCurrent(client), [client]);\n const query = usePlatformQuery({\n query: handleQuery,\n enabled,\n queryName: \"foundry-current-user\"\n });\n return {\n currentUser: query.data,\n isLoading: query.isLoading,\n error: query.error,\n refetch: query.refetch\n };\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Users } from \"@osdk/foundry.admin\";\nimport React from \"react\";\nimport { usePlatformQuery } from \"../../../utils/usePlatformQuery.js\";\nimport { OsdkContext } from \"../../OsdkContext.js\";\n/**\n * Get the User with the specified id.\n * @param userId A Foundry User ID.\n * @param options Options to control the query.\n */\nexport function useFoundryUser(userId, {\n enabled = true,\n status = \"ACTIVE\"\n} = {}) {\n const {\n client\n } = React.useContext(OsdkContext);\n const handleQuery = React.useCallback(() => {\n return Users.get(client, userId, {\n status\n });\n }, [client, userId, status]);\n const query = usePlatformQuery({\n query: handleQuery,\n enabled,\n queryName: \"foundry-user\"\n });\n return {\n user: query.data,\n isLoading: query.isLoading,\n error: query.error,\n refetch: query.refetch\n };\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Users } from \"@osdk/foundry.admin\";\nimport React from \"react\";\nimport { usePlatformQuery } from \"../../../utils/usePlatformQuery.js\";\nimport { OsdkContext } from \"../../OsdkContext.js\";\n/**\n * Lists all Users. This is a paged endpoint. Each page may be smaller or larger than the requested page size.\n * @param options Options to control the query.\n */\nexport function useFoundryUsersList({\n enabled = true,\n include = \"ACTIVE\",\n pageSize = 1000,\n pageToken\n} = {}) {\n const {\n client\n } = React.useContext(OsdkContext);\n const handleQuery = React.useCallback(() => {\n return Users.list(client, {\n include,\n pageSize,\n pageToken\n });\n }, [client, include, pageSize, pageToken]);\n const query = usePlatformQuery({\n query: handleQuery,\n enabled,\n queryName: \"foundry-users-list\"\n });\n return {\n users: query.data?.data,\n nextPageToken: query.data?.nextPageToken,\n isLoading: query.isLoading,\n error: query.error,\n refetch: query.refetch\n };\n}","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { MarkingCategories } from \"@osdk/foundry.admin\";\nimport React from \"react\";\nimport { usePlatformQuery } from \"../../../utils/usePlatformQuery.js\";\nimport { OsdkContext } from \"../../OsdkContext.js\";\n/**\n * List all marking categories.\n * @param options Options to control the query.\n */\nexport function useMarkingCategories({\n enabled = true\n} = {}) {\n const {\n client\n } = React.useContext(OsdkContext);\n const handleQuery = React.useCallback(() => {\n return MarkingCategories.list(client);\n }, [client]);\n const query = usePlatformQuery({\n query: handleQuery,\n enabled,\n queryName: \"marking-categories\"\n });\n return {\n categories: query.data?.data,\n isLoading: query.isLoading,\n error: query.error,\n refetch: query.refetch\n };\n}","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Markings } from \"@osdk/foundry.admin\";\nimport React from \"react\";\nimport { usePlatformQuery } from \"../../../utils/usePlatformQuery.js\";\nimport { OsdkContext } from \"../../OsdkContext.js\";\n/**\n * List all markings.\n * @param options Options to control the query.\n */\nexport function useMarkings({\n enabled = true\n} = {}) {\n const {\n client\n } = React.useContext(OsdkContext);\n const handleQuery = React.useCallback(() => {\n return Markings.list(client);\n }, [client]);\n const query = usePlatformQuery({\n query: handleQuery,\n enabled,\n queryName: \"markings\"\n });\n return {\n markings: query.data?.data,\n isLoading: query.isLoading,\n error: query.error,\n refetch: query.refetch\n };\n}","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Users } from \"@osdk/foundry.admin\";\nimport React from \"react\";\nimport { usePlatformQuery } from \"../../../utils/usePlatformQuery.js\";\nimport { OsdkContext } from \"../../OsdkContext.js\";\n/**\n * Get view-accessible markings for a user.\n * When `userId` is provided, fetches markings for that user.\n * When omitted, fetches markings for the current user.\n * @param options Options to control the query.\n */\nexport function useUserViewMarkings({\n userId,\n enabled = true\n} = {}) {\n const {\n client\n } = React.useContext(OsdkContext);\n const handleQuery = React.useCallback(async () => {\n const resolvedUserId = userId ?? (await Users.getCurrent(client)).id;\n return Users.getMarkings(client, resolvedUserId);\n }, [client, userId]);\n const query = usePlatformQuery({\n query: handleQuery,\n enabled,\n queryName: \"user-view-markings\"\n });\n return {\n markingIds: query.data?.view,\n isLoading: query.isLoading,\n error: query.error,\n refetch: query.refetch\n };\n}"]}
1
+ {"version":3,"sources":["../../src/utils/usePlatformQuery.ts","../../src/new/platform-apis/admin/useCbacBanner.ts","../../src/new/platform-apis/admin/useCbacMarkingRestrictions.ts","../../src/new/platform-apis/admin/useCurrentFoundryUser.ts","../../src/new/platform-apis/admin/useFoundryUser.ts","../../src/new/platform-apis/admin/useFoundryUsersList.ts","../../src/new/platform-apis/admin/useMarkingCategories.ts","../../src/new/platform-apis/admin/useMarkings.ts","../../src/new/platform-apis/admin/useUserMarkings.ts"],"names":["React","makeExternalStore","devToolsMetadata","OsdkContext","CbacBanners","CbacMarkingRestrictionsObjects","Users","MarkingCategories","Markings"],"mappings":";;;;;;;;;;;AAkBO,SAAS,gBAAA,CAAiB;AAAA,EAC/B,KAAA;AAAA,EACA,SAAA;AAAA,EACA,OAAA,GAAU;AACZ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AAA,CAAW,MAAMM,mBAAAA,CAAM,UAAA,CAAW,MAAM,CAAA,EAAG,EAAA;AAClE,IAAA,OAAOA,mBAAAA,CAAM,WAAA,CAAY,MAAA,EAAQ,cAAc,CAAA;AAAA,EACjD,CAAA,EAAG,CAAC,MAAA,EAAQ,MAAM,CAAC,CAAA;AACnB,EAAA,MAAM,QAAQ,gBAAA,CAAiB;AAAA,IAC7B,KAAA,EAAO,WAAA;AAAA,IACP,OAAA;AAAA,IACA,SAAA,EAAW;AAAA,GACZ,CAAA;AACD,EAAA,OAAO;AAAA,IACL,UAAA,EAAY,MAAM,IAAA,EAAM,IAAA;AAAA,IACxB,WAAW,KAAA,CAAM,SAAA;AAAA,IACjB,OAAO,KAAA,CAAM,KAAA;AAAA,IACb,SAAS,KAAA,CAAM;AAAA,GACjB;AACF","file":"chunk-VQ4PS6U2.cjs","sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\nimport { devToolsMetadata, makeExternalStore } from \"../new/makeExternalStore.js\";\nexport function usePlatformQuery({\n query,\n queryName,\n enabled = true\n}) {\n const observerRef = React.useRef();\n const handleQuery = React.useCallback(() => {\n const observer = observerRef.current;\n if (observer == null) return;\n observer.next({\n status: \"loading\",\n data: undefined\n });\n query().then(data => {\n observer.next({\n status: \"success\",\n data\n });\n }).catch(err => {\n observer.error(err);\n });\n }, [query]);\n const {\n subscribe,\n getSnapShot\n } = React.useMemo(() => {\n if (!enabled) {\n return makeExternalStore(() => ({\n unsubscribe: () => {}\n }), devToolsMetadata({\n hookType: \"usePlatformQuery\",\n objectType: queryName\n }));\n }\n return makeExternalStore(observer => {\n observerRef.current = observer;\n handleQuery();\n return {\n unsubscribe: () => {\n observerRef.current = undefined;\n }\n };\n }, devToolsMetadata({\n hookType: \"usePlatformQuery\",\n objectType: queryName\n }));\n }, [enabled, queryName, handleQuery]);\n const payload = React.useSyncExternalStore(subscribe, getSnapShot);\n let error;\n if (payload && \"error\" in payload && payload.error != null) {\n error = payload.error;\n } else if (payload?.status === \"error\") {\n error = new Error(`Failed to query platform API: ${queryName}`);\n }\n return {\n data: payload?.data,\n isLoading: enabled ? payload?.status === \"loading\" || !payload : false,\n error,\n refetch: handleQuery\n };\n}","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { CbacBanners } from \"@osdk/foundry.admin\";\nimport React from \"react\";\nimport { usePlatformQuery } from \"../../../utils/usePlatformQuery.js\";\nimport { OsdkContext } from \"../../OsdkContext.js\";\n/**\n * Get the CBAC banner data for the given marking IDs.\n * @param options Options to control the query.\n */\nexport function useCbacBanner({\n markingIds,\n enabled: externalEnabled = true\n}) {\n const {\n client\n } = React.useContext(OsdkContext);\n const stableMarkingIds = React.useMemo(() => markingIds, [JSON.stringify(markingIds)]);\n const enabled = stableMarkingIds.length > 0 && externalEnabled;\n const handleQuery = React.useCallback(() => {\n return CbacBanners.get(client, {\n markingIds: stableMarkingIds,\n preview: true\n });\n }, [client, stableMarkingIds]);\n const query = usePlatformQuery({\n query: handleQuery,\n enabled,\n queryName: \"cbac-banner\"\n });\n const banner = React.useMemo(() => {\n if (query.data == null) {\n return undefined;\n }\n return {\n classificationString: query.data.classificationString,\n textColor: query.data.textColor,\n backgroundColors: query.data.backgroundColors,\n markingIds: query.data.markings\n };\n }, [query.data]);\n return {\n banner,\n isLoading: query.isLoading,\n error: query.error,\n refetch: query.refetch\n };\n}","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { CbacMarkingRestrictionsObjects } from \"@osdk/foundry.admin\";\nimport React from \"react\";\nimport { usePlatformQuery } from \"../../../utils/usePlatformQuery.js\";\nimport { OsdkContext } from \"../../OsdkContext.js\";\n/**\n * Get CBAC marking restrictions (implied, disallowed, required) for the given marking IDs.\n * @param options Options to control the query.\n */\nexport function useCbacMarkingRestrictions({\n markingIds,\n enabled: externalEnabled = true\n}) {\n const {\n client\n } = React.useContext(OsdkContext);\n const stableMarkingIds = React.useMemo(() => markingIds, [JSON.stringify(markingIds)]);\n const enabled = stableMarkingIds.length > 0 && externalEnabled;\n const handleQuery = React.useCallback(() => {\n return CbacMarkingRestrictionsObjects.get(client, {\n markingIds: stableMarkingIds,\n preview: true\n });\n }, [client, stableMarkingIds]);\n const query = usePlatformQuery({\n query: handleQuery,\n enabled,\n queryName: \"cbac-marking-restrictions\"\n });\n const restrictions = React.useMemo(() => {\n if (query.data == null) {\n return undefined;\n }\n return {\n disallowedMarkings: query.data.disallowedMarkings.map(String),\n impliedMarkings: query.data.impliedMarkings.map(String),\n requiredMarkings: query.data.requiredMarkings.map(group => group.map(String)),\n userSatisfiesMarkings: query.data.userSatisfiesMarkings,\n isValid: query.data.isValid\n };\n }, [query.data]);\n return {\n restrictions,\n isLoading: query.isLoading,\n error: query.error,\n refetch: query.refetch\n };\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Users } from \"@osdk/foundry.admin\";\nimport React from \"react\";\nimport { usePlatformQuery } from \"../../../utils/usePlatformQuery.js\";\nimport { OsdkContext } from \"../../OsdkContext.js\";\n/**\n * Get the currently signed in User.\n * @param options Options to control the query.\n */\nexport function useCurrentFoundryUser({\n enabled = true\n} = {}) {\n const {\n client\n } = React.useContext(OsdkContext);\n const handleQuery = React.useCallback(() => Users.getCurrent(client), [client]);\n const query = usePlatformQuery({\n query: handleQuery,\n enabled,\n queryName: \"foundry-current-user\"\n });\n return {\n currentUser: query.data,\n isLoading: query.isLoading,\n error: query.error,\n refetch: query.refetch\n };\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Users } from \"@osdk/foundry.admin\";\nimport React from \"react\";\nimport { usePlatformQuery } from \"../../../utils/usePlatformQuery.js\";\nimport { OsdkContext } from \"../../OsdkContext.js\";\n/**\n * Get the User with the specified id.\n * @param userId A Foundry User ID.\n * @param options Options to control the query.\n */\nexport function useFoundryUser(userId, {\n enabled = true,\n status = \"ACTIVE\"\n} = {}) {\n const {\n client\n } = React.useContext(OsdkContext);\n const handleQuery = React.useCallback(() => {\n return Users.get(client, userId, {\n status\n });\n }, [client, userId, status]);\n const query = usePlatformQuery({\n query: handleQuery,\n enabled,\n queryName: \"foundry-user\"\n });\n return {\n user: query.data,\n isLoading: query.isLoading,\n error: query.error,\n refetch: query.refetch\n };\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Users } from \"@osdk/foundry.admin\";\nimport React from \"react\";\nimport { usePlatformQuery } from \"../../../utils/usePlatformQuery.js\";\nimport { OsdkContext } from \"../../OsdkContext.js\";\n/**\n * Lists all Users. This is a paged endpoint. Each page may be smaller or larger than the requested page size.\n * @param options Options to control the query.\n */\nexport function useFoundryUsersList({\n enabled = true,\n include = \"ACTIVE\",\n pageSize = 1000,\n pageToken\n} = {}) {\n const {\n client\n } = React.useContext(OsdkContext);\n const handleQuery = React.useCallback(() => {\n return Users.list(client, {\n include,\n pageSize,\n pageToken\n });\n }, [client, include, pageSize, pageToken]);\n const query = usePlatformQuery({\n query: handleQuery,\n enabled,\n queryName: \"foundry-users-list\"\n });\n return {\n users: query.data?.data,\n nextPageToken: query.data?.nextPageToken,\n isLoading: query.isLoading,\n error: query.error,\n refetch: query.refetch\n };\n}","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { MarkingCategories } from \"@osdk/foundry.admin\";\nimport React from \"react\";\nimport { usePlatformQuery } from \"../../../utils/usePlatformQuery.js\";\nimport { OsdkContext } from \"../../OsdkContext.js\";\n/**\n * List all marking categories.\n * @param options Options to control the query.\n */\nexport function useMarkingCategories({\n enabled = true\n} = {}) {\n const {\n client\n } = React.useContext(OsdkContext);\n const handleQuery = React.useCallback(() => {\n return MarkingCategories.list(client);\n }, [client]);\n const query = usePlatformQuery({\n query: handleQuery,\n enabled,\n queryName: \"marking-categories\"\n });\n return {\n categories: query.data?.data,\n isLoading: query.isLoading,\n error: query.error,\n refetch: query.refetch\n };\n}","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Markings } from \"@osdk/foundry.admin\";\nimport React from \"react\";\nimport { usePlatformQuery } from \"../../../utils/usePlatformQuery.js\";\nimport { OsdkContext } from \"../../OsdkContext.js\";\n/**\n * List all markings.\n * @param options Options to control the query.\n */\nexport function useMarkings({\n enabled = true\n} = {}) {\n const {\n client\n } = React.useContext(OsdkContext);\n const handleQuery = React.useCallback(() => {\n return Markings.list(client);\n }, [client]);\n const query = usePlatformQuery({\n query: handleQuery,\n enabled,\n queryName: \"markings\"\n });\n return {\n markings: query.data?.data,\n isLoading: query.isLoading,\n error: query.error,\n refetch: query.refetch\n };\n}","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Users } from \"@osdk/foundry.admin\";\nimport React from \"react\";\nimport { usePlatformQuery } from \"../../../utils/usePlatformQuery.js\";\nimport { OsdkContext } from \"../../OsdkContext.js\";\n/**\n * Get view-accessible markings for a user.\n * When `userId` is provided, fetches markings for that user.\n * When omitted, fetches markings for the current user.\n * @param options Options to control the query.\n */\nexport function useUserViewMarkings({\n userId,\n enabled = true\n} = {}) {\n const {\n client\n } = React.useContext(OsdkContext);\n const handleQuery = React.useCallback(async () => {\n const resolvedUserId = userId ?? (await Users.getCurrent(client)).id;\n return Users.getMarkings(client, resolvedUserId);\n }, [client, userId]);\n const query = usePlatformQuery({\n query: handleQuery,\n enabled,\n queryName: \"user-view-markings\"\n });\n return {\n markingIds: query.data?.view,\n isLoading: query.isLoading,\n error: query.error,\n refetch: query.refetch\n };\n}"]}
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var chunkSEFARM7Y_cjs = require('./chunk-SEFARM7Y.cjs');
3
+ var chunkICSJXGFL_cjs = require('./chunk-ICSJXGFL.cjs');
4
4
  var chunkOGP2DK2V_cjs = require('./chunk-OGP2DK2V.cjs');
5
- require('./chunk-UKQGMTMG.cjs');
5
+ require('./chunk-O5ISVU2U.cjs');
6
6
  var chunkDO3NFBKN_cjs = require('./chunk-DO3NFBKN.cjs');
7
7
  var React = require('react');
8
8
 
@@ -16,59 +16,59 @@ function useObservableClient() {
16
16
 
17
17
  Object.defineProperty(exports, "OsdkProvider", {
18
18
  enumerable: true,
19
- get: function () { return chunkSEFARM7Y_cjs.OsdkProvider; }
19
+ get: function () { return chunkICSJXGFL_cjs.OsdkProvider; }
20
20
  });
21
21
  Object.defineProperty(exports, "useDebouncedCallback", {
22
22
  enumerable: true,
23
- get: function () { return chunkSEFARM7Y_cjs.useDebouncedCallback; }
23
+ get: function () { return chunkICSJXGFL_cjs.useDebouncedCallback; }
24
24
  });
25
25
  Object.defineProperty(exports, "useLinks", {
26
26
  enumerable: true,
27
- get: function () { return chunkSEFARM7Y_cjs.useLinks; }
27
+ get: function () { return chunkICSJXGFL_cjs.useLinks; }
28
28
  });
29
29
  Object.defineProperty(exports, "useObjectSet", {
30
30
  enumerable: true,
31
- get: function () { return chunkSEFARM7Y_cjs.useObjectSet; }
31
+ get: function () { return chunkICSJXGFL_cjs.useObjectSet; }
32
32
  });
33
33
  Object.defineProperty(exports, "useOsdkAction", {
34
34
  enumerable: true,
35
- get: function () { return chunkSEFARM7Y_cjs.useOsdkAction; }
35
+ get: function () { return chunkICSJXGFL_cjs.useOsdkAction; }
36
36
  });
37
37
  Object.defineProperty(exports, "useOsdkAggregation", {
38
38
  enumerable: true,
39
- get: function () { return chunkSEFARM7Y_cjs.useOsdkAggregation; }
39
+ get: function () { return chunkICSJXGFL_cjs.useOsdkAggregation; }
40
40
  });
41
41
  Object.defineProperty(exports, "useOsdkClient", {
42
42
  enumerable: true,
43
- get: function () { return chunkSEFARM7Y_cjs.useOsdkClient; }
43
+ get: function () { return chunkICSJXGFL_cjs.useOsdkClient; }
44
44
  });
45
45
  Object.defineProperty(exports, "useOsdkFunction", {
46
46
  enumerable: true,
47
- get: function () { return chunkSEFARM7Y_cjs.useOsdkFunction; }
47
+ get: function () { return chunkICSJXGFL_cjs.useOsdkFunction; }
48
48
  });
49
49
  Object.defineProperty(exports, "useOsdkFunctions", {
50
50
  enumerable: true,
51
- get: function () { return chunkSEFARM7Y_cjs.useOsdkFunctions; }
51
+ get: function () { return chunkICSJXGFL_cjs.useOsdkFunctions; }
52
52
  });
53
53
  Object.defineProperty(exports, "useOsdkMetadata", {
54
54
  enumerable: true,
55
- get: function () { return chunkSEFARM7Y_cjs.useOsdkMetadata; }
55
+ get: function () { return chunkICSJXGFL_cjs.useOsdkMetadata; }
56
56
  });
57
57
  Object.defineProperty(exports, "useOsdkObject", {
58
58
  enumerable: true,
59
- get: function () { return chunkSEFARM7Y_cjs.useOsdkObject; }
59
+ get: function () { return chunkICSJXGFL_cjs.useOsdkObject; }
60
60
  });
61
61
  Object.defineProperty(exports, "useOsdkObjects", {
62
62
  enumerable: true,
63
- get: function () { return chunkSEFARM7Y_cjs.useOsdkObjects; }
63
+ get: function () { return chunkICSJXGFL_cjs.useOsdkObjects; }
64
64
  });
65
65
  Object.defineProperty(exports, "useRegisterUserAgent", {
66
66
  enumerable: true,
67
- get: function () { return chunkSEFARM7Y_cjs.useRegisterUserAgent; }
67
+ get: function () { return chunkICSJXGFL_cjs.useRegisterUserAgent; }
68
68
  });
69
69
  Object.defineProperty(exports, "useStableObjectSet", {
70
70
  enumerable: true,
71
- get: function () { return chunkSEFARM7Y_cjs.useStableObjectSet; }
71
+ get: function () { return chunkICSJXGFL_cjs.useStableObjectSet; }
72
72
  });
73
73
  Object.defineProperty(exports, "getRegisteredDevTools", {
74
74
  enumerable: true,
@@ -1,42 +1,42 @@
1
1
  'use strict';
2
2
 
3
- var chunkHJHKH4B6_cjs = require('../../chunk-HJHKH4B6.cjs');
4
- require('../../chunk-UKQGMTMG.cjs');
3
+ var chunkVQ4PS6U2_cjs = require('../../chunk-VQ4PS6U2.cjs');
4
+ require('../../chunk-O5ISVU2U.cjs');
5
5
  require('../../chunk-DO3NFBKN.cjs');
6
6
 
7
7
 
8
8
 
9
9
  Object.defineProperty(exports, "useCbacBanner", {
10
10
  enumerable: true,
11
- get: function () { return chunkHJHKH4B6_cjs.useCbacBanner; }
11
+ get: function () { return chunkVQ4PS6U2_cjs.useCbacBanner; }
12
12
  });
13
13
  Object.defineProperty(exports, "useCbacMarkingRestrictions", {
14
14
  enumerable: true,
15
- get: function () { return chunkHJHKH4B6_cjs.useCbacMarkingRestrictions; }
15
+ get: function () { return chunkVQ4PS6U2_cjs.useCbacMarkingRestrictions; }
16
16
  });
17
17
  Object.defineProperty(exports, "useCurrentFoundryUser", {
18
18
  enumerable: true,
19
- get: function () { return chunkHJHKH4B6_cjs.useCurrentFoundryUser; }
19
+ get: function () { return chunkVQ4PS6U2_cjs.useCurrentFoundryUser; }
20
20
  });
21
21
  Object.defineProperty(exports, "useFoundryUser", {
22
22
  enumerable: true,
23
- get: function () { return chunkHJHKH4B6_cjs.useFoundryUser; }
23
+ get: function () { return chunkVQ4PS6U2_cjs.useFoundryUser; }
24
24
  });
25
25
  Object.defineProperty(exports, "useFoundryUsersList", {
26
26
  enumerable: true,
27
- get: function () { return chunkHJHKH4B6_cjs.useFoundryUsersList; }
27
+ get: function () { return chunkVQ4PS6U2_cjs.useFoundryUsersList; }
28
28
  });
29
29
  Object.defineProperty(exports, "useMarkingCategories", {
30
30
  enumerable: true,
31
- get: function () { return chunkHJHKH4B6_cjs.useMarkingCategories; }
31
+ get: function () { return chunkVQ4PS6U2_cjs.useMarkingCategories; }
32
32
  });
33
33
  Object.defineProperty(exports, "useMarkings", {
34
34
  enumerable: true,
35
- get: function () { return chunkHJHKH4B6_cjs.useMarkings; }
35
+ get: function () { return chunkVQ4PS6U2_cjs.useMarkings; }
36
36
  });
37
37
  Object.defineProperty(exports, "useUserViewMarkings", {
38
38
  enumerable: true,
39
- get: function () { return chunkHJHKH4B6_cjs.useUserViewMarkings; }
39
+ get: function () { return chunkVQ4PS6U2_cjs.useUserViewMarkings; }
40
40
  });
41
41
  //# sourceMappingURL=admin.cjs.map
42
42
  //# sourceMappingURL=admin.cjs.map
@@ -67,7 +67,7 @@ async function runChatStream(ctx, transport, chatId, seed, trigger) {
67
67
  trigger,
68
68
  chatId,
69
69
  messageId: assistantId,
70
- messages: seed.slice(),
70
+ messages: [...seed],
71
71
  abortSignal: ctrl.signal
72
72
  });
73
73
  await drainStream(ctx, stream, assistantId, ctrl);
@@ -330,7 +330,7 @@ function useChat(options) {
330
330
  function resolveRegenerateCutoff(messages, messageId) {
331
331
  if (messageId != null) {
332
332
  const index = messages.findIndex((m) => m.id === messageId);
333
- if (index < 0) {
333
+ if (index === -1) {
334
334
  return {
335
335
  kind: "noop"
336
336
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/aip/chatStore.ts","../../../../src/aip/chatStream.ts","../../../../src/aip/useChat.ts"],"names":["generateMessageId","React","LmsChatTransport"],"mappings":";;;;;;;;;;;;AAoBO,SAAS,gBAAgB,OAAA,EAAS;AACvC,EAAA,IAAI,KAAA,GAAQ;AAAA,IACV,QAAA,EAAU,OAAA,CAAQ,eAAA,IAAmB,EAAC;AAAA,IACtC,MAAA,EAAQ,OAAA;AAAA,IACR,KAAA,EAAO;AAAA,GACT;AACA,EAAA,MAAM,WAAA,uBAAkB,GAAA,EAAI;AAC5B,EAAA,MAAM,UAAA,GAAa,QAAQ,UAAA,IAAc,CAAA;AACzC,EAAA,IAAI,aAAA;AACJ,EAAA,MAAM,YAAY,MAAM;AACtB,IAAA,IAAI,iBAAiB,IAAA,EAAM;AACzB,MAAA,YAAA,CAAa,aAAa,CAAA;AAC1B,MAAA,aAAA,GAAgB,MAAA;AAAA,IAClB;AACA,IAAA,KAAA,MAAW,KAAK,WAAA,EAAa;AAC3B,MAAA,CAAA,EAAE;AAAA,IACJ;AAAA,EACF,CAAA;AACA,EAAA,MAAM,kBAAkB,MAAM;AAC5B,IAAA,IAAI,cAAc,CAAA,EAAG;AACnB,MAAA,SAAA,EAAU;AACV,MAAA;AAAA,IACF;AACA,IAAA,IAAI,iBAAiB,IAAA,EAAM;AACzB,MAAA;AAAA,IACF;AACA,IAAA,aAAA,GAAgB,UAAA,CAAW,WAAW,UAAU,CAAA;AAAA,EAClD,CAAA;AACA,EAAA,OAAO;AAAA,IACL,aAAa,MAAM,KAAA;AAAA,IACnB,WAAW,CAAA,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,QACN,KAAA,EAAO,IAAI,KAAA,CAAM,CAAA,+BAAA,EAAkC,SAAS,CAAA,0EAAA,CAAiF;AAAA,OAC/I;AAAA,IACF;AACA,IAAA,OAAO;AAAA,MACL,IAAA,EAAM,IAAA;AAAA,MACN;AAAA,KACF;AAAA,EACF;AACA,EAAA,MAAM,aAAA,GAAgB,uBAAuB,QAAQ,CAAA;AACrD,EAAA,IAAI,gBAAgB,CAAA,EAAG;AACrB,IAAA,OAAO;AAAA,MACL,IAAA,EAAM;AAAA,KACR;AAAA,EACF;AACA,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,IAAA;AAAA,IACN,KAAA,EAAO;AAAA,GACT;AACF;AACA,SAAS,qBAAqB,KAAA,EAAO;AACnC,EAAA,IAAI,UAAU,KAAA,EAAO;AACnB,IAAA,OAAO;AAAA,MACL,IAAID,yBAAAA,EAAkB;AAAA,MACtB,IAAA,EAAM,MAAA;AAAA,MACN,OAAO,CAAC;AAAA,QACN,IAAA,EAAM,MAAA;AAAA,QACN,MAAM,KAAA,CAAM;AAAA,OACb;AAAA,KACH;AAAA,EACF;AACA,EAAA,OAAO;AAAA,IACL,IAAIA,yBAAAA,EAAkB;AAAA,IACtB,MAAM,KAAA,CAAM,IAAA;AAAA,IACZ,OAAO,KAAA,CAAM;AAAA,GACf;AACF;AACA,SAAS,uBAAuB,GAAA,EAAK;AACnC,EAAA,KAAA,IAAS,IAAI,GAAA,CAAI,MAAA,GAAS,CAAA,EAAG,CAAA,IAAK,GAAG,CAAA,EAAA,EAAK;AACxC,IAAA,IAAI,GAAA,CAAI,CAAC,CAAA,EAAG,IAAA,KAAS,WAAA,EAAa;AAChC,MAAA,OAAO,CAAA;AAAA,IACT;AAAA,EACF;AACA,EAAA,OAAO,EAAA;AACT","file":"aip.cjs","sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Tiny pub-sub store backing `useChat`. Throttles subscriber notifications so\n * fast token-delta streams don't trigger one render per token.\n */\nexport function createChatStore(options) {\n let state = {\n messages: options.initialMessages ?? [],\n status: \"ready\",\n error: undefined\n };\n const subscribers = new Set();\n const throttleMs = options.throttleMs ?? 0;\n let pendingNotify;\n const notifyNow = () => {\n if (pendingNotify != null) {\n clearTimeout(pendingNotify);\n pendingNotify = undefined;\n }\n for (const s of subscribers) {\n s();\n }\n };\n const notifyThrottled = () => {\n if (throttleMs <= 0) {\n notifyNow();\n return;\n }\n if (pendingNotify != null) {\n return;\n }\n pendingNotify = setTimeout(notifyNow, throttleMs);\n };\n return {\n getSnapshot: () => state,\n subscribe: notify => {\n subscribers.add(notify);\n return () => {\n subscribers.delete(notify);\n };\n },\n setState: next => {\n state = typeof next === \"function\" ? next(state) : next;\n notifyNow();\n },\n setStateThrottled: next => {\n state = typeof next === \"function\" ? next(state) : next;\n notifyThrottled();\n }\n };\n}","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { generateMessageId } from \"@osdk/aip-core\";\n\n/**\n * Mutable orchestration handle threaded through the streaming functions.\n * Holds everything they need to read snapshots, mutate state, and check\n * whether their stream is still the active one.\n */\n\nexport async function runChatStream(ctx, transport, chatId, seed, trigger) {\n ctx.abortRef.current?.abort();\n const ctrl = new AbortController();\n ctx.abortRef.current = ctrl;\n ctx.stoppedRef.current = false;\n const assistantId = generateMessageId();\n try {\n const stream = await transport.sendMessages({\n trigger,\n chatId,\n messageId: assistantId,\n messages: seed.slice(),\n abortSignal: ctrl.signal\n });\n await drainStream(ctx, stream, assistantId, ctrl);\n } catch (err) {\n handleStreamError(ctx, err, ctrl);\n }\n}\nexport async function drainStream(ctx, stream, assistantMessageId, capturedCtrl) {\n const {\n store\n } = ctx;\n const reader = stream.getReader();\n let textBuf = \"\";\n const isStale = () => ctx.abortRef.current != null && ctx.abortRef.current !== capturedCtrl;\n\n // Caller dropped our assistant message via `setMessages` mid-stream.\n // Treat as \"the consumer no longer wants this stream\" — quietly stop.\n const isOrphaned = () => {\n const messages = store.getSnapshot().messages;\n return textBuf.length > 0 && !messages.some(m => m.id === assistantMessageId);\n };\n try {\n while (true) {\n const {\n done,\n value\n } = await reader.read();\n if (done) {\n break;\n }\n if (isStale()) {\n await reader.cancel();\n return;\n }\n if (isOrphaned()) {\n await reader.cancel();\n store.setState(prev => ({\n ...prev,\n status: \"ready\"\n }));\n return;\n }\n if (value.type === \"text-delta\") {\n textBuf += value.delta;\n upsertAssistantText(store, assistantMessageId, textBuf);\n } else if (value.type === \"error\") {\n if (ctx.stoppedRef.current || capturedCtrl.signal.aborted) {\n return;\n }\n await reader.cancel();\n throw new Error(value.errorText);\n }\n }\n if (isStale()) {\n return;\n }\n store.setState(prev => ({\n ...prev,\n status: \"ready\"\n }));\n const finalSnap = store.getSnapshot();\n const finalMessage = finalSnap.messages.find(m => m.id === assistantMessageId);\n if (finalMessage != null && ctx.onFinish != null) {\n ctx.onFinish({\n message: finalMessage,\n messages: finalSnap.messages\n });\n }\n } catch (err) {\n handleStreamError(ctx, err, capturedCtrl);\n } finally {\n reader.releaseLock();\n }\n}\nfunction upsertAssistantText(store, assistantMessageId, text) {\n store.setStateThrottled(prev => {\n const exists = prev.messages.some(m => m.id === assistantMessageId);\n const messages = exists ? prev.messages.map(m => m.id === assistantMessageId ? {\n ...m,\n parts: [{\n type: \"text\",\n text\n }]\n } : m) : [...prev.messages, {\n id: assistantMessageId,\n role: \"assistant\",\n parts: [{\n type: \"text\",\n text\n }]\n }];\n return {\n ...prev,\n status: \"streaming\",\n messages\n };\n });\n}\nfunction handleStreamError(ctx, err, capturedCtrl) {\n if (ctx.abortRef.current != null && ctx.abortRef.current !== capturedCtrl) {\n return;\n }\n const error = err instanceof Error ? err : new Error(String(err));\n if (ctx.stoppedRef.current || error.name === \"AbortError\" || capturedCtrl.signal.aborted) {\n ctx.store.setState(prev => ({\n ...prev,\n status: \"ready\",\n error: undefined\n }));\n return;\n }\n ctx.store.setState(prev => ({\n ...prev,\n status: \"error\",\n error\n }));\n ctx.onError?.(error);\n}","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { generateMessageId, LmsChatTransport } from \"@osdk/aip-core\";\nimport React from \"react\";\nimport { createChatStore } from \"./chatStore.js\";\nimport { drainStream, runChatStream } from \"./chatStream.js\";\n\n/**\n * Options for {@link useChat}.\n *\n * v0 covers text-only chat. Tools, multi-step agent loops, and stream\n * resume are not supported.\n */\n\n/** Return value of {@link useChat}. */\n\n/** Input shape accepted by `sendMessage`. */\n\n/**\n * React hook for streaming chat completions through `@osdk/aip-core`'s\n * `streamText`.\n *\n * @example\n * ```tsx\n * const { messages, status, sendMessage, stop, error } = useChat({\n * model: foundryModel({ client, model: \"gpt-4o\" }),\n * system: \"You are a concise assistant.\",\n * });\n * ```\n */\nexport function useChat(options) {\n const {\n onFinish,\n onError\n } = options;\n const id = React.useMemo(() => options.id ?? generateMessageId(), [options.id]);\n\n // JSON-stringify keys keep the memo stable when callers pass inline objects.\n const headersKey = JSON.stringify(options.headers ?? null);\n const stopSequencesKey = JSON.stringify(options.stopSequences ?? null);\n const transport = React.useMemo(() => {\n if (options.transport != null) {\n return options.transport;\n }\n if (options.model == null) {\n throw new Error(\"useChat: `model` is required when no `transport` is provided.\");\n }\n const built = {\n model: options.model,\n system: options.system,\n temperature: options.temperature,\n maxOutputTokens: options.maxOutputTokens,\n topP: options.topP,\n presencePenalty: options.presencePenalty,\n frequencyPenalty: options.frequencyPenalty,\n stopSequences: options.stopSequences,\n seed: options.seed,\n headers: options.headers\n };\n return new LmsChatTransport(built);\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [options.transport, options.model, options.system, options.temperature, options.maxOutputTokens, options.topP, options.presencePenalty, options.frequencyPenalty, options.seed, headersKey, stopSequencesKey]);\n const store = React.useMemo(() => createChatStore({\n initialMessages: options.messages,\n throttleMs: options.experimentalThrottle ?? 50\n }),\n // Recreating the store mid-session would drop chat state, so it's keyed\n // only by `id`. Use `setMessages` to mutate messages at runtime.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [id]);\n const state = React.useSyncExternalStore(store.subscribe, store.getSnapshot, store.getSnapshot);\n const abortRef = React.useRef(undefined);\n const stoppedRef = React.useRef(false);\n const ctxRef = React.useRef({\n store,\n abortRef,\n stoppedRef,\n onFinish,\n onError\n });\n ctxRef.current = {\n store,\n abortRef,\n stoppedRef,\n onFinish,\n onError\n };\n const runStream = React.useCallback((seed, trigger) => runChatStream(ctxRef.current, transport, id, seed, trigger), [transport, id]);\n const sendMessage = React.useCallback(async input => {\n const userMsg = normalizeUserMessage(input);\n const seeded = [...store.getSnapshot().messages, userMsg];\n store.setState({\n messages: seeded,\n status: \"submitted\",\n error: undefined\n });\n await runStream(seeded, \"submit-message\");\n }, [store, runStream]);\n const regenerate = React.useCallback(async regenerateOpts => {\n const messages = store.getSnapshot().messages;\n const cutoff = resolveRegenerateCutoff(messages, regenerateOpts?.messageId);\n if (cutoff.kind === \"noop\") {\n return;\n }\n if (cutoff.kind === \"error\") {\n store.setState(prev => ({\n ...prev,\n status: \"error\",\n error: cutoff.error\n }));\n return;\n }\n const truncated = messages.slice(0, cutoff.index);\n store.setState({\n messages: truncated,\n status: \"submitted\",\n error: undefined\n });\n await runStream(truncated, \"regenerate-message\");\n }, [store, runStream]);\n const stop = React.useCallback(() => {\n stoppedRef.current = true;\n abortRef.current?.abort();\n abortRef.current = undefined;\n }, []);\n const resumeStream = React.useCallback(async () => {\n const stream = await transport.reconnectToStream({\n chatId: id\n });\n if (stream == null) {\n return;\n }\n abortRef.current?.abort();\n const ctrl = new AbortController();\n abortRef.current = ctrl;\n const assistantId = generateMessageId();\n await drainStream(ctxRef.current, stream, assistantId, ctrl);\n }, [transport, id]);\n const clearError = React.useCallback(() => {\n // Resetting from streaming/submitted would race the in-flight stream, so\n // only reset when status === \"error\".\n store.setState(prev => prev.status === \"error\" ? {\n ...prev,\n status: \"ready\",\n error: undefined\n } : prev);\n }, [store]);\n const setMessages = React.useCallback(next => {\n store.setState(prev => {\n if (prev.status === \"streaming\" || prev.status === \"submitted\") {\n return prev;\n }\n return {\n ...prev,\n messages: typeof next === \"function\" ? next(prev.messages) : next\n };\n });\n }, [store]);\n return React.useMemo(() => ({\n id,\n messages: state.messages,\n setMessages,\n status: state.status,\n error: state.error,\n sendMessage,\n regenerate,\n stop,\n resumeStream,\n clearError\n }), [id, state.messages, state.status, state.error, setMessages, sendMessage, regenerate, stop, resumeStream, clearError]);\n}\nfunction resolveRegenerateCutoff(messages, messageId) {\n if (messageId != null) {\n const index = messages.findIndex(m => m.id === messageId);\n if (index < 0) {\n return {\n kind: \"noop\"\n };\n }\n const target = messages[index];\n if (target == null || target.role !== \"assistant\") {\n return {\n kind: \"error\",\n error: new Error(`useChat.regenerate: messageId \"${messageId}\" is ` + `not an assistant message; only assistant messages can be regenerated.`)\n };\n }\n return {\n kind: \"ok\",\n index\n };\n }\n const lastAssistant = findLastAssistantIndex(messages);\n if (lastAssistant < 0) {\n return {\n kind: \"noop\"\n };\n }\n return {\n kind: \"ok\",\n index: lastAssistant\n };\n}\nfunction normalizeUserMessage(input) {\n if (\"text\" in input) {\n return {\n id: generateMessageId(),\n role: \"user\",\n parts: [{\n type: \"text\",\n text: input.text\n }]\n };\n }\n return {\n id: generateMessageId(),\n role: input.role,\n parts: input.parts\n };\n}\nfunction findLastAssistantIndex(arr) {\n for (let i = arr.length - 1; i >= 0; i--) {\n if (arr[i]?.role === \"assistant\") {\n return i;\n }\n }\n return -1;\n}"]}
1
+ {"version":3,"sources":["../../../../src/aip/chatStore.ts","../../../../src/aip/chatStream.ts","../../../../src/aip/useChat.ts"],"names":["generateMessageId","React","LmsChatTransport"],"mappings":";;;;;;;;;;;;AAoBO,SAAS,gBAAgB,OAAA,EAAS;AACvC,EAAA,IAAI,KAAA,GAAQ;AAAA,IACV,QAAA,EAAU,OAAA,CAAQ,eAAA,IAAmB,EAAC;AAAA,IACtC,MAAA,EAAQ,OAAA;AAAA,IACR,KAAA,EAAO;AAAA,GACT;AACA,EAAA,MAAM,WAAA,uBAAkB,GAAA,EAAI;AAC5B,EAAA,MAAM,UAAA,GAAa,QAAQ,UAAA,IAAc,CAAA;AACzC,EAAA,IAAI,aAAA;AACJ,EAAA,MAAM,YAAY,MAAM;AACtB,IAAA,IAAI,iBAAiB,IAAA,EAAM;AACzB,MAAA,YAAA,CAAa,aAAa,CAAA;AAC1B,MAAA,aAAA,GAAgB,MAAA;AAAA,IAClB;AACA,IAAA,KAAA,MAAW,KAAK,WAAA,EAAa;AAC3B,MAAA,CAAA,EAAE;AAAA,IACJ;AAAA,EACF,CAAA;AACA,EAAA,MAAM,kBAAkB,MAAM;AAC5B,IAAA,IAAI,cAAc,CAAA,EAAG;AACnB,MAAA,SAAA,EAAU;AACV,MAAA;AAAA,IACF;A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C,MAAA,OAAO,CAAA;AAAA,IACT;AAAA,EACF;AACA,EAAA,OAAO,EAAA;AACT","file":"aip.cjs","sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Tiny pub-sub store backing `useChat`. Throttles subscriber notifications so\n * fast token-delta streams don't trigger one render per token.\n */\nexport function createChatStore(options) {\n let state = {\n messages: options.initialMessages ?? [],\n status: \"ready\",\n error: undefined\n };\n const subscribers = new Set();\n const throttleMs = options.throttleMs ?? 0;\n let pendingNotify;\n const notifyNow = () => {\n if (pendingNotify != null) {\n clearTimeout(pendingNotify);\n pendingNotify = undefined;\n }\n for (const s of subscribers) {\n s();\n }\n };\n const notifyThrottled = () => {\n if (throttleMs <= 0) {\n notifyNow();\n return;\n }\n if (pendingNotify != null) {\n return;\n }\n pendingNotify = setTimeout(notifyNow, throttleMs);\n };\n return {\n getSnapshot: () => state,\n subscribe: notify => {\n subscribers.add(notify);\n return () => {\n subscribers.delete(notify);\n };\n },\n setState: next => {\n state = typeof next === \"function\" ? next(state) : next;\n notifyNow();\n },\n setStateThrottled: next => {\n state = typeof next === \"function\" ? next(state) : next;\n notifyThrottled();\n }\n };\n}","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { generateMessageId } from \"@osdk/aip-core\";\n\n/**\n * Mutable orchestration handle threaded through the streaming functions.\n * Holds everything they need to read snapshots, mutate state, and check\n * whether their stream is still the active one.\n */\n\nexport async function runChatStream(ctx, transport, chatId, seed, trigger) {\n ctx.abortRef.current?.abort();\n const ctrl = new AbortController();\n ctx.abortRef.current = ctrl;\n ctx.stoppedRef.current = false;\n const assistantId = generateMessageId();\n try {\n const stream = await transport.sendMessages({\n trigger,\n chatId,\n messageId: assistantId,\n messages: [...seed],\n abortSignal: ctrl.signal\n });\n await drainStream(ctx, stream, assistantId, ctrl);\n } catch (err) {\n handleStreamError(ctx, err, ctrl);\n }\n}\nexport async function drainStream(ctx, stream, assistantMessageId, capturedCtrl) {\n const {\n store\n } = ctx;\n const reader = stream.getReader();\n let textBuf = \"\";\n const isStale = () => ctx.abortRef.current != null && ctx.abortRef.current !== capturedCtrl;\n\n // Caller dropped our assistant message via `setMessages` mid-stream.\n // Treat as \"the consumer no longer wants this stream\" — quietly stop.\n const isOrphaned = () => {\n const messages = store.getSnapshot().messages;\n return textBuf.length > 0 && !messages.some(m => m.id === assistantMessageId);\n };\n try {\n while (true) {\n const {\n done,\n value\n } = await reader.read();\n if (done) {\n break;\n }\n if (isStale()) {\n await reader.cancel();\n return;\n }\n if (isOrphaned()) {\n await reader.cancel();\n store.setState(prev => ({\n ...prev,\n status: \"ready\"\n }));\n return;\n }\n if (value.type === \"text-delta\") {\n textBuf += value.delta;\n upsertAssistantText(store, assistantMessageId, textBuf);\n } else if (value.type === \"error\") {\n if (ctx.stoppedRef.current || capturedCtrl.signal.aborted) {\n return;\n }\n await reader.cancel();\n throw new Error(value.errorText);\n }\n }\n if (isStale()) {\n return;\n }\n store.setState(prev => ({\n ...prev,\n status: \"ready\"\n }));\n const finalSnap = store.getSnapshot();\n const finalMessage = finalSnap.messages.find(m => m.id === assistantMessageId);\n if (finalMessage != null && ctx.onFinish != null) {\n ctx.onFinish({\n message: finalMessage,\n messages: finalSnap.messages\n });\n }\n } catch (err) {\n handleStreamError(ctx, err, capturedCtrl);\n } finally {\n reader.releaseLock();\n }\n}\nfunction upsertAssistantText(store, assistantMessageId, text) {\n store.setStateThrottled(prev => {\n const exists = prev.messages.some(m => m.id === assistantMessageId);\n const messages = exists ? prev.messages.map(m => m.id === assistantMessageId ? {\n ...m,\n parts: [{\n type: \"text\",\n text\n }]\n } : m) : [...prev.messages, {\n id: assistantMessageId,\n role: \"assistant\",\n parts: [{\n type: \"text\",\n text\n }]\n }];\n return {\n ...prev,\n status: \"streaming\",\n messages\n };\n });\n}\nfunction handleStreamError(ctx, err, capturedCtrl) {\n if (ctx.abortRef.current != null && ctx.abortRef.current !== capturedCtrl) {\n return;\n }\n const error = err instanceof Error ? err : new Error(String(err));\n if (ctx.stoppedRef.current || error.name === \"AbortError\" || capturedCtrl.signal.aborted) {\n ctx.store.setState(prev => ({\n ...prev,\n status: \"ready\",\n error: undefined\n }));\n return;\n }\n ctx.store.setState(prev => ({\n ...prev,\n status: \"error\",\n error\n }));\n ctx.onError?.(error);\n}","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { generateMessageId, LmsChatTransport } from \"@osdk/aip-core\";\nimport React from \"react\";\nimport { createChatStore } from \"./chatStore.js\";\nimport { drainStream, runChatStream } from \"./chatStream.js\";\n\n/**\n * Options for {@link useChat}.\n *\n * v0 covers text-only chat. Tools, multi-step agent loops, and stream\n * resume are not supported.\n */\n\n/** Return value of {@link useChat}. */\n\n/** Input shape accepted by `sendMessage`. */\n\n/**\n * React hook for streaming chat completions through `@osdk/aip-core`'s\n * `streamText`.\n *\n * @example\n * ```tsx\n * const { messages, status, sendMessage, stop, error } = useChat({\n * model: foundryModel({ client, model: \"gpt-4o\" }),\n * system: \"You are a concise assistant.\",\n * });\n * ```\n */\nexport function useChat(options) {\n const {\n onFinish,\n onError\n } = options;\n const id = React.useMemo(() => options.id ?? generateMessageId(), [options.id]);\n\n // JSON-stringify keys keep the memo stable when callers pass inline objects.\n const headersKey = JSON.stringify(options.headers ?? null);\n const stopSequencesKey = JSON.stringify(options.stopSequences ?? null);\n const transport = React.useMemo(() => {\n if (options.transport != null) {\n return options.transport;\n }\n if (options.model == null) {\n throw new Error(\"useChat: `model` is required when no `transport` is provided.\");\n }\n const built = {\n model: options.model,\n system: options.system,\n temperature: options.temperature,\n maxOutputTokens: options.maxOutputTokens,\n topP: options.topP,\n presencePenalty: options.presencePenalty,\n frequencyPenalty: options.frequencyPenalty,\n stopSequences: options.stopSequences,\n seed: options.seed,\n headers: options.headers\n };\n return new LmsChatTransport(built);\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [options.transport, options.model, options.system, options.temperature, options.maxOutputTokens, options.topP, options.presencePenalty, options.frequencyPenalty, options.seed, headersKey, stopSequencesKey]);\n const store = React.useMemo(() => createChatStore({\n initialMessages: options.messages,\n throttleMs: options.experimentalThrottle ?? 50\n }),\n // Recreating the store mid-session would drop chat state, so it's keyed\n // only by `id`. Use `setMessages` to mutate messages at runtime.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [id]);\n const state = React.useSyncExternalStore(store.subscribe, store.getSnapshot, store.getSnapshot);\n const abortRef = React.useRef(undefined);\n const stoppedRef = React.useRef(false);\n const ctxRef = React.useRef({\n store,\n abortRef,\n stoppedRef,\n onFinish,\n onError\n });\n ctxRef.current = {\n store,\n abortRef,\n stoppedRef,\n onFinish,\n onError\n };\n const runStream = React.useCallback((seed, trigger) => runChatStream(ctxRef.current, transport, id, seed, trigger), [transport, id]);\n const sendMessage = React.useCallback(async input => {\n const userMsg = normalizeUserMessage(input);\n const seeded = [...store.getSnapshot().messages, userMsg];\n store.setState({\n messages: seeded,\n status: \"submitted\",\n error: undefined\n });\n await runStream(seeded, \"submit-message\");\n }, [store, runStream]);\n const regenerate = React.useCallback(async regenerateOpts => {\n const messages = store.getSnapshot().messages;\n const cutoff = resolveRegenerateCutoff(messages, regenerateOpts?.messageId);\n if (cutoff.kind === \"noop\") {\n return;\n }\n if (cutoff.kind === \"error\") {\n store.setState(prev => ({\n ...prev,\n status: \"error\",\n error: cutoff.error\n }));\n return;\n }\n const truncated = messages.slice(0, cutoff.index);\n store.setState({\n messages: truncated,\n status: \"submitted\",\n error: undefined\n });\n await runStream(truncated, \"regenerate-message\");\n }, [store, runStream]);\n const stop = React.useCallback(() => {\n stoppedRef.current = true;\n abortRef.current?.abort();\n abortRef.current = undefined;\n }, []);\n const resumeStream = React.useCallback(async () => {\n const stream = await transport.reconnectToStream({\n chatId: id\n });\n if (stream == null) {\n return;\n }\n abortRef.current?.abort();\n const ctrl = new AbortController();\n abortRef.current = ctrl;\n const assistantId = generateMessageId();\n await drainStream(ctxRef.current, stream, assistantId, ctrl);\n }, [transport, id]);\n const clearError = React.useCallback(() => {\n // Resetting from streaming/submitted would race the in-flight stream, so\n // only reset when status === \"error\".\n store.setState(prev => prev.status === \"error\" ? {\n ...prev,\n status: \"ready\",\n error: undefined\n } : prev);\n }, [store]);\n const setMessages = React.useCallback(next => {\n store.setState(prev => {\n if (prev.status === \"streaming\" || prev.status === \"submitted\") {\n return prev;\n }\n return {\n ...prev,\n messages: typeof next === \"function\" ? next(prev.messages) : next\n };\n });\n }, [store]);\n return React.useMemo(() => ({\n id,\n messages: state.messages,\n setMessages,\n status: state.status,\n error: state.error,\n sendMessage,\n regenerate,\n stop,\n resumeStream,\n clearError\n }), [id, state.messages, state.status, state.error, setMessages, sendMessage, regenerate, stop, resumeStream, clearError]);\n}\nfunction resolveRegenerateCutoff(messages, messageId) {\n if (messageId != null) {\n const index = messages.findIndex(m => m.id === messageId);\n if (index === -1) {\n return {\n kind: \"noop\"\n };\n }\n const target = messages[index];\n if (target == null || target.role !== \"assistant\") {\n return {\n kind: \"error\",\n error: new Error(`useChat.regenerate: messageId \"${messageId}\" is ` + `not an assistant message; only assistant messages can be regenerated.`)\n };\n }\n return {\n kind: \"ok\",\n index\n };\n }\n const lastAssistant = findLastAssistantIndex(messages);\n if (lastAssistant < 0) {\n return {\n kind: \"noop\"\n };\n }\n return {\n kind: \"ok\",\n index: lastAssistant\n };\n}\nfunction normalizeUserMessage(input) {\n if (\"text\" in input) {\n return {\n id: generateMessageId(),\n role: \"user\",\n parts: [{\n type: \"text\",\n text: input.text\n }]\n };\n }\n return {\n id: generateMessageId(),\n role: input.role,\n parts: input.parts\n };\n}\nfunction findLastAssistantIndex(arr) {\n for (let i = arr.length - 1; i >= 0; i--) {\n if (arr[i]?.role === \"assistant\") {\n return i;\n }\n }\n return -1;\n}"]}
@@ -1,71 +1,71 @@
1
1
  'use strict';
2
2
 
3
- var chunkSEFARM7Y_cjs = require('../chunk-SEFARM7Y.cjs');
3
+ var chunkICSJXGFL_cjs = require('../chunk-ICSJXGFL.cjs');
4
4
  var chunkOGP2DK2V_cjs = require('../chunk-OGP2DK2V.cjs');
5
- require('../chunk-UKQGMTMG.cjs');
5
+ require('../chunk-O5ISVU2U.cjs');
6
6
  require('../chunk-DO3NFBKN.cjs');
7
7
 
8
8
 
9
9
 
10
10
  Object.defineProperty(exports, "OsdkProvider2", {
11
11
  enumerable: true,
12
- get: function () { return chunkSEFARM7Y_cjs.OsdkProvider; }
12
+ get: function () { return chunkICSJXGFL_cjs.OsdkProvider; }
13
13
  });
14
14
  Object.defineProperty(exports, "useDebouncedCallback", {
15
15
  enumerable: true,
16
- get: function () { return chunkSEFARM7Y_cjs.useDebouncedCallback; }
16
+ get: function () { return chunkICSJXGFL_cjs.useDebouncedCallback; }
17
17
  });
18
18
  Object.defineProperty(exports, "useLinks", {
19
19
  enumerable: true,
20
- get: function () { return chunkSEFARM7Y_cjs.useLinks; }
20
+ get: function () { return chunkICSJXGFL_cjs.useLinks; }
21
21
  });
22
22
  Object.defineProperty(exports, "useObjectSet", {
23
23
  enumerable: true,
24
- get: function () { return chunkSEFARM7Y_cjs.useObjectSet; }
24
+ get: function () { return chunkICSJXGFL_cjs.useObjectSet; }
25
25
  });
26
26
  Object.defineProperty(exports, "useOsdkAction", {
27
27
  enumerable: true,
28
- get: function () { return chunkSEFARM7Y_cjs.useOsdkAction; }
28
+ get: function () { return chunkICSJXGFL_cjs.useOsdkAction; }
29
29
  });
30
30
  Object.defineProperty(exports, "useOsdkAggregation", {
31
31
  enumerable: true,
32
- get: function () { return chunkSEFARM7Y_cjs.useOsdkAggregation; }
32
+ get: function () { return chunkICSJXGFL_cjs.useOsdkAggregation; }
33
33
  });
34
34
  Object.defineProperty(exports, "useOsdkClient", {
35
35
  enumerable: true,
36
- get: function () { return chunkSEFARM7Y_cjs.useOsdkClient; }
36
+ get: function () { return chunkICSJXGFL_cjs.useOsdkClient; }
37
37
  });
38
38
  Object.defineProperty(exports, "useOsdkClient2", {
39
39
  enumerable: true,
40
- get: function () { return chunkSEFARM7Y_cjs.useOsdkClient; }
40
+ get: function () { return chunkICSJXGFL_cjs.useOsdkClient; }
41
41
  });
42
42
  Object.defineProperty(exports, "useOsdkFunction", {
43
43
  enumerable: true,
44
- get: function () { return chunkSEFARM7Y_cjs.useOsdkFunction; }
44
+ get: function () { return chunkICSJXGFL_cjs.useOsdkFunction; }
45
45
  });
46
46
  Object.defineProperty(exports, "useOsdkFunctions", {
47
47
  enumerable: true,
48
- get: function () { return chunkSEFARM7Y_cjs.useOsdkFunctions; }
48
+ get: function () { return chunkICSJXGFL_cjs.useOsdkFunctions; }
49
49
  });
50
50
  Object.defineProperty(exports, "useOsdkMetadata", {
51
51
  enumerable: true,
52
- get: function () { return chunkSEFARM7Y_cjs.useOsdkMetadata; }
52
+ get: function () { return chunkICSJXGFL_cjs.useOsdkMetadata; }
53
53
  });
54
54
  Object.defineProperty(exports, "useOsdkObject", {
55
55
  enumerable: true,
56
- get: function () { return chunkSEFARM7Y_cjs.useOsdkObject; }
56
+ get: function () { return chunkICSJXGFL_cjs.useOsdkObject; }
57
57
  });
58
58
  Object.defineProperty(exports, "useOsdkObjects", {
59
59
  enumerable: true,
60
- get: function () { return chunkSEFARM7Y_cjs.useOsdkObjects; }
60
+ get: function () { return chunkICSJXGFL_cjs.useOsdkObjects; }
61
61
  });
62
62
  Object.defineProperty(exports, "useRegisterUserAgent", {
63
63
  enumerable: true,
64
- get: function () { return chunkSEFARM7Y_cjs.useRegisterUserAgent; }
64
+ get: function () { return chunkICSJXGFL_cjs.useRegisterUserAgent; }
65
65
  });
66
66
  Object.defineProperty(exports, "useStableObjectSet", {
67
67
  enumerable: true,
68
- get: function () { return chunkSEFARM7Y_cjs.useStableObjectSet; }
68
+ get: function () { return chunkICSJXGFL_cjs.useStableObjectSet; }
69
69
  });
70
70
  Object.defineProperty(exports, "getRegisteredDevTools", {
71
71
  enumerable: true,
@@ -721,7 +721,7 @@ type UseOsdkFunctionsResult = Array<UseOsdkFunctionResult<QueryDefinition<unknow
721
721
  * @param options - Configuration options containing the queries to execute
722
722
  * @returns Array of results in the same order as input queries, each with the same shape as useOsdkFunction
723
723
  */
724
- declare function useOsdkFunctions({ queries, enabled, maxConcurrent }: UseOsdkFunctionsProps): UseOsdkFunctionsResult;
724
+ declare function useOsdkFunctions({ queries, enabled, maxConcurrent, }: UseOsdkFunctionsProps): UseOsdkFunctionsResult;
725
725
 
726
726
  interface UseOsdkObjectResult<Q extends ObjectOrInterfaceDefinition> {
727
727
  object: Osdk.Instance<Q, "$allBaseProperties"> | undefined;
@@ -1,42 +1,42 @@
1
1
  'use strict';
2
2
 
3
- var chunkHJHKH4B6_cjs = require('../chunk-HJHKH4B6.cjs');
4
- require('../chunk-UKQGMTMG.cjs');
3
+ var chunkVQ4PS6U2_cjs = require('../chunk-VQ4PS6U2.cjs');
4
+ require('../chunk-O5ISVU2U.cjs');
5
5
  require('../chunk-DO3NFBKN.cjs');
6
6
 
7
7
 
8
8
 
9
9
  Object.defineProperty(exports, "useCbacBanner", {
10
10
  enumerable: true,
11
- get: function () { return chunkHJHKH4B6_cjs.useCbacBanner; }
11
+ get: function () { return chunkVQ4PS6U2_cjs.useCbacBanner; }
12
12
  });
13
13
  Object.defineProperty(exports, "useCbacMarkingRestrictions", {
14
14
  enumerable: true,
15
- get: function () { return chunkHJHKH4B6_cjs.useCbacMarkingRestrictions; }
15
+ get: function () { return chunkVQ4PS6U2_cjs.useCbacMarkingRestrictions; }
16
16
  });
17
17
  Object.defineProperty(exports, "useCurrentFoundryUser", {
18
18
  enumerable: true,
19
- get: function () { return chunkHJHKH4B6_cjs.useCurrentFoundryUser; }
19
+ get: function () { return chunkVQ4PS6U2_cjs.useCurrentFoundryUser; }
20
20
  });
21
21
  Object.defineProperty(exports, "useFoundryUser", {
22
22
  enumerable: true,
23
- get: function () { return chunkHJHKH4B6_cjs.useFoundryUser; }
23
+ get: function () { return chunkVQ4PS6U2_cjs.useFoundryUser; }
24
24
  });
25
25
  Object.defineProperty(exports, "useFoundryUsersList", {
26
26
  enumerable: true,
27
- get: function () { return chunkHJHKH4B6_cjs.useFoundryUsersList; }
27
+ get: function () { return chunkVQ4PS6U2_cjs.useFoundryUsersList; }
28
28
  });
29
29
  Object.defineProperty(exports, "useMarkingCategories", {
30
30
  enumerable: true,
31
- get: function () { return chunkHJHKH4B6_cjs.useMarkingCategories; }
31
+ get: function () { return chunkVQ4PS6U2_cjs.useMarkingCategories; }
32
32
  });
33
33
  Object.defineProperty(exports, "useMarkings", {
34
34
  enumerable: true,
35
- get: function () { return chunkHJHKH4B6_cjs.useMarkings; }
35
+ get: function () { return chunkVQ4PS6U2_cjs.useMarkings; }
36
36
  });
37
37
  Object.defineProperty(exports, "useUserViewMarkings", {
38
38
  enumerable: true,
39
- get: function () { return chunkHJHKH4B6_cjs.useUserViewMarkings; }
39
+ get: function () { return chunkVQ4PS6U2_cjs.useUserViewMarkings; }
40
40
  });
41
41
  //# sourceMappingURL=platform-apis.cjs.map
42
42
  //# sourceMappingURL=platform-apis.cjs.map
@@ -33,7 +33,7 @@ interface UseCbacBannerResult {
33
33
  * Get the CBAC banner data for the given marking IDs.
34
34
  * @param options Options to control the query.
35
35
  */
36
- declare function useCbacBanner({ markingIds, enabled: externalEnabled }: UseCbacBannerOptions): UseCbacBannerResult;
36
+ declare function useCbacBanner({ markingIds, enabled: externalEnabled, }: UseCbacBannerOptions): UseCbacBannerResult;
37
37
 
38
38
  interface CbacMarkingRestrictionsData {
39
39
  disallowedMarkings: string[];
@@ -68,7 +68,7 @@ interface UseCbacMarkingRestrictionsResult {
68
68
  * Get CBAC marking restrictions (implied, disallowed, required) for the given marking IDs.
69
69
  * @param options Options to control the query.
70
70
  */
71
- declare function useCbacMarkingRestrictions({ markingIds, enabled: externalEnabled }: UseCbacMarkingRestrictionsOptions): UseCbacMarkingRestrictionsResult;
71
+ declare function useCbacMarkingRestrictions({ markingIds, enabled: externalEnabled, }: UseCbacMarkingRestrictionsOptions): UseCbacMarkingRestrictionsResult;
72
72
 
73
73
  interface UseCurrentFoundryUserOptions {
74
74
  /**
@@ -96,7 +96,7 @@ interface UseCurrentFoundryUserResult {
96
96
  * Get the currently signed in User.
97
97
  * @param options Options to control the query.
98
98
  */
99
- declare function useCurrentFoundryUser({ enabled }?: UseCurrentFoundryUserOptions): UseCurrentFoundryUserResult;
99
+ declare function useCurrentFoundryUser({ enabled, }?: UseCurrentFoundryUserOptions): UseCurrentFoundryUserResult;
100
100
 
101
101
  interface UseFoundryUserOptions {
102
102
  /**
@@ -182,7 +182,7 @@ interface UseFoundryUsersListResult {
182
182
  * Lists all Users. This is a paged endpoint. Each page may be smaller or larger than the requested page size.
183
183
  * @param options Options to control the query.
184
184
  */
185
- declare function useFoundryUsersList({ enabled, include, pageSize, pageToken }?: UseFoundryUsersListOptions): UseFoundryUsersListResult;
185
+ declare function useFoundryUsersList({ enabled, include, pageSize, pageToken, }?: UseFoundryUsersListOptions): UseFoundryUsersListResult;
186
186
 
187
187
  interface UseMarkingCategoriesOptions {
188
188
  /**
@@ -209,7 +209,7 @@ interface UseMarkingCategoriesResult {
209
209
  * List all marking categories.
210
210
  * @param options Options to control the query.
211
211
  */
212
- declare function useMarkingCategories({ enabled }?: UseMarkingCategoriesOptions): UseMarkingCategoriesResult;
212
+ declare function useMarkingCategories({ enabled, }?: UseMarkingCategoriesOptions): UseMarkingCategoriesResult;
213
213
 
214
214
  interface UseMarkingsOptions {
215
215
  /**
@@ -236,7 +236,7 @@ interface UseMarkingsResult {
236
236
  * List all markings.
237
237
  * @param options Options to control the query.
238
238
  */
239
- declare function useMarkings({ enabled }?: UseMarkingsOptions): UseMarkingsResult;
239
+ declare function useMarkings({ enabled, }?: UseMarkingsOptions): UseMarkingsResult;
240
240
 
241
241
  interface UseUserViewMarkingsOptions {
242
242
  /**
@@ -270,6 +270,6 @@ interface UseUserViewMarkingsResult {
270
270
  * When omitted, fetches markings for the current user.
271
271
  * @param options Options to control the query.
272
272
  */
273
- declare function useUserViewMarkings({ userId, enabled }?: UseUserViewMarkingsOptions): UseUserViewMarkingsResult;
273
+ declare function useUserViewMarkings({ userId, enabled, }?: UseUserViewMarkingsOptions): UseUserViewMarkingsResult;
274
274
 
275
275
  export { type CbacBannerData, type CbacMarkingRestrictionsData, type UseCbacBannerOptions, type UseCbacBannerResult, type UseCbacMarkingRestrictionsOptions, type UseCbacMarkingRestrictionsResult, type UseUserViewMarkingsOptions, type UseUserViewMarkingsResult, useCbacBanner, useCbacMarkingRestrictions, useCurrentFoundryUser, useFoundryUser, useFoundryUsersList, useMarkingCategories, useMarkings, useUserViewMarkings };