fyn 3.0.1 → 3.0.3

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.
@@ -0,0 +1,63 @@
1
+ {
2
+ "session_id": "082c1934-9969-4c0e-a095-f8400bd25393",
3
+ "transcript_path": "/Users/jc/.claude/projects/-Users-jc-dev-fynjs/082c1934-9969-4c0e-a095-f8400bd25393.jsonl",
4
+ "cwd": "/Users/jc/dev/fynjs/packages/fyn/bin",
5
+ "prompt_id": "adb5c134-a498-409b-86e1-0869a5c3236f",
6
+ "effort": {
7
+ "level": "high"
8
+ },
9
+ "session_name": "Fyn visual exec log over clearing",
10
+ "model": {
11
+ "id": "claude-opus-5[1m]",
12
+ "display_name": "Opus 5 (1M context)"
13
+ },
14
+ "workspace": {
15
+ "current_dir": "/Users/jc/dev/fynjs/packages/fyn/bin",
16
+ "project_dir": "/Users/jc/dev/fynjs",
17
+ "added_dirs": [],
18
+ "repo": {
19
+ "host": "github.com",
20
+ "owner": "jchip",
21
+ "name": "fynjs"
22
+ }
23
+ },
24
+ "version": "2.1.239",
25
+ "output_style": {
26
+ "name": "default"
27
+ },
28
+ "cost": {
29
+ "total_cost_usd": 10.880410499999998,
30
+ "total_duration_ms": 1739553,
31
+ "total_api_duration_ms": 931367,
32
+ "total_lines_added": 753,
33
+ "total_lines_removed": 12
34
+ },
35
+ "context_window": {
36
+ "total_input_tokens": 187292,
37
+ "total_output_tokens": 147,
38
+ "context_window_size": 1000000,
39
+ "current_usage": {
40
+ "input_tokens": 2,
41
+ "output_tokens": 147,
42
+ "cache_creation_input_tokens": 812,
43
+ "cache_read_input_tokens": 186478
44
+ },
45
+ "used_percentage": 19,
46
+ "remaining_percentage": 81
47
+ },
48
+ "exceeds_200k_tokens": false,
49
+ "fast_mode": false,
50
+ "thinking": {
51
+ "enabled": true
52
+ },
53
+ "rate_limits": {
54
+ "five_hour": {
55
+ "used_percentage": 21,
56
+ "resets_at": 1788241200
57
+ },
58
+ "seven_day": {
59
+ "used_percentage": 51,
60
+ "resets_at": 1788692400
61
+ }
62
+ }
63
+ }
package/dist/fyn.mjs CHANGED
@@ -2073,7 +2073,7 @@ var dist_default = AveAzul;
2073
2073
  var aveazul_default = dist_default;
2074
2074
 
2075
2075
  //#endregion
2076
- //#region node_modules/.f/_/signal-exit/3.0.7/signal-exit/signals.js
2076
+ //#region node_modules/.f/_/signal-exit/3.0.7/node_modules/signal-exit/signals.js
2077
2077
  var require_signals$3 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2078
2078
  module.exports = [
2079
2079
  "SIGABRT",
@@ -2087,7 +2087,7 @@ var require_signals$3 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2087
2087
  }));
2088
2088
 
2089
2089
  //#endregion
2090
- //#region node_modules/.f/_/signal-exit/3.0.7/signal-exit/index.js
2090
+ //#region node_modules/.f/_/signal-exit/3.0.7/node_modules/signal-exit/index.js
2091
2091
  var require_signal_exit = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2092
2092
  var process = global.process;
