@wrongstack/core 0.272.2 → 0.273.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/dist/{agent-bridge-DFQYEeXf.d.ts → agent-bridge-BZ2enORi.d.ts} +1 -1
  2. package/dist/{agent-subagent-runner-BZa_IEcd.d.ts → agent-subagent-runner-ehb4xGvd.d.ts} +11 -4
  3. package/dist/{brain-etbcbRwV.d.ts → brain-BxN2k2HP.d.ts} +101 -0
  4. package/dist/{config-rRS8yorV.d.ts → config-C8IYxlO8.d.ts} +8 -1
  5. package/dist/coordination/index.d.ts +13 -13
  6. package/dist/coordination/index.js +79 -25
  7. package/dist/coordination/index.js.map +1 -1
  8. package/dist/{default-config-B0cj-Hry.d.ts → default-config-BbX4ojZs.d.ts} +1 -0
  9. package/dist/defaults/index.d.ts +20 -19
  10. package/dist/defaults/index.js +2813 -206
  11. package/dist/defaults/index.js.map +1 -1
  12. package/dist/execution/index.d.ts +10 -10
  13. package/dist/execution/index.js +8 -2
  14. package/dist/execution/index.js.map +1 -1
  15. package/dist/extension/index.d.ts +4 -4
  16. package/dist/{global-mailbox-DJ4EoRr0.d.ts → global-mailbox-C9dsc9Y_.d.ts} +1 -1
  17. package/dist/{goal-preamble-hM8BH7TK.d.ts → goal-preamble-NhflDjYb.d.ts} +6 -6
  18. package/dist/{goal-store-CWlbT0TO.d.ts → goal-store-Cx363x7Z.d.ts} +1 -1
  19. package/dist/hq/index.d.ts +4 -4
  20. package/dist/hq/index.js +1 -0
  21. package/dist/hq/index.js.map +1 -1
  22. package/dist/{index-DWm_PE9L.d.ts → index-B7fHDt0B.d.ts} +12 -4
  23. package/dist/{index-2Lhk5v0o.d.ts → index-BbVprU-9.d.ts} +6 -0
  24. package/dist/index.d.ts +194 -33
  25. package/dist/index.js +3222 -681
  26. package/dist/index.js.map +1 -1
  27. package/dist/infrastructure/index.d.ts +4 -4
  28. package/dist/kernel/index.d.ts +94 -14
  29. package/dist/kernel/index.js.map +1 -1
  30. package/dist/{mcp-servers-BpWHTKlE.d.ts → mcp-servers-B6fSRNC1.d.ts} +1 -1
  31. package/dist/models/index.d.ts +3 -3
  32. package/dist/{models-registry-CXQFUn5t.d.ts → models-registry-4C6Wr91w.d.ts} +1 -1
  33. package/dist/{multi-agent-coordinator-jyimfo7D.d.ts → multi-agent-coordinator-q1skFeNP.d.ts} +1 -1
  34. package/dist/{null-fleet-bus-DOGQcvrY.d.ts → null-fleet-bus-C9rrgQwc.d.ts} +15 -5
  35. package/dist/observability/index.d.ts +1 -1
  36. package/dist/{parallel-eternal-engine-rItJBYp9.d.ts → parallel-eternal-engine-CtXly2Sf.d.ts} +7 -6
  37. package/dist/{path-resolver-DrpF5MGK.d.ts → path-resolver-Bim6G5Jz.d.ts} +2 -2
  38. package/dist/{pipeline-Ckkn3AOA.d.ts → pipeline-CNVKuQDQ.d.ts} +1 -1
  39. package/dist/{plan-templates-BvHw5Znw.d.ts → plan-templates-C4wXMmiM.d.ts} +3 -3
  40. package/dist/{provider-model-resolve-nZqnCeaR.d.ts → provider-model-resolve-DFd3IPpw.d.ts} +1 -1
  41. package/dist/{provider-runner-zVOn1p67.d.ts → provider-runner-BpM0mdBE.d.ts} +1 -1
  42. package/dist/sdd/index.d.ts +1111 -11
  43. package/dist/sdd/index.js +5516 -2949
  44. package/dist/sdd/index.js.map +1 -1
  45. package/dist/security/index.d.ts +1 -1
  46. package/dist/security/index.js +6 -0
  47. package/dist/security/index.js.map +1 -1
  48. package/dist/storage/index.d.ts +8 -8
  49. package/dist/storage/index.js +3 -2
  50. package/dist/storage/index.js.map +1 -1
  51. package/dist/tools/index.d.ts +1 -1
  52. package/dist/tools/index.js.map +1 -1
  53. package/dist/types/index.d.ts +14 -14
  54. package/dist/types/index.js +3 -0
  55. package/dist/types/index.js.map +1 -1
  56. package/dist/utils/index.d.ts +30 -4
  57. package/dist/utils/index.js +110 -1
  58. package/dist/utils/index.js.map +1 -1
  59. package/dist/{index-DqW4o62H.d.ts → worktree-manager-BDuXTaWL.d.ts} +48 -90
  60. package/dist/{wstack-paths-hOpNLmvf.d.ts → wstack-paths-BqkDAkoh.d.ts} +2 -0
  61. package/package.json +1 -1
