@antseed/cli 0.1.186 → 0.1.188
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/gateway/gateway.test.js +32 -1
- package/dist/gateway/gateway.test.js.map +1 -1
- package/dist/gateway/server.d.ts.map +1 -1
- package/dist/gateway/server.js +7 -1
- package/dist/gateway/server.js.map +1 -1
- package/dist/proxy/buyer-proxy.d.ts.map +1 -1
- package/dist/proxy/buyer-proxy.js +4 -1
- package/dist/proxy/buyer-proxy.js.map +1 -1
- package/dist/proxy/buyer-proxy.test.js +26 -0
- package/dist/proxy/buyer-proxy.test.js.map +1 -1
- package/package.json +3 -3
|
@@ -100,6 +100,32 @@ test('native video resolves antseed and peer-pinned models like images', async (
|
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
});
|
|
103
|
+
test('native video retrieves use the buyer identity that created the job', async () => {
|
|
104
|
+
const peer = makePeer('a', ['venice']);
|
|
105
|
+
peer.providerServiceApiProtocols = { venice: { services: { 'video-model': ['venice-video'] } } };
|
|
106
|
+
const proxy = makeBuyerProxyWithPeers([peer], [peer], permissiveRouter());
|
|
107
|
+
proxy._persistResourceRoutes = async () => { };
|
|
108
|
+
proxy._mayUseBuyerIdentity = () => true;
|
|
109
|
+
proxy._resolveBuyerIdentity = async (name) => name ?? null;
|
|
110
|
+
const identities = [];
|
|
111
|
+
proxy._node.sendRequest = async (_peer, request, options) => {
|
|
112
|
+
identities.push({ path: request.path, identity: options?.buyerIdentity });
|
|
113
|
+
return { requestId: request.requestId, statusCode: 200, headers: { 'content-type': 'application/json' }, body: Buffer.from(JSON.stringify({ queue_id: 'job' })) };
|
|
114
|
+
};
|
|
115
|
+
proxy._node.sendRequestStream = async (_peer, request, _callbacks, options) => {
|
|
116
|
+
identities.push({ path: request.path, identity: options?.buyerIdentity });
|
|
117
|
+
return { requestId: request.requestId, statusCode: 200, headers: { 'content-type': 'application/json' }, body: Buffer.from(JSON.stringify({ status: 'PROCESSING' })) };
|
|
118
|
+
};
|
|
119
|
+
const headers = { 'x-antseed-buyer-identity': 'team-a' };
|
|
120
|
+
const queued = await invokeProxy(proxy, makeProxyRequest({ path: '/api/v1/video/queue', body: { model: 'video-model', prompt: 'cat', duration: '5s' }, headers }));
|
|
121
|
+
assert.equal(queued.statusCode, 200, queued.body);
|
|
122
|
+
const status = await invokeProxy(proxy, makeProxyRequest({ method: 'POST', path: '/api/v1/video/retrieve', body: { model: 'video-model', queue_id: 'job' }, headers }));
|
|
123
|
+
assert.equal(status.statusCode, 200, status.body);
|
|
124
|
+
assert.deepEqual(identities, [
|
|
125
|
+
{ path: '/api/v1/video/queue', identity: 'team-a' },
|
|
126
|
+
{ path: '/api/v1/video/retrieve', identity: 'team-a' },
|
|
127
|
+
]);
|
|
128
|
+
});
|
|
103
129
|
test('native resource follow-ups fail when the recorded provider loses support instead of switching providers', async () => {
|
|
104
130
|
for (const provider of ['venice']) {
|
|
105
131
|
const protocol = 'venice-video';
|