@tangle-network/agent-interface 0.39.0 → 0.40.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.
@@ -0,0 +1,9 @@
1
+ import type { AgentProfile } from "./agent-profile.js";
2
+ /**
3
+ * Detach, validate, and recursively freeze one AgentProfile at an intake boundary.
4
+ *
5
+ * The returned value is exactly the existing schema output: this function adds no
6
+ * defaults and applies no provider, model, or execution policy. Values outside the
7
+ * existing canonical profile JSON domain fail instead of becoming mutable state.
8
+ */
9
+ export declare function snapshotAgentProfile(value: unknown): AgentProfile;
@@ -0,0 +1,24 @@
1
+ import { canonicalAgentProfileValue } from "./agent-profile-canonical.js";
2
+ import { agentProfileSchema } from "./profile-schema.js";
3
+ /**
4
+ * Detach, validate, and recursively freeze one AgentProfile at an intake boundary.
5
+ *
6
+ * The returned value is exactly the existing schema output: this function adds no
7
+ * defaults and applies no provider, model, or execution policy. Values outside the
8
+ * existing canonical profile JSON domain fail instead of becoming mutable state.
9
+ */
10
+ export function snapshotAgentProfile(value) {
11
+ const parsed = agentProfileSchema.parse(structuredClone(value));
12
+ canonicalAgentProfileValue(parsed);
13
+ return deepFreeze(parsed);
14
+ }
15
+ function deepFreeze(value, seen = new Set()) {
16
+ if (value === null || typeof value !== "object" || seen.has(value)) {
17
+ return value;
18
+ }
19
+ seen.add(value);
20
+ for (const child of Object.values(value)) {
21
+ deepFreeze(child, seen);
22
+ }
23
+ return Object.freeze(value);
24
+ }
package/dist/index.d.ts CHANGED
@@ -623,6 +623,7 @@ export * from "./agent-profile-improvement.js";
623
623
  export * from "./agent-profile-improvement-schema.js";
624
624
  export * from "./agent-execution-limits.js";
625
625
  export * from "./agent-profile.js";
626
+ export * from "./agent-profile-snapshot.js";
626
627
  export * from "./agent-profile-activation.js";
627
628
  export * from "./agent-profile-materialization.js";
628
629
  export * from "./agent-execution-preparation.js";
package/dist/index.js CHANGED
@@ -135,6 +135,7 @@ export * from "./agent-profile-improvement.js";
135
135
  export * from "./agent-profile-improvement-schema.js";
136
136
  export * from "./agent-execution-limits.js";
137
137
  export * from "./agent-profile.js";
138
+ export * from "./agent-profile-snapshot.js";
138
139
  export * from "./agent-profile-activation.js";
139
140
  export * from "./agent-profile-materialization.js";
140
141
  export * from "./agent-execution-preparation.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/agent-interface",
3
- "version": "0.39.0",
3
+ "version": "0.40.0",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "license": "MIT",