create-expert 0.0.37 → 0.0.38

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/bin/cli.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { a as __toCommonJS, i as __require, n as __esmMin, o as __toESM, r as __exportAll, t as __commonJSMin } from "../chunk-D_gEzPfs.js";
3
- import { $ as boolean, A as startCommandInputSchema, At as defineLazy, C as startGeneration, Ct as $ZodObject, D as stopRunByExceededMaxSteps, Dt as safeParse$1, E as stopRunByError, Et as parseAsync, F as checkpointSchema, Ft as PerstackError, G as number$1, It as defaultMaxRetries, J as _instanceof, K as ZodOptional$1, Lt as defaultTimeout, M as lockfileSchema, Mt as $constructor, N as jobSchema, Nt as NEVER, O as stopRunByInteractiveTool, Ot as safeParseAsync$1, P as expertSchema, Pt as knownModels, Q as array$1, Rt as createId, S as skipDelegates, St as meta$1, T as stopRunByDelegate, Tt as parse$1, Y as _null, Z as any, _ as resolveToolResults, _t as url, a as BASE_SKILL_PREFIX, at as looseObject, b as runParamsSchema, bt as toJSONSchema, c as attemptCompletion$1, ct as object$2, d as continueToNextStep, dt as record, et as custom, f as createRuntimeEvent, ft as strictObject, g as proceedToInteractiveTools, gt as unknown, h as finishToolCall, ht as union, i as getFilteredEnv, it as literal, j as perstackConfigSchema, jt as normalizeParams, k as runCommandInputSchema, kt as clone, l as callTools, lt as optional, m as finishMcpTools, mt as tuple, n as createFilteredEventListener, nt as intersection, o as createBaseToolActivity, ot as never, p as createStreamingEvent, pt as string, q as _enum, r as validateEventFilter, rt as lazy, s as createGeneralToolActivity, st as number, t as parseWithFriendlyError, tt as discriminatedUnion, u as completeRun, ut as preprocess, v as resumeFromStop, vt as safeParseAsync$2, w as startRun, wt as $ZodType, x as runSettingSchema, xt as describe$1, y as retry, yt as datetime } from "../src-D-q0VJ6r.js";
3
+ import { $ as boolean, A as startCommandInputSchema, At as defineLazy, C as startGeneration, Ct as $ZodObject, D as stopRunByExceededMaxSteps, Dt as safeParse$1, E as stopRunByError, Et as parseAsync, F as checkpointSchema, Ft as PerstackError, G as number$1, It as defaultMaxRetries, J as _instanceof, K as ZodOptional$1, Lt as defaultTimeout, M as lockfileSchema, Mt as $constructor, N as jobSchema, Nt as NEVER, O as stopRunByInteractiveTool, Ot as safeParseAsync$1, P as expertSchema, Pt as knownModels, Q as array$1, Rt as createId, S as skipDelegates, St as meta$1, T as stopRunByDelegate, Tt as parse$1, Y as _null, Z as any, _ as resolveToolResults, _t as url, a as BASE_SKILL_PREFIX, at as looseObject, b as runParamsSchema, bt as toJSONSchema, c as attemptCompletion$1, ct as object$2, d as continueToNextStep, dt as record, et as custom, f as createRuntimeEvent, ft as strictObject, g as proceedToInteractiveTools, gt as unknown, h as finishToolCall, ht as union, i as getFilteredEnv, it as literal, j as perstackConfigSchema, jt as normalizeParams, k as runCommandInputSchema, kt as clone, l as callTools, lt as optional, m as finishMcpTools, mt as tuple, n as createFilteredEventListener, nt as intersection, o as createBaseToolActivity, ot as never, p as createStreamingEvent, pt as string, q as _enum, r as validateEventFilter, rt as lazy, s as createGeneralToolActivity, st as number, t as parseWithFriendlyError, tt as discriminatedUnion, u as completeRun, ut as preprocess, v as resumeFromStop, vt as safeParseAsync$2, w as startRun, wt as $ZodType, x as runSettingSchema, xt as describe$1, y as retry, yt as datetime } from "../src-C0pz_C3h.js";
4
4
  import { t as require_token_error } from "../token-error-CfavTss_.js";
5
5
  import * as fs$2 from "node:fs";
