@ai-matrx/agents 0.59.184 → 0.59.186

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 CHANGED
@@ -1,10 +1,25 @@
1
1
  # Changelog
2
2
 
3
- ## 0.59.184
3
+ ## 0.59.186
4
4
 
5
5
  UNVERIFIED: this release has no Unreleased entry and the source comparison could not be made (the caller supplied no source comparison). Whether source changed is unknown; consumer action is unknown.
6
6
  Check the package's gitHead on npm against this version's gitHead: `git diff <previous gitHead> <this gitHead> -- apps/shared/matrx-agents/src`.
7
7
 
8
+ ## 0.59.185
9
+
10
+ Automatic changed-only republish (docs/metadata drift since the last published version; verified: `git diff 9b1ad7d08b 19a9da1bde -- apps/shared/matrx-agents/src`
11
+ has no shipped-source changes outside tests, fixtures and docs). No consumer action required.
12
+
13
+ ## 0.59.184
14
+
15
+ Automatic changed-only republish (docs/metadata drift since the last published version; verified: `git diff 9d8e39ac18 9b1ad7d08b -- apps/shared/matrx-agents/src`
16
+ has no shipped-source changes outside tests, fixtures and docs). No consumer action required.
17
+
18
+ ## 0.59.183
19
+
20
+ Automatic changed-only republish (docs/metadata drift since the last published version; verified: `git diff 4f5dd0a906 9d8e39ac18 -- apps/shared/matrx-agents/src`
21
+ has no shipped-source changes outside tests, fixtures and docs). No consumer action required.
22
+
8
23
  ## 0.59.182
9
24
 