@@ -1,10 +1,10 @@
1
- import { C as Context, B as ContextEvidenceState, m as ToolOutputMetadata, J as JSONSchema, M as Message, x as TodoItem } from '../context-Dw55zZ_Q.js';
1
+ import { C as Context, B as ContextEvidenceState, m as ToolOutputMetadata, J as JSONSchema, M as Message, x as TodoItem, T as Tool } from '../context-Dw55zZ_Q.js';
2
2
  export { H as HttpDispatcher, a as HttpsAgentAsDispatcher } from '../dispatcher-types.d-BBeXBQgS.js';
3
3
  export { toErrorMessage } from './error.js';
4
4
  export { expectDefined } from './expect-defined.js';
5
- import { w as CustomModelDefinition, a as ModelsDevPayload } from '../config-rRS8yorV.js';
5
+ import { w as CustomModelDefinition, a as ModelsDevPayload, Y as ToolDescriptionMode, Z as ToolDescriptionModeConfig } from '../config-C8IYxlO8.js';
6
6
  export { T as TaskItem, c as computeTaskItemProgress, f as formatTaskList, a as formatTaskProgress } from '../task-format-vGOIftmK.js';
7
- export { a as WstackPathOptions, W as WstackPaths, p as projectHash, b as projectSlug, r as resolveWstackPaths, w as wstackGlobalRoot } from '../wstack-paths-hOpNLmvf.js';
7
+ export { a as WstackPathOptions, W as WstackPaths, p as projectHash, b as projectSlug, r as resolveWstackPaths, w as wstackGlobalRoot } from '../wstack-paths-BqkDAkoh.js';
8
8
  export { a as TaskPriority, b as TaskStatus, T as TaskType } from '../task-graph-u1q9Jkyk.js';
9
9
  import 'node:https';
10
10
  import 'undici';
@@ -693,6 +693,32 @@ declare function createToolOutputSerializer(opts?: ToolOutputSerializerOptions):
693
693
  capBytes: number;
694
694
  };
695
695
 
