@spotpatch/dev-server 0.1.0 → 0.1.2
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/README.md +1 -5
- package/dist/index.cjs +3 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -12
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.d.cts
CHANGED
|
@@ -119,6 +119,7 @@ interface SourceRegistryOptions {
|
|
|
119
119
|
declare function createSourceRegistry(options?: SourceRegistryOptions): SourceRegistry;
|
|
120
120
|
|
|
121
121
|
interface SpotPatchSession {
|
|
122
|
+
readonly id: string;
|
|
122
123
|
readonly token: string;
|
|
123
124
|
}
|
|
124
125
|
declare function createSession(): SpotPatchSession;
|
package/dist/index.d.ts
CHANGED
|
@@ -119,6 +119,7 @@ interface SourceRegistryOptions {
|
|
|
119
119
|
declare function createSourceRegistry(options?: SourceRegistryOptions): SourceRegistry;
|
|
120
120
|
|
|
121
121
|
interface SpotPatchSession {
|
|
122
|
+
readonly id: string;
|
|
122
123
|
readonly token: string;
|
|
123
124
|
}
|
|
124
125
|
declare function createSession(): SpotPatchSession;
|
package/dist/index.js
CHANGED
|
@@ -87,7 +87,6 @@ function createAgentJobManager(options) {
|
|
|
87
87
|
});
|
|
88
88
|
const jobs = /* @__PURE__ */ new Map();
|
|
89
89
|
const capabilityCache = /* @__PURE__ */ new Map();
|
|
90
|
-
const providerConsents = /* @__PURE__ */ new Set();
|
|
91
90
|
let closed = false;
|
|
92
91
|
const resolveSelection = (providerProfileId, modelProfileId) => {
|
|
93
92
|
const provider = options.ai.providers[providerProfileId];
|
|
@@ -218,15 +217,7 @@ function createAgentJobManager(options) {
|
|
|
218
217
|
};
|
|
219
218
|
const runJob = async (job) => {
|
|
220
219
|
try {
|
|
221
|
-
transition(job, "preparing", "
|
|
222
|
-
await probeResolved(
|
|
223
|
-
Object.freeze({
|
|
224
|
-
credential: job.credential,
|
|
225
|
-
model: job.model,
|
|
226
|
-
provider: job.provider
|
|
227
|
-
}),
|
|
228
|
-
job.controller.signal
|
|
229
|
-
);
|
|
220
|
+
transition(job, "preparing", "Preparing isolated Agent execution.");
|
|
230
221
|
const callbacks = {
|
|
231
222
|
onCheck(result) {
|
|
232
223
|
appendEvent(
|
|
@@ -358,7 +349,6 @@ function createAgentJobManager(options) {
|
|
|
358
349
|
[...jobs.values()].map((job) => job.runPromise).filter((promise) => promise !== void 0)
|
|
359
350
|
);
|
|
360
351
|
capabilityCache.clear();
|
|
361
|
-
providerConsents.clear();
|
|
362
352
|
jobs.clear();
|
|
363
353
|
},
|
|
364
354
|
create(request) {
|
|
@@ -376,7 +366,6 @@ function createAgentJobManager(options) {
|
|
|
376
366
|
request.providerProfileId,
|
|
377
367
|
request.modelProfileId
|
|
378
368
|
);
|
|
379
|
-
providerConsents.add(selection.provider.id);
|
|
380
369
|
const id = dependencies.createJobId();
|
|
381
370
|
if (!JOB_ID_PATTERN.test(id) || jobs.has(id)) {
|
|
382
371
|
throw new SpotPatchError(ERROR_CODES.INTERNAL_ERROR);
|
|
@@ -1417,6 +1406,7 @@ async function authorizeTarget(target, input) {
|
|
|
1417
1406
|
}
|
|
1418
1407
|
return Object.freeze({
|
|
1419
1408
|
instruction: target.instruction,
|
|
1409
|
+
...target.page === void 0 ? {} : { page: Object.freeze({ ...target.page }) },
|
|
1420
1410
|
source,
|
|
1421
1411
|
react: Object.freeze({
|
|
1422
1412
|
supported: target.react.supported,
|
|
@@ -2249,6 +2239,7 @@ async function createSourceRegistrationService(input) {
|
|
|
2249
2239
|
import { randomBytes as randomBytes3 } from "crypto";
|
|
2250
2240
|
function createSession() {
|
|
2251
2241
|
return Object.freeze({
|
|
2242
|
+
id: randomBytes3(16).toString("base64url"),
|
|
2252
2243
|
token: randomBytes3(16).toString("base64url")
|
|
2253
2244
|
});
|
|
2254
2245
|
}
|