@m1a0rz/agent-identity 0.4.1 → 0.4.3
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/README-cn.md +32 -19
- package/README.md +32 -19
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +80 -7
- package/dist/scripts/demo-get-session.d.ts +15 -0
- package/dist/scripts/demo-get-session.d.ts.map +1 -0
- package/dist/scripts/demo-get-session.js +58 -0
- package/dist/src/actions/identity-actions.d.ts +74 -8
- package/dist/src/actions/identity-actions.d.ts.map +1 -1
- package/dist/src/actions/identity-actions.js +217 -84
- package/dist/src/commands/identity-commands.d.ts.map +1 -1
- package/dist/src/commands/identity-commands.js +139 -11
- package/dist/src/gateway/identity-session-methods.d.ts +2 -2
- package/dist/src/gateway/identity-session-methods.d.ts.map +1 -1
- package/dist/src/gateway/identity-session-methods.js +9 -5
- package/dist/src/hooks/after-tool-call.d.ts.map +1 -1
- package/dist/src/hooks/after-tool-call.js +12 -0
- package/dist/src/hooks/before-agent-start.d.ts +2 -0
- package/dist/src/hooks/before-agent-start.d.ts.map +1 -1
- package/dist/src/hooks/before-agent-start.js +33 -6
- package/dist/src/hooks/before-tool-call.d.ts +1 -0
- package/dist/src/hooks/before-tool-call.d.ts.map +1 -1
- package/dist/src/hooks/before-tool-call.js +29 -5
- package/dist/src/hooks/llm-input.d.ts.map +1 -1
- package/dist/src/hooks/llm-input.js +32 -4
- package/dist/src/hooks/sessions-send-propagation.d.ts.map +1 -1
- package/dist/src/hooks/sessions-send-propagation.js +1 -0
- package/dist/src/hooks/sessions-spawn-propagation.d.ts.map +1 -1
- package/dist/src/hooks/sessions-spawn-propagation.js +1 -0
- package/dist/src/hooks/tool-result-persist.d.ts +20 -0
- package/dist/src/hooks/tool-result-persist.d.ts.map +1 -0
- package/dist/src/hooks/tool-result-persist.js +50 -0
- package/dist/src/preflight/plugin-preflight.d.ts +55 -0
- package/dist/src/preflight/plugin-preflight.d.ts.map +1 -0
- package/dist/src/preflight/plugin-preflight.js +226 -0
- package/dist/src/preflight/plugin-state.d.ts +18 -0
- package/dist/src/preflight/plugin-state.d.ts.map +1 -0
- package/dist/src/preflight/plugin-state.js +19 -0
- package/dist/src/routes/oidc-login.js +2 -2
- package/dist/src/services/identity-client.d.ts +129 -2
- package/dist/src/services/identity-client.d.ts.map +1 -1
- package/dist/src/services/identity-client.js +175 -20
- package/dist/src/services/identity-credentials.d.ts +1 -1
- package/dist/src/services/identity-credentials.d.ts.map +1 -1
- package/dist/src/services/identity-credentials.js +32 -16
- package/dist/src/services/oidc-client.d.ts +12 -1
- package/dist/src/services/oidc-client.d.ts.map +1 -1
- package/dist/src/services/oidc-client.js +20 -3
- package/dist/src/services/session-refresh.d.ts +10 -0
- package/dist/src/services/session-refresh.d.ts.map +1 -1
- package/dist/src/services/session-refresh.js +29 -5
- package/dist/src/services/skill-contract-metadata.d.ts +35 -0
- package/dist/src/services/skill-contract-metadata.d.ts.map +1 -0
- package/dist/src/services/skill-contract-metadata.js +145 -0
- package/dist/src/services/skill-contract-renderer.d.ts +14 -0
- package/dist/src/services/skill-contract-renderer.d.ts.map +1 -0
- package/dist/src/services/skill-contract-renderer.js +120 -0
- package/dist/src/services/tip-propagation.d.ts +2 -0
- package/dist/src/services/tip-propagation.d.ts.map +1 -1
- package/dist/src/services/tip-propagation.js +4 -3
- package/dist/src/services/tip-with-refresh.d.ts +1 -1
- package/dist/src/services/tip-with-refresh.d.ts.map +1 -1
- package/dist/src/services/tip-with-refresh.js +24 -39
- package/dist/src/store/credential-store.d.ts +6 -1
- package/dist/src/store/credential-store.d.ts.map +1 -1
- package/dist/src/store/credential-store.js +3 -0
- package/dist/src/store/oidc-state-store.d.ts +3 -3
- package/dist/src/store/oidc-state-store.d.ts.map +1 -1
- package/dist/src/store/oidc-state-store.js +2 -2
- package/dist/src/store/sender-session-store.d.ts +8 -0
- package/dist/src/store/sender-session-store.d.ts.map +1 -1
- package/dist/src/store/sender-session-store.js +34 -1
- package/dist/src/store/skill-contract-store.d.ts +19 -0
- package/dist/src/store/skill-contract-store.d.ts.map +1 -0
- package/dist/src/store/skill-contract-store.js +65 -0
- package/dist/src/store/skill-path-store.d.ts +5 -0
- package/dist/src/store/skill-path-store.d.ts.map +1 -1
- package/dist/src/store/skill-path-store.js +13 -1
- package/dist/src/tools/identity-approve-tool.d.ts +2 -11
- package/dist/src/tools/identity-approve-tool.d.ts.map +1 -1
- package/dist/src/tools/identity-config-suggest.d.ts +2 -13
- package/dist/src/tools/identity-config-suggest.d.ts.map +1 -1
- package/dist/src/tools/identity-config.d.ts +2 -7
- package/dist/src/tools/identity-config.d.ts.map +1 -1
- package/dist/src/tools/identity-fetch.d.ts +2 -13
- package/dist/src/tools/identity-fetch.d.ts.map +1 -1
- package/dist/src/tools/identity-fetch.js +3 -3
- package/dist/src/tools/identity-get-role-credentials.d.ts +10 -0
- package/dist/src/tools/identity-get-role-credentials.d.ts.map +1 -0
- package/dist/src/tools/identity-get-role-credentials.js +56 -0
- package/dist/src/tools/identity-get-session-token.d.ts +8 -0
- package/dist/src/tools/identity-get-session-token.d.ts.map +1 -0
- package/dist/src/tools/identity-get-session-token.js +46 -0
- package/dist/src/tools/identity-get-tip-token.d.ts +8 -0
- package/dist/src/tools/identity-get-tip-token.d.ts.map +1 -0
- package/dist/src/tools/identity-get-tip-token.js +46 -0
- package/dist/src/tools/identity-list-credentials.d.ts +2 -11
- package/dist/src/tools/identity-list-credentials.d.ts.map +1 -1
- package/dist/src/tools/identity-list-credentials.js +4 -3
- package/dist/src/tools/identity-list-risk-patterns.d.ts +2 -7
- package/dist/src/tools/identity-list-risk-patterns.d.ts.map +1 -1
- package/dist/src/tools/identity-list-roles.d.ts +8 -0
- package/dist/src/tools/identity-list-roles.d.ts.map +1 -0
- package/dist/src/tools/identity-list-roles.js +43 -0
- package/dist/src/tools/identity-list-tips.d.ts +2 -7
- package/dist/src/tools/identity-list-tips.d.ts.map +1 -1
- package/dist/src/tools/identity-login.d.ts +2 -7
- package/dist/src/tools/identity-login.d.ts.map +1 -1
- package/dist/src/tools/identity-logout.d.ts +2 -7
- package/dist/src/tools/identity-logout.d.ts.map +1 -1
- package/dist/src/tools/identity-risk-check.d.ts +3 -17
- package/dist/src/tools/identity-risk-check.d.ts.map +1 -1
- package/dist/src/tools/identity-set-binding.d.ts +2 -10
- package/dist/src/tools/identity-set-binding.d.ts.map +1 -1
- package/dist/src/tools/identity-status.d.ts +2 -7
- package/dist/src/tools/identity-status.d.ts.map +1 -1
- package/dist/src/tools/identity-unset-binding.d.ts +2 -9
- package/dist/src/tools/identity-unset-binding.d.ts.map +1 -1
- package/dist/src/tools/identity-whoami.d.ts +2 -7
- package/dist/src/tools/identity-whoami.d.ts.map +1 -1
- package/dist/src/types.d.ts +25 -0
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/derive-session-key.d.ts +1 -0
- package/dist/src/utils/derive-session-key.d.ts.map +1 -1
- package/dist/src/utils/derive-session-key.js +28 -4
- package/dist/src/utils/resolve-identity-endpoint.d.ts +26 -0
- package/dist/src/utils/resolve-identity-endpoint.d.ts.map +1 -0
- package/dist/src/utils/resolve-identity-endpoint.js +90 -0
- package/openclaw.plugin.json +18 -1
- package/package.json +11 -3
- package/skills/SKILL.md +9 -9
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* In-memory stores for identity contract injection:
|
|
3
|
+
*
|
|
4
|
+
* 1. Contract spec cache: normalizedSkillPath -> parsed bindings (LRU eviction).
|
|
5
|
+
* 2. Pending injection map: toolCallId -> rendered contract text (one-time consume + TTL).
|
|
6
|
+
*/
|
|
7
|
+
import type { CredentialBinding } from "../services/skill-contract-metadata.js";
|
|
8
|
+
export type SkillContractSpec = {
|
|
9
|
+
skillName: string;
|
|
10
|
+
skillPath: string;
|
|
11
|
+
bindings: CredentialBinding[];
|
|
12
|
+
parsedAt: number;
|
|
13
|
+
};
|
|
14
|
+
export declare function setContractSpec(skillPath: string, spec: Omit<SkillContractSpec, "parsedAt">): void;
|
|
15
|
+
export declare function getContractSpec(skillPath: string): SkillContractSpec | undefined;
|
|
16
|
+
export declare function setPending(toolCallId: string, renderedText: string): void;
|
|
17
|
+
export declare function consumePending(toolCallId: string): string | undefined;
|
|
18
|
+
export declare function cleanupExpiredPending(): number;
|
|
19
|
+
//# sourceMappingURL=skill-contract-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill-contract-store.d.ts","sourceRoot":"","sources":["../../../src/store/skill-contract-store.ts"],"names":[],"mappings":"AAgBA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAKhF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IAC9B,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAKF,wBAAgB,eAAe,CAC7B,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,IAAI,CAAC,iBAAiB,EAAE,UAAU,CAAC,GACxC,IAAI,CAQN;AAED,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,iBAAiB,GAAG,SAAS,CAGhF;AAaD,wBAAgB,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,IAAI,CAOzE;AAED,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAKrE;AAED,wBAAgB,qBAAqB,IAAI,MAAM,CAU9C"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd. and/or its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { skillDirForCacheKey } from "./skill-path-store.js";
|
|
17
|
+
const specCache = new Map();
|
|
18
|
+
const MAX_SPEC_ENTRIES = 256;
|
|
19
|
+
export function setContractSpec(skillPath, spec) {
|
|
20
|
+
if (!skillPath)
|
|
21
|
+
return;
|
|
22
|
+
const key = skillDirForCacheKey(skillPath);
|
|
23
|
+
if (specCache.size >= MAX_SPEC_ENTRIES) {
|
|
24
|
+
const first = specCache.keys().next().value;
|
|
25
|
+
if (first)
|
|
26
|
+
specCache.delete(first);
|
|
27
|
+
}
|
|
28
|
+
specCache.set(key, { ...spec, parsedAt: Date.now() });
|
|
29
|
+
}
|
|
30
|
+
export function getContractSpec(skillPath) {
|
|
31
|
+
if (!skillPath)
|
|
32
|
+
return undefined;
|
|
33
|
+
return specCache.get(skillDirForCacheKey(skillPath));
|
|
34
|
+
}
|
|
35
|
+
const pendingMap = new Map();
|
|
36
|
+
const PENDING_TTL_MS = 10 * 60 * 1000;
|
|
37
|
+
const MAX_PENDING_ENTRIES = 512;
|
|
38
|
+
export function setPending(toolCallId, renderedText) {
|
|
39
|
+
if (!toolCallId)
|
|
40
|
+
return;
|
|
41
|
+
if (pendingMap.size >= MAX_PENDING_ENTRIES) {
|
|
42
|
+
const first = pendingMap.keys().next().value;
|
|
43
|
+
if (first)
|
|
44
|
+
pendingMap.delete(first);
|
|
45
|
+
}
|
|
46
|
+
pendingMap.set(toolCallId, { renderedText, createdAt: Date.now() });
|
|
47
|
+
}
|
|
48
|
+
export function consumePending(toolCallId) {
|
|
49
|
+
if (!toolCallId)
|
|
50
|
+
return undefined;
|
|
51
|
+
const entry = pendingMap.get(toolCallId);
|
|
52
|
+
pendingMap.delete(toolCallId);
|
|
53
|
+
return entry?.renderedText;
|
|
54
|
+
}
|
|
55
|
+
export function cleanupExpiredPending() {
|
|
56
|
+
const now = Date.now();
|
|
57
|
+
let removed = 0;
|
|
58
|
+
for (const [key, entry] of pendingMap.entries()) {
|
|
59
|
+
if (now - entry.createdAt > PENDING_TTL_MS) {
|
|
60
|
+
pendingMap.delete(key);
|
|
61
|
+
removed++;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return removed;
|
|
65
|
+
}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
export declare function normalizePathForLookup(pathStr: string, workspaceDir?: string): string;
|
|
2
|
+
/** Skill directory path for cache key (strips trailing /SKILL.md). */
|
|
3
|
+
export declare function skillDirForCacheKey(normalizedPath: string): string;
|
|
1
4
|
export declare function setSkillPathsForSession(sessionKey: string, pathToSkill: Map<string, string>, workspaceDir?: string, sessionId?: string): void;
|
|
2
5
|
export declare function getSkillNameForPath(sessionKey: string, pathStr: string, workspaceDir?: string): string | undefined;
|
|
6
|
+
/** Get all skill path entries for a session (normalizedPath -> skillName). Used by contract cache. */
|
|
7
|
+
export declare function getSkillPathEntries(sessionKey: string): Array<[string, string]>;
|
|
3
8
|
export declare function clearSessionByKey(sessionKey: string): void;
|
|
4
9
|
export declare function clearSessionById(sessionId: string): void;
|
|
5
10
|
//# sourceMappingURL=skill-path-store.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skill-path-store.d.ts","sourceRoot":"","sources":["../../../src/store/skill-path-store.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"skill-path-store.d.ts","sourceRoot":"","sources":["../../../src/store/skill-path-store.ts"],"names":[],"mappings":"AA8BA,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAgBrF;AAED,sEAAsE;AACtE,wBAAgB,mBAAmB,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,CAGlE;AAED,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAChC,YAAY,CAAC,EAAE,MAAM,EACrB,SAAS,CAAC,EAAE,MAAM,GACjB,IAAI,CA0BN;AAED,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,EACf,YAAY,CAAC,EAAE,MAAM,GACpB,MAAM,GAAG,SAAS,CAMpB;AAED,sGAAsG;AACtG,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAI/E;AAED,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAS1D;AAED,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAKxD"}
|
|
@@ -24,7 +24,7 @@ const pathToSkillBySessionKey = new Map();
|
|
|
24
24
|
const sessionIdToSessionKey = new Map();
|
|
25
25
|
const MAX_SESSIONS = 512;
|
|
26
26
|
const MAX_PATHS_PER_SESSION = 256;
|
|
27
|
-
function normalizePathForLookup(pathStr, workspaceDir) {
|
|
27
|
+
export function normalizePathForLookup(pathStr, workspaceDir) {
|
|
28
28
|
const s = String(pathStr).trim();
|
|
29
29
|
if (!s)
|
|
30
30
|
return "";
|
|
@@ -44,6 +44,11 @@ function normalizePathForLookup(pathStr, workspaceDir) {
|
|
|
44
44
|
}
|
|
45
45
|
return path.normalize(normalized);
|
|
46
46
|
}
|
|
47
|
+
/** Skill directory path for cache key (strips trailing /SKILL.md). */
|
|
48
|
+
export function skillDirForCacheKey(normalizedPath) {
|
|
49
|
+
const p = normalizedPath.replace(/\\/g, "/");
|
|
50
|
+
return p.endsWith("/SKILL.md") ? p.slice(0, -"/SKILL.md".length) : p;
|
|
51
|
+
}
|
|
47
52
|
export function setSkillPathsForSession(sessionKey, pathToSkill, workspaceDir, sessionId) {
|
|
48
53
|
if (!sessionKey)
|
|
49
54
|
return;
|
|
@@ -84,6 +89,13 @@ export function getSkillNameForPath(sessionKey, pathStr, workspaceDir) {
|
|
|
84
89
|
const normalized = normalizePathForLookup(pathStr, workspaceDir);
|
|
85
90
|
return map.get(normalized);
|
|
86
91
|
}
|
|
92
|
+
/** Get all skill path entries for a session (normalizedPath -> skillName). Used by contract cache. */
|
|
93
|
+
export function getSkillPathEntries(sessionKey) {
|
|
94
|
+
const map = pathToSkillBySessionKey.get(sessionKey);
|
|
95
|
+
if (!map)
|
|
96
|
+
return [];
|
|
97
|
+
return [...map.entries()];
|
|
98
|
+
}
|
|
87
99
|
export function clearSessionByKey(sessionKey) {
|
|
88
100
|
if (!sessionKey)
|
|
89
101
|
return;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Used for webchat/TUI flow when user approves via UI then agent retries.
|
|
4
4
|
*/
|
|
5
5
|
import type { PluginToolContext } from "../types.js";
|
|
6
|
+
import { AnyAgentTool } from "openclaw/plugin-sdk";
|
|
6
7
|
export type IdentityApproveToolDeps = {
|
|
7
8
|
approvalTtlMs: number;
|
|
8
9
|
logger?: {
|
|
@@ -10,15 +11,5 @@ export type IdentityApproveToolDeps = {
|
|
|
10
11
|
warn?: (msg: string) => void;
|
|
11
12
|
};
|
|
12
13
|
};
|
|
13
|
-
export declare function createIdentityApproveTool(deps: IdentityApproveToolDeps): (ctx: PluginToolContext) =>
|
|
14
|
-
name: string;
|
|
15
|
-
label: string;
|
|
16
|
-
description: string;
|
|
17
|
-
parameters: import("@sinclair/typebox").TObject<{
|
|
18
|
-
approval_id: import("@sinclair/typebox").TString;
|
|
19
|
-
}>;
|
|
20
|
-
execute: (_toolCallId: string, params: {
|
|
21
|
-
approval_id?: string;
|
|
22
|
-
}) => Promise<import("@mariozechner/pi-agent-core").AgentToolResult<unknown>>;
|
|
23
|
-
};
|
|
14
|
+
export declare function createIdentityApproveTool(deps: IdentityApproveToolDeps): (ctx: PluginToolContext) => AnyAgentTool;
|
|
24
15
|
//# sourceMappingURL=identity-approve-tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity-approve-tool.d.ts","sourceRoot":"","sources":["../../../src/tools/identity-approve-tool.ts"],"names":[],"mappings":"AAgBA;;;GAGG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"identity-approve-tool.d.ts","sourceRoot":"","sources":["../../../src/tools/identity-approve-tool.ts"],"names":[],"mappings":"AAgBA;;;GAGG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,OAAO,EAAE,YAAY,EAAc,MAAM,qBAAqB,CAAC;AAK/D,MAAM,MAAM,uBAAuB,GAAG;IACpC,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;QAAC,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;KAAE,CAAC;CAC1E,CAAC;AAEF,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,uBAAuB,IAC7D,KAAK,iBAAiB,KAAG,YAAY,CA8B9C"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AnyAgentTool } from "openclaw/plugin-sdk";
|
|
1
2
|
declare const INTENTS: {
|
|
2
3
|
readonly identity: {
|
|
3
4
|
readonly label: "Identity API (AK/SK, endpoint)";
|
|
@@ -96,18 +97,6 @@ declare const INTENTS: {
|
|
|
96
97
|
};
|
|
97
98
|
};
|
|
98
99
|
export type ConfigSuggestIntent = keyof typeof INTENTS;
|
|
99
|
-
export declare function createIdentityConfigSuggestTool(): () =>
|
|
100
|
-
name: string;
|
|
101
|
-
label: string;
|
|
102
|
-
description: string;
|
|
103
|
-
parameters: import("@sinclair/typebox").TObject<{
|
|
104
|
-
intent: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
105
|
-
lang: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
106
|
-
}>;
|
|
107
|
-
execute: (_toolCallId: string, params: {
|
|
108
|
-
intent?: ConfigSuggestIntent;
|
|
109
|
-
lang?: "en" | "zh";
|
|
110
|
-
}) => Promise<import("@mariozechner/pi-agent-core").AgentToolResult<unknown>>;
|
|
111
|
-
};
|
|
100
|
+
export declare function createIdentityConfigSuggestTool(): () => AnyAgentTool;
|
|
112
101
|
export {};
|
|
113
102
|
//# sourceMappingURL=identity-config-suggest.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity-config-suggest.d.ts","sourceRoot":"","sources":["../../../src/tools/identity-config-suggest.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"identity-config-suggest.d.ts","sourceRoot":"","sources":["../../../src/tools/identity-config-suggest.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,YAAY,EAAc,MAAM,qBAAqB,CAAC;AAiC/D,QAAA,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgGH,CAAC;AAEX,MAAM,MAAM,mBAAmB,GAAG,MAAM,OAAO,OAAO,CAAC;AAEvD,wBAAgB,+BAA+B,UAClC,YAAY,CA+CxB"}
|
|
@@ -2,12 +2,7 @@
|
|
|
2
2
|
* identity_config: show identity plugin configuration (redacted).
|
|
3
3
|
*/
|
|
4
4
|
import type { PluginToolContext } from "../types.js";
|
|
5
|
+
import { AnyAgentTool } from "openclaw/plugin-sdk";
|
|
5
6
|
import type { IdentityActionsDeps } from "../actions/identity-actions.js";
|
|
6
|
-
export declare function createIdentityConfigTool(deps: IdentityActionsDeps): (_ctx: PluginToolContext) =>
|
|
7
|
-
name: string;
|
|
8
|
-
label: string;
|
|
9
|
-
description: string;
|
|
10
|
-
parameters: import("@sinclair/typebox").TObject<{}>;
|
|
11
|
-
execute: () => Promise<import("@mariozechner/pi-agent-core").AgentToolResult<unknown>>;
|
|
12
|
-
};
|
|
7
|
+
export declare function createIdentityConfigTool(deps: IdentityActionsDeps): (_ctx: PluginToolContext) => AnyAgentTool;
|
|
13
8
|
//# sourceMappingURL=identity-config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity-config.d.ts","sourceRoot":"","sources":["../../../src/tools/identity-config.ts"],"names":[],"mappings":"AAgBA;;GAEG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"identity-config.d.ts","sourceRoot":"","sources":["../../../src/tools/identity-config.ts"],"names":[],"mappings":"AAgBA;;GAEG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,OAAO,EAAE,YAAY,EAAc,MAAM,qBAAqB,CAAC;AAC/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAG1E,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,mBAAmB,IACxD,MAAM,iBAAiB,KAAG,YAAY,CAU/C"}
|
|
@@ -4,18 +4,7 @@
|
|
|
4
4
|
* When returnValue is true and fetch succeeds, returns the credential value for same-turn automation.
|
|
5
5
|
*/
|
|
6
6
|
import type { PluginToolContext } from "../types.js";
|
|
7
|
+
import { AnyAgentTool } from "openclaw/plugin-sdk";
|
|
7
8
|
import type { IdentityActionsDeps } from "../actions/identity-actions.js";
|
|
8
|
-
export declare function createIdentityFetchTool(deps: IdentityActionsDeps): (ctx: PluginToolContext) =>
|
|
9
|
-
name: string;
|
|
10
|
-
label: string;
|
|
11
|
-
description: string;
|
|
12
|
-
parameters: import("@sinclair/typebox").TObject<{
|
|
13
|
-
provider: import("@sinclair/typebox").TString;
|
|
14
|
-
flow: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<"oauth2-user" | "oauth2-m2m" | "apikey">>;
|
|
15
|
-
redirectUrl: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
16
|
-
scopes: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
|
|
17
|
-
returnValue: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
18
|
-
}>;
|
|
19
|
-
execute: (_toolCallId: any, params: any) => Promise<import("@mariozechner/pi-agent-core").AgentToolResult<unknown>>;
|
|
20
|
-
};
|
|
9
|
+
export declare function createIdentityFetchTool(deps: IdentityActionsDeps): (ctx: PluginToolContext) => AnyAgentTool;
|
|
21
10
|
//# sourceMappingURL=identity-fetch.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity-fetch.d.ts","sourceRoot":"","sources":["../../../src/tools/identity-fetch.ts"],"names":[],"mappings":"AAgBA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"identity-fetch.d.ts","sourceRoot":"","sources":["../../../src/tools/identity-fetch.ts"],"names":[],"mappings":"AAgBA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,OAAO,EAAE,YAAY,EAAsB,MAAM,qBAAqB,CAAC;AAEvE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAO1E,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,mBAAmB,IACvD,KAAK,iBAAiB,KAAG,YAAY,CA8D9C"}
|
|
@@ -19,16 +19,16 @@ import { jsonResult } from "openclaw/plugin-sdk";
|
|
|
19
19
|
import { runFetch } from "../actions/identity-actions.js";
|
|
20
20
|
import { getCredential, resolveCredentialValue } from "../store/credential-store.js";
|
|
21
21
|
import { resolveEffectiveSessionKey } from "../store/sender-session-store.js";
|
|
22
|
-
const FETCH_FLOWS = ["oauth2-user", "oauth2-m2m", "apikey"];
|
|
22
|
+
const FETCH_FLOWS = ["oauth2-user", "oauth2-m2m", "apikey", "user"];
|
|
23
23
|
export function createIdentityFetchTool(deps) {
|
|
24
24
|
return (ctx) => ({
|
|
25
25
|
name: "identity_fetch",
|
|
26
26
|
label: "Identity Fetch Credential",
|
|
27
|
-
description: "Add credential for a provider. OAuth2-user returns auth URL to open; apikey/oauth2-m2m complete immediately. Set returnValue=true to receive the credential value for same-turn automation (use with care: value may appear in logs).",
|
|
27
|
+
description: "Add credential for a provider. OAuth2-user returns auth URL to open; apikey/oauth2-m2m/user complete immediately. Set returnValue=true to receive the credential value for same-turn automation (use with care: value may appear in logs).",
|
|
28
28
|
parameters: Type.Object({
|
|
29
29
|
provider: Type.String({ description: "Provider name (e.g. google, openai)" }),
|
|
30
30
|
flow: Type.Optional(optionalStringEnum(FETCH_FLOWS, {
|
|
31
|
-
description: "oauth2-user (default for 3LO), oauth2-m2m, apikey",
|
|
31
|
+
description: "oauth2-user (default for 3LO), oauth2-m2m, apikey, user",
|
|
32
32
|
})),
|
|
33
33
|
redirectUrl: Type.Optional(Type.String()),
|
|
34
34
|
scopes: Type.Optional(Type.Array(Type.String())),
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* identity_get_role_credentials: obtain STS temporary credentials via a role credential provider.
|
|
3
|
+
* Skills that need IAM Role access call this tool to get AK/SK/SessionToken,
|
|
4
|
+
* then use them for downstream API requests.
|
|
5
|
+
*/
|
|
6
|
+
import type { PluginToolContext } from "../types.js";
|
|
7
|
+
import { AnyAgentTool } from "openclaw/plugin-sdk";
|
|
8
|
+
import type { IdentityActionsDeps } from "../actions/identity-actions.js";
|
|
9
|
+
export declare function createIdentityGetRoleCredentialsTool(deps: IdentityActionsDeps): (ctx: PluginToolContext) => AnyAgentTool;
|
|
10
|
+
//# sourceMappingURL=identity-get-role-credentials.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity-get-role-credentials.d.ts","sourceRoot":"","sources":["../../../src/tools/identity-get-role-credentials.ts"],"names":[],"mappings":"AAgBA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,OAAO,EAAE,YAAY,EAAc,MAAM,qBAAqB,CAAC;AAC/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAI1E,wBAAgB,oCAAoC,CAAC,IAAI,EAAE,mBAAmB,IACpE,KAAK,iBAAiB,KAAG,YAAY,CAsC9C"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd. and/or its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { Type } from "@sinclair/typebox";
|
|
17
|
+
import { jsonResult } from "openclaw/plugin-sdk";
|
|
18
|
+
import { runGetRoleCredentials } from "../actions/identity-actions.js";
|
|
19
|
+
import { resolveEffectiveSessionKey } from "../store/sender-session-store.js";
|
|
20
|
+
export function createIdentityGetRoleCredentialsTool(deps) {
|
|
21
|
+
return (ctx) => ({
|
|
22
|
+
name: "identity_get_role_credentials",
|
|
23
|
+
label: "Identity Get Role Credentials",
|
|
24
|
+
description: "Obtain temporary STS credentials (AccessKeyId, SecretAccessKey, SessionToken) " +
|
|
25
|
+
"via a role credential provider. Use when a skill or tool needs IAM Role access " +
|
|
26
|
+
"to call cloud APIs. By default uses the user session token (id_token); " +
|
|
27
|
+
"set useTip=true to use the TIP token instead.",
|
|
28
|
+
parameters: Type.Object({
|
|
29
|
+
providerName: Type.String({
|
|
30
|
+
description: "Role credential provider name configured in the control plane.",
|
|
31
|
+
}),
|
|
32
|
+
useTip: Type.Optional(Type.Boolean({
|
|
33
|
+
description: "When true, use TIP token as identity token instead of user session token. Default false.",
|
|
34
|
+
})),
|
|
35
|
+
}),
|
|
36
|
+
execute: async (_toolCallId, params) => {
|
|
37
|
+
const sessionKey = ctx.sessionKey ? resolveEffectiveSessionKey(ctx.sessionKey) : undefined;
|
|
38
|
+
if (!sessionKey) {
|
|
39
|
+
return jsonResult({ error: "No session context", success: false });
|
|
40
|
+
}
|
|
41
|
+
const p = params;
|
|
42
|
+
const result = await runGetRoleCredentials(deps, sessionKey, {
|
|
43
|
+
providerName: p.providerName,
|
|
44
|
+
useTip: p.useTip ?? false,
|
|
45
|
+
config: ctx.config,
|
|
46
|
+
});
|
|
47
|
+
if (result.kind === "error") {
|
|
48
|
+
return jsonResult({ success: false, error: result.message });
|
|
49
|
+
}
|
|
50
|
+
return jsonResult({
|
|
51
|
+
success: true,
|
|
52
|
+
credentials: result.credentials,
|
|
53
|
+
});
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* identity_get_session_token: obtain the OIDC id_token (session / user token) for the current session.
|
|
3
|
+
*/
|
|
4
|
+
import type { PluginToolContext } from "../types.js";
|
|
5
|
+
import { AnyAgentTool } from "openclaw/plugin-sdk";
|
|
6
|
+
import type { IdentityActionsDeps } from "../actions/identity-actions.js";
|
|
7
|
+
export declare function createIdentityGetSessionTokenTool(deps: IdentityActionsDeps): (ctx: PluginToolContext) => AnyAgentTool;
|
|
8
|
+
//# sourceMappingURL=identity-get-session-token.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity-get-session-token.d.ts","sourceRoot":"","sources":["../../../src/tools/identity-get-session-token.ts"],"names":[],"mappings":"AAgBA;;GAEG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,OAAO,EAAE,YAAY,EAAc,MAAM,qBAAqB,CAAC;AAC/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAI1E,wBAAgB,iCAAiC,CAAC,IAAI,EAAE,mBAAmB,IACjE,KAAK,iBAAiB,KAAG,YAAY,CA0B9C"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd. and/or its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { Type } from "@sinclair/typebox";
|
|
17
|
+
import { jsonResult } from "openclaw/plugin-sdk";
|
|
18
|
+
import { runGetSessionToken } from "../actions/identity-actions.js";
|
|
19
|
+
import { resolveEffectiveSessionKey } from "../store/sender-session-store.js";
|
|
20
|
+
export function createIdentityGetSessionTokenTool(deps) {
|
|
21
|
+
return (ctx) => ({
|
|
22
|
+
name: "identity_get_session_token",
|
|
23
|
+
label: "Identity Get Session Token",
|
|
24
|
+
description: "Obtain the OIDC id_token stored for this session (UserPool / session identity token). " +
|
|
25
|
+
"Use when a skill needs the end-user JWT instead of the TIP workload token. " +
|
|
26
|
+
"The value is sensitive; do not print it in chat.",
|
|
27
|
+
parameters: Type.Object({}),
|
|
28
|
+
execute: async () => {
|
|
29
|
+
const sessionKey = ctx.sessionKey ? resolveEffectiveSessionKey(ctx.sessionKey) : undefined;
|
|
30
|
+
if (!sessionKey) {
|
|
31
|
+
return jsonResult({ success: false, error: "No session context" });
|
|
32
|
+
}
|
|
33
|
+
const result = await runGetSessionToken(deps, sessionKey);
|
|
34
|
+
if (result.kind === "error") {
|
|
35
|
+
return jsonResult({ success: false, error: result.message });
|
|
36
|
+
}
|
|
37
|
+
return jsonResult({
|
|
38
|
+
success: true,
|
|
39
|
+
sessionIdToken: result.sessionIdToken,
|
|
40
|
+
sub: result.sub,
|
|
41
|
+
loginAt: result.loginAt,
|
|
42
|
+
expiresAt: result.expiresAt,
|
|
43
|
+
});
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* identity_get_tip_token: obtain the workload TIP JWT for the current session.
|
|
3
|
+
*/
|
|
4
|
+
import type { PluginToolContext } from "../types.js";
|
|
5
|
+
import { AnyAgentTool } from "openclaw/plugin-sdk";
|
|
6
|
+
import type { IdentityActionsDeps } from "../actions/identity-actions.js";
|
|
7
|
+
export declare function createIdentityGetTipTokenTool(deps: IdentityActionsDeps): (ctx: PluginToolContext) => AnyAgentTool;
|
|
8
|
+
//# sourceMappingURL=identity-get-tip-token.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity-get-tip-token.d.ts","sourceRoot":"","sources":["../../../src/tools/identity-get-tip-token.ts"],"names":[],"mappings":"AAgBA;;GAEG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,OAAO,EAAE,YAAY,EAAc,MAAM,qBAAqB,CAAC;AAC/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAI1E,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,mBAAmB,IAC7D,KAAK,iBAAiB,KAAG,YAAY,CA0B9C"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd. and/or its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { Type } from "@sinclair/typebox";
|
|
17
|
+
import { jsonResult } from "openclaw/plugin-sdk";
|
|
18
|
+
import { runGetTipToken } from "../actions/identity-actions.js";
|
|
19
|
+
import { resolveEffectiveSessionKey } from "../store/sender-session-store.js";
|
|
20
|
+
export function createIdentityGetTipTokenTool(deps) {
|
|
21
|
+
return (ctx) => ({
|
|
22
|
+
name: "identity_get_tip_token",
|
|
23
|
+
label: "Identity Get TIP Token",
|
|
24
|
+
description: "Obtain the Trusted Identity Provider (TIP) JWT for this session. " +
|
|
25
|
+
"Use when a skill needs the workload token for downstream APIs. " +
|
|
26
|
+
"The value is sensitive; do not print it in chat.",
|
|
27
|
+
parameters: Type.Object({}),
|
|
28
|
+
execute: async () => {
|
|
29
|
+
const sessionKey = ctx.sessionKey ? resolveEffectiveSessionKey(ctx.sessionKey) : undefined;
|
|
30
|
+
if (!sessionKey) {
|
|
31
|
+
return jsonResult({ success: false, error: "No session context" });
|
|
32
|
+
}
|
|
33
|
+
const result = await runGetTipToken(deps, sessionKey, ctx.config);
|
|
34
|
+
if (result.kind === "error") {
|
|
35
|
+
return jsonResult({ success: false, error: result.message });
|
|
36
|
+
}
|
|
37
|
+
return jsonResult({
|
|
38
|
+
success: true,
|
|
39
|
+
tipToken: result.tipToken,
|
|
40
|
+
sub: result.sub,
|
|
41
|
+
issuedAt: result.issuedAt,
|
|
42
|
+
expiresAt: result.expiresAt,
|
|
43
|
+
});
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
}
|
|
@@ -2,16 +2,7 @@
|
|
|
2
2
|
* identity_list_credentials: list credential providers and stored credentials (paginated).
|
|
3
3
|
*/
|
|
4
4
|
import type { PluginToolContext } from "../types.js";
|
|
5
|
+
import { AnyAgentTool } from "openclaw/plugin-sdk";
|
|
5
6
|
import type { IdentityActionsDeps } from "../actions/identity-actions.js";
|
|
6
|
-
export declare function createIdentityListCredentialsTool(deps: IdentityActionsDeps): (ctx: PluginToolContext) =>
|
|
7
|
-
name: string;
|
|
8
|
-
label: string;
|
|
9
|
-
description: string;
|
|
10
|
-
parameters: import("@sinclair/typebox").TObject<{
|
|
11
|
-
page: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
|
12
|
-
name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
13
|
-
flow: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
14
|
-
}>;
|
|
15
|
-
execute: (_toolCallId: any, params: any) => Promise<import("@mariozechner/pi-agent-core").AgentToolResult<unknown>>;
|
|
16
|
-
};
|
|
7
|
+
export declare function createIdentityListCredentialsTool(deps: IdentityActionsDeps): (ctx: PluginToolContext) => AnyAgentTool;
|
|
17
8
|
//# sourceMappingURL=identity-list-credentials.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity-list-credentials.d.ts","sourceRoot":"","sources":["../../../src/tools/identity-list-credentials.ts"],"names":[],"mappings":"AAgBA;;GAEG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"identity-list-credentials.d.ts","sourceRoot":"","sources":["../../../src/tools/identity-list-credentials.ts"],"names":[],"mappings":"AAgBA;;GAEG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,OAAO,EAAE,YAAY,EAAc,MAAM,qBAAqB,CAAC;AAC/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAI1E,wBAAgB,iCAAiC,CAAC,IAAI,EAAE,mBAAmB,IACjE,KAAK,iBAAiB,KAAG,YAAY,CA0B9C"}
|
|
@@ -21,19 +21,20 @@ export function createIdentityListCredentialsTool(deps) {
|
|
|
21
21
|
return (ctx) => ({
|
|
22
22
|
name: "identity_list_credentials",
|
|
23
23
|
label: "Identity List Credentials",
|
|
24
|
-
description: "List credential providers and stored credentials.
|
|
24
|
+
description: "List credential providers (OAuth/API key) and stored credentials. Use identity_list_roles for role credential providers (STS).",
|
|
25
25
|
parameters: Type.Object({
|
|
26
26
|
page: Type.Optional(Type.Number({ minimum: 1, default: 1 })),
|
|
27
27
|
name: Type.Optional(Type.String({ description: "Filter providers by name (exact or prefix match)." })),
|
|
28
28
|
flow: Type.Optional(Type.String({ description: "Filter providers by flow, e.g. 'M2M' or 'USER_FEDERATION'." })),
|
|
29
|
+
type: Type.Optional(Type.String({ description: "Filter credential providers by type, e.g. 'api_key' or 'oauth2'." })),
|
|
29
30
|
}),
|
|
30
31
|
execute: async (_toolCallId, params) => {
|
|
31
32
|
const sessionKey = ctx.sessionKey ? resolveEffectiveSessionKey(ctx.sessionKey) : undefined;
|
|
32
33
|
if (!sessionKey) {
|
|
33
34
|
return jsonResult({ error: "No session context", providers: [], storedOnly: [] });
|
|
34
35
|
}
|
|
35
|
-
const { page, name, flow } = params;
|
|
36
|
-
const filter = name || flow ? { name, flow } : undefined;
|
|
36
|
+
const { page, name, flow, type } = params;
|
|
37
|
+
const filter = name || flow || type ? { name, flow, type } : undefined;
|
|
37
38
|
const result = await runListCredentials(deps, sessionKey, page ?? 1, filter);
|
|
38
39
|
return jsonResult({
|
|
39
40
|
providers: result.providers,
|
|
@@ -3,11 +3,6 @@
|
|
|
3
3
|
* Use to understand what the plugin considers high-risk before running commands.
|
|
4
4
|
*/
|
|
5
5
|
import type { PluginToolContext } from "../types.js";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
label: string;
|
|
9
|
-
description: string;
|
|
10
|
-
parameters: import("@sinclair/typebox").TObject<{}>;
|
|
11
|
-
execute: () => Promise<import("@mariozechner/pi-agent-core").AgentToolResult<unknown>>;
|
|
12
|
-
};
|
|
6
|
+
import { AnyAgentTool } from "openclaw/plugin-sdk";
|
|
7
|
+
export declare function createIdentityListRiskPatternsTool(): (_ctx: PluginToolContext) => AnyAgentTool;
|
|
13
8
|
//# sourceMappingURL=identity-list-risk-patterns.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity-list-risk-patterns.d.ts","sourceRoot":"","sources":["../../../src/tools/identity-list-risk-patterns.ts"],"names":[],"mappings":"AAgBA;;;GAGG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"identity-list-risk-patterns.d.ts","sourceRoot":"","sources":["../../../src/tools/identity-list-risk-patterns.ts"],"names":[],"mappings":"AAgBA;;;GAGG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,OAAO,EAAE,YAAY,EAAc,MAAM,qBAAqB,CAAC;AAG/D,wBAAgB,kCAAkC,KACxC,MAAM,iBAAiB,KAAG,YAAY,CAe/C"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* identity_list_roles: list role credential providers (STS).
|
|
3
|
+
*/
|
|
4
|
+
import type { PluginToolContext } from "../types.js";
|
|
5
|
+
import { AnyAgentTool } from "openclaw/plugin-sdk";
|
|
6
|
+
import type { IdentityActionsDeps } from "../actions/identity-actions.js";
|
|
7
|
+
export declare function createIdentityListRolesTool(deps: IdentityActionsDeps): (ctx: PluginToolContext) => AnyAgentTool;
|
|
8
|
+
//# sourceMappingURL=identity-list-roles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity-list-roles.d.ts","sourceRoot":"","sources":["../../../src/tools/identity-list-roles.ts"],"names":[],"mappings":"AAgBA;;GAEG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,OAAO,EAAE,YAAY,EAAc,MAAM,qBAAqB,CAAC;AAC/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAI1E,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,mBAAmB,IAC3D,KAAK,iBAAiB,KAAG,YAAY,CAsB9C"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd. and/or its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { Type } from "@sinclair/typebox";
|
|
17
|
+
import { jsonResult } from "openclaw/plugin-sdk";
|
|
18
|
+
import { runListRoleCredentials } from "../actions/identity-actions.js";
|
|
19
|
+
import { resolveEffectiveSessionKey } from "../store/sender-session-store.js";
|
|
20
|
+
export function createIdentityListRolesTool(deps) {
|
|
21
|
+
return (ctx) => ({
|
|
22
|
+
name: "identity_list_roles",
|
|
23
|
+
label: "Identity List Roles",
|
|
24
|
+
description: "List role credential providers (STS). Use identity_get_role_credentials to obtain credentials for a provider.",
|
|
25
|
+
parameters: Type.Object({
|
|
26
|
+
name: Type.Optional(Type.String({ description: "Filter providers by name (prefix match)." })),
|
|
27
|
+
}),
|
|
28
|
+
execute: async (_toolCallId, params) => {
|
|
29
|
+
const sessionKey = ctx.sessionKey ? resolveEffectiveSessionKey(ctx.sessionKey) : undefined;
|
|
30
|
+
if (!sessionKey) {
|
|
31
|
+
return jsonResult({ error: "No session context", providers: [] });
|
|
32
|
+
}
|
|
33
|
+
const { name } = params;
|
|
34
|
+
const filter = name ? { name } : undefined;
|
|
35
|
+
const result = await runListRoleCredentials(deps, sessionKey, filter);
|
|
36
|
+
return jsonResult({
|
|
37
|
+
providers: result.providers,
|
|
38
|
+
page: result.page,
|
|
39
|
+
hasMore: result.hasMore,
|
|
40
|
+
});
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
}
|
|
@@ -2,12 +2,7 @@
|
|
|
2
2
|
* identity_list_tips: list valid TIP tokens and env bindings.
|
|
3
3
|
*/
|
|
4
4
|
import type { PluginToolContext } from "../types.js";
|
|
5
|
+
import { AnyAgentTool } from "openclaw/plugin-sdk";
|
|
5
6
|
import type { IdentityActionsDeps } from "../actions/identity-actions.js";
|
|
6
|
-
export declare function createIdentityListTipsTool(deps: IdentityActionsDeps): (_ctx: PluginToolContext) =>
|
|
7
|
-
name: string;
|
|
8
|
-
label: string;
|
|
9
|
-
description: string;
|
|
10
|
-
parameters: import("@sinclair/typebox").TObject<{}>;
|
|
11
|
-
execute: () => Promise<import("@mariozechner/pi-agent-core").AgentToolResult<unknown>>;
|
|
12
|
-
};
|
|
7
|
+
export declare function createIdentityListTipsTool(deps: IdentityActionsDeps): (_ctx: PluginToolContext) => AnyAgentTool;
|
|
13
8
|
//# sourceMappingURL=identity-list-tips.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity-list-tips.d.ts","sourceRoot":"","sources":["../../../src/tools/identity-list-tips.ts"],"names":[],"mappings":"AAgBA;;GAEG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"identity-list-tips.d.ts","sourceRoot":"","sources":["../../../src/tools/identity-list-tips.ts"],"names":[],"mappings":"AAgBA;;GAEG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,OAAO,EAAE,YAAY,EAAc,MAAM,qBAAqB,CAAC;AAC/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAG1E,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,mBAAmB,IAC1D,MAAM,iBAAiB,KAAG,YAAY,CAa/C"}
|