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,202 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
|
+
|
|
3
|
+
var _chunkRZNQGEGJcjs = require('./chunk-RZNQGEGJ.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunk2E5EWEDGcjs = require('./chunk-2E5EWEDG.cjs');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
var _chunkLE5P3SJWcjs = require('./chunk-LE5P3SJW.cjs');
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
var _chunkJSP7ZROScjs = require('./chunk-JSP7ZROS.cjs');
|
|
17
|
+
|
|
18
|
+
// src/auth/workload-access-token.ts
|
|
19
|
+
var WorkloadAccessTokenProvider = class {
|
|
20
|
+
|
|
21
|
+
#token;
|
|
22
|
+
|
|
23
|
+
constructor(endpoint, source, options = {}) {
|
|
24
|
+
this.controller = new (0, _chunk2E5EWEDGcjs.ControllerClient)(endpoint, source, options);
|
|
25
|
+
}
|
|
26
|
+
async get() {
|
|
27
|
+
if (this.#token !== void 0) return this.#token;
|
|
28
|
+
if (this.pending) return this.pending;
|
|
29
|
+
const request = this.exchange();
|
|
30
|
+
this.pending = request;
|
|
31
|
+
try {
|
|
32
|
+
this.#token = await request;
|
|
33
|
+
return this.#token;
|
|
34
|
+
} finally {
|
|
35
|
+
this.pending = void 0;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
async invalidate(token) {
|
|
39
|
+
if (this.pending) await this.pending.catch(() => void 0);
|
|
40
|
+
if (token === void 0 || token === this.#token) this.#token = void 0;
|
|
41
|
+
}
|
|
42
|
+
close() {
|
|
43
|
+
this.controller.close();
|
|
44
|
+
this.#token = void 0;
|
|
45
|
+
}
|
|
46
|
+
async exchange() {
|
|
47
|
+
const response = await this.controller.post("/api/v1/workload/token");
|
|
48
|
+
if (response.status === 404) throw new (0, _chunkJSP7ZROScjs.WorkloadIdentityNotConfiguredError)("the current Agent has no configured Workload Identity");
|
|
49
|
+
if (response.status < 200 || response.status >= 300) throw new (0, _chunkJSP7ZROScjs.AuthenticationError)(`Controller workload token request failed with HTTP ${response.status}`);
|
|
50
|
+
const payload = response.payload;
|
|
51
|
+
const token = payload && typeof payload === "object" && "workloadAccessToken" in payload ? payload.workloadAccessToken : void 0;
|
|
52
|
+
if (typeof token !== "string" || !token.trim()) throw new (0, _chunkJSP7ZROScjs.AuthenticationError)("Controller returned an empty workload access token");
|
|
53
|
+
return token.trim();
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
// src/auth/bound-credentials.ts
|
|
58
|
+
var _util = require('util');
|
|
59
|
+
var _agentidentitydata20251127 = require('@alicloud/agentidentitydata20251127'); var _agentidentitydata202511272 = _interopRequireDefault(_agentidentitydata20251127);
|
|
60
|
+
var _openapicore = require('@alicloud/openapi-core');
|
|
61
|
+
var _typescript = require('@darabonba/typescript');
|
|
62
|
+
var GeneratedClient = typeof _agentidentitydata202511272.default === "function" ? _agentidentitydata202511272.default : _agentidentitydata202511272.default.default;
|
|
63
|
+
var WAT_ERRORS = /* @__PURE__ */ new Set(["WORKLOAD_ACCESS_TOKEN_EXPIRED", "WORKLOAD_ACCESS_TOKEN_INVALID"]);
|
|
64
|
+
var BoundCredential = class {
|
|
65
|
+
constructor(providerName, value, metadata) {
|
|
66
|
+
this.metadata = metadata;
|
|
67
|
+
this.providerName = providerName;
|
|
68
|
+
this.#value = value;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
#value;
|
|
73
|
+
get value() {
|
|
74
|
+
return this.#value;
|
|
75
|
+
}
|
|
76
|
+
get credentialType() {
|
|
77
|
+
return this.metadata.credentialType;
|
|
78
|
+
}
|
|
79
|
+
asHeaders() {
|
|
80
|
+
if (this.credentialType !== "mcpHeader") throw new (0, _chunkJSP7ZROScjs.ConfigError)("Credential must have type mcpHeader to read headers");
|
|
81
|
+
let data;
|
|
82
|
+
try {
|
|
83
|
+
data = JSON.parse(this.#value);
|
|
84
|
+
} catch (e) {
|
|
85
|
+
throw new (0, _chunkJSP7ZROScjs.ConfigError)("Invalid MCP Header credential payload");
|
|
86
|
+
}
|
|
87
|
+
const entries = fields(data).headers;
|
|
88
|
+
if (!Array.isArray(entries) || !entries.length) throw new (0, _chunkJSP7ZROScjs.ConfigError)("MCP Header credential must contain a non-empty headers array");
|
|
89
|
+
const headers = {};
|
|
90
|
+
for (const entry of entries) {
|
|
91
|
+
const { name, value } = fields(entry);
|
|
92
|
+
if (typeof name !== "string" || !/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/.test(name)) throw new (0, _chunkJSP7ZROScjs.ConfigError)("Invalid credential header name");
|
|
93
|
+
if (typeof value !== "string" || /[\x00-\x1f\x7f]/.test(value)) throw new (0, _chunkJSP7ZROScjs.ConfigError)("Invalid credential header value");
|
|
94
|
+
const folded = name.toLowerCase();
|
|
95
|
+
if (Object.hasOwn(headers, folded)) throw new (0, _chunkJSP7ZROScjs.ConfigError)("Duplicate credential header name");
|
|
96
|
+
Object.defineProperty(headers, folded, { value, enumerable: true, configurable: true, writable: true });
|
|
97
|
+
}
|
|
98
|
+
return headers;
|
|
99
|
+
}
|
|
100
|
+
[_util.inspect.custom]() {
|
|
101
|
+
return `BoundCredential(providerName=${JSON.stringify(this.providerName)}, <redacted>)`;
|
|
102
|
+
}
|
|
103
|
+
toJSON() {
|
|
104
|
+
return this[_util.inspect.custom]();
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
var BoundCredentials = class {
|
|
108
|
+
constructor(runtime, logger = _chunkLE5P3SJWcjs.nullLogger) {
|
|
109
|
+
this.runtime = runtime;
|
|
110
|
+
this.logger = logger;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
async get(credentialName) {
|
|
115
|
+
return this.resolve(credentialName);
|
|
116
|
+
}
|
|
117
|
+
/** @internal Bind only after validating the credential's MCP application scope. */
|
|
118
|
+
async getForMCP(credentialName, serverId) {
|
|
119
|
+
return this.resolve(credentialName, serverId);
|
|
120
|
+
}
|
|
121
|
+
async resolve(credentialName, serverId) {
|
|
122
|
+
credentialName = credentialName.trim();
|
|
123
|
+
if (!credentialName) throw new TypeError("credential name must not be empty");
|
|
124
|
+
const { workspaceId, regionId, workloadAccessToken: wat, resourceSTS: sts, controlPlane } = await this.runtime();
|
|
125
|
+
if (!wat || !sts) throw new (0, _chunkJSP7ZROScjs.CredentialExchangeError)("AgentCore credential runtime is not configured");
|
|
126
|
+
const metadata = await controlPlane.resolveCredential(credentialName);
|
|
127
|
+
if (serverId !== void 0) {
|
|
128
|
+
if (metadata.credentialType !== "mcpHeader") throw new (0, _chunkJSP7ZROScjs.ConfigError)("MCP credential must have type mcpHeader");
|
|
129
|
+
if (!(metadata.resourceScope === "ALL" || metadata.resourceScope === "SPECIFIED" && metadata.resourceRefs.some((ref) => ref.resourceType === "mcpServer" && ref.resourceId === serverId))) {
|
|
130
|
+
throw new (0, _chunkJSP7ZROScjs.ConfigError)("MCP credential does not allow the selected MCP server");
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
const providerName = `${workspaceId}-${credentialName}`;
|
|
134
|
+
this.logger.info("agentcore.credential.resolve.started", { workspace_id: workspaceId, credential_name: credentialName });
|
|
135
|
+
const credential = await sts.get(_chunkRZNQGEGJcjs.AGENT_IDENTITY_DATA_PURPOSE);
|
|
136
|
+
let token = await wat.get();
|
|
137
|
+
let value;
|
|
138
|
+
try {
|
|
139
|
+
value = await this.getAPIKey(regionId, credential, providerName, token);
|
|
140
|
+
} catch (error) {
|
|
141
|
+
if (!(error instanceof _chunkJSP7ZROScjs.WorkloadAccessTokenRejectedError)) throw error;
|
|
142
|
+
this.logger.warn("agentcore.credential.resolve.wat_rejected", { workspace_id: workspaceId, credential_name: credentialName, retry: true });
|
|
143
|
+
await wat.invalidate(token);
|
|
144
|
+
token = await wat.get();
|
|
145
|
+
value = await this.getAPIKey(regionId, credential, providerName, token);
|
|
146
|
+
}
|
|
147
|
+
this.logger.info("agentcore.credential.resolve.succeeded", { workspace_id: workspaceId, credential_name: credentialName });
|
|
148
|
+
return new BoundCredential(providerName, value, metadata);
|
|
149
|
+
}
|
|
150
|
+
async getAPIKey(regionId, credential, providerName, token) {
|
|
151
|
+
const endpoint = `agentidentitydata.${regionId}.aliyuncs.com`;
|
|
152
|
+
const client = new GeneratedClient(new _openapicore.$OpenApiUtil.Config({
|
|
153
|
+
accessKeyId: credential.accessKeyId,
|
|
154
|
+
accessKeySecret: credential.accessKeySecret,
|
|
155
|
+
securityToken: credential.securityToken,
|
|
156
|
+
regionId,
|
|
157
|
+
endpoint,
|
|
158
|
+
protocol: "https"
|
|
159
|
+
}));
|
|
160
|
+
try {
|
|
161
|
+
const response = await client.getResourceAPIKeyWithOptions(new (0, _agentidentitydata20251127.GetResourceAPIKeyRequest)({
|
|
162
|
+
resourceCredentialProviderName: providerName,
|
|
163
|
+
workloadAccessToken: token
|
|
164
|
+
}), new (0, _typescript.RuntimeOptions)({ autoretry: false, connectTimeout: 1e4, readTimeout: 3e4 }));
|
|
165
|
+
const value = _optionalChain([response, 'access', _ => _.body, 'optionalAccess', _2 => _2.APIKey]);
|
|
166
|
+
if (typeof value !== "string" || !value) throw new (0, _chunkJSP7ZROScjs.CredentialExchangeError)("Agent Identity Data returned an empty or invalid API key");
|
|
167
|
+
return value;
|
|
168
|
+
} catch (error) {
|
|
169
|
+
if (watRejection(error)) throw new (0, _chunkJSP7ZROScjs.WorkloadAccessTokenRejectedError)("Agent Identity Data rejected the Workload Access Token");
|
|
170
|
+
const details = fields(error);
|
|
171
|
+
const data = fields(details.data);
|
|
172
|
+
this.logger.warn("agentcore.credential.api.failed", {
|
|
173
|
+
endpoint: `https://${endpoint}/`,
|
|
174
|
+
provider_name: providerName,
|
|
175
|
+
error_type: error instanceof Error ? error.name : "Error",
|
|
176
|
+
request_id: String(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(details.requestId, () => ( data.RequestId)), () => ( data.requestId)), () => ( "")))
|
|
177
|
+
});
|
|
178
|
+
if (error instanceof _chunkJSP7ZROScjs.CredentialExchangeError) throw error;
|
|
179
|
+
throw new (0, _chunkJSP7ZROScjs.CredentialExchangeError)("Agent Identity Data API key request failed");
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
function fields(value) {
|
|
184
|
+
return value && typeof value === "object" ? value : {};
|
|
185
|
+
}
|
|
186
|
+
function watRejection(error) {
|
|
187
|
+
let current = fields(error);
|
|
188
|
+
for (let depth = 0; depth < 3; depth++) {
|
|
189
|
+
const data = fields(current.data);
|
|
190
|
+
if ([current.code, data.Code, data.code].some((code) => typeof code === "string" && WAT_ERRORS.has(code.toUpperCase()))) return true;
|
|
191
|
+
if (!current.innerException) return false;
|
|
192
|
+
current = fields(current.innerException);
|
|
193
|
+
}
|
|
194
|
+
return false;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
exports.WorkloadAccessTokenProvider = WorkloadAccessTokenProvider; exports.BoundCredential = BoundCredential; exports.BoundCredentials = BoundCredentials;
|
|
202
|
+
//# sourceMappingURL=chunk-ZTWLCHCO.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/Users/zhuoguang/Documents/Code/collaborate/hiclaw/agentcore-sdk-nodejs/dist/chunk-ZTWLCHCO.cjs","../src/auth/workload-access-token.ts","../src/auth/bound-credentials.ts"],"names":[],"mappings":"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","file":"/Users/zhuoguang/Documents/Code/collaborate/hiclaw/agentcore-sdk-nodejs/dist/chunk-ZTWLCHCO.cjs","sourcesContent":[null,"import { AuthenticationError, WorkloadIdentityNotConfiguredError } from '../errors';\nimport type { AgentSATokenSource } from './agent-sa-token';\nimport { ControllerClient, type ControllerOptions } from './controller';\n\nexport class WorkloadAccessTokenProvider {\n private readonly controller: ControllerClient;\n #token?: string;\n private pending?: Promise<string>;\n\n constructor(endpoint: string, source: AgentSATokenSource, options: ControllerOptions = {}) {\n this.controller = new ControllerClient(endpoint, source, options);\n }\n async get(): Promise<string> {\n if (this.#token !== undefined) return this.#token;\n if (this.pending) return this.pending;\n const request = this.exchange();\n this.pending = request;\n try { this.#token = await request; return this.#token; }\n finally { this.pending = undefined; }\n }\n async invalidate(token?: string): Promise<void> {\n // Serialize invalidation after an exchange, including an initially empty cache.\n if (this.pending) await this.pending.catch(() => undefined);\n if (token === undefined || token === this.#token) this.#token = undefined;\n }\n close(): void { this.controller.close(); this.#token = undefined; }\n\n private async exchange(): Promise<string> {\n const response = await this.controller.post('/api/v1/workload/token');\n if (response.status === 404) throw new WorkloadIdentityNotConfiguredError('the current Agent has no configured Workload Identity');\n if (response.status < 200 || response.status >= 300) throw new AuthenticationError(`Controller workload token request failed with HTTP ${response.status}`);\n const payload = response.payload;\n const token = payload && typeof payload === 'object' && 'workloadAccessToken' in payload ? payload.workloadAccessToken : undefined;\n if (typeof token !== 'string' || !token.trim()) throw new AuthenticationError('Controller returned an empty workload access token');\n return token.trim();\n }\n}\n","import { inspect } from 'node:util';\nimport Client, { GetResourceAPIKeyRequest } from '@alicloud/agentidentitydata20251127';\nimport { $OpenApiUtil } from '@alicloud/openapi-core';\nimport { RuntimeOptions } from '@darabonba/typescript';\nimport { ConfigError, CredentialExchangeError, WorkloadAccessTokenRejectedError } from '../errors';\nimport type { AgentCoreControlPlane, CredentialMetadata } from '../controlplane/client';\nimport { nullLogger, type Logger } from '../logging';\nimport type { AccessKeyCredential, CredentialProvider } from './access-key';\nimport { AGENT_IDENTITY_DATA_PURPOSE } from './resource-sts';\n\nconst GeneratedClient = typeof Client === 'function' ? Client : (Client as unknown as { default: typeof Client }).default;\nconst WAT_ERRORS = new Set(['WORKLOAD_ACCESS_TOKEN_EXPIRED', 'WORKLOAD_ACCESS_TOKEN_INVALID']);\ninterface CredentialRuntime {\n workspaceId: string;\n regionId: string;\n controlPlane: AgentCoreControlPlane;\n resourceSTS?: CredentialProvider;\n workloadAccessToken?: { get(): Promise<string>; invalidate(token: string): Promise<void> };\n}\n\nexport class BoundCredential {\n readonly providerName: string;\n #value: string;\n constructor(providerName: string, value: string, readonly metadata: CredentialMetadata) { this.providerName = providerName; this.#value = value; }\n get value(): string { return this.#value; }\n get credentialType(): string { return this.metadata.credentialType; }\n asHeaders(): Record<string, string> {\n if (this.credentialType !== 'mcpHeader') throw new ConfigError('Credential must have type mcpHeader to read headers');\n let data: unknown;\n try { data = JSON.parse(this.#value); } catch { throw new ConfigError('Invalid MCP Header credential payload'); }\n const entries = fields(data).headers;\n if (!Array.isArray(entries) || !entries.length) throw new ConfigError('MCP Header credential must contain a non-empty headers array');\n const headers: Record<string, string> = {};\n for (const entry of entries) {\n const { name, value } = fields(entry);\n if (typeof name !== 'string' || !/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/.test(name)) throw new ConfigError('Invalid credential header name');\n if (typeof value !== 'string' || /[\\x00-\\x1f\\x7f]/.test(value)) throw new ConfigError('Invalid credential header value');\n const folded = name.toLowerCase();\n if (Object.hasOwn(headers, folded)) throw new ConfigError('Duplicate credential header name');\n Object.defineProperty(headers, folded, { value, enumerable: true, configurable: true, writable: true });\n }\n return headers;\n }\n [inspect.custom](): string { return `BoundCredential(providerName=${JSON.stringify(this.providerName)}, <redacted>)`; }\n toJSON(): string { return this[inspect.custom](); }\n}\n\n/** Resolve metadata by name, then fetch the secret from AgentIdentity. WAT/STS cache independently. */\nexport class BoundCredentials {\n constructor(private readonly runtime: () => Promise<CredentialRuntime>, private readonly logger: Logger = nullLogger) {}\n async get(credentialName: string): Promise<BoundCredential> {\n return this.resolve(credentialName);\n }\n /** @internal Bind only after validating the credential's MCP application scope. */\n async getForMCP(credentialName: string, serverId: string): Promise<BoundCredential> {\n return this.resolve(credentialName, serverId);\n }\n private async resolve(credentialName: string, serverId?: string): Promise<BoundCredential> {\n credentialName = credentialName.trim();\n if (!credentialName) throw new TypeError('credential name must not be empty');\n const { workspaceId, regionId, workloadAccessToken: wat, resourceSTS: sts, controlPlane } = await this.runtime();\n if (!wat || !sts) throw new CredentialExchangeError('AgentCore credential runtime is not configured');\n const metadata = await controlPlane.resolveCredential(credentialName);\n if (serverId !== undefined) {\n if (metadata.credentialType !== 'mcpHeader') throw new ConfigError('MCP credential must have type mcpHeader');\n if (!(metadata.resourceScope === 'ALL' || (metadata.resourceScope === 'SPECIFIED' &&\n metadata.resourceRefs.some((ref) => ref.resourceType === 'mcpServer' && ref.resourceId === serverId)))) {\n throw new ConfigError('MCP credential does not allow the selected MCP server');\n }\n }\n // Matches the control plane's CreateCredential provider naming contract.\n const providerName = `${workspaceId}-${credentialName}`;\n this.logger.info('agentcore.credential.resolve.started', { workspace_id: workspaceId, credential_name: credentialName });\n const credential = await sts.get(AGENT_IDENTITY_DATA_PURPOSE);\n let token = await wat.get(); let value: string;\n try { value = await this.getAPIKey(regionId, credential, providerName, token); }\n catch (error) {\n if (!(error instanceof WorkloadAccessTokenRejectedError)) throw error;\n this.logger.warn('agentcore.credential.resolve.wat_rejected', { workspace_id: workspaceId, credential_name: credentialName, retry: true });\n await wat.invalidate(token); token = await wat.get();\n value = await this.getAPIKey(regionId, credential, providerName, token);\n }\n this.logger.info('agentcore.credential.resolve.succeeded', { workspace_id: workspaceId, credential_name: credentialName });\n return new BoundCredential(providerName, value, metadata);\n }\n private async getAPIKey(regionId: string, credential: AccessKeyCredential, providerName: string, token: string): Promise<string> {\n const endpoint = `agentidentitydata.${regionId}.aliyuncs.com`;\n const client = new GeneratedClient(new $OpenApiUtil.Config({\n accessKeyId: credential.accessKeyId, accessKeySecret: credential.accessKeySecret, securityToken: credential.securityToken,\n regionId, endpoint, protocol: 'https',\n }));\n try {\n const response = await client.getResourceAPIKeyWithOptions(new GetResourceAPIKeyRequest({\n resourceCredentialProviderName: providerName, workloadAccessToken: token,\n }), new RuntimeOptions({ autoretry: false, connectTimeout: 10_000, readTimeout: 30_000 }));\n const value = response.body?.APIKey;\n if (typeof value !== 'string' || !value) throw new CredentialExchangeError('Agent Identity Data returned an empty or invalid API key');\n return value;\n } catch (error) {\n if (watRejection(error)) throw new WorkloadAccessTokenRejectedError('Agent Identity Data rejected the Workload Access Token');\n const details = fields(error); const data = fields(details.data);\n this.logger.warn('agentcore.credential.api.failed', { endpoint: `https://${endpoint}/`, provider_name: providerName,\n error_type: error instanceof Error ? error.name : 'Error', request_id: String(details.requestId ?? data.RequestId ?? data.requestId ?? '') });\n if (error instanceof CredentialExchangeError) throw error;\n // Generated SDK errors may contain a credential-bearing request; do not attach them.\n throw new CredentialExchangeError('Agent Identity Data API key request failed');\n }\n }\n}\nfunction fields(value: unknown): Record<string, unknown> { return value && typeof value === 'object' ? value as Record<string, unknown> : {}; }\nfunction watRejection(error: unknown): boolean {\n let current = fields(error);\n for (let depth = 0; depth < 3; depth++) {\n const data = fields(current.data);\n if ([current.code, data.Code, data.code].some((code) => typeof code === 'string' && WAT_ERRORS.has(code.toUpperCase()))) return true;\n if (!current.innerException) return false;\n current = fields(current.innerException);\n }\n return false;\n}\n"]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ContextError
|
|
3
|
+
} from "./chunk-MZ5UWGXS.js";
|
|
4
|
+
|
|
5
|
+
// src/runtime/context.ts
|
|
6
|
+
import { AsyncLocalStorage } from "async_hooks";
|
|
7
|
+
import { inspect } from "util";
|
|
8
|
+
var RequestContext = class {
|
|
9
|
+
headers;
|
|
10
|
+
constructor(headers) {
|
|
11
|
+
this.headers = Object.freeze(Object.fromEntries(Object.entries(headers).map(([k, v]) => [k.toLowerCase(), v])));
|
|
12
|
+
}
|
|
13
|
+
[inspect.custom]() {
|
|
14
|
+
return "RequestContext(headers=<redacted>)";
|
|
15
|
+
}
|
|
16
|
+
toJSON() {
|
|
17
|
+
return this[inspect.custom]();
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
var context = new AsyncLocalStorage();
|
|
21
|
+
function currentContext(required = true) {
|
|
22
|
+
const value = context.getStore();
|
|
23
|
+
if (!value && required) throw new ContextError("no AgentCore request context is active");
|
|
24
|
+
return value;
|
|
25
|
+
}
|
|
26
|
+
function useContext(value, callback) {
|
|
27
|
+
return context.run(value, callback);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export {
|
|
31
|
+
RequestContext,
|
|
32
|
+
currentContext,
|
|
33
|
+
useContext
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=chunk-ZWQBAJ5O.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/runtime/context.ts"],"sourcesContent":["import { AsyncLocalStorage } from 'node:async_hooks';\nimport { inspect } from 'node:util';\nimport { ContextError } from '../errors';\n\nexport class RequestContext {\n readonly headers: Readonly<Record<string, string>>;\n constructor(headers: Readonly<Record<string, string>>) {\n this.headers = Object.freeze(Object.fromEntries(Object.entries(headers).map(([k, v]) => [k.toLowerCase(), v])));\n }\n [inspect.custom](): string { return 'RequestContext(headers=<redacted>)'; }\n toJSON(): string { return this[inspect.custom](); }\n}\nconst context = new AsyncLocalStorage<RequestContext>();\nexport function currentContext(required = true): RequestContext | undefined {\n const value = context.getStore();\n if (!value && required) throw new ContextError('no AgentCore request context is active');\n return value;\n}\nexport function useContext<T>(value: RequestContext, callback: () => T): T {\n return context.run(value, callback);\n}\n"],"mappings":";;;;;AAAA,SAAS,yBAAyB;AAClC,SAAS,eAAe;AAGjB,IAAM,iBAAN,MAAqB;AAAA,EACjB;AAAA,EACT,YAAY,SAA2C;AACrD,SAAK,UAAU,OAAO,OAAO,OAAO,YAAY,OAAO,QAAQ,OAAO,EAAE,IAAI,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,YAAY,GAAG,CAAC,CAAC,CAAC,CAAC;AAAA,EAChH;AAAA,EACA,CAAC,QAAQ,MAAM,IAAY;AAAE,WAAO;AAAA,EAAsC;AAAA,EAC1E,SAAiB;AAAE,WAAO,KAAK,QAAQ,MAAM,EAAE;AAAA,EAAG;AACpD;AACA,IAAM,UAAU,IAAI,kBAAkC;AAC/C,SAAS,eAAe,WAAW,MAAkC;AAC1E,QAAM,QAAQ,QAAQ,SAAS;AAC/B,MAAI,CAAC,SAAS,SAAU,OAAM,IAAI,aAAa,wCAAwC;AACvF,SAAO;AACT;AACO,SAAS,WAAc,OAAuB,UAAsB;AACzE,SAAO,QAAQ,IAAI,OAAO,QAAQ;AACpC;","names":[]}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { inspect } from 'node:util';
|
|
2
|
+
import { L as Logger } from './logging-C8GLLg1f.cjs';
|
|
3
|
+
import { A as AgentConfig } from './config-CMkmMtx1.cjs';
|
|
4
|
+
import { ModelDescriptor } from './controlplane/index.cjs';
|
|
5
|
+
|
|
6
|
+
type ModelProtocol = 'openai' | 'anthropic';
|
|
7
|
+
type ModelMessage = {
|
|
8
|
+
role: string;
|
|
9
|
+
content?: unknown;
|
|
10
|
+
[key: string]: unknown;
|
|
11
|
+
};
|
|
12
|
+
type ModelParameters = Record<string, unknown>;
|
|
13
|
+
type ModelResponse = Record<string, unknown>;
|
|
14
|
+
type HeadersProvider = () => Readonly<Record<string, string>> | Promise<Readonly<Record<string, string>>>;
|
|
15
|
+
interface ModelCallOptions {
|
|
16
|
+
signal?: AbortSignal;
|
|
17
|
+
}
|
|
18
|
+
interface DirectModelOptions {
|
|
19
|
+
model: string;
|
|
20
|
+
baseURL: string;
|
|
21
|
+
provider?: ModelProtocol;
|
|
22
|
+
apiKey?: string;
|
|
23
|
+
apiKeyProvider?: () => string | Promise<string>;
|
|
24
|
+
headersProvider?: HeadersProvider;
|
|
25
|
+
timeoutMs?: number;
|
|
26
|
+
logger?: Logger;
|
|
27
|
+
}
|
|
28
|
+
interface ModelSettings {
|
|
29
|
+
readonly model: string;
|
|
30
|
+
readonly provider: ModelProtocol;
|
|
31
|
+
readonly baseURL: string;
|
|
32
|
+
readonly maxTokens?: number;
|
|
33
|
+
}
|
|
34
|
+
declare function managedModelProtocol(protocol: string): ModelProtocol;
|
|
35
|
+
declare function modelBaseURL(gatewayURL: string, connectionId: string, protocol: string): string;
|
|
36
|
+
declare class ModelClient {
|
|
37
|
+
private readonly timeoutMs;
|
|
38
|
+
readonly descriptor?: ModelDescriptor;
|
|
39
|
+
readonly settings: ModelSettings;
|
|
40
|
+
private readonly logger;
|
|
41
|
+
private readonly openai?;
|
|
42
|
+
private readonly anthropic?;
|
|
43
|
+
private readonly lifetime;
|
|
44
|
+
private readonly requestHeaders;
|
|
45
|
+
private constructor();
|
|
46
|
+
static platform(config: AgentConfig, descriptor: ModelDescriptor, options?: {
|
|
47
|
+
logger?: Logger;
|
|
48
|
+
timeoutMs?: number;
|
|
49
|
+
}): ModelClient;
|
|
50
|
+
static direct(options: DirectModelOptions): ModelClient;
|
|
51
|
+
/** Headers are resolved for framework transports as well as direct API calls. */
|
|
52
|
+
headers(): Promise<Readonly<Record<string, string>>>;
|
|
53
|
+
completion(messages: readonly ModelMessage[], parameters?: ModelParameters, options?: ModelCallOptions): Promise<ModelResponse>;
|
|
54
|
+
invoke(messages: readonly ModelMessage[], parameters?: ModelParameters, options?: ModelCallOptions): Promise<ModelResponse>;
|
|
55
|
+
stream(messages: readonly ModelMessage[], parameters?: ModelParameters, options?: ModelCallOptions): AsyncGenerator<ModelResponse>;
|
|
56
|
+
responses(input: unknown, parameters?: ModelParameters, options?: ModelCallOptions): Promise<ModelResponse>;
|
|
57
|
+
responsesStream(input: unknown, parameters?: ModelParameters, options?: ModelCallOptions): AsyncGenerator<ModelResponse>;
|
|
58
|
+
embedding(input: unknown, parameters?: ModelParameters, options?: ModelCallOptions): Promise<ModelResponse>;
|
|
59
|
+
close(): void;
|
|
60
|
+
[inspect.custom](): string;
|
|
61
|
+
toJSON(): string;
|
|
62
|
+
private requireOpenAI;
|
|
63
|
+
private reject;
|
|
64
|
+
private anthropicParameters;
|
|
65
|
+
/** Authenticated transport shared by native clients and framework adapters. */
|
|
66
|
+
httpFetch(input: Parameters<typeof fetch>[0], init?: Parameters<typeof fetch>[1]): Promise<Response>;
|
|
67
|
+
private invokeRequest;
|
|
68
|
+
private invokeStream;
|
|
69
|
+
private failed;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export { type DirectModelOptions as D, type HeadersProvider as H, ModelClient as M, type ModelCallOptions as a, type ModelMessage as b, type ModelParameters as c, type ModelProtocol as d, type ModelResponse as e, type ModelSettings as f, modelBaseURL as g, managedModelProtocol as m };
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { inspect } from 'node:util';
|
|
2
|
+
import { L as Logger } from './logging-C8GLLg1f.js';
|
|
3
|
+
import { A as AgentConfig } from './config-CMkmMtx1.js';
|
|
4
|
+
import { ModelDescriptor } from './controlplane/index.js';
|
|
5
|
+
|
|
6
|
+
type ModelProtocol = 'openai' | 'anthropic';
|
|
7
|
+
type ModelMessage = {
|
|
8
|
+
role: string;
|
|
9
|
+
content?: unknown;
|
|
10
|
+
[key: string]: unknown;
|
|
11
|
+
};
|
|
12
|
+
type ModelParameters = Record<string, unknown>;
|
|
13
|
+
type ModelResponse = Record<string, unknown>;
|
|
14
|
+
type HeadersProvider = () => Readonly<Record<string, string>> | Promise<Readonly<Record<string, string>>>;
|
|
15
|
+
interface ModelCallOptions {
|
|
16
|
+
signal?: AbortSignal;
|
|
17
|
+
}
|
|
18
|
+
interface DirectModelOptions {
|
|
19
|
+
model: string;
|
|
20
|
+
baseURL: string;
|
|
21
|
+
provider?: ModelProtocol;
|
|
22
|
+
apiKey?: string;
|
|
23
|
+
apiKeyProvider?: () => string | Promise<string>;
|
|
24
|
+
headersProvider?: HeadersProvider;
|
|
25
|
+
timeoutMs?: number;
|
|
26
|
+
logger?: Logger;
|
|
27
|
+
}
|
|
28
|
+
interface ModelSettings {
|
|
29
|
+
readonly model: string;
|
|
30
|
+
readonly provider: ModelProtocol;
|
|
31
|
+
readonly baseURL: string;
|
|
32
|
+
readonly maxTokens?: number;
|
|
33
|
+
}
|
|
34
|
+
declare function managedModelProtocol(protocol: string): ModelProtocol;
|
|
35
|
+
declare function modelBaseURL(gatewayURL: string, connectionId: string, protocol: string): string;
|
|
36
|
+
declare class ModelClient {
|
|
37
|
+
private readonly timeoutMs;
|
|
38
|
+
readonly descriptor?: ModelDescriptor;
|
|
39
|
+
readonly settings: ModelSettings;
|
|
40
|
+
private readonly logger;
|
|
41
|
+
private readonly openai?;
|
|
42
|
+
private readonly anthropic?;
|
|
43
|
+
private readonly lifetime;
|
|
44
|
+
private readonly requestHeaders;
|
|
45
|
+
private constructor();
|
|
46
|
+
static platform(config: AgentConfig, descriptor: ModelDescriptor, options?: {
|
|
47
|
+
logger?: Logger;
|
|
48
|
+
timeoutMs?: number;
|
|
49
|
+
}): ModelClient;
|
|
50
|
+
static direct(options: DirectModelOptions): ModelClient;
|
|
51
|
+
/** Headers are resolved for framework transports as well as direct API calls. */
|
|
52
|
+
headers(): Promise<Readonly<Record<string, string>>>;
|
|
53
|
+
completion(messages: readonly ModelMessage[], parameters?: ModelParameters, options?: ModelCallOptions): Promise<ModelResponse>;
|
|
54
|
+
invoke(messages: readonly ModelMessage[], parameters?: ModelParameters, options?: ModelCallOptions): Promise<ModelResponse>;
|
|
55
|
+
stream(messages: readonly ModelMessage[], parameters?: ModelParameters, options?: ModelCallOptions): AsyncGenerator<ModelResponse>;
|
|
56
|
+
responses(input: unknown, parameters?: ModelParameters, options?: ModelCallOptions): Promise<ModelResponse>;
|
|
57
|
+
responsesStream(input: unknown, parameters?: ModelParameters, options?: ModelCallOptions): AsyncGenerator<ModelResponse>;
|
|
58
|
+
embedding(input: unknown, parameters?: ModelParameters, options?: ModelCallOptions): Promise<ModelResponse>;
|
|
59
|
+
close(): void;
|
|
60
|
+
[inspect.custom](): string;
|
|
61
|
+
toJSON(): string;
|
|
62
|
+
private requireOpenAI;
|
|
63
|
+
private reject;
|
|
64
|
+
private anthropicParameters;
|
|
65
|
+
/** Authenticated transport shared by native clients and framework adapters. */
|
|
66
|
+
httpFetch(input: Parameters<typeof fetch>[0], init?: Parameters<typeof fetch>[1]): Promise<Response>;
|
|
67
|
+
private invokeRequest;
|
|
68
|
+
private invokeStream;
|
|
69
|
+
private failed;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export { type DirectModelOptions as D, type HeadersProvider as H, ModelClient as M, type ModelCallOptions as a, type ModelMessage as b, type ModelParameters as c, type ModelProtocol as d, type ModelResponse as e, type ModelSettings as f, modelBaseURL as g, managedModelProtocol as m };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
var _chunkA3PF2SPDcjs = require('../chunk-A3PF2SPD.cjs');
|
|
22
|
+
require('../chunk-JSP7ZROS.cjs');
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
exports.CollaborationConfigError = _chunkA3PF2SPDcjs.CollaborationConfigError; exports.CollaborationContextError = _chunkA3PF2SPDcjs.CollaborationContextError; exports.CollaborationContextRequiredError = _chunkA3PF2SPDcjs.CollaborationContextRequiredError; exports.CollaborationDisabledError = _chunkA3PF2SPDcjs.CollaborationDisabledError; exports.CollaborationError = _chunkA3PF2SPDcjs.CollaborationError; exports.CollaborationFileTooLargeError = _chunkA3PF2SPDcjs.CollaborationFileTooLargeError; exports.CollaborationRoleUnsupportedError = _chunkA3PF2SPDcjs.CollaborationRoleUnsupportedError; exports.CollaborationTaskConflictError = _chunkA3PF2SPDcjs.CollaborationTaskConflictError; exports.CollaborationTaskInvalidError = _chunkA3PF2SPDcjs.CollaborationTaskInvalidError; exports.CollaborationTaskNotFoundError = _chunkA3PF2SPDcjs.CollaborationTaskNotFoundError; exports.CollaborationTaskUnauthorizedError = _chunkA3PF2SPDcjs.CollaborationTaskUnauthorizedError; exports.CollaborationTaskUnavailableError = _chunkA3PF2SPDcjs.CollaborationTaskUnavailableError; exports.CollaborationTeamUnavailableError = _chunkA3PF2SPDcjs.CollaborationTeamUnavailableError; exports.CollaborationToolArgumentError = _chunkA3PF2SPDcjs.CollaborationToolArgumentError; exports.CollaborationTurnContext = _chunkA3PF2SPDcjs.CollaborationTurnContext; exports.bindCollaborationContext = _chunkA3PF2SPDcjs.bindCollaborationContext; exports.currentCollaborationContext = _chunkA3PF2SPDcjs.currentCollaborationContext; exports.parseCollaborationContext = _chunkA3PF2SPDcjs.parseCollaborationContext; exports.useCollaborationContext = _chunkA3PF2SPDcjs.useCollaborationContext;
|
|
44
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/Users/zhuoguang/Documents/Code/collaborate/hiclaw/agentcore-sdk-nodejs/dist/collaboration/index.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,yDAA8B;AAC9B,iCAA8B;AAC9B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,knDAAC","file":"/Users/zhuoguang/Documents/Code/collaborate/hiclaw/agentcore-sdk-nodejs/dist/collaboration/index.cjs"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { inspect } from 'node:util';
|
|
2
|
+
import { C as ConfigError, a as ContextError, A as AgentCoreError } from '../errors-D9OtcR-o.cjs';
|
|
3
|
+
export { b as CollaborationOptions, c as CollaborationRuntime, W as Worker } from '../errors-D9OtcR-o.cjs';
|
|
4
|
+
import '../common-BSXkQfxI.cjs';
|
|
5
|
+
import '../logging-C8GLLg1f.cjs';
|
|
6
|
+
import '../loader-eWuJ2GSL.cjs';
|
|
7
|
+
import '../controlplane/index.cjs';
|
|
8
|
+
import '../access-key-CkoHq3S8.cjs';
|
|
9
|
+
|
|
10
|
+
declare class CollaborationTurnContext {
|
|
11
|
+
readonly sessionId: string | undefined;
|
|
12
|
+
readonly teamId: string | undefined;
|
|
13
|
+
readonly roomId: string;
|
|
14
|
+
readonly eventId: string;
|
|
15
|
+
readonly roomKind: 'dm' | 'group' | 'task';
|
|
16
|
+
constructor(sessionId: string | undefined, teamId: string | undefined, roomId: string, eventId: string, roomKind: 'dm' | 'group' | 'task');
|
|
17
|
+
[inspect.custom](): string;
|
|
18
|
+
toJSON(): string;
|
|
19
|
+
}
|
|
20
|
+
declare function currentCollaborationContext(required?: true): CollaborationTurnContext;
|
|
21
|
+
declare function currentCollaborationContext(required: false): CollaborationTurnContext | undefined;
|
|
22
|
+
declare function useCollaborationContext<T>(value: CollaborationTurnContext | undefined, callback: () => T): T;
|
|
23
|
+
declare function bindCollaborationContext<T>(headers: Readonly<Record<string, string>>, callback: () => T): T;
|
|
24
|
+
declare function parseCollaborationContext(headers: Readonly<Record<string, string>>): CollaborationTurnContext | undefined;
|
|
25
|
+
|
|
26
|
+
declare class CollaborationError extends AgentCoreError {
|
|
27
|
+
readonly code: string;
|
|
28
|
+
readonly retryable: boolean;
|
|
29
|
+
}
|
|
30
|
+
declare class CollaborationConfigError extends ConfigError {
|
|
31
|
+
readonly code = "COLLABORATION_CONFIG_INVALID";
|
|
32
|
+
readonly retryable = true;
|
|
33
|
+
}
|
|
34
|
+
declare class CollaborationContextError extends ContextError {
|
|
35
|
+
readonly code = "COLLABORATION_CONTEXT_INVALID";
|
|
36
|
+
readonly retryable = false;
|
|
37
|
+
}
|
|
38
|
+
declare class CollaborationDisabledError extends CollaborationError {
|
|
39
|
+
readonly code = "COLLABORATION_DISABLED";
|
|
40
|
+
}
|
|
41
|
+
declare class CollaborationContextRequiredError extends CollaborationError {
|
|
42
|
+
readonly code = "COLLABORATION_CONTEXT_REQUIRED";
|
|
43
|
+
}
|
|
44
|
+
declare class CollaborationTeamUnavailableError extends CollaborationError {
|
|
45
|
+
readonly code = "COLLABORATION_TEAM_UNAVAILABLE";
|
|
46
|
+
}
|
|
47
|
+
declare class CollaborationRoleUnsupportedError extends CollaborationError {
|
|
48
|
+
readonly code = "COLLABORATION_ROLE_UNSUPPORTED";
|
|
49
|
+
}
|
|
50
|
+
declare class CollaborationToolArgumentError extends CollaborationError {
|
|
51
|
+
readonly code = "COLLABORATION_ARGUMENT_INVALID";
|
|
52
|
+
}
|
|
53
|
+
declare class CollaborationTaskUnauthorizedError extends CollaborationError {
|
|
54
|
+
readonly code = "COLLABORATION_TASK_UNAUTHORIZED";
|
|
55
|
+
}
|
|
56
|
+
declare class CollaborationTaskInvalidError extends CollaborationError {
|
|
57
|
+
readonly code = "COLLABORATION_TASK_INVALID";
|
|
58
|
+
}
|
|
59
|
+
declare class CollaborationTaskNotFoundError extends CollaborationError {
|
|
60
|
+
readonly code = "COLLABORATION_TASK_NOT_FOUND";
|
|
61
|
+
}
|
|
62
|
+
declare class CollaborationTaskConflictError extends CollaborationError {
|
|
63
|
+
readonly code = "COLLABORATION_TASK_CONFLICT";
|
|
64
|
+
}
|
|
65
|
+
declare class CollaborationFileTooLargeError extends CollaborationError {
|
|
66
|
+
readonly code = "COLLABORATION_FILE_TOO_LARGE";
|
|
67
|
+
}
|
|
68
|
+
declare class CollaborationTaskUnavailableError extends CollaborationError {
|
|
69
|
+
readonly code = "COLLABORATION_TASK_UNAVAILABLE";
|
|
70
|
+
readonly retryable = true;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export { CollaborationConfigError, CollaborationContextError, CollaborationContextRequiredError, CollaborationDisabledError, CollaborationError, CollaborationFileTooLargeError, CollaborationRoleUnsupportedError, CollaborationTaskConflictError, CollaborationTaskInvalidError, CollaborationTaskNotFoundError, CollaborationTaskUnauthorizedError, CollaborationTaskUnavailableError, CollaborationTeamUnavailableError, CollaborationToolArgumentError, CollaborationTurnContext, bindCollaborationContext, currentCollaborationContext, parseCollaborationContext, useCollaborationContext };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { inspect } from 'node:util';
|
|
2
|
+
import { C as ConfigError, a as ContextError, A as AgentCoreError } from '../errors-BjGO6N10.js';
|
|
3
|
+
export { b as CollaborationOptions, c as CollaborationRuntime, W as Worker } from '../errors-BjGO6N10.js';
|
|
4
|
+
import '../common-BSXkQfxI.js';
|
|
5
|
+
import '../logging-C8GLLg1f.js';
|
|
6
|
+
import '../loader-DrIQ37nm.js';
|
|
7
|
+
import '../controlplane/index.js';
|
|
8
|
+
import '../access-key-CkoHq3S8.js';
|
|
9
|
+
|
|
10
|
+
declare class CollaborationTurnContext {
|
|
11
|
+
readonly sessionId: string | undefined;
|
|
12
|
+
readonly teamId: string | undefined;
|
|
13
|
+
readonly roomId: string;
|
|
14
|
+
readonly eventId: string;
|
|
15
|
+
readonly roomKind: 'dm' | 'group' | 'task';
|
|
16
|
+
constructor(sessionId: string | undefined, teamId: string | undefined, roomId: string, eventId: string, roomKind: 'dm' | 'group' | 'task');
|
|
17
|
+
[inspect.custom](): string;
|
|
18
|
+
toJSON(): string;
|
|
19
|
+
}
|
|
20
|
+
declare function currentCollaborationContext(required?: true): CollaborationTurnContext;
|
|
21
|
+
declare function currentCollaborationContext(required: false): CollaborationTurnContext | undefined;
|
|
22
|
+
declare function useCollaborationContext<T>(value: CollaborationTurnContext | undefined, callback: () => T): T;
|
|
23
|
+
declare function bindCollaborationContext<T>(headers: Readonly<Record<string, string>>, callback: () => T): T;
|
|
24
|
+
declare function parseCollaborationContext(headers: Readonly<Record<string, string>>): CollaborationTurnContext | undefined;
|
|
25
|
+
|
|
26
|
+
declare class CollaborationError extends AgentCoreError {
|
|
27
|
+
readonly code: string;
|
|
28
|
+
readonly retryable: boolean;
|
|
29
|
+
}
|
|
30
|
+
declare class CollaborationConfigError extends ConfigError {
|
|
31
|
+
readonly code = "COLLABORATION_CONFIG_INVALID";
|
|
32
|
+
readonly retryable = true;
|
|
33
|
+
}
|
|
34
|
+
declare class CollaborationContextError extends ContextError {
|
|
35
|
+
readonly code = "COLLABORATION_CONTEXT_INVALID";
|
|
36
|
+
readonly retryable = false;
|
|
37
|
+
}
|
|
38
|
+
declare class CollaborationDisabledError extends CollaborationError {
|
|
39
|
+
readonly code = "COLLABORATION_DISABLED";
|
|
40
|
+
}
|
|
41
|
+
declare class CollaborationContextRequiredError extends CollaborationError {
|
|
42
|
+
readonly code = "COLLABORATION_CONTEXT_REQUIRED";
|
|
43
|
+
}
|
|
44
|
+
declare class CollaborationTeamUnavailableError extends CollaborationError {
|
|
45
|
+
readonly code = "COLLABORATION_TEAM_UNAVAILABLE";
|
|
46
|
+
}
|
|
47
|
+
declare class CollaborationRoleUnsupportedError extends CollaborationError {
|
|
48
|
+
readonly code = "COLLABORATION_ROLE_UNSUPPORTED";
|
|
49
|
+
}
|
|
50
|
+
declare class CollaborationToolArgumentError extends CollaborationError {
|
|
51
|
+
readonly code = "COLLABORATION_ARGUMENT_INVALID";
|
|
52
|
+
}
|
|
53
|
+
declare class CollaborationTaskUnauthorizedError extends CollaborationError {
|
|
54
|
+
readonly code = "COLLABORATION_TASK_UNAUTHORIZED";
|
|
55
|
+
}
|
|
56
|
+
declare class CollaborationTaskInvalidError extends CollaborationError {
|
|
57
|
+
readonly code = "COLLABORATION_TASK_INVALID";
|
|
58
|
+
}
|
|
59
|
+
declare class CollaborationTaskNotFoundError extends CollaborationError {
|
|
60
|
+
readonly code = "COLLABORATION_TASK_NOT_FOUND";
|
|
61
|
+
}
|
|
62
|
+
declare class CollaborationTaskConflictError extends CollaborationError {
|
|
63
|
+
readonly code = "COLLABORATION_TASK_CONFLICT";
|
|
64
|
+
}
|
|
65
|
+
declare class CollaborationFileTooLargeError extends CollaborationError {
|
|
66
|
+
readonly code = "COLLABORATION_FILE_TOO_LARGE";
|
|
67
|
+
}
|
|
68
|
+
declare class CollaborationTaskUnavailableError extends CollaborationError {
|
|
69
|
+
readonly code = "COLLABORATION_TASK_UNAVAILABLE";
|
|
70
|
+
readonly retryable = true;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export { CollaborationConfigError, CollaborationContextError, CollaborationContextRequiredError, CollaborationDisabledError, CollaborationError, CollaborationFileTooLargeError, CollaborationRoleUnsupportedError, CollaborationTaskConflictError, CollaborationTaskInvalidError, CollaborationTaskNotFoundError, CollaborationTaskUnauthorizedError, CollaborationTaskUnavailableError, CollaborationTeamUnavailableError, CollaborationToolArgumentError, CollaborationTurnContext, bindCollaborationContext, currentCollaborationContext, parseCollaborationContext, useCollaborationContext };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CollaborationConfigError,
|
|
3
|
+
CollaborationContextError,
|
|
4
|
+
CollaborationContextRequiredError,
|
|
5
|
+
CollaborationDisabledError,
|
|
6
|
+
CollaborationError,
|
|
7
|
+
CollaborationFileTooLargeError,
|
|
8
|
+
CollaborationRoleUnsupportedError,
|
|
9
|
+
CollaborationTaskConflictError,
|
|
10
|
+
CollaborationTaskInvalidError,
|
|
11
|
+
CollaborationTaskNotFoundError,
|
|
12
|
+
CollaborationTaskUnauthorizedError,
|
|
13
|
+
CollaborationTaskUnavailableError,
|
|
14
|
+
CollaborationTeamUnavailableError,
|
|
15
|
+
CollaborationToolArgumentError,
|
|
16
|
+
CollaborationTurnContext,
|
|
17
|
+
bindCollaborationContext,
|
|
18
|
+
currentCollaborationContext,
|
|
19
|
+
parseCollaborationContext,
|
|
20
|
+
useCollaborationContext
|
|
21
|
+
} from "../chunk-RYXL25AI.js";
|
|
22
|
+
import "../chunk-MZ5UWGXS.js";
|
|
23
|
+
export {
|
|
24
|
+
CollaborationConfigError,
|
|
25
|
+
CollaborationContextError,
|
|
26
|
+
CollaborationContextRequiredError,
|
|
27
|
+
CollaborationDisabledError,
|
|
28
|
+
CollaborationError,
|
|
29
|
+
CollaborationFileTooLargeError,
|
|
30
|
+
CollaborationRoleUnsupportedError,
|
|
31
|
+
CollaborationTaskConflictError,
|
|
32
|
+
CollaborationTaskInvalidError,
|
|
33
|
+
CollaborationTaskNotFoundError,
|
|
34
|
+
CollaborationTaskUnauthorizedError,
|
|
35
|
+
CollaborationTaskUnavailableError,
|
|
36
|
+
CollaborationTeamUnavailableError,
|
|
37
|
+
CollaborationToolArgumentError,
|
|
38
|
+
CollaborationTurnContext,
|
|
39
|
+
bindCollaborationContext,
|
|
40
|
+
currentCollaborationContext,
|
|
41
|
+
parseCollaborationContext,
|
|
42
|
+
useCollaborationContext
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=index.js.map
|