10
25
  Automatic changed-only republish (docs/metadata drift since the last published version; verified: `git diff b50b1b48e7 4f5dd0a906 -- apps/shared/matrx-agents/src`
@@ -703,7 +703,7 @@ var MANDATE_KEYS = {
703
703
  */
704
704
  brand_discovery__offering_roles: "brand_discovery.offering_roles",
705
705
  /**
706
- * @deprecated retiring since 0.59.184 — no longer declared in
706
+ * @deprecated retiring since 0.59.186 — no longer declared in
707
707
  * aidream. It leaves this union once no snapshot within the last
708
708
  * 3 published versions still carries it as active.
709
709
  */
@@ -680,7 +680,7 @@ var MANDATE_KEYS = {
680
680
  */
681
681
  brand_discovery__offering_roles: "brand_discovery.offering_roles",
682
682
  /**
683
- * @deprecated retiring since 0.59.184 — no longer declared in
683
+ * @deprecated retiring since 0.59.186 — no longer declared in
684
684
  * aidream. It leaves this union once no snapshot within the last
685
685
  * 3 published versions still carries it as active.
686
686
  */
@@ -656,7 +656,7 @@ var MANDATE_KEYS = {
656
656
  */
657
657
  brand_discovery__offering_roles: "brand_discovery.offering_roles",
658
658
  /**
659
- * @deprecated retiring since 0.59.184 — no longer declared in
659
+ * @deprecated retiring since 0.59.186 — no longer declared in
660
660
  * aidream. It leaves this union once no snapshot within the last
661
661
  * 3 published versions still carries it as active.
662
662
  */
@@ -628,7 +628,7 @@ var MANDATE_KEYS = {
628
628
  */
629
629
  brand_discovery__offering_roles: "brand_discovery.offering_roles",
630
630
  /**
631
- * @deprecated retiring since 0.59.184 — no longer declared in
631
+ * @deprecated retiring since 0.59.186 — no longer declared in
632
632
  * aidream. It leaves this union once no snapshot within the last
633
633
  * 3 published versions still carries it as active.
634
634
  */
@@ -47,9 +47,9 @@ module.exports = __toCommonJS(mandates_exports);
47
47
 
48
48
  // mandates/keys.generated.ts
49
49
  var MANDATE_KEYS_META = {
50
- aidreamRevision: "9b1ad7d08b592e62afac688f6b3d68461645deff",
50
+ aidreamRevision: "65685f41ac7e017fa790fc02eb86a06c99c6995f",
51
51
  generatorVersion: "1.0.0",
52
- packageVersion: "0.59.184",
52
+ packageVersion: "0.59.186",
53
53
  retireWindow: 3
54
54
  };
55
55
  var MANDATE_KEYS = {
@@ -666,7 +666,7 @@ var MANDATE_KEYS = {
666
666
  */
667
667
  brand_discovery__offering_roles: "brand_discovery.offering_roles",
668
668
  /**
669
- * @deprecated retiring since 0.59.184 — no longer declared in
669
+ * @deprecated retiring since 0.59.186 — no longer declared in
670
670
  * aidream. It leaves this union once no snapshot within the last
671
671
  * 3 published versions still carries it as active.
672
672
  */
@@ -693,7 +693,7 @@ var MANDATE_KEYS = {
693
693
  var ALL_MANDATE_KEYS = Object.values(MANDATE_KEYS);
694
694
  var RETIRING_MANDATE_KEYS = {
695
695
  "brand_discovery.offering_roles": "0.59.0",
696
- "coding_session.managed_translation_reference": "0.59.184",
696
+ "coding_session.managed_translation_reference": "0.59.186",
697
697
  "pdf.content_cleaner": "0.59.0",
698
698
  "sms.owner_beta": "0.59.0",
699
699
  "voice.owner_beta": "0.59.0"
@@ -6,9 +6,9 @@
6
6
  * from the IN-PROCESS mandate declarations — the same `declared_mandates()` the
7
7
  * boot sync writes to the database from. There is no hand list anywhere.
8
8
  *
9
- * aidream revision: 9b1ad7d08b592e62afac688f6b3d68461645deff
9
+ * aidream revision: 65685f41ac7e017fa790fc02eb86a06c99c6995f
10
10
  * generator version: 1.0.0
11
- * package version: 0.59.184
11
+ * package version: 0.59.186
12
12
  * active keys: 606
13
13
  * retiring keys: 5
14
14
  *
@@ -19,9 +19,9 @@
19
19
  */
20
20
  /** Where this module came from — surfaced so a report can name the exact build. */
21
21
  declare const MANDATE_KEYS_META: {
22
- readonly aidreamRevision: "9b1ad7d08b592e62afac688f6b3d68461645deff";
22
+ readonly aidreamRevision: "65685f41ac7e017fa790fc02eb86a06c99c6995f";
23
23
  readonly generatorVersion: "1.0.0";
24
- readonly packageVersion: "0.59.184";
24
+ readonly packageVersion: "0.59.186";
25
25
  readonly retireWindow: 3;
26
26
  };
27
27
  /** Every declared mandate key, by THE IDENTIFIER RULE. */
@@ -639,7 +639,7 @@ declare const MANDATE_KEYS: {
639
639
  */
640
640
  readonly brand_discovery__offering_roles: "brand_discovery.offering_roles";
641
641
  /**
642
- * @deprecated retiring since 0.59.184 — no longer declared in
642
+ * @deprecated retiring since 0.59.186 — no longer declared in
643
643
  * aidream. It leaves this union once no snapshot within the last
644
644
  * 3 published versions still carries it as active.
645
645
  */
@@ -670,7 +670,7 @@ declare const ALL_MANDATE_KEYS: readonly MandateKey[];
670
670
  /** Keys still in the union but no longer declared (two-phase retire, phase 1). */
671
671
  declare const RETIRING_MANDATE_KEYS: {
672
672
  readonly "brand_discovery.offering_roles": "0.59.0";
673
- readonly "coding_session.managed_translation_reference": "0.59.184";
673
+ readonly "coding_session.managed_translation_reference": "0.59.186";
674
674
  readonly "pdf.content_cleaner": "0.59.0";
675
675
  readonly "sms.owner_beta": "0.59.0";
676
676
  readonly "voice.owner_beta": "0.59.0";
@@ -6,9 +6,9 @@
6
6
  * from the IN-PROCESS mandate declarations — the same `declared_mandates()` the
7
7
  * boot sync writes to the database from. There is no hand list anywhere.
8
8
  *
9
- * aidream revision: 9b1ad7d08b592e62afac688f6b3d68461645deff
9
+ * aidream revision: 65685f41ac7e017fa790fc02eb86a06c99c6995f
10
10
  * generator version: 1.0.0
11
- * package version: 0.59.184
11
+ * package version: 0.59.186
12
12
  * active keys: 606
13
13
  * retiring keys: 5
14
14
  *
@@ -19,9 +19,9 @@
19
19
  */
20
20
  /** Where this module came from — surfaced so a report can name the exact build. */
21
21
  declare const MANDATE_KEYS_META: {
22
- readonly aidreamRevision: "9b1ad7d08b592e62afac688f6b3d68461645deff";
22
+ readonly aidreamRevision: "65685f41ac7e017fa790fc02eb86a06c99c6995f";
23
23
  readonly generatorVersion: "1.0.0";
24
- readonly packageVersion: "0.59.184";
24
+ readonly packageVersion: "0.59.186";
25
25
  readonly retireWindow: 3;
26
26
  };
27
27
  /** Every declared mandate key, by THE IDENTIFIER RULE. */
@@ -639,7 +639,7 @@ declare const MANDATE_KEYS: {
639
639
  */
640
640
  readonly brand_discovery__offering_roles: "brand_discovery.offering_roles";
641
641
  /**
642
- * @deprecated retiring since 0.59.184 — no longer declared in
642
+ * @deprecated retiring since 0.59.186 — no longer declared in
643
643
  * aidream. It leaves this union once no snapshot within the last
644
644
  * 3 published versions still carries it as active.
645
645
  */
@@ -670,7 +670,7 @@ declare const ALL_MANDATE_KEYS: readonly MandateKey[];
670
670
  /** Keys still in the union but no longer declared (two-phase retire, phase 1). */
671
671
  declare const RETIRING_MANDATE_KEYS: {
672
672
  readonly "brand_discovery.offering_roles": "0.59.0";
673
- readonly "coding_session.managed_translation_reference": "0.59.184";
673
+ readonly "coding_session.managed_translation_reference": "0.59.186";
674
674
  readonly "pdf.content_cleaner": "0.59.0";
675
675
  readonly "sms.owner_beta": "0.59.0";
676
676
  readonly "voice.owner_beta": "0.59.0";
@@ -1,8 +1,8 @@
1
1
  // mandates/keys.generated.ts
2
2
  var MANDATE_KEYS_META = {
3
- aidreamRevision: "9b1ad7d08b592e62afac688f6b3d68461645deff",
3
+ aidreamRevision: "65685f41ac7e017fa790fc02eb86a06c99c6995f",
4
4
  generatorVersion: "1.0.0",
5
- packageVersion: "0.59.184",
5
+ packageVersion: "0.59.186",
6
6
  retireWindow: 3
7
7
  };
8
8
  var MANDATE_KEYS = {
@@ -619,7 +619,7 @@ var MANDATE_KEYS = {
619
619
  */
620
620
  brand_discovery__offering_roles: "brand_discovery.offering_roles",
621
621
  /**
622
- * @deprecated retiring since 0.59.184 — no longer declared in
622
+ * @deprecated retiring since 0.59.186 — no longer declared in
623
623
  * aidream. It leaves this union once no snapshot within the last
624
624
  * 3 published versions still carries it as active.
625
625
  */
@@ -646,7 +646,7 @@ var MANDATE_KEYS = {
646
646
  var ALL_MANDATE_KEYS = Object.values(MANDATE_KEYS);
647
647
  var RETIRING_MANDATE_KEYS = {
648
648
  "brand_discovery.offering_roles": "0.59.0",
649
- "coding_session.managed_translation_reference": "0.59.184",
649
+ "coding_session.managed_translation_reference": "0.59.186",
650
650
  "pdf.content_cleaner": "0.59.0",
651
651
  "sms.owner_beta": "0.59.0",
652
652
  "voice.owner_beta": "0.59.0"
@@ -24,12 +24,14 @@ __export(versions_exports, {
24
24
  AGENT_EXCLUDE_PATHS: () => AGENT_EXCLUDE_PATHS,
25
25
  AGENT_IDENTITY_KEYS: () => AGENT_IDENTITY_KEYS,
26
26
  AgentVersionsError: () => AgentVersionsError,
27
+ PROMOTE_HISTORY_OUTCOME: () => PROMOTE_HISTORY_OUTCOME,
27
28
  compareAgentDefinitions: () => compareAgentDefinitions,
28
29
  computeVersionFetchTargets: () => computeVersionFetchTargets,
29
30
  declareContractBreak: () => declareContractBreak,
30
31
  enrichVersions: () => enrichVersions,
31
32
  listAgentVersions: () => listAgentVersions,
32
33
  promoteAgentVersion: () => promoteAgentVersion,
34
+ promoteConfirmMessage: () => promoteConfirmMessage,
33
35
  promoteFailureMessage: () => promoteFailureMessage,
34
36
  promoteSuccessMessage: () => promoteSuccessMessage,
35
37
  readAgentCurrentVersion: () => readAgentCurrentVersion,
@@ -132,8 +134,15 @@ function promoteFailureMessage(err) {
132
134
  const reason = raw.trim();
133
135
  return reason ? `${GENERIC}: ${reason}` : GENERIC;
134
136
  }
135
- function promoteSuccessMessage(version) {
136
- return `v${version}'s settings are now current; no new version was saved`;
137
+ var PROMOTE_HISTORY_OUTCOME = "a new version";
138
+ function promoteConfirmMessage(version, currentVersion) {
139
+ const stays = currentVersion != null ? ` v${currentVersion} stays in the history.` : "";
140
+ return `v${version}'s settings replace the current configuration and are saved as ${PROMOTE_HISTORY_OUTCOME}.${stays}`;
141
+ }
142
+ function promoteSuccessMessage(version, outcome = {}) {
143
+ if (outcome.unchanged) return `Already matches v${version} \u2014 nothing to save`;
144
+ const saved = outcome.newVersion != null ? ` (v${outcome.newVersion})` : "";
145
+ return `Restored v${version} as ${PROMOTE_HISTORY_OUTCOME}${saved}`;
137
146
  }
138
147
 
139
148
  // versions/enrich.ts
@@ -224,7 +233,9 @@ async function promoteAgentVersion(client, query) {
224
233
  });
225
234
  if (error) throw new AgentVersionsError(error);
226
235
  const result = data ?? {};
227
- return { ...result, success: result.success === true };
236
+ const out = { ...result, success: result.success === true, unchanged: result.unchanged === true };
237
+ if (typeof result.new_version !== "number") delete out.new_version;
238
+ return out;
228
239
  }
229
240
  async function readAgentCurrentVersion(client, agentId) {
230
241
  const { data, error } = await client.schema("agent").from("definition").select("version").eq("id", agentId).maybeSingle();
@@ -29,12 +29,25 @@ declare function compareAgentDefinitions(systemAgent: ComparableAgent, personalA
29
29
 
30
30
  declare function promoteFailureMessage(err: unknown): string;
31
31
  /**
32
- * The sentence a successful restore shows. `agx_promote_version` copies the version's settings onto
33
- * the agent and SAVES NO NEW VERSION (it sets `app.skip_version_snapshot`; read 2026-10-21), so the
34
- * history gains no row: the restored version becomes the current one. Saying so keeps a person from
35
- * looking for a new row that will never come.
32
+ * What a restore does to the history, said ONCE. `agx_promote_version` copies the version's settings
33
+ * onto the agent and the snapshot trigger SAVES THEM AS A NEW VERSION noted "Restored from v<N>"; the
34
+ * agent's current version moves to it (aidream migration 20261021233500). Its answer carries that
35
+ * number as `new_version`, and `unchanged: true` when the agent already matched (nothing saved).
36
+ * The confirm dialog and the result notice both build their sentence from this one constant, so
37
+ * neither can promise a row the other denies; `__tests__/promote-failure-message.test.ts` guards it.
36
38
  */
37
- declare function promoteSuccessMessage(version: number): string;
39
+ declare const PROMOTE_HISTORY_OUTCOME = "a new version";
40
+ /** The sentence the confirm shows BEFORE a restore (web dialog and desktop confirm). */
41
+ declare function promoteConfirmMessage(version: number, currentVersion?: number | null): string;
42
+ /** What the restore door answered, as the result sentence needs it (from `promoteAgentVersion`). */
43
+ interface PromoteOutcome {
44
+ /** The version row the restore saved (`new_version`); null/undefined when the answer has none. */
45
+ newVersion?: number | null;
46
+ /** True when the agent already matched the restored version, so nothing was saved. */
47
+ unchanged?: boolean;
48
+ }
49
+ /** The sentence a successful restore shows AFTER it ran. */
50
+ declare function promoteSuccessMessage(version: number, outcome?: PromoteOutcome): string;
38
51
 
39
52
  /** One row of `agx_get_version_history`: a saved version of an agent (newest first). */
40
53
  interface AgentVersionHistoryEntry {
@@ -61,6 +74,10 @@ interface PromoteVersionResult {
61
74
  error?: string;
62
75
  promoted_version?: number;
63
76
  agent_id?: string;
77
+ /** The version row the restore saved ("Restored from v<N>"); the agent's current version now. */
78
+ new_version?: number;
79
+ /** True when the agent already matched the restored version: no row was saved. */
80
+ unchanged?: boolean;
64
81
  }
65
82
  /** A contract break a person declares on a version (null clears the declaration). */
66
83
  type ContractBreakKind = "input" | "output" | "both";
@@ -156,9 +173,8 @@ declare function promoteAgentVersion(client: VersionsClient, query: {
156
173
  version: number;
157
174
  }): Promise<PromoteVersionResult>;
158
175
  /**
159
- * The version the agent is at NOW (`agent.definition.version`). A restore sets it to the restored
160
- * number without adding a history row, so the newest history row is not the current version after
161
- * one: read this instead. Null when the person cannot read the agent.
176
+ * The version the agent is at NOW (`agent.definition.version`), read from the agent itself. Null
177
+ * when the person cannot read the agent.
162
178
  */
163
179
  declare function readAgentCurrentVersion(client: VersionsClient, agentId: string): Promise<number | null>;
164
180
  /** Declare (or clear, with null) a contract break the hashes cannot see. */
@@ -168,4 +184,4 @@ declare function declareContractBreak(client: VersionsClient, query: {
168
184
  kind: ContractBreakKind | null;
169
185
  }): Promise<void>;
170
186
 
171
- export { AGENT_DIFF_OPTIONS, AGENT_EXCLUDE_PATHS, AGENT_IDENTITY_KEYS, type AgentDefinitionComparison, type AgentVersionHistoryEntry, type AgentVersionLookup, AgentVersionsError, type ComparableAgent, type ContractBreakKind, type EnrichedVersion, type PromoteVersionResult, type VersionHistoryLoad, type VersionsClient, type VersionsDbError, compareAgentDefinitions, computeVersionFetchTargets, declareContractBreak, enrichVersions, listAgentVersions, promoteAgentVersion, promoteFailureMessage, promoteSuccessMessage, readAgentCurrentVersion, readAgentVersionSnapshot, resolveAgentVersionId, snapshotToComparable };
187
+ export { AGENT_DIFF_OPTIONS, AGENT_EXCLUDE_PATHS, AGENT_IDENTITY_KEYS, type AgentDefinitionComparison, type AgentVersionHistoryEntry, type AgentVersionLookup, AgentVersionsError, type ComparableAgent, type ContractBreakKind, type EnrichedVersion, PROMOTE_HISTORY_OUTCOME, type PromoteOutcome, type PromoteVersionResult, type VersionHistoryLoad, type VersionsClient, type VersionsDbError, compareAgentDefinitions, computeVersionFetchTargets, declareContractBreak, enrichVersions, listAgentVersions, promoteAgentVersion, promoteConfirmMessage, promoteFailureMessage, promoteSuccessMessage, readAgentCurrentVersion, readAgentVersionSnapshot, resolveAgentVersionId, snapshotToComparable };
@@ -29,12 +29,25 @@ declare function compareAgentDefinitions(systemAgent: ComparableAgent, personalA
29
29
 
30
30
  declare function promoteFailureMessage(err: unknown): string;
31
31
  /**
32
- * The sentence a successful restore shows. `agx_promote_version` copies the version's settings onto
33
- * the agent and SAVES NO NEW VERSION (it sets `app.skip_version_snapshot`; read 2026-10-21), so the
34
- * history gains no row: the restored version becomes the current one. Saying so keeps a person from
35
- * looking for a new row that will never come.
32
+ * What a restore does to the history, said ONCE. `agx_promote_version` copies the version's settings
33
+ * onto the agent and the snapshot trigger SAVES THEM AS A NEW VERSION noted "Restored from v<N>"; the
34
+ * agent's current version moves to it (aidream migration 20261021233500). Its answer carries that
35
+ * number as `new_version`, and `unchanged: true` when the agent already matched (nothing saved).
36
+ * The confirm dialog and the result notice both build their sentence from this one constant, so
37
+ * neither can promise a row the other denies; `__tests__/promote-failure-message.test.ts` guards it.
36
38
  */
37
- declare function promoteSuccessMessage(version: number): string;
39
+ declare const PROMOTE_HISTORY_OUTCOME = "a new version";
40
+ /** The sentence the confirm shows BEFORE a restore (web dialog and desktop confirm). */
41
+ declare function promoteConfirmMessage(version: number, currentVersion?: number | null): string;
42
+ /** What the restore door answered, as the result sentence needs it (from `promoteAgentVersion`). */
43
+ interface PromoteOutcome {
44
+ /** The version row the restore saved (`new_version`); null/undefined when the answer has none. */
45
+ newVersion?: number | null;
46
+ /** True when the agent already matched the restored version, so nothing was saved. */
47
+ unchanged?: boolean;
48
+ }
49
+ /** The sentence a successful restore shows AFTER it ran. */
50
+ declare function promoteSuccessMessage(version: number, outcome?: PromoteOutcome): string;
38
51
 
39
52
  /** One row of `agx_get_version_history`: a saved version of an agent (newest first). */
40
53
  interface AgentVersionHistoryEntry {
@@ -61,6 +74,10 @@ interface PromoteVersionResult {
61
74
  error?: string;
62
75
  promoted_version?: number;
63
76
  agent_id?: string;
77
+ /** The version row the restore saved ("Restored from v<N>"); the agent's current version now. */
78
+ new_version?: number;
79
+ /** True when the agent already matched the restored version: no row was saved. */
80
+ unchanged?: boolean;
64
81
  }
65
82
  /** A contract break a person declares on a version (null clears the declaration). */
66
83
  type ContractBreakKind = "input" | "output" | "both";
@@ -156,9 +173,8 @@ declare function promoteAgentVersion(client: VersionsClient, query: {
156
173
  version: number;
157
174
  }): Promise<PromoteVersionResult>;
158
175
  /**
159
- * The version the agent is at NOW (`agent.definition.version`). A restore sets it to the restored
160
- * number without adding a history row, so the newest history row is not the current version after
161
- * one: read this instead. Null when the person cannot read the agent.
176
+ * The version the agent is at NOW (`agent.definition.version`), read from the agent itself. Null
177
+ * when the person cannot read the agent.
162
178
  */
163
179
  declare function readAgentCurrentVersion(client: VersionsClient, agentId: string): Promise<number | null>;
164
180
  /** Declare (or clear, with null) a contract break the hashes cannot see. */
@@ -168,4 +184,4 @@ declare function declareContractBreak(client: VersionsClient, query: {
168
184
  kind: ContractBreakKind | null;
169
185
  }): Promise<void>;
170
186
 
171
- export { AGENT_DIFF_OPTIONS, AGENT_EXCLUDE_PATHS, AGENT_IDENTITY_KEYS, type AgentDefinitionComparison, type AgentVersionHistoryEntry, type AgentVersionLookup, AgentVersionsError, type ComparableAgent, type ContractBreakKind, type EnrichedVersion, type PromoteVersionResult, type VersionHistoryLoad, type VersionsClient, type VersionsDbError, compareAgentDefinitions, computeVersionFetchTargets, declareContractBreak, enrichVersions, listAgentVersions, promoteAgentVersion, promoteFailureMessage, promoteSuccessMessage, readAgentCurrentVersion, readAgentVersionSnapshot, resolveAgentVersionId, snapshotToComparable };
187
+ export { AGENT_DIFF_OPTIONS, AGENT_EXCLUDE_PATHS, AGENT_IDENTITY_KEYS, type AgentDefinitionComparison, type AgentVersionHistoryEntry, type AgentVersionLookup, AgentVersionsError, type ComparableAgent, type ContractBreakKind, type EnrichedVersion, PROMOTE_HISTORY_OUTCOME, type PromoteOutcome, type PromoteVersionResult, type VersionHistoryLoad, type VersionsClient, type VersionsDbError, compareAgentDefinitions, computeVersionFetchTargets, declareContractBreak, enrichVersions, listAgentVersions, promoteAgentVersion, promoteConfirmMessage, promoteFailureMessage, promoteSuccessMessage, readAgentCurrentVersion, readAgentVersionSnapshot, resolveAgentVersionId, snapshotToComparable };
@@ -91,8 +91,15 @@ function promoteFailureMessage(err) {
91
91
  const reason = raw.trim();
92
92
  return reason ? `${GENERIC}: ${reason}` : GENERIC;
93
93
  }
94
- function promoteSuccessMessage(version) {
95
- return `v${version}'s settings are now current; no new version was saved`;
94
+ var PROMOTE_HISTORY_OUTCOME = "a new version";
95
+ function promoteConfirmMessage(version, currentVersion) {
96
+ const stays = currentVersion != null ? ` v${currentVersion} stays in the history.` : "";
97
+ return `v${version}'s settings replace the current configuration and are saved as ${PROMOTE_HISTORY_OUTCOME}.${stays}`;
98
+ }
99
+ function promoteSuccessMessage(version, outcome = {}) {
100
+ if (outcome.unchanged) return `Already matches v${version} \u2014 nothing to save`;
101
+ const saved = outcome.newVersion != null ? ` (v${outcome.newVersion})` : "";
102
+ return `Restored v${version} as ${PROMOTE_HISTORY_OUTCOME}${saved}`;
96
103
  }
97
104
 
98
105
  // versions/enrich.ts
@@ -183,7 +190,9 @@ async function promoteAgentVersion(client, query) {
183
190
  });
184
191
  if (error) throw new AgentVersionsError(error);
185
192
  const result = data ?? {};
186
- return { ...result, success: result.success === true };
193
+ const out = { ...result, success: result.success === true, unchanged: result.unchanged === true };
194
+ if (typeof result.new_version !== "number") delete out.new_version;
195
+ return out;
187
196
  }
188
197
  async function readAgentCurrentVersion(client, agentId) {
189
198
  const { data, error } = await client.schema("agent").from("definition").select("version").eq("id", agentId).maybeSingle();
@@ -204,12 +213,14 @@ export {
204
213
  AGENT_EXCLUDE_PATHS,
205
214
  AGENT_IDENTITY_KEYS,
206
215
  AgentVersionsError,
216
+ PROMOTE_HISTORY_OUTCOME,
207
217
  compareAgentDefinitions,
208
218
  computeVersionFetchTargets,
209
219
  declareContractBreak,
210
220
  enrichVersions,
211
221
  listAgentVersions,
212
222
  promoteAgentVersion,
223
+ promoteConfirmMessage,
213
224
  promoteFailureMessage,
214
225
  promoteSuccessMessage,
215
226
  readAgentCurrentVersion,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-matrx/agents",
3
- "version": "0.59.184",
3
+ "version": "0.59.186",
4
4
  "description": "Portable AI Matrx agent stream protocol, event projection, and safe result-presentation primitives.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -508,9 +508,9 @@
508
508
  },
509
509
  "sideEffects": false,
510
510
  "dependencies": {
511
+ "@ai-matrx/associations": "latest",
511
512
  "@ai-matrx/alchemy": "latest",
512
513
  "@ai-matrx/api": "latest",
513
- "@ai-matrx/associations": "latest",
514
514
  "@ai-matrx/data": "latest",
515
515
  "@ai-matrx/content-ir": "latest",
516
516
  "@ai-matrx/design-system": "latest",
@@ -561,5 +561,5 @@
561
561
  "verify:tarball": "node ./scripts/verify-tarball.mjs",
562
562
  "typegen:self-test": "node scripts/typegen/drop-guard.self-test.mjs && node scripts/typegen/check-api-types-fresh.mjs --self-test"
563
563
  },
564
- "gitHead": "9b1ad7d08b592e62afac688f6b3d68461645deff"
564
+ "gitHead": "65685f41ac7e017fa790fc02eb86a06c99c6995f"
565
565
  }