6
6
  import fs, { existsSync, mkdirSync, readFileSync, readdirSync, realpathSync, writeFileSync } from "node:fs";
@@ -16305,7 +16305,7 @@ const EMPTY_COMPLETION_RESULT = { completion: {
16305
16305
  //#endregion
16306
16306
  //#region ../base/package.json
16307
16307
  var name$5 = "@perstack/base";
16308
- var version$2 = "0.0.60";
16308
+ var version$2 = "0.0.61";
16309
16309
 
16310
16310
  //#endregion
16311
16311
  //#region ../base/src/tools/todo.ts
@@ -19750,13 +19750,22 @@ var SkillManager = class SkillManager {
19750
19750
  },
19751
19751
  removeDelegate: (name) => sm.removeDelegate(name),
19752
19752
  createExpert: async (input) => {
19753
+ const skills = input.skills ? {
19754
+ "@perstack/base": input.skills["@perstack/base"] ?? {
19755
+ type: "mcpStdioSkill",
19756
+ command: "npx",
19757
+ packageName: "@perstack/base",
19758
+ pick: ["attemptCompletion"]
19759
+ },
19760
+ ...input.skills
19761
+ } : void 0;
19753
19762
  const expert = expertSchema.parse({
19754
19763
  key: input.key,
19755
19764
  name: input.key,
19756
19765
  version: input.version ?? "1.0.0",
19757
19766
  description: input.description,
19758
19767
  instruction: input.instruction,
19759
- skills: input.skills,
19768
+ skills,
19760
19769
  delegates: input.delegates,
19761
19770
  tags: input.tags,
19762
19771
  providerTools: input.providerTools
@@ -19917,7 +19926,7 @@ var SkillManager = class SkillManager {
19917
19926
 
19918
19927
  //#endregion
19919
19928
  //#region ../../packages/runtime/package.json
19920
- var version$1 = "0.0.107";
19929
+ var version$1 = "0.0.108";
19921
19930
 
19922
19931
  //#endregion
19923
19932
  //#region ../../packages/runtime/src/helpers/usage.ts
@@ -53484,7 +53493,7 @@ function createOpenAI(options = {}) {
53484
53493
  var openai = createOpenAI();
53485
53494
 
53486
53495
  //#endregion
53487
- //#region ../../node_modules/.pnpm/ollama-ai-provider-v2@3.3.0_ai@6.0.86_zod@4.3.6__zod@4.3.6/node_modules/ollama-ai-provider-v2/dist/index.mjs
53496
+ //#region ../../node_modules/.pnpm/ollama-ai-provider-v2@3.3.1_ai@6.0.87_zod@4.3.6__zod@4.3.6/node_modules/ollama-ai-provider-v2/dist/index.mjs
53488
53497
  function convertToOllamaCompletionPrompt({ prompt, user = "user", assistant = "assistant" }) {
53489
53498
  let text = "";
53490
53499
  if (prompt[0].role === "system") {
@@ -75465,7 +75474,7 @@ function validateRuntimeVersion(experts) {
75465
75474
  //#endregion
75466
75475
  //#region ../../packages/runtime/src/helpers/setup-experts.ts
75467
75476
  async function setupExperts(setting, resolveExpertToRun) {
75468
- const resolveFn = resolveExpertToRun ?? (await import("../resolve-expert-DsQia0Mr.js")).resolveExpertToRun;
75477
+ const resolveFn = resolveExpertToRun ?? (await import("../resolve-expert-CTnETi9d.js")).resolveExpertToRun;
75469
75478
  const { expertKey } = setting;
75470
75479
  const experts = { ...setting.experts };
75471
75480
  const clientOptions = {
@@ -75768,7 +75777,7 @@ var require_dist$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
75768
75777
  }));
75769
75778
 
75770
75779
  //#endregion
75771
- //#region ../../node_modules/.pnpm/@ai-sdk+gateway@3.0.46_zod@4.3.6/node_modules/@ai-sdk/gateway/dist/index.mjs
75780
+ //#region ../../node_modules/.pnpm/@ai-sdk+gateway@3.0.47_zod@4.3.6/node_modules/@ai-sdk/gateway/dist/index.mjs
75772
75781
  var import_dist$1 = require_dist$1();
75773
75782
  var symbol$1 = Symbol.for("vercel.ai.gateway.error");
75774
75783
  var _a$1, _b;
@@ -76652,7 +76661,7 @@ async function getVercelRequestId() {
76652
76661
  var _a9;
76653
76662
  return (_a9 = (0, import_dist$1.getContext)().headers) == null ? void 0 : _a9["x-vercel-id"];
76654
76663
  }
76655
- var VERSION$2 = "3.0.46";
76664
+ var VERSION$2 = "3.0.47";
76656
76665
  var AI_GATEWAY_PROTOCOL_VERSION = "0.0.1";
76657
76666
  function createGatewayProvider(options = {}) {
76658
76667
  var _a9, _b9;
@@ -77673,7 +77682,7 @@ var TraceAPI = function() {
77673
77682
  var trace = TraceAPI.getInstance();
77674
77683
 
77675
77684
  //#endregion
77676
- //#region ../../node_modules/.pnpm/ai@6.0.86_zod@4.3.6/node_modules/ai/dist/index.mjs
77685
+ //#region ../../node_modules/.pnpm/ai@6.0.87_zod@4.3.6/node_modules/ai/dist/index.mjs
77677
77686
  var __defProp = Object.defineProperty;
77678
77687
  var __export = (target, all) => {
77679
77688
  for (var name21 in all) __defProp(target, name21, {
@@ -78209,7 +78218,7 @@ function detectMediaType({ data, signatures }) {
78209
78218
  const bytes = typeof processedData === "string" ? convertBase64ToUint8Array(processedData.substring(0, Math.min(processedData.length, 24))) : processedData;
78210
78219
  for (const signature of signatures) if (bytes.length >= signature.bytesPrefix.length && signature.bytesPrefix.every((byte, index) => byte === null || bytes[index] === byte)) return signature.mediaType;
78211
78220
  }
78212
- var VERSION = "6.0.86";
78221
+ var VERSION = "6.0.87";
78213
78222
  var download = async ({ url, maxBytes, abortSignal }) => {
78214
78223
  var _a21;
78215
78224
  const urlText = url.toString();
@@ -89074,43 +89083,65 @@ var DelegationExecutor = class {
89074
89083
  async executeSingleDelegation(delegation, parentSetting, parentContext, parentExpert, runFn, parentOptions) {
89075
89084
  const { expert, toolCallId, toolName, query } = delegation;
89076
89085
  const delegateRunId = createId();
89077
- const resultCheckpoint = await runFn({
89078
- setting: {
89079
- ...parentSetting,
89080
- runId: delegateRunId,
89081
- expertKey: expert.key,
89082
- input: { text: query }
89086
+ const delegateSetting = {
89087
+ ...parentSetting,
89088
+ runId: delegateRunId,
89089
+ expertKey: expert.key,
89090
+ input: { text: query }
89091
+ };
89092
+ const delegateCheckpoint = {
89093
+ id: createId(),
89094
+ jobId: parentSetting.jobId,
89095
+ runId: delegateRunId,
89096
+ status: "init",
89097
+ stepNumber: parentContext.stepNumber,
89098
+ messages: [],
89099
+ expert: {
89100
+ key: expert.key,
89101
+ name: expert.name,
89102
+ version: expert.version
89083
89103
  },
89084
- checkpoint: {
89085
- id: createId(),
89086
- jobId: parentSetting.jobId,
89087
- runId: delegateRunId,
89088
- status: "init",
89089
- stepNumber: parentContext.stepNumber,
89090
- messages: [],
89104
+ delegatedBy: {
89091
89105
  expert: {
89092
- key: expert.key,
89093
- name: expert.name,
89094
- version: expert.version
89095
- },
89096
- delegatedBy: {
89097
- expert: {
89098
- key: parentExpert.key,
89099
- name: parentExpert.name,
89100
- version: parentExpert.version
89101
- },
89102
- toolCallId,
89103
- toolName,
89104
- checkpointId: parentContext.id,
89105
- runId: parentSetting.runId
89106
+ key: parentExpert.key,
89107
+ name: parentExpert.name,
89108
+ version: parentExpert.version
89106
89109
  },
89107
- usage: createEmptyUsage(),
89108
- contextWindow: parentContext.contextWindow
89109
- }
89110
- }, {
89111
- ...parentOptions,
89112
- returnOnDelegationComplete: true
89113
- });
89110
+ toolCallId,
89111
+ toolName,
89112
+ checkpointId: parentContext.id,
89113
+ runId: parentSetting.runId
89114
+ },
89115
+ usage: createEmptyUsage(),
89116
+ contextWindow: parentContext.contextWindow
89117
+ };
89118
+ let resultCheckpoint;
89119
+ try {
89120
+ resultCheckpoint = await runFn({
89121
+ setting: delegateSetting,
89122
+ checkpoint: delegateCheckpoint
89123
+ }, {
89124
+ ...parentOptions,
89125
+ returnOnDelegationComplete: true
89126
+ });
89127
+ } catch (error) {
89128
+ return {
89129
+ toolCallId,
89130
+ toolName,
89131
+ expertKey: expert.key,
89132
+ text: `Delegation to ${expert.key} failed: ${error instanceof Error ? error.message : String(error)}`,
89133
+ stepNumber: parentContext.stepNumber,
89134
+ deltaUsage: createEmptyUsage()
89135
+ };
89136
+ }
89137
+ if (resultCheckpoint.status !== "completed") return {
89138
+ toolCallId,
89139
+ toolName,
89140
+ expertKey: expert.key,
89141
+ text: `Delegation to ${expert.key} ended with status: ${resultCheckpoint.status}`,
89142
+ stepNumber: resultCheckpoint.stepNumber,
89143
+ deltaUsage: resultCheckpoint.usage
89144
+ };
89114
89145
  return this.extractDelegationResult(resultCheckpoint, toolCallId, toolName, expert.key);
89115
89146
  }
89116
89147
  extractDelegationResult(checkpoint, toolCallId, toolName, expertKey) {
@@ -113396,6 +113427,17 @@ var EventQueue = class EventQueue {
113396
113427
  }
113397
113428
  };
113398
113429
 
113430
+ //#endregion
113431
+ //#region ../../packages/tui-components/src/colors.ts
113432
+ const colors = {
113433
+ primary: "white",
113434
+ muted: "gray",
113435
+ accent: "cyan",
113436
+ success: "green",
113437
+ warn: "yellow",
113438
+ destructive: "red"
113439
+ };
113440
+
113399
113441
  //#endregion
113400
113442
  //#region ../../packages/tui-components/src/constants.ts
113401
113443
  const UI_CONSTANTS = {
@@ -113729,7 +113771,7 @@ const ActionRowSimple = ({ indicatorColor, text, textDimColor = false }) => /* @
113729
113771
  color: indicatorColor,
113730
113772
  children: INDICATOR.BULLET
113731
113773
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
113732
- color: "white",
113774
+ color: colors.primary,
113733
113775
  dimColor: textDimColor,
113734
113776
  children: text
113735
113777
  })]
@@ -113747,11 +113789,11 @@ const ActionRow = ({ indicatorColor, label, summary, children }) => /* @__PURE__
113747
113789
  children: INDICATOR.BULLET
113748
113790
  }),
113749
113791
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
113750
- color: "white",
113792
+ color: colors.primary,
113751
113793
  children: label
113752
113794
  }),
113753
113795
  summary && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
113754
- color: "white",
113796
+ color: colors.primary,
113755
113797
  dimColor: true,
113756
113798
  children: summary
113757
113799
  })
@@ -113863,10 +113905,10 @@ const ListBrowser = ({ title, items, renderItem, onSelect, emptyMessage = "No it
113863
113905
  flexDirection: "column",
113864
113906
  children: [
113865
113907
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
113866
- color: "cyan",
113908
+ color: colors.accent,
113867
113909
  children: title
113868
113910
  }), items.length > maxItems && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
113869
- color: "gray",
113911
+ color: colors.muted,
113870
113912
  children: [
113871
113913
  " ",
113872
113914
  "(",
@@ -113877,13 +113919,13 @@ const ListBrowser = ({ title, items, renderItem, onSelect, emptyMessage = "No it
113877
113919
  ]
113878
113920
  })] }),
113879
113921
  hasMoreAbove && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
113880
- color: "gray",
113922
+ color: colors.muted,
113881
113923
  children: INDICATOR.ELLIPSIS
113882
113924
  }),
113883
113925
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
113884
113926
  flexDirection: "column",
113885
113927
  children: displayItems.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
113886
- color: "gray",
113928
+ color: colors.muted,
113887
113929
  children: emptyMessage
113888
113930
  }) : displayItems.map((item, index) => {
113889
113931
  const actualIndex = scrollOffset + index;
@@ -113891,7 +113933,7 @@ const ListBrowser = ({ title, items, renderItem, onSelect, emptyMessage = "No it
113891
113933
  })
113892
113934
  }),
113893
113935
  hasMoreBelow && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
113894
- color: "gray",
113936
+ color: colors.muted,
113895
113937
  children: INDICATOR.ELLIPSIS
113896
113938
  })
113897
113939
  ]
@@ -113914,7 +113956,7 @@ const BrowsingCheckpointsInput = ({ job, checkpoints, onCheckpointSelect, onChec
113914
113956
  return false;
113915
113957
  },
113916
113958
  renderItem: (cp, isSelected) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
113917
- color: isSelected ? "cyan" : "gray",
113959
+ color: isSelected ? colors.accent : colors.muted,
113918
113960
  children: [
113919
113961
  isSelected ? ">" : " ",
113920
113962
  " Step ",
@@ -113949,29 +113991,29 @@ const BrowsingEventDetailInput = ({ event, onBack }) => {
113949
113991
  marginLeft: 2,
113950
113992
  children: [
113951
113993
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
113952
- color: "gray",
113994
+ color: colors.muted,
113953
113995
  children: "Type: "
113954
113996
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
113955
- color: "cyan",
113997
+ color: colors.accent,
113956
113998
  children: event.type
113957
113999
  })] }),
113958
114000
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
113959
- color: "gray",
114001
+ color: colors.muted,
113960
114002
  children: "Step: "
113961
114003
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { children: event.stepNumber })] }),
113962
114004
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
113963
- color: "gray",
114005
+ color: colors.muted,
113964
114006
  children: "Timestamp: "
113965
114007
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { children: formatTimestamp(event.timestamp) })] }),
113966
114008
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
113967
- color: "gray",
114009
+ color: colors.muted,
113968
114010
  children: "ID: "
113969
114011
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
113970
114012
  dimColor: true,
113971
114013
  children: event.id
113972
114014
  })] }),
113973
114015
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
113974
- color: "gray",
114016
+ color: colors.muted,
113975
114017
  children: "Run ID: "
113976
114018
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
113977
114019
  dimColor: true,
@@ -113991,7 +114033,7 @@ const BrowsingEventsInput = ({ checkpoint, events, onEventSelect, onBack }) => /
113991
114033
  onBack,
113992
114034
  emptyMessage: "No events found",
113993
114035
  renderItem: (ev, isSelected) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
113994
- color: isSelected ? "cyan" : "gray",
114036
+ color: isSelected ? colors.accent : colors.muted,
113995
114037
  children: [
113996
114038
  isSelected ? ">" : " ",
113997
114039
  " [",
@@ -114673,17 +114715,17 @@ const useExpertSelector = (options) => {
114673
114715
  const ExpertList = ({ experts, selectedIndex, showSource = false, inline = false, maxItems }) => {
114674
114716
  const displayExperts = maxItems ? experts.slice(0, maxItems) : experts;
114675
114717
  if (displayExperts.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
114676
- color: "gray",
114718
+ color: colors.muted,
114677
114719
  children: "No experts found."
114678
114720
  });
114679
114721
  const items = displayExperts.map((expert, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
114680
- color: index === selectedIndex ? "cyan" : "gray",
114722
+ color: index === selectedIndex ? colors.accent : colors.muted,
114681
114723
  children: [
114682
114724
  index === selectedIndex ? ">" : " ",
114683
114725
  " ",
114684
114726
  showSource ? expert.key : expert.name,
114685
114727
  showSource && expert.source && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [" ", /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
114686
- color: expert.source === "configured" ? "green" : "yellow",
114728
+ color: expert.source === "configured" ? colors.success : colors.warn,
114687
114729
  children: [
114688
114730
  "[",
114689
114731
  expert.source === "configured" ? "config" : "recent",
@@ -114713,7 +114755,7 @@ const ExpertSelectorBase = ({ experts, hint, onExpertSelect, showSource = false,
114713
114755
  children: [!inputMode && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, {
114714
114756
  flexDirection: "column",
114715
114757
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
114716
- color: "cyan",
114758
+ color: colors.accent,
114717
114759
  children: hint
114718
114760
  }) }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ExpertList, {
114719
114761
  experts,
@@ -114724,15 +114766,15 @@ const ExpertSelectorBase = ({ experts, hint, onExpertSelect, showSource = false,
114724
114766
  })]
114725
114767
  }), inputMode && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, { children: [
114726
114768
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
114727
- color: "gray",
114769
+ color: colors.muted,
114728
114770
  children: "Expert: "
114729
114771
  }),
114730
114772
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
114731
- color: "white",
114773
+ color: colors.primary,
114732
114774
  children: input
114733
114775
  }),
114734
114776
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
114735
- color: "cyan",
114777
+ color: colors.accent,
114736
114778
  children: "_"
114737
114779
  })
114738
114780
  ] })]
@@ -114778,7 +114820,7 @@ const BrowsingHistoryInput = ({ jobs, onJobSelect, onJobResume, onSwitchToExpert
114778
114820
  return false;
114779
114821
  },
114780
114822
  renderItem: (job, isSelected) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
114781
- color: isSelected ? "cyan" : "gray",
114823
+ color: isSelected ? colors.accent : colors.muted,
114782
114824
  children: [
114783
114825
  isSelected ? ">" : " ",
114784
114826
  " ",
@@ -114860,12 +114902,13 @@ function renderParallelGroup(group) {
114860
114902
  });
114861
114903
  }
114862
114904
  function renderReasoning(text) {
114905
+ const lines = text.split("\n");
114863
114906
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ActionRow, {
114864
- indicatorColor: "white",
114907
+ indicatorColor: colors.primary,
114865
114908
  label: "Reasoning",
114866
114909
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
114867
114910
  flexDirection: "column",
114868
- children: text.split("\n").map((line, idx) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
114911
+ children: lines.map((line, idx) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
114869
114912
  dimColor: true,
114870
114913
  wrap: "wrap",
114871
114914
  children: line
@@ -114874,11 +114917,11 @@ function renderReasoning(text) {
114874
114917
  });
114875
114918
  }
114876
114919
  function renderAction(action) {
114877
- const color = action.type === "error" || "error" in action && action.error ? "red" : "green";
114920
+ const color = action.type === "error" || "error" in action && action.error ? colors.destructive : colors.success;
114878
114921
  switch (action.type) {
114879
114922
  case "query": return renderQuery(action.text, action.runId);
114880
114923
  case "retry": return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ActionRow, {
114881
- indicatorColor: "yellow",
114924
+ indicatorColor: colors.warn,
114882
114925
  label: "Retry",
114883
114926
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
114884
114927
  dimColor: true,
@@ -114886,22 +114929,22 @@ function renderAction(action) {
114886
114929
  })
114887
114930
  });
114888
114931
  case "complete": return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ActionRow, {
114889
- indicatorColor: "green",
114932
+ indicatorColor: colors.success,
114890
114933
  label: "Run Results",
114891
114934
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { children: action.text })
114892
114935
  });
114893
114936
  case "attemptCompletion": {
114894
114937
  if (action.error) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ActionRow, {
114895
- indicatorColor: "red",
114938
+ indicatorColor: colors.destructive,
114896
114939
  label: "Completion Failed",
114897
114940
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
114898
- color: "red",
114941
+ color: colors.destructive,
114899
114942
  children: action.error
114900
114943
  })
114901
114944
  });
114902
114945
  const remaining = action.remainingTodos?.filter((t) => !t.completed) ?? [];
114903
114946
  if (remaining.length > 0) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ActionRow, {
114904
- indicatorColor: "yellow",
114947
+ indicatorColor: colors.warn,
114905
114948
  label: "Completion Blocked",
114906
114949
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
114907
114950
  dimColor: true,
@@ -114913,7 +114956,7 @@ function renderAction(action) {
114913
114956
  })
114914
114957
  });
114915
114958
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ActionRowSimple, {
114916
- indicatorColor: "green",
114959
+ indicatorColor: colors.success,
114917
114960
  text: "Completion Accepted"
114918
114961
  });
114919
114962
  }
@@ -114945,7 +114988,7 @@ function renderAction(action) {
114945
114988
  });
114946
114989
  case "exec": return renderExec(action, color);
114947
114990
  case "delegate": return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ActionRow, {
114948
- indicatorColor: "yellow",
114991
+ indicatorColor: colors.warn,
114949
114992
  label: action.delegateExpertKey,
114950
114993
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
114951
114994
  dimColor: true,
@@ -114953,17 +114996,49 @@ function renderAction(action) {
114953
114996
  })
114954
114997
  });
114955
114998
  case "delegationComplete": return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ActionRowSimple, {
114956
- indicatorColor: "green",
114999
+ indicatorColor: colors.success,
114957
115000
  text: `Delegation Complete (${action.count} delegate${action.count > 1 ? "s" : ""} returned)`
114958
115001
  });
114959
115002
  case "interactiveTool": return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ActionRow, {
114960
- indicatorColor: "yellow",
115003
+ indicatorColor: colors.warn,
114961
115004
  label: `Interactive: ${action.toolName}`,
114962
115005
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
114963
115006
  dimColor: true,
114964
115007
  children: truncateText(JSON.stringify(action.args), UI_CONSTANTS.TRUNCATE_TEXT_MEDIUM)
114965
115008
  })
114966
115009
  });
115010
+ case "addSkill": {
115011
+ const skillColor = action.error ? colors.destructive : colors.accent;
115012
+ const toolsSummary = action.tools ? `${action.tools.length} tool${action.tools.length !== 1 ? "s" : ""}: ${action.tools.join(", ")}` : void 0;
115013
+ if (toolsSummary) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ActionRow, {
115014
+ indicatorColor: skillColor,
115015
+ label: `Add Skill ${action.name}`,
115016
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
115017
+ dimColor: true,
115018
+ children: truncateText(toolsSummary, UI_CONSTANTS.TRUNCATE_TEXT_MEDIUM)
115019
+ })
115020
+ });
115021
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ActionRowSimple, {
115022
+ indicatorColor: skillColor,
115023
+ text: `Add Skill ${action.name}`
115024
+ });
115025
+ }
115026
+ case "removeSkill": return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ActionRowSimple, {
115027
+ indicatorColor: action.error ? colors.destructive : colors.accent,
115028
+ text: `Remove Skill ${action.skillName}`
115029
+ });
115030
+ case "addDelegate": return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ActionRowSimple, {
115031
+ indicatorColor: action.error ? colors.destructive : colors.accent,
115032
+ text: `Add Delegate ${action.targetExpertKey}`
115033
+ });
115034
+ case "removeDelegate": return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ActionRowSimple, {
115035
+ indicatorColor: action.error ? colors.destructive : colors.accent,
115036
+ text: `Remove Delegate ${action.expertName}`
115037
+ });
115038
+ case "createExpert": return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ActionRowSimple, {
115039
+ indicatorColor: action.error ? colors.destructive : colors.accent,
115040
+ text: `Create Expert ${action.description ? `${action.targetKey} - ${truncateText(action.description, UI_CONSTANTS.TRUNCATE_TEXT_MEDIUM)}` : action.targetKey}`
115041
+ });
114967
115042
  case "generalTool": return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ActionRow, {
114968
115043
  indicatorColor: color,
114969
115044
  label: action.toolName,
@@ -114973,10 +115048,10 @@ function renderAction(action) {
114973
115048
  })
114974
115049
  });
114975
115050
  case "error": return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ActionRow, {
114976
- indicatorColor: "red",
115051
+ indicatorColor: colors.destructive,
114977
115052
  label: action.errorName ?? "Error",
114978
115053
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
114979
- color: "red",
115054
+ color: colors.destructive,
114980
115055
  children: action.error ?? "Unknown error"
114981
115056
  })
114982
115057
  });
@@ -115048,7 +115123,7 @@ function renderReadTextFile(action, color) {
115048
115123
  flexDirection: "row",
115049
115124
  gap: 1,
115050
115125
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
115051
- color: "white",
115126
+ color: colors.primary,
115052
115127
  dimColor: true,
115053
115128
  children: line
115054
115129
  })
@@ -115069,11 +115144,11 @@ function renderWriteTextFile(action, color) {
115069
115144
  flexDirection: "row",
115070
115145
  gap: 1,
115071
115146
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
115072
- color: "green",
115147
+ color: colors.success,
115073
115148
  dimColor: true,
115074
115149
  children: "+"
115075
115150
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
115076
- color: "white",
115151
+ color: colors.primary,
115077
115152
  dimColor: true,
115078
115153
  children: line
115079
115154
  })]
@@ -115095,11 +115170,11 @@ function renderEditTextFile(action, color) {
115095
115170
  flexDirection: "row",
115096
115171
  gap: 1,
115097
115172
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
115098
- color: "red",
115173
+ color: colors.destructive,
115099
115174
  dimColor: true,
115100
115175
  children: "-"
115101
115176
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
115102
- color: "white",
115177
+ color: colors.primary,
115103
115178
  dimColor: true,
115104
115179
  children: line
115105
115180
  })]
@@ -115107,7 +115182,7 @@ function renderEditTextFile(action, color) {
115107
115182
  flexDirection: "row",
115108
115183
  gap: 1,
115109
115184
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
115110
- color: "green",
115185
+ color: colors.success,
115111
115186
  dimColor: true,
115112
115187
  children: "+"
115113
115188
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
@@ -115144,10 +115219,11 @@ function renderExec(action, color) {
115144
115219
  }
115145
115220
  function renderQuery(text, runId) {
115146
115221
  const lines = text.split("\n");
115222
+ const shortRunId = runId.slice(0, 8);
115147
115223
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ActionRow, {
115148
- indicatorColor: "cyan",
115224
+ indicatorColor: colors.accent,
115149
115225
  label: "Query",
115150
- summary: `(${runId.slice(0, 8)})`,
115226
+ summary: `(${shortRunId})`,
115151
115227
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box, {
115152
115228
  flexDirection: "column",
115153
115229
  children: lines.map((line, idx) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
@@ -115254,15 +115330,15 @@ const InterfacePanel = ({ runtimeInfo, runStatus, streaming, onSubmit }) => {
115254
115330
  useInput(handleInput);
115255
115331
  let statusLabel;
115256
115332
  if (runStatus === "waiting") statusLabel = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
115257
- color: "cyan",
115333
+ color: colors.accent,
115258
115334
  children: "Waiting for query..."
115259
115335
  });
115260
115336
  else if (runStatus === "completed") statusLabel = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
115261
- color: "green",
115337
+ color: colors.success,
115262
115338
  children: "Completed"
115263
115339
  });
115264
115340
  else if (runStatus === "stopped") statusLabel = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
115265
- color: "yellow",
115341
+ color: colors.warn,
115266
115342
  children: "Stopped"
115267
115343
  });
115268
115344
  else if (streamingPhase === "reasoning") statusLabel = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { children: "Streaming Reasoning..." });
@@ -115274,14 +115350,14 @@ const InterfacePanel = ({ runtimeInfo, runStatus, streaming, onSubmit }) => {
115274
115350
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box, {
115275
115351
  flexDirection: "column",
115276
115352
  borderStyle: "single",
115277
- borderColor: "gray",
115353
+ borderColor: colors.muted,
115278
115354
  borderTop: true,
115279
115355
  borderBottom: false,
115280
115356
  borderLeft: false,
115281
115357
  borderRight: false,
115282
115358
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, { children: [
115283
115359
  spinner ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
115284
- color: "cyan",
115360
+ color: colors.accent,
115285
115361
  children: [spinner, " "]
115286
115362
  }) : null,
115287
115363
  statusLabel,
@@ -115302,12 +115378,12 @@ const InterfacePanel = ({ runtimeInfo, runStatus, streaming, onSubmit }) => {
115302
115378
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, { children: [usagePercent, "%"] })
115303
115379
  ] }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, { children: [
115304
115380
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
115305
- color: "gray",
115381
+ color: colors.muted,
115306
115382
  children: "> "
115307
115383
  }),
115308
115384
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { children: input }),
115309
115385
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
115310
- color: "cyan",
115386
+ color: colors.accent,
115311
115387
  children: "_"
115312
115388
  })
115313
115389
  ] })]
@@ -115864,7 +115940,7 @@ async function startHandler(expertKey, query, options, handlerOptions) {
115864
115940
  //#endregion
115865
115941
  //#region package.json
115866
115942
  var name = "create-expert";
115867
- var version = "0.0.37";
115943
+ var version = "0.0.38";
115868
115944
  var description = "Create and modify Perstack expert definitions";
115869
115945
 
115870
115946
  //#endregion