@ai-matrx/agents 0.59.185 → 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 +6 -1
- package/dist/content-transfer/index.cjs +1 -1
- package/dist/content-transfer/index.js +1 -1
- package/dist/content-transfer/react/index.cjs +1 -1
- package/dist/content-transfer/react/index.js +1 -1
- package/dist/mandates/index.cjs +4 -4
- package/dist/mandates/index.d.cts +6 -6
- package/dist/mandates/index.d.ts +6 -6
- package/dist/mandates/index.js +4 -4
- package/dist/versions/index.cjs +9 -5
- package/dist/versions/index.d.cts +20 -10
- package/dist/versions/index.d.ts +20 -10
- package/dist/versions/index.js +9 -5
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## 0.59.
|
|
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
|
+
|
|
8
13
|
## 0.59.184
|
|
9
14
|
|
|
10
15
|
Automatic changed-only republish (docs/metadata drift since the last published version; verified: `git diff 9d8e39ac18 9b1ad7d08b -- 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.
|
|
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.
|
|
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.
|
|
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.
|
|
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
|
*/
|
package/dist/mandates/index.cjs
CHANGED
|
@@ -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: "
|
|
50
|
+
aidreamRevision: "65685f41ac7e017fa790fc02eb86a06c99c6995f",
|
|
51
51
|
generatorVersion: "1.0.0",
|
|
52
|
-
packageVersion: "0.59.
|
|
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.
|
|
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.
|
|
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:
|
|
9
|
+
* aidream revision: 65685f41ac7e017fa790fc02eb86a06c99c6995f
|
|
10
10
|
* generator version: 1.0.0
|
|
11
|
-
* package version: 0.59.
|
|
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: "
|
|
22
|
+
readonly aidreamRevision: "65685f41ac7e017fa790fc02eb86a06c99c6995f";
|
|
23
23
|
readonly generatorVersion: "1.0.0";
|
|
24
|
-
readonly packageVersion: "0.59.
|
|
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.
|
|
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.
|
|
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";
|
package/dist/mandates/index.d.ts
CHANGED
|
@@ -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:
|
|
9
|
+
* aidream revision: 65685f41ac7e017fa790fc02eb86a06c99c6995f
|
|
10
10
|
* generator version: 1.0.0
|
|
11
|
-
* package version: 0.59.
|
|
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: "
|
|
22
|
+
readonly aidreamRevision: "65685f41ac7e017fa790fc02eb86a06c99c6995f";
|
|
23
23
|
readonly generatorVersion: "1.0.0";
|
|
24
|
-
readonly packageVersion: "0.59.
|
|
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.
|
|
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.
|
|
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";
|
package/dist/mandates/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// mandates/keys.generated.ts
|
|
2
2
|
var MANDATE_KEYS_META = {
|
|
3
|
-
aidreamRevision: "
|
|
3
|
+
aidreamRevision: "65685f41ac7e017fa790fc02eb86a06c99c6995f",
|
|
4
4
|
generatorVersion: "1.0.0",
|
|
5
|
-
packageVersion: "0.59.
|
|
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.
|
|
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.
|
|
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"
|
package/dist/versions/index.cjs
CHANGED
|
@@ -134,13 +134,15 @@ function promoteFailureMessage(err) {
|
|
|
134
134
|
const reason = raw.trim();
|
|
135
135
|
return reason ? `${GENERIC}: ${reason}` : GENERIC;
|
|
136
136
|
}
|
|
137
|
-
var PROMOTE_HISTORY_OUTCOME = "
|
|
137
|
+
var PROMOTE_HISTORY_OUTCOME = "a new version";
|
|
138
138
|
function promoteConfirmMessage(version, currentVersion) {
|
|
139
139
|
const stays = currentVersion != null ? ` v${currentVersion} stays in the history.` : "";
|
|
140
|
-
return `v${version}'s settings replace the current configuration
|
|
140
|
+
return `v${version}'s settings replace the current configuration and are saved as ${PROMOTE_HISTORY_OUTCOME}.${stays}`;
|
|
141
141
|
}
|
|
142
|
-
function promoteSuccessMessage(version) {
|
|
143
|
-
return `v${version}
|
|
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}`;
|
|
144
146
|
}
|
|
145
147
|
|
|
146
148
|
// versions/enrich.ts
|
|
@@ -231,7 +233,9 @@ async function promoteAgentVersion(client, query) {
|
|
|
231
233
|
});
|
|
232
234
|
if (error) throw new AgentVersionsError(error);
|
|
233
235
|
const result = data ?? {};
|
|
234
|
-
|
|
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;
|
|
235
239
|
}
|
|
236
240
|
async function readAgentCurrentVersion(client, agentId) {
|
|
237
241
|
const { data, error } = await client.schema("agent").from("definition").select("version").eq("id", agentId).maybeSingle();
|
|
@@ -30,17 +30,24 @@ declare function compareAgentDefinitions(systemAgent: ComparableAgent, personalA
|
|
|
30
30
|
declare function promoteFailureMessage(err: unknown): string;
|
|
31
31
|
/**
|
|
32
32
|
* What a restore does to the history, said ONCE. `agx_promote_version` copies the version's settings
|
|
33
|
-
* onto the agent and SAVES
|
|
34
|
-
*
|
|
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).
|
|
35
36
|
* The confirm dialog and the result notice both build their sentence from this one constant, so
|
|
36
|
-
* neither can promise a row the other
|
|
37
|
-
* this constant and the guard test in `__tests__/promote-failure-message.test.ts` tells you where.
|
|
37
|
+
* neither can promise a row the other denies; `__tests__/promote-failure-message.test.ts` guards it.
|
|
38
38
|
*/
|
|
39
|
-
declare const PROMOTE_HISTORY_OUTCOME = "
|
|
39
|
+
declare const PROMOTE_HISTORY_OUTCOME = "a new version";
|
|
40
40
|
/** The sentence the confirm shows BEFORE a restore (web dialog and desktop confirm). */
|
|
41
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
|
+
}
|
|
42
49
|
/** The sentence a successful restore shows AFTER it ran. */
|
|
43
|
-
declare function promoteSuccessMessage(version: number): string;
|
|
50
|
+
declare function promoteSuccessMessage(version: number, outcome?: PromoteOutcome): string;
|
|
44
51
|
|
|
45
52
|
/** One row of `agx_get_version_history`: a saved version of an agent (newest first). */
|
|
46
53
|
interface AgentVersionHistoryEntry {
|
|
@@ -67,6 +74,10 @@ interface PromoteVersionResult {
|
|
|
67
74
|
error?: string;
|
|
68
75
|
promoted_version?: number;
|
|
69
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;
|
|
70
81
|
}
|
|
71
82
|
/** A contract break a person declares on a version (null clears the declaration). */
|
|
72
83
|
type ContractBreakKind = "input" | "output" | "both";
|
|
@@ -162,9 +173,8 @@ declare function promoteAgentVersion(client: VersionsClient, query: {
|
|
|
162
173
|
version: number;
|
|
163
174
|
}): Promise<PromoteVersionResult>;
|
|
164
175
|
/**
|
|
165
|
-
* The version the agent is at NOW (`agent.definition.version`)
|
|
166
|
-
*
|
|
167
|
-
* 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.
|
|
168
178
|
*/
|
|
169
179
|
declare function readAgentCurrentVersion(client: VersionsClient, agentId: string): Promise<number | null>;
|
|
170
180
|
/** Declare (or clear, with null) a contract break the hashes cannot see. */
|
|
@@ -174,4 +184,4 @@ declare function declareContractBreak(client: VersionsClient, query: {
|
|
|
174
184
|
kind: ContractBreakKind | null;
|
|
175
185
|
}): Promise<void>;
|
|
176
186
|
|
|
177
|
-
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 PromoteVersionResult, type VersionHistoryLoad, type VersionsClient, type VersionsDbError, compareAgentDefinitions, computeVersionFetchTargets, declareContractBreak, enrichVersions, listAgentVersions, promoteAgentVersion, promoteConfirmMessage, 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 };
|
package/dist/versions/index.d.ts
CHANGED
|
@@ -30,17 +30,24 @@ declare function compareAgentDefinitions(systemAgent: ComparableAgent, personalA
|
|
|
30
30
|
declare function promoteFailureMessage(err: unknown): string;
|
|
31
31
|
/**
|
|
32
32
|
* What a restore does to the history, said ONCE. `agx_promote_version` copies the version's settings
|
|
33
|
-
* onto the agent and SAVES
|
|
34
|
-
*
|
|
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).
|
|
35
36
|
* The confirm dialog and the result notice both build their sentence from this one constant, so
|
|
36
|
-
* neither can promise a row the other
|
|
37
|
-
* this constant and the guard test in `__tests__/promote-failure-message.test.ts` tells you where.
|
|
37
|
+
* neither can promise a row the other denies; `__tests__/promote-failure-message.test.ts` guards it.
|
|
38
38
|
*/
|
|
39
|
-
declare const PROMOTE_HISTORY_OUTCOME = "
|
|
39
|
+
declare const PROMOTE_HISTORY_OUTCOME = "a new version";
|
|
40
40
|
/** The sentence the confirm shows BEFORE a restore (web dialog and desktop confirm). */
|
|
41
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
|
+
}
|
|
42
49
|
/** The sentence a successful restore shows AFTER it ran. */
|
|
43
|
-
declare function promoteSuccessMessage(version: number): string;
|
|
50
|
+
declare function promoteSuccessMessage(version: number, outcome?: PromoteOutcome): string;
|
|
44
51
|
|
|
45
52
|
/** One row of `agx_get_version_history`: a saved version of an agent (newest first). */
|
|
46
53
|
interface AgentVersionHistoryEntry {
|
|
@@ -67,6 +74,10 @@ interface PromoteVersionResult {
|
|
|
67
74
|
error?: string;
|
|
68
75
|
promoted_version?: number;
|
|
69
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;
|
|
70
81
|
}
|
|
71
82
|
/** A contract break a person declares on a version (null clears the declaration). */
|
|
72
83
|
type ContractBreakKind = "input" | "output" | "both";
|
|
@@ -162,9 +173,8 @@ declare function promoteAgentVersion(client: VersionsClient, query: {
|
|
|
162
173
|
version: number;
|
|
163
174
|
}): Promise<PromoteVersionResult>;
|
|
164
175
|
/**
|
|
165
|
-
* The version the agent is at NOW (`agent.definition.version`)
|
|
166
|
-
*
|
|
167
|
-
* 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.
|
|
168
178
|
*/
|
|
169
179
|
declare function readAgentCurrentVersion(client: VersionsClient, agentId: string): Promise<number | null>;
|
|
170
180
|
/** Declare (or clear, with null) a contract break the hashes cannot see. */
|
|
@@ -174,4 +184,4 @@ declare function declareContractBreak(client: VersionsClient, query: {
|
|
|
174
184
|
kind: ContractBreakKind | null;
|
|
175
185
|
}): Promise<void>;
|
|
176
186
|
|
|
177
|
-
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 PromoteVersionResult, type VersionHistoryLoad, type VersionsClient, type VersionsDbError, compareAgentDefinitions, computeVersionFetchTargets, declareContractBreak, enrichVersions, listAgentVersions, promoteAgentVersion, promoteConfirmMessage, 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 };
|
package/dist/versions/index.js
CHANGED
|
@@ -91,13 +91,15 @@ function promoteFailureMessage(err) {
|
|
|
91
91
|
const reason = raw.trim();
|
|
92
92
|
return reason ? `${GENERIC}: ${reason}` : GENERIC;
|
|
93
93
|
}
|
|
94
|
-
var PROMOTE_HISTORY_OUTCOME = "
|
|
94
|
+
var PROMOTE_HISTORY_OUTCOME = "a new version";
|
|
95
95
|
function promoteConfirmMessage(version, currentVersion) {
|
|
96
96
|
const stays = currentVersion != null ? ` v${currentVersion} stays in the history.` : "";
|
|
97
|
-
return `v${version}'s settings replace the current configuration
|
|
97
|
+
return `v${version}'s settings replace the current configuration and are saved as ${PROMOTE_HISTORY_OUTCOME}.${stays}`;
|
|
98
98
|
}
|
|
99
|
-
function promoteSuccessMessage(version) {
|
|
100
|
-
return `v${version}
|
|
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}`;
|
|
101
103
|
}
|
|
102
104
|
|
|
103
105
|
// versions/enrich.ts
|
|
@@ -188,7 +190,9 @@ async function promoteAgentVersion(client, query) {
|
|
|
188
190
|
});
|
|
189
191
|
if (error) throw new AgentVersionsError(error);
|
|
190
192
|
const result = data ?? {};
|
|
191
|
-
|
|
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;
|
|
192
196
|
}
|
|
193
197
|
async function readAgentCurrentVersion(client, agentId) {
|
|
194
198
|
const { data, error } = await client.schema("agent").from("definition").select("version").eq("id", agentId).maybeSingle();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-matrx/agents",
|
|
3
|
-
"version": "0.59.
|
|
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,12 +508,12 @@
|
|
|
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
514
|
"@ai-matrx/data": "latest",
|
|
514
|
-
"@ai-matrx/design-system": "latest",
|
|
515
515
|
"@ai-matrx/content-ir": "latest",
|
|
516
|
-
"@ai-matrx/
|
|
516
|
+
"@ai-matrx/design-system": "latest",
|
|
517
517
|
"@ai-matrx/diff": "latest",
|
|
518
518
|
"@ai-matrx/icons": "latest",
|
|
519
519
|
"@ai-matrx/kit": "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": "
|
|
564
|
+
"gitHead": "65685f41ac7e017fa790fc02eb86a06c99c6995f"
|
|
565
565
|
}
|