@blocklet/pages-kit 0.2.340 → 0.2.342
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/lib/cjs/builtin/async/ai-runtime/api/agent.js +3 -5
- package/lib/cjs/builtin/async/ai-runtime/api/message.js +2 -4
- package/lib/cjs/builtin/async/ai-runtime/api/request.js +5 -1
- package/lib/cjs/builtin/async/ai-runtime/api/{subscription.js → secret.js} +7 -15
- package/lib/cjs/builtin/async/ai-runtime/api/session.js +9 -10
- package/lib/cjs/builtin/async/ai-runtime/components/AgentErrorBoundary.js +27 -0
- package/lib/cjs/builtin/async/ai-runtime/components/AgentSettings/AgentSettingsDialog.js +80 -0
- package/lib/cjs/builtin/async/ai-runtime/components/PopperMenuButton/LoadingMenuItem.js +1 -1
- package/lib/cjs/builtin/async/ai-runtime/components/ShareActions/index.js +10 -10
- package/lib/cjs/builtin/async/ai-runtime/constants.js +2 -1
- package/lib/cjs/builtin/async/ai-runtime/contexts/CurrentAgent.js +2 -2
- package/lib/cjs/builtin/async/ai-runtime/contexts/Runtime.js +4 -3
- package/lib/cjs/builtin/async/ai-runtime/hooks/use-agent-admin.js +11 -0
- package/lib/cjs/builtin/async/ai-runtime/hooks/use-header-menu.js +10 -2
- package/lib/cjs/builtin/async/ai-runtime/locales/index.js +4 -0
- package/lib/cjs/builtin/async/ai-runtime/runtime/Runtime/index.js +5 -4
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/AutoForm/index.js +26 -57
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/ChatOutput/MessageItemView.js +10 -19
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/ChatOutput/index.js +2 -2
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/GoogleSearch/GoogleSearchRelatedQuestionsView.js +1 -1
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/PhotoGallery/index.js +3 -3
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/PhotoGalleryItem/index.js +5 -5
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleChat/MessageView.js +5 -4
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleChat/MessagesView.js +1 -1
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleChat/UserMessageView.js +2 -2
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleOutput/index.js +5 -4
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimplePage/index.js +2 -2
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/SuggestedQuestionsView/index.js +2 -2
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/Input.js +1 -1
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/Output.js +5 -5
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/Page.js +7 -7
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/components/CodePreview.js +8 -8
- package/lib/cjs/builtin/async/ai-runtime/state/agent.js +7 -8
- package/lib/cjs/builtin/async/ai-runtime/state/runtime.js +5 -5
- package/lib/cjs/builtin/async/ai-runtime/state/session.js +15 -17
- package/lib/cjs/builtin/page/header.js +3 -3
- package/lib/cjs/components/CustomComponentRenderer/index.js +1 -1
- package/lib/cjs/tsconfig.tsbuildinfo +1 -1
- package/lib/esm/builtin/async/ai-runtime/api/agent.js +4 -6
- package/lib/esm/builtin/async/ai-runtime/api/message.js +3 -5
- package/lib/esm/builtin/async/ai-runtime/api/request.js +3 -0
- package/lib/esm/builtin/async/ai-runtime/api/{subscription.js → secret.js} +7 -14
- package/lib/esm/builtin/async/ai-runtime/api/session.js +10 -11
- package/lib/esm/builtin/async/ai-runtime/components/AgentErrorBoundary.js +22 -0
- package/lib/esm/builtin/async/ai-runtime/components/AgentSettings/AgentSettingsDialog.js +76 -0
- package/lib/esm/builtin/async/ai-runtime/components/PopperMenuButton/LoadingMenuItem.js +1 -1
- package/lib/esm/builtin/async/ai-runtime/components/ShareActions/index.js +10 -10
- package/lib/esm/builtin/async/ai-runtime/constants.js +1 -0
- package/lib/esm/builtin/async/ai-runtime/contexts/CurrentAgent.js +2 -2
- package/lib/esm/builtin/async/ai-runtime/contexts/Runtime.js +4 -3
- package/lib/esm/builtin/async/ai-runtime/hooks/use-agent-admin.js +7 -0
- package/lib/esm/builtin/async/ai-runtime/hooks/use-header-menu.js +11 -3
- package/lib/esm/builtin/async/ai-runtime/locales/index.js +4 -0
- package/lib/esm/builtin/async/ai-runtime/runtime/Runtime/index.js +5 -4
- package/lib/esm/builtin/async/ai-runtime/runtime-components/AutoForm/index.js +27 -58
- package/lib/esm/builtin/async/ai-runtime/runtime-components/ChatOutput/MessageItemView.js +10 -19
- package/lib/esm/builtin/async/ai-runtime/runtime-components/ChatOutput/index.js +2 -2
- package/lib/esm/builtin/async/ai-runtime/runtime-components/GoogleSearch/GoogleSearchRelatedQuestionsView.js +1 -1
- package/lib/esm/builtin/async/ai-runtime/runtime-components/PhotoGallery/index.js +3 -3
- package/lib/esm/builtin/async/ai-runtime/runtime-components/PhotoGalleryItem/index.js +5 -5
- package/lib/esm/builtin/async/ai-runtime/runtime-components/SimpleChat/MessageView.js +5 -4
- package/lib/esm/builtin/async/ai-runtime/runtime-components/SimpleChat/MessagesView.js +1 -1
- package/lib/esm/builtin/async/ai-runtime/runtime-components/SimpleChat/UserMessageView.js +2 -2
- package/lib/esm/builtin/async/ai-runtime/runtime-components/SimpleOutput/index.js +5 -4
- package/lib/esm/builtin/async/ai-runtime/runtime-components/SimplePage/index.js +2 -2
- package/lib/esm/builtin/async/ai-runtime/runtime-components/SuggestedQuestionsView/index.js +2 -2
- package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/Input.js +1 -1
- package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/Output.js +5 -5
- package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/Page.js +7 -7
- package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/components/CodePreview.js +8 -8
- package/lib/esm/builtin/async/ai-runtime/state/agent.js +6 -6
- package/lib/esm/builtin/async/ai-runtime/state/runtime.js +5 -5
- package/lib/esm/builtin/async/ai-runtime/state/session.js +15 -17
- package/lib/esm/builtin/page/header.js +3 -3
- package/lib/esm/components/CustomComponentRenderer/BlockletReactComponentRenderer.js +1 -1
- package/lib/esm/components/CustomComponentRenderer/index.js +1 -1
- package/lib/esm/tsconfig.tsbuildinfo +1 -1
- package/lib/types/builtin/async/ai-runtime/api/agent.d.ts +10 -1
- package/lib/types/builtin/async/ai-runtime/api/message.d.ts +4 -15
- package/lib/types/builtin/async/ai-runtime/api/request.d.ts +1 -0
- package/lib/types/builtin/async/ai-runtime/api/secret.d.ts +12 -0
- package/lib/types/builtin/async/ai-runtime/api/session.d.ts +5 -8
- package/lib/types/builtin/async/ai-runtime/components/AgentErrorBoundary.d.ts +4 -0
- package/lib/types/builtin/async/ai-runtime/components/AgentSettings/AgentSettingsDialog.d.ts +10 -0
- package/lib/types/builtin/async/ai-runtime/constants.d.ts +1 -0
- package/lib/types/builtin/async/ai-runtime/contexts/Runtime.d.ts +3 -1
- package/lib/types/builtin/async/ai-runtime/hooks/use-agent-admin.d.ts +2 -0
- package/lib/types/builtin/async/ai-runtime/locales/index.d.ts +4 -0
- package/lib/types/builtin/async/ai-runtime/runtime/Runtime/index.d.ts +2 -1
- package/lib/types/builtin/async/ai-runtime/state/agent.d.ts +2 -6
- package/lib/types/builtin/async/ai-runtime/state/runtime.d.ts +2 -0
- package/lib/types/builtin/async/ai-runtime/state/session.d.ts +1 -0
- package/lib/types/builtin/page/header.d.ts +2 -2
- package/lib/types/components/CustomComponentRenderer/index.d.ts +3 -0
- package/lib/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
- package/lib/types/builtin/async/ai-runtime/api/subscription.d.ts +0 -15
|
@@ -31,8 +31,17 @@ export interface Agent {
|
|
|
31
31
|
};
|
|
32
32
|
};
|
|
33
33
|
};
|
|
34
|
+
config: {
|
|
35
|
+
secrets: {
|
|
36
|
+
targetProjectId: string;
|
|
37
|
+
targetAgentId: string;
|
|
38
|
+
targetInput: Parameter;
|
|
39
|
+
hasValue: boolean;
|
|
40
|
+
}[];
|
|
41
|
+
};
|
|
34
42
|
}
|
|
35
|
-
export declare function getAgent({ aid, working }: {
|
|
43
|
+
export declare function getAgent({ aid, blockletDid, working, }: {
|
|
36
44
|
aid: string;
|
|
45
|
+
blockletDid?: string;
|
|
37
46
|
working?: boolean;
|
|
38
47
|
}): Promise<Agent>;
|
|
@@ -1,27 +1,16 @@
|
|
|
1
|
-
import { ExecuteBlock, RuntimeOutputVariablesSchema } from '@blocklet/ai-runtime/types';
|
|
2
1
|
export interface Message {
|
|
3
2
|
id: string;
|
|
4
|
-
|
|
5
|
-
assistantId: string;
|
|
3
|
+
agentId: string;
|
|
6
4
|
sessionId: string;
|
|
7
5
|
createdAt: string;
|
|
8
6
|
updatedAt: string;
|
|
9
|
-
|
|
7
|
+
inputs?: {
|
|
10
8
|
[key: string]: any;
|
|
11
9
|
};
|
|
12
|
-
|
|
10
|
+
outputs?: {
|
|
13
11
|
content?: string;
|
|
14
|
-
images?: {
|
|
15
|
-
url: string;
|
|
16
|
-
}[];
|
|
17
|
-
messages?: {
|
|
18
|
-
taskId: string;
|
|
19
|
-
respondAs?: ExecuteBlock['respondAs'];
|
|
20
|
-
result?: Pick<NonNullable<Message['result']>, 'content' | 'images'>;
|
|
21
|
-
}[];
|
|
22
12
|
objects?: {
|
|
23
|
-
|
|
24
|
-
data: RuntimeOutputVariablesSchema;
|
|
13
|
+
[key: string]: any;
|
|
25
14
|
}[];
|
|
26
15
|
} | null;
|
|
27
16
|
error?: {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface CreateOrUpdateSecretsInput {
|
|
2
|
+
secrets: {
|
|
3
|
+
projectId: string;
|
|
4
|
+
targetProjectId: string;
|
|
5
|
+
targetAgentId: string;
|
|
6
|
+
targetInputKey: string;
|
|
7
|
+
secret: string;
|
|
8
|
+
}[];
|
|
9
|
+
}
|
|
10
|
+
export declare function createSecrets({ input }: {
|
|
11
|
+
input: CreateOrUpdateSecretsInput;
|
|
12
|
+
}): Promise<{}>;
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import { RunAssistantResponse } from '@blocklet/ai-runtime/types';
|
|
2
2
|
export interface Session {
|
|
3
3
|
id: string;
|
|
4
|
+
createdAt: string;
|
|
5
|
+
updatedAt: string;
|
|
4
6
|
name?: string;
|
|
5
7
|
userId: string;
|
|
6
8
|
projectId: string;
|
|
7
|
-
|
|
8
|
-
assistantId: string;
|
|
9
|
-
createdAt: string;
|
|
10
|
-
parameters?: any;
|
|
11
|
-
entry?: {
|
|
12
|
-
title?: string;
|
|
13
|
-
};
|
|
9
|
+
agentId: string;
|
|
14
10
|
}
|
|
15
11
|
export declare function getSessions({ aid }: {
|
|
16
12
|
aid: string;
|
|
@@ -45,9 +41,10 @@ export declare function deleteSession({ sessionId, }: {
|
|
|
45
41
|
deleted: Session;
|
|
46
42
|
sessions: Session[];
|
|
47
43
|
}>;
|
|
48
|
-
export declare function runAgent({ aid, sessionId, working, parameters, }: {
|
|
44
|
+
export declare function runAgent({ aid, sessionId, blockletDid, working, parameters, }: {
|
|
49
45
|
aid: string;
|
|
50
46
|
sessionId: string;
|
|
47
|
+
blockletDid?: string;
|
|
51
48
|
working?: boolean;
|
|
52
49
|
parameters: any;
|
|
53
50
|
}): AsyncGenerator<RunAssistantResponse, void, unknown>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DialogProps } from '@mui/material';
|
|
2
|
+
export interface SettingsDialogState {
|
|
3
|
+
isOpen: boolean;
|
|
4
|
+
open: () => void;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const settingsDialogState: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<SettingsDialogState>, "setState"> & {
|
|
8
|
+
setState(nextStateOrUpdater: SettingsDialogState | Partial<SettingsDialogState> | ((state: import("immer").WritableDraft<SettingsDialogState>) => void), shouldReplace?: boolean | undefined): void;
|
|
9
|
+
}>;
|
|
10
|
+
export default function AgentSettingsDialog({ ...props }: Omit<DialogProps, 'open'>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { OutputVariable } from '@blocklet/ai-runtime/types';
|
|
2
2
|
export declare const AI_STUDIO_DID = "z8iZpog7mcgcgBZzTiXJCWESvmnRrQmnd3XBB";
|
|
3
|
+
export declare const AI_RUNTIME_DID = "z2qa5vnwATPJyAnBYm7SbLMMjfeXJgeBKkfMG";
|
|
3
4
|
export declare const PAYMENT_KIT_DID = "z2qaCNvKMv5GjouKdcDWexv6WqtHbpNPQDnAk";
|
|
4
5
|
export declare const DEFAULT_PAGE_COMPONENT_ID = "ctnxha29uu8cx4xv";
|
|
5
6
|
export declare const DEFAULT_INPUT_COMPONENT_ID = "1wwtemqcdio6nqf0";
|
|
@@ -2,9 +2,11 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
export interface RuntimeContext {
|
|
3
3
|
aid: string;
|
|
4
4
|
working?: boolean;
|
|
5
|
+
blockletDid?: string;
|
|
5
6
|
}
|
|
6
7
|
export declare function useRuntimeContext(): RuntimeContext;
|
|
7
|
-
export default function RuntimeProvider({ aid, working, children, }: {
|
|
8
|
+
export default function RuntimeProvider({ blockletDid, aid, working, children, }: {
|
|
9
|
+
blockletDid?: string;
|
|
8
10
|
aid: string;
|
|
9
11
|
working?: boolean;
|
|
10
12
|
children?: ReactNode;
|
|
@@ -98,6 +98,8 @@ export declare const translations: {
|
|
|
98
98
|
retry: string;
|
|
99
99
|
errorCodeTip: string;
|
|
100
100
|
};
|
|
101
|
+
settings: string;
|
|
102
|
+
setup: string;
|
|
101
103
|
};
|
|
102
104
|
zh: {
|
|
103
105
|
by: string;
|
|
@@ -198,5 +200,7 @@ export declare const translations: {
|
|
|
198
200
|
retry: string;
|
|
199
201
|
errorCodeTip: string;
|
|
200
202
|
};
|
|
203
|
+
settings: string;
|
|
204
|
+
setup: string;
|
|
201
205
|
};
|
|
202
206
|
};
|
|
@@ -5,12 +5,8 @@ export interface AgentState {
|
|
|
5
5
|
error?: Error;
|
|
6
6
|
load: () => Promise<void>;
|
|
7
7
|
}
|
|
8
|
-
export declare
|
|
9
|
-
|
|
10
|
-
working?: boolean;
|
|
11
|
-
agent?: Agent;
|
|
12
|
-
}) => import("zustand").UseBoundStore<import("zustand").StoreApi<import("immer").WritableDraft<AgentState>>>;
|
|
13
|
-
export declare function useAgentState({ aid, working }: {
|
|
8
|
+
export declare function useAgentState({ blockletDid, aid, working, }: {
|
|
9
|
+
blockletDid?: string;
|
|
14
10
|
aid: string;
|
|
15
11
|
working?: boolean;
|
|
16
12
|
}): [Agent, AgentState];
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export declare function useRuntimeState(): {
|
|
2
|
+
blockletDid: string | undefined;
|
|
2
3
|
aid: string;
|
|
3
4
|
working: boolean | undefined;
|
|
4
5
|
agent: import("../api/agent").Agent;
|
|
5
6
|
execute: (options: {
|
|
7
|
+
blockletDid?: string | undefined;
|
|
6
8
|
sessionId?: string | undefined;
|
|
7
9
|
aid: string;
|
|
8
10
|
working?: boolean | undefined;
|
|
@@ -3,14 +3,14 @@ export interface HeaderWidgets {
|
|
|
3
3
|
logo?: any;
|
|
4
4
|
brand?: any;
|
|
5
5
|
description?: any;
|
|
6
|
-
addons?: (
|
|
6
|
+
addons?: (exists: any[]) => any[];
|
|
7
7
|
}
|
|
8
8
|
export type HeaderWidgetCreator = () => HeaderWidgets;
|
|
9
9
|
export interface HeaderState {
|
|
10
10
|
logo?: any;
|
|
11
11
|
brand?: any;
|
|
12
12
|
description?: any;
|
|
13
|
-
addons?: (
|
|
13
|
+
addons?: (exists: any[]) => any[];
|
|
14
14
|
stack: Set<HeaderWidgetCreator>;
|
|
15
15
|
add: (creator: HeaderWidgetCreator) => void;
|
|
16
16
|
delete: (creator: HeaderWidgetCreator) => void;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
import { ErrorBoundary } from 'react-error-boundary';
|
|
1
3
|
import { StateMode } from '../../types';
|
|
2
4
|
import { CustomComponent } from '../../types/core';
|
|
3
5
|
export * from './state';
|
|
@@ -24,5 +26,6 @@ export interface CustomComponentRendererProps {
|
|
|
24
26
|
};
|
|
25
27
|
dev?: CustomComponentRendererDevProps;
|
|
26
28
|
fallbackRender?: any;
|
|
29
|
+
ErrorBoundaryProps?: ComponentProps<typeof ErrorBoundary>;
|
|
27
30
|
}
|
|
28
31
|
export default function CustomComponentRenderer({ dev, ...props }: CustomComponentRendererProps): import("react/jsx-runtime").JSX.Element;
|