chat-recall 0.7.36 → 0.7.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/mcp.js CHANGED
@@ -3020,7 +3020,7 @@ var require_tools = __commonJS({
3020
3020
  stream.flushSync();
3021
3021
  }
3022
3022
  }
3023
- function createArgsNormalizer(defaultOptions) {
3023
+ function createArgsNormalizer(defaultOptions2) {
3024
3024
  return function normalizeArgs(instance, caller, opts = {}, stream) {
3025
3025
  if (typeof opts === "string") {
3026
3026
  stream = buildSafeSonicBoom({ dest: opts });
@@ -3046,9 +3046,9 @@ var require_tools = __commonJS({
3046
3046
  }
3047
3047
  stream = transport2({ caller, ...opts.transport, levels: customLevels });
3048
3048
  }
3049
- opts = Object.assign({}, defaultOptions, opts);
3050
- opts.serializers = Object.assign({}, defaultOptions.serializers, opts.serializers);
3051
- opts.formatters = Object.assign({}, defaultOptions.formatters, opts.formatters);
3049
+ opts = Object.assign({}, defaultOptions2, opts);
3050
+ opts.serializers = Object.assign({}, defaultOptions2.serializers, opts.serializers);
3051
+ opts.formatters = Object.assign({}, defaultOptions2.formatters, opts.formatters);
3052
3052
  if (opts.prettyPrint) {
3053
3053
  throw new Error("prettyPrint option is no longer supported, see the pino-pretty package (https://github.com/pinojs/pino-pretty)");
3054
3054
  }
@@ -4379,7 +4379,7 @@ var require_pino = __commonJS({
4379
4379
  var { pid } = process;
4380
4380
  var hostname3 = os.hostname();
4381
4381
  var defaultErrorSerializer = stdSerializers.err;
4382
- var defaultOptions = {
4382
+ var defaultOptions2 = {
4383
4383
  level: "info",
4384
4384
  levelComparison: SORTING_ORDER.ASC,
4385
4385
  levels: DEFAULT_LEVELS,
@@ -4411,7 +4411,7 @@ var require_pino = __commonJS({
4411
4411
  depthLimit: 5,
4412
4412
  edgeLimit: 100
4413
4413
  };
4414
- var normalize = createArgsNormalizer(defaultOptions);
4414
+ var normalize = createArgsNormalizer(defaultOptions2);
4415
4415
  var serializers = Object.assign(/* @__PURE__ */ Object.create(null), stdSerializers);
4416
4416
  function pino2(...args) {
4417
4417
  const instance = {};
@@ -17370,6 +17370,29 @@ var init_secret_precision = __esm({
17370
17370
  }
17371
17371
  });
17372
17372
 
17373
+ // src/walk-budget.ts
17374
+ function walkSessionLimit(env = process.env) {
17375
+ const raw = env.CHAT_RECALL_SYNC_WALK_MAX;
17376
+ if (raw === void 0 || raw.trim() === "") return DEFAULT_WALK_MAX_SESSIONS;
17377
+ const n = Number(raw);
17378
+ if (!Number.isFinite(n) || !Number.isInteger(n) || n <= 0) return DEFAULT_WALK_MAX_SESSIONS;
17379
+ return n;
17380
+ }
17381
+ function orderRefsForWalk(refs, isAcked) {
17382
+ const fresh = [];
17383
+ const acked = [];
17384
+ for (const ref of refs) (isAcked(ref.prefixedId) ? acked : fresh).push(ref);
17385
+ return [...fresh, ...acked];
17386
+ }
17387
+ var DEFAULT_WALK_MAX_SESSIONS, FULL_WALK_INTERVAL_MS;
17388
+ var init_walk_budget = __esm({
17389
+ "src/walk-budget.ts"() {
17390
+ "use strict";
17391
+ DEFAULT_WALK_MAX_SESSIONS = 2e3;
17392
+ FULL_WALK_INTERVAL_MS = 6 * 60 * 6e4;
17393
+ }
17394
+ });
17395
+
17373
17396
  // ../engine/dist/core/entity-extractor.js
17374
17397
  function looksLikeStrictTool(raw) {
17375
17398
  const t = raw.trim().toLowerCase();
@@ -29285,7 +29308,7 @@ var init_http = __esm({
29285
29308
  CLI_VERSION = JSON.parse(readFileSync44(new URL("../package.json", import.meta.url), "utf-8")).version || CLI_VERSION;
29286
29309
  } catch {
29287
29310
  try {
29288
- if (true) CLI_VERSION = "0.7.36";
29311
+ if (true) CLI_VERSION = "0.7.38";
29289
29312
  } catch {
29290
29313
  }
29291
29314
  }
@@ -29783,7 +29806,7 @@ var init_telemetry = __esm({
29783
29806
  init_sync_client();
29784
29807
  cliVersion2 = () => {
29785
29808
  try {
29786
- return true ? "0.7.36" : "dev";
29809
+ return true ? "0.7.38" : "dev";
29787
29810
  } catch {
29788
29811
  return "dev";
29789
29812
  }
@@ -30413,8 +30436,10 @@ __export(sync_client_exports, {
30413
30436
  buildConversationTail: () => buildConversationTail,
30414
30437
  classedError: () => classedError,
30415
30438
  classifyError: () => classifyError,
30439
+ countsForBreaker: () => countsForBreaker,
30416
30440
  isStandingFailure: () => isStandingFailure,
30417
30441
  isSyncSkip: () => isSyncSkip,
30442
+ lastSuccessfulWalkAt: () => lastSuccessfulWalkAt,
30418
30443
  loadAllCredentials: () => loadAllCredentials,
30419
30444
  loadCredentials: () => loadCredentials,
30420
30445
  reapStaleScanDirs: () => reapStaleScanDirs,
@@ -30449,11 +30474,15 @@ function isStandingFailure(err) {
30449
30474
  const c = taggedClass(err);
30450
30475
  return c !== null && STANDING_FAILURE.has(c);
30451
30476
  }
30477
+ function countsForBreaker(cls) {
30478
+ return cls !== "rate_limited" && cls !== "payload_too_large";
30479
+ }
30452
30480
  function classifyError(msg, err) {
30453
30481
  const tagged = taggedClass(err);
30454
30482
  if (tagged) return tagged;
30455
30483
  const m = msg.toLowerCase();
30456
30484
  if (m.includes("429")) return "rate_limited";
30485
+ if (m.includes("body_too_large") || m.includes("payload too large") || m.includes("entity too large")) return "payload_too_large";
30457
30486
  if (m.includes("402")) return "payment_required";
30458
30487
  if (m.includes("401") || m.includes("403") || m.includes("token")) return "auth";
30459
30488
  if (m.includes("timed out") || m.includes("etimedout") || m.includes("aborted due to timeout")) return "timeout";
@@ -30722,6 +30751,12 @@ async function syncSessions(opts = {}) {
30722
30751
  const msg = e instanceof Error ? e.message : String(e);
30723
30752
  errors.push(`${cred.serverUrl}: ${msg}`);
30724
30753
  perTarget[cred.serverUrl] = { ok: false, error: msg, accepted: acceptedUploads.get(cred.serverUrl) ?? 0 };
30754
+ const cls = classifyError(msg, e);
30755
+ if (!countsForBreaker(cls)) {
30756
+ console.error(`[sync] ${cred.serverUrl}: ${cls === "rate_limited" ? "asked to slow down" : "refused one oversized body"}; the target stays out of cooldown and the next walk retries`);
30757
+ record({ kind: "target_throttled", failures: 0, retryInMs: 0, errorClass: cls, local: isLocalHost(cred.serverUrl) ? 1 : 0 });
30758
+ continue;
30759
+ }
30725
30760
  const next = noteTargetFailure(cred.serverUrl, msg);
30726
30761
  const notice = breakerNotice(cred.serverUrl, next);
30727
30762
  if (notice) console.error(`[sync] ${notice}`);
@@ -30734,7 +30769,7 @@ async function syncSessions(opts = {}) {
30734
30769
  kind: next.tripped ? "breaker_trip" : "target_failure",
30735
30770
  failures: next.failures,
30736
30771
  retryInMs: next.retryInMs,
30737
- errorClass: classifyError(msg, e),
30772
+ errorClass: cls,
30738
30773
  local: isLocalHost(cred.serverUrl) ? 1 : 0
30739
30774
  });
30740
30775
  }
@@ -30759,6 +30794,11 @@ async function syncSessions(opts = {}) {
30759
30794
  rssPeakMb: Math.round(process.memoryUsage().rss / 1048576)
30760
30795
  });
30761
30796
  }
30797
+ if (agg) {
30798
+ for (const t of targets) {
30799
+ if (!errors.some((e) => e.startsWith(`${t.serverUrl}:`))) noteWalkSuccess(t.serverUrl);
30800
+ }
30801
+ }
30762
30802
  void flush().catch(() => {
30763
30803
  });
30764
30804
  if (!agg) throw new Error(`sync failed for all targets:
@@ -30767,6 +30807,32 @@ async function syncSessions(opts = {}) {
30767
30807
  ${errors.join("\n ")}`);
30768
30808
  return { ...agg, perTarget };
30769
30809
  }
30810
+ function walkStatePath() {
30811
+ return join56(getDataDir(), "walk-state.json");
30812
+ }
30813
+ function readWalkState() {
30814
+ try {
30815
+ const raw = JSON.parse(readFileSync47(walkStatePath(), "utf-8"));
30816
+ return raw && typeof raw === "object" ? raw : {};
30817
+ } catch {
30818
+ return {};
30819
+ }
30820
+ }
30821
+ function noteWalkSuccess(serverUrl) {
30822
+ try {
30823
+ const state2 = readWalkState();
30824
+ state2[serverUrl.replace(/\/+$/, "")] = Date.now();
30825
+ mkdirSync14(getDataDir(), { recursive: true });
30826
+ writeFileSync11(walkStatePath(), JSON.stringify(state2));
30827
+ } catch {
30828
+ }
30829
+ }
30830
+ function lastSuccessfulWalkAt(serverUrl) {
30831
+ const state2 = readWalkState();
30832
+ const key2 = serverUrl?.replace(/\/+$/, "");
30833
+ const stamps = key2 ? [state2[key2]] : Object.values(state2);
30834
+ return stamps.reduce((max, v) => Math.max(max, typeof v === "number" ? v : 0), 0);
30835
+ }
30770
30836
  async function postFieldBatch(base2, token, rows) {
30771
30837
  const headers2 = { "content-type": "application/json" };
30772
30838
  if (token) headers2.authorization = `Bearer ${token}`;
@@ -31296,7 +31362,9 @@ async function syncToTargetInScope(cred, opts = {}) {
31296
31362
  }
31297
31363
  };
31298
31364
  let scanMs = 0, scanned = 0;
31299
- const slice = refs.slice(0, opts.limit ?? refs.length);
31365
+ const walkMax = opts.limit ?? walkSessionLimit();
31366
+ const ordered = walkMax > 0 ? orderRefsForWalk(refs, (id) => Boolean(ledger?.get(id))) : refs;
31367
+ const slice = walkMax > 0 ? ordered.slice(0, walkMax) : ordered;
31300
31368
  const trace = process.env.CHAT_RECALL_SYNC_TRACE === "1" ? (msg) => {
31301
31369
  const m = process.memoryUsage();
31302
31370
  console.error(`[sync-trace] ${msg} \xB7 heap=${(m.heapUsed / 1048576).toFixed(0)}MB rss=${(m.rss / 1048576).toFixed(0)}MB`);
@@ -32151,6 +32219,7 @@ var init_sync_client = __esm({
32151
32219
  init_secret_precision();
32152
32220
  init_settings();
32153
32221
  init_paths();
32222
+ init_walk_budget();
32154
32223
  init_tool_backend();
32155
32224
  init_transcript();
32156
32225
  init_claude2();
@@ -32184,7 +32253,7 @@ var init_sync_client = __esm({
32184
32253
  ownVersion = JSON.parse(readFileSync47(join56(dir, "../package.json"), "utf-8")).version || ownVersion;
32185
32254
  } catch {
32186
32255
  try {
32187
- if (true) ownVersion = "0.7.36";
32256
+ if (true) ownVersion = "0.7.38";
32188
32257
  } catch {
32189
32258
  }
32190
32259
  }
@@ -35806,6 +35875,1309 @@ function isMultiTenant() {
35806
35875
  import { Server } from "@modelcontextprotocol/sdk/server/index.js";
35807
35876
  import { CallToolRequestSchema, ListToolsRequestSchema, ListResourcesRequestSchema, ListPromptsRequestSchema } from "@modelcontextprotocol/sdk/types.js";
35808
35877
  import { z } from "zod";
35878
+
35879
+ // ../../node_modules/zod-to-json-schema/dist/esm/Options.js
35880
+ var ignoreOverride = /* @__PURE__ */ Symbol("Let zodToJsonSchema decide on which parser to use");
35881
+ var defaultOptions = {
35882
+ name: void 0,
35883
+ $refStrategy: "root",
35884
+ basePath: ["#"],
35885
+ effectStrategy: "input",
35886
+ pipeStrategy: "all",
35887
+ dateStrategy: "format:date-time",
35888
+ mapStrategy: "entries",
35889
+ removeAdditionalStrategy: "passthrough",
35890
+ allowedAdditionalProperties: true,
35891
+ rejectedAdditionalProperties: false,
35892
+ definitionPath: "definitions",
35893
+ target: "jsonSchema7",
35894
+ strictUnions: false,
35895
+ definitions: {},
35896
+ errorMessages: false,
35897
+ markdownDescription: false,
35898
+ patternStrategy: "escape",
35899
+ applyRegexFlags: false,
35900
+ emailStrategy: "format:email",
35901
+ base64Strategy: "contentEncoding:base64",
35902
+ nameStrategy: "ref",
35903
+ openAiAnyTypeName: "OpenAiAnyType"
35904
+ };
35905
+ var getDefaultOptions = (options) => typeof options === "string" ? {
35906
+ ...defaultOptions,
35907
+ name: options
35908
+ } : {
35909
+ ...defaultOptions,
35910
+ ...options
35911
+ };
35912
+
35913
+ // ../../node_modules/zod-to-json-schema/dist/esm/Refs.js
35914
+ var getRefs = (options) => {
35915
+ const _options = getDefaultOptions(options);
35916
+ const currentPath = _options.name !== void 0 ? [..._options.basePath, _options.definitionPath, _options.name] : _options.basePath;
35917
+ return {
35918
+ ..._options,
35919
+ flags: { hasReferencedOpenAiAnyType: false },
35920
+ currentPath,
35921
+ propertyPath: void 0,
35922
+ seen: new Map(Object.entries(_options.definitions).map(([name, def]) => [
35923
+ def._def,
35924
+ {
35925
+ def: def._def,
35926
+ path: [..._options.basePath, _options.definitionPath, name],
35927
+ // Resolution of references will be forced even though seen, so it's ok that the schema is undefined here for now.
35928
+ jsonSchema: void 0
35929
+ }
35930
+ ]))
35931
+ };
35932
+ };
35933
+
35934
+ // ../../node_modules/zod-to-json-schema/dist/esm/errorMessages.js
35935
+ function addErrorMessage(res, key2, errorMessage, refs) {
35936
+ if (!refs?.errorMessages)
35937
+ return;
35938
+ if (errorMessage) {
35939
+ res.errorMessage = {
35940
+ ...res.errorMessage,
35941
+ [key2]: errorMessage
35942
+ };
35943
+ }
35944
+ }
35945
+ function setResponseValueAndErrors(res, key2, value, errorMessage, refs) {
35946
+ res[key2] = value;
35947
+ addErrorMessage(res, key2, errorMessage, refs);
35948
+ }
35949
+
35950
+ // ../../node_modules/zod-to-json-schema/dist/esm/getRelativePath.js
35951
+ var getRelativePath = (pathA, pathB) => {
35952
+ let i = 0;
35953
+ for (; i < pathA.length && i < pathB.length; i++) {
35954
+ if (pathA[i] !== pathB[i])
35955
+ break;
35956
+ }
35957
+ return [(pathA.length - i).toString(), ...pathB.slice(i)].join("/");
35958
+ };
35959
+
35960
+ // ../../node_modules/zod-to-json-schema/dist/esm/selectParser.js
35961
+ import { ZodFirstPartyTypeKind as ZodFirstPartyTypeKind3 } from "zod/v3";
35962
+
35963
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/any.js
35964
+ function parseAnyDef(refs) {
35965
+ if (refs.target !== "openAi") {
35966
+ return {};
35967
+ }
35968
+ const anyDefinitionPath = [
35969
+ ...refs.basePath,
35970
+ refs.definitionPath,
35971
+ refs.openAiAnyTypeName
35972
+ ];
35973
+ refs.flags.hasReferencedOpenAiAnyType = true;
35974
+ return {
35975
+ $ref: refs.$refStrategy === "relative" ? getRelativePath(anyDefinitionPath, refs.currentPath) : anyDefinitionPath.join("/")
35976
+ };
35977
+ }
35978
+
35979
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/array.js
35980
+ import { ZodFirstPartyTypeKind } from "zod/v3";
35981
+ function parseArrayDef(def, refs) {
35982
+ const res = {
35983
+ type: "array"
35984
+ };
35985
+ if (def.type?._def && def.type?._def?.typeName !== ZodFirstPartyTypeKind.ZodAny) {
35986
+ res.items = parseDef(def.type._def, {
35987
+ ...refs,
35988
+ currentPath: [...refs.currentPath, "items"]
35989
+ });
35990
+ }
35991
+ if (def.minLength) {
35992
+ setResponseValueAndErrors(res, "minItems", def.minLength.value, def.minLength.message, refs);
35993
+ }
35994
+ if (def.maxLength) {
35995
+ setResponseValueAndErrors(res, "maxItems", def.maxLength.value, def.maxLength.message, refs);
35996
+ }
35997
+ if (def.exactLength) {
35998
+ setResponseValueAndErrors(res, "minItems", def.exactLength.value, def.exactLength.message, refs);
35999
+ setResponseValueAndErrors(res, "maxItems", def.exactLength.value, def.exactLength.message, refs);
36000
+ }
36001
+ return res;
36002
+ }
36003
+
36004
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js
36005
+ function parseBigintDef(def, refs) {
36006
+ const res = {
36007
+ type: "integer",
36008
+ format: "int64"
36009
+ };
36010
+ if (!def.checks)
36011
+ return res;
36012
+ for (const check of def.checks) {
36013
+ switch (check.kind) {
36014
+ case "min":
36015
+ if (refs.target === "jsonSchema7") {
36016
+ if (check.inclusive) {
36017
+ setResponseValueAndErrors(res, "minimum", check.value, check.message, refs);
36018
+ } else {
36019
+ setResponseValueAndErrors(res, "exclusiveMinimum", check.value, check.message, refs);
36020
+ }
36021
+ } else {
36022
+ if (!check.inclusive) {
36023
+ res.exclusiveMinimum = true;
36024
+ }
36025
+ setResponseValueAndErrors(res, "minimum", check.value, check.message, refs);
36026
+ }
36027
+ break;
36028
+ case "max":
36029
+ if (refs.target === "jsonSchema7") {
36030
+ if (check.inclusive) {
36031
+ setResponseValueAndErrors(res, "maximum", check.value, check.message, refs);
36032
+ } else {
36033
+ setResponseValueAndErrors(res, "exclusiveMaximum", check.value, check.message, refs);
36034
+ }
36035
+ } else {
36036
+ if (!check.inclusive) {
36037
+ res.exclusiveMaximum = true;
36038
+ }
36039
+ setResponseValueAndErrors(res, "maximum", check.value, check.message, refs);
36040
+ }
36041
+ break;
36042
+ case "multipleOf":
36043
+ setResponseValueAndErrors(res, "multipleOf", check.value, check.message, refs);
36044
+ break;
36045
+ }
36046
+ }
36047
+ return res;
36048
+ }
36049
+
36050
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js
36051
+ function parseBooleanDef() {
36052
+ return {
36053
+ type: "boolean"
36054
+ };
36055
+ }
36056
+
36057
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/branded.js
36058
+ function parseBrandedDef(_def, refs) {
36059
+ return parseDef(_def.type._def, refs);
36060
+ }
36061
+
36062
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/catch.js
36063
+ var parseCatchDef = (def, refs) => {
36064
+ return parseDef(def.innerType._def, refs);
36065
+ };
36066
+
36067
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/date.js
36068
+ function parseDateDef(def, refs, overrideDateStrategy) {
36069
+ const strategy = overrideDateStrategy ?? refs.dateStrategy;
36070
+ if (Array.isArray(strategy)) {
36071
+ return {
36072
+ anyOf: strategy.map((item, i) => parseDateDef(def, refs, item))
36073
+ };
36074
+ }
36075
+ switch (strategy) {
36076
+ case "string":
36077
+ case "format:date-time":
36078
+ return {
36079
+ type: "string",
36080
+ format: "date-time"
36081
+ };
36082
+ case "format:date":
36083
+ return {
36084
+ type: "string",
36085
+ format: "date"
36086
+ };
36087
+ case "integer":
36088
+ return integerDateParser(def, refs);
36089
+ }
36090
+ }
36091
+ var integerDateParser = (def, refs) => {
36092
+ const res = {
36093
+ type: "integer",
36094
+ format: "unix-time"
36095
+ };
36096
+ if (refs.target === "openApi3") {
36097
+ return res;
36098
+ }
36099
+ for (const check of def.checks) {
36100
+ switch (check.kind) {
36101
+ case "min":
36102
+ setResponseValueAndErrors(
36103
+ res,
36104
+ "minimum",
36105
+ check.value,
36106
+ // This is in milliseconds
36107
+ check.message,
36108
+ refs
36109
+ );
36110
+ break;
36111
+ case "max":
36112
+ setResponseValueAndErrors(
36113
+ res,
36114
+ "maximum",
36115
+ check.value,
36116
+ // This is in milliseconds
36117
+ check.message,
36118
+ refs
36119
+ );
36120
+ break;
36121
+ }
36122
+ }
36123
+ return res;
36124
+ };
36125
+
36126
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/default.js
36127
+ function parseDefaultDef(_def, refs) {
36128
+ return {
36129
+ ...parseDef(_def.innerType._def, refs),
36130
+ default: _def.defaultValue()
36131
+ };
36132
+ }
36133
+
36134
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/effects.js
36135
+ function parseEffectsDef(_def, refs) {
36136
+ return refs.effectStrategy === "input" ? parseDef(_def.schema._def, refs) : parseAnyDef(refs);
36137
+ }
36138
+
36139
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/enum.js
36140
+ function parseEnumDef(def) {
36141
+ return {
36142
+ type: "string",
36143
+ enum: Array.from(def.values)
36144
+ };
36145
+ }
36146
+
36147
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js
36148
+ var isJsonSchema7AllOfType = (type) => {
36149
+ if ("type" in type && type.type === "string")
36150
+ return false;
36151
+ return "allOf" in type;
36152
+ };
36153
+ function parseIntersectionDef(def, refs) {
36154
+ const allOf = [
36155
+ parseDef(def.left._def, {
36156
+ ...refs,
36157
+ currentPath: [...refs.currentPath, "allOf", "0"]
36158
+ }),
36159
+ parseDef(def.right._def, {
36160
+ ...refs,
36161
+ currentPath: [...refs.currentPath, "allOf", "1"]
36162
+ })
36163
+ ].filter((x) => !!x);
36164
+ let unevaluatedProperties = refs.target === "jsonSchema2019-09" ? { unevaluatedProperties: false } : void 0;
36165
+ const mergedAllOf = [];
36166
+ allOf.forEach((schema) => {
36167
+ if (isJsonSchema7AllOfType(schema)) {
36168
+ mergedAllOf.push(...schema.allOf);
36169
+ if (schema.unevaluatedProperties === void 0) {
36170
+ unevaluatedProperties = void 0;
36171
+ }
36172
+ } else {
36173
+ let nestedSchema = schema;
36174
+ if ("additionalProperties" in schema && schema.additionalProperties === false) {
36175
+ const { additionalProperties, ...rest } = schema;
36176
+ nestedSchema = rest;
36177
+ } else {
36178
+ unevaluatedProperties = void 0;
36179
+ }
36180
+ mergedAllOf.push(nestedSchema);
36181
+ }
36182
+ });
36183
+ return mergedAllOf.length ? {
36184
+ allOf: mergedAllOf,
36185
+ ...unevaluatedProperties
36186
+ } : void 0;
36187
+ }
36188
+
36189
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/literal.js
36190
+ function parseLiteralDef(def, refs) {
36191
+ const parsedType = typeof def.value;
36192
+ if (parsedType !== "bigint" && parsedType !== "number" && parsedType !== "boolean" && parsedType !== "string") {
36193
+ return {
36194
+ type: Array.isArray(def.value) ? "array" : "object"
36195
+ };
36196
+ }
36197
+ if (refs.target === "openApi3") {
36198
+ return {
36199
+ type: parsedType === "bigint" ? "integer" : parsedType,
36200
+ enum: [def.value]
36201
+ };
36202
+ }
36203
+ return {
36204
+ type: parsedType === "bigint" ? "integer" : parsedType,
36205
+ const: def.value
36206
+ };
36207
+ }
36208
+
36209
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/record.js
36210
+ import { ZodFirstPartyTypeKind as ZodFirstPartyTypeKind2 } from "zod/v3";
36211
+
36212
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/string.js
36213
+ var emojiRegex = void 0;
36214
+ var zodPatterns = {
36215
+ /**
36216
+ * `c` was changed to `[cC]` to replicate /i flag
36217
+ */
36218
+ cuid: /^[cC][^\s-]{8,}$/,
36219
+ cuid2: /^[0-9a-z]+$/,
36220
+ ulid: /^[0-9A-HJKMNP-TV-Z]{26}$/,
36221
+ /**
36222
+ * `a-z` was added to replicate /i flag
36223
+ */
36224
+ email: /^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,
36225
+ /**
36226
+ * Constructed a valid Unicode RegExp
36227
+ *
36228
+ * Lazily instantiate since this type of regex isn't supported
36229
+ * in all envs (e.g. React Native).
36230
+ *
36231
+ * See:
36232
+ * https://github.com/colinhacks/zod/issues/2433
36233
+ * Fix in Zod:
36234
+ * https://github.com/colinhacks/zod/commit/9340fd51e48576a75adc919bff65dbc4a5d4c99b
36235
+ */
36236
+ emoji: () => {
36237
+ if (emojiRegex === void 0) {
36238
+ emojiRegex = RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", "u");
36239
+ }
36240
+ return emojiRegex;
36241
+ },
36242
+ /**
36243
+ * Unused
36244
+ */
36245
+ uuid: /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,
36246
+ /**
36247
+ * Unused
36248
+ */
36249
+ ipv4: /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,
36250
+ ipv4Cidr: /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,
36251
+ /**
36252
+ * Unused
36253
+ */
36254
+ ipv6: /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,
36255
+ ipv6Cidr: /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,
36256
+ base64: /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,
36257
+ base64url: /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,
36258
+ nanoid: /^[a-zA-Z0-9_-]{21}$/,
36259
+ jwt: /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/
36260
+ };
36261
+ function parseStringDef(def, refs) {
36262
+ const res = {
36263
+ type: "string"
36264
+ };
36265
+ if (def.checks) {
36266
+ for (const check of def.checks) {
36267
+ switch (check.kind) {
36268
+ case "min":
36269
+ setResponseValueAndErrors(res, "minLength", typeof res.minLength === "number" ? Math.max(res.minLength, check.value) : check.value, check.message, refs);
36270
+ break;
36271
+ case "max":
36272
+ setResponseValueAndErrors(res, "maxLength", typeof res.maxLength === "number" ? Math.min(res.maxLength, check.value) : check.value, check.message, refs);
36273
+ break;
36274
+ case "email":
36275
+ switch (refs.emailStrategy) {
36276
+ case "format:email":
36277
+ addFormat(res, "email", check.message, refs);
36278
+ break;
36279
+ case "format:idn-email":
36280
+ addFormat(res, "idn-email", check.message, refs);
36281
+ break;
36282
+ case "pattern:zod":
36283
+ addPattern(res, zodPatterns.email, check.message, refs);
36284
+ break;
36285
+ }
36286
+ break;
36287
+ case "url":
36288
+ addFormat(res, "uri", check.message, refs);
36289
+ break;
36290
+ case "uuid":
36291
+ addFormat(res, "uuid", check.message, refs);
36292
+ break;
36293
+ case "regex":
36294
+ addPattern(res, check.regex, check.message, refs);
36295
+ break;
36296
+ case "cuid":
36297
+ addPattern(res, zodPatterns.cuid, check.message, refs);
36298
+ break;
36299
+ case "cuid2":
36300
+ addPattern(res, zodPatterns.cuid2, check.message, refs);
36301
+ break;
36302
+ case "startsWith":
36303
+ addPattern(res, RegExp(`^${escapeLiteralCheckValue(check.value, refs)}`), check.message, refs);
36304
+ break;
36305
+ case "endsWith":
36306
+ addPattern(res, RegExp(`${escapeLiteralCheckValue(check.value, refs)}$`), check.message, refs);
36307
+ break;
36308
+ case "datetime":
36309
+ addFormat(res, "date-time", check.message, refs);
36310
+ break;
36311
+ case "date":
36312
+ addFormat(res, "date", check.message, refs);
36313
+ break;
36314
+ case "time":
36315
+ addFormat(res, "time", check.message, refs);
36316
+ break;
36317
+ case "duration":
36318
+ addFormat(res, "duration", check.message, refs);
36319
+ break;
36320
+ case "length":
36321
+ setResponseValueAndErrors(res, "minLength", typeof res.minLength === "number" ? Math.max(res.minLength, check.value) : check.value, check.message, refs);
36322
+ setResponseValueAndErrors(res, "maxLength", typeof res.maxLength === "number" ? Math.min(res.maxLength, check.value) : check.value, check.message, refs);
36323
+ break;
36324
+ case "includes": {
36325
+ addPattern(res, RegExp(escapeLiteralCheckValue(check.value, refs)), check.message, refs);
36326
+ break;
36327
+ }
36328
+ case "ip": {
36329
+ if (check.version !== "v6") {
36330
+ addFormat(res, "ipv4", check.message, refs);
36331
+ }
36332
+ if (check.version !== "v4") {
36333
+ addFormat(res, "ipv6", check.message, refs);
36334
+ }
36335
+ break;
36336
+ }
36337
+ case "base64url":
36338
+ addPattern(res, zodPatterns.base64url, check.message, refs);
36339
+ break;
36340
+ case "jwt":
36341
+ addPattern(res, zodPatterns.jwt, check.message, refs);
36342
+ break;
36343
+ case "cidr": {
36344
+ if (check.version !== "v6") {
36345
+ addPattern(res, zodPatterns.ipv4Cidr, check.message, refs);
36346
+ }
36347
+ if (check.version !== "v4") {
36348
+ addPattern(res, zodPatterns.ipv6Cidr, check.message, refs);
36349
+ }
36350
+ break;
36351
+ }
36352
+ case "emoji":
36353
+ addPattern(res, zodPatterns.emoji(), check.message, refs);
36354
+ break;
36355
+ case "ulid": {
36356
+ addPattern(res, zodPatterns.ulid, check.message, refs);
36357
+ break;
36358
+ }
36359
+ case "base64": {
36360
+ switch (refs.base64Strategy) {
36361
+ case "format:binary": {
36362
+ addFormat(res, "binary", check.message, refs);
36363
+ break;
36364
+ }
36365
+ case "contentEncoding:base64": {
36366
+ setResponseValueAndErrors(res, "contentEncoding", "base64", check.message, refs);
36367
+ break;
36368
+ }
36369
+ case "pattern:zod": {
36370
+ addPattern(res, zodPatterns.base64, check.message, refs);
36371
+ break;
36372
+ }
36373
+ }
36374
+ break;
36375
+ }
36376
+ case "nanoid": {
36377
+ addPattern(res, zodPatterns.nanoid, check.message, refs);
36378
+ }
36379
+ case "toLowerCase":
36380
+ case "toUpperCase":
36381
+ case "trim":
36382
+ break;
36383
+ default:
36384
+ /* @__PURE__ */ ((_) => {
36385
+ })(check);
36386
+ }
36387
+ }
36388
+ }
36389
+ return res;
36390
+ }
36391
+ function escapeLiteralCheckValue(literal, refs) {
36392
+ return refs.patternStrategy === "escape" ? escapeNonAlphaNumeric(literal) : literal;
36393
+ }
36394
+ var ALPHA_NUMERIC = new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");
36395
+ function escapeNonAlphaNumeric(source) {
36396
+ let result = "";
36397
+ for (let i = 0; i < source.length; i++) {
36398
+ if (!ALPHA_NUMERIC.has(source[i])) {
36399
+ result += "\\";
36400
+ }
36401
+ result += source[i];
36402
+ }
36403
+ return result;
36404
+ }
36405
+ function addFormat(schema, value, message, refs) {
36406
+ if (schema.format || schema.anyOf?.some((x) => x.format)) {
36407
+ if (!schema.anyOf) {
36408
+ schema.anyOf = [];
36409
+ }
36410
+ if (schema.format) {
36411
+ schema.anyOf.push({
36412
+ format: schema.format,
36413
+ ...schema.errorMessage && refs.errorMessages && {
36414
+ errorMessage: { format: schema.errorMessage.format }
36415
+ }
36416
+ });
36417
+ delete schema.format;
36418
+ if (schema.errorMessage) {
36419
+ delete schema.errorMessage.format;
36420
+ if (Object.keys(schema.errorMessage).length === 0) {
36421
+ delete schema.errorMessage;
36422
+ }
36423
+ }
36424
+ }
36425
+ schema.anyOf.push({
36426
+ format: value,
36427
+ ...message && refs.errorMessages && { errorMessage: { format: message } }
36428
+ });
36429
+ } else {
36430
+ setResponseValueAndErrors(schema, "format", value, message, refs);
36431
+ }
36432
+ }
36433
+ function addPattern(schema, regex, message, refs) {
36434
+ if (schema.pattern || schema.allOf?.some((x) => x.pattern)) {
36435
+ if (!schema.allOf) {
36436
+ schema.allOf = [];
36437
+ }
36438
+ if (schema.pattern) {
36439
+ schema.allOf.push({
36440
+ pattern: schema.pattern,
36441
+ ...schema.errorMessage && refs.errorMessages && {
36442
+ errorMessage: { pattern: schema.errorMessage.pattern }
36443
+ }
36444
+ });
36445
+ delete schema.pattern;
36446
+ if (schema.errorMessage) {
36447
+ delete schema.errorMessage.pattern;
36448
+ if (Object.keys(schema.errorMessage).length === 0) {
36449
+ delete schema.errorMessage;
36450
+ }
36451
+ }
36452
+ }
36453
+ schema.allOf.push({
36454
+ pattern: stringifyRegExpWithFlags(regex, refs),
36455
+ ...message && refs.errorMessages && { errorMessage: { pattern: message } }
36456
+ });
36457
+ } else {
36458
+ setResponseValueAndErrors(schema, "pattern", stringifyRegExpWithFlags(regex, refs), message, refs);
36459
+ }
36460
+ }
36461
+ function stringifyRegExpWithFlags(regex, refs) {
36462
+ if (!refs.applyRegexFlags || !regex.flags) {
36463
+ return regex.source;
36464
+ }
36465
+ const flags = {
36466
+ i: regex.flags.includes("i"),
36467
+ m: regex.flags.includes("m"),
36468
+ s: regex.flags.includes("s")
36469
+ // `.` matches newlines
36470
+ };
36471
+ const source = flags.i ? regex.source.toLowerCase() : regex.source;
36472
+ let pattern = "";
36473
+ let isEscaped = false;
36474
+ let inCharGroup = false;
36475
+ let inCharRange = false;
36476
+ for (let i = 0; i < source.length; i++) {
36477
+ if (isEscaped) {
36478
+ pattern += source[i];
36479
+ isEscaped = false;
36480
+ continue;
36481
+ }
36482
+ if (flags.i) {
36483
+ if (inCharGroup) {
36484
+ if (source[i].match(/[a-z]/)) {
36485
+ if (inCharRange) {
36486
+ pattern += source[i];
36487
+ pattern += `${source[i - 2]}-${source[i]}`.toUpperCase();
36488
+ inCharRange = false;
36489
+ } else if (source[i + 1] === "-" && source[i + 2]?.match(/[a-z]/)) {
36490
+ pattern += source[i];
36491
+ inCharRange = true;
36492
+ } else {
36493
+ pattern += `${source[i]}${source[i].toUpperCase()}`;
36494
+ }
36495
+ continue;
36496
+ }
36497
+ } else if (source[i].match(/[a-z]/)) {
36498
+ pattern += `[${source[i]}${source[i].toUpperCase()}]`;
36499
+ continue;
36500
+ }
36501
+ }
36502
+ if (flags.m) {
36503
+ if (source[i] === "^") {
36504
+ pattern += `(^|(?<=[\r
36505
+ ]))`;
36506
+ continue;
36507
+ } else if (source[i] === "$") {
36508
+ pattern += `($|(?=[\r
36509
+ ]))`;
36510
+ continue;
36511
+ }
36512
+ }
36513
+ if (flags.s && source[i] === ".") {
36514
+ pattern += inCharGroup ? `${source[i]}\r
36515
+ ` : `[${source[i]}\r
36516
+ ]`;
36517
+ continue;
36518
+ }
36519
+ pattern += source[i];
36520
+ if (source[i] === "\\") {
36521
+ isEscaped = true;
36522
+ } else if (inCharGroup && source[i] === "]") {
36523
+ inCharGroup = false;
36524
+ } else if (!inCharGroup && source[i] === "[") {
36525
+ inCharGroup = true;
36526
+ }
36527
+ }
36528
+ try {
36529
+ new RegExp(pattern);
36530
+ } catch {
36531
+ console.warn(`Could not convert regex pattern at ${refs.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`);
36532
+ return regex.source;
36533
+ }
36534
+ return pattern;
36535
+ }
36536
+
36537
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/record.js
36538
+ function parseRecordDef(def, refs) {
36539
+ if (refs.target === "openAi") {
36540
+ console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead.");
36541
+ }
36542
+ if (refs.target === "openApi3" && def.keyType?._def.typeName === ZodFirstPartyTypeKind2.ZodEnum) {
36543
+ return {
36544
+ type: "object",
36545
+ required: def.keyType._def.values,
36546
+ properties: def.keyType._def.values.reduce((acc, key2) => ({
36547
+ ...acc,
36548
+ [key2]: parseDef(def.valueType._def, {
36549
+ ...refs,
36550
+ currentPath: [...refs.currentPath, "properties", key2]
36551
+ }) ?? parseAnyDef(refs)
36552
+ }), {}),
36553
+ additionalProperties: refs.rejectedAdditionalProperties
36554
+ };
36555
+ }
36556
+ const schema = {
36557
+ type: "object",
36558
+ additionalProperties: parseDef(def.valueType._def, {
36559
+ ...refs,
36560
+ currentPath: [...refs.currentPath, "additionalProperties"]
36561
+ }) ?? refs.allowedAdditionalProperties
36562
+ };
36563
+ if (refs.target === "openApi3") {
36564
+ return schema;
36565
+ }
36566
+ if (def.keyType?._def.typeName === ZodFirstPartyTypeKind2.ZodString && def.keyType._def.checks?.length) {
36567
+ const { type, ...keyType } = parseStringDef(def.keyType._def, refs);
36568
+ return {
36569
+ ...schema,
36570
+ propertyNames: keyType
36571
+ };
36572
+ } else if (def.keyType?._def.typeName === ZodFirstPartyTypeKind2.ZodEnum) {
36573
+ return {
36574
+ ...schema,
36575
+ propertyNames: {
36576
+ enum: def.keyType._def.values
36577
+ }
36578
+ };
36579
+ } else if (def.keyType?._def.typeName === ZodFirstPartyTypeKind2.ZodBranded && def.keyType._def.type._def.typeName === ZodFirstPartyTypeKind2.ZodString && def.keyType._def.type._def.checks?.length) {
36580
+ const { type, ...keyType } = parseBrandedDef(def.keyType._def, refs);
36581
+ return {
36582
+ ...schema,
36583
+ propertyNames: keyType
36584
+ };
36585
+ }
36586
+ return schema;
36587
+ }
36588
+
36589
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/map.js
36590
+ function parseMapDef(def, refs) {
36591
+ if (refs.mapStrategy === "record") {
36592
+ return parseRecordDef(def, refs);
36593
+ }
36594
+ const keys = parseDef(def.keyType._def, {
36595
+ ...refs,
36596
+ currentPath: [...refs.currentPath, "items", "items", "0"]
36597
+ }) || parseAnyDef(refs);
36598
+ const values = parseDef(def.valueType._def, {
36599
+ ...refs,
36600
+ currentPath: [...refs.currentPath, "items", "items", "1"]
36601
+ }) || parseAnyDef(refs);
36602
+ return {
36603
+ type: "array",
36604
+ maxItems: 125,
36605
+ items: {
36606
+ type: "array",
36607
+ items: [keys, values],
36608
+ minItems: 2,
36609
+ maxItems: 2
36610
+ }
36611
+ };
36612
+ }
36613
+
36614
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js
36615
+ function parseNativeEnumDef(def) {
36616
+ const object = def.values;
36617
+ const actualKeys = Object.keys(def.values).filter((key2) => {
36618
+ return typeof object[object[key2]] !== "number";
36619
+ });
36620
+ const actualValues = actualKeys.map((key2) => object[key2]);
36621
+ const parsedTypes = Array.from(new Set(actualValues.map((values) => typeof values)));
36622
+ return {
36623
+ type: parsedTypes.length === 1 ? parsedTypes[0] === "string" ? "string" : "number" : ["string", "number"],
36624
+ enum: actualValues
36625
+ };
36626
+ }
36627
+
36628
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/never.js
36629
+ function parseNeverDef(refs) {
36630
+ return refs.target === "openAi" ? void 0 : {
36631
+ not: parseAnyDef({
36632
+ ...refs,
36633
+ currentPath: [...refs.currentPath, "not"]
36634
+ })
36635
+ };
36636
+ }
36637
+
36638
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/null.js
36639
+ function parseNullDef(refs) {
36640
+ return refs.target === "openApi3" ? {
36641
+ enum: ["null"],
36642
+ nullable: true
36643
+ } : {
36644
+ type: "null"
36645
+ };
36646
+ }
36647
+
36648
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/union.js
36649
+ var primitiveMappings = {
36650
+ ZodString: "string",
36651
+ ZodNumber: "number",
36652
+ ZodBigInt: "integer",
36653
+ ZodBoolean: "boolean",
36654
+ ZodNull: "null"
36655
+ };
36656
+ function parseUnionDef(def, refs) {
36657
+ if (refs.target === "openApi3")
36658
+ return asAnyOf(def, refs);
36659
+ const options = def.options instanceof Map ? Array.from(def.options.values()) : def.options;
36660
+ if (options.every((x) => x._def.typeName in primitiveMappings && (!x._def.checks || !x._def.checks.length))) {
36661
+ const types = options.reduce((types2, x) => {
36662
+ const type = primitiveMappings[x._def.typeName];
36663
+ return type && !types2.includes(type) ? [...types2, type] : types2;
36664
+ }, []);
36665
+ return {
36666
+ type: types.length > 1 ? types : types[0]
36667
+ };
36668
+ } else if (options.every((x) => x._def.typeName === "ZodLiteral" && !x.description)) {
36669
+ const types = options.reduce((acc, x) => {
36670
+ const type = typeof x._def.value;
36671
+ switch (type) {
36672
+ case "string":
36673
+ case "number":
36674
+ case "boolean":
36675
+ return [...acc, type];
36676
+ case "bigint":
36677
+ return [...acc, "integer"];
36678
+ case "object":
36679
+ if (x._def.value === null)
36680
+ return [...acc, "null"];
36681
+ case "symbol":
36682
+ case "undefined":
36683
+ case "function":
36684
+ default:
36685
+ return acc;
36686
+ }
36687
+ }, []);
36688
+ if (types.length === options.length) {
36689
+ const uniqueTypes = types.filter((x, i, a) => a.indexOf(x) === i);
36690
+ return {
36691
+ type: uniqueTypes.length > 1 ? uniqueTypes : uniqueTypes[0],
36692
+ enum: options.reduce((acc, x) => {
36693
+ return acc.includes(x._def.value) ? acc : [...acc, x._def.value];
36694
+ }, [])
36695
+ };
36696
+ }
36697
+ } else if (options.every((x) => x._def.typeName === "ZodEnum")) {
36698
+ return {
36699
+ type: "string",
36700
+ enum: options.reduce((acc, x) => [
36701
+ ...acc,
36702
+ ...x._def.values.filter((x2) => !acc.includes(x2))
36703
+ ], [])
36704
+ };
36705
+ }
36706
+ return asAnyOf(def, refs);
36707
+ }
36708
+ var asAnyOf = (def, refs) => {
36709
+ const anyOf = (def.options instanceof Map ? Array.from(def.options.values()) : def.options).map((x, i) => parseDef(x._def, {
36710
+ ...refs,
36711
+ currentPath: [...refs.currentPath, "anyOf", `${i}`]
36712
+ })).filter((x) => !!x && (!refs.strictUnions || typeof x === "object" && Object.keys(x).length > 0));
36713
+ return anyOf.length ? { anyOf } : void 0;
36714
+ };
36715
+
36716
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js
36717
+ function parseNullableDef(def, refs) {
36718
+ if (["ZodString", "ZodNumber", "ZodBigInt", "ZodBoolean", "ZodNull"].includes(def.innerType._def.typeName) && (!def.innerType._def.checks || !def.innerType._def.checks.length)) {
36719
+ if (refs.target === "openApi3") {
36720
+ return {
36721
+ type: primitiveMappings[def.innerType._def.typeName],
36722
+ nullable: true
36723
+ };
36724
+ }
36725
+ return {
36726
+ type: [
36727
+ primitiveMappings[def.innerType._def.typeName],
36728
+ "null"
36729
+ ]
36730
+ };
36731
+ }
36732
+ if (refs.target === "openApi3") {
36733
+ const base3 = parseDef(def.innerType._def, {
36734
+ ...refs,
36735
+ currentPath: [...refs.currentPath]
36736
+ });
36737
+ if (base3 && "$ref" in base3)
36738
+ return { allOf: [base3], nullable: true };
36739
+ return base3 && { ...base3, nullable: true };
36740
+ }
36741
+ const base2 = parseDef(def.innerType._def, {
36742
+ ...refs,
36743
+ currentPath: [...refs.currentPath, "anyOf", "0"]
36744
+ });
36745
+ return base2 && { anyOf: [base2, { type: "null" }] };
36746
+ }
36747
+
36748
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/number.js
36749
+ function parseNumberDef(def, refs) {
36750
+ const res = {
36751
+ type: "number"
36752
+ };
36753
+ if (!def.checks)
36754
+ return res;
36755
+ for (const check of def.checks) {
36756
+ switch (check.kind) {
36757
+ case "int":
36758
+ res.type = "integer";
36759
+ addErrorMessage(res, "type", check.message, refs);
36760
+ break;
36761
+ case "min":
36762
+ if (refs.target === "jsonSchema7") {
36763
+ if (check.inclusive) {
36764
+ setResponseValueAndErrors(res, "minimum", check.value, check.message, refs);
36765
+ } else {
36766
+ setResponseValueAndErrors(res, "exclusiveMinimum", check.value, check.message, refs);
36767
+ }
36768
+ } else {
36769
+ if (!check.inclusive) {
36770
+ res.exclusiveMinimum = true;
36771
+ }
36772
+ setResponseValueAndErrors(res, "minimum", check.value, check.message, refs);
36773
+ }
36774
+ break;
36775
+ case "max":
36776
+ if (refs.target === "jsonSchema7") {
36777
+ if (check.inclusive) {
36778
+ setResponseValueAndErrors(res, "maximum", check.value, check.message, refs);
36779
+ } else {
36780
+ setResponseValueAndErrors(res, "exclusiveMaximum", check.value, check.message, refs);
36781
+ }
36782
+ } else {
36783
+ if (!check.inclusive) {
36784
+ res.exclusiveMaximum = true;
36785
+ }
36786
+ setResponseValueAndErrors(res, "maximum", check.value, check.message, refs);
36787
+ }
36788
+ break;
36789
+ case "multipleOf":
36790
+ setResponseValueAndErrors(res, "multipleOf", check.value, check.message, refs);
36791
+ break;
36792
+ }
36793
+ }
36794
+ return res;
36795
+ }
36796
+
36797
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/object.js
36798
+ function parseObjectDef(def, refs) {
36799
+ const forceOptionalIntoNullable = refs.target === "openAi";
36800
+ const result = {
36801
+ type: "object",
36802
+ properties: {}
36803
+ };
36804
+ const required = [];
36805
+ const shape = def.shape();
36806
+ for (const propName in shape) {
36807
+ let propDef = shape[propName];
36808
+ if (propDef === void 0 || propDef._def === void 0) {
36809
+ continue;
36810
+ }
36811
+ let propOptional = safeIsOptional(propDef);
36812
+ if (propOptional && forceOptionalIntoNullable) {
36813
+ if (propDef._def.typeName === "ZodOptional") {
36814
+ propDef = propDef._def.innerType;
36815
+ }
36816
+ if (!propDef.isNullable()) {
36817
+ propDef = propDef.nullable();
36818
+ }
36819
+ propOptional = false;
36820
+ }
36821
+ const parsedDef = parseDef(propDef._def, {
36822
+ ...refs,
36823
+ currentPath: [...refs.currentPath, "properties", propName],
36824
+ propertyPath: [...refs.currentPath, "properties", propName]
36825
+ });
36826
+ if (parsedDef === void 0) {
36827
+ continue;
36828
+ }
36829
+ result.properties[propName] = parsedDef;
36830
+ if (!propOptional) {
36831
+ required.push(propName);
36832
+ }
36833
+ }
36834
+ if (required.length) {
36835
+ result.required = required;
36836
+ }
36837
+ const additionalProperties = decideAdditionalProperties(def, refs);
36838
+ if (additionalProperties !== void 0) {
36839
+ result.additionalProperties = additionalProperties;
36840
+ }
36841
+ return result;
36842
+ }
36843
+ function decideAdditionalProperties(def, refs) {
36844
+ if (def.catchall._def.typeName !== "ZodNever") {
36845
+ return parseDef(def.catchall._def, {
36846
+ ...refs,
36847
+ currentPath: [...refs.currentPath, "additionalProperties"]
36848
+ });
36849
+ }
36850
+ switch (def.unknownKeys) {
36851
+ case "passthrough":
36852
+ return refs.allowedAdditionalProperties;
36853
+ case "strict":
36854
+ return refs.rejectedAdditionalProperties;
36855
+ case "strip":
36856
+ return refs.removeAdditionalStrategy === "strict" ? refs.allowedAdditionalProperties : refs.rejectedAdditionalProperties;
36857
+ }
36858
+ }
36859
+ function safeIsOptional(schema) {
36860
+ try {
36861
+ return schema.isOptional();
36862
+ } catch {
36863
+ return true;
36864
+ }
36865
+ }
36866
+
36867
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/optional.js
36868
+ var parseOptionalDef = (def, refs) => {
36869
+ if (refs.currentPath.toString() === refs.propertyPath?.toString()) {
36870
+ return parseDef(def.innerType._def, refs);
36871
+ }
36872
+ const innerSchema = parseDef(def.innerType._def, {
36873
+ ...refs,
36874
+ currentPath: [...refs.currentPath, "anyOf", "1"]
36875
+ });
36876
+ return innerSchema ? {
36877
+ anyOf: [
36878
+ {
36879
+ not: parseAnyDef(refs)
36880
+ },
36881
+ innerSchema
36882
+ ]
36883
+ } : parseAnyDef(refs);
36884
+ };
36885
+
36886
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js
36887
+ var parsePipelineDef = (def, refs) => {
36888
+ if (refs.pipeStrategy === "input") {
36889
+ return parseDef(def.in._def, refs);
36890
+ } else if (refs.pipeStrategy === "output") {
36891
+ return parseDef(def.out._def, refs);
36892
+ }
36893
+ const a = parseDef(def.in._def, {
36894
+ ...refs,
36895
+ currentPath: [...refs.currentPath, "allOf", "0"]
36896
+ });
36897
+ const b = parseDef(def.out._def, {
36898
+ ...refs,
36899
+ currentPath: [...refs.currentPath, "allOf", a ? "1" : "0"]
36900
+ });
36901
+ return {
36902
+ allOf: [a, b].filter((x) => x !== void 0)
36903
+ };
36904
+ };
36905
+
36906
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/promise.js
36907
+ function parsePromiseDef(def, refs) {
36908
+ return parseDef(def.type._def, refs);
36909
+ }
36910
+
36911
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/set.js
36912
+ function parseSetDef(def, refs) {
36913
+ const items = parseDef(def.valueType._def, {
36914
+ ...refs,
36915
+ currentPath: [...refs.currentPath, "items"]
36916
+ });
36917
+ const schema = {
36918
+ type: "array",
36919
+ uniqueItems: true,
36920
+ items
36921
+ };
36922
+ if (def.minSize) {
36923
+ setResponseValueAndErrors(schema, "minItems", def.minSize.value, def.minSize.message, refs);
36924
+ }
36925
+ if (def.maxSize) {
36926
+ setResponseValueAndErrors(schema, "maxItems", def.maxSize.value, def.maxSize.message, refs);
36927
+ }
36928
+ return schema;
36929
+ }
36930
+
36931
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js
36932
+ function parseTupleDef(def, refs) {
36933
+ if (def.rest) {
36934
+ return {
36935
+ type: "array",
36936
+ minItems: def.items.length,
36937
+ items: def.items.map((x, i) => parseDef(x._def, {
36938
+ ...refs,
36939
+ currentPath: [...refs.currentPath, "items", `${i}`]
36940
+ })).reduce((acc, x) => x === void 0 ? acc : [...acc, x], []),
36941
+ additionalItems: parseDef(def.rest._def, {
36942
+ ...refs,
36943
+ currentPath: [...refs.currentPath, "additionalItems"]
36944
+ })
36945
+ };
36946
+ } else {
36947
+ return {
36948
+ type: "array",
36949
+ minItems: def.items.length,
36950
+ maxItems: def.items.length,
36951
+ items: def.items.map((x, i) => parseDef(x._def, {
36952
+ ...refs,
36953
+ currentPath: [...refs.currentPath, "items", `${i}`]
36954
+ })).reduce((acc, x) => x === void 0 ? acc : [...acc, x], [])
36955
+ };
36956
+ }
36957
+ }
36958
+
36959
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js
36960
+ function parseUndefinedDef(refs) {
36961
+ return {
36962
+ not: parseAnyDef(refs)
36963
+ };
36964
+ }
36965
+
36966
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js
36967
+ function parseUnknownDef(refs) {
36968
+ return parseAnyDef(refs);
36969
+ }
36970
+
36971
+ // ../../node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js
36972
+ var parseReadonlyDef = (def, refs) => {
36973
+ return parseDef(def.innerType._def, refs);
36974
+ };
36975
+
36976
+ // ../../node_modules/zod-to-json-schema/dist/esm/selectParser.js
36977
+ var selectParser = (def, typeName, refs) => {
36978
+ switch (typeName) {
36979
+ case ZodFirstPartyTypeKind3.ZodString:
36980
+ return parseStringDef(def, refs);
36981
+ case ZodFirstPartyTypeKind3.ZodNumber:
36982
+ return parseNumberDef(def, refs);
36983
+ case ZodFirstPartyTypeKind3.ZodObject:
36984
+ return parseObjectDef(def, refs);
36985
+ case ZodFirstPartyTypeKind3.ZodBigInt:
36986
+ return parseBigintDef(def, refs);
36987
+ case ZodFirstPartyTypeKind3.ZodBoolean:
36988
+ return parseBooleanDef();
36989
+ case ZodFirstPartyTypeKind3.ZodDate:
36990
+ return parseDateDef(def, refs);
36991
+ case ZodFirstPartyTypeKind3.ZodUndefined:
36992
+ return parseUndefinedDef(refs);
36993
+ case ZodFirstPartyTypeKind3.ZodNull:
36994
+ return parseNullDef(refs);
36995
+ case ZodFirstPartyTypeKind3.ZodArray:
36996
+ return parseArrayDef(def, refs);
36997
+ case ZodFirstPartyTypeKind3.ZodUnion:
36998
+ case ZodFirstPartyTypeKind3.ZodDiscriminatedUnion:
36999
+ return parseUnionDef(def, refs);
37000
+ case ZodFirstPartyTypeKind3.ZodIntersection:
37001
+ return parseIntersectionDef(def, refs);
37002
+ case ZodFirstPartyTypeKind3.ZodTuple:
37003
+ return parseTupleDef(def, refs);
37004
+ case ZodFirstPartyTypeKind3.ZodRecord:
37005
+ return parseRecordDef(def, refs);
37006
+ case ZodFirstPartyTypeKind3.ZodLiteral:
37007
+ return parseLiteralDef(def, refs);
37008
+ case ZodFirstPartyTypeKind3.ZodEnum:
37009
+ return parseEnumDef(def);
37010
+ case ZodFirstPartyTypeKind3.ZodNativeEnum:
37011
+ return parseNativeEnumDef(def);
37012
+ case ZodFirstPartyTypeKind3.ZodNullable:
37013
+ return parseNullableDef(def, refs);
37014
+ case ZodFirstPartyTypeKind3.ZodOptional:
37015
+ return parseOptionalDef(def, refs);
37016
+ case ZodFirstPartyTypeKind3.ZodMap:
37017
+ return parseMapDef(def, refs);
37018
+ case ZodFirstPartyTypeKind3.ZodSet:
37019
+ return parseSetDef(def, refs);
37020
+ case ZodFirstPartyTypeKind3.ZodLazy:
37021
+ return () => def.getter()._def;
37022
+ case ZodFirstPartyTypeKind3.ZodPromise:
37023
+ return parsePromiseDef(def, refs);
37024
+ case ZodFirstPartyTypeKind3.ZodNaN:
37025
+ case ZodFirstPartyTypeKind3.ZodNever:
37026
+ return parseNeverDef(refs);
37027
+ case ZodFirstPartyTypeKind3.ZodEffects:
37028
+ return parseEffectsDef(def, refs);
37029
+ case ZodFirstPartyTypeKind3.ZodAny:
37030
+ return parseAnyDef(refs);
37031
+ case ZodFirstPartyTypeKind3.ZodUnknown:
37032
+ return parseUnknownDef(refs);
37033
+ case ZodFirstPartyTypeKind3.ZodDefault:
37034
+ return parseDefaultDef(def, refs);
37035
+ case ZodFirstPartyTypeKind3.ZodBranded:
37036
+ return parseBrandedDef(def, refs);
37037
+ case ZodFirstPartyTypeKind3.ZodReadonly:
37038
+ return parseReadonlyDef(def, refs);
37039
+ case ZodFirstPartyTypeKind3.ZodCatch:
37040
+ return parseCatchDef(def, refs);
37041
+ case ZodFirstPartyTypeKind3.ZodPipeline:
37042
+ return parsePipelineDef(def, refs);
37043
+ case ZodFirstPartyTypeKind3.ZodFunction:
37044
+ case ZodFirstPartyTypeKind3.ZodVoid:
37045
+ case ZodFirstPartyTypeKind3.ZodSymbol:
37046
+ return void 0;
37047
+ default:
37048
+ return /* @__PURE__ */ ((_) => void 0)(typeName);
37049
+ }
37050
+ };
37051
+
37052
+ // ../../node_modules/zod-to-json-schema/dist/esm/parseDef.js
37053
+ function parseDef(def, refs, forceResolution = false) {
37054
+ const seenItem = refs.seen.get(def);
37055
+ if (refs.override) {
37056
+ const overrideResult = refs.override?.(def, refs, seenItem, forceResolution);
37057
+ if (overrideResult !== ignoreOverride) {
37058
+ return overrideResult;
37059
+ }
37060
+ }
37061
+ if (seenItem && !forceResolution) {
37062
+ const seenSchema = get$ref(seenItem, refs);
37063
+ if (seenSchema !== void 0) {
37064
+ return seenSchema;
37065
+ }
37066
+ }
37067
+ const newItem = { def, path: refs.currentPath, jsonSchema: void 0 };
37068
+ refs.seen.set(def, newItem);
37069
+ const jsonSchemaOrGetter = selectParser(def, def.typeName, refs);
37070
+ const jsonSchema = typeof jsonSchemaOrGetter === "function" ? parseDef(jsonSchemaOrGetter(), refs) : jsonSchemaOrGetter;
37071
+ if (jsonSchema) {
37072
+ addMeta(def, refs, jsonSchema);
37073
+ }
37074
+ if (refs.postProcess) {
37075
+ const postProcessResult = refs.postProcess(jsonSchema, def, refs);
37076
+ newItem.jsonSchema = jsonSchema;
37077
+ return postProcessResult;
37078
+ }
37079
+ newItem.jsonSchema = jsonSchema;
37080
+ return jsonSchema;
37081
+ }
37082
+ var get$ref = (item, refs) => {
37083
+ switch (refs.$refStrategy) {
37084
+ case "root":
37085
+ return { $ref: item.path.join("/") };
37086
+ case "relative":
37087
+ return { $ref: getRelativePath(refs.currentPath, item.path) };
37088
+ case "none":
37089
+ case "seen": {
37090
+ if (item.path.length < refs.currentPath.length && item.path.every((value, index) => refs.currentPath[index] === value)) {
37091
+ console.warn(`Recursive reference detected at ${refs.currentPath.join("/")}! Defaulting to any`);
37092
+ return parseAnyDef(refs);
37093
+ }
37094
+ return refs.$refStrategy === "seen" ? parseAnyDef(refs) : void 0;
37095
+ }
37096
+ }
37097
+ };
37098
+ var addMeta = (def, refs, jsonSchema) => {
37099
+ if (def.description) {
37100
+ jsonSchema.description = def.description;
37101
+ if (refs.markdownDescription) {
37102
+ jsonSchema.markdownDescription = def.description;
37103
+ }
37104
+ }
37105
+ return jsonSchema;
37106
+ };
37107
+
37108
+ // ../../node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js
37109
+ var zodToJsonSchema = (schema, options) => {
37110
+ const refs = getRefs(options);
37111
+ let definitions = typeof options === "object" && options.definitions ? Object.entries(options.definitions).reduce((acc, [name2, schema2]) => ({
37112
+ ...acc,
37113
+ [name2]: parseDef(schema2._def, {
37114
+ ...refs,
37115
+ currentPath: [...refs.basePath, refs.definitionPath, name2]
37116
+ }, true) ?? parseAnyDef(refs)
37117
+ }), {}) : void 0;
37118
+ const name = typeof options === "string" ? options : options?.nameStrategy === "title" ? void 0 : options?.name;
37119
+ const main2 = parseDef(schema._def, name === void 0 ? refs : {
37120
+ ...refs,
37121
+ currentPath: [...refs.basePath, refs.definitionPath, name]
37122
+ }, false) ?? parseAnyDef(refs);
37123
+ const title = typeof options === "object" && options.name !== void 0 && options.nameStrategy === "title" ? options.name : void 0;
37124
+ if (title !== void 0) {
37125
+ main2.title = title;
37126
+ }
37127
+ if (refs.flags.hasReferencedOpenAiAnyType) {
37128
+ if (!definitions) {
37129
+ definitions = {};
37130
+ }
37131
+ if (!definitions[refs.openAiAnyTypeName]) {
37132
+ definitions[refs.openAiAnyTypeName] = {
37133
+ // Skipping "object" as no properties can be defined and additionalProperties must be "false"
37134
+ type: ["string", "number", "integer", "boolean", "array", "null"],
37135
+ items: {
37136
+ $ref: refs.$refStrategy === "relative" ? "1" : [
37137
+ ...refs.basePath,
37138
+ refs.definitionPath,
37139
+ refs.openAiAnyTypeName
37140
+ ].join("/")
37141
+ }
37142
+ };
37143
+ }
37144
+ }
37145
+ const combined = name === void 0 ? definitions ? {
37146
+ ...main2,
37147
+ [refs.definitionPath]: definitions
37148
+ } : main2 : {
37149
+ $ref: [
37150
+ ...refs.$refStrategy === "relative" ? [] : refs.basePath,
37151
+ refs.definitionPath,
37152
+ name
37153
+ ].join("/"),
37154
+ [refs.definitionPath]: {
37155
+ ...definitions,
37156
+ [name]: main2
37157
+ }
37158
+ };
37159
+ if (refs.target === "jsonSchema7") {
37160
+ combined.$schema = "http://json-schema.org/draft-07/schema#";
37161
+ } else if (refs.target === "jsonSchema2019-09" || refs.target === "openAi") {
37162
+ combined.$schema = "https://json-schema.org/draft/2019-09/schema#";
37163
+ }
37164
+ if (refs.target === "openAi" && ("anyOf" in combined || "oneOf" in combined || "allOf" in combined || "type" in combined && Array.isArray(combined.type))) {
37165
+ console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property.");
37166
+ }
37167
+ return combined;
37168
+ };
37169
+
37170
+ // ../engine/dist/mcp/input-schema.js
37171
+ function inputSchemaOf(schema) {
37172
+ const convert = zodToJsonSchema;
37173
+ const json = convert(schema, { target: "jsonSchema7", $refStrategy: "none", effectStrategy: "input" });
37174
+ const { $schema: _s, definitions: _d, additionalProperties: _a, ...rest } = json;
37175
+ if (rest.type !== "object")
37176
+ throw new Error("inputSchemaOf needs a zod object");
37177
+ return rest;
37178
+ }
37179
+
37180
+ // ../engine/dist/mcp/tools.js
35809
37181
  import { existsSync as existsSync23, readFileSync as readFileSync25, statSync as statSync23 } from "fs";
35810
37182
  import { join as join32 } from "path";
35811
37183
 
@@ -36618,7 +37990,7 @@ var RecallTasksSchema = z.object({
36618
37990
  });
36619
37991
  var RecallTaskCreateSchema = z.object({
36620
37992
  title: z.string().describe("Task title"),
36621
- description: z.string().optional(),
37993
+ description: z.string().optional().describe("What the work actually is. The title is the label; this is where the detail a future reader needs belongs."),
36622
37994
  project: z.string().optional().describe("project_id this task belongs to"),
36623
37995
  assignee: z.string().optional().describe("Teammate user id (sub) to assign; omit to leave unassigned"),
36624
37996
  due: z.number().optional().describe("Due date, epoch milliseconds. Set one when the work is time-bound; omit otherwise."),
@@ -36633,7 +38005,7 @@ var RecallTaskUpdateSchema = z.object({
36633
38005
  files: z.array(z.string()).optional().describe("Files those commits changed. PASS THESE: without them the card cannot narrow the session's diff to this card, and shows no changes at all rather than another repository's."),
36634
38006
  summary: z.string().optional().describe("One line on what changed (optional)."),
36635
38007
  assignee: z.string().optional().describe("Reassign to this user id (sub); empty string unassigns"),
36636
- title: z.string().optional(),
38008
+ title: z.string().optional().describe("Rename the card. Omit to leave the title alone."),
36637
38009
  comment: z.string().optional().describe("Add a comment to the task"),
36638
38010
  linked_session_id: z.string().nullable().optional().describe("Session id to attach to the task (null detaches). Pass YOUR OWN current session id when you start working on the task.")
36639
38011
  });
@@ -36664,7 +38036,7 @@ var RecallTaskCommentSchema = z.object({
36664
38036
  var RecallKGQuerySchema = z.object({
36665
38037
  entity: z.string().describe('Entity name to query (e.g., "Alice", "chat-recall", "PostgreSQL")'),
36666
38038
  as_of: z.string().optional().describe("Date filter \u2014 only facts valid at this date (YYYY-MM-DD)"),
36667
- direction: z.enum(["outgoing", "incoming", "both"]).optional().default("both")
38039
+ direction: z.enum(["outgoing", "incoming", "both"]).optional().default("both").describe("Which edges to follow: facts where the entity is the subject (outgoing), the object (incoming), or both.")
36668
38040
  });
36669
38041
  var RecallKGAddSchema = z.object({
36670
38042
  subject: z.string().describe("The entity doing/being something"),
@@ -36778,7 +38150,7 @@ var RecallDecisionsSchema = z.object({
36778
38150
  area: z.string().optional().describe("Only this area"),
36779
38151
  project: z.string().optional().describe("Resolve for this project"),
36780
38152
  workspace: z.string().optional().describe('Folder group to resolve through, e.g. "personal". Resolved from the current directory when omitted.'),
36781
- include_candidates: z.boolean().optional().default(false)
38153
+ include_candidates: z.boolean().optional().default(false).describe("Also return unconfirmed guesses the indexer extracted. These are NOT decisions \u2014 never treat one as settled.")
36782
38154
  });
36783
38155
  var RecallDecisionScanSchema = z.object({
36784
38156
  path: z.string().optional().describe("Repository root to read. Defaults to the current directory."),
@@ -37102,19 +38474,7 @@ Three modes on one tool:
37102
38474
  first prompt as the search text, excludes itself, groups hits by project).
37103
38475
  - \`include_outcome: true\` \u2014 append a per-result outcome one-liner (shipped /
37104
38476
  interrupted / abandoned + edit stats) to judge whether each hit is worth resuming.`,
37105
- inputSchema: {
37106
- type: "object",
37107
- properties: {
37108
- query: { type: "string", description: `What you're looking for (e.g., "OAuth implementation"). Required unless like_session is set.` },
37109
- like_session: { type: "string", description: "Find sessions similar to this session id instead of a free-text query." },
37110
- include_outcome: { type: "boolean", default: false, description: "Append per-result outcome one-liners (status + edit stats)." },
37111
- top_k: { type: "number", default: 5, description: "Number of results to return" },
37112
- project_filter: { type: "string", description: "Optional filter by project path substring" },
37113
- skip_ranking: { type: "boolean", default: false, description: "Skip Claude ranking for faster results" },
37114
- provider: { type: "string", enum: ["ollama", "gemini"], default: "ollama", description: "Embedding provider" },
37115
- scope: { type: "string", enum: ["local", "server"], default: "local", description: "Accepted for back-compat; search always runs against the synced server." }
37116
- }
37117
- }
38477
+ inputSchema: inputSchemaOf(RecallSearchSchema)
37118
38478
  },
37119
38479
  {
37120
38480
  name: "recall_index",
@@ -37122,13 +38482,7 @@ Three modes on one tool:
37122
38482
 
37123
38483
  Scans ~/.claude/projects/ and creates embeddings for all sessions.
37124
38484
  By default, only indexes new or changed sessions.`,
37125
- inputSchema: {
37126
- type: "object",
37127
- properties: {
37128
- force: { type: "boolean", default: false, description: "Force re-index all sessions" },
37129
- provider: { type: "string", enum: ["ollama", "gemini"], default: "ollama", description: "Embedding provider" }
37130
- }
37131
- }
38485
+ inputSchema: inputSchemaOf(RecallIndexSchema)
37132
38486
  },
37133
38487
  {
37134
38488
  name: "recall_status",
@@ -37154,18 +38508,7 @@ Four ways to reach a message:
37154
38508
  Message text and commands come back in full. Tool calls come with their inputs
37155
38509
  and results; a body over 2000 characters shows its first and last 100 and the
37156
38510
  line to pass as \`expand_line\` to get it whole.`,
37157
- inputSchema: {
37158
- type: "object",
37159
- properties: {
37160
- session_id: { type: "string", description: "Session ID from search results, or a plan id (filename without .md)" },
37161
- around_line: { type: "number", description: "Transcript line to centre on. Returns max_messages messages around the message nearest to it." },
37162
- max_messages: { type: "number", default: 10, description: "Messages to return with around_line or query, or from the start of the session. from_end sets its own count." },
37163
- from_end: { type: "number", description: "Return the last N messages (alternative to around_line)." },
37164
- expand_line: { type: "number", description: "Return only the message at this line, with every tool input and result whole." },
37165
- query: { type: "string", description: "Return the messages that contain this text (case-insensitive), with their lines. Searches message text, tool inputs and tool results." }
37166
- },
37167
- required: ["session_id"]
37168
- }
38511
+ inputSchema: inputSchemaOf(RecallShowSchema)
37169
38512
  },
37170
38513
  {
37171
38514
  name: "recall_recent",
@@ -37179,15 +38522,7 @@ Pass \`since_hours: N\` to restrict to sessions modified in the last N hours.
37179
38522
  It lists synced transcripts, which reach the server some time after they change. To find a
37180
38523
  session that runs NOW, or to send one a message, use recall_session_status: it lists the live
37181
38524
  sessions of every AI tool, with their ids and names.`,
37182
- inputSchema: {
37183
- type: "object",
37184
- properties: {
37185
- project_filter: { type: "string", description: 'Filter by project name (e.g., "acme", "poly")' },
37186
- limit: { type: "number", default: 10, description: "Number of recent sessions to show" },
37187
- since_hours: { type: "number", description: "Only include sessions modified in the last N hours." },
37188
- scope: { type: "string", enum: ["local", "server"], default: "local", description: "server = synced cross-device history (needs chat-recall login)." }
37189
- }
37190
- }
38525
+ inputSchema: inputSchemaOf(RecallRecentSchema)
37191
38526
  },
37192
38527
  {
37193
38528
  name: "recall_forget",
@@ -37202,14 +38537,7 @@ tell them that, because it is usually what they mean to keep.
37202
38537
 
37203
38538
  IRREVERSIBLE. There is no undo and no tool that restores it. Only pass \`confirm: true\` when the user
37204
38539
  has actually asked for this; do not infer it from a complaint about a conversation.`,
37205
- inputSchema: {
37206
- type: "object",
37207
- properties: {
37208
- session_id: { type: "string", description: "Session ID to delete (from recall_recent / recall_search)." },
37209
- confirm: { type: "boolean", description: "Must be true. Only when the user actually asked to delete it." }
37210
- },
37211
- required: ["session_id", "confirm"]
37212
- }
38540
+ inputSchema: inputSchemaOf(RecallForgetSchema)
37213
38541
  },
37214
38542
  {
37215
38543
  name: "recall_exclude_path",
@@ -37224,14 +38552,7 @@ so, and offer recall_forget for the ones that matter.
37224
38552
 
37225
38553
  There is deliberately no tool to REMOVE an exclusion: an agent may narrow what is synced, never widen it.
37226
38554
  Undo it with \`chat-recall exclude remove <path>\` or in the dashboard.`,
37227
- inputSchema: {
37228
- type: "object",
37229
- properties: {
37230
- path: { type: "string", description: "Absolute path (or a distinctive part of one) to stop syncing." },
37231
- confirm: { type: "boolean", description: "Must be true. Only when the user actually asked to stop syncing it." }
37232
- },
37233
- required: ["path", "confirm"]
37234
- }
38555
+ inputSchema: inputSchemaOf(RecallExcludePathSchema)
37235
38556
  },
37236
38557
  {
37237
38558
  name: "recall_rename_session",
@@ -37242,14 +38563,7 @@ recall_recent and the web UI. Use it when the user says "name this conversation
37242
38563
  or "rename this to Z". Pass an empty string to clear the name and revert to the auto title.
37243
38564
 
37244
38565
  The name persists across re-syncs and summary regeneration (it's stored separately from the AI summary).`,
37245
- inputSchema: {
37246
- type: "object",
37247
- properties: {
37248
- session_id: { type: "string", description: "Session ID to name (from recall_recent / recall_search)." },
37249
- name: { type: "string", description: "The name to give this conversation. Empty string clears it." }
37250
- },
37251
- required: ["session_id", "name"]
37252
- }
38566
+ inputSchema: inputSchemaOf(RecallRenameSchema)
37253
38567
  },
37254
38568
  {
37255
38569
  name: "recall_edits_timeline",
@@ -37266,24 +38580,7 @@ two hours of edits across every session and every AI tool.
37266
38580
 
37267
38581
  Pass \`group_by: "session"\` (with \`pattern\` + a wide \`since_hours\`, e.g. 720) to
37268
38582
  aggregate per session instead \u2014 "which sessions edited auth.rs in the last month?".`,
37269
- inputSchema: {
37270
- type: "object",
37271
- properties: {
37272
- since_hours: { type: "number", default: 24, description: "Time window in hours" },
37273
- limit: { type: "number", default: 100, description: "Maximum edit rows to return" },
37274
- pattern: { type: "string", description: "Optional substring filter on file path" },
37275
- project_filter: { type: "string", description: "Filter by encoded project directory name" },
37276
- include_reads: { type: "boolean", default: false, description: "Include Read tool_uses too" },
37277
- tools: {
37278
- type: "array",
37279
- items: { type: "string", enum: ["claude", "opencode", "codex", "agy", "cursor", "hermes", "pi"] },
37280
- description: "Restrict to specific AI tools. Default: every tool this machine has."
37281
- },
37282
- group_by_repo: { type: "boolean", default: false, description: "Group results by detected git repo root." },
37283
- view: { type: "string", enum: ["timeline", "summary"], default: "timeline", description: "timeline = chronological edit rows; summary = aggregated rollup over the same window" },
37284
- group_by: { type: "string", enum: ["session"], description: '"session" = aggregate edits per session (which sessions touched files matching pattern).' }
37285
- }
37286
- }
38583
+ inputSchema: inputSchemaOf(RecallEditsTimelineSchema)
37287
38584
  },
37288
38585
  {
37289
38586
  name: "recall_context",
@@ -37297,13 +38594,7 @@ Returns:
37297
38594
  - Summary if available
37298
38595
 
37299
38596
  Use this to understand what happened in a session before resuming.`,
37300
- inputSchema: {
37301
- type: "object",
37302
- properties: {
37303
- session_id: { type: "string", description: "Session ID to get context from" }
37304
- },
37305
- required: ["session_id"]
37306
- }
38597
+ inputSchema: inputSchemaOf(RecallContextSchema)
37307
38598
  },
37308
38599
  {
37309
38600
  name: "recall_summary",
@@ -37318,14 +38609,7 @@ markers, and the last assistant claim paired with the user's reaction to it
37318
38609
  This is the triage call when scanning a session list \u2014 it answers the question
37319
38610
  the AI summary doesn't: did this work actually land?
37320
38611
  Pass \`rich: false\` to fall back to the legacy single-line AI summary only.`,
37321
- inputSchema: {
37322
- type: "object",
37323
- properties: {
37324
- session_id: { type: "string", description: "Session ID to get summary for" },
37325
- rich: { type: "boolean", default: true, description: "Include structured outcome alongside AI summary" }
37326
- },
37327
- required: ["session_id"]
37328
- }
38612
+ inputSchema: inputSchemaOf(RecallSummarySchema)
37329
38613
  },
37330
38614
  {
37331
38615
  name: "recall_diff",
@@ -37340,17 +38624,7 @@ Pass \`file\` to focus on a single absolute path. Pass \`context_only: true\` fo
37340
38624
  just the per-file stats (lines added/removed) when you don't need the diff body.
37341
38625
  Pass \`files_only: true\` for just the list of files the session touched (grouped
37342
38626
  by extension, with tools used) \u2014 "which files did session X actually touch?".`,
37343
- inputSchema: {
37344
- type: "object",
37345
- properties: {
37346
- session_id: { type: "string", description: "Session ID to replay" },
37347
- file: { type: "string", description: "Absolute file path to focus on (optional)" },
37348
- context_only: { type: "boolean", default: false, description: "Skip diff bodies, return stats only" },
37349
- files_only: { type: "boolean", default: false, description: "Return just the file list (no diffs/stats)" },
37350
- max_diff_chars: { type: "number", default: 4e3, description: "Truncate each per-file unified diff" }
37351
- },
37352
- required: ["session_id"]
37353
- }
38627
+ inputSchema: inputSchemaOf(RecallDiffSchema)
37354
38628
  },
37355
38629
  {
37356
38630
  name: "recall_commits",
@@ -37362,14 +38636,7 @@ between commit-files and session-touched-files.
37362
38636
 
37363
38637
  Use this to verify "shipped" claims \u2014 if the session edited 18 files but no
37364
38638
  matching commit exists, work probably stayed local.`,
37365
- inputSchema: {
37366
- type: "object",
37367
- properties: {
37368
- session_id: { type: "string", description: "Session ID to look up commits for" },
37369
- buffer_minutes: { type: "number", default: 30, description: "Window padding on each side" }
37370
- },
37371
- required: ["session_id"]
37372
- }
38639
+ inputSchema: inputSchemaOf(RecallCommitsSchema)
37373
38640
  },
37374
38641
  {
37375
38642
  name: "recall_markers",
@@ -37385,14 +38652,7 @@ matching commit exists, work probably stayed local.`,
37385
38652
 
37386
38653
  Returns per-prompt markers + a session-level summary count. Use this to spot
37387
38654
  sessions where things went sideways before reading the whole transcript.`,
37388
- inputSchema: {
37389
- type: "object",
37390
- properties: {
37391
- session_id: { type: "string", description: "Session ID to mark prompts in" },
37392
- limit: { type: "number", default: 200, description: "Maximum prompts to return" }
37393
- },
37394
- required: ["session_id"]
37395
- }
38655
+ inputSchema: inputSchemaOf(RecallMarkersSchema)
37396
38656
  },
37397
38657
  {
37398
38658
  name: "recall_memory_search",
@@ -37401,23 +38661,7 @@ sessions where things went sideways before reading the whole transcript.`,
37401
38661
  Returns results from any memory source, ranked by relevance. Use source_types to filter.
37402
38662
  Plans and tasks are found here (source_types: ['plan', 'task']); read a full plan
37403
38663
  with recall_show (pass the plan id).`,
37404
- inputSchema: {
37405
- type: "object",
37406
- properties: {
37407
- query: { type: "string", description: "What you're looking for across all memory types" },
37408
- top_k: { type: "number", default: 10, description: "Number of results" },
37409
- source_types: {
37410
- type: "array",
37411
- items: { type: "string", enum: ["session", "plan", "task", "claude_md", "paste", "history", "diary"] },
37412
- description: "Filter by source types (default: all)"
37413
- },
37414
- project_filter: { type: "string", description: "Filter by project path" },
37415
- provider: { type: "string", enum: ["ollama", "gemini"], default: "ollama", description: "Embedding provider, when the server has vector search configured. Ignored on a keyword-only server." },
37416
- scope: { type: "string", enum: ["local", "server"], default: "local", description: "server = synced cross-device history (needs chat-recall login)." },
37417
- semantic: { type: "boolean", default: false, description: "Reserved and currently ignored: the semantic tier is switched off server-side, so every search runs keyword FTS." }
37418
- },
37419
- required: ["query"]
37420
- }
38664
+ inputSchema: inputSchemaOf(RecallMemorySearchSchema)
37421
38665
  },
37422
38666
  {
37423
38667
  name: "recall_smart_resume",
@@ -37441,14 +38685,7 @@ A bare call takes the globally newest sessions, which may belong to different
37441
38685
  projects \u2014 the output says so when they do. Pass project_filter to scope it.
37442
38686
 
37443
38687
  Use this instead of recall_context for a more actionable summary when resuming work.`,
37444
- inputSchema: {
37445
- type: "object",
37446
- properties: {
37447
- session_id: { type: "string", description: "Session to resume. OMIT to resume the most recent session." },
37448
- project_filter: { type: "string", description: "With session_id omitted, resume the latest sessions from this project." },
37449
- depth: { type: "number", default: 3, minimum: 1, maximum: 5, description: "How many recent sessions to cover: the newest in full, the rest as digests. Ignored when session_id is set." }
37450
- }
37451
- }
38688
+ inputSchema: inputSchemaOf(RecallSmartResumeSchema)
37452
38689
  },
37453
38690
  {
37454
38691
  name: "recall_project_context",
@@ -37467,16 +38704,7 @@ Accepts EITHER a project path / name substring (e.g. "api", "example-app",
37467
38704
  - "user:<custom>" (declared in ~/.chat-recall/projects.json)
37468
38705
 
37469
38706
  Use at the START of a new session to understand what's been happening in a project.`,
37470
- inputSchema: {
37471
- type: "object",
37472
- properties: {
37473
- project_path: { type: "string", description: "Project path, name substring, or project_id (git:/ws:/git-local:/user:)" },
37474
- limit: { type: "number", default: 5, description: "Number of recent sessions to include" },
37475
- tasks: { type: "number", default: 20, description: "Max open tasks to list" },
37476
- plans: { type: "number", default: 20, description: "Max plans to list" }
37477
- },
37478
- required: ["project_path"]
37479
- }
38707
+ inputSchema: inputSchemaOf(RecallProjectContextSchema)
37480
38708
  },
37481
38709
  {
37482
38710
  name: "recall_weekly_digest",
@@ -37490,12 +38718,7 @@ Returns:
37490
38718
  - Git activity summary
37491
38719
 
37492
38720
  Use to understand overall productivity and spending.`,
37493
- inputSchema: {
37494
- type: "object",
37495
- properties: {
37496
- weeks_back: { type: "number", default: 0, description: "0 = current week, 1 = last week" }
37497
- }
37498
- }
38721
+ inputSchema: inputSchemaOf(RecallWeeklyDigestSchema)
37499
38722
  },
37500
38723
  {
37501
38724
  name: "recall_team_activity",
@@ -37507,14 +38730,7 @@ work on projects they've shared into the team (private projects never appear).
37507
38730
 
37508
38731
  Use for "what has the team been working on", "what did <teammate> do on <project>",
37509
38732
  or standup/status. Filter by project, by member, or by recency (since_days).`,
37510
- inputSchema: {
37511
- type: "object",
37512
- properties: {
37513
- project: { type: "string", description: "Filter to one project_id" },
37514
- member: { type: "string", description: "Filter to one teammate (user id / sub)" },
37515
- since_days: { type: "number", description: "Only activity in the last N days" }
37516
- }
37517
- }
38733
+ inputSchema: inputSchemaOf(RecallTeamActivitySchema)
37518
38734
  },
37519
38735
  {
37520
38736
  name: "recall_tasks",
@@ -37530,18 +38746,7 @@ work rather than report on it.
37530
38746
 
37531
38747
  Closing is earned: 'done' is refused without a linked session. Rejecting is the
37532
38748
  user's call, never yours.`,
37533
- inputSchema: {
37534
- type: "object",
37535
- properties: {
37536
- mine: { type: "boolean", description: "Only tasks assigned to me" },
37537
- project: { type: "string", description: "Filter to one project_id" },
37538
- status: { type: "string", enum: [...TASK_STATUS_FILTER], description: "Filter by status" },
37539
- detail: {
37540
- type: "boolean",
37541
- description: "Return the full brief per task \u2014 the fix, the file locations and the agent prompt \u2014 plus how to claim and close one. Use this when you intend to DO the tasks, not just list them."
37542
- }
37543
- }
37544
- }
38749
+ inputSchema: inputSchemaOf(RecallTasksSchema)
37545
38750
  },
37546
38751
  {
37547
38752
  name: "recall_task_create",
@@ -37551,18 +38756,7 @@ attach it to a project. Returns the new task id.
37551
38756
  When you then START working on a task, use recall_task_update to set status
37552
38757
  'in_progress' and link your current session (linked_session_id) \u2014 that is what
37553
38758
  lets the board verify the work actually shipped.`,
37554
- inputSchema: {
37555
- type: "object",
37556
- properties: {
37557
- title: { type: "string", description: "Task title" },
37558
- description: { type: "string", description: "What the work actually is. The title is the label; this is where the detail a future reader needs belongs." },
37559
- project: { type: "string", description: "project_id this task belongs to" },
37560
- assignee: { type: "string", description: "Teammate user id (sub) to assign" },
37561
- due: { type: "number", description: "Due date, epoch milliseconds. Set one when the work is time-bound; omit otherwise." },
37562
- linked_finding_id: { type: "string", description: "The code finding this task comes from (ca_\u2026). Setting it lets the card close itself when a re-index stops reporting the finding, and dedupes against an existing card for the same finding." }
37563
- },
37564
- required: ["title"]
37565
- }
38759
+ inputSchema: inputSchemaOf(RecallTaskCreateSchema)
37566
38760
  },
37567
38761
  {
37568
38762
  name: "recall_task_update",
@@ -37603,37 +38797,14 @@ THE THREE ENDINGS ARE NOT THE SAME:
37603
38797
  Closing a card you did not fix, as 'done', is the one thing that makes this board
37604
38798
  worthless: two thirds of one real board's Done column turned out to be work
37605
38799
  nobody had done.`,
37606
- inputSchema: {
37607
- type: "object",
37608
- properties: {
37609
- id: { type: "string", description: "Task id (t_\u2026)" },
37610
- status: { type: "string", enum: [...TASK_STATUS_SETTABLE], description: "Set the card's state. 'done' needs linked_session_id; 'closed' needs closed_reason. There is no 'rejected' here on purpose: rejecting is the user's verdict, not yours." },
37611
- closed_reason: { type: "string", description: "Why the card no longer applies. REQUIRED with status 'closed'." },
37612
- diff: { type: "string", description: "THE CHANGE YOU MADE for this card, as a unified diff. REQUIRED with status 'done' unless you pass commits \u2014 the board cannot reconstruct shell-driven edits, so this is the only reliable record." },
37613
- commits: { type: "array", items: { type: "string" }, description: "Commit sha(s) carrying that change, if you committed it." },
37614
- files: { type: "array", items: { type: "string" }, description: "Files those commits changed. PASS THESE: the card scopes the session's diff by them, and without them it can show no changes rather than risk showing another repository's." },
37615
- summary: { type: "string", description: "One line on what changed (optional)." },
37616
- assignee: { type: "string", description: "Reassign to this user id (sub)" },
37617
- title: { type: "string", description: "Rename the card. Omit to leave the title alone." },
37618
- comment: { type: "string", description: "Add a comment" },
37619
- linked_session_id: { type: "string", description: "Session id to attach \u2014 pass YOUR OWN current session id when you start working on this task, so the board can check whether the work shipped. Null detaches." }
37620
- },
37621
- required: ["id"]
37622
- }
38800
+ inputSchema: inputSchemaOf(RecallTaskUpdateSchema)
37623
38801
  },
37624
38802
  {
37625
38803
  name: "recall_task_comment",
37626
38804
  description: `Leave a progress note on a team task \u2014 a comment visible to everyone on the
37627
38805
  board. Use it to record what you did, what is blocked, or why a status changed,
37628
38806
  without editing the task itself. Pass the task id (t_\u2026) from recall_tasks.`,
37629
- inputSchema: {
37630
- type: "object",
37631
- properties: {
37632
- task_id: { type: "string", description: "Task id (t_\u2026) from recall_tasks" },
37633
- body: { type: "string", description: "The comment text" }
37634
- },
37635
- required: ["task_id", "body"]
37636
- }
38807
+ inputSchema: inputSchemaOf(RecallTaskCommentSchema)
37637
38808
  },
37638
38809
  {
37639
38810
  name: "recall_task_policy",
@@ -37653,20 +38824,7 @@ without editing the task itself. Pass the task id (t_\u2026) from recall_tasks.`
37653
38824
  Use this when the user says what they want worked on \u2014 "only security", "high and
37654
38825
  critical for now", "stop filing hotspots", "let more in". Reading it first also
37655
38826
  explains a quiet board: at the ceiling, filing pauses until cards close.`,
37656
- inputSchema: {
37657
- type: "object",
37658
- properties: {
37659
- enabled: { type: "boolean", description: "Turn auto-filing on or off." },
37660
- max_pri: { type: "number", description: "Severity floor: 0 critical, 1 high, 2 medium, 3 low." },
37661
- ceiling: { type: "number", description: "How many auto-filed cards may be OPEN at once." },
37662
- max_per_run: { type: "number", description: "Cap on NEW cards per run." },
37663
- categories: { type: "array", items: { type: "string" }, description: "Only file these categories; [] means all." },
37664
- project: { type: "string", description: "Apply max_pri/categories to THIS project only, leaving other repos on the global setting." },
37665
- excluded_projects: { type: "array", items: { type: "string" }, description: "Replace the never-file list." },
37666
- exclude_project: { type: "string", description: "Add ONE project to the never-file list." },
37667
- include_project: { type: "string", description: "Remove ONE project from the never-file list." }
37668
- }
37669
- }
38827
+ inputSchema: inputSchemaOf(RecallTaskPolicySchema)
37670
38828
  },
37671
38829
  // ── Knowledge Graph Tools ──────────────────────────────────
37672
38830
  {
@@ -37676,57 +38834,24 @@ explains a quiet board: at the ceiling, filing pauses until cards close.`,
37676
38834
  Returns typed facts with temporal validity. E.g. "example-app" \u2192 uses TypeScript, deploys to Kubernetes.
37677
38835
  Filter by date with as_of to see what was true at a specific point in time.
37678
38836
  Use this to VERIFY facts before asserting them.`,
37679
- inputSchema: {
37680
- type: "object",
37681
- properties: {
37682
- entity: { type: "string", description: 'Entity to query (e.g., "Alice", "chat-recall")' },
37683
- as_of: { type: "string", description: "Date filter (YYYY-MM-DD, optional)" },
37684
- direction: { type: "string", enum: ["outgoing", "incoming", "both"], default: "both", description: "Which edges to follow: facts where the entity is the subject (outgoing), the object (incoming), or both." }
37685
- },
37686
- required: ["entity"]
37687
- }
38837
+ inputSchema: inputSchemaOf(RecallKGQuerySchema)
37688
38838
  },
37689
38839
  {
37690
38840
  name: "recall_kg_add",
37691
38841
  description: `Add a fact to the knowledge graph. Subject \u2192 predicate \u2192 object with optional time window.
37692
38842
 
37693
38843
  E.g. ("example-app", "uses", "Postgres", valid_from="2026-01-15")`,
37694
- inputSchema: {
37695
- type: "object",
37696
- properties: {
37697
- subject: { type: "string", description: "The entity doing/being something" },
37698
- predicate: { type: "string", description: 'Relationship type (e.g., "uses", "works_on", "prefers")' },
37699
- object: { type: "string", description: "The entity being connected to" },
37700
- valid_from: { type: "string", description: "When this became true (YYYY-MM-DD, optional)" },
37701
- source_session: { type: "string", description: "Session ID where this was learned (optional)" }
37702
- },
37703
- required: ["subject", "predicate", "object"]
37704
- }
38844
+ inputSchema: inputSchemaOf(RecallKGAddSchema)
37705
38845
  },
37706
38846
  {
37707
38847
  name: "recall_kg_invalidate",
37708
38848
  description: `Mark a fact as no longer true. Use when things change \u2014 tools replaced, decisions reversed, people leave.`,
37709
- inputSchema: {
37710
- type: "object",
37711
- properties: {
37712
- subject: { type: "string", description: "Entity" },
37713
- predicate: { type: "string", description: "Relationship" },
37714
- object: { type: "string", description: "Connected entity" },
37715
- ended: { type: "string", description: "When it stopped being true (YYYY-MM-DD, default: today)" }
37716
- },
37717
- required: ["subject", "predicate", "object"]
37718
- }
38849
+ inputSchema: inputSchemaOf(RecallKGInvalidateSchema)
37719
38850
  },
37720
38851
  {
37721
38852
  name: "recall_kg_timeline",
37722
38853
  description: `Get chronological timeline of facts. Shows the story of an entity (or everything) in order.`,
37723
- inputSchema: {
37724
- type: "object",
37725
- properties: {
37726
- entity: { type: "string", description: "Entity to get timeline for (optional)" },
37727
- limit: { type: "number", default: 50 }
37728
- }
37729
- }
38854
+ inputSchema: inputSchemaOf(RecallKGTimelineSchema)
37730
38855
  },
37731
38856
  {
37732
38857
  name: "recall_kg_stats",
@@ -37743,29 +38868,12 @@ E.g. ("example-app", "uses", "Postgres", valid_from="2026-01-15")`,
37743
38868
 
37744
38869
  Each agent gets their own persistent diary across sessions. Use this at the end of sessions
37745
38870
  or when you learn something important that should persist.`,
37746
- inputSchema: {
37747
- type: "object",
37748
- properties: {
37749
- agent_name: { type: "string", description: "Your name \u2014 each agent gets their own diary" },
37750
- entry: { type: "string", description: "What happened, what you learned, what matters" },
37751
- topic: { type: "string", default: "general", description: "Topic tag" },
37752
- session_id: { type: "string", description: "Current session ID (for linking)" },
37753
- project_path: { type: "string", description: "Project path (for context)" }
37754
- },
37755
- required: ["agent_name", "entry"]
37756
- }
38871
+ inputSchema: inputSchemaOf(RecallDiaryWriteSchema)
37757
38872
  },
37758
38873
  {
37759
38874
  name: "recall_diary_read",
37760
38875
  description: `Read your recent diary entries. See what past versions of yourself recorded across sessions.`,
37761
- inputSchema: {
37762
- type: "object",
37763
- properties: {
37764
- agent_name: { type: "string", description: "Agent name to read diary for" },
37765
- last_n: { type: "number", default: 10, description: "Number of recent entries" }
37766
- },
37767
- required: ["agent_name"]
37768
- }
38876
+ inputSchema: inputSchemaOf(RecallDiaryReadSchema)
37769
38877
  },
37770
38878
  // ── Code intelligence (codeindex companion) ──
37771
38879
  // Registered ONLY when the codeindex binary is on PATH: recall_code_index
@@ -37775,42 +38883,22 @@ or when you learn something important that should persist.`,
37775
38883
  {
37776
38884
  name: "recall_code_index",
37777
38885
  description: `Index a code repository with codeindex and sync its findings/hotspots/actions to your chat-recall server. Runs the codeindex analyzer LOCALLY (needs the repo files + git history), then ships the result. Use before recall_code_findings/actions if a repo hasn't been indexed yet.`,
37778
- inputSchema: {
37779
- type: "object",
37780
- properties: { path: { type: "string", description: "Repo path (default: cwd)" } }
37781
- }
38886
+ inputSchema: inputSchemaOf(RecallCodeIndexSchema)
37782
38887
  },
37783
38888
  {
37784
38889
  name: "recall_code_projects",
37785
38890
  description: `List code-indexed projects on your server with health score, finding count, and label (poc/production/engineering).`,
37786
- inputSchema: { type: "object", properties: {} }
38891
+ inputSchema: inputSchemaOf(RecallCodeProjectsSchema)
37787
38892
  },
37788
38893
  {
37789
38894
  name: "recall_code_findings",
37790
38895
  description: `List code findings (security / hardcoded literals / copy-paste clones / reinvention / dead code / coupling / cycles). Each finding carries a concrete, ready-to-run agent prompt that references codeindex tools. Filter by project/severity/category.`,
37791
- inputSchema: {
37792
- type: "object",
37793
- properties: {
37794
- project: { type: "string", description: "Project id (omit for all)" },
37795
- severity: { type: "string", enum: ["critical", "high", "medium", "low", "info"] },
37796
- category: { type: "string", description: "security|literal|clone|duplication|dead_code|coupling|cycle" },
37797
- limit: { type: "number", default: 50 },
37798
- view: { type: "string", enum: ["findings", "summary", "hotspots", "file-sessions"], default: "findings", description: "findings = the list; summary = counts by severity/category; hotspots = churn-ranked files; file-sessions = which sessions touched `file`" },
37799
- file: { type: "string", description: "view=file-sessions only: repo-relative path" }
37800
- }
37801
- }
38896
+ inputSchema: inputSchemaOf(RecallCodeFindingsSchema)
37802
38897
  },
37803
38898
  {
37804
38899
  name: "recall_code_actions",
37805
38900
  description: `The ranked, actionable plan for a codebase \u2014 prioritised tasks synthesised from the findings, each with a ready agent prompt. This is the "what should I fix next" list. Filter by project/status.`,
37806
- inputSchema: {
37807
- type: "object",
37808
- properties: {
37809
- project: { type: "string", description: "Project id (omit for all)" },
37810
- status: { type: "string", enum: ["suggested", "queued", "done", "dismissed"] },
37811
- limit: { type: "number", default: 30 }
37812
- }
37813
- }
38901
+ inputSchema: inputSchemaOf(RecallCodeActionsSchema)
37814
38902
  }
37815
38903
  ] : [],
37816
38904
  {
@@ -37825,13 +38913,7 @@ or when you learn something important that should persist.`,
37825
38913
  a skill, set a project label, or reset a POC db. Reasons over BOTH the code
37826
38914
  findings and how sessions in this project went (failed/abandoned, recurring
37827
38915
  corrections). Each has rationale + evidence + an apply-action.`,
37828
- inputSchema: {
37829
- type: "object",
37830
- properties: {
37831
- scope: { type: "string", enum: ["account", "project"], default: "account", description: "account = your chat-recall data; project = one code-indexed project" },
37832
- project: { type: "string", description: 'Project id (from recall_code_projects). Required when scope is "project".' }
37833
- }
37834
- }
38916
+ inputSchema: inputSchemaOf(RecallRecommendationsSchema)
37835
38917
  },
37836
38918
  // ── Aggregated views over the recommendation engines ──
37837
38919
  // Registered UNGATED, unlike the recall_code_* family: they read findings
@@ -37851,14 +38933,7 @@ paste.
37851
38933
  This is the read side. To apply one, use the apply rail the recommendation
37852
38934
  already names (recall_recommendations documents it) \u2014 this tool never edits a
37853
38935
  CLAUDE.md itself.`,
37854
- inputSchema: {
37855
- type: "object",
37856
- properties: {
37857
- project: { type: "string", description: "Limit to one code-indexed project id (from recall_code_projects)" },
37858
- include_projects: { type: "boolean", default: true, description: "Also fan out over code-indexed projects. false = account scope only." },
37859
- kind: { type: "string", enum: [...INSTRUCTION_KINDS], description: "rule = a CLAUDE.md line; skill = a skill to install. Omit for both." }
37860
- }
37861
- }
38936
+ inputSchema: inputSchemaOf(RecallClaudeSuggestionsSchema)
37862
38937
  },
37863
38938
  {
37864
38939
  name: "recall_improvements",
@@ -37873,16 +38948,7 @@ severity; both are mapped onto one scale so a single ordered list is honest.
37873
38948
  Set \`create_tasks: true\` to open one task per improvement on the shared team
37874
38949
  board (recall_tasks). It is off by default \u2014 this reads unless you ask it to
37875
38950
  write.`,
37876
- inputSchema: {
37877
- type: "object",
37878
- properties: {
37879
- project: { type: "string", description: "Limit to one code-indexed project id" },
37880
- min_severity: { type: "string", enum: [...SEVERITIES], default: "low", description: "Drop anything below this severity" },
37881
- limit: { type: "number", default: 30, description: "Maximum improvements to return, after ranking" },
37882
- create_tasks: { type: "boolean", default: false, description: "Create one team task per returned improvement" },
37883
- assignee: { type: "string", description: "create_tasks only: teammate user id (sub) to assign each task to" }
37884
- }
37885
- }
38951
+ inputSchema: inputSchemaOf(RecallImprovementsSchema)
37886
38952
  },
37887
38953
  // ── User-prompts / decision-record ──
37888
38954
  {
@@ -37892,15 +38958,7 @@ Tool results and system banners are stripped \u2014 you get only what the user a
37892
38958
  "what was I asking yesterday?" or "what did I tell the agent in this session?". Pass \`query\` for
37893
38959
  "did I say X?": it keeps only the prompts that contain that text. Each prompt prints whole up to 2000
37894
38960
  characters; a longer one prints its start and end and the recall_show expand_line call for the rest.`,
37895
- inputSchema: {
37896
- type: "object",
37897
- properties: {
37898
- session_id: { type: "string", description: "If set, only that session's prompts" },
37899
- since_days: { type: "number", default: 7, description: "How far back to look, in days." },
37900
- limit: { type: "number", default: 50, description: "Maximum prompts to return, newest first." },
37901
- query: { type: "string", description: "Keep only the prompts that contain this text. Case and runs of whitespace are ignored." }
37902
- }
37903
- }
38961
+ inputSchema: inputSchemaOf(RecallUserPromptsSchema)
37904
38962
  },
37905
38963
  {
37906
38964
  name: "recall_decision_record",
@@ -37911,20 +38969,7 @@ something non-obvious that future sessions should remember.
37911
38969
  PASS \`area\`. It is the key a reversal supersedes on: recording a new \`auth\` decision closes the
37912
38970
  previous \`auth\` one and leaves every other area alone. Without it the decision is stored but
37913
38971
  nothing it contradicts is closed, and both answers stay live forever.`,
37914
- inputSchema: {
37915
- type: "object",
37916
- properties: {
37917
- subject: { type: "string", description: "What the decision is about" },
37918
- decision: { type: "string", description: "The decision itself" },
37919
- reason: { type: "string", description: "Why this was decided" },
37920
- area: { type: "string", description: `The area this decides, so a later decision on the same area supersedes it. Standard areas: ${DECISION_AREAS.join(", ")}. Any short slug works for an area not listed.` },
37921
- project: { type: "string", description: "Project this applies to. Omit for an account-wide decision that applies everywhere." },
37922
- importance: { type: "number", minimum: 1, maximum: 5, default: 4, description: "1-5. Only 4 and 5 surface in the wake-up bundle, so reserve those for decisions a future session must not miss." },
37923
- session_id: { type: "string", description: "Session this decision came out of. Pass your own current session id so the decision can be traced back to the conversation that made it." },
37924
- agent_name: { type: "string", default: "agent", description: "Which agent is recording this, so diary entries stay separable per agent." }
37925
- },
37926
- required: ["subject", "decision"]
37927
- }
38972
+ inputSchema: inputSchemaOf(RecallDecisionRecordSchema)
37928
38973
  },
37929
38974
  {
37930
38975
  name: "recall_decisions",
@@ -37936,14 +38981,7 @@ Returns one effective value per area with the cascade already resolved (project
37936
38981
  personal preferences fill gaps and never override a team decision), what each value replaced and
37937
38982
  when, and the session it came from. Also returns \`gaps\` \u2014 areas nobody has decided, where you are
37938
38983
  free to choose, and where recording the choice afterwards is worth doing.`,
37939
- inputSchema: {
37940
- type: "object",
37941
- properties: {
37942
- area: { type: "string", description: `Only this area. Standard areas: ${DECISION_AREAS.join(", ")}.` },
37943
- project: { type: "string", description: "Resolve for this project, so its overrides win over account-wide decisions. Omit for the account-wide view." },
37944
- include_candidates: { type: "boolean", default: false, description: "Also return unconfirmed guesses the indexer extracted. These are NOT decisions \u2014 never treat one as settled." }
37945
- }
37946
- }
38984
+ inputSchema: inputSchemaOf(RecallDecisionsSchema)
37947
38985
  },
37948
38986
  {
37949
38987
  name: "recall_decision_scan",
@@ -37960,16 +38998,7 @@ read. That is EVIDENCE, not a decision: it says what is there, never what was ru
37960
38998
 
37961
38999
  \`record: true\` writes the areas the manifests answer, at project scope, with the file and line as
37962
39000
  the reason. Areas the manifests do not answer are never written \u2014 ask the user instead.`,
37963
- inputSchema: {
37964
- type: "object",
37965
- properties: {
37966
- path: { type: "string", description: "Repository root to read. Defaults to the current directory." },
37967
- project: { type: "string", description: "Project the decisions belong to. Defaults to the repository folder name." },
37968
- area: { type: "string", description: `Only this area. Standard areas: ${DECISION_AREAS.join(", ")}.` },
37969
- record: { type: "boolean", default: false, description: "Record what the manifests answer, at project scope, citing the file and line. Leave false to look first." },
37970
- session_id: { type: "string", description: "Your current session id, so each write traces back to this conversation." }
37971
- }
37972
- }
39001
+ inputSchema: inputSchemaOf(RecallDecisionScanSchema)
37973
39002
  },
37974
39003
  {
37975
39004
  name: "recall_analytics_summary",
@@ -37979,12 +39008,7 @@ weekly delta, top tools/projects/models, and how many sessions had unknown prici
37979
39008
  can answer "how much have I spent this week" without you opening the UI.
37980
39009
 
37981
39010
  \`view: "patterns"\` returns behavioural patterns across sessions instead of the spend rollup.`,
37982
- inputSchema: {
37983
- type: "object",
37984
- properties: {
37985
- view: { type: "string", enum: ["summary", "patterns"], default: "summary", description: "summary = spend/activity rollup; patterns = behavioural patterns across sessions" }
37986
- }
37987
- }
39011
+ inputSchema: inputSchemaOf(RecallAnalyticsSummarySchema)
37988
39012
  },
37989
39013
  {
37990
39014
  name: "recall_wake_up",
@@ -37992,16 +39016,7 @@ can answer "how much have I spent this week" without you opening the UI.
37992
39016
  classifier-flagged facts (decisions/preferences/milestones at importance >=4) +
37993
39017
  current knowledge-graph facts. Replaces a manual context dump. Call this once at
37994
39018
  the start of a session to "remember who you are and what's true right now".`,
37995
- inputSchema: {
37996
- type: "object",
37997
- properties: {
37998
- max_facts: { type: "number", default: 10, description: "How many high-importance classifier facts to include." },
37999
- max_kg_facts: { type: "number", default: 15, description: "How many current knowledge-graph facts to include." },
38000
- identity: { type: "string", description: "Override the identity line at the top of the bundle. Defaults to ~/.chat-recall/identity.txt when present." },
38001
- project_filter: { type: "string", description: "Scope facts, KG entities and the task count to a project (substring match). Without it, facts are global." },
38002
- project: { type: "string", description: "Alias for project_filter \u2014 the name every sibling tool uses." }
38003
- }
38004
- }
39019
+ inputSchema: inputSchemaOf(RecallWakeUpSchema)
38005
39020
  },
38006
39021
  {
38007
39022
  name: "recall_set",
@@ -38009,15 +39024,7 @@ the start of a session to "remember who you are and what's true right now".`,
38009
39024
  state that doesn't fit the diary (narrative) or knowledge graph (entity-relationship facts) \u2014
38010
39025
  things like "current PR url", "branch I'm working on", "user's preferred test runner".
38011
39026
  Scope namespaces keys so per-project state doesn't collide.`,
38012
- inputSchema: {
38013
- type: "object",
38014
- properties: {
38015
- key: { type: "string", description: "Key name" },
38016
- value: { type: "string", description: "Value to store. JSON-encode if structured." },
38017
- scope: { type: "string", default: "default", description: "Namespace" }
38018
- },
38019
- required: ["key", "value"]
38020
- }
39027
+ inputSchema: inputSchemaOf(RecallSetSchema)
38021
39028
  },
38022
39029
  {
38023
39030
  name: "recall_get",
@@ -38025,14 +39032,7 @@ Scope namespaces keys so per-project state doesn't collide.`,
38025
39032
  omitted, LIST the recorded keys (in one scope, or across all scopes when \`scope\` is
38026
39033
  also omitted). Use the list mode to discover what state has been recorded without
38027
39034
  remembering specific keys.`,
38028
- inputSchema: {
38029
- type: "object",
38030
- properties: {
38031
- key: { type: "string", description: "Key name. Omit to list keys instead." },
38032
- scope: { type: "string", description: 'Namespace (default "default" when reading; omit to list across all scopes)' },
38033
- limit: { type: "number", default: 50, description: "Max entries in list mode" }
38034
- }
38035
- }
39035
+ inputSchema: inputSchemaOf(RecallGetSchema)
38036
39036
  },
38037
39037
  // ── Messages between sessions ────────────────────────────────
38038
39038
  {
@@ -38050,17 +39050,7 @@ the parent and every running child \u2014 use it to announce a decision to the w
38050
39050
  than one is refused instead of guessed. When the folder is known, pass it in both \`to\` and
38051
39051
  \`expect_cwd\`; a recipient that is in another folder is refused and nothing is sent. An opencode TUI
38052
39052
  that has no session yet appears as its folder, and the message becomes its first prompt.`,
38053
- inputSchema: {
38054
- type: "object",
38055
- properties: {
38056
- from: { type: "string", description: "The sending session id, so the recipient can answer." },
38057
- to: { type: "string", description: 'A session id, the start of one, a session name, an absolute folder, "parent", "children" or "group".' },
38058
- body: { type: "string", description: "The message. Secrets are redacted before it is sent." },
38059
- reply_to: { type: "string", description: "The id of the message this answers." },
38060
- expect_cwd: { type: "string", description: "The folder the recipient must be in; the send is refused when it is elsewhere." }
38061
- },
38062
- required: ["to", "body"]
38063
- }
39053
+ inputSchema: inputSchemaOf(RecallMessageSendSchema)
38064
39054
  },
38065
39055
  {
38066
39056
  name: "recall_inbox",
@@ -38068,15 +39058,7 @@ that has no session yet appears as its folder, and the message becomes its first
38068
39058
  With wait_secs, wait for a message to arrive, for example the answer from a child session.
38069
39059
  Claude Code sessions with the message hook receive messages without this tool; use it to wait,
38070
39060
  or in a tool without the hook.`,
38071
- inputSchema: {
38072
- type: "object",
38073
- properties: {
38074
- session: { type: "string", description: "The receiving session id, usually this one." },
38075
- wait_secs: { type: "number", default: 0, description: "Poll for up to this many seconds (max 600) when nothing waits." },
38076
- limit: { type: "number", default: 50 }
38077
- },
38078
- required: ["session"]
38079
- }
39061
+ inputSchema: inputSchemaOf(RecallInboxSchema)
38080
39062
  },
38081
39063
  {
38082
39064
  name: "recall_session_spawn",
@@ -38088,20 +39070,7 @@ take over any child with \`claude attach <id>\`.
38088
39070
 
38089
39071
  Without \`permission_mode\`, a tool call that needs approval stops the child until a person attaches;
38090
39072
  recall_session_status shows that. Pass a permission mode only when the user chose it.`,
38091
- inputSchema: {
38092
- type: "object",
38093
- properties: {
38094
- from: { type: "string", description: "This session id (the parent)." },
38095
- prompt: { type: "string", description: "The task, as the first prompt. Say what done means and what to report." },
38096
- name: { type: "string", description: 'A name to send to, e.g. "worker-a".' },
38097
- doing: { type: "string", description: "One line on what the child works on." },
38098
- cwd: { type: "string", description: "Working directory. Defaults to the parent's." },
38099
- model: { type: "string", description: "Model alias or id. Defaults to the user's setting." },
38100
- permission_mode: { type: "string", enum: [...PERMISSION_MODES], description: "Only when the user chose it." },
38101
- resume: { type: "string", description: "Continue this ended child (session id) with the prompt." }
38102
- },
38103
- required: ["from", "prompt"]
38104
- }
39073
+ inputSchema: inputSchemaOf(RecallSessionSpawnSchema)
38105
39074
  },
38106
39075
  {
38107
39076
  name: "recall_session_status",
@@ -38114,15 +39083,7 @@ unread messages. An opencode TUI that has no session yet is listed by its folder
38114
39083
  opencode or claude process with no session (Linux). With \`parent\`, list the children of one session \u2014
38115
39084
  the check a coordinating session runs on the sessions it started. With \`session\`, show one session and
38116
39085
  its message thread. To read what a session did, follow up with recall_show and from_end.`,
38117
- inputSchema: {
38118
- type: "object",
38119
- properties: {
38120
- parent: { type: "string", description: "List only the children of this session (id, start of id, or name)." },
38121
- session: { type: "string", description: "Show one session and its messages." },
38122
- include_ended: { type: "boolean", default: false },
38123
- messages: { type: "number", default: 10, description: "Messages to show with `session`." }
38124
- }
38125
- }
39086
+ inputSchema: inputSchemaOf(RecallSessionStatusSchema)
38126
39087
  },
38127
39088
  {
38128
39089
  name: "recall_session_register",
@@ -38130,16 +39091,7 @@ its message thread. To read what a session did, follow up with recall_show and f
38130
39091
  what it works on. A child calls this once with its own id and the parent's id or name, so the parent can
38131
39092
  list it with recall_session_status and reach it with to: "children". Set \`doing\` when you start a task
38132
39093
  and when it changes, so every other session can see who works on what.`,
38133
- inputSchema: {
38134
- type: "object",
38135
- properties: {
38136
- session: { type: "string", description: "The session to change, usually this one." },
38137
- name: { type: "string", description: 'A name, e.g. "backend-worker". Empty string removes it.' },
38138
- parent: { type: "string", description: "The parent: id, start of id, or name. Empty string removes the link." },
38139
- doing: { type: "string", description: "One line: the project, issue or task this session works on. Empty string clears it." }
38140
- },
38141
- required: ["session"]
38142
- }
39094
+ inputSchema: inputSchemaOf(RecallSessionRegisterSchema)
38143
39095
  },
38144
39096
  // ── Security / Secret Findings Tools ─────────────────────────
38145
39097
  {
@@ -38151,16 +39103,7 @@ preview), plus per-detector totals and top rules. Use this when the user asks
38151
39103
  "do we have any leaked secrets?" or "security findings" or "what should I rotate".
38152
39104
 
38153
39105
  Call this first; then call recall_security_session for specific sessions.`,
38154
- inputSchema: {
38155
- type: "object",
38156
- properties: {
38157
- include_dismissed: { type: "boolean", default: false, description: "Show previously dismissed findings" },
38158
- top_k: { type: "number", default: 20, description: "Max distinct secrets to list" },
38159
- group_by: { type: "string", enum: ["detector", "rule", "project", "trend", "sessions"], default: "detector", description: "detector = action-required view; rule/project = grouped counts; trend = daily counts; sessions = one row per session with findings" },
38160
- days: { type: "number", default: 30, description: "group_by=trend only: window in days (1-365)" },
38161
- min_detectors: { type: "number", description: "group_by=sessions only: require N detectors agreeing" }
38162
- }
38163
- }
39106
+ inputSchema: inputSchemaOf(RecallSecuritySummarySchema)
38164
39107
  },
38165
39108
  {
38166
39109
  name: "recall_security_session",
@@ -38168,13 +39111,7 @@ Call this first; then call recall_security_session for specific sessions.`,
38168
39111
 
38169
39112
  Use after recall_search or recall_security_summary to show exactly which lines
38170
39113
  in a session matched which detector.`,
38171
- inputSchema: {
38172
- type: "object",
38173
- properties: {
38174
- session_id: { type: "string", description: "Session ID from search results" }
38175
- },
38176
- required: ["session_id"]
38177
- }
39114
+ inputSchema: inputSchemaOf(RecallSecuritySessionSchema)
38178
39115
  },
38179
39116
  {
38180
39117
  name: "recall_recommendation_apply",
@@ -38188,14 +39125,7 @@ allowed to do destructively.
38188
39125
  A CLAUDE.md edit is queued for the machine that has the repo and lands within
38189
39126
  about 45 seconds; only that machine has the file. A label applies immediately.
38190
39127
  Applying twice is harmless.`,
38191
- inputSchema: {
38192
- type: "object",
38193
- properties: {
38194
- id: { type: "string", description: "Recommendation id from recall_recommendations" },
38195
- project: { type: "string", description: "Project id the recommendation belongs to" }
38196
- },
38197
- required: ["id", "project"]
38198
- }
39128
+ inputSchema: inputSchemaOf(RecallRecommendationApplySchema)
38199
39129
  },
38200
39130
  {
38201
39131
  name: "recall_recommendation_dismiss",
@@ -38208,16 +39138,7 @@ recommendations stop being offered for that project and no other.
38208
39138
  TELL THE USER what you dismissed and why. This changes how future sessions treat
38209
39139
  their codebase, and a reason nobody sees is a decision nobody can review. Pass
38210
39140
  undo: true to put one back.`,
38211
- inputSchema: {
38212
- type: "object",
38213
- properties: {
38214
- id: { type: "string", description: "Recommendation id from recall_recommendations" },
38215
- project: { type: "string", description: "Project id the recommendation belongs to" },
38216
- reason: { type: "string", description: "Why it does not apply here. Required." },
38217
- undo: { type: "boolean", description: "Restore a previously dismissed recommendation." }
38218
- },
38219
- required: ["id", "project", "reason"]
38220
- }
39141
+ inputSchema: inputSchemaOf(RecallRecommendationDismissSchema)
38221
39142
  },
38222
39143
  {
38223
39144
  name: "recall_project_label",
@@ -38230,14 +39151,7 @@ higher bar on tests and review (engineering).
38230
39151
 
38231
39152
  ASK THE USER before setting 'production' or clearing a label. Both change what
38232
39153
  other agents will consider permitted, and that is not yours to decide alone.`,
38233
- inputSchema: {
38234
- type: "object",
38235
- properties: {
38236
- project: { type: "string", description: "Project id from recall_code_projects" },
38237
- label: { type: "string", enum: ["poc", "production", "engineering", "none"], description: "none clears it" }
38238
- },
38239
- required: ["project", "label"]
38240
- }
39154
+ inputSchema: inputSchemaOf(RecallProjectLabelSchema)
38241
39155
  },
38242
39156
  {
38243
39157
  name: "recall_security_dismiss",
@@ -38245,15 +39159,7 @@ other agents will consider permitted, and that is not yours to decide alone.`,
38245
39159
 
38246
39160
  Use when the user confirms a key was rotated or that the match is not a real
38247
39161
  secret. The dismissal syncs across devices.`,
38248
- inputSchema: {
38249
- type: "object",
38250
- properties: {
38251
- preview: { type: "string", description: "Masked secret preview from the security dashboard" },
38252
- status: { type: "string", enum: ["rotated", "false_positive", "dismissed", "undismissed"], description: "Resolution status, or `undismissed` to put the finding back on the action-required list" },
38253
- reason: { type: "string", description: "Optional note" }
38254
- },
38255
- required: ["preview", "status"]
38256
- }
39162
+ inputSchema: inputSchemaOf(RecallSecurityDismissSchema)
38257
39163
  },
38258
39164
  {
38259
39165
  name: "recall_toolkit_status",
@@ -38266,12 +39172,7 @@ uploaded them, so you can tell "my laptop has it" from "my desktop has it".
38266
39172
  NOTE: the server holds an INVENTORY. MCP registrations carry enough to rebuild
38267
39173
  elsewhere; skills and agents do not (their file content is not uploaded), and
38268
39174
  this tool says which is which.`,
38269
- inputSchema: {
38270
- type: "object",
38271
- properties: {
38272
- type: { type: "string", enum: [...TOOLKIT_TYPES], description: "Restrict to one artifact type. Omit for every type." }
38273
- }
38274
- }
39175
+ inputSchema: inputSchemaOf(RecallToolkitStatusSchema)
38275
39176
  },
38276
39177
  {
38277
39178
  name: "recall_toolkit_sync",
@@ -38298,15 +39199,7 @@ The work is QUEUED, not done inline: the target device performs it on its next
38298
39199
  drain (the watch daemon polls, or run \`chat-recall toolkit drain\`). Only that
38299
39200
  device can write its own config files, so nothing else could do it. Read the
38300
39201
  outcome back with recall_toolkit_status.`,
38301
- inputSchema: {
38302
- type: "object",
38303
- properties: {
38304
- types: { type: "array", items: { type: "string", enum: [...TOOLKIT_TYPES] }, description: "Artifact types to install. Omit for all." },
38305
- name: { type: "string", description: "Install ONE named artifact. Requires exactly one entry in types." },
38306
- device: { type: "string", description: "Hostname of the target machine. Omit to target every device on the account." },
38307
- scope: { type: "string", enum: ["pull", "fan_out"], default: "pull", description: "pull = install from the server (cross-device). fan_out = copy between one machine's own tools." }
38308
- }
38309
- }
39202
+ inputSchema: inputSchemaOf(RecallToolkitSyncSchema)
38310
39203
  },
38311
39204
  {
38312
39205
  name: "recall_security_rules",
@@ -38314,105 +39207,55 @@ outcome back with recall_toolkit_status.`,
38314
39207
 
38315
39208
  Tenant rules are configured in the chat-recall dashboard; this tool exposes them
38316
39209
  to the agent and lets you test new regexes without persisting them.`,
38317
- inputSchema: {
38318
- type: "object",
38319
- properties: {
38320
- action: { type: "string", enum: ["list", "test"], default: "list", description: "list = existing rules; test = regex sandbox" },
38321
- name: { type: "string", description: "For test: rule name" },
38322
- regex: { type: "string", description: "For test: regex to evaluate" },
38323
- sample: { type: "string", description: "For test: text to match against" }
38324
- }
38325
- }
39210
+ inputSchema: inputSchemaOf(RecallSecurityRulesSchema)
38326
39211
  },
38327
39212
  {
38328
39213
  name: "recall_subagent_search",
38329
39214
  description: `Search inside SUBAGENT transcripts \u2014 the explore/compact/aside sub-tasks that run within a session and whose work never appears in the main conversation.
38330
39215
 
38331
39216
  Use when a session's own turns don't contain what you remember: the finding may have come from a subagent. Indexed server-side, so it works across devices.`,
38332
- inputSchema: {
38333
- type: "object",
38334
- properties: {
38335
- query: { type: "string", description: "Text to find inside subagent transcripts" },
38336
- session_id: { type: "string", description: "Restrict to one session" },
38337
- kind: { type: "string", description: "Restrict to one subagent kind" },
38338
- limit: { type: "number", default: 20 }
38339
- },
38340
- required: ["query"]
38341
- }
39217
+ inputSchema: inputSchemaOf(RecallSubagentSearchSchema)
38342
39218
  },
38343
39219
  {
38344
39220
  name: "recall_redundant_files",
38345
39221
  description: `Before creating a file, check whether you have written one like it before. Scores the filename against every file touched in your synced history.
38346
39222
 
38347
39223
  Answers "have I built this already?" \u2014 the reinvention check.`,
38348
- inputSchema: {
38349
- type: "object",
38350
- properties: {
38351
- filename: { type: "string", description: "Filename you are about to create" },
38352
- project: { type: "string", description: "Restrict to one project" },
38353
- limit: { type: "number", default: 20 }
38354
- },
38355
- required: ["filename"]
38356
- }
39224
+ inputSchema: inputSchemaOf(RecallRedundantFilesSchema)
38357
39225
  },
38358
39226
  {
38359
39227
  name: "recall_heal_audit",
38360
39228
  description: `Report how many of your sessions are DAMAGED \u2014 the rendered conversation is thinner than the shrink-protected raw archive, which happens when an upstream tool truncates a transcript in place (a resume/compaction rewrite, or a script mirroring a shorter file over a longer one).
38361
39229
 
38362
39230
  This is the authoritative "0 remaining" check. Read-only by default; apply=true heals, and healing only ever makes a conversation FULLER.`,
38363
- inputSchema: {
38364
- type: "object",
38365
- properties: {
38366
- since_hours: { type: "number", description: "Bound the scan to the last N hours. Default 168 (7 days). The scan is capped at 500 sessions so it returns within the request timeout; the reply reports what it did not cover." },
38367
- apply: { type: "boolean", default: false, description: "false = audit only; true = heal now" }
38368
- }
38369
- }
39231
+ inputSchema: inputSchemaOf(RecallHealAuditSchema)
38370
39232
  },
38371
39233
  {
38372
39234
  name: "recall_memory_item",
38373
39235
  description: `Fetch ONE memory item, its full text, or its links \u2014 or browse a whole source type.
38374
39236
 
38375
39237
  Complements recall_memory_search: search finds candidates, this reads the specific item. mode=browse lists a type (e.g. every skill, every plan) without a query.`,
38376
- inputSchema: {
38377
- type: "object",
38378
- properties: {
38379
- source_type: { type: "string", enum: ["session", "plan", "task", "claude_md", "paste", "history", "diary"] },
38380
- id: { type: "string", description: "Item id. Omit with mode=browse." },
38381
- mode: { type: "string", enum: ["item", "content", "links", "browse"], default: "item", description: "item = metadata, content = full text, links = related items, browse = list the type" },
38382
- limit: { type: "number", default: 50, description: "browse mode only" }
38383
- },
38384
- required: ["source_type"]
38385
- }
39238
+ inputSchema: inputSchemaOf(RecallMemoryItemSchema)
38386
39239
  },
38387
39240
  {
38388
39241
  name: "recall_regenerate_summary",
38389
39242
  description: "Force a fresh AI summary for one session \u2014 use when its stored summary is missing, stale, or plainly wrong.",
38390
- inputSchema: {
38391
- type: "object",
38392
- properties: { session_id: { type: "string" } },
38393
- required: ["session_id"]
38394
- }
39243
+ inputSchema: inputSchemaOf(RecallRegenerateSummarySchema)
38395
39244
  },
38396
39245
  {
38397
39246
  name: "recall_outcome_summary",
38398
39247
  description: 'Aggregate session outcomes (shipped / interrupted / abandoned / in_progress) over the last N days \u2014 "how much of my work actually landed?".',
38399
- inputSchema: {
38400
- type: "object",
38401
- properties: { days: { type: "number", default: 7, description: "1-90" } }
38402
- }
39248
+ inputSchema: inputSchemaOf(RecallOutcomeSummarySchema)
38403
39249
  },
38404
39250
  {
38405
39251
  name: "recall_shares",
38406
39252
  description: "Which projects are shared into your team. scope=mine for your own shares, scope=all for every share visible to you. Private by default \u2014 nothing is visible to teammates until shared.",
38407
- inputSchema: {
38408
- type: "object",
38409
- properties: { scope: { type: "string", enum: ["mine", "all"], default: "mine" } }
38410
- }
39253
+ inputSchema: inputSchemaOf(RecallSharesSchema)
38411
39254
  },
38412
39255
  {
38413
39256
  name: "recall_reclassify",
38414
39257
  description: "Re-run the memory classifier over already-indexed chunks so classifier improvements reach old data. Idempotent \u2014 only rewrites tags that actually changed.",
38415
- inputSchema: { type: "object", properties: {} }
39258
+ inputSchema: inputSchemaOf(RecallReclassifySchema)
38416
39259
  }
38417
39260
  ];
38418
39261
  const localOnly = /* @__PURE__ */ new Set(["recall_index", "recall_code_index"]);
@@ -41168,6 +42011,16 @@ function parentOf(pid) {
41168
42011
  const stat3 = readFileSync50(`/proc/${pid}/stat`, "utf-8");
41169
42012
  const ppid = Number(stat3.slice(stat3.lastIndexOf(")") + 2).split(" ")[1]);
41170
42013
  return ppid > 1 ? ppid : null;
42014
+ } catch {
42015
+ }
42016
+ if (process.platform === "win32") return null;
42017
+ try {
42018
+ const ppid = Number(execFileSync4("ps", ["-o", "ppid=", "-p", String(pid)], {
42019
+ encoding: "utf8",
42020
+ timeout: 2e3,
42021
+ stdio: ["ignore", "pipe", "ignore"]
42022
+ }).trim());
42023
+ return Number.isInteger(ppid) && ppid > 1 ? ppid : null;
41171
42024
  } catch {
41172
42025
  return null;
41173
42026
  }
@@ -41201,6 +42054,7 @@ function channelDecision(env = process.env, args = process.argv.slice(2), ancest
41201
42054
 
41202
42055
  // src/channel-state.ts
41203
42056
  init_data_dir();
42057
+ import { execFileSync as execFileSync5 } from "node:child_process";
41204
42058
  import { mkdirSync as mkdirSync15, readFileSync as readFileSync51, readdirSync as readdirSync35, statSync as statSync47, unlinkSync as unlinkSync4, writeFileSync as writeFileSync13 } from "node:fs";
41205
42059
  import { join as join58 } from "node:path";
41206
42060
  function channelStateDir() {
@@ -41224,7 +42078,18 @@ function startTimeOf(pid) {
41224
42078
  const stat3 = readFileSync51(`/proc/${pid}/stat`, "utf-8");
41225
42079
  const rest = stat3.slice(stat3.lastIndexOf(")") + 2).split(" ");
41226
42080
  const started = rest[19];
41227
- return started && /^\d+$/.test(started) ? started : null;
42081
+ if (started && /^\d+$/.test(started)) return started;
42082
+ } catch {
42083
+ }
42084
+ if (process.platform === "win32") return null;
42085
+ try {
42086
+ const out = execFileSync5("ps", ["-o", "lstart=", "-p", String(pid)], {
42087
+ encoding: "utf8",
42088
+ timeout: 2e3,
42089
+ stdio: ["ignore", "pipe", "ignore"]
42090
+ }).trim();
42091
+ const ms = out ? Date.parse(out) : NaN;
42092
+ return Number.isFinite(ms) ? String(ms) : null;
41228
42093
  } catch {
41229
42094
  return null;
41230
42095
  }
@@ -41559,7 +42424,7 @@ function installCrashGuards() {
41559
42424
  reportClientEvent2("mcp_crash", { message: err.stack || err.message });
41560
42425
  });
41561
42426
  }
41562
- var RELAY_VERSION = true ? "0.7.36" : "0.0.0";
42427
+ var RELAY_VERSION = true ? "0.7.38" : "0.0.0";
41563
42428
  function daemonIdleSecs() {
41564
42429
  const raw = process.env.CHAT_RECALL_DAEMON_IDLE_SECS;
41565
42430
  if (raw === void 0) return 900;