@getpaseo/protocol 0.1.88 → 0.1.89

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.
@@ -1,2 +1,7 @@
1
1
  export declare const PARENT_AGENT_ID_LABEL = "paseo.parent-agent-id";
2
+ export interface AgentLabelSource {
3
+ labels?: Record<string, unknown> | null;
4
+ }
5
+ export declare function getParentAgentIdFromLabels(labels: Record<string, unknown> | null | undefined): string | null;
6
+ export declare function isDelegatedAgent(agent: AgentLabelSource): boolean;
2
7
  //# sourceMappingURL=agent-labels.d.ts.map
@@ -1,2 +1,11 @@
1
1
  export const PARENT_AGENT_ID_LABEL = "paseo.parent-agent-id";
2
+ export function getParentAgentIdFromLabels(labels) {
3
+ const parentAgentId = labels?.[PARENT_AGENT_ID_LABEL];
4
+ return typeof parentAgentId === "string" && parentAgentId.trim().length > 0
5
+ ? parentAgentId.trim()
6
+ : null;
7
+ }
8
+ export function isDelegatedAgent(agent) {
9
+ return getParentAgentIdFromLabels(agent.labels) !== null;
10
+ }
2
11
  //# sourceMappingURL=agent-labels.js.map