@openscout/protocol 0.2.34 → 0.2.36
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/dist/agent-identity.js
CHANGED
|
@@ -84,7 +84,7 @@ function parseSegmentedIdentity(raw) {
|
|
|
84
84
|
positional.push(part);
|
|
85
85
|
}
|
|
86
86
|
// 1 positional → workspaceQualifier (@agent.branch)
|
|
87
|
-
// 2 positionals → nodeQualifier
|
|
87
|
+
// 2 positionals → workspaceQualifier.nodeQualifier (@agent.branch.node — node is always last)
|
|
88
88
|
// 3+ positionals → invalid
|
|
89
89
|
if (positional.length === 1) {
|
|
90
90
|
const value = normalizeAgentIdentitySegment(positional[0]);
|
|
@@ -93,14 +93,14 @@ function parseSegmentedIdentity(raw) {
|
|
|
93
93
|
next.workspaceQualifier = value;
|
|
94
94
|
}
|
|
95
95
|
else if (positional.length === 2) {
|
|
96
|
-
const
|
|
97
|
-
const
|
|
98
|
-
if (!
|
|
96
|
+
const workspaceValue = normalizeAgentIdentitySegment(positional[0]);
|
|
97
|
+
const nodeValue = normalizeAgentIdentitySegment(positional[1]);
|
|
98
|
+
if (!workspaceValue || !nodeValue)
|
|
99
99
|
return null;
|
|
100
|
-
if (!next.nodeQualifier)
|
|
101
|
-
next.nodeQualifier = nodeValue;
|
|
102
100
|
if (!next.workspaceQualifier)
|
|
103
101
|
next.workspaceQualifier = workspaceValue;
|
|
102
|
+
if (!next.nodeQualifier)
|
|
103
|
+
next.nodeQualifier = nodeValue;
|
|
104
104
|
}
|
|
105
105
|
else if (positional.length > 2) {
|
|
106
106
|
return null;
|
package/package.json
CHANGED
|
@@ -57,12 +57,12 @@ describe("agent identity grammar", () => {
|
|
|
57
57
|
});
|
|
58
58
|
});
|
|
59
59
|
|
|
60
|
-
test("parses 3-segment positional as definitionId.nodeQualifier
|
|
61
|
-
const result = parseAgentIdentity("@arc.
|
|
60
|
+
test("parses 3-segment positional as definitionId.workspaceQualifier.nodeQualifier", () => {
|
|
61
|
+
const result = parseAgentIdentity("@arc.dev.mini");
|
|
62
62
|
expect(result).not.toBeNull();
|
|
63
63
|
expect(result!.definitionId).toBe("arc");
|
|
64
|
-
expect(result!.nodeQualifier).toBe("main");
|
|
65
64
|
expect(result!.workspaceQualifier).toBe("dev");
|
|
65
|
+
expect(result!.nodeQualifier).toBe("mini");
|
|
66
66
|
});
|
|
67
67
|
|
|
68
68
|
test("rejects invalid and legacy-shaped identities", () => {
|
package/src/agent-identity.ts
CHANGED
|
@@ -131,18 +131,18 @@ function parseSegmentedIdentity(raw: string): AgentIdentity | null {
|
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
// 1 positional → workspaceQualifier (@agent.branch)
|
|
134
|
-
// 2 positionals → nodeQualifier
|
|
134
|
+
// 2 positionals → workspaceQualifier.nodeQualifier (@agent.branch.node — node is always last)
|
|
135
135
|
// 3+ positionals → invalid
|
|
136
136
|
if (positional.length === 1) {
|
|
137
137
|
const value = normalizeAgentIdentitySegment(positional[0]);
|
|
138
138
|
if (!value) return null;
|
|
139
139
|
next.workspaceQualifier = value;
|
|
140
140
|
} else if (positional.length === 2) {
|
|
141
|
-
const
|
|
142
|
-
const
|
|
143
|
-
if (!
|
|
144
|
-
if (!next.nodeQualifier) next.nodeQualifier = nodeValue;
|
|
141
|
+
const workspaceValue = normalizeAgentIdentitySegment(positional[0]);
|
|
142
|
+
const nodeValue = normalizeAgentIdentitySegment(positional[1]);
|
|
143
|
+
if (!workspaceValue || !nodeValue) return null;
|
|
145
144
|
if (!next.workspaceQualifier) next.workspaceQualifier = workspaceValue;
|
|
145
|
+
if (!next.nodeQualifier) next.nodeQualifier = nodeValue;
|
|
146
146
|
} else if (positional.length > 2) {
|
|
147
147
|
return null;
|
|
148
148
|
}
|