@mastra/factory 0.8.0-alpha.8 → 0.8.0
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 +660 -0
- package/dist/factory.d.ts.map +1 -1
- package/dist/factory.js +42 -4
- package/dist/factory.js.map +1 -1
- package/dist/integrations/base.d.ts +8 -0
- package/dist/integrations/base.d.ts.map +1 -1
- package/dist/integrations/github/app-identity.d.ts +43 -0
- package/dist/integrations/github/app-identity.d.ts.map +1 -0
- package/dist/integrations/github/app-identity.js +62 -0
- package/dist/integrations/github/app-identity.js.map +1 -0
- package/dist/integrations/github/integration.d.ts +9 -0
- package/dist/integrations/github/integration.d.ts.map +1 -1
- package/dist/integrations/github/integration.js +9 -1
- package/dist/integrations/github/integration.js.map +1 -1
- package/dist/integrations/github/reconcile-worker.d.ts +5 -0
- package/dist/integrations/github/reconcile-worker.d.ts.map +1 -1
- package/dist/integrations/github/reconcile-worker.js +7 -0
- package/dist/integrations/github/reconcile-worker.js.map +1 -1
- package/dist/integrations/github/routes.d.ts.map +1 -1
- package/dist/integrations/github/routes.js +11 -6
- package/dist/integrations/github/routes.js.map +1 -1
- package/dist/integrations/github/rules.d.ts +8 -0
- package/dist/integrations/github/rules.d.ts.map +1 -1
- package/dist/integrations/github/rules.js +30 -8
- package/dist/integrations/github/rules.js.map +1 -1
- package/dist/integrations/github/sandbox.d.ts +39 -6
- package/dist/integrations/github/sandbox.d.ts.map +1 -1
- package/dist/integrations/github/sandbox.js +48 -14
- package/dist/integrations/github/sandbox.js.map +1 -1
- package/dist/integrations/github/webhook.d.ts +39 -0
- package/dist/integrations/github/webhook.d.ts.map +1 -1
- package/dist/integrations/github/webhook.js +74 -13
- package/dist/integrations/github/webhook.js.map +1 -1
- package/dist/integrations/linear/integration.d.ts.map +1 -1
- package/dist/integrations/linear/integration.js +1 -0
- package/dist/integrations/linear/integration.js.map +1 -1
- package/dist/integrations/linear/routes.d.ts +10 -0
- package/dist/integrations/linear/routes.d.ts.map +1 -1
- package/dist/integrations/linear/routes.js +35 -1
- package/dist/integrations/linear/routes.js.map +1 -1
- package/dist/integrations/linear/rules.d.ts.map +1 -1
- package/dist/integrations/linear/rules.js +2 -1
- package/dist/integrations/linear/rules.js.map +1 -1
- package/dist/integrations/platform/github/event-worker.d.ts +11 -0
- package/dist/integrations/platform/github/event-worker.d.ts.map +1 -1
- package/dist/integrations/platform/github/event-worker.js +64 -16
- package/dist/integrations/platform/github/event-worker.js.map +1 -1
- package/dist/integrations/platform/github/integration.d.ts +12 -0
- package/dist/integrations/platform/github/integration.d.ts.map +1 -1
- package/dist/integrations/platform/github/integration.js +47 -4
- package/dist/integrations/platform/github/integration.js.map +1 -1
- package/dist/integrations/platform/linear/integration.d.ts.map +1 -1
- package/dist/integrations/platform/linear/integration.js +1 -0
- package/dist/integrations/platform/linear/integration.js.map +1 -1
- package/dist/integrations/slack/slack.d.ts.map +1 -1
- package/dist/integrations/slack/slack.js +2 -1
- package/dist/integrations/slack/slack.js.map +1 -1
- package/dist/routes/config.d.ts +12 -6
- package/dist/routes/config.d.ts.map +1 -1
- package/dist/routes/config.js +97 -56
- package/dist/routes/config.js.map +1 -1
- package/dist/routes/fs.d.ts.map +1 -1
- package/dist/routes/fs.js +2 -0
- package/dist/routes/fs.js.map +1 -1
- package/dist/routes/intake.d.ts +15 -0
- package/dist/routes/intake.d.ts.map +1 -1
- package/dist/routes/intake.js +65 -2
- package/dist/routes/intake.js.map +1 -1
- package/dist/routes/knowledge.d.ts +152 -0
- package/dist/routes/knowledge.d.ts.map +1 -0
- package/dist/routes/knowledge.js +442 -0
- package/dist/routes/knowledge.js.map +1 -0
- package/dist/routes/projects.d.ts +9 -1
- package/dist/routes/projects.d.ts.map +1 -1
- package/dist/routes/projects.js +8 -0
- package/dist/routes/projects.js.map +1 -1
- package/dist/routes/surface.d.ts +6 -0
- package/dist/routes/surface.d.ts.map +1 -1
- package/dist/routes/surface.js +10 -0
- package/dist/routes/surface.js.map +1 -1
- package/dist/routes/work-items.d.ts.map +1 -1
- package/dist/routes/work-items.js +3 -1
- package/dist/routes/work-items.js.map +1 -1
- package/dist/rules/binding-context.d.ts.map +1 -1
- package/dist/rules/binding-context.js +4 -1
- package/dist/rules/binding-context.js.map +1 -1
- package/dist/rules/defaults.d.ts.map +1 -1
- package/dist/rules/defaults.js +87 -4
- package/dist/rules/defaults.js.map +1 -1
- package/dist/rules/dispatcher.d.ts +6 -0
- package/dist/rules/dispatcher.d.ts.map +1 -1
- package/dist/rules/dispatcher.js +118 -16
- package/dist/rules/dispatcher.js.map +1 -1
- package/dist/rules/processor.d.ts.map +1 -1
- package/dist/rules/processor.js +20 -7
- package/dist/rules/processor.js.map +1 -1
- package/dist/rules/resolve.d.ts +1 -0
- package/dist/rules/resolve.d.ts.map +1 -1
- package/dist/rules/resolve.js +3 -2
- package/dist/rules/resolve.js.map +1 -1
- package/dist/rules/start-coordinator.d.ts +2 -0
- package/dist/rules/start-coordinator.d.ts.map +1 -1
- package/dist/rules/start-coordinator.js +3 -1
- package/dist/rules/start-coordinator.js.map +1 -1
- package/dist/rules/terminal-cleanup.d.ts +23 -0
- package/dist/rules/terminal-cleanup.d.ts.map +1 -0
- package/dist/rules/terminal-cleanup.js +43 -0
- package/dist/rules/terminal-cleanup.js.map +1 -0
- package/dist/rules/tools.d.ts.map +1 -1
- package/dist/rules/tools.js +24 -2
- package/dist/rules/tools.js.map +1 -1
- package/dist/rules/transition-service.d.ts +3 -0
- package/dist/rules/transition-service.d.ts.map +1 -1
- package/dist/rules/transition-service.js +10 -6
- package/dist/rules/transition-service.js.map +1 -1
- package/dist/rules/types.d.ts +32 -3
- package/dist/rules/types.d.ts.map +1 -1
- package/dist/rules/types.js +2 -0
- package/dist/rules/types.js.map +1 -1
- package/dist/rules/validation.d.ts.map +1 -1
- package/dist/rules/validation.js +8 -3
- package/dist/rules/validation.js.map +1 -1
- package/dist/sandbox/base-checkpoint-triggers.d.ts +77 -0
- package/dist/sandbox/base-checkpoint-triggers.d.ts.map +1 -0
- package/dist/sandbox/base-checkpoint-triggers.js +137 -0
- package/dist/sandbox/base-checkpoint-triggers.js.map +1 -0
- package/dist/sandbox/base-checkpoint.d.ts +59 -0
- package/dist/sandbox/base-checkpoint.d.ts.map +1 -0
- package/dist/sandbox/base-checkpoint.js +145 -0
- package/dist/sandbox/base-checkpoint.js.map +1 -0
- package/dist/sandbox/fleet.d.ts +32 -0
- package/dist/sandbox/fleet.d.ts.map +1 -1
- package/dist/sandbox/fleet.js +39 -10
- package/dist/sandbox/fleet.js.map +1 -1
- package/dist/session/checkpoint-capture.d.ts +3 -2
- package/dist/session/checkpoint-capture.d.ts.map +1 -1
- package/dist/session/checkpoint-capture.js +3 -3
- package/dist/session/checkpoint-capture.js.map +1 -1
- package/dist/session/factory-session.d.ts.map +1 -1
- package/dist/session/factory-session.js +2 -1
- package/dist/session/factory-session.js.map +1 -1
- package/dist/session/filesystem-capture.d.ts +7 -0
- package/dist/session/filesystem-capture.d.ts.map +1 -1
- package/dist/session/filesystem-capture.js +41 -4
- package/dist/session/filesystem-capture.js.map +1 -1
- package/dist/session/model-pack-hydration.d.ts +55 -0
- package/dist/session/model-pack-hydration.d.ts.map +1 -0
- package/dist/session/model-pack-hydration.js +56 -0
- package/dist/session/model-pack-hydration.js.map +1 -0
- package/dist/skills/service.d.ts +9 -0
- package/dist/skills/service.d.ts.map +1 -1
- package/dist/skills/service.js +10 -1
- package/dist/skills/service.js.map +1 -1
- package/dist/storage/domains/intake/base.d.ts +36 -0
- package/dist/storage/domains/intake/base.d.ts.map +1 -1
- package/dist/storage/domains/intake/base.js +91 -2
- package/dist/storage/domains/intake/base.js.map +1 -1
- package/dist/storage/domains/model-packs/base.d.ts +26 -0
- package/dist/storage/domains/model-packs/base.d.ts.map +1 -1
- package/dist/storage/domains/model-packs/base.js +102 -13
- package/dist/storage/domains/model-packs/base.js.map +1 -1
- package/dist/storage/domains/source-control/base.d.ts +47 -1
- package/dist/storage/domains/source-control/base.d.ts.map +1 -1
- package/dist/storage/domains/source-control/base.js +78 -19
- package/dist/storage/domains/source-control/base.js.map +1 -1
- package/dist/storage/domains/source-control/inmemory.d.ts +11 -3
- package/dist/storage/domains/source-control/inmemory.d.ts.map +1 -1
- package/dist/storage/domains/source-control/inmemory.js +10 -1
- package/dist/storage/domains/source-control/inmemory.js.map +1 -1
- package/dist/storage/domains/work-items/base.d.ts +67 -1
- package/dist/storage/domains/work-items/base.d.ts.map +1 -1
- package/dist/storage/domains/work-items/base.js +183 -12
- package/dist/storage/domains/work-items/base.js.map +1 -1
- package/dist/workspace.d.ts +31 -2
- package/dist/workspace.d.ts.map +1 -1
- package/dist/workspace.js +225 -54
- package/dist/workspace.js.map +1 -1
- package/factory-skills/factory-plan/SKILL.md +1 -1
- package/factory-skills/factory-rereview/SKILL.md +3 -3
- package/factory-skills/factory-review/SKILL.md +3 -3
- package/factory-skills/factory-triage/SKILL.md +2 -0
- package/package.json +8 -8
package/dist/routes/config.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { WEB_OAUTH_FLOW_KINDS, getAuthProviderId, listTenantCredentialsForRequest, resolveCredentialContext, tenantOrgId } from "./provider-credentials.js";
|
|
2
2
|
import { Route } from "./route.js";
|
|
3
3
|
import { applyStoredMemorySettings } from "../session/memory-settings-hydration.js";
|
|
4
|
+
import { applyActiveModelPack } from "../session/model-pack-hydration.js";
|
|
4
5
|
import { registerApiRoute } from "@mastra/core/server";
|
|
5
6
|
import { DEFAULT_OM_MODEL_ID } from "@mastra/code-sdk/constants";
|
|
6
7
|
import { getAvailableModePacks, resolveProviderOMDefault } from "@mastra/code-sdk/onboarding/packs";
|
|
7
|
-
import { THINKING_LEVEL_VALUES,
|
|
8
|
+
import { THINKING_LEVEL_VALUES, getCustomProviderId, isThinkingLevelSetting, loadSettings, saveSettings } from "@mastra/code-sdk/onboarding/settings";
|
|
8
9
|
//#region src/routes/config.ts
|
|
9
10
|
/** Widen a route-local Hono context to the plain `Context` the auth helpers take. */
|
|
10
11
|
function loose(c) {
|
|
@@ -173,6 +174,13 @@ async function resolvePackContext({ c, auth, modelPacks }) {
|
|
|
173
174
|
message: "Model pack storage is unavailable — the app database is not configured or failed to start."
|
|
174
175
|
}, 503) };
|
|
175
176
|
}
|
|
177
|
+
async function authorizePackSession({ c, auth, sessions, packContext, resourceId, scope }) {
|
|
178
|
+
if (!auth.enabled()) return null;
|
|
179
|
+
if (!sessions) return c.json({ error: "session_authorization_unavailable" }, 503);
|
|
180
|
+
const sourceSession = await sessions.getBySessionId(resourceId);
|
|
181
|
+
if (!sourceSession || sourceSession.orgId !== packContext.orgId || sourceSession.userId !== packContext.userId || !scope || sourceSession.sandboxWorkdir !== scope) return c.json({ error: `No session for resourceId "${resourceId}"` }, 404);
|
|
182
|
+
return null;
|
|
183
|
+
}
|
|
176
184
|
/** DB row → the `ModePack` shape the packs list and activation flow consume. */
|
|
177
185
|
function recordToModePack(record) {
|
|
178
186
|
return {
|
|
@@ -185,8 +193,8 @@ function recordToModePack(record) {
|
|
|
185
193
|
/**
|
|
186
194
|
* List available model packs (built-in, gated by provider access, plus saved
|
|
187
195
|
* custom packs from the request's pack context). Drops the synthetic
|
|
188
|
-
* "New Custom" placeholder
|
|
189
|
-
*
|
|
196
|
+
* "New Custom" placeholder because the web client has its own create flow.
|
|
197
|
+
* `active` marks the user's default pack for new interactive chats.
|
|
190
198
|
*/
|
|
191
199
|
async function listModelPacks({ controller, authStorage, tenantCredentials, packContext, activePackId }) {
|
|
192
200
|
return [...getAvailableModePacks(await buildProviderAccess({
|
|
@@ -199,50 +207,11 @@ async function listModelPacks({ controller, authStorage, tenantCredentials, pack
|
|
|
199
207
|
active: activePackId != null && p.id === activePackId
|
|
200
208
|
}));
|
|
201
209
|
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
const threadId = session.thread.getId();
|
|
206
|
-
if (!threadId) return null;
|
|
207
|
-
const value = (await session.thread.list()).find((t) => t.id === threadId)?.metadata?.[THREAD_ACTIVE_MODEL_PACK_ID_KEY];
|
|
210
|
+
async function resolveSessionModelPackId(session) {
|
|
211
|
+
if (!session?.thread.getId()) return null;
|
|
212
|
+
const value = await session.thread.getSetting({ key: "activeModelPackId" });
|
|
208
213
|
return typeof value === "string" ? value : null;
|
|
209
214
|
}
|
|
210
|
-
/**
|
|
211
|
-
* Apply a pack to a session: seed each mode's default model, switch the current
|
|
212
|
-
* mode's model, set per-subagent models, and tag the thread with the active
|
|
213
|
-
* pack id. Mirrors the TUI `applyPack` orchestration.
|
|
214
|
-
*/
|
|
215
|
-
async function applyPackToSession({ controller, session, pack }) {
|
|
216
|
-
const modes = controller.listModes?.() ?? [];
|
|
217
|
-
const packModels = pack.models;
|
|
218
|
-
for (const mode of modes) {
|
|
219
|
-
const modelId = packModels[mode.id];
|
|
220
|
-
if (modelId) {
|
|
221
|
-
mode.defaultModelId = modelId;
|
|
222
|
-
await session.thread.setSetting({
|
|
223
|
-
key: `modeModelId_${mode.id}`,
|
|
224
|
-
value: modelId
|
|
225
|
-
});
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
const currentModeModel = packModels[session.mode.get()];
|
|
229
|
-
if (currentModeModel) await session.model.switch({ modelId: currentModeModel });
|
|
230
|
-
for (const [agentType, modeId] of Object.entries({
|
|
231
|
-
explore: "fast",
|
|
232
|
-
plan: "plan",
|
|
233
|
-
execute: "build"
|
|
234
|
-
})) {
|
|
235
|
-
const saModelId = packModels[modeId];
|
|
236
|
-
if (saModelId) await session.subagents.model.set({
|
|
237
|
-
modelId: saModelId,
|
|
238
|
-
agentType
|
|
239
|
-
});
|
|
240
|
-
}
|
|
241
|
-
await session.thread.setSetting({
|
|
242
|
-
key: THREAD_ACTIVE_MODEL_PACK_ID_KEY,
|
|
243
|
-
value: pack.id
|
|
244
|
-
});
|
|
245
|
-
}
|
|
246
215
|
function readOMConfig(session) {
|
|
247
216
|
const observeAttachments = (session.state.get() ?? {}).observeAttachments;
|
|
248
217
|
return {
|
|
@@ -295,6 +264,7 @@ async function persistMemorySettings(context, patch, fillIfUnset) {
|
|
|
295
264
|
}
|
|
296
265
|
/**
|
|
297
266
|
* The web config routes as Mastra `apiRoutes`:
|
|
267
|
+
* - `GET /web/config/features` — list server-enabled product features
|
|
298
268
|
* - `GET /web/config/providers` — list providers + key source
|
|
299
269
|
* - `PUT /web/config/providers/:provider/key` — set/update a provider's API key
|
|
300
270
|
* - `DELETE /web/config/providers/:provider/key` — remove a stored API key
|
|
@@ -316,6 +286,11 @@ var ConfigRoutes = class extends Route {
|
|
|
316
286
|
const onCredentialsChanged = options.onCredentialsChanged ?? (() => {});
|
|
317
287
|
const onCustomProvidersChanged = options.onCustomProvidersChanged ?? (() => {});
|
|
318
288
|
return [
|
|
289
|
+
registerApiRoute("/web/config/features", {
|
|
290
|
+
method: "GET",
|
|
291
|
+
requiresAuth: false,
|
|
292
|
+
handler: async (c) => c.json({ knowledge: options.features?.knowledge ?? false })
|
|
293
|
+
}),
|
|
319
294
|
registerApiRoute("/web/config/providers", {
|
|
320
295
|
method: "GET",
|
|
321
296
|
requiresAuth: false,
|
|
@@ -589,7 +564,22 @@ var ConfigRoutes = class extends Route {
|
|
|
589
564
|
const resourceId = c.req.query("resourceId");
|
|
590
565
|
const scope = c.req.query("scope") || void 0;
|
|
591
566
|
try {
|
|
592
|
-
const activePackId =
|
|
567
|
+
const activePackId = (await packContext.storage.getActive({
|
|
568
|
+
orgId: packContext.orgId,
|
|
569
|
+
userId: packContext.userId
|
|
570
|
+
}))?.packId ?? null;
|
|
571
|
+
if (resourceId) {
|
|
572
|
+
const unauthorized = await authorizePackSession({
|
|
573
|
+
c: loose(c),
|
|
574
|
+
auth,
|
|
575
|
+
sessions: options.sourceControlSessions,
|
|
576
|
+
packContext,
|
|
577
|
+
resourceId,
|
|
578
|
+
scope
|
|
579
|
+
});
|
|
580
|
+
if (unauthorized) return unauthorized;
|
|
581
|
+
}
|
|
582
|
+
const sessionPackId = await resolveSessionModelPackId(resourceId ? await controller.getSessionByResource?.(resourceId, scope) : void 0);
|
|
593
583
|
const tenantCredentials = await listTenantCredentialsForRequest({
|
|
594
584
|
c: loose(c),
|
|
595
585
|
auth,
|
|
@@ -603,7 +593,8 @@ var ConfigRoutes = class extends Route {
|
|
|
603
593
|
packContext,
|
|
604
594
|
activePackId
|
|
605
595
|
}),
|
|
606
|
-
activePackId
|
|
596
|
+
activePackId,
|
|
597
|
+
sessionPackId
|
|
607
598
|
});
|
|
608
599
|
} catch (error) {
|
|
609
600
|
return c.json({ error: error instanceof Error ? error.message : String(error) }, 500);
|
|
@@ -655,6 +646,30 @@ var ConfigRoutes = class extends Route {
|
|
|
655
646
|
}
|
|
656
647
|
}
|
|
657
648
|
}),
|
|
649
|
+
registerApiRoute("/web/config/model-packs/active", {
|
|
650
|
+
method: "DELETE",
|
|
651
|
+
requiresAuth: false,
|
|
652
|
+
handler: async (c) => {
|
|
653
|
+
const packContext = await resolvePackContext({
|
|
654
|
+
c: loose(c),
|
|
655
|
+
auth,
|
|
656
|
+
modelPacks: options.modelPacks
|
|
657
|
+
});
|
|
658
|
+
if ("response" in packContext) return packContext.response;
|
|
659
|
+
try {
|
|
660
|
+
await packContext.storage.clearActive({
|
|
661
|
+
orgId: packContext.orgId,
|
|
662
|
+
userId: packContext.userId
|
|
663
|
+
});
|
|
664
|
+
return c.json({
|
|
665
|
+
ok: true,
|
|
666
|
+
activePackId: null
|
|
667
|
+
});
|
|
668
|
+
} catch (error) {
|
|
669
|
+
return c.json({ error: error instanceof Error ? error.message : String(error) }, 500);
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
}),
|
|
658
673
|
registerApiRoute("/web/config/model-packs/:id", {
|
|
659
674
|
method: "DELETE",
|
|
660
675
|
requiresAuth: false,
|
|
@@ -694,12 +709,25 @@ var ConfigRoutes = class extends Route {
|
|
|
694
709
|
} catch {
|
|
695
710
|
return c.json({ error: "Invalid JSON body" }, 400);
|
|
696
711
|
}
|
|
697
|
-
const
|
|
712
|
+
const target = body.target ?? "default";
|
|
713
|
+
if (target !== "default" && target !== "session") return c.json({ error: "target must be \"default\" or \"session\"" }, 400);
|
|
714
|
+
const resourceId = typeof body.resourceId === "string" && body.resourceId ? body.resourceId : void 0;
|
|
698
715
|
const scope = typeof body.scope === "string" && body.scope ? body.scope : void 0;
|
|
699
|
-
if (!resourceId) return c.json({ error: "Missing required field: resourceId" }, 400);
|
|
716
|
+
if (target === "session" && !resourceId) return c.json({ error: "Missing required field for session activation: resourceId" }, 400);
|
|
700
717
|
try {
|
|
701
|
-
|
|
702
|
-
|
|
718
|
+
if (target === "session" && resourceId) {
|
|
719
|
+
const unauthorized = await authorizePackSession({
|
|
720
|
+
c: loose(c),
|
|
721
|
+
auth,
|
|
722
|
+
sessions: options.sourceControlSessions,
|
|
723
|
+
packContext,
|
|
724
|
+
resourceId,
|
|
725
|
+
scope
|
|
726
|
+
});
|
|
727
|
+
if (unauthorized) return unauthorized;
|
|
728
|
+
}
|
|
729
|
+
const session = target === "session" && resourceId ? await controller.getSessionByResource?.(resourceId, scope) : void 0;
|
|
730
|
+
if (target === "session" && !session) return c.json({ error: `No session for resourceId "${resourceId}"` }, 404);
|
|
703
731
|
const tenantCredentials = await listTenantCredentialsForRequest({
|
|
704
732
|
c: loose(c),
|
|
705
733
|
auth,
|
|
@@ -712,14 +740,27 @@ var ConfigRoutes = class extends Route {
|
|
|
712
740
|
packContext
|
|
713
741
|
})).find((p) => p.id === id);
|
|
714
742
|
if (!pack) return c.json({ error: `Unknown pack "${id}"` }, 404);
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
743
|
+
if (target === "default") {
|
|
744
|
+
await packContext.storage.setActive({
|
|
745
|
+
orgId: packContext.orgId,
|
|
746
|
+
userId: packContext.userId,
|
|
747
|
+
packId: pack.id,
|
|
748
|
+
models: pack.models
|
|
749
|
+
});
|
|
750
|
+
return c.json({
|
|
751
|
+
ok: true,
|
|
752
|
+
target,
|
|
753
|
+
activePackId: pack.id
|
|
754
|
+
});
|
|
755
|
+
}
|
|
756
|
+
if (session) await applyActiveModelPack(session, {
|
|
757
|
+
packId: pack.id,
|
|
758
|
+
models: pack.models
|
|
719
759
|
});
|
|
720
760
|
return c.json({
|
|
721
761
|
ok: true,
|
|
722
|
-
|
|
762
|
+
target,
|
|
763
|
+
sessionPackId: pack.id
|
|
723
764
|
});
|
|
724
765
|
} catch (error) {
|
|
725
766
|
return c.json({ error: error instanceof Error ? error.message : String(error) }, 500);
|