@alfe.ai/openclaw-secrets 0.2.24 → 0.2.25
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.md +12 -0
- package/dist/crypto.d.ts.map +1 -1
- package/dist/crypto.js +70 -17
- package/dist/crypto.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +50 -121
- package/dist/index.js.map +1 -1
- package/dist/input-validation.d.ts +30 -0
- package/dist/input-validation.d.ts.map +1 -0
- package/dist/input-validation.js +166 -0
- package/dist/input-validation.js.map +1 -0
- package/dist/scope-resolve.d.ts +1 -1
- package/dist/scope-resolve.d.ts.map +1 -1
- package/dist/scope-resolve.js +7 -1
- package/dist/scope-resolve.js.map +1 -1
- package/package.json +8 -4
- package/.turbo/turbo-build.log +0 -4
- package/CHANGELOG.md +0 -322
- package/dist/types.d.ts +0 -18
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -8
- package/dist/types.js.map +0 -1
- package/src/__tests__/crypto.test.ts +0 -187
- package/src/__tests__/scope-resolve.test.ts +0 -68
- package/src/crypto.ts +0 -115
- package/src/index.ts +0 -624
- package/src/scope-resolve.ts +0 -62
- package/src/types.ts +0 -18
- package/sst-env.d.ts +0 -10
- package/tsconfig.json +0 -20
- package/vitest.config.ts +0 -9
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
export const VALID_SCOPES = ["org", "team", "project", "agent"];
|
|
2
|
+
export const VALID_CATEGORIES = [
|
|
3
|
+
"login", "api_key", "database", "ssh_key", "certificate",
|
|
4
|
+
"secure_note", "credit_card", "identity", "wifi", "other",
|
|
5
|
+
];
|
|
6
|
+
export const VALID_FORMATS = [
|
|
7
|
+
"text", "email", "url", "phone", "date", "number", "json",
|
|
8
|
+
];
|
|
9
|
+
export const VALID_SENSITIVITIES = ["plaintext", "encrypted"];
|
|
10
|
+
const FIELD_KEY_REGEX = /^[a-zA-Z0-9_./-]{1,64}$/;
|
|
11
|
+
const UUID_V4 = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
12
|
+
const CURSOR_REGEX = /^[A-Za-z0-9+/_=-]+$/;
|
|
13
|
+
const SUSPICIOUS_PLAINTEXT_KEYS = [
|
|
14
|
+
"password", "token", "secret", "apikey", "api_key", "pwd",
|
|
15
|
+
];
|
|
16
|
+
function parseRequiredString(raw, field, max) {
|
|
17
|
+
if (typeof raw !== "string" || raw.length === 0) {
|
|
18
|
+
throw new Error(`${field} is required`);
|
|
19
|
+
}
|
|
20
|
+
if (raw.length > max) {
|
|
21
|
+
throw new Error(`${field} must be ${String(max)} characters or fewer`);
|
|
22
|
+
}
|
|
23
|
+
return raw;
|
|
24
|
+
}
|
|
25
|
+
export function parseOptionalString(raw, field, max) {
|
|
26
|
+
if (raw === undefined)
|
|
27
|
+
return undefined;
|
|
28
|
+
return parseRequiredString(raw, field, max);
|
|
29
|
+
}
|
|
30
|
+
export function parseScope(raw, field = "scope") {
|
|
31
|
+
if (typeof raw !== "string" || !VALID_SCOPES.includes(raw)) {
|
|
32
|
+
throw new Error(`${field} must be one of ${VALID_SCOPES.join(", ")}`);
|
|
33
|
+
}
|
|
34
|
+
return raw;
|
|
35
|
+
}
|
|
36
|
+
export function parseSecretName(raw) {
|
|
37
|
+
return parseRequiredString(raw, "name", 128);
|
|
38
|
+
}
|
|
39
|
+
export function parseFieldKey(raw) {
|
|
40
|
+
const value = parseRequiredString(raw, "field key", 64);
|
|
41
|
+
if (!FIELD_KEY_REGEX.test(value)) {
|
|
42
|
+
throw new Error("field key must match ^[a-zA-Z0-9_./-]{1,64}$");
|
|
43
|
+
}
|
|
44
|
+
return value;
|
|
45
|
+
}
|
|
46
|
+
export function parseSecretId(raw) {
|
|
47
|
+
const value = parseRequiredString(raw, "secretId", 64);
|
|
48
|
+
if (!UUID_V4.test(value))
|
|
49
|
+
throw new Error("secretId must be a UUID v4");
|
|
50
|
+
return value;
|
|
51
|
+
}
|
|
52
|
+
export function parseCategory(raw) {
|
|
53
|
+
if (raw === undefined)
|
|
54
|
+
return undefined;
|
|
55
|
+
if (typeof raw !== "string" || !VALID_CATEGORIES.includes(raw)) {
|
|
56
|
+
throw new Error(`category must be one of ${VALID_CATEGORIES.join(", ")}`);
|
|
57
|
+
}
|
|
58
|
+
return raw;
|
|
59
|
+
}
|
|
60
|
+
export function parseFormat(raw) {
|
|
61
|
+
if (raw === undefined)
|
|
62
|
+
return undefined;
|
|
63
|
+
if (typeof raw !== "string" || !VALID_FORMATS.includes(raw)) {
|
|
64
|
+
throw new Error(`format must be one of ${VALID_FORMATS.join(", ")}`);
|
|
65
|
+
}
|
|
66
|
+
return raw;
|
|
67
|
+
}
|
|
68
|
+
export function parseSensitivity(raw, field = "sensitivity") {
|
|
69
|
+
if (typeof raw !== "string" || !VALID_SENSITIVITIES.includes(raw)) {
|
|
70
|
+
throw new Error(`${field} must be one of ${VALID_SENSITIVITIES.join(", ")}`);
|
|
71
|
+
}
|
|
72
|
+
return raw;
|
|
73
|
+
}
|
|
74
|
+
export function parseFieldValue(args) {
|
|
75
|
+
const { raw, key, sensitivity, format, field = "value" } = args;
|
|
76
|
+
if (typeof raw !== "string")
|
|
77
|
+
throw new Error(`${field} must be a string`);
|
|
78
|
+
const max = sensitivity === "encrypted" ? 16_384 : format === "json" ? 8_192 : 1_024;
|
|
79
|
+
if (raw.length > max)
|
|
80
|
+
throw new Error(`${field} must be ${String(max)} characters or fewer`);
|
|
81
|
+
if (sensitivity === "plaintext") {
|
|
82
|
+
const normalizedKey = key.toLowerCase();
|
|
83
|
+
if (SUSPICIOUS_PLAINTEXT_KEYS.some((fragment) => normalizedKey.includes(fragment))) {
|
|
84
|
+
throw new Error(`field '${key}' looks sensitive — use encrypted sensitivity`);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
if (format === "json") {
|
|
88
|
+
try {
|
|
89
|
+
JSON.parse(raw);
|
|
90
|
+
}
|
|
91
|
+
catch {
|
|
92
|
+
throw new Error(`${field} must contain valid JSON`);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return raw;
|
|
96
|
+
}
|
|
97
|
+
export function parseFields(raw) {
|
|
98
|
+
if (!Array.isArray(raw) || raw.length === 0) {
|
|
99
|
+
throw new Error("fields must be a non-empty array");
|
|
100
|
+
}
|
|
101
|
+
if (raw.length > 32)
|
|
102
|
+
throw new Error("fields cannot exceed 32 entries");
|
|
103
|
+
const keys = new Set();
|
|
104
|
+
return raw.map((candidate, index) => {
|
|
105
|
+
if (typeof candidate !== "object" || candidate === null || Array.isArray(candidate)) {
|
|
106
|
+
throw new Error(`fields[${String(index)}] must be an object`);
|
|
107
|
+
}
|
|
108
|
+
const value = candidate;
|
|
109
|
+
const key = parseFieldKey(value.key);
|
|
110
|
+
if (keys.has(key))
|
|
111
|
+
throw new Error(`duplicate field key: ${key}`);
|
|
112
|
+
keys.add(key);
|
|
113
|
+
const sensitivity = parseSensitivity(value.sensitivity, `fields[${String(index)}].sensitivity`);
|
|
114
|
+
const format = parseFormat(value.format);
|
|
115
|
+
return {
|
|
116
|
+
key,
|
|
117
|
+
sensitivity,
|
|
118
|
+
format,
|
|
119
|
+
value: parseFieldValue({
|
|
120
|
+
raw: value.value,
|
|
121
|
+
key,
|
|
122
|
+
sensitivity,
|
|
123
|
+
format,
|
|
124
|
+
field: `fields[${String(index)}].value`,
|
|
125
|
+
}),
|
|
126
|
+
};
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
export function parseTags(raw) {
|
|
130
|
+
if (raw === undefined)
|
|
131
|
+
return undefined;
|
|
132
|
+
if (!Array.isArray(raw))
|
|
133
|
+
throw new Error("tags must be an array");
|
|
134
|
+
if (raw.length > 16)
|
|
135
|
+
throw new Error("tags cannot exceed 16 entries");
|
|
136
|
+
const tags = raw.map((tag, index) => parseRequiredString(tag, `tags[${String(index)}]`, 64));
|
|
137
|
+
if (new Set(tags).size !== tags.length)
|
|
138
|
+
throw new Error("tags must be unique");
|
|
139
|
+
return tags;
|
|
140
|
+
}
|
|
141
|
+
export function parseSecretFilters(params) {
|
|
142
|
+
const category = parseCategory(params.category);
|
|
143
|
+
const tag = parseOptionalString(params.tag, "tag", 64);
|
|
144
|
+
const fieldKey = params.fieldKey === undefined ? undefined : parseFieldKey(params.fieldKey);
|
|
145
|
+
if ([category, tag, fieldKey].filter((value) => value !== undefined).length > 1) {
|
|
146
|
+
throw new Error("at most one of category, tag, or fieldKey may be supplied");
|
|
147
|
+
}
|
|
148
|
+
return { category, tag, fieldKey };
|
|
149
|
+
}
|
|
150
|
+
export function parseHistoryLimit(raw) {
|
|
151
|
+
if (raw === undefined)
|
|
152
|
+
return undefined;
|
|
153
|
+
if (typeof raw !== "number" || !Number.isInteger(raw) || raw < 1 || raw > 100) {
|
|
154
|
+
throw new Error("limit must be an integer between 1 and 100");
|
|
155
|
+
}
|
|
156
|
+
return raw;
|
|
157
|
+
}
|
|
158
|
+
export function parseHistoryCursor(raw) {
|
|
159
|
+
if (raw === undefined)
|
|
160
|
+
return undefined;
|
|
161
|
+
const cursor = parseRequiredString(raw, "cursor", 4_096);
|
|
162
|
+
if (!CURSOR_REGEX.test(cursor))
|
|
163
|
+
throw new Error("cursor has an invalid format");
|
|
164
|
+
return cursor;
|
|
165
|
+
}
|
|
166
|
+
//# sourceMappingURL=input-validation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-validation.js","sourceRoot":"","sources":["../src/input-validation.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,MAAM,YAAY,GAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;AAC/E,MAAM,CAAC,MAAM,gBAAgB,GAAqB;IAChD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa;IACxD,aAAa,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO;CAC1D,CAAC;AACF,MAA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 export interface ToolContextLike {
|
|
|
12
12
|
*
|
|
13
13
|
* - omitted or empty → fill from ctx.agentId
|
|
14
14
|
* - the literal string "agent" → fill from ctx.agentId (LLM mistake)
|
|
15
|
-
* -
|
|
15
|
+
* - the current agent ID (e.g. "agt_…") → normalize to runtime casing
|
|
16
16
|
*
|
|
17
17
|
* Other scopes (org/team/project) require an explicit scopeId from the
|
|
18
18
|
* `secret_list_scopes` tool — they have no sensible default.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scope-resolve.d.ts","sourceRoot":"","sources":["../src/scope-resolve.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAE7D,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,GAAG,EAAE,eAAe,GACnB,MAAM,
|
|
1
|
+
{"version":3,"file":"scope-resolve.d.ts","sourceRoot":"","sources":["../src/scope-resolve.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAE7D,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,GAAG,EAAE,eAAe,GACnB,MAAM,CAuCR;AAED,eAAO,MAAM,oBAAoB,0OACmM,CAAC"}
|
package/dist/scope-resolve.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* - omitted or empty → fill from ctx.agentId
|
|
10
10
|
* - the literal string "agent" → fill from ctx.agentId (LLM mistake)
|
|
11
|
-
* -
|
|
11
|
+
* - the current agent ID (e.g. "agt_…") → normalize to runtime casing
|
|
12
12
|
*
|
|
13
13
|
* Other scopes (org/team/project) require an explicit scopeId from the
|
|
14
14
|
* `secret_list_scopes` tool — they have no sensible default.
|
|
@@ -28,10 +28,16 @@ export function resolveScopeId(scope, params, ctx) {
|
|
|
28
28
|
(!explicit || explicit.toLowerCase() === fallback.toLowerCase())) {
|
|
29
29
|
return fallback;
|
|
30
30
|
}
|
|
31
|
+
if (fallback && explicit) {
|
|
32
|
+
throw new Error("agent scopeId must match the current runtime agentId");
|
|
33
|
+
}
|
|
31
34
|
const resolved = explicit ?? fallback ?? "";
|
|
32
35
|
if (!resolved) {
|
|
33
36
|
throw new Error("agent scope requires either ctx.agentId from the runtime or an explicit agent scopeId from secret_list_scopes");
|
|
34
37
|
}
|
|
38
|
+
if (resolved.length > 256) {
|
|
39
|
+
throw new Error("scopeId must be 256 characters or fewer");
|
|
40
|
+
}
|
|
35
41
|
return resolved;
|
|
36
42
|
}
|
|
37
43
|
if (typeof params.scopeId !== "string" || params.scopeId.length === 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scope-resolve.js","sourceRoot":"","sources":["../src/scope-resolve.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,cAAc,CAC5B,KAAkB,EAClB,MAA+B,EAC/B,GAAoB;IAEpB,IAAI,KAAK,KAAK,OAAO,EAAE,CAAC;QACtB,MAAM,QAAQ,GACZ,OAAO,MAAM,CAAC,OAAO,KAAK,QAAQ;YAClC,MAAM,CAAC,OAAO,KAAK,OAAO;YAC1B,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC;YACvB,CAAC,CAAC,MAAM,CAAC,OAAO;YAChB,CAAC,CAAC,SAAS,CAAC;QAChB,MAAM,QAAQ,GAAG,GAAG,CAAC,OAAO,CAAC;QAC7B,yEAAyE;QACzE,2EAA2E;QAC3E,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encrypted secret store. Agents encrypt/decrypt locally with AES-256-GCM; KMS data keys are fetched via the Alfe secrets service.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -10,10 +10,14 @@
|
|
|
10
10
|
"./dist/index.js"
|
|
11
11
|
]
|
|
12
12
|
},
|
|
13
|
+
"files": [
|
|
14
|
+
"dist",
|
|
15
|
+
"openclaw.plugin.json"
|
|
16
|
+
],
|
|
13
17
|
"license": "UNLICENSED",
|
|
14
18
|
"dependencies": {
|
|
15
|
-
"@alfe.ai/agent-api-client": "0.
|
|
16
|
-
"@alfe.ai/config": "0.4.
|
|
19
|
+
"@alfe.ai/agent-api-client": "0.15.0",
|
|
20
|
+
"@alfe.ai/config": "0.4.1"
|
|
17
21
|
},
|
|
18
22
|
"devDependencies": {
|
|
19
23
|
"@types/node": "^25.4.0",
|
|
@@ -30,7 +34,7 @@
|
|
|
30
34
|
"plugin"
|
|
31
35
|
],
|
|
32
36
|
"scripts": {
|
|
33
|
-
"build": "tsc",
|
|
37
|
+
"build": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\" && tsc",
|
|
34
38
|
"typecheck": "tsc --noEmit",
|
|
35
39
|
"lint": "eslint .",
|
|
36
40
|
"test": "vitest run --passWithNoTests"
|
package/.turbo/turbo-build.log
DELETED
package/CHANGELOG.md
DELETED
|
@@ -1,322 +0,0 @@
|
|
|
1
|
-
# @alfe.ai/openclaw-secrets
|
|
2
|
-
|
|
3
|
-
## 0.2.24
|
|
4
|
-
|
|
5
|
-
### Patch Changes
|
|
6
|
-
|
|
7
|
-
- Updated dependencies [0b8d3f5]
|
|
8
|
-
- Updated dependencies [0b8d3f5]
|
|
9
|
-
- Updated dependencies [0b8d3f5]
|
|
10
|
-
- Updated dependencies [0b8d3f5]
|
|
11
|
-
- @alfe.ai/agent-api-client@0.14.0
|
|
12
|
-
- @alfe.ai/config@0.4.0
|
|
13
|
-
|
|
14
|
-
## 0.2.23
|
|
15
|
-
|
|
16
|
-
### Patch Changes
|
|
17
|
-
|
|
18
|
-
- Updated dependencies [84bd15e]
|
|
19
|
-
- @alfe.ai/agent-api-client@0.13.0
|
|
20
|
-
|
|
21
|
-
## 0.2.22
|
|
22
|
-
|
|
23
|
-
### Patch Changes
|
|
24
|
-
|
|
25
|
-
- Updated dependencies [c8c8166]
|
|
26
|
-
- @alfe.ai/agent-api-client@0.12.0
|
|
27
|
-
|
|
28
|
-
## 0.2.21
|
|
29
|
-
|
|
30
|
-
### Patch Changes
|
|
31
|
-
|
|
32
|
-
- Updated dependencies [fb19a43]
|
|
33
|
-
- Updated dependencies [c38f020]
|
|
34
|
-
- @alfe.ai/agent-api-client@0.11.2
|
|
35
|
-
|
|
36
|
-
## 0.2.20
|
|
37
|
-
|
|
38
|
-
### Patch Changes
|
|
39
|
-
|
|
40
|
-
- Updated dependencies [3dd0528]
|
|
41
|
-
- @alfe.ai/agent-api-client@0.11.1
|
|
42
|
-
|
|
43
|
-
## 0.2.19
|
|
44
|
-
|
|
45
|
-
### Patch Changes
|
|
46
|
-
|
|
47
|
-
- Updated dependencies [0cb83b6]
|
|
48
|
-
- Updated dependencies [194e0b1]
|
|
49
|
-
- Updated dependencies [09cb229]
|
|
50
|
-
- Updated dependencies [d392820]
|
|
51
|
-
- @alfe.ai/agent-api-client@0.11.0
|
|
52
|
-
|
|
53
|
-
## 0.2.18
|
|
54
|
-
|
|
55
|
-
### Patch Changes
|
|
56
|
-
|
|
57
|
-
- bb910e1: Allow free-form secret names. A secret's `name` is a user-friendly display label — not an identifier — so the slug-only regex (`^[a-zA-Z0-9_./-]$`) is dropped; any non-empty string up to 128 chars is accepted. The unique identifier remains `secretId`. Also normalise a case-mangled own-agent `scopeId` back to the runtime's canonical `ctx.agentId` so the server's exact-match self-scope check passes.
|
|
58
|
-
- Updated dependencies [4f11322]
|
|
59
|
-
- @alfe.ai/agent-api-client@0.10.0
|
|
60
|
-
|
|
61
|
-
## 0.2.17
|
|
62
|
-
|
|
63
|
-
### Patch Changes
|
|
64
|
-
|
|
65
|
-
- Updated dependencies [41faec4]
|
|
66
|
-
- @alfe.ai/agent-api-client@0.9.0
|
|
67
|
-
|
|
68
|
-
## 0.2.16
|
|
69
|
-
|
|
70
|
-
### Patch Changes
|
|
71
|
-
|
|
72
|
-
- 30c06d6: Capture tool failures for Sentry: wrap tool registration with installToolErrorCapture so thrown and silently-returned tool errors emit a detector-matched [ERROR] line the Alfe daemon reports to Sentry.
|
|
73
|
-
- Updated dependencies [30c06d6]
|
|
74
|
-
- @alfe.ai/agent-api-client@0.8.0
|
|
75
|
-
|
|
76
|
-
## 0.2.15
|
|
77
|
-
|
|
78
|
-
### Patch Changes
|
|
79
|
-
|
|
80
|
-
- Updated dependencies [019c5e5]
|
|
81
|
-
- @alfe.ai/agent-api-client@0.7.1
|
|
82
|
-
|
|
83
|
-
## 0.2.14
|
|
84
|
-
|
|
85
|
-
### Patch Changes
|
|
86
|
-
|
|
87
|
-
- Updated dependencies [930e47b]
|
|
88
|
-
- @alfe.ai/agent-api-client@0.7.0
|
|
89
|
-
|
|
90
|
-
## 0.2.13
|
|
91
|
-
|
|
92
|
-
### Patch Changes
|
|
93
|
-
|
|
94
|
-
- Updated dependencies [3cb626d]
|
|
95
|
-
- @alfe.ai/agent-api-client@0.6.1
|
|
96
|
-
|
|
97
|
-
## 0.2.12
|
|
98
|
-
|
|
99
|
-
### Patch Changes
|
|
100
|
-
|
|
101
|
-
- Updated dependencies [0f90085]
|
|
102
|
-
- @alfe.ai/agent-api-client@0.6.0
|
|
103
|
-
|
|
104
|
-
## 0.2.11
|
|
105
|
-
|
|
106
|
-
### Patch Changes
|
|
107
|
-
|
|
108
|
-
- Updated dependencies [4f07d4a]
|
|
109
|
-
- @alfe.ai/agent-api-client@0.5.0
|
|
110
|
-
|
|
111
|
-
## 0.2.10
|
|
112
|
-
|
|
113
|
-
### Patch Changes
|
|
114
|
-
|
|
115
|
-
- Updated dependencies [cf857c6]
|
|
116
|
-
- @alfe.ai/config@0.3.0
|
|
117
|
-
|
|
118
|
-
## 0.2.9
|
|
119
|
-
|
|
120
|
-
### Patch Changes
|
|
121
|
-
|
|
122
|
-
- a7fcb13: Add npm package metadata (homepage, keywords, author) and README backlinks to alfe.ai and docs.alfe.ai for discoverability + SEO. Metadata/docs only — no code or API changes.
|
|
123
|
-
- Updated dependencies [73aaddb]
|
|
124
|
-
- Updated dependencies [156618e]
|
|
125
|
-
- Updated dependencies [61ade51]
|
|
126
|
-
- Updated dependencies [a7fcb13]
|
|
127
|
-
- Updated dependencies [156618e]
|
|
128
|
-
- @alfe.ai/agent-api-client@0.4.0
|
|
129
|
-
- @alfe.ai/config@0.2.0
|
|
130
|
-
|
|
131
|
-
## 0.2.8
|
|
132
|
-
|
|
133
|
-
### Patch Changes
|
|
134
|
-
|
|
135
|
-
- Updated dependencies [c6e316f]
|
|
136
|
-
- Updated dependencies [4da52e5]
|
|
137
|
-
- @alfe.ai/config@0.1.0
|
|
138
|
-
- @alfe.ai/agent-api-client@0.3.0
|
|
139
|
-
|
|
140
|
-
## 0.2.7
|
|
141
|
-
|
|
142
|
-
### Patch Changes
|
|
143
|
-
|
|
144
|
-
- Updated dependencies [2c81c60]
|
|
145
|
-
- @alfe.ai/agent-api-client@0.2.3
|
|
146
|
-
|
|
147
|
-
## 0.2.6
|
|
148
|
-
|
|
149
|
-
### Patch Changes
|
|
150
|
-
|
|
151
|
-
- Updated dependencies [62c3f05]
|
|
152
|
-
- @alfe.ai/agent-api-client@0.2.2
|
|
153
|
-
|
|
154
|
-
## 0.2.5
|
|
155
|
-
|
|
156
|
-
### Patch Changes
|
|
157
|
-
|
|
158
|
-
- Updated dependencies [6927804]
|
|
159
|
-
- @alfe.ai/agent-api-client@0.2.1
|
|
160
|
-
|
|
161
|
-
## 0.2.4
|
|
162
|
-
|
|
163
|
-
### Patch Changes
|
|
164
|
-
|
|
165
|
-
- Updated dependencies [9beffcc]
|
|
166
|
-
- Updated dependencies [4a4cd3e]
|
|
167
|
-
- Updated dependencies [4a4cd3e]
|
|
168
|
-
- Updated dependencies [48e58c5]
|
|
169
|
-
- Updated dependencies [6cbd063]
|
|
170
|
-
- @alfe.ai/agent-api-client@0.2.0
|
|
171
|
-
|
|
172
|
-
## 0.2.3
|
|
173
|
-
|
|
174
|
-
### Patch Changes
|
|
175
|
-
|
|
176
|
-
- Updated dependencies [aa889fe]
|
|
177
|
-
- @alfe.ai/config@0.0.9
|
|
178
|
-
|
|
179
|
-
## 0.2.2
|
|
180
|
-
|
|
181
|
-
### Patch Changes
|
|
182
|
-
|
|
183
|
-
- Updated dependencies [89723a9]
|
|
184
|
-
- @alfe.ai/agent-api-client@0.1.4
|
|
185
|
-
|
|
186
|
-
## 0.2.1
|
|
187
|
-
|
|
188
|
-
### Patch Changes
|
|
189
|
-
|
|
190
|
-
- Updated dependencies [893a67a]
|
|
191
|
-
- @alfe.ai/agent-api-client@0.1.3
|
|
192
|
-
|
|
193
|
-
## 0.2.0
|
|
194
|
-
|
|
195
|
-
### Minor Changes
|
|
196
|
-
|
|
197
|
-
- 28b68cd: Auto-fill `scopeId` from `ctx.agentId` for `scope === "agent"` and tighten every tool's schema description so an LLM can't pick the literal word `"agent"` as the ID. Previously, the plugin's tool schemas required `scopeId` with no description, which led to LLMs writing the literal string `"agent"` and stranding secret rows at `scopeId="agent"` instead of the real agent ID. The corresponding server-side enforcement (`requireAgentSelfScope`) now rejects that same mistake, but the plugin should make the happy path discoverable rather than fail-closed.
|
|
198
|
-
|
|
199
|
-
Behaviour:
|
|
200
|
-
|
|
201
|
-
- `scope: "agent"` with `scopeId` omitted, empty, or the literal `"agent"` → falls back to `ctx.agentId` from the OpenClaw runtime.
|
|
202
|
-
- `scope: "agent"` with a real agent ID → passed through (server-side enforces it must equal the calling agent).
|
|
203
|
-
- `scope: "org" | "team" | "project"` → `scopeId` is still required and validated as before.
|
|
204
|
-
|
|
205
|
-
`scopeId` is now optional in the JSON schema for `scope: "agent"`. Agents on older runtimes that don't populate `ctx.agentId` will see a clear error pointing them at `secret_list_scopes` for the canonical ID.
|
|
206
|
-
|
|
207
|
-
## 0.1.15
|
|
208
|
-
|
|
209
|
-
### Patch Changes
|
|
210
|
-
|
|
211
|
-
- Updated dependencies [47b38af]
|
|
212
|
-
- @alfe.ai/agent-api-client@0.1.2
|
|
213
|
-
|
|
214
|
-
## 0.1.14
|
|
215
|
-
|
|
216
|
-
### Patch Changes
|
|
217
|
-
|
|
218
|
-
- 0ebc784: Use `registerMemoryPromptSupplement` instead of `registerMemoryPromptSection`.
|
|
219
|
-
|
|
220
|
-
OpenClaw 2026.5+ added a runtime gate that rejects `registerMemoryPromptSection` calls from plugins whose `kind` is not `"memory"` (the secrets plugin is `kind: "secrets"`). The thrown error caused the entire plugin to fail during `register()`, so all 12 `secret_*` tools never reached the agent's tool inventory — agents reported they had "no API access to store secrets" even though the plugin was listed as enabled.
|
|
221
|
-
|
|
222
|
-
`registerMemoryPromptSupplement` is the correct API for non-memory plugins to add guidance text to the active memory plugin's prompt section. Same builder signature, no behavioural change otherwise.
|
|
223
|
-
|
|
224
|
-
## 0.1.13
|
|
225
|
-
|
|
226
|
-
### Patch Changes
|
|
227
|
-
|
|
228
|
-
- 9147ccc: Declare manifest contracts (`activation.onStartup`, `contracts.tools`) so OpenClaw 2026.5+'s effective-plugin-set loader imports these plugins. Without these declarations, the new runtime silently skips the plugin entirely — never imports it, never calls `activate(api)`, never establishes its connections. Backwards-compatible with OpenClaw 2026.4.x (already supports the same fields). No source-code or public-API changes — manifest-only patches.
|
|
229
|
-
|
|
230
|
-
- `memory-cloud`, `metrics`, `mcp-bundler`, `openclaw` (alfe-core), `google-chat`, `voice`, `webhooks` set `activation.onStartup: true` because they need to load at boot to maintain persistent connections, attach hooks, or run service polls.
|
|
231
|
-
- `secrets`, `search`, `database`, `google`, `mobile`, `teams`, `whatsapp` set `activation.onStartup: false` — they're tool-only and load on demand once a tool is invoked.
|
|
232
|
-
- `mcp-bundler` omits `contracts.tools` because it registers tools dynamically via the factory form of `api.registerTool(...)`; `onStartup: true` forces import without static tool names.
|
|
233
|
-
|
|
234
|
-
## 0.1.12
|
|
235
|
-
|
|
236
|
-
### Patch Changes
|
|
237
|
-
|
|
238
|
-
- 229045a: Fix plugin id mismatch — set the runtime `plugin.id` (and the manifest `id` for memory-cloud) to the fully qualified package name. OpenClaw 2026.5.x validates that the plugin module's exported id matches the package name; the previous short ids (`"secrets"`, `"memory-cloud"`) caused the plugins to fail validation and not load on agents running newer OpenClaw runtimes.
|
|
239
|
-
|
|
240
|
-
## 0.1.11
|
|
241
|
-
|
|
242
|
-
### Patch Changes
|
|
243
|
-
|
|
244
|
-
- 4de07e1: Multi-field secrets. New tools: `secret_get_full`, `secret_get_field`, `secret_set_field`, `secret_remove_field`, `secret_update_metadata`, `secret_search`, `secret_get_history`. `secret_set` now accepts an array of fields with `sensitivity: "plaintext" | "encrypted"` and `format: "text" | "email" | "url" | "phone" | "date" | "number" | "json"`. Existing `{ value: "..." }` shorthand on `secret_set` and `secret_get` keep working — they map to a single field with key `"value"`. Per-field encryption context binds each encrypted field to its key.
|
|
245
|
-
- Updated dependencies [229b827]
|
|
246
|
-
- Updated dependencies [4de07e1]
|
|
247
|
-
- @alfe.ai/agent-api-client@0.1.1
|
|
248
|
-
|
|
249
|
-
## 0.1.10
|
|
250
|
-
|
|
251
|
-
### Patch Changes
|
|
252
|
-
|
|
253
|
-
- Updated dependencies [a86024c]
|
|
254
|
-
- @alfe.ai/agent-api-client@0.1.0
|
|
255
|
-
|
|
256
|
-
## 0.1.9
|
|
257
|
-
|
|
258
|
-
### Patch Changes
|
|
259
|
-
|
|
260
|
-
- Updated dependencies [f0a9368]
|
|
261
|
-
- @alfe.ai/agent-api-client@0.0.13
|
|
262
|
-
|
|
263
|
-
## 0.1.8
|
|
264
|
-
|
|
265
|
-
### Patch Changes
|
|
266
|
-
|
|
267
|
-
- Remove required apiUrl/agentApiKey from openclaw.plugin.json config schema — OpenClaw was rejecting the plugin before code ran because no config was provided. Plugin now uses resolveConfig() internally.
|
|
268
|
-
|
|
269
|
-
## 0.1.7
|
|
270
|
-
|
|
271
|
-
### Patch Changes
|
|
272
|
-
|
|
273
|
-
- Updated dependencies [4f3b54a]
|
|
274
|
-
- @alfe.ai/agent-api-client@0.0.12
|
|
275
|
-
|
|
276
|
-
## 0.1.6
|
|
277
|
-
|
|
278
|
-
### Patch Changes
|
|
279
|
-
|
|
280
|
-
- eadf368: Use resolveConfig() from @alfe.ai/config instead of requiring apiUrl/agentApiKey in plugin config
|
|
281
|
-
|
|
282
|
-
## 0.1.5
|
|
283
|
-
|
|
284
|
-
### Patch Changes
|
|
285
|
-
|
|
286
|
-
- 6921672: Fix plugin install and activation issues
|
|
287
|
-
|
|
288
|
-
- openclaw-memory-cloud: Add `openclaw.extensions`, refactor to use AgentApiClient instead of raw MemoryClient
|
|
289
|
-
- openclaw-secrets: Add missing `openclaw.extensions` field
|
|
290
|
-
- openclaw-google-chat: Fix poller not starting — registrationMode guard was blocking registerService
|
|
291
|
-
- agent-api-client: Add memory API methods, include Atlassian OAuth clientId/clientSecret in credentials
|
|
292
|
-
- All plugins: Remove registrationMode guard from activate() — OpenClaw handles mode filtering via registerService lifecycle
|
|
293
|
-
|
|
294
|
-
- Updated dependencies [6921672]
|
|
295
|
-
- @alfe.ai/agent-api-client@0.0.11
|
|
296
|
-
|
|
297
|
-
## 0.1.4
|
|
298
|
-
|
|
299
|
-
### Patch Changes
|
|
300
|
-
|
|
301
|
-
- c6b4fb3: Read plugin version from package.json instead of hardcoding, remove stale version field from openclaw.plugin.json
|
|
302
|
-
|
|
303
|
-
## 0.1.3
|
|
304
|
-
|
|
305
|
-
### Patch Changes
|
|
306
|
-
|
|
307
|
-
- Updated dependencies
|
|
308
|
-
- @alfe.ai/agent-api-client@0.0.10
|
|
309
|
-
|
|
310
|
-
## 0.1.2
|
|
311
|
-
|
|
312
|
-
### Patch Changes
|
|
313
|
-
|
|
314
|
-
- Updated dependencies [21c2a8f]
|
|
315
|
-
- @alfe.ai/agent-api-client@0.0.9
|
|
316
|
-
|
|
317
|
-
## 0.1.1
|
|
318
|
-
|
|
319
|
-
### Patch Changes
|
|
320
|
-
|
|
321
|
-
- Updated dependencies [bb1cde2]
|
|
322
|
-
- @alfe.ai/agent-api-client@0.0.8
|
package/dist/types.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Plugin-local types. Shared contract types (SecretScope, EncryptedEnvelopeV1,
|
|
3
|
-
* SecretMetadata, etc.) live in `@alfe/types` and are re-exported by
|
|
4
|
-
* `@alfe.ai/agent-api-client`; import from there so we have one canonical
|
|
5
|
-
* source of truth across every agent HTTP surface.
|
|
6
|
-
*/
|
|
7
|
-
export interface SecretsConfig {
|
|
8
|
-
/**
|
|
9
|
-
* Base URL of the Alfe API host — the same value `@alfe.ai/agent-api-client`
|
|
10
|
-
* expects (normally read from `ALFE_API_URL`), e.g. `https://api.alfe.ai`.
|
|
11
|
-
* The client prepends `/agent/secrets/*` automatically (the `/agent` segment
|
|
12
|
-
* is the agent-gateway api-mapping key; `/secrets` is the service
|
|
13
|
-
* pathPrefix). Do NOT include either segment in `apiUrl`.
|
|
14
|
-
*/
|
|
15
|
-
apiUrl: string;
|
|
16
|
-
agentApiKey: string;
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,aAAa;IAC5B;;;;;;OAMG;IACH,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;CACrB"}
|
package/dist/types.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Plugin-local types. Shared contract types (SecretScope, EncryptedEnvelopeV1,
|
|
3
|
-
* SecretMetadata, etc.) live in `@alfe/types` and are re-exported by
|
|
4
|
-
* `@alfe.ai/agent-api-client`; import from there so we have one canonical
|
|
5
|
-
* source of truth across every agent HTTP surface.
|
|
6
|
-
*/
|
|
7
|
-
export {};
|
|
8
|
-
//# sourceMappingURL=types.js.map
|
package/dist/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|