@aigne/core 0.0.3 → 0.0.5
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/index.js +1 -1
- package/lib/cjs/types/index.js +2 -4
- package/lib/esm/index.js +1 -1
- package/lib/esm/types/index.js +2 -4
- package/lib/types/index.d.ts +1 -1
- package/lib/types/types/agent.d.ts +5 -0
- package/lib/types/types/index.d.ts +2 -4
- package/lib/types/types/runnable.d.ts +22 -0
- package/package.json +3 -4
- package/lib/cjs/assistant/generate-output.js +0 -101
- package/lib/cjs/assistant/select-agent.js +0 -76
- package/lib/cjs/assistant/type.js +0 -11
- package/lib/cjs/common/aid.js +0 -42
- package/lib/cjs/common/index.js +0 -238
- package/lib/cjs/common/resource-manager.js +0 -199
- package/lib/cjs/constants.js +0 -9
- package/lib/cjs/executor/agent.js +0 -10
- package/lib/cjs/executor/aigc.js +0 -28
- package/lib/cjs/executor/api.js +0 -64
- package/lib/cjs/executor/base.js +0 -676
- package/lib/cjs/executor/blocklet.js +0 -25
- package/lib/cjs/executor/call-agent.js +0 -105
- package/lib/cjs/executor/decision.js +0 -478
- package/lib/cjs/executor/image-blender.js +0 -32
- package/lib/cjs/executor/index.js +0 -81
- package/lib/cjs/executor/llm.js +0 -379
- package/lib/cjs/executor/logic.js +0 -167
- package/lib/cjs/libs/blocklet/vc.js +0 -92
- package/lib/cjs/libs/openapi/request/index.js +0 -24
- package/lib/cjs/libs/openapi/request/util.js +0 -146
- package/lib/cjs/libs/openapi/types/index.js +0 -17
- package/lib/cjs/libs/openapi/util/call.js +0 -15
- package/lib/cjs/libs/openapi/util/check-schema.js +0 -67
- package/lib/cjs/libs/openapi/util/convert-schema.js +0 -44
- package/lib/cjs/libs/openapi/util/flatten-open-api.js +0 -21
- package/lib/cjs/libs/openapi/util/get-open-api-i18n-text.js +0 -7
- package/lib/cjs/runtime/resource-blocklet.js +0 -5
- package/lib/cjs/runtime/runtime.js +0 -143
- package/lib/cjs/types/assistant/index.js +0 -31
- package/lib/cjs/types/assistant/mustache/ReadableMustache.js +0 -69
- package/lib/cjs/types/assistant/mustache/directive.js +0 -35
- package/lib/cjs/types/assistant/mustache/mustache.js +0 -688
- package/lib/cjs/types/resource/index.js +0 -47
- package/lib/cjs/types/resource/project.js +0 -35
- package/lib/cjs/types/runtime/error.js +0 -18
- package/lib/cjs/types/runtime/index.js +0 -37
- package/lib/cjs/types/runtime/runtime-resource-blocklet-state.js +0 -4
- package/lib/cjs/types/runtime/schema.js +0 -259
- package/lib/cjs/utils/cron-job.js +0 -48
- package/lib/cjs/utils/extract-metadata-transform.js +0 -58
- package/lib/cjs/utils/extract-metadata-transform.test.js +0 -61
- package/lib/cjs/utils/fs.js +0 -49
- package/lib/cjs/utils/get-blocklet-agent.js +0 -351
- package/lib/cjs/utils/geti.js +0 -37
- package/lib/cjs/utils/is-non-nullable.js +0 -20
- package/lib/cjs/utils/render-message.js +0 -23
- package/lib/cjs/utils/resolve-secret-inputs.js +0 -49
- package/lib/cjs/utils/retry.js +0 -19
- package/lib/cjs/utils/task-id.js +0 -7
- package/lib/cjs/utils/tool-calls-transform.js +0 -18
- package/lib/esm/assistant/generate-output.js +0 -91
- package/lib/esm/assistant/select-agent.js +0 -71
- package/lib/esm/assistant/type.js +0 -7
- package/lib/esm/common/aid.js +0 -38
- package/lib/esm/common/index.js +0 -232
- package/lib/esm/common/resource-manager.js +0 -192
- package/lib/esm/constants.js +0 -6
- package/lib/esm/executor/agent.js +0 -6
- package/lib/esm/executor/aigc.js +0 -24
- package/lib/esm/executor/api.js +0 -34
- package/lib/esm/executor/base.js +0 -668
- package/lib/esm/executor/blocklet.js +0 -21
- package/lib/esm/executor/call-agent.js +0 -98
- package/lib/esm/executor/decision.js +0 -471
- package/lib/esm/executor/image-blender.js +0 -25
- package/lib/esm/executor/index.js +0 -74
- package/lib/esm/executor/llm.js +0 -372
- package/lib/esm/executor/logic.js +0 -160
- package/lib/esm/libs/blocklet/vc.js +0 -85
- package/lib/esm/libs/openapi/request/index.js +0 -20
- package/lib/esm/libs/openapi/request/util.js +0 -136
- package/lib/esm/libs/openapi/types/index.js +0 -1
- package/lib/esm/libs/openapi/util/call.js +0 -8
- package/lib/esm/libs/openapi/util/check-schema.js +0 -62
- package/lib/esm/libs/openapi/util/convert-schema.js +0 -42
- package/lib/esm/libs/openapi/util/flatten-open-api.js +0 -19
- package/lib/esm/libs/openapi/util/get-open-api-i18n-text.js +0 -5
- package/lib/esm/runtime/resource-blocklet.js +0 -2
- package/lib/esm/runtime/runtime.js +0 -136
- package/lib/esm/types/assistant/index.js +0 -9
- package/lib/esm/types/assistant/mustache/ReadableMustache.js +0 -63
- package/lib/esm/types/assistant/mustache/directive.js +0 -29
- package/lib/esm/types/assistant/mustache/mustache.js +0 -686
- package/lib/esm/types/resource/index.js +0 -26
- package/lib/esm/types/resource/project.js +0 -29
- package/lib/esm/types/runtime/error.js +0 -14
- package/lib/esm/types/runtime/index.js +0 -20
- package/lib/esm/types/runtime/runtime-resource-blocklet-state.js +0 -1
- package/lib/esm/types/runtime/schema.js +0 -249
- package/lib/esm/utils/cron-job.js +0 -44
- package/lib/esm/utils/extract-metadata-transform.js +0 -54
- package/lib/esm/utils/extract-metadata-transform.test.js +0 -59
- package/lib/esm/utils/fs.js +0 -41
- package/lib/esm/utils/get-blocklet-agent.js +0 -344
- package/lib/esm/utils/geti.js +0 -30
- package/lib/esm/utils/is-non-nullable.js +0 -13
- package/lib/esm/utils/render-message.js +0 -20
- package/lib/esm/utils/resolve-secret-inputs.js +0 -46
- package/lib/esm/utils/retry.js +0 -16
- package/lib/esm/utils/task-id.js +0 -3
- package/lib/esm/utils/tool-calls-transform.js +0 -15
- package/lib/types/assistant/generate-output.d.ts +0 -29
- package/lib/types/assistant/select-agent.d.ts +0 -14
- package/lib/types/assistant/type.d.ts +0 -61
- package/lib/types/common/aid.d.ts +0 -18
- package/lib/types/common/index.d.ts +0 -7
- package/lib/types/common/resource-manager.d.ts +0 -88
- package/lib/types/constants.d.ts +0 -6
- package/lib/types/executor/agent.d.ts +0 -5
- package/lib/types/executor/aigc.d.ts +0 -9
- package/lib/types/executor/api.d.ts +0 -9
- package/lib/types/executor/base.d.ts +0 -209
- package/lib/types/executor/blocklet.d.ts +0 -9
- package/lib/types/executor/call-agent.d.ts +0 -12
- package/lib/types/executor/decision.d.ts +0 -20
- package/lib/types/executor/image-blender.d.ts +0 -9
- package/lib/types/executor/index.d.ts +0 -8
- package/lib/types/executor/llm.d.ts +0 -38
- package/lib/types/executor/logic.d.ts +0 -9
- package/lib/types/libs/blocklet/vc.d.ts +0 -17
- package/lib/types/libs/openapi/request/index.d.ts +0 -17
- package/lib/types/libs/openapi/request/util.d.ts +0 -40
- package/lib/types/libs/openapi/types/index.d.ts +0 -20
- package/lib/types/libs/openapi/util/call.d.ts +0 -2
- package/lib/types/libs/openapi/util/check-schema.d.ts +0 -3
- package/lib/types/libs/openapi/util/convert-schema.d.ts +0 -8
- package/lib/types/libs/openapi/util/flatten-open-api.d.ts +0 -3
- package/lib/types/libs/openapi/util/get-open-api-i18n-text.d.ts +0 -2
- package/lib/types/runtime/resource-blocklet.d.ts +0 -2
- package/lib/types/runtime/runtime.d.ts +0 -20
- package/lib/types/types/assistant/index.d.ts +0 -405
- package/lib/types/types/assistant/mustache/ReadableMustache.d.ts +0 -2
- package/lib/types/types/assistant/mustache/directive.d.ts +0 -6
- package/lib/types/types/assistant/mustache/mustache.d.ts +0 -2
- package/lib/types/types/common/index.d.ts +0 -45
- package/lib/types/types/resource/index.d.ts +0 -17
- package/lib/types/types/resource/project.d.ts +0 -41
- package/lib/types/types/runtime/agent.d.ts +0 -33
- package/lib/types/types/runtime/error.d.ts +0 -10
- package/lib/types/types/runtime/index.d.ts +0 -116
- package/lib/types/types/runtime/runtime-resource-blocklet-state.d.ts +0 -5
- package/lib/types/types/runtime/schema.d.ts +0 -110
- package/lib/types/utils/cron-job.d.ts +0 -22
- package/lib/types/utils/extract-metadata-transform.d.ts +0 -16
- package/lib/types/utils/extract-metadata-transform.test.d.ts +0 -1
- package/lib/types/utils/fs.d.ts +0 -9
- package/lib/types/utils/get-blocklet-agent.d.ts +0 -219
- package/lib/types/utils/geti.d.ts +0 -1
- package/lib/types/utils/is-non-nullable.d.ts +0 -2
- package/lib/types/utils/render-message.d.ts +0 -6
- package/lib/types/utils/resolve-secret-inputs.d.ts +0 -11
- package/lib/types/utils/retry.d.ts +0 -1
- package/lib/types/utils/task-id.d.ts +0 -1
- package/lib/types/utils/tool-calls-transform.d.ts +0 -2
- /package/lib/cjs/types/{runtime/agent.js → agent.js} +0 -0
- /package/lib/cjs/types/{common/index.js → runnable.js} +0 -0
- /package/lib/esm/types/{runtime/agent.js → agent.js} +0 -0
- /package/lib/esm/types/{common/index.js → runnable.js} +0 -0
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { Assistant, ResourceProject, ResourceType } from '../types';
|
|
2
|
-
export type ResourceProjectItem = ResourceProject & {
|
|
3
|
-
blocklet: {
|
|
4
|
-
did: string;
|
|
5
|
-
};
|
|
6
|
-
dir: string;
|
|
7
|
-
agentMap: {
|
|
8
|
-
[agentId: string]: Assistant;
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
export type ResourceBlockletItem = {
|
|
12
|
-
did: string;
|
|
13
|
-
status?: number;
|
|
14
|
-
projectMap: {
|
|
15
|
-
[projectId: string]: ResourceProjectItem;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
export interface ResourceKnowledge {
|
|
19
|
-
knowledge: any & {
|
|
20
|
-
public?: boolean;
|
|
21
|
-
};
|
|
22
|
-
blockletDid: string;
|
|
23
|
-
documents: any[];
|
|
24
|
-
contents: any[];
|
|
25
|
-
segments: any[];
|
|
26
|
-
vectorsPath: string;
|
|
27
|
-
uploadPath: string;
|
|
28
|
-
sourcesPath: string;
|
|
29
|
-
processedPath: string;
|
|
30
|
-
logoPath: string;
|
|
31
|
-
title: string;
|
|
32
|
-
did: string;
|
|
33
|
-
}
|
|
34
|
-
export interface Resources {
|
|
35
|
-
knowledge: {
|
|
36
|
-
knowledgeList: ResourceKnowledge[];
|
|
37
|
-
blockletMap: {
|
|
38
|
-
[blockletDid: string]: {
|
|
39
|
-
knowledgeMap: {
|
|
40
|
-
[knowledgeId: string]: ResourceKnowledge;
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
agents: {
|
|
46
|
-
[type: string]: {
|
|
47
|
-
projects: ResourceProjectItem[];
|
|
48
|
-
blockletMap: {
|
|
49
|
-
[blockletDid: string]: ResourceBlockletItem;
|
|
50
|
-
};
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
export declare class ResourceManager {
|
|
55
|
-
constructor({ wait, watch }?: {
|
|
56
|
-
wait?: number;
|
|
57
|
-
watch?: boolean;
|
|
58
|
-
});
|
|
59
|
-
private promise?;
|
|
60
|
-
get resources(): Promise<Resources>;
|
|
61
|
-
reload(): Promise<Resources>;
|
|
62
|
-
getProjects({ blockletDid, type }: {
|
|
63
|
-
blockletDid?: string;
|
|
64
|
-
type: ResourceType;
|
|
65
|
-
}): Promise<ResourceProjectItem[]>;
|
|
66
|
-
getProject({ blockletDid, projectId, type, }: {
|
|
67
|
-
blockletDid: string;
|
|
68
|
-
projectId: string;
|
|
69
|
-
type?: ResourceType | ResourceType[];
|
|
70
|
-
}): Promise<ResourceProjectItem | undefined>;
|
|
71
|
-
getAgent({ blockletDid, projectId, agentId, type, }: {
|
|
72
|
-
blockletDid: string;
|
|
73
|
-
projectId: string;
|
|
74
|
-
agentId: string;
|
|
75
|
-
type?: ResourceType | ResourceType[];
|
|
76
|
-
}): Promise<{
|
|
77
|
-
agent: Assistant;
|
|
78
|
-
project: import("../types").ProjectSettings;
|
|
79
|
-
blocklet: {
|
|
80
|
-
did: string;
|
|
81
|
-
};
|
|
82
|
-
} | undefined>;
|
|
83
|
-
getKnowledgeList(): Promise<ResourceKnowledge[]>;
|
|
84
|
-
getKnowledge({ blockletDid, knowledgeId }: {
|
|
85
|
-
blockletDid: string;
|
|
86
|
-
knowledgeId: string;
|
|
87
|
-
}): Promise<ResourceKnowledge>;
|
|
88
|
-
}
|
package/lib/types/constants.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare const AIGNE_RUNTIME_COMPONENT_DID = "z2qaBP9SahqU2L2YA3ip7NecwKACMByTFuiJ2";
|
|
2
|
-
export declare const AIGNE_COMPONENTS_COMPONENT_DID = "z2qa6fvjmjew4pWJyTsKaWFuNoMUMyXDh5A1D";
|
|
3
|
-
export declare const AIGNE_RUNTIME_CUSTOM_COMPONENT_ID = "grc9q1cveub6pnl8";
|
|
4
|
-
export declare const AIGNE_STUDIO_COMPONENT_DID = "z8iZpog7mcgcgBZzTiXJCWESvmnRrQmnd3XBB";
|
|
5
|
-
export declare const NFT_BLENDER_COMPONENT_DID = "z8ia1ieY5KhEC4LMRETzS5nUwD7PvAND8qkfX";
|
|
6
|
-
export declare const AIGNE_ISSUE_VC_PREFIX = "AIGNE";
|
|
@@ -1,209 +0,0 @@
|
|
|
1
|
-
import { CallAI, CallAIImage, GetAgent, GetAgentResult, RunAssistantCallback } from '../assistant/type';
|
|
2
|
-
import { issueVC } from '../libs/blocklet/vc';
|
|
3
|
-
import type { DatasetObject } from '../libs/openapi/types';
|
|
4
|
-
import { ProjectSettings, Variable, VariableScope } from '../types';
|
|
5
|
-
import { renderMessage } from '../utils/render-message';
|
|
6
|
-
export declare class ExecutorContext {
|
|
7
|
-
constructor(options: Pick<ExecutorContext, 'entry' | 'getAgent' | 'callAI' | 'callAIImage' | 'callback' | 'getMemoryVariables' | 'user' | 'sessionId' | 'messageId' | 'clientTime' | 'executor' | 'entryProjectId' | 'queryCache' | 'setCache'>);
|
|
8
|
-
entry: {
|
|
9
|
-
blockletDid?: string;
|
|
10
|
-
project: ProjectSettings;
|
|
11
|
-
working?: boolean;
|
|
12
|
-
appUrl?: string;
|
|
13
|
-
};
|
|
14
|
-
getAgent: GetAgent;
|
|
15
|
-
callAI: CallAI;
|
|
16
|
-
callAIImage: CallAIImage;
|
|
17
|
-
queryCache: (options: {
|
|
18
|
-
aid: string;
|
|
19
|
-
cacheKey: string;
|
|
20
|
-
}) => Promise<{
|
|
21
|
-
inputs: {
|
|
22
|
-
[key: string]: any;
|
|
23
|
-
};
|
|
24
|
-
outputs: {
|
|
25
|
-
[key: string]: any;
|
|
26
|
-
};
|
|
27
|
-
} | null>;
|
|
28
|
-
setCache: (options: {
|
|
29
|
-
aid: string;
|
|
30
|
-
cacheKey: string;
|
|
31
|
-
inputs: {
|
|
32
|
-
[key: string]: any;
|
|
33
|
-
};
|
|
34
|
-
outputs: {
|
|
35
|
-
objects: any[];
|
|
36
|
-
};
|
|
37
|
-
}) => Promise<any>;
|
|
38
|
-
callback: RunAssistantCallback;
|
|
39
|
-
sessionId: string;
|
|
40
|
-
messageId: string;
|
|
41
|
-
clientTime: string;
|
|
42
|
-
promise?: Promise<{
|
|
43
|
-
agents: (GetAgentResult & {
|
|
44
|
-
openApi: DatasetObject;
|
|
45
|
-
})[];
|
|
46
|
-
agentsMap: {
|
|
47
|
-
[key: string]: GetAgentResult & {
|
|
48
|
-
openApi: DatasetObject;
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
|
-
openApis: DatasetObject[];
|
|
52
|
-
}>;
|
|
53
|
-
entryProjectId: string;
|
|
54
|
-
user?: {
|
|
55
|
-
id: string;
|
|
56
|
-
did: string;
|
|
57
|
-
role?: string;
|
|
58
|
-
fullName?: string;
|
|
59
|
-
provider?: string;
|
|
60
|
-
walletOS?: string;
|
|
61
|
-
isAdmin?: boolean;
|
|
62
|
-
};
|
|
63
|
-
getMemoryVariables: (options: {
|
|
64
|
-
blockletDid?: string;
|
|
65
|
-
projectId: string;
|
|
66
|
-
projectRef?: string;
|
|
67
|
-
working?: boolean;
|
|
68
|
-
}) => Promise<Variable[]>;
|
|
69
|
-
maxRetries: number;
|
|
70
|
-
executor: <T extends GetAgentResult>(agent: T, options: AgentExecutorOptions) => AgentExecutorBase<T>;
|
|
71
|
-
execute<T extends GetAgentResult>(agent: T, options: AgentExecutorOptions): Promise<any>;
|
|
72
|
-
copy(options: Partial<ExecutorContext>): ExecutorContext;
|
|
73
|
-
getBlockletAgent(agentId: string): Promise<{
|
|
74
|
-
agent: GetAgentResult & {
|
|
75
|
-
openApi: DatasetObject;
|
|
76
|
-
};
|
|
77
|
-
openApis: DatasetObject[];
|
|
78
|
-
}>;
|
|
79
|
-
}
|
|
80
|
-
export interface AgentExecutorOptions {
|
|
81
|
-
inputs?: {
|
|
82
|
-
[key: string]: any;
|
|
83
|
-
};
|
|
84
|
-
taskId: string;
|
|
85
|
-
parentTaskId?: string;
|
|
86
|
-
variables?: {
|
|
87
|
-
[key: string]: any;
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
export declare abstract class AgentExecutorBase<T> {
|
|
91
|
-
readonly context: ExecutorContext;
|
|
92
|
-
readonly agent: GetAgentResult & T;
|
|
93
|
-
readonly options: AgentExecutorOptions;
|
|
94
|
-
constructor(context: ExecutorContext, agent: GetAgentResult & T, options: AgentExecutorOptions);
|
|
95
|
-
abstract process(options: {
|
|
96
|
-
inputs: {
|
|
97
|
-
[key: string]: any;
|
|
98
|
-
};
|
|
99
|
-
}): Promise<any>;
|
|
100
|
-
execute(): Promise<any>;
|
|
101
|
-
private _finalInputs;
|
|
102
|
-
private get finalInputs();
|
|
103
|
-
private set finalInputs(value);
|
|
104
|
-
private cacheKey;
|
|
105
|
-
get globalContext(): {
|
|
106
|
-
$sys: {
|
|
107
|
-
sessionId: string;
|
|
108
|
-
messageId: string;
|
|
109
|
-
clientTime: string;
|
|
110
|
-
user: {
|
|
111
|
-
id: string;
|
|
112
|
-
did: string;
|
|
113
|
-
role?: string;
|
|
114
|
-
fullName?: string;
|
|
115
|
-
provider?: string;
|
|
116
|
-
walletOS?: string;
|
|
117
|
-
isAdmin?: boolean;
|
|
118
|
-
} | undefined;
|
|
119
|
-
env: Pick<{
|
|
120
|
-
[key: string]: any;
|
|
121
|
-
appId: string;
|
|
122
|
-
appPid: string;
|
|
123
|
-
appIds: string[];
|
|
124
|
-
appName: string;
|
|
125
|
-
appNameSlug: string;
|
|
126
|
-
appDescription: string;
|
|
127
|
-
appUrl: string;
|
|
128
|
-
isComponent: boolean;
|
|
129
|
-
dataDir: string;
|
|
130
|
-
cacheDir: string;
|
|
131
|
-
mode: string;
|
|
132
|
-
tenantMode: string;
|
|
133
|
-
appStorageEndpoint: string;
|
|
134
|
-
serverVersion: string;
|
|
135
|
-
languages: {
|
|
136
|
-
code: string;
|
|
137
|
-
name: string;
|
|
138
|
-
}[];
|
|
139
|
-
preferences: Record<string, any>;
|
|
140
|
-
componentDid: string;
|
|
141
|
-
initialized?: boolean;
|
|
142
|
-
}, "appId" | "appName" | "appDescription" | "appUrl">;
|
|
143
|
-
};
|
|
144
|
-
$storage: {
|
|
145
|
-
getItem(key: string, { scope, onlyOne }?: {
|
|
146
|
-
scope?: VariableScope;
|
|
147
|
-
onlyOne?: boolean;
|
|
148
|
-
}): Promise<{
|
|
149
|
-
id: string;
|
|
150
|
-
key: string;
|
|
151
|
-
data: any;
|
|
152
|
-
scope: VariableScope;
|
|
153
|
-
}[] | {
|
|
154
|
-
id: string;
|
|
155
|
-
key: string;
|
|
156
|
-
data: any;
|
|
157
|
-
scope: VariableScope;
|
|
158
|
-
} | null>;
|
|
159
|
-
setItem(key: string, value: any, { scope, onlyOne }?: {
|
|
160
|
-
scope?: VariableScope;
|
|
161
|
-
onlyOne?: boolean;
|
|
162
|
-
}): Promise<{
|
|
163
|
-
id: string;
|
|
164
|
-
key: string;
|
|
165
|
-
data: any;
|
|
166
|
-
scope: VariableScope;
|
|
167
|
-
}>;
|
|
168
|
-
};
|
|
169
|
-
$cache: {
|
|
170
|
-
readonly key: string;
|
|
171
|
-
getItem(key: string, { agentId }?: {
|
|
172
|
-
agentId?: string;
|
|
173
|
-
}): Promise<{
|
|
174
|
-
inputs: {
|
|
175
|
-
[key: string]: any;
|
|
176
|
-
};
|
|
177
|
-
outputs: {
|
|
178
|
-
[key: string]: any;
|
|
179
|
-
};
|
|
180
|
-
} | null>;
|
|
181
|
-
};
|
|
182
|
-
$blocklet: {
|
|
183
|
-
issueVC: (args: Omit<Parameters<typeof issueVC>[0], "userDid" | "project">) => Promise<{
|
|
184
|
-
user: import("@abtnode/client").UserInfo;
|
|
185
|
-
vc: object;
|
|
186
|
-
}>;
|
|
187
|
-
};
|
|
188
|
-
};
|
|
189
|
-
private prepareInputs;
|
|
190
|
-
protected renderMessage: typeof renderMessage;
|
|
191
|
-
protected validateOutputs({ inputs, outputs, partial, processCallAgentOutputs, }: {
|
|
192
|
-
inputs?: {
|
|
193
|
-
[key: string]: any;
|
|
194
|
-
};
|
|
195
|
-
outputs?: {
|
|
196
|
-
[key: string]: any;
|
|
197
|
-
};
|
|
198
|
-
partial?: boolean;
|
|
199
|
-
processCallAgentOutputs?: boolean;
|
|
200
|
-
}): Promise<any>;
|
|
201
|
-
private postProcessOutputs;
|
|
202
|
-
private setMemory;
|
|
203
|
-
private getMemory;
|
|
204
|
-
hideSecretInputs(partial: {
|
|
205
|
-
[key: string]: any;
|
|
206
|
-
}, agent: GetAgentResult): {
|
|
207
|
-
[x: string]: any;
|
|
208
|
-
};
|
|
209
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { CallAssistant } from '../types';
|
|
2
|
-
import { AgentExecutorBase } from './base';
|
|
3
|
-
export declare class CallAgentExecutor extends AgentExecutorBase<CallAssistant> {
|
|
4
|
-
private getCalledAgents;
|
|
5
|
-
private getLastTextSteamAgentId;
|
|
6
|
-
private getOutputVariables;
|
|
7
|
-
process(options: {
|
|
8
|
-
inputs: {
|
|
9
|
-
[key: string]: any;
|
|
10
|
-
};
|
|
11
|
-
}): Promise<Partial<{}>>;
|
|
12
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { RouterAssistant } from '../types';
|
|
2
|
-
import { AgentExecutorBase } from './base';
|
|
3
|
-
export declare class DecisionAgentExecutor extends AgentExecutorBase<RouterAssistant> {
|
|
4
|
-
process({ inputs }: {
|
|
5
|
-
inputs: {
|
|
6
|
-
[key: string]: any;
|
|
7
|
-
};
|
|
8
|
-
}): Promise<any>;
|
|
9
|
-
processWithJsonLogic({ inputs }: {
|
|
10
|
-
inputs: {
|
|
11
|
-
[key: string]: any;
|
|
12
|
-
};
|
|
13
|
-
}): Promise<any>;
|
|
14
|
-
processWithLLM({ inputs }: {
|
|
15
|
-
inputs: {
|
|
16
|
-
[key: string]: any;
|
|
17
|
-
};
|
|
18
|
-
}): Promise<any>;
|
|
19
|
-
private getEnglishFunctionName;
|
|
20
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { GetAgentResult } from '../assistant/type';
|
|
2
|
-
import { AgentExecutorBase, AgentExecutorOptions, ExecutorContext } from './base';
|
|
3
|
-
export declare class RuntimeExecutor extends AgentExecutorBase<GetAgentResult> {
|
|
4
|
-
private parentAgent?;
|
|
5
|
-
constructor(context: Omit<ConstructorParameters<typeof ExecutorContext>[0], 'executor'>, agent: GetAgentResult, options: AgentExecutorOptions, parentAgent?: GetAgentResult | undefined);
|
|
6
|
-
process(): Promise<void>;
|
|
7
|
-
execute(): Promise<any>;
|
|
8
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { GetAgentResult } from '../assistant/type';
|
|
2
|
-
import { OutputVariable, PromptAssistant } from '../types';
|
|
3
|
-
import { AgentExecutorBase } from './base';
|
|
4
|
-
export declare class LLMAgentExecutor extends AgentExecutorBase<PromptAssistant> {
|
|
5
|
-
private retryTimes;
|
|
6
|
-
get modelInfo(): {
|
|
7
|
-
model: string;
|
|
8
|
-
temperature: number | undefined;
|
|
9
|
-
topP: number | undefined;
|
|
10
|
-
presencePenalty: number | undefined;
|
|
11
|
-
frequencyPenalty: number | undefined;
|
|
12
|
-
};
|
|
13
|
-
private _executor;
|
|
14
|
-
get executor(): Promise<{
|
|
15
|
-
executor: GetAgentResult;
|
|
16
|
-
inputValues?: {
|
|
17
|
-
[key: string]: any;
|
|
18
|
-
};
|
|
19
|
-
} | undefined>;
|
|
20
|
-
private _outputsInfo;
|
|
21
|
-
get outputsInfo(): Promise<{
|
|
22
|
-
outputs: OutputVariable[];
|
|
23
|
-
schema: any;
|
|
24
|
-
hasStreamingTextOutput: boolean;
|
|
25
|
-
hasJsonOutputs: boolean;
|
|
26
|
-
}>;
|
|
27
|
-
private getMessages;
|
|
28
|
-
process({ inputs }: {
|
|
29
|
-
inputs: {
|
|
30
|
-
[key: string]: any;
|
|
31
|
-
};
|
|
32
|
-
}): Promise<any>;
|
|
33
|
-
private processWithOutJsonSchemaFormatSupport;
|
|
34
|
-
private processWithJsonSchemaFormat;
|
|
35
|
-
private callAIGetJsonOutput;
|
|
36
|
-
private callAIGetTextStreamOutput;
|
|
37
|
-
private callAIOrExecutor;
|
|
38
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { FunctionAssistant } from '../types';
|
|
2
|
-
import { AgentExecutorBase } from './base';
|
|
3
|
-
export declare class LogicAgentExecutor extends AgentExecutorBase<FunctionAssistant> {
|
|
4
|
-
process({ inputs }: {
|
|
5
|
-
inputs: {
|
|
6
|
-
[key: string]: any;
|
|
7
|
-
};
|
|
8
|
-
}): Promise<any>;
|
|
9
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { UserInfo } from '@abtnode/client';
|
|
2
|
-
import AuthService from '@blocklet/sdk/lib/service/auth';
|
|
3
|
-
import type { ExecutorContext } from '../../executor/base';
|
|
4
|
-
export declare const authService: AuthService;
|
|
5
|
-
export declare function issueVC({ context: { entry }, userDid, name, title, description, reissue, displayUrl, notify, }: {
|
|
6
|
-
context: ExecutorContext;
|
|
7
|
-
userDid: string;
|
|
8
|
-
name: string;
|
|
9
|
-
title: string;
|
|
10
|
-
description: string;
|
|
11
|
-
reissue?: boolean;
|
|
12
|
-
displayUrl?: string;
|
|
13
|
-
notify?: boolean;
|
|
14
|
-
}): Promise<{
|
|
15
|
-
user: UserInfo;
|
|
16
|
-
vc: object;
|
|
17
|
-
}>;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { DatasetObject } from '../types';
|
|
2
|
-
export interface User {
|
|
3
|
-
did: string;
|
|
4
|
-
}
|
|
5
|
-
export declare const callBlockletApi: (pathItem: DatasetObject, data: {
|
|
6
|
-
[key: string]: any;
|
|
7
|
-
}, options?: {
|
|
8
|
-
user?: User;
|
|
9
|
-
params?: {
|
|
10
|
-
[key: string]: any;
|
|
11
|
-
};
|
|
12
|
-
data?: {
|
|
13
|
-
[key: string]: any;
|
|
14
|
-
};
|
|
15
|
-
}) => Promise<import("axios").AxiosResponse<any, {
|
|
16
|
-
[key: string]: any;
|
|
17
|
-
}>>;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { DatasetObject, RequestBodyObject } from '../types';
|
|
2
|
-
export declare const getRequestConfig: (pathItem: DatasetObject, requestData: {
|
|
3
|
-
[key: string]: any;
|
|
4
|
-
}, options?: {
|
|
5
|
-
params: {
|
|
6
|
-
[key: string]: any;
|
|
7
|
-
};
|
|
8
|
-
data: {
|
|
9
|
-
[key: string]: any;
|
|
10
|
-
};
|
|
11
|
-
}) => {
|
|
12
|
-
url: string;
|
|
13
|
-
method: string;
|
|
14
|
-
headers: {
|
|
15
|
-
[key: string]: any;
|
|
16
|
-
};
|
|
17
|
-
params: {
|
|
18
|
-
[key: string]: any;
|
|
19
|
-
};
|
|
20
|
-
data: {
|
|
21
|
-
[key: string]: any;
|
|
22
|
-
};
|
|
23
|
-
body: {
|
|
24
|
-
[key: string]: any;
|
|
25
|
-
};
|
|
26
|
-
cookies: {
|
|
27
|
-
[key: string]: any;
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
export declare function extractRequestBodyParameters(requestBody?: RequestBodyObject): {
|
|
31
|
-
name: string;
|
|
32
|
-
value: any;
|
|
33
|
-
description?: string;
|
|
34
|
-
}[];
|
|
35
|
-
export declare function getAllParameters(dataset: DatasetObject): {
|
|
36
|
-
name: string;
|
|
37
|
-
description?: string;
|
|
38
|
-
type?: string;
|
|
39
|
-
}[];
|
|
40
|
-
export declare function getRequiredFields(dataset: DatasetObject): any[];
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { ParameterObject, RequestBodyObject, ResponsesObject } from 'openapi3-ts/oas31';
|
|
2
|
-
export * from 'openapi3-ts/oas31';
|
|
3
|
-
export interface PathItemObject {
|
|
4
|
-
path: string;
|
|
5
|
-
method: string;
|
|
6
|
-
summary?: string;
|
|
7
|
-
description?: string;
|
|
8
|
-
parameters?: ParameterObject[];
|
|
9
|
-
requestBody?: RequestBodyObject;
|
|
10
|
-
responses?: ResponsesObject;
|
|
11
|
-
}
|
|
12
|
-
export interface DatasetObject extends PathItemObject {
|
|
13
|
-
id: string;
|
|
14
|
-
type: string;
|
|
15
|
-
url?: string;
|
|
16
|
-
name?: string;
|
|
17
|
-
did?: string;
|
|
18
|
-
[key: `x-summary-${string}`]: string | undefined;
|
|
19
|
-
[key: `x-description-${string}`]: string | undefined;
|
|
20
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Agent, Variable } from '../types';
|
|
2
|
-
export interface AIGNEProject {
|
|
3
|
-
id: string;
|
|
4
|
-
name?: string;
|
|
5
|
-
description?: string;
|
|
6
|
-
createdAt?: string;
|
|
7
|
-
updatedAt?: string;
|
|
8
|
-
createdBy?: string;
|
|
9
|
-
updatedBy?: string;
|
|
10
|
-
agents?: Agent[];
|
|
11
|
-
memories?: Variable[];
|
|
12
|
-
}
|
|
13
|
-
export declare class AIGNERuntime {
|
|
14
|
-
project: AIGNEProject;
|
|
15
|
-
static load(options: {
|
|
16
|
-
path: string;
|
|
17
|
-
}): Promise<AIGNERuntime>;
|
|
18
|
-
constructor(project: AIGNEProject);
|
|
19
|
-
runAgent(agentId: string, inputs: object): Promise<any>;
|
|
20
|
-
}
|