perstack 0.0.91 → 0.0.92

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.
@@ -6451,6 +6451,36 @@ const generalToolActivitySchema = baseActivitySchema.extend({
6451
6451
  result: array(messagePartSchema).optional(),
6452
6452
  error: string().optional()
6453
6453
  });
6454
+ const addSkillActivitySchema = baseActivitySchema.extend({
6455
+ type: literal("addSkill"),
6456
+ name: string(),
6457
+ skillType: string(),
6458
+ tools: array(string()).optional(),
6459
+ error: string().optional()
6460
+ });
6461
+ const removeSkillActivitySchema = baseActivitySchema.extend({
6462
+ type: literal("removeSkill"),
6463
+ skillName: string(),
6464
+ error: string().optional()
6465
+ });
6466
+ const addDelegateActivitySchema = baseActivitySchema.extend({
6467
+ type: literal("addDelegate"),
6468
+ targetExpertKey: string(),
6469
+ delegateToolName: string().optional(),
6470
+ error: string().optional()
6471
+ });
6472
+ const removeDelegateActivitySchema = baseActivitySchema.extend({
6473
+ type: literal("removeDelegate"),
6474
+ expertName: string(),
6475
+ error: string().optional()
6476
+ });
6477
+ const createExpertActivitySchema = baseActivitySchema.extend({
6478
+ type: literal("createExpert"),
6479
+ targetKey: string(),
6480
+ description: string().optional(),
6481
+ resultExpertKey: string().optional(),
6482
+ error: string().optional()
6483
+ });
6454
6484
  const activitySchema = discriminatedUnion("type", [
6455
6485
  queryActivitySchema,
6456
6486
  retryActivitySchema,
@@ -6468,7 +6498,12 @@ const activitySchema = discriminatedUnion("type", [
6468
6498
  delegateActivitySchema,
6469
6499
  delegationCompleteActivitySchema,
6470
6500
  interactiveToolActivitySchema,
6471
- generalToolActivitySchema
6501
+ generalToolActivitySchema,
6502
+ addSkillActivitySchema,
6503
+ removeSkillActivitySchema,
6504
+ addDelegateActivitySchema,
6505
+ removeDelegateActivitySchema,
6506
+ createExpertActivitySchema
6472
6507
  ]);
6473
6508
  const parallelActivitiesGroupSchema = object({
6474
6509
  type: literal("parallelGroup"),
@@ -7416,6 +7451,41 @@ function createBaseToolActivity(toolName, toolCall, toolResult, reasoning) {
7416
7451
  stdout: parseStringField(resultContents, "stdout"),
7417
7452
  stderr: parseStringField(resultContents, "stderr")
7418
7453
  };
7454
+ case "addSkill": return {
7455
+ type: "addSkill",
7456
+ ...baseFields,
7457
+ name: String(args["name"] ?? ""),
7458
+ skillType: String(args["type"] ?? ""),
7459
+ tools: parseStringArrayField(resultContents, "tools"),
7460
+ error: errorText
7461
+ };
7462
+ case "removeSkill": return {
7463
+ type: "removeSkill",
7464
+ ...baseFields,
7465
+ skillName: String(args["skillName"] ?? ""),
7466
+ error: errorText
7467
+ };
7468
+ case "addDelegate": return {
7469
+ type: "addDelegate",
7470
+ ...baseFields,
7471
+ targetExpertKey: String(args["expertKey"] ?? ""),
7472
+ delegateToolName: parseStringField(resultContents, "delegateToolName"),
7473
+ error: errorText
7474
+ };
7475
+ case "removeDelegate": return {
7476
+ type: "removeDelegate",
7477
+ ...baseFields,
7478
+ expertName: String(args["expertName"] ?? ""),
7479
+ error: errorText
7480
+ };
7481
+ case "createExpert": return {
7482
+ type: "createExpert",
7483
+ ...baseFields,
7484
+ targetKey: String(args["key"] ?? ""),
7485
+ description: typeof args["description"] === "string" ? args["description"] : void 0,
7486
+ resultExpertKey: parseStringField(resultContents, "expertKey"),
7487
+ error: errorText
7488
+ };
7419
7489
  default: return createGeneralToolActivity(toolCall.skillName, toolName, toolCall, toolResult, reasoning);
7420
7490
  }
7421
7491
  }
@@ -7465,6 +7535,14 @@ function parseNumberField(result, field) {
7465
7535
  return;
7466
7536
  }
7467
7537
  }
7538
+ function parseStringArrayField(result, field) {
7539
+ const textPart = result.find((p) => p.type === "textPart");
7540
+ if (!textPart?.text) return void 0;
7541
+ try {
7542
+ const parsed = JSON.parse(textPart.text);
7543
+ if (Array.isArray(parsed[field])) return parsed[field].map(String);
7544
+ } catch {}
7545
+ }
7468
7546
  function parseRemainingTodosFromResult(result) {
7469
7547
  const textPart = result.find((p) => p.type === "textPart");
7470
7548
  if (!textPart?.text) return void 0;
@@ -9155,4 +9233,4 @@ function createApiClient(config) {
9155
9233
 
9156
9234
  //#endregion
9157
9235
  export { object as $, runCommandInputSchema as A, createId as At, _instanceof as B, skipDelegates as C, $constructor as Ct, stopRunByError as D, defaultMaxRetries as Dt, stopRunByDelegate as E, PerstackError as Et, expertSchema$1 as F, custom as G, any as H, checkpointSchema as I, lazy as J, discriminatedUnion as K, number as L, perstackConfigSchema as M, lockfileSchema as N, stopRunByExceededMaxSteps as O, defaultPerstackApiBaseUrl as Ot, jobSchema$1 as P, number$1 as Q, ZodOptional as R, runSettingSchema as S, normalizeParams as St, startRun as T, knownModels as Tt, array as U, _null as V, boolean$1 as W, looseObject as X, literal as Y, never as Z, proceedToInteractiveTools as _, parseAsync$1 as _t, getFilteredEnv as a, tuple as at, retry as b, clone as bt, createGeneralToolActivity as c, url as ct, completeRun as d, toJSONSchema as dt, optional as et, continueToNextStep as f, describe$1 as ft, finishToolCall as g, parse$1 as gt, finishMcpTools as h, $ZodType as ht, validateEventFilter as i, string as it, startCommandInputSchema as j, stopRunByInteractiveTool as k, defaultTimeout as kt, attemptCompletion as l, safeParseAsync as lt, createStreamingEvent as m, $ZodObject as mt, parseWithFriendlyError as n, record as nt, BASE_SKILL_PREFIX as o, union as ot, createRuntimeEvent as p, meta$1 as pt, intersection as q, createFilteredEventListener as r, strictObject as rt, createBaseToolActivity as s, unknown as st, createApiClient as t, preprocess as tt, callTools as u, datetime as ut, resolveToolResults as v, safeParse$1 as vt, startGeneration as w, NEVER as wt, runParamsSchema as x, defineLazy as xt, resumeFromStop as y, safeParseAsync$1 as yt, _enum as z };
9158
- //# sourceMappingURL=dist-Bww5wViz.js.map
9236
+ //# sourceMappingURL=dist-V21w4o7U.js.map