@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 CHANGED
@@ -1,8 +1,4 @@
1
- <p align="center">
2
- <a href="https://github.com/huanglvjing/spotpatch"><img src="https://raw.githubusercontent.com/huanglvjing/spotpatch/main/docs/assets/spotpatch-logo.svg" alt="SpotPatch" width="560" /></a>
3
- </p>
4
-
5
- # `@spotpatch/dev-server`
1
+ <h1><a href="https://github.com/huanglvjing/spotpatch"><img src="https://raw.githubusercontent.com/huanglvjing/spotpatch/main/docs/assets/spotpatch-npm-icon.png" alt="SpotPatch" width="48" height="48" align="absmiddle" /></a> <code>@spotpatch/dev-server</code></h1>
6
2
 
7
3
  ## English
8
4
 
package/dist/index.cjs CHANGED
@@ -129,7 +129,6 @@ function createAgentJobManager(options) {
129
129
  });
130
130
  const jobs = /* @__PURE__ */ new Map();
131
131
  const capabilityCache = /* @__PURE__ */ new Map();
132
- const providerConsents = /* @__PURE__ */ new Set();
133
132
  let closed = false;
134
133
  const resolveSelection = (providerProfileId, modelProfileId) => {
135
134
  const provider = options.ai.providers[providerProfileId];
@@ -260,15 +259,7 @@ function createAgentJobManager(options) {
260
259
  };
261
260
  const runJob = async (job) => {
262
261
  try {
263
- transition(job, "preparing", "Verifying provider and model capabilities.");
264
- await probeResolved(
265
- Object.freeze({
266
- credential: job.credential,
267
- model: job.model,
268
- provider: job.provider
269
- }),
270
- job.controller.signal
271
- );
262
+ transition(job, "preparing", "Preparing isolated Agent execution.");
272
263
  const callbacks = {
273
264
  onCheck(result) {
274
265
  appendEvent(
@@ -400,7 +391,6 @@ function createAgentJobManager(options) {
400
391
  [...jobs.values()].map((job) => job.runPromise).filter((promise) => promise !== void 0)
401
392
  );
402
393
  capabilityCache.clear();
403
- providerConsents.clear();
404
394
  jobs.clear();
405
395
  },
406
396
  create(request) {
@@ -418,7 +408,6 @@ function createAgentJobManager(options) {
418
408
  request.providerProfileId,
419
409
  request.modelProfileId
420
410
  );
421
- providerConsents.add(selection.provider.id);
422
411
  const id = dependencies.createJobId();
423
412
  if (!JOB_ID_PATTERN.test(id) || jobs.has(id)) {
424
413
  throw new import_shared.SpotPatchError(import_shared.ERROR_CODES.INTERNAL_ERROR);
@@ -1430,6 +1419,7 @@ async function authorizeTarget(target, input) {
1430
1419
  }
1431
1420
  return Object.freeze({
1432
1421
  instruction: target.instruction,
1422
+ ...target.page === void 0 ? {} : { page: Object.freeze({ ...target.page }) },
1433
1423
  source,
1434
1424
  react: Object.freeze({
1435
1425
  supported: target.react.supported,
@@ -2257,6 +2247,7 @@ async function createSourceRegistrationService(input) {
2257
2247
  var import_node_crypto5 = require("crypto");
2258
2248
  function createSession() {
2259
2249
  return Object.freeze({
2250
+ id: (0, import_node_crypto5.randomBytes)(16).toString("base64url"),
2260
2251
  token: (0, import_node_crypto5.randomBytes)(16).toString("base64url")
2261
2252
  });
2262
2253
  }