@kortix/sdk 0.13.13 → 0.13.15
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.
- package/dist/core/client/kortix.d.ts +7 -1
- package/dist/core/client/kortix.d.ts.map +1 -1
- package/dist/core/client/kortix.js +3 -0
- package/dist/core/client/kortix.js.map +1 -1
- package/dist/core/rest/projects-client/connectors.d.ts +78 -1
- package/dist/core/rest/projects-client/connectors.d.ts.map +1 -1
- package/dist/core/rest/projects-client/connectors.js +46 -5
- package/dist/core/rest/projects-client/connectors.js.map +1 -1
- package/dist/core/rest/projects-client/projects.d.ts +15 -5
- package/dist/core/rest/projects-client/projects.d.ts.map +1 -1
- package/dist/core/rest/projects-client/projects.js +3 -4
- package/dist/core/rest/projects-client/projects.js.map +1 -1
- package/dist/kortix.esm.min.js +18 -18
- package/dist/kortix.global.js +18 -18
- package/dist/react/use-feature-flag.d.ts +4 -0
- package/dist/react/use-feature-flag.d.ts.map +1 -1
- package/dist/react/use-feature-flag.js +12 -1
- package/dist/react/use-feature-flag.js.map +1 -1
- package/package.json +2 -2
|
@@ -18,6 +18,10 @@ export interface FeatureFlagState {
|
|
|
18
18
|
* project id, an in-flight query, an error, an older server that does not
|
|
19
19
|
* serve the flag map, and a non-boolean wire value all resolve to `false`.
|
|
20
20
|
* A disabled feature's surface must be invisible, not merely inert.
|
|
21
|
+
*
|
|
22
|
+
* The one exception is a graduated key (`review_center`): it reports
|
|
23
|
+
* `enabled: true` for every project, because the feature no longer has an off
|
|
24
|
+
* state.
|
|
21
25
|
*/
|
|
22
26
|
export declare function useFeatureFlag(projectId: string | null | undefined, key: FeatureFlagKey): FeatureFlagState;
|
|
23
27
|
//# sourceMappingURL=use-feature-flag.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-feature-flag.d.ts","sourceRoot":"","sources":["../../src/react/use-feature-flag.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"use-feature-flag.d.ts","sourceRoot":"","sources":["../../src/react/use-feature-flag.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAYnE,iEAAiE;AACjE,MAAM,WAAW,gBAAgB;IAC/B,yEAAyE;IACzE,OAAO,EAAE,OAAO,CAAC;IACjB,uEAAuE;IACvE,SAAS,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,cAAc,CAC5B,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACpC,GAAG,EAAE,cAAc,GAClB,gBAAgB,CAclB"}
|
|
@@ -3,6 +3,13 @@ import { useQuery } from '@tanstack/react-query';
|
|
|
3
3
|
import { getProjectDetail } from '../core/rest/projects-client/index.js';
|
|
4
4
|
import { contract } from './query-contracts.js';
|
|
5
5
|
import { qk } from './query-keys.js';
|
|
6
|
+
/**
|
|
7
|
+
* Keys that graduated out of the flag system. Their features are on for every
|
|
8
|
+
* project and the API no longer serves them, so the fail-closed read below
|
|
9
|
+
* would hide a surface that is meant to be visible. Deprecated members of
|
|
10
|
+
* `FeatureFlagKey`; removed with them in the next major.
|
|
11
|
+
*/
|
|
12
|
+
const GRADUATED_FEATURE_FLAG_KEYS = new Set(['review_center']);
|
|
6
13
|
/**
|
|
7
14
|
* The ONE client-side gate for a per-project feature flag.
|
|
8
15
|
*
|
|
@@ -15,6 +22,10 @@ import { qk } from './query-keys.js';
|
|
|
15
22
|
* project id, an in-flight query, an error, an older server that does not
|
|
16
23
|
* serve the flag map, and a non-boolean wire value all resolve to `false`.
|
|
17
24
|
* A disabled feature's surface must be invisible, not merely inert.
|
|
25
|
+
*
|
|
26
|
+
* The one exception is a graduated key (`review_center`): it reports
|
|
27
|
+
* `enabled: true` for every project, because the feature no longer has an off
|
|
28
|
+
* state.
|
|
18
29
|
*/
|
|
19
30
|
export function useFeatureFlag(projectId, key) {
|
|
20
31
|
const query = useQuery({
|
|
@@ -25,7 +36,7 @@ export function useFeatureFlag(projectId, key) {
|
|
|
25
36
|
refetchOnWindowFocus: false,
|
|
26
37
|
});
|
|
27
38
|
return {
|
|
28
|
-
enabled: query.data?.project?.experimental?.[key] === true,
|
|
39
|
+
enabled: GRADUATED_FEATURE_FLAG_KEYS.has(key) || query.data?.project?.experimental?.[key] === true,
|
|
29
40
|
isLoading: query.isLoading,
|
|
30
41
|
};
|
|
31
42
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-feature-flag.js","sourceRoot":"","sources":["../../src/react/use-feature-flag.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"use-feature-flag.js","sourceRoot":"","sources":["../../src/react/use-feature-flag.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAElC;;;;;GAKG;AACH,MAAM,2BAA2B,GAAgC,IAAI,GAAG,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC;AAU5F;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,cAAc,CAC5B,SAAoC,EACpC,GAAmB;IAEnB,MAAM,KAAK,GAAG,QAAQ,CAAC;QACrB,QAAQ,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,IAAI,EAAE,CAAC;QAC5C,OAAO,EAAE,GAAG,EAAE,CAAC,gBAAgB,CAAC,SAAmB,CAAC;QACpD,OAAO,EAAE,CAAC,CAAC,SAAS;QACpB,GAAG,QAAQ,CAAC,QAAQ,CAAC;QACrB,oBAAoB,EAAE,KAAK;KAC5B,CAAC,CAAC;IAEH,OAAO;QACL,OAAO,EACL,2BAA2B,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC,GAAG,CAAC,KAAK,IAAI;QAC3F,SAAS,EAAE,KAAK,CAAC,SAAS;KAC3B,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kortix/sdk",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.15",
|
|
4
4
|
"description": "Official Kortix frontend TypeScript SDK — one typed client for the Kortix agent platform. Unifies project/session lifecycle and live agent streaming behind a single ergonomic Session handle, so web, mobile, and white-label apps never touch the raw HTTP API or OpenCode semantics.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Elastic-2.0",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
],
|
|
21
21
|
"sideEffects": false,
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@kortix/llm-catalog": "0.13.
|
|
23
|
+
"@kortix/llm-catalog": "0.13.15",
|
|
24
24
|
"@opencode-ai/sdk": "1.18.23",
|
|
25
25
|
"zustand": "^5.0.3"
|
|
26
26
|
},
|