@ai-matrx/agents 0.25.4 → 0.28.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/CHANGELOG.md +16 -10
- package/dist/content-transfer/index.cjs.map +1 -1
- package/dist/content-transfer/index.js.map +1 -1
- package/dist/content-transfer/react/index.cjs.map +1 -1
- package/dist/content-transfer/react/index.js.map +1 -1
- package/dist/context/index.cjs +50 -3
- package/dist/context/index.cjs.map +1 -1
- package/dist/context/index.d.cts +68 -2
- package/dist/context/index.d.ts +68 -2
- package/dist/context/index.js +48 -3
- package/dist/context/index.js.map +1 -1
- package/dist/context/react/index.cjs +15 -3
- package/dist/context/react/index.cjs.map +1 -1
- package/dist/context/react/index.d.cts +4 -3
- package/dist/context/react/index.d.ts +4 -3
- package/dist/context/react/index.js +15 -3
- package/dist/context/react/index.js.map +1 -1
- package/dist/mandates/index.cjs +2 -2
- package/dist/mandates/index.cjs.map +1 -1
- package/dist/mandates/index.d.cts +4 -4
- package/dist/mandates/index.d.ts +4 -4
- package/dist/mandates/index.js +2 -2
- package/dist/mandates/index.js.map +1 -1
- package/mandates/snapshots/keys.0.27.0.json +652 -0
- package/mandates/snapshots/keys.0.28.0.json +652 -0
- package/package.json +3 -3
|
@@ -13,6 +13,15 @@ import {
|
|
|
13
13
|
// context/index.ts
|
|
14
14
|
var DEFAULT_INLINE_MAX_CHARS = 200;
|
|
15
15
|
var DEFAULT_INLINE_CAP = 5e4;
|
|
16
|
+
var SERVER_AUTHORITATIVE_KEYS = {
|
|
17
|
+
user: "manifest",
|
|
18
|
+
client: "manifest",
|
|
19
|
+
organization: "active_context",
|
|
20
|
+
active_scopes: "active_context"
|
|
21
|
+
};
|
|
22
|
+
function isServerAuthoritativeKey(key) {
|
|
23
|
+
return Object.prototype.hasOwnProperty.call(SERVER_AUTHORITATIVE_KEYS, key);
|
|
24
|
+
}
|
|
16
25
|
var isNum = (v) => typeof v === "number" && Number.isFinite(v);
|
|
17
26
|
var isValidLimit = (v) => typeof v === "number" && Number.isInteger(v) && v >= 0;
|
|
18
27
|
function resolveContextRule(input) {
|
|
@@ -21,9 +30,10 @@ function resolveContextRule(input) {
|
|
|
21
30
|
const user = input.user ?? null;
|
|
22
31
|
const cap = isNum(input.cap) ? input.cap : DEFAULT_INLINE_CAP;
|
|
23
32
|
const agentDeclared = agent?.declared === true;
|
|
33
|
+
const identity = input.identity === true;
|
|
24
34
|
let include = true;
|
|
25
35
|
let includeBy = "default";
|
|
26
|
-
if (surface?.declared === true && surface.auto_context === false) {
|
|
36
|
+
if (!identity && surface?.declared === true && surface.auto_context === false) {
|
|
27
37
|
if (agentDeclared) {
|
|
28
38
|
include = true;
|
|
29
39
|
includeBy = "agent";
|
|
@@ -32,7 +42,7 @@ function resolveContextRule(input) {
|
|
|
32
42
|
includeBy = "page";
|
|
33
43
|
}
|
|
34
44
|
}
|
|
35
|
-
if (agent?.kill_switch === true && !agentDeclared) {
|
|
45
|
+
if (!identity && agent?.kill_switch === true && !agentDeclared) {
|
|
36
46
|
include = false;
|
|
37
47
|
includeBy = "agent";
|
|
38
48
|
}
|
|
@@ -738,7 +748,9 @@ function ContextDeliveredValue({
|
|
|
738
748
|
row,
|
|
739
749
|
className
|
|
740
750
|
}) {
|
|
741
|
-
if (!row.delivered && !row.onRequest)
|
|
751
|
+
if (!row.delivered && !row.onRequest) {
|
|
752
|
+
return isServerAuthoritativeKey(row.key) ? /* @__PURE__ */ jsx5("p", { "data-testid": "context-server-fills", className: cn4("text-xs text-muted-foreground", className), children: "Filled in by the server" }) : null;
|
|
753
|
+
}
|
|
742
754
|
return /* @__PURE__ */ jsxs5("div", { className: cn4("flex flex-col gap-3", className), children: [
|
|
743
755
|
row.delivered ? /* @__PURE__ */ jsx5(DeliveredBlock, { title: "Agent received", text: row.delivered }) : null,
|
|
744
756
|
row.onRequest ? /* @__PURE__ */ jsx5(DeliveredBlock, { title: "Returned on request", text: row.onRequest }) : null
|