lotus-wisdom-mcp 0.8.4 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -13,7 +13,7 @@ Available at: https://lotus-wisdom-mcp.linxule.workers.dev/mcp
13
13
  * Multi-faceted problem-solving approach inspired by the Lotus Sutra
14
14
  * Step-by-step thought process with different thinking techniques
15
15
  * Meditation pauses to allow insights to emerge naturally
16
- * **Interactive visualization** via MCP ext-apps (Claude Desktop, Cursor, ChatGPT) — adapts to the host light/dark theme and is keyboard-accessible
16
+ * **Interactive visualization** via MCP ext-apps (Claude Desktop, Cursor, ChatGPT) — a pixel halo that lights one segment per step, in night and day variants that follow the host theme; keyboard-accessible and respects reduced motion
17
17
  * **MCP Prompts** (`contemplate`, `deep-inquiry`) for one-step guided contemplative sessions
18
18
  * **Structured tool output** (`structuredContent` + `outputSchema`) alongside the text response
19
19
  * Tracks both tag journey and wisdom domain movements
@@ -54,7 +54,7 @@ The server organizes thoughts using wisdom domains (all valid values for the `ta
54
54
 
55
55
  ### Thought Visualization
56
56
 
57
- In clients that support MCP ext-apps, each step renders inline as an interactive "Living Trace" (see [Interactive Visualization](#interactive-visualization-ext-apps) below). For every client, each step also returns:
57
+ In clients that support MCP ext-apps, each step renders inline as an interactive halo (see [Interactive Visualization](#interactive-visualization-ext-apps) below). For every client, each step also returns:
58
58
 
59
59
  * Journey tracking showing both the tag path and the wisdom-domain movements
60
60
  * Domain-specific labels and the current contemplation text
@@ -92,7 +92,15 @@ A tool for problem-solving using the Lotus Sutra's wisdom framework, with variou
92
92
  * `meditationDuration` (integer, optional): Duration for meditation in seconds (1-10)
93
93
  * `previousJourney` (string, optional): The `journey` string from a previous response, e.g. `"begin → open → examine"`. Lets the AI carry journey continuity forward in stateless clients (such as the remote Worker), where the server keeps no session state.
94
94
 
95
- **Returns:** a JSON text block and `structuredContent` validated against the tool's `outputSchema`. For `begin`, the full framework is in the text block; structured output contains its status, welcome, and contemplation fields. Other result variants retain their fields in both representations.
95
+ **Returns:** a JSON text block and `structuredContent` validated against the tool's
96
+ `outputSchema`. Every successful response includes `journey` for continuity,
97
+ including `begin` and completion. Completion also retains `finalJourney` for
98
+ compatibility. For `begin`, the full framework is in the text block; structured
99
+ output contains its status, welcome, contemplation, journey, domain journey,
100
+ and step counts. Other result variants retain their fields in both representations.
101
+
102
+ A meditation step with `nextStepNeeded: false` completes the inquiry with
103
+ `WISDOM_READY`; ongoing meditation steps return `MEDITATION_COMPLETE`.
96
104
 
97
105
  Response statuses include:
98
106
 
@@ -408,16 +416,32 @@ bun install --frozen-lockfile
408
416
  bun run typecheck
409
417
  bun run test
410
418
  bun run build
419
+ bun run test:package
411
420
  bun run start
412
421
  ```
413
422
 
414
423
  The build installs the app's locked dependencies and rebuilds the tracked
415
- `dist/bundle.js` and `dist/journey.html` artifacts. Check app types and build
416
- regressions with `cd app && bunx tsc --noEmit && bun run test`; see
417
- [worker validation](worker/README.md#local-dev) for the worker typecheck,
418
- dry-run build, and local HTTP regression. The app's local Vite plugin inlines
419
- JavaScript and CSS into one HTML resource, with tests for dynamic imports and
420
- HTML escaping.
424
+ `dist/bundle.js` and `dist/journey.html` artifacts. Check the app with
425
+ `cd app && bunx tsc --noEmit && bun run test`. The suite covers the single-file
426
+ build (the local Vite plugin inlines JavaScript and CSS into one HTML resource;
427
+ tests cover dynamic imports and HTML escaping) and the journey itself:
428
+ continuity across frames, meditation, reset between inquiries, exploration of
429
+ the completed panel only, and every tag's character rendering from embedded
430
+ outlines. See [worker validation](worker/README.md#local-dev) for the worker
431
+ typecheck, dry-run build, and local HTTP regression.
432
+
433
+ To see a journey the way a chat shows it, one frame per call, run
434
+ `cd app && bunx vite build` and open `app/preview.html`. The halo's characters
435
+ are generated into `app/src/glyphs.ts`; `app/scripts/glyphs.py` regenerates
436
+ them from a Noto Serif TC subset and documents how to fetch it.
437
+
438
+ `bun run test:package` packs the built files, installs the tarball in a temporary
439
+ consumer directory, and starts npm's executable link. It checks the MCP version,
440
+ tool discovery, a complete inquiry ending in meditation, a fresh inquiry reset,
441
+ and the packaged journey HTML. CI runs this check
442
+ after building and before publishing, so a broken launcher or missing package
443
+ asset blocks the release. It requires npm registry access to install production
444
+ dependencies and removes its temporary files on completion.
421
445
 
422
446
  Dependabot uses the `bun` ecosystem for the root, app, and worker packages so
423
447
  updates include their `bun.lock` files. CI verifies all three packages on pull
@@ -428,10 +452,11 @@ If npm publishes successfully but MCP Registry registration fails, retry only
428
452
  registration for the existing tag:
429
453
 
430
454
  ```bash
431
- gh workflow run publish-mcp.yml --ref main -f registry_tag=v0.8.1
455
+ gh workflow run publish-mcp.yml --ref main -f registry_tag=vX.Y.Z
432
456
  ```
433
457
 
434
- This revalidates the tagged source and waits for npm availability before
458
+ Replace `vX.Y.Z` with the existing published version's tag. This revalidates the
459
+ tagged source and waits for npm availability before
435
460
  registration. It does not republish npm or move the release tag.
436
461
 
437
462
  Enable debug mode:
@@ -442,14 +467,15 @@ LOTUS_DEBUG=true bun run start
442
467
 
443
468
  ## Interactive Visualization (ext-apps)
444
469
 
445
- In MCP clients that support ext-apps (Claude Desktop, Cursor, ChatGPT), the tool renders an interactive "Living Trace" visualization inline in the chat:
470
+ In MCP clients that support ext-apps (Claude Desktop, Cursor, ChatGPT), each step renders inline as a small panel: a ring of pixels modeled on the LED halos (光背) wired behind temple statues, the step's character at its center, and the contemplation beside it. Each tool call gets its own panel, so a journey reads down the conversation one frame at a time.
446
471
 
447
- * **Journey trace**: SVG circles colored by wisdom domain appear as steps arrive
448
- * **Domain colors**: Process (gold), Skillful Means (amber), Non-Dual (green), Meta-Cognitive (blue), Meditation (teal)
449
- * **Meditation breathing**: Hollow circles with gentle inhale/exhale animation
450
- * **Completion**: Journey resolves into a gradient path showing the full domain arc
451
- * **Click to explore**: Pin any step to read its contemplation text
452
- * **Collapse for long journeys**: Shows last 8 steps with a "+N" cluster for earlier ones
472
+ * **The ring**: one segment per step, shaded with the ASCII ramp: a ▒ track for steps still estimated to come, ▓ for earlier steps, solid █ for the current one, which dithers in as it arrives. The ring re-divides as `totalSteps` changes and closes exactly when the journey completes.
473
+ * **Color is attention**: only the current step is in color; the rest is ink. The colors are the six of the Buddha's aura from the Buddhist flag: Entry white, Process red, Skillful Means yellow, Non-Dual orange, Meta-Cognitive blue, and Meditation the flag's sixth band, a pixel mosaic of all five. When the circle closes it turns white, every color at once (ink in daylight).
474
+ * **A character for each tag**: every character comes from Kumārajīva's Lotus Sutra or from Tiantai's reading of it, in traditional forms. open, express, recognize and embody spell 開示悟入, the four aims of the Buddha's appearance in chapter 2, the chapter on skillful means, which also gives 巧 (upaya: 巧說諸法, "skillfully expounds the teachings") and 直 (direct: 正直捨方便, "directly setting means aside"). 照 (reflect) is the light across eighteen thousand worlds (ch. 1), 出 (transcend) the children leaving the burning house (ch. 3), 證 (verify) Many Treasures bearing witness (ch. 11), 淨 (refine) the purified senses (ch. 19). examine and meditate make Tiantai's 止觀. Hover a character for its pinyin and source. Characters are drawn from embedded Noto Serif TC outlines (SIL OFL 1.1), so they look the same with or without CJK fonts.
475
+ * **Meditation**: the meditation segment breathes by pixel density three times, then rests.
476
+ * **Completion**: the circle closes and turns white, segment by segment. Nothing is added underneath.
477
+ * **Look back**: only the completed panel is interactive. Hover or focus a segment to see that step in its color with its character and tag; click or press Enter to pin it; arrow keys walk the ring. Panels for steps still in progress are for reading and do not respond to the pointer. Steps carried over from earlier frames show their place; their words stay in those frames.
478
+ * **Quiet by design**: nothing loops, nothing glows, and with `prefers-reduced-motion` every state appears without animation. The design came out of a Lotus Wisdom journey on its own UI; after `cd app && bunx vite build`, open `app/preview.html` to replay that journey as a chat shows it, one frame per call.
453
479
 
454
480
  Clients without ext-apps support are unaffected — they receive the same JSON tool responses as before.
455
481
 
@@ -492,7 +518,37 @@ Contributions are welcome! Please feel free to submit issues or pull requests on
492
518
 
493
519
  ## Version
494
520
 
495
- Current version: 0.8.1
521
+ Current version: 0.9.0
522
+
523
+ ### What's New in 0.9.0
524
+
525
+ - Redesigned the journey visualization as a pixel halo: one segment per step,
526
+ a traditional character at its center, and the contemplation beside it.
527
+ Earlier steps appear in ink, future steps as a dim track, and the current
528
+ step in its domain color. The completed circle turns white in the night theme.
529
+ - Added embedded Noto Serif TC glyph outlines, with pinyin and source notes on
530
+ hover, so the characters render without installed CJK fonts or font requests.
531
+ - Gave each event a finite animation and made only the completed panel
532
+ explorable by hover, focus, pin, and keyboard navigation.
533
+ - Kept completed panels at a steady height while looking back, with internal
534
+ scrolling for longer earlier text, and fixed a rapid-hover content fade race.
535
+ - Added a daylight palette that follows the host theme, reduced-motion styles,
536
+ DOM regressions, and a development preview showing one frame per tool call.
537
+ - Includes the journey reliability and dependency security fixes below; 0.8.6
538
+ was prepared but not published separately.
539
+
540
+ ### Reliability fixes prepared for 0.8.6 (included in 0.9.0)
541
+
542
+ - Preserved the opening step in stateless journeys by returning continuity
543
+ metadata from `begin`, including in structured output.
544
+ - Fixed completion on meditation steps and added `journey` to completion
545
+ responses while retaining `finalJourney`.
546
+ - Reset the visualization between inquiries in reused iframes, including
547
+ pending animations, collapsed steps, pins, and completion effects.
548
+ - Added response-driven journey regressions for the installed CLI and worker,
549
+ plus DOM tests for consecutive inquiries and animation races.
550
+ - Updated dependencies and patched vulnerable transitive packages. The worker
551
+ temporarily overrides Undici until Wrangler's Miniflare dependency is patched.
496
552
 
497
553
  ### What's New in 0.8.1
498
554
 
package/cli.js CHANGED
@@ -1,3 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import './dist/bundle.js';
3
+ import { startStdioServer } from './dist/bundle.js';
4
+
5
+ startStdioServer().catch((error) => {
6
+ console.error('Fatal error running server:', error);
7
+ process.exit(1);
8
+ });
package/dist/bundle.js CHANGED
@@ -3337,6 +3337,37 @@ var require_utils = __commonJS({
3337
3337
  }
3338
3338
  return output2.join("");
3339
3339
  }
3340
+ function removeDotSegmentsRelative(path) {
3341
+ if (path === "" || path[0] === "/") {
3342
+ return removeDotSegments(path);
3343
+ }
3344
+ const segments = path.split("/");
3345
+ const last = segments.length - 1;
3346
+ const output2 = [];
3347
+ let trailingDirectory = false;
3348
+ for (let i = 0; i <= last; i++) {
3349
+ const segment = segments[i];
3350
+ if (segment === "." || segment === "..") {
3351
+ if (segment === "..") {
3352
+ if (output2.length !== 0 && output2[output2.length - 1] !== "..") {
3353
+ output2.pop();
3354
+ } else {
3355
+ output2.push("..");
3356
+ }
3357
+ }
3358
+ trailingDirectory = i === last;
3359
+ } else {
3360
+ output2.push(segment);
3361
+ }
3362
+ }
3363
+ if (trailingDirectory && output2[output2.length - 1] !== "..") {
3364
+ output2.push("");
3365
+ }
3366
+ if (output2.length === 0 || output2[0] === "" || output2[0].includes(":")) {
3367
+ output2.unshift(".");
3368
+ }
3369
+ return output2.join("/");
3370
+ }
3340
3371
  var HOST_DELIMS = { "@": "%40", "/": "%2F", "?": "%3F", "#": "%23", ":": "%3A" };
3341
3372
  var HOST_DELIM_RE = /[@/?#:]/g;
3342
3373
  var HOST_DELIM_NO_COLON_RE = /[@/?#]/g;
@@ -3597,6 +3628,7 @@ var require_utils = __commonJS({
3597
3628
  encodeFragment,
3598
3629
  escapePreservingEscapes,
3599
3630
  removeDotSegments,
3631
+ removeDotSegmentsRelative,
3600
3632
  isIPv4,
3601
3633
  isUUID,
3602
3634
  normalizeIPv6,
@@ -3820,16 +3852,18 @@ var require_schemes = __commonJS({
3820
3852
  var require_fast_uri = __commonJS({
3821
3853
  "node_modules/fast-uri/index.js"(exports, module) {
3822
3854
  "use strict";
3823
- var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, serializePathEncoding, normalizeQueryFragmentEncoding, encodeQuery, encodeFragment, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require_utils();
3855
+ var { normalizeIPv6, removeDotSegments, removeDotSegmentsRelative, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, serializePathEncoding, normalizeQueryFragmentEncoding, encodeQuery, encodeFragment, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require_utils();
3824
3856
  var { SCHEMES, getSchemeHandler } = require_schemes();
3825
3857
  var VALID_SCHEME = /^[A-Za-z][A-Za-z0-9+.-]*$/u;
3826
3858
  var MALFORMED_SCHEME_ERROR = "URI scheme is malformed.";
3827
- function decodeValidScheme(scheme) {
3828
- const decodedScheme = unescape(String(scheme));
3829
- if (!VALID_SCHEME.test(decodedScheme)) {
3859
+ var MALFORMED_HOST_ERROR = "URI host is malformed.";
3860
+ var FORBIDDEN_DOMAIN_HOST_CHARACTER = /[\0-\x20"#/:<>?@[\\\]^`{|}\x7F]/u;
3861
+ function validateScheme(scheme) {
3862
+ const stringScheme = String(scheme);
3863
+ if (!VALID_SCHEME.test(stringScheme)) {
3830
3864
  throw new TypeError(MALFORMED_SCHEME_ERROR);
3831
3865
  }
3832
- return decodedScheme;
3866
+ return stringScheme;
3833
3867
  }
3834
3868
  function normalize(uri, options) {
3835
3869
  if (typeof uri === "string") {
@@ -3866,6 +3900,9 @@ var require_fast_uri = __commonJS({
3866
3900
  const resolvedSchemeHandler = getSchemeHandler(options && options.scheme || resolved.scheme);
3867
3901
  const resolvedHost = resolved.host;
3868
3902
  const resolvedHostIsIP = resolvedHost !== void 0 && resolvedHost !== "" && (isIPv4(resolvedHost) || normalizeIPv6(resolvedHost).isIPV6);
3903
+ if (hasForbiddenDomainHost(resolved, options || {}, resolvedSchemeHandler, resolvedHostIsIP)) {
3904
+ throw new Error(MALFORMED_HOST_ERROR);
3905
+ }
3869
3906
  canonicalizeHost(resolved, options || {}, resolvedSchemeHandler, resolvedHostIsIP);
3870
3907
  const encodedASCIIHost = resolvedHost && resolvedHost.indexOf("%") !== -1 && !/\P{ASCII}/u.test(resolvedHost);
3871
3908
  if (resolved.error && !encodedASCIIHost) {
@@ -3907,14 +3944,15 @@ var require_fast_uri = __commonJS({
3907
3944
  if (relative.path[0] === "/") {
3908
3945
  target.path = removeDotSegments(relative.path);
3909
3946
  } else {
3910
- if ((base.userinfo !== void 0 || base.host !== void 0 || base.port !== void 0) && !base.path) {
3947
+ const baseHasAuthority = base.userinfo !== void 0 || base.host !== void 0 || base.port !== void 0;
3948
+ if (baseHasAuthority && !base.path) {
3911
3949
  target.path = "/" + relative.path;
3912
3950
  } else if (!base.path) {
3913
3951
  target.path = relative.path;
3914
3952
  } else {
3915
3953
  target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path;
3916
3954
  }
3917
- target.path = removeDotSegments(target.path);
3955
+ target.path = base.scheme === void 0 && !baseHasAuthority && target.path[0] !== "/" ? removeDotSegmentsRelative(target.path) : removeDotSegments(target.path);
3918
3956
  }
3919
3957
  target.query = relative.query;
3920
3958
  }
@@ -3952,12 +3990,13 @@ var require_fast_uri = __commonJS({
3952
3990
  const options = Object.assign({}, opts);
3953
3991
  const uriTokens = [];
3954
3992
  if (component.scheme) {
3955
- component.scheme = decodeValidScheme(component.scheme);
3993
+ component.scheme = validateScheme(component.scheme);
3956
3994
  }
3957
3995
  const schemeHandler = getSchemeHandler(options.scheme || component.scheme);
3958
3996
  if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(component, options);
3959
3997
  const hasAuthority = component.userinfo !== void 0 || component.host !== void 0 || component.port !== void 0;
3960
- const pathNoScheme = !options.skipEscape && component.scheme === void 0 && !hasAuthority;
3998
+ const schemelessReference = (component.scheme === void 0 || options.reference === "suffix") && !hasAuthority;
3999
+ const pathNoScheme = !options.skipEscape && schemelessReference;
3961
4000
  if (component.path !== void 0) {
3962
4001
  if (!options.skipEscape) {
3963
4002
  component.path = serializePathEncoding(component.path, pathNoScheme);
@@ -3966,7 +4005,7 @@ var require_fast_uri = __commonJS({
3966
4005
  }
3967
4006
  }
3968
4007
  if (options.reference !== "suffix" && component.scheme) {
3969
- component.scheme = decodeValidScheme(component.scheme);
4008
+ component.scheme = validateScheme(component.scheme);
3970
4009
  uriTokens.push(component.scheme, ":");
3971
4010
  }
3972
4011
  const authority = recomposeAuthority(component);
@@ -3982,9 +4021,9 @@ var require_fast_uri = __commonJS({
3982
4021
  if (component.path !== void 0) {
3983
4022
  let s = component.path;
3984
4023
  if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {
3985
- s = removeDotSegments(s);
4024
+ s = schemelessReference && s[0] !== "/" ? removeDotSegmentsRelative(s) : removeDotSegments(s);
3986
4025
  }
3987
- if (pathNoScheme) {
4026
+ if (schemelessReference) {
3988
4027
  s = serializePathEncoding(s, true);
3989
4028
  }
3990
4029
  if (authority === void 0 && s[0] === "/" && s[1] === "/") {
@@ -4031,16 +4070,34 @@ var require_fast_uri = __commonJS({
4031
4070
  return hasMalformedPercentEncoding(matches[3]) || host !== void 0 && !isIPLiteral(host) && hasMalformedPercentEncoding(host) || hasMalformedPercentEncoding(matches[6]) || hasMalformedPercentEncoding(matches[7]) || hasMalformedPercentEncoding(matches[8]);
4032
4071
  }
4033
4072
  function canonicalizeHost(parsed, options, schemeHandler, isIP) {
4073
+ if (hasForbiddenDomainHost(parsed, options, schemeHandler, isIP)) {
4074
+ parsed.error = parsed.error || MALFORMED_HOST_ERROR;
4075
+ return true;
4076
+ }
4034
4077
  if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport) && parsed.host && !isIPLiteral(parsed.host) && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && nonSimpleDomain(parsed.host)) {
4078
+ let url2;
4035
4079
  try {
4036
- parsed.host = new URL("http://" + parsed.host).hostname;
4080
+ url2 = new URL("http://" + parsed.host);
4037
4081
  } catch (e) {
4038
4082
  parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e;
4039
4083
  return true;
4040
4084
  }
4085
+ if (!isHostOnlyURL(url2)) {
4086
+ parsed.error = parsed.error || MALFORMED_HOST_ERROR;
4087
+ return true;
4088
+ }
4089
+ parsed.host = url2.hostname;
4041
4090
  }
4042
4091
  return false;
4043
4092
  }
4093
+ function hasForbiddenDomainHost(parsed, options, schemeHandler, isIP) {
4094
+ return Boolean(
4095
+ parsed.host && isIP === false && !isIPLiteral(parsed.host) && (options.domainHost || schemeHandler && schemeHandler.domainHost) && FORBIDDEN_DOMAIN_HOST_CHARACTER.test(parsed.host)
4096
+ );
4097
+ }
4098
+ function isHostOnlyURL(url2) {
4099
+ return url2.username === "" && url2.password === "" && url2.port === "" && url2.pathname === "/" && url2.search === "" && url2.hash === "" && url2.hostname !== "";
4100
+ }
4044
4101
  function parseWithStatus(uri, opts) {
4045
4102
  const options = Object.assign({}, opts);
4046
4103
  const parsed = {
@@ -4095,9 +4152,8 @@ var require_fast_uri = __commonJS({
4095
4152
  parsed.query = matches[7];
4096
4153
  parsed.fragment = matches[8];
4097
4154
  if (parsed.scheme !== void 0) {
4098
- const decodedScheme = unescape(parsed.scheme);
4099
- if (VALID_SCHEME.test(decodedScheme)) {
4100
- parsed.scheme = decodedScheme.toLowerCase();
4155
+ if (VALID_SCHEME.test(parsed.scheme)) {
4156
+ parsed.scheme = parsed.scheme.toLowerCase();
4101
4157
  } else {
4102
4158
  parsed.error = parsed.error || MALFORMED_SCHEME_ERROR;
4103
4159
  malformedScheme = true;
@@ -4125,7 +4181,7 @@ var require_fast_uri = __commonJS({
4125
4181
  malformedIPLiteral = hasIPLiteralBracket && (!bracketedIPLiteral || ipv6result.error === true);
4126
4182
  parsed.host = isIP ? ipv6result.host : ipv6result.host.toLowerCase();
4127
4183
  if (malformedIPLiteral) {
4128
- parsed.error = parsed.error || "URI host is malformed.";
4184
+ parsed.error = parsed.error || MALFORMED_HOST_ERROR;
4129
4185
  malformedAuthorityOrPort = true;
4130
4186
  }
4131
4187
  } else {
@@ -4153,7 +4209,7 @@ var require_fast_uri = __commonJS({
4153
4209
  if (!isIP) {
4154
4210
  host = normalizePercentEncoding(host.toLowerCase());
4155
4211
  }
4156
- parsed.host = reescapeHostDelimiters(host, isIP);
4212
+ parsed.host = isIP || options.scheme !== "null" ? reescapeHostDelimiters(host, isIP) : host;
4157
4213
  }
4158
4214
  if (!schemeHandler || schemeHandler && !schemeHandler.skipNormalize) {
4159
4215
  if (parsed.path) {
@@ -33806,13 +33862,13 @@ var zodToJsonSchema = (schema, options) => {
33806
33862
  }, true) ?? parseAnyDef(refs)
33807
33863
  }), {}) : void 0;
33808
33864
  const name = typeof options === "string" ? options : options?.nameStrategy === "title" ? void 0 : options?.name;
33809
- const main2 = parseDef(schema._def, name === void 0 ? refs : {
33865
+ const main = parseDef(schema._def, name === void 0 ? refs : {
33810
33866
  ...refs,
33811
33867
  currentPath: [...refs.basePath, refs.definitionPath, name]
33812
33868
  }, false) ?? parseAnyDef(refs);
33813
33869
  const title = typeof options === "object" && options.name !== void 0 && options.nameStrategy === "title" ? options.name : void 0;
33814
33870
  if (title !== void 0) {
33815
- main2.title = title;
33871
+ main.title = title;
33816
33872
  }
33817
33873
  if (refs.flags.hasReferencedOpenAiAnyType) {
33818
33874
  if (!definitions) {
@@ -33833,9 +33889,9 @@ var zodToJsonSchema = (schema, options) => {
33833
33889
  }
33834
33890
  }
33835
33891
  const combined = name === void 0 ? definitions ? {
33836
- ...main2,
33892
+ ...main,
33837
33893
  [refs.definitionPath]: definitions
33838
- } : main2 : {
33894
+ } : main : {
33839
33895
  $ref: [
33840
33896
  ...refs.$refStrategy === "relative" ? [] : refs.basePath,
33841
33897
  refs.definitionPath,
@@ -33843,7 +33899,7 @@ var zodToJsonSchema = (schema, options) => {
33843
33899
  ].join("/"),
33844
33900
  [refs.definitionPath]: {
33845
33901
  ...definitions,
33846
- [name]: main2
33902
+ [name]: main
33847
33903
  }
33848
33904
  };
33849
33905
  if (refs.target === "jsonSchema7") {
@@ -36590,7 +36646,7 @@ var StdioServerTransport = class {
36590
36646
  };
36591
36647
 
36592
36648
  // index.ts
36593
- import { readFileSync } from "fs";
36649
+ import { existsSync, readFileSync, realpathSync } from "fs";
36594
36650
  import { dirname, join } from "path";
36595
36651
  import { fileURLToPath } from "url";
36596
36652
 
@@ -36753,11 +36809,16 @@ function processThought(input2, thoughtProcess) {
36753
36809
  const nextProcess = [...process3, step];
36754
36810
  if (input2.tag === "begin") {
36755
36811
  return {
36756
- result: buildFrameworkResponse(input2.content),
36812
+ result: {
36813
+ ...buildFrameworkResponse(input2.content),
36814
+ ...buildJourney(nextProcess),
36815
+ stepNumber: input2.stepNumber,
36816
+ totalSteps
36817
+ },
36757
36818
  thoughtProcess: nextProcess
36758
36819
  };
36759
36820
  }
36760
- if (input2.tag === "meditate") {
36821
+ if (input2.tag === "meditate" && input2.nextStepNeeded) {
36761
36822
  const { journey: journey2 } = buildJourney(nextProcess);
36762
36823
  return {
36763
36824
  result: {
@@ -36785,6 +36846,7 @@ function processThought(input2, thoughtProcess) {
36785
36846
  totalSteps: input2.stepNumber,
36786
36847
  journeyLength: nextProcess.length,
36787
36848
  finalJourney: journey2,
36849
+ journey: journey2,
36788
36850
  domainJourney: domainJourney2
36789
36851
  },
36790
36852
  thoughtProcess: nextProcess
@@ -36826,14 +36888,18 @@ function structuredContentFor(result) {
36826
36888
  return {
36827
36889
  status: result.status,
36828
36890
  contemplation: result.contemplation ?? "",
36829
- welcome: result.welcome ?? ""
36891
+ welcome: result.welcome ?? "",
36892
+ ...result.journey !== void 0 ? { journey: result.journey } : {},
36893
+ ...result.domainJourney !== void 0 ? { domainJourney: result.domainJourney } : {},
36894
+ ...result.stepNumber !== void 0 ? { stepNumber: result.stepNumber } : {},
36895
+ ...result.totalSteps !== void 0 ? { totalSteps: result.totalSteps } : {}
36830
36896
  };
36831
36897
  }
36832
36898
  return result;
36833
36899
  }
36834
36900
 
36835
36901
  // src/shared/version.ts
36836
- var VERSION = "0.8.4";
36902
+ var VERSION = "0.9.0";
36837
36903
 
36838
36904
  // src/shared/tool-defs.ts
36839
36905
  var SERVER_NAME = "lotus-wisdom";
@@ -37078,19 +37144,20 @@ function createServer() {
37078
37144
  registerLotusPrompts(server);
37079
37145
  return server;
37080
37146
  }
37081
- async function main() {
37147
+ async function startStdioServer() {
37082
37148
  const server = createServer();
37083
37149
  const transport = new StdioServerTransport();
37084
37150
  await server.connect(transport);
37085
37151
  console.error(`Lotus Wisdom MCP Server v${VERSION} running`);
37086
37152
  }
37087
- var isDirectRun = process.argv[1] && (process.argv[1].endsWith("bundle.js") || process.argv[1].endsWith("index.js") || process.argv[1].endsWith("index.ts") || process.argv[1].endsWith("cli.js"));
37153
+ var isDirectRun = process.argv[1] && existsSync(process.argv[1]) && realpathSync(process.argv[1]) === fileURLToPath(import.meta.url);
37088
37154
  if (isDirectRun) {
37089
- main().catch((error62) => {
37155
+ startStdioServer().catch((error62) => {
37090
37156
  console.error("Fatal error running server:", error62);
37091
37157
  process.exit(1);
37092
37158
  });
37093
37159
  }
37094
37160
  export {
37095
- createServer as default
37161
+ createServer as default,
37162
+ startStdioServer
37096
37163
  };