alibabacloud-agentcore-sdk 0.1.0
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/LICENSE +202 -0
- package/README.md +189 -0
- package/dist/access-key-CkoHq3S8.d.cts +30 -0
- package/dist/access-key-CkoHq3S8.d.ts +30 -0
- package/dist/agent-sa-token-DD1Sb8P1.d.cts +14 -0
- package/dist/agent-sa-token-DD1Sb8P1.d.ts +14 -0
- package/dist/auth/index.cjs +36 -0
- package/dist/auth/index.cjs.map +1 -0
- package/dist/auth/index.d.cts +34 -0
- package/dist/auth/index.d.ts +34 -0
- package/dist/auth/index.js +36 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/bound-credentials-C1fM0thh.d.cts +39 -0
- package/dist/bound-credentials-DqT64Q2s.d.ts +39 -0
- package/dist/chunk-2E5EWEDG.cjs +142 -0
- package/dist/chunk-2E5EWEDG.cjs.map +1 -0
- package/dist/chunk-55XZZRKO.js +220 -0
- package/dist/chunk-55XZZRKO.js.map +1 -0
- package/dist/chunk-5JXA7JPS.js +29 -0
- package/dist/chunk-5JXA7JPS.js.map +1 -0
- package/dist/chunk-5RKN46UU.cjs +139 -0
- package/dist/chunk-5RKN46UU.cjs.map +1 -0
- package/dist/chunk-5ZOLHQXO.js +296 -0
- package/dist/chunk-5ZOLHQXO.js.map +1 -0
- package/dist/chunk-7Y263YIW.js +298 -0
- package/dist/chunk-7Y263YIW.js.map +1 -0
- package/dist/chunk-A3PF2SPD.cjs +141 -0
- package/dist/chunk-A3PF2SPD.cjs.map +1 -0
- package/dist/chunk-A3WMLVJC.cjs +141 -0
- package/dist/chunk-A3WMLVJC.cjs.map +1 -0
- package/dist/chunk-BVZ7H2F5.cjs +582 -0
- package/dist/chunk-BVZ7H2F5.cjs.map +1 -0
- package/dist/chunk-EGUKJE3Z.cjs +24 -0
- package/dist/chunk-EGUKJE3Z.cjs.map +1 -0
- package/dist/chunk-EKXZKKJJ.js +24 -0
- package/dist/chunk-EKXZKKJJ.js.map +1 -0
- package/dist/chunk-GYLT23D3.js +110 -0
- package/dist/chunk-GYLT23D3.js.map +1 -0
- package/dist/chunk-IF7LMBXC.js +306 -0
- package/dist/chunk-IF7LMBXC.js.map +1 -0
- package/dist/chunk-IUCLCPVV.js +113 -0
- package/dist/chunk-IUCLCPVV.js.map +1 -0
- package/dist/chunk-JSP7ZROS.cjs +95 -0
- package/dist/chunk-JSP7ZROS.cjs.map +1 -0
- package/dist/chunk-JW62DVIC.js +238 -0
- package/dist/chunk-JW62DVIC.js.map +1 -0
- package/dist/chunk-K3TE7625.js +139 -0
- package/dist/chunk-K3TE7625.js.map +1 -0
- package/dist/chunk-LE5P3SJW.cjs +16 -0
- package/dist/chunk-LE5P3SJW.cjs.map +1 -0
- package/dist/chunk-LXHW6OT4.cjs +77 -0
- package/dist/chunk-LXHW6OT4.cjs.map +1 -0
- package/dist/chunk-MICRSJ6R.js +48 -0
- package/dist/chunk-MICRSJ6R.js.map +1 -0
- package/dist/chunk-MWAHO47B.cjs +220 -0
- package/dist/chunk-MWAHO47B.cjs.map +1 -0
- package/dist/chunk-MZ5UWGXS.js +95 -0
- package/dist/chunk-MZ5UWGXS.js.map +1 -0
- package/dist/chunk-NZL3VPJ2.js +16 -0
- package/dist/chunk-NZL3VPJ2.js.map +1 -0
- package/dist/chunk-PC4FM2RP.cjs +180 -0
- package/dist/chunk-PC4FM2RP.cjs.map +1 -0
- package/dist/chunk-PKYET77D.cjs +296 -0
- package/dist/chunk-PKYET77D.cjs.map +1 -0
- package/dist/chunk-PTJPB27L.js +31 -0
- package/dist/chunk-PTJPB27L.js.map +1 -0
- package/dist/chunk-QIZO3A4Y.cjs +306 -0
- package/dist/chunk-QIZO3A4Y.cjs.map +1 -0
- package/dist/chunk-RBAY4MO2.js +202 -0
- package/dist/chunk-RBAY4MO2.js.map +1 -0
- package/dist/chunk-RHY7Y43E.js +582 -0
- package/dist/chunk-RHY7Y43E.js.map +1 -0
- package/dist/chunk-RQRI6RCG.cjs +238 -0
- package/dist/chunk-RQRI6RCG.cjs.map +1 -0
- package/dist/chunk-RYXL25AI.js +141 -0
- package/dist/chunk-RYXL25AI.js.map +1 -0
- package/dist/chunk-RZNQGEGJ.cjs +113 -0
- package/dist/chunk-RZNQGEGJ.cjs.map +1 -0
- package/dist/chunk-S7PWSJNP.cjs +48 -0
- package/dist/chunk-S7PWSJNP.cjs.map +1 -0
- package/dist/chunk-TWEO5XVM.cjs +298 -0
- package/dist/chunk-TWEO5XVM.cjs.map +1 -0
- package/dist/chunk-UBP5CHU7.js +142 -0
- package/dist/chunk-UBP5CHU7.js.map +1 -0
- package/dist/chunk-ULJTQSLE.cjs +35 -0
- package/dist/chunk-ULJTQSLE.cjs.map +1 -0
- package/dist/chunk-UWPKFJYM.js +77 -0
- package/dist/chunk-UWPKFJYM.js.map +1 -0
- package/dist/chunk-WKZUYPDS.js +180 -0
- package/dist/chunk-WKZUYPDS.js.map +1 -0
- package/dist/chunk-YZP55W7S.cjs +29 -0
- package/dist/chunk-YZP55W7S.cjs.map +1 -0
- package/dist/chunk-ZELRQU4J.cjs +31 -0
- package/dist/chunk-ZELRQU4J.cjs.map +1 -0
- package/dist/chunk-ZLKYXRNM.js +141 -0
- package/dist/chunk-ZLKYXRNM.js.map +1 -0
- package/dist/chunk-ZLQ2IBTC.cjs +110 -0
- package/dist/chunk-ZLQ2IBTC.cjs.map +1 -0
- package/dist/chunk-ZTWLCHCO.cjs +202 -0
- package/dist/chunk-ZTWLCHCO.cjs.map +1 -0
- package/dist/chunk-ZWQBAJ5O.js +35 -0
- package/dist/chunk-ZWQBAJ5O.js.map +1 -0
- package/dist/client-DDU4-ygJ.d.cts +72 -0
- package/dist/client-pDzS7EZR.d.ts +72 -0
- package/dist/collaboration/index.cjs +44 -0
- package/dist/collaboration/index.cjs.map +1 -0
- package/dist/collaboration/index.d.cts +73 -0
- package/dist/collaboration/index.d.ts +73 -0
- package/dist/collaboration/index.js +44 -0
- package/dist/collaboration/index.js.map +1 -0
- package/dist/common-BSXkQfxI.d.cts +25 -0
- package/dist/common-BSXkQfxI.d.ts +25 -0
- package/dist/common-DRdI-75k.d.ts +8 -0
- package/dist/common-_vxreiEW.d.cts +8 -0
- package/dist/config-CMkmMtx1.d.cts +20 -0
- package/dist/config-CMkmMtx1.d.ts +20 -0
- package/dist/context-M9rOTifU.d.cts +12 -0
- package/dist/context-M9rOTifU.d.ts +12 -0
- package/dist/controller-DWs3Sy04.d.cts +9 -0
- package/dist/controller-DmI4L4sP.d.ts +9 -0
- package/dist/controlplane/index.cjs +13 -0
- package/dist/controlplane/index.cjs.map +1 -0
- package/dist/controlplane/index.d.cts +66 -0
- package/dist/controlplane/index.d.ts +66 -0
- package/dist/controlplane/index.js +13 -0
- package/dist/controlplane/index.js.map +1 -0
- package/dist/errors-BjGO6N10.d.ts +93 -0
- package/dist/errors-D9OtcR-o.d.cts +93 -0
- package/dist/event-converters-BIn8odqo.d.ts +38 -0
- package/dist/event-converters-Cn_NeGyQ.d.cts +38 -0
- package/dist/google-adk-model-N47R7GB2.js +208 -0
- package/dist/google-adk-model-N47R7GB2.js.map +1 -0
- package/dist/google-adk-model-PDBKY5YZ.cjs +208 -0
- package/dist/google-adk-model-PDBKY5YZ.cjs.map +1 -0
- package/dist/index.cjs +322 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +78 -0
- package/dist/index.d.ts +78 -0
- package/dist/index.js +322 -0
- package/dist/index.js.map +1 -0
- package/dist/integrations/ai-sdk.cjs +15 -0
- package/dist/integrations/ai-sdk.cjs.map +1 -0
- package/dist/integrations/ai-sdk.d.cts +21 -0
- package/dist/integrations/ai-sdk.d.ts +21 -0
- package/dist/integrations/ai-sdk.js +15 -0
- package/dist/integrations/ai-sdk.js.map +1 -0
- package/dist/integrations/google-adk.cjs +90 -0
- package/dist/integrations/google-adk.cjs.map +1 -0
- package/dist/integrations/google-adk.d.cts +46 -0
- package/dist/integrations/google-adk.d.ts +46 -0
- package/dist/integrations/google-adk.js +90 -0
- package/dist/integrations/google-adk.js.map +1 -0
- package/dist/integrations/langchain.cjs +95 -0
- package/dist/integrations/langchain.cjs.map +1 -0
- package/dist/integrations/langchain.d.cts +52 -0
- package/dist/integrations/langchain.d.ts +52 -0
- package/dist/integrations/langchain.js +95 -0
- package/dist/integrations/langchain.js.map +1 -0
- package/dist/integrations/langgraph.cjs +30 -0
- package/dist/integrations/langgraph.cjs.map +1 -0
- package/dist/integrations/langgraph.d.cts +53 -0
- package/dist/integrations/langgraph.d.ts +53 -0
- package/dist/integrations/langgraph.js +30 -0
- package/dist/integrations/langgraph.js.map +1 -0
- package/dist/integrations/mastra.cjs +108 -0
- package/dist/integrations/mastra.cjs.map +1 -0
- package/dist/integrations/mastra.d.cts +47 -0
- package/dist/integrations/mastra.d.ts +47 -0
- package/dist/integrations/mastra.js +108 -0
- package/dist/integrations/mastra.js.map +1 -0
- package/dist/langchain-adapter-DFJdEX04.d.cts +47 -0
- package/dist/langchain-adapter-DJsyjm5V.d.ts +47 -0
- package/dist/langchain-provider-NF5GIDQV.cjs +227 -0
- package/dist/langchain-provider-NF5GIDQV.cjs.map +1 -0
- package/dist/langchain-provider-PHL4UWNF.js +227 -0
- package/dist/langchain-provider-PHL4UWNF.js.map +1 -0
- package/dist/loader-DrIQ37nm.d.ts +38 -0
- package/dist/loader-eWuJ2GSL.d.cts +38 -0
- package/dist/logging-C8GLLg1f.d.cts +9 -0
- package/dist/logging-C8GLLg1f.d.ts +9 -0
- package/dist/managed-CwLx9h4C.d.cts +32 -0
- package/dist/managed-D9eQK1ut.d.ts +32 -0
- package/dist/mcp/index.cjs +12 -0
- package/dist/mcp/index.cjs.map +1 -0
- package/dist/mcp/index.d.cts +62 -0
- package/dist/mcp/index.d.ts +62 -0
- package/dist/mcp/index.js +12 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/memory/index.cjs +12 -0
- package/dist/memory/index.cjs.map +1 -0
- package/dist/memory/index.d.cts +113 -0
- package/dist/memory/index.d.ts +113 -0
- package/dist/memory/index.js +12 -0
- package/dist/memory/index.js.map +1 -0
- package/dist/model/index.cjs +16 -0
- package/dist/model/index.cjs.map +1 -0
- package/dist/model/index.d.cts +129 -0
- package/dist/model/index.d.ts +129 -0
- package/dist/model/index.js +16 -0
- package/dist/model/index.js.map +1 -0
- package/dist/model-CkYHzHPk.d.cts +50 -0
- package/dist/model-CkYHzHPk.d.ts +50 -0
- package/dist/runtime/index.cjs +49 -0
- package/dist/runtime/index.cjs.map +1 -0
- package/dist/runtime/index.d.cts +73 -0
- package/dist/runtime/index.d.ts +73 -0
- package/dist/runtime/index.js +49 -0
- package/dist/runtime/index.js.map +1 -0
- package/dist/server/index.cjs +604 -0
- package/dist/server/index.cjs.map +1 -0
- package/dist/server/index.d.cts +69 -0
- package/dist/server/index.d.ts +69 -0
- package/dist/server/index.js +604 -0
- package/dist/server/index.js.map +1 -0
- package/dist/skill/index.cjs +14 -0
- package/dist/skill/index.cjs.map +1 -0
- package/dist/skill/index.d.cts +16 -0
- package/dist/skill/index.d.ts +16 -0
- package/dist/skill/index.js +14 -0
- package/dist/skill/index.js.map +1 -0
- package/package.json +292 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { a as ModelCallOptions } from '../client-pDzS7EZR.js';
|
|
2
|
+
export { D as DirectModelOptions, H as HeadersProvider, M as ModelClient, b as ModelMessage, c as ModelParameters, d as ModelProtocol, e as ModelResponse, f as ModelSettings, m as managedModelProtocol, g as modelBaseURL } from '../client-pDzS7EZR.js';
|
|
3
|
+
import * as _ai_sdk_provider from '@ai-sdk/provider';
|
|
4
|
+
import { LanguageModelV3, EmbeddingModelV3 } from '@ai-sdk/provider';
|
|
5
|
+
import * as ai from 'ai';
|
|
6
|
+
import { ToolSet, ModelMessage, generateText, streamText, embedMany } from 'ai';
|
|
7
|
+
import { inspect } from 'node:util';
|
|
8
|
+
import { L as Logger } from '../logging-C8GLLg1f.js';
|
|
9
|
+
import '../config-CMkmMtx1.js';
|
|
10
|
+
import '../controlplane/index.js';
|
|
11
|
+
import '../access-key-CkoHq3S8.js';
|
|
12
|
+
|
|
13
|
+
interface DirectProviderOptions {
|
|
14
|
+
/** A configured AI SDK provider model. The provider owns its endpoint and auth. */
|
|
15
|
+
languageModel: LanguageModelV3;
|
|
16
|
+
embeddingModel?: EmbeddingModelV3;
|
|
17
|
+
timeoutMs?: number;
|
|
18
|
+
logger?: Logger;
|
|
19
|
+
}
|
|
20
|
+
type ProviderGenerateOptions<T extends ToolSet = ToolSet> = Omit<Parameters<typeof generateText<T>>[0], 'model' | 'messages' | 'prompt' | 'abortSignal'>;
|
|
21
|
+
type ProviderStreamOptions<T extends ToolSet = ToolSet> = Omit<Parameters<typeof streamText<T>>[0], 'model' | 'messages' | 'prompt' | 'abortSignal'>;
|
|
22
|
+
type ProviderEmbeddingOptions = Omit<Parameters<typeof embedMany>[0], 'model' | 'values' | 'abortSignal'>;
|
|
23
|
+
/** Multi-provider Direct models use AI SDK messages/results, not a simulated OpenAI protocol. */
|
|
24
|
+
declare class ProviderModelClient {
|
|
25
|
+
readonly settings: Readonly<{
|
|
26
|
+
model: string;
|
|
27
|
+
provider: string;
|
|
28
|
+
}>;
|
|
29
|
+
readonly languageModel: LanguageModelV3;
|
|
30
|
+
private readonly lifetime;
|
|
31
|
+
private readonly logger;
|
|
32
|
+
private readonly timeoutMs;
|
|
33
|
+
private readonly embeddingModel?;
|
|
34
|
+
constructor(options: DirectProviderOptions);
|
|
35
|
+
completion<T extends ToolSet = ToolSet>(messages: readonly ModelMessage[], parameters?: ProviderGenerateOptions<T>, options?: ModelCallOptions): Promise<ai.GenerateTextResult<T, ai.OutputInterface<string, string, any>>>;
|
|
36
|
+
invoke<T extends ToolSet = ToolSet>(messages: readonly ModelMessage[], parameters?: ProviderGenerateOptions<T>, options?: ModelCallOptions): Promise<ai.GenerateTextResult<T, ai.OutputInterface<string, string, any>>>;
|
|
37
|
+
stream<T extends ToolSet = ToolSet>(messages: readonly ModelMessage[], parameters?: ProviderStreamOptions<T>, options?: ModelCallOptions): AsyncGenerator<{
|
|
38
|
+
type: "text-start";
|
|
39
|
+
id: string;
|
|
40
|
+
providerMetadata?: ai.ProviderMetadata;
|
|
41
|
+
} | {
|
|
42
|
+
type: "text-end";
|
|
43
|
+
id: string;
|
|
44
|
+
providerMetadata?: ai.ProviderMetadata;
|
|
45
|
+
} | {
|
|
46
|
+
type: "text-delta";
|
|
47
|
+
id: string;
|
|
48
|
+
providerMetadata?: ai.ProviderMetadata;
|
|
49
|
+
text: string;
|
|
50
|
+
} | {
|
|
51
|
+
type: "reasoning-start";
|
|
52
|
+
id: string;
|
|
53
|
+
providerMetadata?: ai.ProviderMetadata;
|
|
54
|
+
} | {
|
|
55
|
+
type: "reasoning-end";
|
|
56
|
+
id: string;
|
|
57
|
+
providerMetadata?: ai.ProviderMetadata;
|
|
58
|
+
} | {
|
|
59
|
+
type: "reasoning-delta";
|
|
60
|
+
providerMetadata?: ai.ProviderMetadata;
|
|
61
|
+
id: string;
|
|
62
|
+
text: string;
|
|
63
|
+
} | {
|
|
64
|
+
type: "tool-input-start";
|
|
65
|
+
id: string;
|
|
66
|
+
toolName: string;
|
|
67
|
+
providerMetadata?: ai.ProviderMetadata;
|
|
68
|
+
toolMetadata?: _ai_sdk_provider.JSONObject;
|
|
69
|
+
providerExecuted?: boolean;
|
|
70
|
+
dynamic?: boolean;
|
|
71
|
+
title?: string;
|
|
72
|
+
} | {
|
|
73
|
+
type: "tool-input-end";
|
|
74
|
+
id: string;
|
|
75
|
+
providerMetadata?: ai.ProviderMetadata;
|
|
76
|
+
} | {
|
|
77
|
+
type: "tool-input-delta";
|
|
78
|
+
id: string;
|
|
79
|
+
delta: string;
|
|
80
|
+
providerMetadata?: ai.ProviderMetadata;
|
|
81
|
+
} | ({
|
|
82
|
+
type: "source";
|
|
83
|
+
} & _ai_sdk_provider.LanguageModelV3Source) | {
|
|
84
|
+
type: "file";
|
|
85
|
+
file: ai.Experimental_GeneratedImage;
|
|
86
|
+
providerMetadata?: ai.ProviderMetadata;
|
|
87
|
+
} | {
|
|
88
|
+
type: "start-step";
|
|
89
|
+
request: ai.LanguageModelRequestMetadata;
|
|
90
|
+
warnings: ai.CallWarning[];
|
|
91
|
+
} | {
|
|
92
|
+
type: "finish-step";
|
|
93
|
+
response: ai.LanguageModelResponseMetadata;
|
|
94
|
+
usage: ai.LanguageModelUsage;
|
|
95
|
+
finishReason: ai.FinishReason;
|
|
96
|
+
rawFinishReason: string | undefined;
|
|
97
|
+
providerMetadata: ai.ProviderMetadata | undefined;
|
|
98
|
+
} | {
|
|
99
|
+
type: "start";
|
|
100
|
+
} | {
|
|
101
|
+
type: "finish";
|
|
102
|
+
finishReason: ai.FinishReason;
|
|
103
|
+
rawFinishReason: string | undefined;
|
|
104
|
+
totalUsage: ai.LanguageModelUsage;
|
|
105
|
+
} | {
|
|
106
|
+
type: "abort";
|
|
107
|
+
reason?: string;
|
|
108
|
+
} | {
|
|
109
|
+
type: "raw";
|
|
110
|
+
rawValue: unknown;
|
|
111
|
+
} | ({
|
|
112
|
+
type: "tool-call";
|
|
113
|
+
} & ai.TypedToolCall<T>) | ({
|
|
114
|
+
type: "tool-result";
|
|
115
|
+
} & ai.TypedToolResult<T>) | ({
|
|
116
|
+
type: "tool-error";
|
|
117
|
+
} & ai.TypedToolError<T>) | ({
|
|
118
|
+
type: "tool-output-denied";
|
|
119
|
+
} & ai.StaticToolOutputDenied<T>) | ai.ToolApprovalRequestOutput<T>, void, unknown>;
|
|
120
|
+
embedding(input: string | readonly string[], parameters?: ProviderEmbeddingOptions, options?: ModelCallOptions): Promise<ai.EmbedManyResult>;
|
|
121
|
+
close(): void;
|
|
122
|
+
[inspect.custom](): string;
|
|
123
|
+
toJSON(): string;
|
|
124
|
+
private signal;
|
|
125
|
+
private request;
|
|
126
|
+
private failed;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export { type DirectProviderOptions, ModelCallOptions, type ProviderEmbeddingOptions, type ProviderGenerateOptions, ProviderModelClient, type ProviderStreamOptions };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ModelClient,
|
|
3
|
+
ProviderModelClient,
|
|
4
|
+
managedModelProtocol,
|
|
5
|
+
modelBaseURL
|
|
6
|
+
} from "../chunk-7Y263YIW.js";
|
|
7
|
+
import "../chunk-K3TE7625.js";
|
|
8
|
+
import "../chunk-NZL3VPJ2.js";
|
|
9
|
+
import "../chunk-MZ5UWGXS.js";
|
|
10
|
+
export {
|
|
11
|
+
ModelClient,
|
|
12
|
+
ProviderModelClient,
|
|
13
|
+
managedModelProtocol,
|
|
14
|
+
modelBaseURL
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
type MessageRole = 'developer' | 'system' | 'user' | 'assistant' | 'tool' | 'activity' | 'reasoning';
|
|
2
|
+
interface ToolCall {
|
|
3
|
+
id: string;
|
|
4
|
+
type: string;
|
|
5
|
+
function: Record<string, unknown>;
|
|
6
|
+
}
|
|
7
|
+
interface Message {
|
|
8
|
+
role: MessageRole;
|
|
9
|
+
content?: string | ReadonlyArray<Record<string, unknown>> | null;
|
|
10
|
+
id?: string;
|
|
11
|
+
name?: string;
|
|
12
|
+
toolCalls?: ToolCall[];
|
|
13
|
+
toolCallId?: string;
|
|
14
|
+
}
|
|
15
|
+
interface AgentTool {
|
|
16
|
+
name: string;
|
|
17
|
+
description: string;
|
|
18
|
+
parameters: Record<string, unknown>;
|
|
19
|
+
}
|
|
20
|
+
interface AgentRequest {
|
|
21
|
+
protocol: string;
|
|
22
|
+
messages: Message[];
|
|
23
|
+
tools?: AgentTool[];
|
|
24
|
+
stream: boolean;
|
|
25
|
+
rawRequest: Request;
|
|
26
|
+
rawPayload: Record<string, unknown>;
|
|
27
|
+
/** Forward this signal to model/tool calls and any long-running application work. */
|
|
28
|
+
signal: AbortSignal;
|
|
29
|
+
}
|
|
30
|
+
declare const EventType: {
|
|
31
|
+
readonly TEXT: "TEXT";
|
|
32
|
+
readonly TEXT_END: "TEXT_END";
|
|
33
|
+
readonly REASONING: "REASONING";
|
|
34
|
+
readonly REASONING_END: "REASONING_END";
|
|
35
|
+
readonly TOOL_CALL: "TOOL_CALL";
|
|
36
|
+
readonly TOOL_CALL_CHUNK: "TOOL_CALL_CHUNK";
|
|
37
|
+
readonly TOOL_RESULT: "TOOL_RESULT";
|
|
38
|
+
readonly ERROR: "ERROR";
|
|
39
|
+
};
|
|
40
|
+
declare class AgentEvent {
|
|
41
|
+
readonly event: string;
|
|
42
|
+
readonly data: Record<string, unknown>;
|
|
43
|
+
constructor(event: string, data: Record<string, unknown>);
|
|
44
|
+
get type(): string;
|
|
45
|
+
toJSON(): Record<string, unknown>;
|
|
46
|
+
}
|
|
47
|
+
type AgentOutput = string | AgentEvent | undefined | null;
|
|
48
|
+
type AgentResult = AgentOutput | Iterable<AgentOutput> | AsyncIterable<AgentOutput>;
|
|
49
|
+
|
|
50
|
+
export { AgentEvent as A, EventType as E, type Message as M, type ToolCall as T, type AgentRequest as a, type AgentResult as b, type AgentOutput as c, type AgentTool as d, type MessageRole as e };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
type MessageRole = 'developer' | 'system' | 'user' | 'assistant' | 'tool' | 'activity' | 'reasoning';
|
|
2
|
+
interface ToolCall {
|
|
3
|
+
id: string;
|
|
4
|
+
type: string;
|
|
5
|
+
function: Record<string, unknown>;
|
|
6
|
+
}
|
|
7
|
+
interface Message {
|
|
8
|
+
role: MessageRole;
|
|
9
|
+
content?: string | ReadonlyArray<Record<string, unknown>> | null;
|
|
10
|
+
id?: string;
|
|
11
|
+
name?: string;
|
|
12
|
+
toolCalls?: ToolCall[];
|
|
13
|
+
toolCallId?: string;
|
|
14
|
+
}
|
|
15
|
+
interface AgentTool {
|
|
16
|
+
name: string;
|
|
17
|
+
description: string;
|
|
18
|
+
parameters: Record<string, unknown>;
|
|
19
|
+
}
|
|
20
|
+
interface AgentRequest {
|
|
21
|
+
protocol: string;
|
|
22
|
+
messages: Message[];
|
|
23
|
+
tools?: AgentTool[];
|
|
24
|
+
stream: boolean;
|
|
25
|
+
rawRequest: Request;
|
|
26
|
+
rawPayload: Record<string, unknown>;
|
|
27
|
+
/** Forward this signal to model/tool calls and any long-running application work. */
|
|
28
|
+
signal: AbortSignal;
|
|
29
|
+
}
|
|
30
|
+
declare const EventType: {
|
|
31
|
+
readonly TEXT: "TEXT";
|
|
32
|
+
readonly TEXT_END: "TEXT_END";
|
|
33
|
+
readonly REASONING: "REASONING";
|
|
34
|
+
readonly REASONING_END: "REASONING_END";
|
|
35
|
+
readonly TOOL_CALL: "TOOL_CALL";
|
|
36
|
+
readonly TOOL_CALL_CHUNK: "TOOL_CALL_CHUNK";
|
|
37
|
+
readonly TOOL_RESULT: "TOOL_RESULT";
|
|
38
|
+
readonly ERROR: "ERROR";
|
|
39
|
+
};
|
|
40
|
+
declare class AgentEvent {
|
|
41
|
+
readonly event: string;
|
|
42
|
+
readonly data: Record<string, unknown>;
|
|
43
|
+
constructor(event: string, data: Record<string, unknown>);
|
|
44
|
+
get type(): string;
|
|
45
|
+
toJSON(): Record<string, unknown>;
|
|
46
|
+
}
|
|
47
|
+
type AgentOutput = string | AgentEvent | undefined | null;
|
|
48
|
+
type AgentResult = AgentOutput | Iterable<AgentOutput> | AsyncIterable<AgentOutput>;
|
|
49
|
+
|
|
50
|
+
export { AgentEvent as A, EventType as E, type Message as M, type ToolCall as T, type AgentRequest as a, type AgentResult as b, type AgentOutput as c, type AgentTool as d, type MessageRole as e };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
var _chunkBVZ7H2F5cjs = require('../chunk-BVZ7H2F5.cjs');
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
var _chunkULJTQSLEcjs = require('../chunk-ULJTQSLE.cjs');
|
|
16
|
+
require('../chunk-YZP55W7S.cjs');
|
|
17
|
+
require('../chunk-2E5EWEDG.cjs');
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
var _chunk5RKN46UUcjs = require('../chunk-5RKN46UU.cjs');
|
|
27
|
+
require('../chunk-LE5P3SJW.cjs');
|
|
28
|
+
require('../chunk-JSP7ZROS.cjs');
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
exports.DEFAULT_CONFIG_PATH = _chunk5RKN46UUcjs.DEFAULT_CONFIG_PATH; exports.DEFAULT_ENV_PATH = _chunkBVZ7H2F5cjs.DEFAULT_ENV_PATH; exports.DebugRuntimeSource = _chunkBVZ7H2F5cjs.DebugRuntimeSource; exports.DebugToken = _chunkBVZ7H2F5cjs.DebugToken; exports.ManagedRuntimeSource = _chunkBVZ7H2F5cjs.ManagedRuntimeSource; exports.RequestContext = _chunkULJTQSLEcjs.RequestContext; exports.RuntimeEnvironmentProvider = _chunkBVZ7H2F5cjs.RuntimeEnvironmentProvider; exports.createRuntimeSource = _chunkBVZ7H2F5cjs.createRuntimeSource; exports.currentContext = _chunkULJTQSLEcjs.currentContext; exports.httpUrl = _chunk5RKN46UUcjs.httpUrl; exports.loadAgentConfig = _chunk5RKN46UUcjs.loadAgentConfig; exports.object = _chunk5RKN46UUcjs.object; exports.parseAgentConfig = _chunk5RKN46UUcjs.parseAgentConfig; exports.parseAgentConfigMapping = _chunk5RKN46UUcjs.parseAgentConfigMapping; exports.parseDebugToken = _chunkBVZ7H2F5cjs.parseDebugToken; exports.parseRuntimeEnvironment = _chunkBVZ7H2F5cjs.parseRuntimeEnvironment; exports.requiredString = _chunk5RKN46UUcjs.requiredString; exports.useContext = _chunkULJTQSLEcjs.useContext;
|
|
49
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/Users/zhuoguang/Documents/Code/collaborate/hiclaw/agentcore-sdk-nodejs/dist/runtime/index.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,yDAA8B;AAC9B;AACE;AACA;AACA;AACF,yDAA8B;AAC9B,iCAA8B;AAC9B,iCAA8B;AAC9B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACF,yDAA8B;AAC9B,iCAA8B;AAC9B,iCAA8B;AAC9B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,umCAAC","file":"/Users/zhuoguang/Documents/Code/collaborate/hiclaw/agentcore-sdk-nodejs/dist/runtime/index.cjs"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
export { A as AgentConfig, D as DEFAULT_CONFIG_PATH, h as httpUrl, l as loadAgentConfig, o as object, p as parseAgentConfig, a as parseAgentConfigMapping, r as requiredString } from '../config-CMkmMtx1.cjs';
|
|
2
|
+
export { R as RequestContext, c as currentContext, u as useContext } from '../context-M9rOTifU.cjs';
|
|
3
|
+
import { R as RuntimeSource, a as RuntimeBindings, M as ManagedRuntimeOptions } from '../managed-CwLx9h4C.cjs';
|
|
4
|
+
export { b as ManagedRuntimeSource } from '../managed-CwLx9h4C.cjs';
|
|
5
|
+
import { inspect } from 'node:util';
|
|
6
|
+
import { C as ControllerOptions } from '../controller-DWs3Sy04.cjs';
|
|
7
|
+
import { A as AgentSATokenSource } from '../agent-sa-token-DD1Sb8P1.cjs';
|
|
8
|
+
import '../logging-C8GLLg1f.cjs';
|
|
9
|
+
|
|
10
|
+
declare const DEFAULT_ENV_PATH = "/var/run/agentcore/agent/env";
|
|
11
|
+
interface RuntimeEnvironment {
|
|
12
|
+
controllerUrl: string;
|
|
13
|
+
agentSATokenFile: string;
|
|
14
|
+
controlPlaneEndpoint?: string;
|
|
15
|
+
}
|
|
16
|
+
declare function parseRuntimeEnvironment(text: string): Record<string, string>;
|
|
17
|
+
declare class RuntimeEnvironmentProvider {
|
|
18
|
+
readonly path: string;
|
|
19
|
+
constructor(path?: string);
|
|
20
|
+
read(): Promise<Record<string, string>>;
|
|
21
|
+
snapshot(): Promise<RuntimeEnvironment>;
|
|
22
|
+
value(name: string): Promise<string>;
|
|
23
|
+
taskServiceEndpoint(): Promise<string>;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
declare class DebugToken {
|
|
27
|
+
#private;
|
|
28
|
+
readonly controllerUrl: string;
|
|
29
|
+
readonly modelGatewayUrl: string;
|
|
30
|
+
readonly matrixUrl: string;
|
|
31
|
+
readonly product = "agentcore";
|
|
32
|
+
constructor(jwtToken: string, controllerUrl: string, modelGatewayUrl: string, matrixUrl: string);
|
|
33
|
+
get jwtToken(): string;
|
|
34
|
+
[inspect.custom](): string;
|
|
35
|
+
toJSON(): string;
|
|
36
|
+
}
|
|
37
|
+
declare function parseDebugToken(value: string): DebugToken;
|
|
38
|
+
interface DebugRuntimeOptions extends ControllerOptions {
|
|
39
|
+
controlPlaneEndpoint?: string;
|
|
40
|
+
}
|
|
41
|
+
declare class DebugRuntimeSource implements RuntimeSource, AgentSATokenSource {
|
|
42
|
+
#private;
|
|
43
|
+
private readonly token;
|
|
44
|
+
private readonly options;
|
|
45
|
+
private saExpiresAt;
|
|
46
|
+
private jwtExpiresAt;
|
|
47
|
+
private bindings?;
|
|
48
|
+
private resolving?;
|
|
49
|
+
private exchanging?;
|
|
50
|
+
private refreshTimer?;
|
|
51
|
+
private readonly lifetime;
|
|
52
|
+
private readonly configLoader;
|
|
53
|
+
private readonly controller;
|
|
54
|
+
private readonly logger;
|
|
55
|
+
constructor(token: DebugToken, options?: DebugRuntimeOptions);
|
|
56
|
+
get matrixUrl(): string;
|
|
57
|
+
resolve(): Promise<RuntimeBindings>;
|
|
58
|
+
get(): Promise<string>;
|
|
59
|
+
refresh(current: string): Promise<string>;
|
|
60
|
+
loadTeamsConfig(): Promise<Uint8Array | undefined>;
|
|
61
|
+
exchangeMatrixToken(): Promise<string>;
|
|
62
|
+
close(): void;
|
|
63
|
+
[inspect.custom](): string;
|
|
64
|
+
toJSON(): string;
|
|
65
|
+
private load;
|
|
66
|
+
private exchange;
|
|
67
|
+
private scheduleRefresh;
|
|
68
|
+
private backgroundRefresh;
|
|
69
|
+
private requestToken;
|
|
70
|
+
}
|
|
71
|
+
declare function createRuntimeSource(options?: ManagedRuntimeOptions): RuntimeSource;
|
|
72
|
+
|
|
73
|
+
export { DEFAULT_ENV_PATH, type DebugRuntimeOptions, DebugRuntimeSource, DebugToken, ManagedRuntimeOptions, RuntimeBindings, type RuntimeEnvironment, RuntimeEnvironmentProvider, RuntimeSource, createRuntimeSource, parseDebugToken, parseRuntimeEnvironment };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
export { A as AgentConfig, D as DEFAULT_CONFIG_PATH, h as httpUrl, l as loadAgentConfig, o as object, p as parseAgentConfig, a as parseAgentConfigMapping, r as requiredString } from '../config-CMkmMtx1.js';
|
|
2
|
+
export { R as RequestContext, c as currentContext, u as useContext } from '../context-M9rOTifU.js';
|
|
3
|
+
import { R as RuntimeSource, a as RuntimeBindings, M as ManagedRuntimeOptions } from '../managed-D9eQK1ut.js';
|
|
4
|
+
export { b as ManagedRuntimeSource } from '../managed-D9eQK1ut.js';
|
|
5
|
+
import { inspect } from 'node:util';
|
|
6
|
+
import { C as ControllerOptions } from '../controller-DmI4L4sP.js';
|
|
7
|
+
import { A as AgentSATokenSource } from '../agent-sa-token-DD1Sb8P1.js';
|
|
8
|
+
import '../logging-C8GLLg1f.js';
|
|
9
|
+
|
|
10
|
+
declare const DEFAULT_ENV_PATH = "/var/run/agentcore/agent/env";
|
|
11
|
+
interface RuntimeEnvironment {
|
|
12
|
+
controllerUrl: string;
|
|
13
|
+
agentSATokenFile: string;
|
|
14
|
+
controlPlaneEndpoint?: string;
|
|
15
|
+
}
|
|
16
|
+
declare function parseRuntimeEnvironment(text: string): Record<string, string>;
|
|
17
|
+
declare class RuntimeEnvironmentProvider {
|
|
18
|
+
readonly path: string;
|
|
19
|
+
constructor(path?: string);
|
|
20
|
+
read(): Promise<Record<string, string>>;
|
|
21
|
+
snapshot(): Promise<RuntimeEnvironment>;
|
|
22
|
+
value(name: string): Promise<string>;
|
|
23
|
+
taskServiceEndpoint(): Promise<string>;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
declare class DebugToken {
|
|
27
|
+
#private;
|
|
28
|
+
readonly controllerUrl: string;
|
|
29
|
+
readonly modelGatewayUrl: string;
|
|
30
|
+
readonly matrixUrl: string;
|
|
31
|
+
readonly product = "agentcore";
|
|
32
|
+
constructor(jwtToken: string, controllerUrl: string, modelGatewayUrl: string, matrixUrl: string);
|
|
33
|
+
get jwtToken(): string;
|
|
34
|
+
[inspect.custom](): string;
|
|
35
|
+
toJSON(): string;
|
|
36
|
+
}
|
|
37
|
+
declare function parseDebugToken(value: string): DebugToken;
|
|
38
|
+
interface DebugRuntimeOptions extends ControllerOptions {
|
|
39
|
+
controlPlaneEndpoint?: string;
|
|
40
|
+
}
|
|
41
|
+
declare class DebugRuntimeSource implements RuntimeSource, AgentSATokenSource {
|
|
42
|
+
#private;
|
|
43
|
+
private readonly token;
|
|
44
|
+
private readonly options;
|
|
45
|
+
private saExpiresAt;
|
|
46
|
+
private jwtExpiresAt;
|
|
47
|
+
private bindings?;
|
|
48
|
+
private resolving?;
|
|
49
|
+
private exchanging?;
|
|
50
|
+
private refreshTimer?;
|
|
51
|
+
private readonly lifetime;
|
|
52
|
+
private readonly configLoader;
|
|
53
|
+
private readonly controller;
|
|
54
|
+
private readonly logger;
|
|
55
|
+
constructor(token: DebugToken, options?: DebugRuntimeOptions);
|
|
56
|
+
get matrixUrl(): string;
|
|
57
|
+
resolve(): Promise<RuntimeBindings>;
|
|
58
|
+
get(): Promise<string>;
|
|
59
|
+
refresh(current: string): Promise<string>;
|
|
60
|
+
loadTeamsConfig(): Promise<Uint8Array | undefined>;
|
|
61
|
+
exchangeMatrixToken(): Promise<string>;
|
|
62
|
+
close(): void;
|
|
63
|
+
[inspect.custom](): string;
|
|
64
|
+
toJSON(): string;
|
|
65
|
+
private load;
|
|
66
|
+
private exchange;
|
|
67
|
+
private scheduleRefresh;
|
|
68
|
+
private backgroundRefresh;
|
|
69
|
+
private requestToken;
|
|
70
|
+
}
|
|
71
|
+
declare function createRuntimeSource(options?: ManagedRuntimeOptions): RuntimeSource;
|
|
72
|
+
|
|
73
|
+
export { DEFAULT_ENV_PATH, type DebugRuntimeOptions, DebugRuntimeSource, DebugToken, ManagedRuntimeOptions, RuntimeBindings, type RuntimeEnvironment, RuntimeEnvironmentProvider, RuntimeSource, createRuntimeSource, parseDebugToken, parseRuntimeEnvironment };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DEFAULT_ENV_PATH,
|
|
3
|
+
DebugRuntimeSource,
|
|
4
|
+
DebugToken,
|
|
5
|
+
ManagedRuntimeSource,
|
|
6
|
+
RuntimeEnvironmentProvider,
|
|
7
|
+
createRuntimeSource,
|
|
8
|
+
parseDebugToken,
|
|
9
|
+
parseRuntimeEnvironment
|
|
10
|
+
} from "../chunk-RHY7Y43E.js";
|
|
11
|
+
import {
|
|
12
|
+
RequestContext,
|
|
13
|
+
currentContext,
|
|
14
|
+
useContext
|
|
15
|
+
} from "../chunk-ZWQBAJ5O.js";
|
|
16
|
+
import "../chunk-5JXA7JPS.js";
|
|
17
|
+
import "../chunk-UBP5CHU7.js";
|
|
18
|
+
import {
|
|
19
|
+
DEFAULT_CONFIG_PATH,
|
|
20
|
+
httpUrl,
|
|
21
|
+
loadAgentConfig,
|
|
22
|
+
object,
|
|
23
|
+
parseAgentConfig,
|
|
24
|
+
parseAgentConfigMapping,
|
|
25
|
+
requiredString
|
|
26
|
+
} from "../chunk-K3TE7625.js";
|
|
27
|
+
import "../chunk-NZL3VPJ2.js";
|
|
28
|
+
import "../chunk-MZ5UWGXS.js";
|
|
29
|
+
export {
|
|
30
|
+
DEFAULT_CONFIG_PATH,
|
|
31
|
+
DEFAULT_ENV_PATH,
|
|
32
|
+
DebugRuntimeSource,
|
|
33
|
+
DebugToken,
|
|
34
|
+
ManagedRuntimeSource,
|
|
35
|
+
RequestContext,
|
|
36
|
+
RuntimeEnvironmentProvider,
|
|
37
|
+
createRuntimeSource,
|
|
38
|
+
currentContext,
|
|
39
|
+
httpUrl,
|
|
40
|
+
loadAgentConfig,
|
|
41
|
+
object,
|
|
42
|
+
parseAgentConfig,
|
|
43
|
+
parseAgentConfigMapping,
|
|
44
|
+
parseDebugToken,
|
|
45
|
+
parseRuntimeEnvironment,
|
|
46
|
+
requiredString,
|
|
47
|
+
useContext
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|