@automattic/jetpack-ai-client 0.27.6 → 0.27.8
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/CHANGELOG.md +17 -0
- package/build/api-fetch/index.d.ts +3 -1
- package/build/ask-question/index.d.ts +2 -2
- package/build/ask-question/index.js +1 -1
- package/build/ask-question/sync.d.ts +2 -2
- package/build/ask-question/sync.js +1 -1
- package/build/audio-transcription/index.js +1 -1
- package/build/chrome-ai/factory.d.ts +2 -2
- package/build/chrome-ai/factory.js +2 -2
- package/build/chrome-ai/index.d.ts +2 -2
- package/build/chrome-ai/index.js +2 -2
- package/build/chrome-ai/suggestions.d.ts +1 -1
- package/build/chrome-ai/suggestions.js +4 -4
- package/build/components/ai-control/ai-control.d.ts +6 -2
- package/build/components/ai-control/ai-control.js +1 -1
- package/build/components/ai-control/block-ai-control.d.ts +1 -1
- package/build/components/ai-control/block-ai-control.js +2 -2
- package/build/components/ai-control/extension-ai-control.d.ts +1 -1
- package/build/components/ai-control/extension-ai-control.js +2 -2
- package/build/components/ai-control/index.d.ts +3 -3
- package/build/components/ai-control/index.js +3 -3
- package/build/components/ai-image/components/ai-image-modal.d.ts +2 -3
- package/build/components/ai-image/components/ai-image-modal.js +7 -7
- package/build/components/ai-image/components/carrousel.d.ts +0 -1
- package/build/components/ai-image/components/carrousel.js +2 -2
- package/build/components/ai-image/featured-image.js +8 -8
- package/build/components/ai-image/general-purpose-image.js +7 -7
- package/build/components/ai-image/hooks/use-ai-image.d.ts +3 -3
- package/build/components/ai-image/hooks/use-ai-image.js +7 -7
- package/build/components/ai-image/index.d.ts +3 -3
- package/build/components/ai-image/index.js +3 -3
- package/build/components/ai-status-indicator/index.d.ts +1 -1
- package/build/components/audio-duration-display/index.js +1 -1
- package/build/components/index.d.ts +10 -10
- package/build/components/index.js +10 -10
- package/build/components/message/index.d.ts +1 -1
- package/build/components/message/index.js +3 -3
- package/build/components/modal/index.d.ts +1 -2
- package/build/components/modal/index.js +1 -1
- package/build/components/quota-exceeded-message/index.js +3 -3
- package/build/data-flow/context.d.ts +4 -4
- package/build/data-flow/index.d.ts +3 -3
- package/build/data-flow/index.js +3 -3
- package/build/data-flow/use-ai-context.d.ts +3 -3
- package/build/data-flow/use-ai-context.js +2 -2
- package/build/data-flow/with-ai-assistant-data.js +2 -2
- package/build/hooks/use-ai-checkout/index.js +1 -1
- package/build/hooks/use-ai-feature/index.d.ts +1 -1
- package/build/hooks/use-ai-feature/index.js +1 -1
- package/build/hooks/use-ai-suggestions/index.d.ts +3 -3
- package/build/hooks/use-ai-suggestions/index.js +3 -3
- package/build/hooks/use-audio-transcription/index.js +1 -1
- package/build/hooks/use-image-generator/index.d.ts +2 -2
- package/build/hooks/use-image-generator/index.js +3 -3
- package/build/hooks/use-post-content.js +1 -1
- package/build/hooks/use-transcription-post-processing/index.js +1 -1
- package/build/icons/index.d.ts +7 -7
- package/build/icons/index.js +7 -7
- package/build/index.d.ts +23 -23
- package/build/index.js +23 -23
- package/build/jwt/index.js +1 -1
- package/build/libs/get-all-blocks.d.ts +1 -1
- package/build/libs/index.d.ts +7 -7
- package/build/libs/index.js +6 -6
- package/build/libs/map-action-to-human-text.js +1 -1
- package/build/libs/markdown/index.d.ts +3 -3
- package/build/libs/markdown/index.js +2 -2
- package/build/logo-generator/components/fair-usage-notice.js +1 -1
- package/build/logo-generator/components/first-load-screen.js +1 -1
- package/build/logo-generator/components/generator-modal.d.ts +1 -1
- package/build/logo-generator/components/generator-modal.js +14 -14
- package/build/logo-generator/components/history-carousel.js +2 -2
- package/build/logo-generator/components/logo-presenter.d.ts +1 -1
- package/build/logo-generator/components/logo-presenter.js +10 -10
- package/build/logo-generator/components/prompt.js +8 -8
- package/build/logo-generator/components/upgrade-nudge.js +3 -3
- package/build/logo-generator/components/upgrade-screen.js +2 -2
- package/build/logo-generator/hooks/use-checkout.js +1 -1
- package/build/logo-generator/hooks/use-fair-usage-notice-message.js +1 -1
- package/build/logo-generator/hooks/use-logo-generator.d.ts +3 -3
- package/build/logo-generator/hooks/use-logo-generator.js +8 -8
- package/build/logo-generator/hooks/use-request-errors.d.ts +6 -6
- package/build/logo-generator/hooks/use-request-errors.js +1 -1
- package/build/logo-generator/index.d.ts +2 -2
- package/build/logo-generator/index.js +2 -2
- package/build/logo-generator/lib/logo-storage.d.ts +2 -2
- package/build/logo-generator/lib/logo-storage.js +1 -1
- package/build/logo-generator/lib/media-exists.d.ts +1 -1
- package/build/logo-generator/lib/media-exists.js +1 -1
- package/build/logo-generator/lib/set-site-logo.d.ts +1 -1
- package/build/logo-generator/lib/set-site-logo.js +1 -1
- package/build/logo-generator/lib/wpcom-limited-request.js +1 -1
- package/build/logo-generator/store/actions.d.ts +2 -2
- package/build/logo-generator/store/actions.js +3 -3
- package/build/logo-generator/store/index.js +3 -3
- package/build/logo-generator/store/initial-state.d.ts +1 -1
- package/build/logo-generator/store/initial-state.js +1 -1
- package/build/logo-generator/store/reducer.d.ts +26 -26
- package/build/logo-generator/store/reducer.js +4 -4
- package/build/logo-generator/store/selectors.d.ts +2 -2
- package/build/logo-generator/store/selectors.js +1 -1
- package/build/logo-generator/store/types.d.ts +2 -2
- package/build/logo-generator/types.d.ts +1 -1
- package/build/suggestions-event-source/index.d.ts +1 -1
- package/build/suggestions-event-source/index.js +3 -3
- package/build/types.d.ts +8 -8
- package/build/types.js +1 -1
- package/package.json +21 -20
- package/src/ask-question/index.ts +2 -2
- package/src/ask-question/sync.ts +3 -3
- package/src/audio-transcription/index.ts +1 -1
- package/src/chrome-ai/factory.ts +3 -3
- package/src/chrome-ai/index.ts +2 -2
- package/src/chrome-ai/suggestions.ts +4 -4
- package/src/components/ai-control/ai-control.tsx +3 -3
- package/src/components/ai-control/block-ai-control.tsx +3 -3
- package/src/components/ai-control/extension-ai-control.tsx +3 -3
- package/src/components/ai-control/index.tsx +3 -3
- package/src/components/ai-control/style.scss +1 -0
- package/src/components/ai-feedback/style.scss +1 -0
- package/src/components/ai-image/components/ai-image-modal.scss +2 -0
- package/src/components/ai-image/components/ai-image-modal.tsx +7 -7
- package/src/components/ai-image/components/carrousel.scss +10 -4
- package/src/components/ai-image/components/carrousel.tsx +2 -2
- package/src/components/ai-image/components/usage-counter.scss +1 -1
- package/src/components/ai-image/featured-image.tsx +11 -11
- package/src/components/ai-image/general-purpose-image.tsx +7 -7
- package/src/components/ai-image/hooks/use-ai-image.ts +8 -8
- package/src/components/ai-image/index.ts +3 -3
- package/src/components/ai-image/style.scss +2 -0
- package/src/components/ai-status-indicator/index.tsx +1 -1
- package/src/components/audio-duration-display/index.tsx +1 -1
- package/src/components/index.ts +10 -10
- package/src/components/message/index.tsx +4 -4
- package/src/components/modal/index.tsx +2 -2
- package/src/components/modal/style.scss +2 -0
- package/src/components/quota-exceeded-message/index.tsx +3 -3
- package/src/components/quota-exceeded-message/style.scss +3 -1
- package/src/data-flow/context.tsx +4 -4
- package/src/data-flow/index.ts +3 -3
- package/src/data-flow/use-ai-context.ts +4 -4
- package/src/data-flow/with-ai-assistant-data.tsx +2 -2
- package/src/hooks/use-ai-checkout/index.ts +1 -1
- package/src/hooks/use-ai-suggestions/index.ts +6 -6
- package/src/hooks/use-audio-transcription/index.ts +1 -1
- package/src/hooks/use-image-generator/index.ts +3 -3
- package/src/hooks/use-post-content.ts +1 -1
- package/src/hooks/use-save-to-media-library/index.ts +1 -1
- package/src/hooks/use-save-to-media-library.ts +1 -1
- package/src/hooks/use-transcription-post-processing/index.ts +2 -2
- package/src/icons/index.ts +7 -7
- package/src/index.ts +23 -23
- package/src/jwt/index.ts +1 -1
- package/src/libs/get-all-blocks.ts +1 -1
- package/src/libs/index.ts +7 -7
- package/src/libs/map-action-to-human-text.ts +1 -1
- package/src/libs/markdown/index.ts +3 -3
- package/src/logo-generator/assets/icons/icons.scss +1 -0
- package/src/logo-generator/components/fair-usage-notice.tsx +1 -1
- package/src/logo-generator/components/first-load-screen.tsx +1 -1
- package/src/logo-generator/components/generator-modal.scss +1 -0
- package/src/logo-generator/components/generator-modal.tsx +15 -15
- package/src/logo-generator/components/history-carousel.tsx +2 -2
- package/src/logo-generator/components/logo-presenter.scss +1 -0
- package/src/logo-generator/components/logo-presenter.tsx +12 -12
- package/src/logo-generator/components/prompt.scss +1 -0
- package/src/logo-generator/components/prompt.tsx +9 -9
- package/src/logo-generator/components/upgrade-nudge.tsx +3 -3
- package/src/logo-generator/components/upgrade-screen.tsx +2 -2
- package/src/logo-generator/hooks/use-checkout.ts +2 -2
- package/src/logo-generator/hooks/use-fair-usage-notice-message.tsx +2 -2
- package/src/logo-generator/hooks/use-logo-generator.ts +11 -11
- package/src/logo-generator/hooks/use-request-errors.ts +2 -2
- package/src/logo-generator/index.ts +2 -2
- package/src/logo-generator/lib/logo-storage.ts +3 -3
- package/src/logo-generator/lib/media-exists.ts +2 -2
- package/src/logo-generator/lib/set-site-logo.ts +2 -2
- package/src/logo-generator/lib/wpcom-limited-request.ts +1 -1
- package/src/logo-generator/store/actions.ts +5 -5
- package/src/logo-generator/store/index.ts +3 -3
- package/src/logo-generator/store/initial-state.ts +2 -2
- package/src/logo-generator/store/reducer.ts +5 -5
- package/src/logo-generator/store/selectors.ts +3 -3
- package/src/logo-generator/store/types.ts +2 -2
- package/src/logo-generator/types.ts +1 -1
- package/src/suggestions-event-source/index.ts +4 -4
- package/src/types.ts +8 -8
|
@@ -6,11 +6,11 @@ declare const useRequestErrors: () => {
|
|
|
6
6
|
setSaveToLibraryError: any;
|
|
7
7
|
setLogoUpdateError: any;
|
|
8
8
|
clearErrors: () => void;
|
|
9
|
-
featureFetchError: import("../store/types.
|
|
10
|
-
firstLogoPromptFetchError: import("../store/types.
|
|
11
|
-
enhancePromptFetchError: import("../store/types.
|
|
12
|
-
logoFetchError: import("../store/types.
|
|
13
|
-
saveToLibraryError: import("../store/types.
|
|
14
|
-
logoUpdateError: import("../store/types.
|
|
9
|
+
featureFetchError: import("../store/types.ts").RequestError;
|
|
10
|
+
firstLogoPromptFetchError: import("../store/types.ts").RequestError;
|
|
11
|
+
enhancePromptFetchError: import("../store/types.ts").RequestError;
|
|
12
|
+
logoFetchError: import("../store/types.ts").RequestError;
|
|
13
|
+
saveToLibraryError: import("../store/types.ts").RequestError;
|
|
14
|
+
logoUpdateError: import("../store/types.ts").RequestError;
|
|
15
15
|
};
|
|
16
16
|
export default useRequestErrors;
|
|
@@ -5,7 +5,7 @@ import { useDispatch, useSelect } from '@wordpress/data';
|
|
|
5
5
|
/**
|
|
6
6
|
* Internal dependencies
|
|
7
7
|
*/
|
|
8
|
-
import { STORE_NAME } from
|
|
8
|
+
import { STORE_NAME } from "../store/index.js";
|
|
9
9
|
const useRequestErrors = () => {
|
|
10
10
|
const { setFeatureFetchError, setFirstLogoPromptFetchError, setEnhancePromptFetchError, setLogoFetchError, setSaveToLibraryError, setLogoUpdateError, } = useDispatch(STORE_NAME);
|
|
11
11
|
const { featureFetchError, firstLogoPromptFetchError, enhancePromptFetchError, logoFetchError, saveToLibraryError, logoUpdateError, } = useSelect(select => {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './components/generator-modal.
|
|
2
|
-
export { AiModalPromptInput } from './components/prompt.
|
|
1
|
+
export * from './components/generator-modal.tsx';
|
|
2
|
+
export { AiModalPromptInput } from './components/prompt.tsx';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export { AiModalPromptInput } from
|
|
1
|
+
export * from "./components/generator-modal.js";
|
|
2
|
+
export { AiModalPromptInput } from "./components/prompt.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Types
|
|
3
3
|
*/
|
|
4
|
-
import { Logo } from '../store/types.
|
|
5
|
-
import { RemoveFromStorageProps, SaveToStorageProps, UpdateInStorageProps } from '../types.
|
|
4
|
+
import { Logo } from '../store/types.ts';
|
|
5
|
+
import { RemoveFromStorageProps, SaveToStorageProps, UpdateInStorageProps } from '../types.ts';
|
|
6
6
|
/**
|
|
7
7
|
* Add an entry to the site's logo history.
|
|
8
8
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { AiFeatureProps, AiAssistantFeatureEndpointResponseProps, Logo, RequestError } from './types.
|
|
2
|
-
import type { SiteDetails } from '../types.
|
|
1
|
+
import type { AiFeatureProps, AiAssistantFeatureEndpointResponseProps, Logo, RequestError } from './types.ts';
|
|
2
|
+
import type { SiteDetails } from '../types.ts';
|
|
3
3
|
/**
|
|
4
4
|
* Map the response from the `sites/$site/ai-assistant-feature`
|
|
5
5
|
* endpoint to the AI Assistant feature props.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Internal dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { getSiteLogoHistory } from
|
|
5
|
-
import wpcomLimitedRequest from
|
|
4
|
+
import { getSiteLogoHistory } from "../lib/logo-storage.js";
|
|
5
|
+
import wpcomLimitedRequest from "../lib/wpcom-limited-request.js";
|
|
6
6
|
/**
|
|
7
7
|
* Types & Constants
|
|
8
8
|
*/
|
|
9
|
-
import { ACTION_INCREASE_AI_ASSISTANT_REQUESTS_COUNT, ACTION_REQUEST_AI_ASSISTANT_FEATURE, ACTION_SET_AI_ASSISTANT_FEATURE_REQUIRE_UPGRADE, ACTION_SET_SITE_DETAILS, ACTION_STORE_AI_ASSISTANT_FEATURE, ACTION_SET_TIER_PLANS_ENABLED, ACTION_SET_SELECTED_LOGO_INDEX, ACTION_ADD_LOGO_TO_HISTORY, ACTION_SET_IS_SAVING_LOGO_TO_LIBRARY, ACTION_SAVE_SELECTED_LOGO, ACTION_SET_IS_REQUESTING_IMAGE, ACTION_SET_IS_APPLYING_LOGO, ACTION_SET_IS_ENHANCING_PROMPT, ACTION_SET_SITE_HISTORY, ACTION_SET_FEATURE_FETCH_ERROR, ACTION_SET_FIRST_LOGO_PROMPT_FETCH_ERROR, ACTION_SET_ENHANCE_PROMPT_FETCH_ERROR, ACTION_SET_LOGO_FETCH_ERROR, ACTION_SET_LOGO_UPDATE_ERROR, ACTION_SET_SAVE_TO_LIBRARY_ERROR, ACTION_SET_CONTEXT, ACTION_SET_IS_LOADING_HISTORY, } from
|
|
9
|
+
import { ACTION_INCREASE_AI_ASSISTANT_REQUESTS_COUNT, ACTION_REQUEST_AI_ASSISTANT_FEATURE, ACTION_SET_AI_ASSISTANT_FEATURE_REQUIRE_UPGRADE, ACTION_SET_SITE_DETAILS, ACTION_STORE_AI_ASSISTANT_FEATURE, ACTION_SET_TIER_PLANS_ENABLED, ACTION_SET_SELECTED_LOGO_INDEX, ACTION_ADD_LOGO_TO_HISTORY, ACTION_SET_IS_SAVING_LOGO_TO_LIBRARY, ACTION_SAVE_SELECTED_LOGO, ACTION_SET_IS_REQUESTING_IMAGE, ACTION_SET_IS_APPLYING_LOGO, ACTION_SET_IS_ENHANCING_PROMPT, ACTION_SET_SITE_HISTORY, ACTION_SET_FEATURE_FETCH_ERROR, ACTION_SET_FIRST_LOGO_PROMPT_FETCH_ERROR, ACTION_SET_ENHANCE_PROMPT_FETCH_ERROR, ACTION_SET_LOGO_FETCH_ERROR, ACTION_SET_LOGO_UPDATE_ERROR, ACTION_SET_SAVE_TO_LIBRARY_ERROR, ACTION_SET_CONTEXT, ACTION_SET_IS_LOADING_HISTORY, } from "./constants.js";
|
|
10
10
|
/**
|
|
11
11
|
* Map the response from the `sites/$site/ai-assistant-feature`
|
|
12
12
|
* endpoint to the AI Assistant feature props.
|
|
@@ -5,9 +5,9 @@ import { createReduxStore, register } from '@wordpress/data';
|
|
|
5
5
|
/**
|
|
6
6
|
* Internal dependencies
|
|
7
7
|
*/
|
|
8
|
-
import actions from
|
|
9
|
-
import reducer from
|
|
10
|
-
import selectors from
|
|
8
|
+
import actions from "./actions.js";
|
|
9
|
+
import reducer from "./reducer.js";
|
|
10
|
+
import selectors from "./selectors.js";
|
|
11
11
|
export const STORE_NAME = 'jetpack-ai/logo-generator';
|
|
12
12
|
const jetpackAiLogoGeneratorStore = createReduxStore(STORE_NAME, {
|
|
13
13
|
// @ts-expect-error -- TSCONVERSION
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Types & Constants
|
|
3
3
|
*/
|
|
4
|
-
import { ASYNC_REQUEST_COUNTDOWN_INIT_VALUE, FREE_PLAN_REQUESTS_LIMIT } from
|
|
4
|
+
import { ASYNC_REQUEST_COUNTDOWN_INIT_VALUE, FREE_PLAN_REQUESTS_LIMIT } from "./constants.js";
|
|
5
5
|
const INITIAL_STATE = {
|
|
6
6
|
siteDetails: {},
|
|
7
7
|
features: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { AiFeatureStateProps, RequestError } from './types.
|
|
2
|
-
import type { SiteDetails } from '../types.
|
|
1
|
+
import type { AiFeatureStateProps, RequestError } from './types.ts';
|
|
2
|
+
import type { SiteDetails } from '../types.ts';
|
|
3
3
|
/**
|
|
4
4
|
* Reducer for the Logo Generator store.
|
|
5
5
|
*
|
|
@@ -27,7 +27,7 @@ import type { SiteDetails } from '../types.js';
|
|
|
27
27
|
* @param {boolean} action.isLoadingHistory - Whether the history is being loaded
|
|
28
28
|
* @return {LogoGeneratorStateProp} The new state
|
|
29
29
|
*/
|
|
30
|
-
export default function reducer(state: import("./types.
|
|
30
|
+
export default function reducer(state: import("./types.ts").LogoGeneratorStateProp, action: {
|
|
31
31
|
type: string;
|
|
32
32
|
feature?: AiFeatureStateProps;
|
|
33
33
|
count?: number;
|
|
@@ -70,16 +70,16 @@ export default function reducer(state: import("./types.js").LogoGeneratorStatePr
|
|
|
70
70
|
requestsLimit: number;
|
|
71
71
|
errorMessage?: string;
|
|
72
72
|
errorCode?: string;
|
|
73
|
-
upgradeType: import("./types.
|
|
74
|
-
currentTier?: import("./types.
|
|
75
|
-
nextTier?: import("./types.
|
|
73
|
+
upgradeType: import("./types.ts").UpgradeTypeProp;
|
|
74
|
+
currentTier?: import("./types.ts").TierProp;
|
|
75
|
+
nextTier?: import("./types.ts").TierProp | null;
|
|
76
76
|
tierPlansEnabled?: boolean;
|
|
77
77
|
costs?: {
|
|
78
|
-
|
|
78
|
+
"jetpack-ai-logo-generator": {
|
|
79
79
|
logo: number;
|
|
80
80
|
};
|
|
81
81
|
};
|
|
82
|
-
featuresControl?: import("./types.
|
|
82
|
+
featuresControl?: import("./types.ts").FeaturesControl;
|
|
83
83
|
_meta?: {
|
|
84
84
|
isRequesting: boolean;
|
|
85
85
|
asyncRequestCountdown: number;
|
|
@@ -103,7 +103,7 @@ export default function reducer(state: import("./types.js").LogoGeneratorStatePr
|
|
|
103
103
|
isLoadingHistory: boolean;
|
|
104
104
|
};
|
|
105
105
|
siteDetails?: SiteDetails | Record<string, never>;
|
|
106
|
-
history: import("./types.
|
|
106
|
+
history: Array<import("./types.ts").Logo>;
|
|
107
107
|
selectedLogoIndex: number;
|
|
108
108
|
} | {
|
|
109
109
|
history: {
|
|
@@ -148,7 +148,7 @@ export default function reducer(state: import("./types.js").LogoGeneratorStatePr
|
|
|
148
148
|
features: {
|
|
149
149
|
aiAssistantFeature?: AiFeatureStateProps;
|
|
150
150
|
};
|
|
151
|
-
history: import("./types.
|
|
151
|
+
history: Array<import("./types.ts").Logo>;
|
|
152
152
|
selectedLogoIndex: number;
|
|
153
153
|
} | {
|
|
154
154
|
_meta: {
|
|
@@ -169,7 +169,7 @@ export default function reducer(state: import("./types.js").LogoGeneratorStatePr
|
|
|
169
169
|
features: {
|
|
170
170
|
aiAssistantFeature?: AiFeatureStateProps;
|
|
171
171
|
};
|
|
172
|
-
history: import("./types.
|
|
172
|
+
history: Array<import("./types.ts").Logo>;
|
|
173
173
|
selectedLogoIndex: number;
|
|
174
174
|
} | {
|
|
175
175
|
_meta: {
|
|
@@ -190,7 +190,7 @@ export default function reducer(state: import("./types.js").LogoGeneratorStatePr
|
|
|
190
190
|
features: {
|
|
191
191
|
aiAssistantFeature?: AiFeatureStateProps;
|
|
192
192
|
};
|
|
193
|
-
history: import("./types.
|
|
193
|
+
history: Array<import("./types.ts").Logo>;
|
|
194
194
|
selectedLogoIndex: number;
|
|
195
195
|
} | {
|
|
196
196
|
_meta: {
|
|
@@ -211,7 +211,7 @@ export default function reducer(state: import("./types.js").LogoGeneratorStatePr
|
|
|
211
211
|
features: {
|
|
212
212
|
aiAssistantFeature?: AiFeatureStateProps;
|
|
213
213
|
};
|
|
214
|
-
history: import("./types.
|
|
214
|
+
history: Array<import("./types.ts").Logo>;
|
|
215
215
|
selectedLogoIndex: number;
|
|
216
216
|
} | {
|
|
217
217
|
features: {
|
|
@@ -229,21 +229,21 @@ export default function reducer(state: import("./types.js").LogoGeneratorStatePr
|
|
|
229
229
|
requireUpgrade: boolean;
|
|
230
230
|
errorMessage?: string;
|
|
231
231
|
errorCode?: string;
|
|
232
|
-
upgradeType: import("./types.
|
|
233
|
-
currentTier?: import("./types.
|
|
232
|
+
upgradeType: import("./types.ts").UpgradeTypeProp;
|
|
233
|
+
currentTier?: import("./types.ts").TierProp;
|
|
234
234
|
usagePeriod?: {
|
|
235
235
|
currentStart: string;
|
|
236
236
|
nextStart: string;
|
|
237
237
|
requestsCount: number;
|
|
238
238
|
};
|
|
239
|
-
nextTier?: import("./types.
|
|
239
|
+
nextTier?: import("./types.ts").TierProp | null;
|
|
240
240
|
tierPlansEnabled?: boolean;
|
|
241
241
|
costs?: {
|
|
242
|
-
|
|
242
|
+
"jetpack-ai-logo-generator": {
|
|
243
243
|
logo: number;
|
|
244
244
|
};
|
|
245
245
|
};
|
|
246
|
-
featuresControl?: import("./types.
|
|
246
|
+
featuresControl?: import("./types.ts").FeaturesControl;
|
|
247
247
|
};
|
|
248
248
|
};
|
|
249
249
|
_meta: {
|
|
@@ -261,7 +261,7 @@ export default function reducer(state: import("./types.js").LogoGeneratorStatePr
|
|
|
261
261
|
isLoadingHistory?: boolean;
|
|
262
262
|
};
|
|
263
263
|
siteDetails?: SiteDetails | Record<string, never>;
|
|
264
|
-
history: import("./types.
|
|
264
|
+
history: Array<import("./types.ts").Logo>;
|
|
265
265
|
selectedLogoIndex: number;
|
|
266
266
|
} | {
|
|
267
267
|
_meta: {
|
|
@@ -282,7 +282,7 @@ export default function reducer(state: import("./types.js").LogoGeneratorStatePr
|
|
|
282
282
|
features: {
|
|
283
283
|
aiAssistantFeature?: AiFeatureStateProps;
|
|
284
284
|
};
|
|
285
|
-
history: import("./types.
|
|
285
|
+
history: Array<import("./types.ts").Logo>;
|
|
286
286
|
selectedLogoIndex: number;
|
|
287
287
|
} | {
|
|
288
288
|
_meta: {
|
|
@@ -303,7 +303,7 @@ export default function reducer(state: import("./types.js").LogoGeneratorStatePr
|
|
|
303
303
|
features: {
|
|
304
304
|
aiAssistantFeature?: AiFeatureStateProps;
|
|
305
305
|
};
|
|
306
|
-
history: import("./types.
|
|
306
|
+
history: Array<import("./types.ts").Logo>;
|
|
307
307
|
selectedLogoIndex: number;
|
|
308
308
|
} | {
|
|
309
309
|
_meta: {
|
|
@@ -324,7 +324,7 @@ export default function reducer(state: import("./types.js").LogoGeneratorStatePr
|
|
|
324
324
|
features: {
|
|
325
325
|
aiAssistantFeature?: AiFeatureStateProps;
|
|
326
326
|
};
|
|
327
|
-
history: import("./types.
|
|
327
|
+
history: Array<import("./types.ts").Logo>;
|
|
328
328
|
selectedLogoIndex: number;
|
|
329
329
|
} | {
|
|
330
330
|
_meta: {
|
|
@@ -345,7 +345,7 @@ export default function reducer(state: import("./types.js").LogoGeneratorStatePr
|
|
|
345
345
|
features: {
|
|
346
346
|
aiAssistantFeature?: AiFeatureStateProps;
|
|
347
347
|
};
|
|
348
|
-
history: import("./types.
|
|
348
|
+
history: Array<import("./types.ts").Logo>;
|
|
349
349
|
selectedLogoIndex: number;
|
|
350
350
|
} | {
|
|
351
351
|
_meta: {
|
|
@@ -366,7 +366,7 @@ export default function reducer(state: import("./types.js").LogoGeneratorStatePr
|
|
|
366
366
|
features: {
|
|
367
367
|
aiAssistantFeature?: AiFeatureStateProps;
|
|
368
368
|
};
|
|
369
|
-
history: import("./types.
|
|
369
|
+
history: Array<import("./types.ts").Logo>;
|
|
370
370
|
selectedLogoIndex: number;
|
|
371
371
|
} | {
|
|
372
372
|
_meta: {
|
|
@@ -387,7 +387,7 @@ export default function reducer(state: import("./types.js").LogoGeneratorStatePr
|
|
|
387
387
|
features: {
|
|
388
388
|
aiAssistantFeature?: AiFeatureStateProps;
|
|
389
389
|
};
|
|
390
|
-
history: import("./types.
|
|
390
|
+
history: Array<import("./types.ts").Logo>;
|
|
391
391
|
selectedLogoIndex: number;
|
|
392
392
|
} | {
|
|
393
393
|
_meta: {
|
|
@@ -408,6 +408,6 @@ export default function reducer(state: import("./types.js").LogoGeneratorStatePr
|
|
|
408
408
|
features: {
|
|
409
409
|
aiAssistantFeature?: AiFeatureStateProps;
|
|
410
410
|
};
|
|
411
|
-
history: import("./types.
|
|
411
|
+
history: Array<import("./types.ts").Logo>;
|
|
412
412
|
selectedLogoIndex: number;
|
|
413
413
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Types & Constants
|
|
3
3
|
*/
|
|
4
|
-
import { DEFAULT_LOGO_COST } from
|
|
5
|
-
import { ACTION_INCREASE_AI_ASSISTANT_REQUESTS_COUNT, ACTION_REQUEST_AI_ASSISTANT_FEATURE, ACTION_SET_AI_ASSISTANT_FEATURE_REQUIRE_UPGRADE, ACTION_STORE_AI_ASSISTANT_FEATURE, ASYNC_REQUEST_COUNTDOWN_INIT_VALUE, FREE_PLAN_REQUESTS_LIMIT, UNLIMITED_PLAN_REQUESTS_LIMIT, ACTION_SET_TIER_PLANS_ENABLED, ACTION_SET_SITE_DETAILS, ACTION_SET_SELECTED_LOGO_INDEX, ACTION_ADD_LOGO_TO_HISTORY, ACTION_SAVE_SELECTED_LOGO, ACTION_SET_IS_SAVING_LOGO_TO_LIBRARY, ACTION_SET_IS_REQUESTING_IMAGE, ACTION_SET_IS_APPLYING_LOGO, ACTION_SET_IS_ENHANCING_PROMPT, ACTION_SET_SITE_HISTORY, ACTION_SET_FEATURE_FETCH_ERROR, ACTION_SET_FIRST_LOGO_PROMPT_FETCH_ERROR, ACTION_SET_ENHANCE_PROMPT_FETCH_ERROR, ACTION_SET_LOGO_FETCH_ERROR, ACTION_SET_SAVE_TO_LIBRARY_ERROR, ACTION_SET_LOGO_UPDATE_ERROR, ACTION_SET_CONTEXT, ACTION_SET_IS_LOADING_HISTORY, } from
|
|
6
|
-
import INITIAL_STATE from
|
|
4
|
+
import { DEFAULT_LOGO_COST } from "../constants.js";
|
|
5
|
+
import { ACTION_INCREASE_AI_ASSISTANT_REQUESTS_COUNT, ACTION_REQUEST_AI_ASSISTANT_FEATURE, ACTION_SET_AI_ASSISTANT_FEATURE_REQUIRE_UPGRADE, ACTION_STORE_AI_ASSISTANT_FEATURE, ASYNC_REQUEST_COUNTDOWN_INIT_VALUE, FREE_PLAN_REQUESTS_LIMIT, UNLIMITED_PLAN_REQUESTS_LIMIT, ACTION_SET_TIER_PLANS_ENABLED, ACTION_SET_SITE_DETAILS, ACTION_SET_SELECTED_LOGO_INDEX, ACTION_ADD_LOGO_TO_HISTORY, ACTION_SAVE_SELECTED_LOGO, ACTION_SET_IS_SAVING_LOGO_TO_LIBRARY, ACTION_SET_IS_REQUESTING_IMAGE, ACTION_SET_IS_APPLYING_LOGO, ACTION_SET_IS_ENHANCING_PROMPT, ACTION_SET_SITE_HISTORY, ACTION_SET_FEATURE_FETCH_ERROR, ACTION_SET_FIRST_LOGO_PROMPT_FETCH_ERROR, ACTION_SET_ENHANCE_PROMPT_FETCH_ERROR, ACTION_SET_LOGO_FETCH_ERROR, ACTION_SET_SAVE_TO_LIBRARY_ERROR, ACTION_SET_LOGO_UPDATE_ERROR, ACTION_SET_CONTEXT, ACTION_SET_IS_LOADING_HISTORY, } from "./constants.js";
|
|
6
|
+
import INITIAL_STATE from "./initial-state.js";
|
|
7
7
|
/**
|
|
8
8
|
* Reducer for the Logo Generator store.
|
|
9
9
|
*
|
|
@@ -48,7 +48,7 @@ export default function reducer(state = INITIAL_STATE, action) {
|
|
|
48
48
|
_meta: {
|
|
49
49
|
...state?.features?.aiAssistantFeature?._meta,
|
|
50
50
|
isRequesting: true,
|
|
51
|
-
asyncRequestCountdown: ASYNC_REQUEST_COUNTDOWN_INIT_VALUE,
|
|
51
|
+
asyncRequestCountdown: ASYNC_REQUEST_COUNTDOWN_INIT_VALUE, // restore the countdown
|
|
52
52
|
asyncRequestTimerId: 0, // reset the timer id
|
|
53
53
|
},
|
|
54
54
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { AiFeatureProps, LogoGeneratorStateProp, Logo, RequestError } from './types.
|
|
2
|
-
import type { SiteDetails } from '../types.
|
|
1
|
+
import type { AiFeatureProps, LogoGeneratorStateProp, Logo, RequestError } from './types.ts';
|
|
2
|
+
import type { SiteDetails } from '../types.ts';
|
|
3
3
|
declare const selectors: {
|
|
4
4
|
/**
|
|
5
5
|
* Return the AI Assistant feature.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ImageStyleObject } from '../../hooks/use-image-generator/constants.
|
|
2
|
-
import type { SiteDetails } from '../types.
|
|
1
|
+
import type { ImageStyleObject } from '../../hooks/use-image-generator/constants.ts';
|
|
2
|
+
import type { SiteDetails } from '../types.ts';
|
|
3
3
|
/**
|
|
4
4
|
* Types for the AI Assistant feature.
|
|
5
5
|
*/
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { EventSourceMessage } from '@microsoft/fetch-event-source';
|
|
5
|
-
import type { AiModelTypeProp, PromptProp } from '../types.
|
|
5
|
+
import type { AiModelTypeProp, PromptProp } from '../types.ts';
|
|
6
6
|
type SuggestionsEventSourceConstructorArgs = {
|
|
7
7
|
url?: string;
|
|
8
8
|
question: PromptProp;
|
|
@@ -6,12 +6,12 @@ import debugFactory from 'debug';
|
|
|
6
6
|
/**
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
|
-
import { getErrorData } from
|
|
10
|
-
import requestJwt from
|
|
9
|
+
import { getErrorData } from "../hooks/use-ai-suggestions/index.js";
|
|
10
|
+
import requestJwt from "../jwt/index.js";
|
|
11
11
|
/*
|
|
12
12
|
* Types & constants
|
|
13
13
|
*/
|
|
14
|
-
import { ERROR_CONTEXT_TOO_LARGE, ERROR_MODERATION, ERROR_NETWORK, ERROR_QUOTA_EXCEEDED, ERROR_RESPONSE, ERROR_SERVICE_UNAVAILABLE, ERROR_UNCLEAR_PROMPT, } from
|
|
14
|
+
import { ERROR_CONTEXT_TOO_LARGE, ERROR_MODERATION, ERROR_NETWORK, ERROR_QUOTA_EXCEEDED, ERROR_RESPONSE, ERROR_SERVICE_UNAVAILABLE, ERROR_UNCLEAR_PROMPT, } from "../types.js";
|
|
15
15
|
const debug = debugFactory('jetpack-ai-client:suggestions-event-source');
|
|
16
16
|
/**
|
|
17
17
|
* SuggestionsEventSource is a wrapper around EvenTarget that emits
|
package/build/types.d.ts
CHANGED
|
@@ -19,18 +19,18 @@ export type PromptItemProps = {
|
|
|
19
19
|
};
|
|
20
20
|
export type PromptMessagesProp = Array<PromptItemProps>;
|
|
21
21
|
export type PromptProp = PromptMessagesProp | string;
|
|
22
|
-
export type { UseAiContextOptions } from './data-flow/use-ai-context.
|
|
23
|
-
export type { RequestingErrorProps } from './hooks/use-ai-suggestions/index.
|
|
24
|
-
export type { UseAudioTranscriptionProps, UseAudioTranscriptionReturn, } from './hooks/use-audio-transcription/index.
|
|
25
|
-
export type { UseTranscriptionPostProcessingProps, UseTranscriptionPostProcessingReturn, PostProcessingAction, } from './hooks/use-transcription-post-processing/index.
|
|
26
|
-
export type { UseAudioValidationReturn, ValidatedAudioInformation, } from './hooks/use-audio-validation/index.
|
|
27
|
-
export { TRANSCRIPTION_POST_PROCESSING_ACTION_SIMPLE_DRAFT } from './hooks/use-transcription-post-processing/index.
|
|
22
|
+
export type { UseAiContextOptions } from './data-flow/use-ai-context.ts';
|
|
23
|
+
export type { RequestingErrorProps } from './hooks/use-ai-suggestions/index.ts';
|
|
24
|
+
export type { UseAudioTranscriptionProps, UseAudioTranscriptionReturn, } from './hooks/use-audio-transcription/index.ts';
|
|
25
|
+
export type { UseTranscriptionPostProcessingProps, UseTranscriptionPostProcessingReturn, PostProcessingAction, } from './hooks/use-transcription-post-processing/index.ts';
|
|
26
|
+
export type { UseAudioValidationReturn, ValidatedAudioInformation, } from './hooks/use-audio-validation/index.ts';
|
|
27
|
+
export { TRANSCRIPTION_POST_PROCESSING_ACTION_SIMPLE_DRAFT } from './hooks/use-transcription-post-processing/index.ts';
|
|
28
28
|
export declare const REQUESTING_STATES: readonly ["init", "requesting", "suggesting", "done", "error"];
|
|
29
29
|
export type RequestingStateProp = (typeof REQUESTING_STATES)[number];
|
|
30
30
|
export declare const AI_MODEL_GPT_3_5_Turbo_16K: "gpt-3.5-turbo-16k";
|
|
31
31
|
export declare const AI_MODEL_GPT_4: "gpt-4";
|
|
32
32
|
export type AiModelTypeProp = typeof AI_MODEL_GPT_3_5_Turbo_16K | typeof AI_MODEL_GPT_4;
|
|
33
|
-
export type { RecordingState } from './hooks/use-media-recording/index.
|
|
33
|
+
export type { RecordingState } from './hooks/use-media-recording/index.ts';
|
|
34
34
|
export type CancelablePromise<T = void> = Promise<T> & {
|
|
35
35
|
canceled?: boolean;
|
|
36
36
|
};
|
|
@@ -45,7 +45,7 @@ export type Block = {
|
|
|
45
45
|
originalContent?: string;
|
|
46
46
|
};
|
|
47
47
|
export type TranscriptionState = RecordingState | 'validating' | 'processing' | 'error';
|
|
48
|
-
export type { RenderHTMLRules } from './libs/index.
|
|
48
|
+
export type { RenderHTMLRules } from './libs/index.ts';
|
|
49
49
|
export interface BlockEditorStore {
|
|
50
50
|
selectors: {
|
|
51
51
|
[key in keyof typeof BlockEditorSelectors]: (typeof BlockEditorSelectors)[key];
|
package/build/types.js
CHANGED
|
@@ -12,7 +12,7 @@ export const ROLE_JETPACK_AI = 'jetpack-ai';
|
|
|
12
12
|
/*
|
|
13
13
|
* Hook constants
|
|
14
14
|
*/
|
|
15
|
-
export { TRANSCRIPTION_POST_PROCESSING_ACTION_SIMPLE_DRAFT } from
|
|
15
|
+
export { TRANSCRIPTION_POST_PROCESSING_ACTION_SIMPLE_DRAFT } from "./hooks/use-transcription-post-processing/index.js";
|
|
16
16
|
/*
|
|
17
17
|
* Requests types
|
|
18
18
|
*/
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"private": false,
|
|
3
3
|
"name": "@automattic/jetpack-ai-client",
|
|
4
|
-
"version": "0.27.
|
|
4
|
+
"version": "0.27.8",
|
|
5
5
|
"description": "A JS client for consuming Jetpack AI services",
|
|
6
6
|
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/ai-client/#readme",
|
|
7
7
|
"bugs": {
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"compile-ts": "tsc --pretty",
|
|
21
21
|
"test": "NODE_OPTIONS=--experimental-vm-modules jest",
|
|
22
22
|
"test-coverage": "pnpm run test --coverage",
|
|
23
|
+
"typecheck": "tsc --noEmit",
|
|
23
24
|
"watch": "tsc --watch --pretty"
|
|
24
25
|
},
|
|
25
26
|
"type": "module",
|
|
@@ -33,7 +34,7 @@
|
|
|
33
34
|
"jest": "^29.6.2",
|
|
34
35
|
"jest-environment-jsdom": "29.7.0",
|
|
35
36
|
"storybook": "8.6.7",
|
|
36
|
-
"typescript": "5.
|
|
37
|
+
"typescript": "5.8.2"
|
|
37
38
|
},
|
|
38
39
|
"exports": {
|
|
39
40
|
".": {
|
|
@@ -44,28 +45,28 @@
|
|
|
44
45
|
"main": "./build/index.js",
|
|
45
46
|
"types": "./build/index.d.ts",
|
|
46
47
|
"dependencies": {
|
|
47
|
-
"@automattic/jetpack-base-styles": "^0.
|
|
48
|
-
"@automattic/jetpack-components": "^0.72.
|
|
49
|
-
"@automattic/jetpack-connection": "^0.39.
|
|
50
|
-
"@automattic/jetpack-shared-extension-utils": "^0.
|
|
48
|
+
"@automattic/jetpack-base-styles": "^0.7.1",
|
|
49
|
+
"@automattic/jetpack-components": "^0.72.4",
|
|
50
|
+
"@automattic/jetpack-connection": "^0.39.11",
|
|
51
|
+
"@automattic/jetpack-shared-extension-utils": "^0.19.0",
|
|
51
52
|
"@microsoft/fetch-event-source": "2.0.1",
|
|
52
53
|
"@types/jest": "29.5.14",
|
|
53
54
|
"@types/react": "18.3.18",
|
|
54
55
|
"@types/wordpress__block-editor": "11.5.16",
|
|
55
|
-
"@wordpress/api-fetch": "7.
|
|
56
|
-
"@wordpress/base-styles": "5.
|
|
57
|
-
"@wordpress/blob": "4.
|
|
58
|
-
"@wordpress/blocks": "14.
|
|
59
|
-
"@wordpress/block-editor": "14.
|
|
60
|
-
"@wordpress/components": "29.
|
|
61
|
-
"@wordpress/compose": "7.
|
|
62
|
-
"@wordpress/data": "10.
|
|
63
|
-
"@wordpress/editor": "14.
|
|
64
|
-
"@wordpress/element": "6.
|
|
65
|
-
"@wordpress/i18n": "5.
|
|
66
|
-
"@wordpress/icons": "10.
|
|
67
|
-
"@wordpress/primitives": "4.
|
|
68
|
-
"@wordpress/url": "4.
|
|
56
|
+
"@wordpress/api-fetch": "7.21.0",
|
|
57
|
+
"@wordpress/base-styles": "5.21.0",
|
|
58
|
+
"@wordpress/blob": "4.21.0",
|
|
59
|
+
"@wordpress/blocks": "14.10.0",
|
|
60
|
+
"@wordpress/block-editor": "14.16.0",
|
|
61
|
+
"@wordpress/components": "29.7.0",
|
|
62
|
+
"@wordpress/compose": "7.21.0",
|
|
63
|
+
"@wordpress/data": "10.21.0",
|
|
64
|
+
"@wordpress/editor": "14.21.0",
|
|
65
|
+
"@wordpress/element": "6.21.0",
|
|
66
|
+
"@wordpress/i18n": "5.21.0",
|
|
67
|
+
"@wordpress/icons": "10.21.0",
|
|
68
|
+
"@wordpress/primitives": "4.21.0",
|
|
69
|
+
"@wordpress/url": "4.21.0",
|
|
69
70
|
"clsx": "2.1.1",
|
|
70
71
|
"debug": "4.4.0",
|
|
71
72
|
"markdown-it": "14.1.0",
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import debugFactory from 'debug';
|
|
5
|
-
import SuggestionsEventSource from '../suggestions-event-source/index.
|
|
5
|
+
import SuggestionsEventSource from '../suggestions-event-source/index.ts';
|
|
6
6
|
/*
|
|
7
7
|
* Types & constants
|
|
8
8
|
*/
|
|
9
|
-
import type { AiModelTypeProp, PromptProp } from '../types.
|
|
9
|
+
import type { AiModelTypeProp, PromptProp } from '../types.ts';
|
|
10
10
|
|
|
11
11
|
export type AskQuestionOptionsArgProps = {
|
|
12
12
|
/*
|
package/src/ask-question/sync.ts
CHANGED
|
@@ -5,9 +5,9 @@ import debugFactory from 'debug';
|
|
|
5
5
|
/*
|
|
6
6
|
* Types & constants
|
|
7
7
|
*/
|
|
8
|
-
import requestJwt from '../jwt/index.
|
|
9
|
-
import { AskQuestionOptionsArgProps } from './index.
|
|
10
|
-
import type { PromptProp } from '../types.
|
|
8
|
+
import requestJwt from '../jwt/index.ts';
|
|
9
|
+
import { AskQuestionOptionsArgProps } from './index.ts';
|
|
10
|
+
import type { PromptProp } from '../types.ts';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* The response data from the AI assistant when doing a sync, not-streamed question.
|
package/src/chrome-ai/factory.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getJetpackExtensionAvailability } from '@automattic/jetpack-shared-extension-utils';
|
|
2
|
-
import { PROMPT_TYPE_CHANGE_LANGUAGE, PROMPT_TYPE_SUMMARIZE } from '../constants.
|
|
3
|
-
import { PromptProp, PromptItemProps } from '../types.
|
|
4
|
-
import ChromeAISuggestionsEventSource from './suggestions.
|
|
2
|
+
import { PROMPT_TYPE_CHANGE_LANGUAGE, PROMPT_TYPE_SUMMARIZE } from '../constants.ts';
|
|
3
|
+
import { PromptProp, PromptItemProps } from '../types.ts';
|
|
4
|
+
import ChromeAISuggestionsEventSource from './suggestions.ts';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Check for the feature flag.
|
package/src/chrome-ai/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as ChromeAIFactory } from './factory.
|
|
2
|
-
export { default as ChromeAISuggestionsEventSource } from './suggestions.
|
|
1
|
+
export { default as ChromeAIFactory } from './factory.ts';
|
|
2
|
+
export { default as ChromeAISuggestionsEventSource } from './suggestions.ts';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { EventSourceMessage } from '@microsoft/fetch-event-source';
|
|
2
|
-
import { PROMPT_TYPE_CHANGE_LANGUAGE, PROMPT_TYPE_SUMMARIZE } from '../constants.
|
|
3
|
-
import { getErrorData } from '../hooks/use-ai-suggestions/index.
|
|
4
|
-
import { renderHTMLFromMarkdown, renderMarkdownFromHTML } from '../libs/markdown/index.
|
|
5
|
-
import { AiModelTypeProp, ERROR_RESPONSE, ERROR_NETWORK } from '../types.
|
|
2
|
+
import { PROMPT_TYPE_CHANGE_LANGUAGE, PROMPT_TYPE_SUMMARIZE } from '../constants.ts';
|
|
3
|
+
import { getErrorData } from '../hooks/use-ai-suggestions/index.ts';
|
|
4
|
+
import { renderHTMLFromMarkdown, renderMarkdownFromHTML } from '../libs/markdown/index.ts';
|
|
5
|
+
import { AiModelTypeProp, ERROR_RESPONSE, ERROR_NETWORK } from '../types.ts';
|
|
6
6
|
|
|
7
7
|
type ChromeAISuggestionsEventSourceConstructorArgs = {
|
|
8
8
|
content: string;
|