@tpsdev-ai/adk-flair 0.44.9 → 0.44.10
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/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/tag.d.ts +22 -4
- package/dist/tag.d.ts.map +1 -1
- package/dist/tag.js +31 -5
- package/dist/tag.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
* @packageDocumentation
|
|
5
5
|
*/
|
|
6
6
|
export { FlairMemoryService } from "./memory_service.js";
|
|
7
|
-
export { compoundTag, sanitizeTagSegment } from "./tag.js";
|
|
7
|
+
export { compoundTag, sanitizeTagSegment, desanitizeTagSegment } from "./tag.js";
|
|
8
8
|
export { loadEd25519Key, signRequest } from "./signing.js";
|
|
9
9
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
* @packageDocumentation
|
|
5
5
|
*/
|
|
6
6
|
export { FlairMemoryService } from "./memory_service.js";
|
|
7
|
-
export { compoundTag, sanitizeTagSegment } from "./tag.js";
|
|
7
|
+
export { compoundTag, sanitizeTagSegment, desanitizeTagSegment } from "./tag.js";
|
|
8
8
|
export { loadEd25519Key, signRequest } from "./signing.js";
|
|
9
9
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/tag.d.ts
CHANGED
|
@@ -2,14 +2,32 @@
|
|
|
2
2
|
* Compound tag helpers for adk-flair.
|
|
3
3
|
*
|
|
4
4
|
* Builds the `adk:<app_name>:<user_id>` compound tag used for per-user
|
|
5
|
-
* scoping in Flair.
|
|
6
|
-
*
|
|
5
|
+
* scoping in Flair. Reserved characters in segments are percent-encoded so
|
|
6
|
+
* distinct inputs never collide and the `:` delimiter stays unambiguous.
|
|
7
7
|
*/
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
9
|
+
* Percent-encode the reserved characters in a tag segment so distinct inputs
|
|
10
|
+
* never collide and the compound-tag delimiter ':' stays unambiguous.
|
|
11
|
+
*
|
|
12
|
+
* The old scheme replaced ':' -> '_', which COLLIDED: userId="alice:admin"
|
|
13
|
+
* and userId="alice_admin" both sanitized to "alice_admin" — one tag for two
|
|
14
|
+
* distinct identities. Because the compound tag is the per-user access-control
|
|
15
|
+
* boundary (ADK session distillation, #1205), that collision is a cross-user
|
|
16
|
+
* contamination bug. Mirrors the Python fix in
|
|
17
|
+
* packages/adk-flair/src/adk_flair/memory_service.py.
|
|
18
|
+
*
|
|
19
|
+
* This encoding is reversible and collision-free. '%' is escaped FIRST so it
|
|
20
|
+
* can introduce escapes, then ':' (the delimiter) and '_' (the old escape
|
|
21
|
+
* char). Because every escape starts with an already-escaped '%', no input can
|
|
22
|
+
* forge another input's encoding — see desanitizeTagSegment for the inverse.
|
|
11
23
|
*/
|
|
12
24
|
export declare function sanitizeTagSegment(segment: string): string;
|
|
25
|
+
/**
|
|
26
|
+
* Inverse of sanitizeTagSegment. '%25' is decoded LAST so a literal '%3A' in
|
|
27
|
+
* the original input (which encoded to '%253A') is not mistaken for an encoded
|
|
28
|
+
* ':'. Round-trips exactly: desanitizeTagSegment(sanitizeTagSegment(x)) === x.
|
|
29
|
+
*/
|
|
30
|
+
export declare function desanitizeTagSegment(segment: string): string;
|
|
13
31
|
/**
|
|
14
32
|
* Build the compound tag `adk:<app_name>:<user_id>`.
|
|
15
33
|
* Both segments are sanitized to prevent delimiter breakage.
|
package/dist/tag.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tag.d.ts","sourceRoot":"","sources":["../src/tag.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH
|
|
1
|
+
{"version":3,"file":"tag.d.ts","sourceRoot":"","sources":["../src/tag.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAK1D;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAK5D;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAEnE"}
|
package/dist/tag.js
CHANGED
|
@@ -2,16 +2,42 @@
|
|
|
2
2
|
* Compound tag helpers for adk-flair.
|
|
3
3
|
*
|
|
4
4
|
* Builds the `adk:<app_name>:<user_id>` compound tag used for per-user
|
|
5
|
-
* scoping in Flair.
|
|
6
|
-
*
|
|
5
|
+
* scoping in Flair. Reserved characters in segments are percent-encoded so
|
|
6
|
+
* distinct inputs never collide and the `:` delimiter stays unambiguous.
|
|
7
7
|
*/
|
|
8
8
|
const TAG_PREFIX = "adk";
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
10
|
+
* Percent-encode the reserved characters in a tag segment so distinct inputs
|
|
11
|
+
* never collide and the compound-tag delimiter ':' stays unambiguous.
|
|
12
|
+
*
|
|
13
|
+
* The old scheme replaced ':' -> '_', which COLLIDED: userId="alice:admin"
|
|
14
|
+
* and userId="alice_admin" both sanitized to "alice_admin" — one tag for two
|
|
15
|
+
* distinct identities. Because the compound tag is the per-user access-control
|
|
16
|
+
* boundary (ADK session distillation, #1205), that collision is a cross-user
|
|
17
|
+
* contamination bug. Mirrors the Python fix in
|
|
18
|
+
* packages/adk-flair/src/adk_flair/memory_service.py.
|
|
19
|
+
*
|
|
20
|
+
* This encoding is reversible and collision-free. '%' is escaped FIRST so it
|
|
21
|
+
* can introduce escapes, then ':' (the delimiter) and '_' (the old escape
|
|
22
|
+
* char). Because every escape starts with an already-escaped '%', no input can
|
|
23
|
+
* forge another input's encoding — see desanitizeTagSegment for the inverse.
|
|
12
24
|
*/
|
|
13
25
|
export function sanitizeTagSegment(segment) {
|
|
14
|
-
return segment
|
|
26
|
+
return segment
|
|
27
|
+
.replace(/%/g, "%25")
|
|
28
|
+
.replace(/:/g, "%3A")
|
|
29
|
+
.replace(/_/g, "%5F");
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Inverse of sanitizeTagSegment. '%25' is decoded LAST so a literal '%3A' in
|
|
33
|
+
* the original input (which encoded to '%253A') is not mistaken for an encoded
|
|
34
|
+
* ':'. Round-trips exactly: desanitizeTagSegment(sanitizeTagSegment(x)) === x.
|
|
35
|
+
*/
|
|
36
|
+
export function desanitizeTagSegment(segment) {
|
|
37
|
+
return segment
|
|
38
|
+
.replace(/%3A/g, ":")
|
|
39
|
+
.replace(/%5F/g, "_")
|
|
40
|
+
.replace(/%25/g, "%");
|
|
15
41
|
}
|
|
16
42
|
/**
|
|
17
43
|
* Build the compound tag `adk:<app_name>:<user_id>`.
|
package/dist/tag.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tag.js","sourceRoot":"","sources":["../src/tag.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,UAAU,GAAG,KAAK,CAAC;AAEzB
|
|
1
|
+
{"version":3,"file":"tag.js","sourceRoot":"","sources":["../src/tag.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,UAAU,GAAG,KAAK,CAAC;AAEzB;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAAe;IAChD,OAAO,OAAO;SACX,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AAC1B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAe;IAClD,OAAO,OAAO;SACX,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;SACpB,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;SACpB,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAC1B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,OAAe,EAAE,MAAc;IACzD,OAAO,GAAG,UAAU,IAAI,kBAAkB,CAAC,OAAO,CAAC,IAAI,kBAAkB,CAAC,MAAM,CAAC,EAAE,CAAC;AACtF,CAAC"}
|