2093
2093
  const processOk = function(process) {
@@ -7622,13 +7622,13 @@ cliCursor.toggle = (force, writableStream) => {
7622
7622
  };
7623
7623
 
7624
7624
  //#endregion
7625
- //#region node_modules/.f/_/ansi-regex/6.3.0/ansi-regex/index.js
7625
+ //#region node_modules/.f/_/ansi-regex/6.3.0/node_modules/ansi-regex/index.js
7626
7626
  function ansiRegex$1({ onlyFirst = false } = {}) {
7627
7627
  return new RegExp(`(?:\\u001B\\][^\\u0007\\u001B\\u009C]*(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]`, onlyFirst ? void 0 : "g");
7628
7628
  }
7629
7629
 
7630
7630
  //#endregion
7631
- //#region node_modules/.f/_/strip-ansi/7.2.0/strip-ansi/index.js
7631
+ //#region node_modules/.f/_/strip-ansi/7.2.0/node_modules/strip-ansi/index.js
7632
7632
  const regex$2 = ansiRegex$1();
7633
7633
  function stripAnsi$1(string) {
7634
7634
  if (typeof string !== "string") throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
@@ -10019,6 +10019,7 @@ var VisualLogger = class VisualLogger {
10019
10019
  this._renderInterval = Math.floor(1e3 / options.renderFps + .5);
10020
10020
  this._spinTimers = {};
10021
10021
  this._renderTimer = null;
10022
+ this._rendered = false;
10022
10023
  this._colorPrefix = {};
10023
10024
  this._defaultPrefix = "";
10024
10025
  this._chalkLevel = 0;
@@ -10074,9 +10075,23 @@ var VisualLogger = class VisualLogger {
10074
10075
  return this;
10075
10076
  }
10076
10077
  setItemType(flag) {
10077
- if (!flag) this._itemType = LogItemTypes.none;
10078
- else this._itemType = LogItemTypes[flag] || LogItemTypes.none;
10079
- if (this._itemType === LogItemTypes.normal && !this._output.isTTY()) this._itemType = LogItemTypes.simple;
10078
+ let itemType;
10079
+ if (!flag) itemType = LogItemTypes.none;
10080
+ else itemType = LogItemTypes[flag] || LogItemTypes.none;
10081
+ if (itemType === LogItemTypes.normal && !this._output.isTTY()) itemType = LogItemTypes.simple;
10082
+ if (itemType !== this._itemType) {
10083
+ const wasVisual = this._shouldLogItem();
10084
+ if (wasVisual) {
10085
+ this.clearItems();
10086
+ this._getItemKeys().forEach((k) => {
10087
+ this._stopItemSpinner(this._itemOptions[k]);
10088
+ });
10089
+ }
10090
+ this._itemType = itemType;
10091
+ if (!wasVisual && this._shouldLogItem()) this._getItemKeys().forEach((k) => {
10092
+ this._startItemSpinner(this._itemOptions[k]);
10093
+ });
10094
+ }
10080
10095
  if (this._itemType === LogItemTypes.simple) this._dots = 0;
10081
10096
  return this;
10082
10097
  }
@@ -10165,15 +10180,24 @@ var VisualLogger = class VisualLogger {
10165
10180
  return this;
10166
10181
  }
10167
10182
  clearItems() {
10168
- if (this._shouldLogItem() && this._lines.length > 0) this._output.visual.clear();
10169
- else this._checkSimpleDots();
10183
+ if (this._shouldLogItem()) {
10184
+ this._cancelRender();
10185
+ if (this._rendered) {
10186
+ this._output.visual.clear();
10187
+ this._rendered = false;
10188
+ }
10189
+ } else this._checkSimpleDots();
10170
10190
  return this;
10171
10191
  }
10172
10192
  freezeItems(showItems) {
10173
10193
  this._getItemKeys().forEach((k) => {
10174
10194
  this._stopItemSpinner(this._itemOptions[k]);
10175
10195
  });
10176
- this._output.visual.clear();
10196
+ this._cancelRender();
10197
+ if (this._rendered) {
10198
+ this._output.visual.clear();
10199
+ this._rendered = false;
10200
+ }
10177
10201
  this._resetSimpleDots();
10178
10202
  if (showItems) this._output.write(`${this._lines.join("\n")}\n`);
10179
10203
  this._backupItemType = this._itemType;
@@ -10190,7 +10214,7 @@ var VisualLogger = class VisualLogger {
10190
10214
  }
10191
10215
  shutdown(showItems) {
10192
10216
  this.freezeItems(showItems);
10193
- if (this._renderTimer) clearTimeout(this._renderTimer);
10217
+ this._cancelRender();
10194
10218
  }
10195
10219
  _checkSimpleDots() {
10196
10220
  if (this._itemType === LogItemTypes.simple && this._dots >= this._maxDots) {
@@ -10270,11 +10294,19 @@ var VisualLogger = class VisualLogger {
10270
10294
  this._stopSpinTimer(options);
10271
10295
  return this;
10272
10296
  }
10297
+ _cancelRender() {
10298
+ if (this._renderTimer) {
10299
+ clearTimeout(this._renderTimer);
10300
+ this._renderTimer = null;
10301
+ }
10302
+ }
10273
10303
  _renderOutput() {
10274
10304
  if (!this._renderTimer && this._shouldLogItem() && this._lines.length > 0) {
10275
10305
  this._renderTimer = setTimeout(() => {
10276
10306
  this._renderTimer = null;
10307
+ if (!this._shouldLogItem() || this._lines.length === 0) return;
10277
10308
  this._output.visual.write(this._lines.join("\n"));
10309
+ this._rendered = true;
10278
10310
  }, this._renderInterval);
10279
10311
  this._renderTimer.unref();
10280
10312
  }
@@ -10321,7 +10353,9 @@ var VisualLogger = class VisualLogger {
10321
10353
  return this;
10322
10354
  }
10323
10355
  _shouldLogItem() {
10324
- return this._itemType === LogItemTypes.normal && this._logLevel <= VisualLogger.Levels.info;
10356
+ const { isTTY } = this._output;
10357
+ const tty = typeof isTTY === "function" ? Boolean(isTTY.call(this._output)) : true;
10358
+ return this._itemType === LogItemTypes.normal && this._logLevel <= VisualLogger.Levels.info && tty;
10325
10359
  }
10326
10360
  };
10327
10361
 
@@ -14033,6 +14067,7 @@ var FynpoDepGraph = class {
14033
14067
  * @returns boolean - whether dep is added (it's not if it already exist)
14034
14068
  */
14035
14069
  addDep(pkgInfo, depPkg, depSection, indirectSteps) {
14070
+ if (pkgInfo.path === depPkg.path) return false;
14036
14071
  const dataPkg = this.depMapByPath[pkgInfo.path];
14037
14072
  const dataDep = this.depMapByPath[depPkg.path];
14038
14073
  if (dataPkg.localDepsByPath[depPkg.path]) return false;
@@ -15315,6 +15350,7 @@ var PkgDepResolver = class {
15315
15350
  if (fynpoPkg) {
15316
15351
  const steps = revSteps.reverse();
15317
15352
  locals.forEach((x) => {
15353
+ if (fynpoPkg.path === x.path) return;
15318
15354
  const sec = getDepSection(depSec);
15319
15355
  if (fynpo.graph.addDep(fynpoPkg, x, sec, steps)) fynpo.indirects.push({
15320
15356
  fromPkg: import_lodash_min.default.pick(fynpoPkg, [
@@ -27747,7 +27783,7 @@ var require_index_min$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
27747
27783
  }));
27748
27784
 
27749
27785
  //#endregion
27750
- //#region node_modules/.f/_/which/7.0.0/which/lib/index.js
27786
+ //#region node_modules/.f/_/which/7.0.0/node_modules/which/lib/index.js
27751
27787
  var require_lib$33 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
27752
27788
  const { isexe, sync: isexeSync } = require_index_min$1();
27753
27789
  const { join: join$10, delimiter: delimiter$2, sep: sep$9, posix: posix$1 } = __require("path");
@@ -31591,7 +31627,7 @@ var require_minipass_collect = /* @__PURE__ */ __commonJSMin(((exports, module)
31591
31627
  }));
31592
31628
 
31593
31629
  //#endregion
31594
- //#region node_modules/.f/_/minipass/3.3.6/minipass/index.js
31630
+ //#region node_modules/.f/_/minipass/3.3.6/node_modules/minipass/index.js
31595
31631
  var require_minipass = /* @__PURE__ */ __commonJSMin(((exports, module) => {
31596
31632
  const proc = typeof process === "object" && process ? process : {
31597
31633
  stdout: null,
@@ -83945,7 +83981,7 @@ var require_chmod = /* @__PURE__ */ __commonJSMin(((exports, module) => {
83945
83981
  }));
83946
83982
 
83947
83983
  //#endregion
83948
- //#region node_modules/.f/_/isexe/2.0.0/isexe/windows.js
83984
+ //#region node_modules/.f/_/isexe/2.0.0/node_modules/isexe/windows.js
83949
83985
  var require_windows = /* @__PURE__ */ __commonJSMin(((exports, module) => {
83950
83986
  module.exports = isexe;
83951
83987
  isexe.sync = sync;
@@ -83976,7 +84012,7 @@ var require_windows = /* @__PURE__ */ __commonJSMin(((exports, module) => {
83976
84012
  }));
83977
84013
 
83978
84014
  //#endregion
83979
- //#region node_modules/.f/_/isexe/2.0.0/isexe/mode.js
84015
+ //#region node_modules/.f/_/isexe/2.0.0/node_modules/isexe/mode.js
83980
84016
  var require_mode = /* @__PURE__ */ __commonJSMin(((exports, module) => {
83981
84017
  module.exports = isexe;
83982
84018
  isexe.sync = sync;
@@ -84007,7 +84043,7 @@ var require_mode = /* @__PURE__ */ __commonJSMin(((exports, module) => {
84007
84043
  }));
84008
84044
 
84009
84045
  //#endregion
84010
- //#region node_modules/.f/_/isexe/2.0.0/isexe/index.js
84046
+ //#region node_modules/.f/_/isexe/2.0.0/node_modules/isexe/index.js
84011
84047
  var require_isexe = /* @__PURE__ */ __commonJSMin(((exports, module) => {
84012
84048
  __require("fs");
84013
84049
  var core;
@@ -84422,7 +84458,7 @@ var require_mimic_fn = /* @__PURE__ */ __commonJSMin(((exports, module) => {
84422
84458
  }));
84423
84459
 
84424
84460
  //#endregion
84425
- //#region node_modules/.f/_/onetime/5.1.2/onetime/index.js
84461
+ //#region node_modules/.f/_/onetime/5.1.2/node_modules/onetime/index.js
84426
84462
  var require_onetime = /* @__PURE__ */ __commonJSMin(((exports, module) => {
84427
84463
  const mimicFn = require_mimic_fn();
84428
84464
  const calledFunctions = /* @__PURE__ */ new WeakMap();
@@ -87582,6 +87618,43 @@ function enhanceError(err, context) {
87582
87618
  err.stderr = context.stderr.length > MAX_OUTPUT_IN_ERROR ? context.stderr.slice(-5e4) : context.stderr;
87583
87619
  return err;
87584
87620
  }
87621
+ const ESCAPE_SEQUENCE = /* @__PURE__ */ new RegExp("\x1B(?:\\[[0-?]*[ -/]*[@-~]|[\\]P^_X][\\s\\S]*?(?:\\u0007|\x1B\\\\|$)|[ -/]+[0-~]|[0-~])", "g");
87622
+ const SGR_SEQUENCE = /* @__PURE__ */ new RegExp("^\x1B\\[[0-?]*[ -/]*m$");
87623
+ const HAS_SGR = /* @__PURE__ */ new RegExp("\x1B\\[[0-?]*[ -/]*m");
87624
+ const SGR_RESET = "\x1B[0m";
87625
+ const C1_SEQUENCE = /[\u009B][0-?]*[ -/]*[@-~]|[\u009D\u0090\u009E\u009F][\s\S]*?(?:\u0007|\u009C|$)/g;
87626
+ const C1_CONTROL = /[\u0080-\u009F]/g;
87627
+ const UNSAFE_CONTROL = /[\u0000-\u0008\u000B-\u001A\u001C-\u001F\u007F]/g;
87628
+ /**
87629
+ * Strip terminal control sequences from child output, keeping colour. Never use this for
87630
+ * output written to a file or handed to a callback - those should get the bytes untouched.
87631
+ */
87632
+ function sanitizeText(text, options = {}) {
87633
+ const { tabs = "space", cr = "drop", resetAtEnd = false } = options;
87634
+ let out = text.replace(ESCAPE_SEQUENCE, (seq) => SGR_SEQUENCE.test(seq) ? seq : "");
87635
+ if (cr === "newline") out = out.replace(/\r\n?/g, "\n");
87636
+ out = out.replace(/\t/g, tabs === "keep" ? " " : " ").replace(C1_SEQUENCE, "").replace(C1_CONTROL, "").replace(UNSAFE_CONTROL, "");
87637
+ return resetAtEnd && HAS_SGR.test(out) ? out + SGR_RESET : out;
87638
+ }
87639
+ /** Profile for text squeezed into a single progress line. */
87640
+ function sanitizeForDisplay(text) {
87641
+ return sanitizeText(text, {
87642
+ tabs: "space",
87643
+ cr: "drop"
87644
+ });
87645
+ }
87646
+ /**
87647
+ * Profile for a multi-line transcript written into scrollback: tabs are real formatting,
87648
+ * carriage returns become line breaks so progress redraws stay readable, and a trailing
87649
+ * reset stops an unterminated child colour bleeding into later output.
87650
+ */
87651
+ function sanitizeForOutput(text) {
87652
+ return sanitizeText(text, {
87653
+ tabs: "keep",
87654
+ cr: "newline",
87655
+ resetAtEnd: true
87656
+ });
87657
+ }
87585
87658
  var VisualExec = class {
87586
87659
  constructor(options) {
87587
87660
  this._aborted = false;
@@ -87650,7 +87723,7 @@ var VisualExec = class {
87650
87723
  if (progress) this._onProgress(progress);
87651
87724
  }
87652
87725
  _updateDigest(item, buf) {
87653
- const lines = (item.buf + buf).split("\n").map((x) => x && x.trim()).filter((x) => x);
87726
+ const lines = (item.buf + sanitizeForDisplay(buf)).split("\n").map((x) => x && x.trim()).filter((x) => x);
87654
87727
  const stripLines = lines.map((x) => hasAnsi(x) ? stripAnsi$1(x) : x);
87655
87728
  let length = 0;
87656
87729
  let ix = stripLines.length - 1;
@@ -87842,7 +87915,7 @@ var VisualExec = class {
87842
87915
  this._logger[level](`${chalk.green("No output")} from ${this._outputLabel}`);
87843
87916
  return;
87844
87917
  }
87845
- const colorize = (t) => t.replace(/ERR!/g, chalk.red("ERR!"));
87918
+ const colorize = (t) => sanitizeForOutput(t).replace(/ERR!/g, chalk.red("ERR!"));
87846
87919
  const logs = [chalk.green(">>>"), `Start of output from ${this._outputLabel} ===`];
87847
87920
  if (output.stdout) logs.push(`\n${colorize(output.stdout)}`);
87848
87921
  if (output.stderr) logs.push(chalk.red("\n=== stderr ===\n") + colorize(output.stderr));
@@ -98877,7 +98950,7 @@ const showAudit = (fyn, opts) => {
98877
98950
  };
98878
98951
 
98879
98952
  //#endregion
98880
- //#region node_modules/.f/_/ini/4.1.1/ini/lib/ini.js
98953
+ //#region node_modules/.f/_/ini/4.1.1/node_modules/ini/lib/ini.js
98881
98954
  var require_ini = /* @__PURE__ */ __commonJSMin(((exports, module) => {
98882
98955
  const { hasOwnProperty } = Object.prototype;
98883
98956
  const encode = (obj, opt = {}) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fyn",
3
- "version": "3.0.1",
3
+ "version": "3.0.3",
4
4
  "description": "fyn is the NPM for fynpo -- a zero setup monorepo tool",
5
5
  "main": "./bin/fyn.js",
6
6
  "homepage": "https://github.com/jchip/fynjs/tree/main/packages/fyn",