696
+ declare const DEFAULT_TOOL_DESCRIPTION_MODE: ToolDescriptionMode;
697
+ interface ToolDescriptionRegistryLike {
698
+ get(name: string): Tool | undefined;
699
+ list(): Tool[];
700
+ wrap?(name: string, wrapper: (tool: Tool) => Tool, owner?: string): void;
701
+ setDescriptionMode?(name: string, mode: ToolDescriptionMode): boolean;
702
+ applyDescriptionModes?(modes?: ToolDescriptionModeConfig): {
703
+ applied: number;
704
+ missing: string[];
705
+ };
706
+ getDescriptionMode?(name: string): ToolDescriptionMode;
707
+ }
708
+ declare function normalizeToolDescriptionMode(value: unknown): ToolDescriptionMode | undefined;
709
+ declare function resolveToolDescriptionMode(modes: ToolDescriptionModeConfig | undefined, toolName: string): ToolDescriptionMode;
710
+ declare function simplifyToolDescription(text: string, opts?: {
711
+ maxSentences?: number | undefined;
712
+ maxChars?: number | undefined;
713
+ }): string;
714
+ declare function applyToolDescriptionModeToTool(tool: Tool, mode: ToolDescriptionMode): Tool;
715
+ declare function setToolDescriptionMode(registry: ToolDescriptionRegistryLike, name: string, mode: ToolDescriptionMode): boolean;
716
+ declare function getToolDescriptionMode(registry: ToolDescriptionRegistryLike, name: string): ToolDescriptionMode;
717
+ declare function applyToolDescriptionModes(registry: ToolDescriptionRegistryLike, modes?: ToolDescriptionModeConfig): {
718
+ applied: number;
719
+ missing: string[];
720
+ };
721
+
696
722
  interface ToolWireDefinitionLike {
697
723
  name: string;
698
724
  description?: string | undefined;
@@ -720,4 +746,4 @@ interface CompactWireToolDefinition {
720
746
  declare function compactToolDefinitionForWire(tool: ToolWireDefinitionLike, opts?: CompactToolDefinitionForWireOptions): CompactWireToolDefinition;
721
747
  declare function compactSchemaDescriptions(schema: unknown, maxDescriptionChars?: number): Record<string, unknown>;
722
748
 
723
- export { type AtomicWriteOptions, type BuildChildEnvOptions, type CompactToolDefinitionForWireOptions, type CompactWireToolDefinition, type CompileFail, type CompileResult, type DeepMergeOptions, FORBIDDEN_PROTO_KEYS, type FileLockOptions, type JsonObject, type JsonPath, type JsonPathSegment, type MessageRepairReport, type MessageRepairResult, type NewlineStyle, type OutputLineGuard, type RecordToolOutputEvidenceInput, type RequestTokenBreakdown, type SafeParseResult, type ToolOutputSerializerOptions, type ToolWireDefinitionLike, type UnifiedDiffOptions, type ValidationError, type ValidationResult, assertNever, assertNotPrivateHost, atomicWrite, buildChildEnv, buildContextEvidenceDigest, color, compactSchemaDescriptions, compactToolDefinitionForWire, compileGlob, compileUserRegex, completePartialObject, computeMessageTokens, createContextEvidenceState, createToolOutputSerializer, deepMerge, detectNewlineStyle, ensureDir, escapeGlobSubject, estimateMessageTokens, estimateRequestTokens, estimateRequestTokensCalibrated, estimateTextTokens, estimateToolDefTokens, estimateToolInputTokens, estimateToolResultTokens, expandGlob, expandIPv6, formatTodosList, getCalibrationState, getJsonPath, getTermSize, isInteractive, isJsonObject, isPathSubjectKey, isPrimitiveArray, isPrivateIPv4, isPrivateIPv6, isStdinTTY, isStdoutTTY, jsonObjectFileExists, markAssistantReferencedEvidence, matchAny, matchGlob, mergeCustomModelDefs, mergeModelsPayload, normalizePathSubject, normalizeToLf, onResize, readJsonObjectFile, recordActualUsage, recordToolOutputEvidence, recordUserIntentEvidence, removeJsonPath, removeJsonPathInFile, repairToolUseAdjacency, repeatedReadPressure, resetCalibration, safeParse, safeStringify, sanitizeJsonString, sanitizeNodeOptions, setJsonPath, setJsonPathInFile, setOutputLineGuard, setRawMode, sleep, stripAnsi, subjectForToolInput, toStyle, truncate, unifiedDiff, updateJsonObjectFile, validateAgainstSchema, withFileLock, writeErr, writeJsonObjectFile, writeOut };
749
+ export { type AtomicWriteOptions, type BuildChildEnvOptions, type CompactToolDefinitionForWireOptions, type CompactWireToolDefinition, type CompileFail, type CompileResult, DEFAULT_TOOL_DESCRIPTION_MODE, type DeepMergeOptions, FORBIDDEN_PROTO_KEYS, type FileLockOptions, type JsonObject, type JsonPath, type JsonPathSegment, type MessageRepairReport, type MessageRepairResult, type NewlineStyle, type OutputLineGuard, type RecordToolOutputEvidenceInput, type RequestTokenBreakdown, type SafeParseResult, type ToolDescriptionRegistryLike, type ToolOutputSerializerOptions, type ToolWireDefinitionLike, type UnifiedDiffOptions, type ValidationError, type ValidationResult, applyToolDescriptionModeToTool, applyToolDescriptionModes, assertNever, assertNotPrivateHost, atomicWrite, buildChildEnv, buildContextEvidenceDigest, color, compactSchemaDescriptions, compactToolDefinitionForWire, compileGlob, compileUserRegex, completePartialObject, computeMessageTokens, createContextEvidenceState, createToolOutputSerializer, deepMerge, detectNewlineStyle, ensureDir, escapeGlobSubject, estimateMessageTokens, estimateRequestTokens, estimateRequestTokensCalibrated, estimateTextTokens, estimateToolDefTokens, estimateToolInputTokens, estimateToolResultTokens, expandGlob, expandIPv6, formatTodosList, getCalibrationState, getJsonPath, getTermSize, getToolDescriptionMode, isInteractive, isJsonObject, isPathSubjectKey, isPrimitiveArray, isPrivateIPv4, isPrivateIPv6, isStdinTTY, isStdoutTTY, jsonObjectFileExists, markAssistantReferencedEvidence, matchAny, matchGlob, mergeCustomModelDefs, mergeModelsPayload, normalizePathSubject, normalizeToLf, normalizeToolDescriptionMode, onResize, readJsonObjectFile, recordActualUsage, recordToolOutputEvidence, recordUserIntentEvidence, removeJsonPath, removeJsonPathInFile, repairToolUseAdjacency, repeatedReadPressure, resetCalibration, resolveToolDescriptionMode, safeParse, safeStringify, sanitizeJsonString, sanitizeNodeOptions, setJsonPath, setJsonPathInFile, setOutputLineGuard, setRawMode, setToolDescriptionMode, simplifyToolDescription, sleep, stripAnsi, subjectForToolInput, toStyle, truncate, unifiedDiff, updateJsonObjectFile, validateAgainstSchema, withFileLock, writeErr, writeJsonObjectFile, writeOut };
@@ -2906,6 +2906,114 @@ function isRecord2(value) {
2906
2906
  function isScalar(value) {
2907
2907
  return value === null || ["string", "number", "boolean"].includes(typeof value);
2908
2908
  }
2909
+
2910
+ // src/utils/tool-description-mode.ts
2911
+ var DEFAULT_TOOL_DESCRIPTION_MODE = "extend";
2912
+ var ORIGINAL_TOOL_DESCRIPTION = /* @__PURE__ */ Symbol.for("wrongstack.tool.originalDescription");
2913
+ function normalizeToolDescriptionMode(value) {
2914
+ if (typeof value !== "string") return void 0;
2915
+ const raw = value.trim().toLowerCase();
2916
+ if (raw === "extend" || raw === "extended" || raw === "full") return "extend";
2917
+ if (raw === "simple" || raw === "short" || raw === "brief") return "simple";
2918
+ return void 0;
2919
+ }
2920
+ function resolveToolDescriptionMode(modes, toolName) {
2921
+ return normalizeToolDescriptionMode(modes?.[toolName]) ?? DEFAULT_TOOL_DESCRIPTION_MODE;
2922
+ }
2923
+ function simplifyToolDescription(text, opts = {}) {
2924
+ const maxSentences = Math.max(1, opts.maxSentences ?? 2);
2925
+ const maxChars = Math.max(40, opts.maxChars ?? 180);
2926
+ const normalized = text.replace(/\r\n?/g, "\n").split("\n").map((line) => line.trim()).filter(Boolean).join(" ").replace(/\s+/g, " ").trim();
2927
+ if (normalized.length <= maxChars) return normalized;
2928
+ const sentences = normalized.match(/[^.!?]+[.!?]+(?=\s|$)|[^.!?]+$/g) ?? [normalized];
2929
+ const selected = [];
2930
+ for (const sentence of sentences) {
2931
+ selected.push(sentence.trim());
2932
+ const candidate = selected.join(" ");
2933
+ if (selected.length >= maxSentences || candidate.length >= maxChars) break;
2934
+ }
2935
+ const summary = selected.join(" ").trim() || normalized;
2936
+ if (summary.length <= maxChars) return summary;
2937
+ const hardLimit = maxChars - 4;
2938
+ const boundary = findWordBoundary(summary, hardLimit);
2939
+ return `${summary.slice(0, boundary > 0 ? boundary : hardLimit).trimEnd()} ...`;
2940
+ }
2941
+ function applyToolDescriptionModeToTool(tool, mode) {
2942
+ const existingOriginal = getOriginalDescription(tool);
2943
+ if (mode === "extend" && !existingOriginal) return tool;
2944
+ const original = existingOriginal ?? {
2945
+ description: tool.description,
2946
+ usageHint: tool.usageHint
2947
+ };
2948
+ const next = mode === "simple" ? withDescription(tool, {
2949
+ description: simplifyToolDescription(original.description),
2950
+ usageHint: original.usageHint === void 0 ? void 0 : simplifyToolDescription(original.usageHint)
2951
+ }) : withDescription(tool, original);
2952
+ return attachOriginalDescription(next, original);
2953
+ }
2954
+ function setToolDescriptionMode(registry, name, mode) {
2955
+ if (typeof registry.setDescriptionMode === "function") {
2956
+ return registry.setDescriptionMode(name, mode);
2957
+ }
2958
+ if (!registry.get(name) || typeof registry.wrap !== "function") return false;
2959
+ registry.wrap(
2960
+ name,
2961
+ (tool) => applyToolDescriptionModeToTool(tool, mode),
2962
+ "tool-description-mode"
2963
+ );
2964
+ return true;
2965
+ }
2966
+ function getToolDescriptionMode(registry, name) {
2967
+ return registry.getDescriptionMode?.(name) ?? DEFAULT_TOOL_DESCRIPTION_MODE;
2968
+ }
2969
+ function applyToolDescriptionModes(registry, modes) {
2970
+ if (typeof registry.applyDescriptionModes === "function") {
2971
+ return registry.applyDescriptionModes(modes);
2972
+ }
2973
+ const entries = Object.entries(modes ?? {});
2974
+ const missing = [];
2975
+ let applied = 0;
2976
+ for (const [name, rawMode] of entries) {
2977
+ const mode = normalizeToolDescriptionMode(rawMode);
2978
+ if (!mode) continue;
2979
+ if (setToolDescriptionMode(registry, name, mode)) applied++;
2980
+ else missing.push(name);
2981
+ }
2982
+ return { applied, missing };
2983
+ }
2984
+ function getOriginalDescription(tool) {
2985
+ return tool[ORIGINAL_TOOL_DESCRIPTION];
2986
+ }
2987
+ function attachOriginalDescription(tool, original) {
2988
+ Object.defineProperty(tool, ORIGINAL_TOOL_DESCRIPTION, {
2989
+ configurable: true,
2990
+ enumerable: false,
2991
+ value: original,
2992
+ writable: true
2993
+ });
2994
+ return tool;
2995
+ }
2996
+ function withDescription(tool, next) {
2997
+ const copy = {
2998
+ ...tool,
2999
+ description: next.description,
3000
+ usageHint: next.usageHint
3001
+ };
3002
+ if (next.usageHint === void 0) {
3003
+ delete copy.usageHint;
3004
+ }
3005
+ return copy;
3006
+ }
3007
+ function findWordBoundary(text, limit) {
3008
+ const semantic = Math.max(
3009
+ text.lastIndexOf(". ", limit),
3010
+ text.lastIndexOf("; ", limit),
3011
+ text.lastIndexOf(", ", limit)
3012
+ );
3013
+ if (semantic > 40) return semantic + 1;
3014
+ const space = text.lastIndexOf(" ", limit);
3015
+ return space > 40 ? space : limit;
3016
+ }
2909
3017
  function projectHash(absRoot) {
2910
3018
  return createHash("sha256").update(path3.resolve(absRoot)).digest("hex").slice(0, 12);
2911
3019
  }
@@ -2959,11 +3067,12 @@ function resolveWstackPaths(opts) {
2959
3067
  projectSddSession: path3.join(projectDir, "sdd-session.json"),
2960
3068
  projectPlan: path3.join(projectDir, "plan.json"),
2961
3069
  projectAutophase: path3.join(projectDir, "autophase"),
3070
+ projectSddBoards: path3.join(projectDir, "sdd-boards"),
2962
3071
  syncConfig: path3.join(globalRoot, "sync.json"),
2963
3072
  projectStatus: (projectHash2) => path3.join(globalRoot, "projects", projectHash2, "status.json")
2964
3073
  };
2965
3074
  }
2966
3075
 
2967
- export { FORBIDDEN_PROTO_KEYS, assertNever, assertNotPrivateHost, atomicWrite, buildChildEnv, buildContextEvidenceDigest, color, compactSchemaDescriptions, compactToolDefinitionForWire, compileGlob, compileUserRegex, completePartialObject, computeMessageTokens, computeTaskItemProgress, createContextEvidenceState, createToolOutputSerializer, deepMerge, detectNewlineStyle, ensureDir, escapeGlobSubject, estimateMessageTokens, estimateRequestTokens, estimateRequestTokensCalibrated, estimateTextTokens, estimateToolDefTokens, estimateToolInputTokens, estimateToolResultTokens, expandGlob, expandIPv6, expectDefined, formatTaskList, formatTaskProgress, formatTodosList, getCalibrationState, getJsonPath, getTermSize, isInteractive, isJsonObject, isPathSubjectKey, isPrimitiveArray, isPrivateIPv4, isPrivateIPv6, isStdinTTY, isStdoutTTY, jsonObjectFileExists, markAssistantReferencedEvidence, matchAny, matchGlob, mergeCustomModelDefs, mergeModelsPayload, normalizePathSubject, normalizeToLf, onResize, projectHash, projectSlug, readJsonObjectFile, recordActualUsage, recordToolOutputEvidence, recordUserIntentEvidence, removeJsonPath, removeJsonPathInFile, repairToolUseAdjacency, repeatedReadPressure, resetCalibration, resolveWstackPaths, safeParse, safeStringify, sanitizeJsonString, sanitizeNodeOptions, setJsonPath, setJsonPathInFile, setOutputLineGuard, setRawMode, sleep, stripAnsi, subjectForToolInput, toErrorMessage, toStyle, truncate, unifiedDiff, updateJsonObjectFile, validateAgainstSchema, withFileLock, writeErr, writeJsonObjectFile, writeOut, wstackGlobalRoot };
3076
+ export { DEFAULT_TOOL_DESCRIPTION_MODE, FORBIDDEN_PROTO_KEYS, applyToolDescriptionModeToTool, applyToolDescriptionModes, assertNever, assertNotPrivateHost, atomicWrite, buildChildEnv, buildContextEvidenceDigest, color, compactSchemaDescriptions, compactToolDefinitionForWire, compileGlob, compileUserRegex, completePartialObject, computeMessageTokens, computeTaskItemProgress, createContextEvidenceState, createToolOutputSerializer, deepMerge, detectNewlineStyle, ensureDir, escapeGlobSubject, estimateMessageTokens, estimateRequestTokens, estimateRequestTokensCalibrated, estimateTextTokens, estimateToolDefTokens, estimateToolInputTokens, estimateToolResultTokens, expandGlob, expandIPv6, expectDefined, formatTaskList, formatTaskProgress, formatTodosList, getCalibrationState, getJsonPath, getTermSize, getToolDescriptionMode, isInteractive, isJsonObject, isPathSubjectKey, isPrimitiveArray, isPrivateIPv4, isPrivateIPv6, isStdinTTY, isStdoutTTY, jsonObjectFileExists, markAssistantReferencedEvidence, matchAny, matchGlob, mergeCustomModelDefs, mergeModelsPayload, normalizePathSubject, normalizeToLf, normalizeToolDescriptionMode, onResize, projectHash, projectSlug, readJsonObjectFile, recordActualUsage, recordToolOutputEvidence, recordUserIntentEvidence, removeJsonPath, removeJsonPathInFile, repairToolUseAdjacency, repeatedReadPressure, resetCalibration, resolveToolDescriptionMode, resolveWstackPaths, safeParse, safeStringify, sanitizeJsonString, sanitizeNodeOptions, setJsonPath, setJsonPathInFile, setOutputLineGuard, setRawMode, setToolDescriptionMode, simplifyToolDescription, sleep, stripAnsi, subjectForToolInput, toErrorMessage, toStyle, truncate, unifiedDiff, updateJsonObjectFile, validateAgainstSchema, withFileLock, writeErr, writeJsonObjectFile, writeOut, wstackGlobalRoot };
2968
3077
  //# sourceMappingURL=index.js.map
2969
3078
  //# sourceMappingURL=index.js.map