@aigne/core 0.0.1
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/assistant/generate-output.js +101 -0
- package/lib/cjs/assistant/select-agent.js +76 -0
- package/lib/cjs/assistant/type.js +11 -0
- package/lib/cjs/common/aid.js +42 -0
- package/lib/cjs/common/index.js +238 -0
- package/lib/cjs/common/resource-manager.js +199 -0
- package/lib/cjs/constants.js +9 -0
- package/lib/cjs/executor/agent.js +10 -0
- package/lib/cjs/executor/aigc.js +28 -0
- package/lib/cjs/executor/api.js +64 -0
- package/lib/cjs/executor/base.js +676 -0
- package/lib/cjs/executor/blocklet.js +25 -0
- package/lib/cjs/executor/call-agent.js +105 -0
- package/lib/cjs/executor/decision.js +478 -0
- package/lib/cjs/executor/image-blender.js +32 -0
- package/lib/cjs/executor/index.js +81 -0
- package/lib/cjs/executor/llm.js +379 -0
- package/lib/cjs/executor/logic.js +167 -0
- package/lib/cjs/index.js +17 -0
- package/lib/cjs/libs/blocklet/vc.js +92 -0
- package/lib/cjs/libs/openapi/request/index.js +24 -0
- package/lib/cjs/libs/openapi/request/util.js +146 -0
- package/lib/cjs/libs/openapi/types/index.js +17 -0
- package/lib/cjs/libs/openapi/util/call.js +15 -0
- package/lib/cjs/libs/openapi/util/check-schema.js +67 -0
- package/lib/cjs/libs/openapi/util/convert-schema.js +44 -0
- package/lib/cjs/libs/openapi/util/flatten-open-api.js +21 -0
- package/lib/cjs/libs/openapi/util/get-open-api-i18n-text.js +7 -0
- package/lib/cjs/logger.js +4 -0
- package/lib/cjs/runtime/resource-blocklet.js +5 -0
- package/lib/cjs/runtime/runtime.js +143 -0
- package/lib/cjs/types/assistant/index.js +31 -0
- package/lib/cjs/types/assistant/mustache/ReadableMustache.js +69 -0
- package/lib/cjs/types/assistant/mustache/directive.js +35 -0
- package/lib/cjs/types/assistant/mustache/mustache.js +688 -0
- package/lib/cjs/types/common/index.js +2 -0
- package/lib/cjs/types/index.js +20 -0
- package/lib/cjs/types/resource/index.js +47 -0
- package/lib/cjs/types/resource/project.js +35 -0
- package/lib/cjs/types/runtime/agent.js +2 -0
- package/lib/cjs/types/runtime/error.js +18 -0
- package/lib/cjs/types/runtime/index.js +37 -0
- package/lib/cjs/types/runtime/runtime-resource-blocklet-state.js +4 -0
- package/lib/cjs/types/runtime/schema.js +259 -0
- package/lib/cjs/utils/cron-job.js +48 -0
- package/lib/cjs/utils/extract-metadata-transform.js +58 -0
- package/lib/cjs/utils/extract-metadata-transform.test.js +61 -0
- package/lib/cjs/utils/fs.js +49 -0
- package/lib/cjs/utils/get-blocklet-agent.js +351 -0
- package/lib/cjs/utils/geti.js +37 -0
- package/lib/cjs/utils/is-non-nullable.js +20 -0
- package/lib/cjs/utils/render-message.js +23 -0
- package/lib/cjs/utils/resolve-secret-inputs.js +49 -0
- package/lib/cjs/utils/retry.js +19 -0
- package/lib/cjs/utils/task-id.js +7 -0
- package/lib/cjs/utils/tool-calls-transform.js +18 -0
- package/lib/esm/assistant/generate-output.js +91 -0
- package/lib/esm/assistant/select-agent.js +71 -0
- package/lib/esm/assistant/type.js +7 -0
- package/lib/esm/common/aid.js +38 -0
- package/lib/esm/common/index.js +232 -0
- package/lib/esm/common/resource-manager.js +192 -0
- package/lib/esm/constants.js +6 -0
- package/lib/esm/executor/agent.js +6 -0
- package/lib/esm/executor/aigc.js +24 -0
- package/lib/esm/executor/api.js +34 -0
- package/lib/esm/executor/base.js +668 -0
- package/lib/esm/executor/blocklet.js +21 -0
- package/lib/esm/executor/call-agent.js +98 -0
- package/lib/esm/executor/decision.js +471 -0
- package/lib/esm/executor/image-blender.js +25 -0
- package/lib/esm/executor/index.js +74 -0
- package/lib/esm/executor/llm.js +372 -0
- package/lib/esm/executor/logic.js +160 -0
- package/lib/esm/index.js +1 -0
- package/lib/esm/libs/blocklet/vc.js +85 -0
- package/lib/esm/libs/openapi/request/index.js +20 -0
- package/lib/esm/libs/openapi/request/util.js +136 -0
- package/lib/esm/libs/openapi/types/index.js +1 -0
- package/lib/esm/libs/openapi/util/call.js +8 -0
- package/lib/esm/libs/openapi/util/check-schema.js +62 -0
- package/lib/esm/libs/openapi/util/convert-schema.js +42 -0
- package/lib/esm/libs/openapi/util/flatten-open-api.js +19 -0
- package/lib/esm/libs/openapi/util/get-open-api-i18n-text.js +5 -0
- package/lib/esm/logger.js +2 -0
- package/lib/esm/runtime/resource-blocklet.js +2 -0
- package/lib/esm/runtime/runtime.js +136 -0
- package/lib/esm/types/assistant/index.js +9 -0
- package/lib/esm/types/assistant/mustache/ReadableMustache.js +63 -0
- package/lib/esm/types/assistant/mustache/directive.js +29 -0
- package/lib/esm/types/assistant/mustache/mustache.js +686 -0
- package/lib/esm/types/common/index.js +1 -0
- package/lib/esm/types/index.js +4 -0
- package/lib/esm/types/resource/index.js +26 -0
- package/lib/esm/types/resource/project.js +29 -0
- package/lib/esm/types/runtime/agent.js +1 -0
- package/lib/esm/types/runtime/error.js +14 -0
- package/lib/esm/types/runtime/index.js +20 -0
- package/lib/esm/types/runtime/runtime-resource-blocklet-state.js +1 -0
- package/lib/esm/types/runtime/schema.js +249 -0
- package/lib/esm/utils/cron-job.js +44 -0
- package/lib/esm/utils/extract-metadata-transform.js +54 -0
- package/lib/esm/utils/extract-metadata-transform.test.js +59 -0
- package/lib/esm/utils/fs.js +41 -0
- package/lib/esm/utils/get-blocklet-agent.js +344 -0
- package/lib/esm/utils/geti.js +30 -0
- package/lib/esm/utils/is-non-nullable.js +13 -0
- package/lib/esm/utils/render-message.js +20 -0
- package/lib/esm/utils/resolve-secret-inputs.js +46 -0
- package/lib/esm/utils/retry.js +16 -0
- package/lib/esm/utils/task-id.js +3 -0
- package/lib/esm/utils/tool-calls-transform.js +15 -0
- package/lib/types/assistant/generate-output.d.ts +29 -0
- package/lib/types/assistant/select-agent.d.ts +14 -0
- package/lib/types/assistant/type.d.ts +61 -0
- package/lib/types/common/aid.d.ts +18 -0
- package/lib/types/common/index.d.ts +7 -0
- package/lib/types/common/resource-manager.d.ts +88 -0
- package/lib/types/constants.d.ts +6 -0
- package/lib/types/executor/agent.d.ts +5 -0
- package/lib/types/executor/aigc.d.ts +9 -0
- package/lib/types/executor/api.d.ts +9 -0
- package/lib/types/executor/base.d.ts +209 -0
- package/lib/types/executor/blocklet.d.ts +9 -0
- package/lib/types/executor/call-agent.d.ts +12 -0
- package/lib/types/executor/decision.d.ts +20 -0
- package/lib/types/executor/image-blender.d.ts +9 -0
- package/lib/types/executor/index.d.ts +8 -0
- package/lib/types/executor/llm.d.ts +38 -0
- package/lib/types/executor/logic.d.ts +9 -0
- package/lib/types/index.d.ts +1 -0
- package/lib/types/libs/blocklet/vc.d.ts +17 -0
- package/lib/types/libs/openapi/request/index.d.ts +17 -0
- package/lib/types/libs/openapi/request/util.d.ts +40 -0
- package/lib/types/libs/openapi/types/index.d.ts +20 -0
- package/lib/types/libs/openapi/util/call.d.ts +2 -0
- package/lib/types/libs/openapi/util/check-schema.d.ts +3 -0
- package/lib/types/libs/openapi/util/convert-schema.d.ts +8 -0
- package/lib/types/libs/openapi/util/flatten-open-api.d.ts +3 -0
- package/lib/types/libs/openapi/util/get-open-api-i18n-text.d.ts +2 -0
- package/lib/types/logger.d.ts +2 -0
- package/lib/types/runtime/resource-blocklet.d.ts +2 -0
- package/lib/types/runtime/runtime.d.ts +20 -0
- package/lib/types/types/assistant/index.d.ts +405 -0
- package/lib/types/types/assistant/mustache/ReadableMustache.d.ts +2 -0
- package/lib/types/types/assistant/mustache/directive.d.ts +6 -0
- package/lib/types/types/assistant/mustache/mustache.d.ts +2 -0
- package/lib/types/types/common/index.d.ts +45 -0
- package/lib/types/types/index.d.ts +4 -0
- package/lib/types/types/resource/index.d.ts +17 -0
- package/lib/types/types/resource/project.d.ts +41 -0
- package/lib/types/types/runtime/agent.d.ts +33 -0
- package/lib/types/types/runtime/error.d.ts +10 -0
- package/lib/types/types/runtime/index.d.ts +116 -0
- package/lib/types/types/runtime/runtime-resource-blocklet-state.d.ts +5 -0
- package/lib/types/types/runtime/schema.d.ts +110 -0
- package/lib/types/utils/cron-job.d.ts +22 -0
- package/lib/types/utils/extract-metadata-transform.d.ts +16 -0
- package/lib/types/utils/extract-metadata-transform.test.d.ts +1 -0
- package/lib/types/utils/fs.d.ts +9 -0
- package/lib/types/utils/get-blocklet-agent.d.ts +219 -0
- package/lib/types/utils/geti.d.ts +1 -0
- package/lib/types/utils/is-non-nullable.d.ts +2 -0
- package/lib/types/utils/render-message.d.ts +6 -0
- package/lib/types/utils/resolve-secret-inputs.d.ts +11 -0
- package/lib/types/utils/retry.d.ts +1 -0
- package/lib/types/utils/task-id.d.ts +1 -0
- package/lib/types/utils/tool-calls-transform.d.ts +2 -0
- package/package.json +67 -0
- package/tsconfig.json +12 -0
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { ChatCompletionResponse } from '@blocklet/ai-kit/api/types/chat';
|
|
2
|
+
import Joi from 'joi';
|
|
3
|
+
import type { Assistant, BlockletAgent, OutputVariable, Variable } from '..';
|
|
4
|
+
export declare const variableBlockListForAgent: {
|
|
5
|
+
[key in Assistant['type']]?: {
|
|
6
|
+
block?: Set<RuntimeOutputVariable>;
|
|
7
|
+
allow?: Set<RuntimeOutputVariable>;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
type OmitUnion<T, K extends keyof any> = T extends any ? Omit<T, K> : never;
|
|
11
|
+
export declare const runtimeVariablesSchema: {
|
|
12
|
+
[key in RuntimeOutputVariable]?: OmitUnion<OutputVariable, 'id'>;
|
|
13
|
+
};
|
|
14
|
+
export declare function outputVariablesToJsonSchema(assistant: Assistant, { variables, includeRuntimeOutputVariables, includeFaker, }: {
|
|
15
|
+
variables: Variable[];
|
|
16
|
+
includeRuntimeOutputVariables?: boolean;
|
|
17
|
+
includeFaker?: boolean;
|
|
18
|
+
}): {
|
|
19
|
+
type: 'object';
|
|
20
|
+
properties: {
|
|
21
|
+
[key: string]: any;
|
|
22
|
+
};
|
|
23
|
+
} | undefined;
|
|
24
|
+
export declare function outputVariablesToJoiSchema(assistant: Assistant | BlockletAgent, { partial, variables }: {
|
|
25
|
+
partial?: boolean;
|
|
26
|
+
variables: Variable[];
|
|
27
|
+
}): Joi.AnySchema;
|
|
28
|
+
export declare enum RuntimeOutputVariable {
|
|
29
|
+
llmResponseStream = "$llmResponseStream",
|
|
30
|
+
text = "$text",
|
|
31
|
+
images = "$images",
|
|
32
|
+
suggestedQuestions = "$suggested.questions",
|
|
33
|
+
referenceLinks = "$reference.links",
|
|
34
|
+
appearancePage = "$appearance.page",
|
|
35
|
+
appearanceInput = "$appearance.input",
|
|
36
|
+
appearanceOutput = "$appearance.output",
|
|
37
|
+
children = "$children",
|
|
38
|
+
share = "$share",
|
|
39
|
+
openingQuestions = "$openingQuestions",
|
|
40
|
+
openingMessage = "$openingMessage",
|
|
41
|
+
profile = "$profile"
|
|
42
|
+
}
|
|
43
|
+
export declare function isRuntimeOutputVariable(variable: string): variable is RuntimeOutputVariable;
|
|
44
|
+
export interface RuntimeOutputAppearance {
|
|
45
|
+
componentBlockletDid?: string;
|
|
46
|
+
componentId?: string;
|
|
47
|
+
componentName?: string;
|
|
48
|
+
componentProperties?: {
|
|
49
|
+
[key: string]: any;
|
|
50
|
+
};
|
|
51
|
+
componentProps?: {
|
|
52
|
+
[key: string]: any;
|
|
53
|
+
};
|
|
54
|
+
title?: string;
|
|
55
|
+
icon?: string;
|
|
56
|
+
jsonataExpression?: string;
|
|
57
|
+
}
|
|
58
|
+
export interface RuntimeOutputChildren {
|
|
59
|
+
agents?: {
|
|
60
|
+
id: string;
|
|
61
|
+
name?: string;
|
|
62
|
+
}[];
|
|
63
|
+
}
|
|
64
|
+
export interface RuntimeOutputShare {
|
|
65
|
+
items?: {
|
|
66
|
+
to: string;
|
|
67
|
+
}[];
|
|
68
|
+
shareAttachUrl?: boolean;
|
|
69
|
+
shareAttachInputs?: boolean;
|
|
70
|
+
}
|
|
71
|
+
export interface RuntimeOutputOpeningQuestions {
|
|
72
|
+
items?: {
|
|
73
|
+
id: string;
|
|
74
|
+
title?: string;
|
|
75
|
+
parameters?: any;
|
|
76
|
+
}[];
|
|
77
|
+
}
|
|
78
|
+
export interface RuntimeOutputOpeningMessage {
|
|
79
|
+
message?: string;
|
|
80
|
+
}
|
|
81
|
+
export interface RuntimeOutputProfile {
|
|
82
|
+
avatar?: string;
|
|
83
|
+
name?: string;
|
|
84
|
+
description?: string;
|
|
85
|
+
ogImage?: string;
|
|
86
|
+
}
|
|
87
|
+
export interface RuntimeOutputVariablesSchema {
|
|
88
|
+
[RuntimeOutputVariable.llmResponseStream]?: ReadableStream<ChatCompletionResponse>;
|
|
89
|
+
[RuntimeOutputVariable.text]?: string;
|
|
90
|
+
[RuntimeOutputVariable.images]?: {
|
|
91
|
+
url: string;
|
|
92
|
+
}[];
|
|
93
|
+
[RuntimeOutputVariable.suggestedQuestions]?: {
|
|
94
|
+
question: string;
|
|
95
|
+
}[];
|
|
96
|
+
[RuntimeOutputVariable.referenceLinks]?: {
|
|
97
|
+
title?: string;
|
|
98
|
+
url: string;
|
|
99
|
+
}[];
|
|
100
|
+
[RuntimeOutputVariable.appearancePage]?: undefined;
|
|
101
|
+
[RuntimeOutputVariable.appearanceInput]?: undefined;
|
|
102
|
+
[RuntimeOutputVariable.appearanceOutput]?: undefined;
|
|
103
|
+
[RuntimeOutputVariable.children]?: RuntimeOutputChildren;
|
|
104
|
+
[RuntimeOutputVariable.share]?: RuntimeOutputShare;
|
|
105
|
+
[RuntimeOutputVariable.openingQuestions]?: RuntimeOutputOpeningQuestions;
|
|
106
|
+
[RuntimeOutputVariable.openingMessage]?: RuntimeOutputOpeningMessage;
|
|
107
|
+
[RuntimeOutputVariable.profile]?: RuntimeOutputProfile;
|
|
108
|
+
}
|
|
109
|
+
export declare function jsonSchemaToOpenAIJsonSchema(schema: any): any;
|
|
110
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare const CronJobDefaultGroup = "default";
|
|
2
|
+
export type Job = {
|
|
3
|
+
id: string;
|
|
4
|
+
cronTime: string;
|
|
5
|
+
onTick: () => void;
|
|
6
|
+
};
|
|
7
|
+
export declare class CronJobManager {
|
|
8
|
+
private groups;
|
|
9
|
+
resetJobs(jobs: Job[], { groupId }?: {
|
|
10
|
+
groupId?: string;
|
|
11
|
+
}): void;
|
|
12
|
+
resetJob(job: Job, { groupId }?: {
|
|
13
|
+
groupId?: string;
|
|
14
|
+
}): void;
|
|
15
|
+
stopJob(jobId: string, { groupId }?: {
|
|
16
|
+
groupId?: string;
|
|
17
|
+
}): void;
|
|
18
|
+
destroyGroup({ groupId }: {
|
|
19
|
+
groupId: string;
|
|
20
|
+
}): void;
|
|
21
|
+
destroy(): void;
|
|
22
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { TransformStream } from 'stream/web';
|
|
2
|
+
export declare class ExtractMetadataTransform extends TransformStream<string, {
|
|
3
|
+
type: 'text';
|
|
4
|
+
text: string;
|
|
5
|
+
} | {
|
|
6
|
+
type: 'match';
|
|
7
|
+
text: string;
|
|
8
|
+
}> {
|
|
9
|
+
private buffer;
|
|
10
|
+
private cursor;
|
|
11
|
+
private state;
|
|
12
|
+
constructor({ start, end }: {
|
|
13
|
+
start: string;
|
|
14
|
+
end: string;
|
|
15
|
+
});
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare function copyFile(src: string, dest: string, { skip }?: {
|
|
2
|
+
skip?: (src: string) => boolean;
|
|
3
|
+
}): Promise<void>;
|
|
4
|
+
export declare function copyDirectory(src: string, dest: string, { skip }?: {
|
|
5
|
+
skip?: (src: string) => boolean;
|
|
6
|
+
}): Promise<void>;
|
|
7
|
+
export declare function copyRecursive(src: string, dest: string, { skip }?: {
|
|
8
|
+
skip?: (src: string) => boolean;
|
|
9
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import { GetAgentResult } from '../assistant/type';
|
|
2
|
+
import { DatasetObject } from '../libs/openapi/types';
|
|
3
|
+
export declare const HISTORY_API_ID: string;
|
|
4
|
+
export declare const KNOWLEDGE_API_ID: string;
|
|
5
|
+
export declare const MEMORY_API_ID: string;
|
|
6
|
+
export declare const buildInOpenAPI: {
|
|
7
|
+
'/api/messages': {
|
|
8
|
+
get: {
|
|
9
|
+
summary: string;
|
|
10
|
+
'x-summary-zh': string;
|
|
11
|
+
description: string;
|
|
12
|
+
'x-description-zh': string;
|
|
13
|
+
tags: string[];
|
|
14
|
+
parameters: ({
|
|
15
|
+
in: string;
|
|
16
|
+
name: string;
|
|
17
|
+
schema: {
|
|
18
|
+
type: string;
|
|
19
|
+
};
|
|
20
|
+
description: string;
|
|
21
|
+
'x-description-zh'?: undefined;
|
|
22
|
+
} | {
|
|
23
|
+
in: string;
|
|
24
|
+
name: string;
|
|
25
|
+
schema: {
|
|
26
|
+
type: string;
|
|
27
|
+
};
|
|
28
|
+
description: string;
|
|
29
|
+
'x-description-zh': string;
|
|
30
|
+
})[];
|
|
31
|
+
responses: {
|
|
32
|
+
'200': {
|
|
33
|
+
description: string;
|
|
34
|
+
'x-description-zh': string;
|
|
35
|
+
content: {
|
|
36
|
+
'application/json': {
|
|
37
|
+
schema: {
|
|
38
|
+
type: string;
|
|
39
|
+
properties: {
|
|
40
|
+
messages: {
|
|
41
|
+
type: string;
|
|
42
|
+
items: {
|
|
43
|
+
type: string;
|
|
44
|
+
properties: {
|
|
45
|
+
role: {
|
|
46
|
+
type: string;
|
|
47
|
+
};
|
|
48
|
+
content: {
|
|
49
|
+
type: string;
|
|
50
|
+
};
|
|
51
|
+
agentId: {
|
|
52
|
+
type: string;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
'x-id': string;
|
|
64
|
+
'x-did': string;
|
|
65
|
+
'x-path': string;
|
|
66
|
+
'x-method': string;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
'/api/datasets/{datasetId}/search': {
|
|
70
|
+
get: {
|
|
71
|
+
summary: string;
|
|
72
|
+
'x-summary-zh': string;
|
|
73
|
+
parameters: ({
|
|
74
|
+
name: string;
|
|
75
|
+
in: string;
|
|
76
|
+
required: boolean;
|
|
77
|
+
schema: {
|
|
78
|
+
type: string;
|
|
79
|
+
default?: undefined;
|
|
80
|
+
};
|
|
81
|
+
description: string;
|
|
82
|
+
} | {
|
|
83
|
+
name: string;
|
|
84
|
+
in: string;
|
|
85
|
+
required: boolean;
|
|
86
|
+
schema: {
|
|
87
|
+
type: string;
|
|
88
|
+
default: number;
|
|
89
|
+
};
|
|
90
|
+
description: string;
|
|
91
|
+
})[];
|
|
92
|
+
responses: {
|
|
93
|
+
'200': {
|
|
94
|
+
description: string;
|
|
95
|
+
content: {
|
|
96
|
+
'application/json': {
|
|
97
|
+
schema: {
|
|
98
|
+
type: string;
|
|
99
|
+
properties: {
|
|
100
|
+
docs: {
|
|
101
|
+
type: string;
|
|
102
|
+
items: {
|
|
103
|
+
type: string;
|
|
104
|
+
properties: {
|
|
105
|
+
title: {
|
|
106
|
+
type: string;
|
|
107
|
+
description: string;
|
|
108
|
+
};
|
|
109
|
+
content: {
|
|
110
|
+
type: string;
|
|
111
|
+
description: string;
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
'x-id': string;
|
|
123
|
+
'x-did': string;
|
|
124
|
+
'x-path': string;
|
|
125
|
+
'x-method': string;
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
'/api/memories/variable-by-query': {
|
|
129
|
+
get: {
|
|
130
|
+
summary: string;
|
|
131
|
+
'x-summary-zh': string;
|
|
132
|
+
parameters: ({
|
|
133
|
+
name: string;
|
|
134
|
+
in: string;
|
|
135
|
+
required: boolean;
|
|
136
|
+
schema: {
|
|
137
|
+
type: string;
|
|
138
|
+
enum?: undefined;
|
|
139
|
+
};
|
|
140
|
+
description: string;
|
|
141
|
+
} | {
|
|
142
|
+
name: string;
|
|
143
|
+
in: string;
|
|
144
|
+
required: boolean;
|
|
145
|
+
schema: {
|
|
146
|
+
type: string;
|
|
147
|
+
enum: string[];
|
|
148
|
+
};
|
|
149
|
+
description: string;
|
|
150
|
+
})[];
|
|
151
|
+
responses: {
|
|
152
|
+
'200': {
|
|
153
|
+
description: string;
|
|
154
|
+
content: {
|
|
155
|
+
'application/json': {
|
|
156
|
+
schema: {
|
|
157
|
+
type: string;
|
|
158
|
+
properties: {
|
|
159
|
+
datastores: {
|
|
160
|
+
type: string;
|
|
161
|
+
items: {
|
|
162
|
+
type: string;
|
|
163
|
+
properties: {
|
|
164
|
+
id: {
|
|
165
|
+
type: string;
|
|
166
|
+
description: string;
|
|
167
|
+
};
|
|
168
|
+
key: {
|
|
169
|
+
type: string;
|
|
170
|
+
description: string;
|
|
171
|
+
};
|
|
172
|
+
data: {
|
|
173
|
+
type: string;
|
|
174
|
+
description: string;
|
|
175
|
+
};
|
|
176
|
+
userId: {
|
|
177
|
+
type: string;
|
|
178
|
+
description: string;
|
|
179
|
+
};
|
|
180
|
+
projectId: {
|
|
181
|
+
type: string;
|
|
182
|
+
description: string;
|
|
183
|
+
};
|
|
184
|
+
sessionId: {
|
|
185
|
+
type: string;
|
|
186
|
+
description: string;
|
|
187
|
+
};
|
|
188
|
+
scope: {
|
|
189
|
+
type: string;
|
|
190
|
+
description: string;
|
|
191
|
+
enum: string[];
|
|
192
|
+
};
|
|
193
|
+
};
|
|
194
|
+
};
|
|
195
|
+
};
|
|
196
|
+
};
|
|
197
|
+
};
|
|
198
|
+
};
|
|
199
|
+
};
|
|
200
|
+
};
|
|
201
|
+
};
|
|
202
|
+
'x-id': string;
|
|
203
|
+
'x-did': string;
|
|
204
|
+
'x-path': string;
|
|
205
|
+
'x-method': string;
|
|
206
|
+
};
|
|
207
|
+
};
|
|
208
|
+
};
|
|
209
|
+
export declare const getBlockletAgent: () => Promise<{
|
|
210
|
+
agents: (GetAgentResult & {
|
|
211
|
+
openApi: DatasetObject;
|
|
212
|
+
})[];
|
|
213
|
+
agentsMap: {
|
|
214
|
+
[key: string]: GetAgentResult & {
|
|
215
|
+
openApi: DatasetObject;
|
|
216
|
+
};
|
|
217
|
+
};
|
|
218
|
+
openApis: DatasetObject[];
|
|
219
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const geti: (object: any, path: any, defaultValue?: any) => any;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { GetAgent, GetAgentResult } from '../assistant/type';
|
|
2
|
+
import { SecretParameter, SourceParameter } from '../types';
|
|
3
|
+
export declare function resolveSecretInputs(agent: GetAgentResult, { getAgent }: {
|
|
4
|
+
getAgent: GetAgent;
|
|
5
|
+
}): Promise<{
|
|
6
|
+
agent: GetAgentResult & Required<Pick<GetAgentResult, 'project'>>;
|
|
7
|
+
input: SourceParameter & {
|
|
8
|
+
key: string;
|
|
9
|
+
source: SecretParameter;
|
|
10
|
+
};
|
|
11
|
+
}[]>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function retry<T>(fn: () => Promise<T> | T, retries: number): Promise<T>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const nextId: () => string;
|
package/package.json
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@aigne/core",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "AIGNE core library",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"author": "Arcblock <blocklet@arcblock.io> https://github.com/blocklet",
|
|
9
|
+
"homepage": "https://github.com/blocklet/ai-studio#readme",
|
|
10
|
+
"license": "ISC",
|
|
11
|
+
"type": "module",
|
|
12
|
+
"main": "./cjs/index.js",
|
|
13
|
+
"module": "./index.js",
|
|
14
|
+
"types": "./index.d.js",
|
|
15
|
+
"files": [
|
|
16
|
+
"lib",
|
|
17
|
+
"LICENSE",
|
|
18
|
+
"package.json",
|
|
19
|
+
"README.md",
|
|
20
|
+
"tsconfig.json"
|
|
21
|
+
],
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "git+https://github.com/blocklet/ai-studio.git"
|
|
25
|
+
},
|
|
26
|
+
"scripts": {
|
|
27
|
+
"lint": "eslint src --ext .mjs,.js,.jsx,.ts,.tsx",
|
|
28
|
+
"lint:fix": "npm run lint -- --fix",
|
|
29
|
+
"build": "tsc --noEmit && run-p build:*",
|
|
30
|
+
"build:cjs": "tsc -p tsconfig.json --module commonjs --outDir lib/cjs",
|
|
31
|
+
"build:esm": "tsc -p tsconfig.json --module es2022 --outDir lib/esm",
|
|
32
|
+
"build:types": "tsc -p tsconfig.json --declaration --emitDeclarationOnly --outDir lib/types",
|
|
33
|
+
"clean": "rimraf cjs esm",
|
|
34
|
+
"prepublishOnly": "npm run build",
|
|
35
|
+
"test": "jest src/"
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"@abtnode/client": "^1.16.33",
|
|
39
|
+
"@blocklet/ai-kit": "^0.1.65",
|
|
40
|
+
"@blocklet/quickjs": "workspace:^",
|
|
41
|
+
"@blocklet/sdk": "^1.16.33",
|
|
42
|
+
"axios": "^1.7.5",
|
|
43
|
+
"cron": "^3.1.7",
|
|
44
|
+
"fast-deep-equal": "^3.1.3",
|
|
45
|
+
"fastq": "^1.17.1",
|
|
46
|
+
"fs-extra": "^11.2.0",
|
|
47
|
+
"glob": "^10.4.5",
|
|
48
|
+
"joi": "^17.13.3",
|
|
49
|
+
"js-base64": "^3.7.7",
|
|
50
|
+
"js-cookie": "^3.0.5",
|
|
51
|
+
"json-logic-js": "^2.0.5",
|
|
52
|
+
"json-stable-stringify": "^1.1.1",
|
|
53
|
+
"lodash": "^4.17.21",
|
|
54
|
+
"openapi3-ts": "^4.3.3",
|
|
55
|
+
"react-querybuilder": "^7.7.1",
|
|
56
|
+
"snowflake-uuid": "^1.0.0",
|
|
57
|
+
"ufo": "^1.5.4",
|
|
58
|
+
"yaml": "^2.5.0"
|
|
59
|
+
},
|
|
60
|
+
"devDependencies": {
|
|
61
|
+
"@tsconfig/recommended": "^1.0.8",
|
|
62
|
+
"npm-run-all": "^4.1.5",
|
|
63
|
+
"rimraf": "^6.0.1",
|
|
64
|
+
"ts-jest": "^29.2.5",
|
|
65
|
+
"typescript": "^5.5.4"
|
|
66
|
+
}
|
|
67
|
+
}
|
package/tsconfig.json
ADDED