fyn 3.0.1 → 3.0.2
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/bin/.temp/sample-input.json +63 -0
- package/dist/fyn.mjs +92 -21
- package/package.json +1 -1
|
@@ -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
|
-
|
|
10078
|
-
|
|
10079
|
-
|
|
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()
|
|
10169
|
-
|
|
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.
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
|
@@ -27747,7 +27781,7 @@ var require_index_min$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
27747
27781
|
}));
|
|
27748
27782
|
|
|
27749
27783
|
//#endregion
|
|
27750
|
-
//#region node_modules/.f/_/which/7.0.0/which/lib/index.js
|
|
27784
|
+
//#region node_modules/.f/_/which/7.0.0/node_modules/which/lib/index.js
|
|
27751
27785
|
var require_lib$33 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
27752
27786
|
const { isexe, sync: isexeSync } = require_index_min$1();
|
|
27753
27787
|
const { join: join$10, delimiter: delimiter$2, sep: sep$9, posix: posix$1 } = __require("path");
|
|
@@ -31591,7 +31625,7 @@ var require_minipass_collect = /* @__PURE__ */ __commonJSMin(((exports, module)
|
|
|
31591
31625
|
}));
|
|
31592
31626
|
|
|
31593
31627
|
//#endregion
|
|
31594
|
-
//#region node_modules/.f/_/minipass/3.3.6/minipass/index.js
|
|
31628
|
+
//#region node_modules/.f/_/minipass/3.3.6/node_modules/minipass/index.js
|
|
31595
31629
|
var require_minipass = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
31596
31630
|
const proc = typeof process === "object" && process ? process : {
|
|
31597
31631
|
stdout: null,
|
|
@@ -83945,7 +83979,7 @@ var require_chmod = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
83945
83979
|
}));
|
|
83946
83980
|
|
|
83947
83981
|
//#endregion
|
|
83948
|
-
//#region node_modules/.f/_/isexe/2.0.0/isexe/windows.js
|
|
83982
|
+
//#region node_modules/.f/_/isexe/2.0.0/node_modules/isexe/windows.js
|
|
83949
83983
|
var require_windows = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
83950
83984
|
module.exports = isexe;
|
|
83951
83985
|
isexe.sync = sync;
|
|
@@ -83976,7 +84010,7 @@ var require_windows = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
83976
84010
|
}));
|
|
83977
84011
|
|
|
83978
84012
|
//#endregion
|
|
83979
|
-
//#region node_modules/.f/_/isexe/2.0.0/isexe/mode.js
|
|
84013
|
+
//#region node_modules/.f/_/isexe/2.0.0/node_modules/isexe/mode.js
|
|
83980
84014
|
var require_mode = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
83981
84015
|
module.exports = isexe;
|
|
83982
84016
|
isexe.sync = sync;
|
|
@@ -84007,7 +84041,7 @@ var require_mode = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
84007
84041
|
}));
|
|
84008
84042
|
|
|
84009
84043
|
//#endregion
|
|
84010
|
-
//#region node_modules/.f/_/isexe/2.0.0/isexe/index.js
|
|
84044
|
+
//#region node_modules/.f/_/isexe/2.0.0/node_modules/isexe/index.js
|
|
84011
84045
|
var require_isexe = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
84012
84046
|
__require("fs");
|
|
84013
84047
|
var core;
|
|
@@ -84422,7 +84456,7 @@ var require_mimic_fn = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
84422
84456
|
}));
|
|
84423
84457
|
|
|
84424
84458
|
//#endregion
|
|
84425
|
-
//#region node_modules/.f/_/onetime/5.1.2/onetime/index.js
|
|
84459
|
+
//#region node_modules/.f/_/onetime/5.1.2/node_modules/onetime/index.js
|
|
84426
84460
|
var require_onetime = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
84427
84461
|
const mimicFn = require_mimic_fn();
|
|
84428
84462
|
const calledFunctions = /* @__PURE__ */ new WeakMap();
|
|
@@ -87582,6 +87616,43 @@ function enhanceError(err, context) {
|
|
|
87582
87616
|
err.stderr = context.stderr.length > MAX_OUTPUT_IN_ERROR ? context.stderr.slice(-5e4) : context.stderr;
|
|
87583
87617
|
return err;
|
|
87584
87618
|
}
|
|
87619
|
+
const ESCAPE_SEQUENCE = /* @__PURE__ */ new RegExp("\x1B(?:\\[[0-?]*[ -/]*[@-~]|[\\]P^_X][\\s\\S]*?(?:\\u0007|\x1B\\\\|$)|[ -/]+[0-~]|[0-~])", "g");
|
|
87620
|
+
const SGR_SEQUENCE = /* @__PURE__ */ new RegExp("^\x1B\\[[0-?]*[ -/]*m$");
|
|
87621
|
+
const HAS_SGR = /* @__PURE__ */ new RegExp("\x1B\\[[0-?]*[ -/]*m");
|
|
87622
|
+
const SGR_RESET = "\x1B[0m";
|
|
87623
|
+
const C1_SEQUENCE = /[\u009B][0-?]*[ -/]*[@-~]|[\u009D\u0090\u009E\u009F][\s\S]*?(?:\u0007|\u009C|$)/g;
|
|
87624
|
+
const C1_CONTROL = /[\u0080-\u009F]/g;
|
|
87625
|
+
const UNSAFE_CONTROL = /[\u0000-\u0008\u000B-\u001A\u001C-\u001F\u007F]/g;
|
|
87626
|
+
/**
|
|
87627
|
+
* Strip terminal control sequences from child output, keeping colour. Never use this for
|
|
87628
|
+
* output written to a file or handed to a callback - those should get the bytes untouched.
|
|
87629
|
+
*/
|
|
87630
|
+
function sanitizeText(text, options = {}) {
|
|
87631
|
+
const { tabs = "space", cr = "drop", resetAtEnd = false } = options;
|
|
87632
|
+
let out = text.replace(ESCAPE_SEQUENCE, (seq) => SGR_SEQUENCE.test(seq) ? seq : "");
|
|
87633
|
+
if (cr === "newline") out = out.replace(/\r\n?/g, "\n");
|
|
87634
|
+
out = out.replace(/\t/g, tabs === "keep" ? " " : " ").replace(C1_SEQUENCE, "").replace(C1_CONTROL, "").replace(UNSAFE_CONTROL, "");
|
|
87635
|
+
return resetAtEnd && HAS_SGR.test(out) ? out + SGR_RESET : out;
|
|
87636
|
+
}
|
|
87637
|
+
/** Profile for text squeezed into a single progress line. */
|
|
87638
|
+
function sanitizeForDisplay(text) {
|
|
87639
|
+
return sanitizeText(text, {
|
|
87640
|
+
tabs: "space",
|
|
87641
|
+
cr: "drop"
|
|
87642
|
+
});
|
|
87643
|
+
}
|
|
87644
|
+
/**
|
|
87645
|
+
* Profile for a multi-line transcript written into scrollback: tabs are real formatting,
|
|
87646
|
+
* carriage returns become line breaks so progress redraws stay readable, and a trailing
|
|
87647
|
+
* reset stops an unterminated child colour bleeding into later output.
|
|
87648
|
+
*/
|
|
87649
|
+
function sanitizeForOutput(text) {
|
|
87650
|
+
return sanitizeText(text, {
|
|
87651
|
+
tabs: "keep",
|
|
87652
|
+
cr: "newline",
|
|
87653
|
+
resetAtEnd: true
|
|
87654
|
+
});
|
|
87655
|
+
}
|
|
87585
87656
|
var VisualExec = class {
|
|
87586
87657
|
constructor(options) {
|
|
87587
87658
|
this._aborted = false;
|
|
@@ -87650,7 +87721,7 @@ var VisualExec = class {
|
|
|
87650
87721
|
if (progress) this._onProgress(progress);
|
|
87651
87722
|
}
|
|
87652
87723
|
_updateDigest(item, buf) {
|
|
87653
|
-
const lines = (item.buf + buf).split("\n").map((x) => x && x.trim()).filter((x) => x);
|
|
87724
|
+
const lines = (item.buf + sanitizeForDisplay(buf)).split("\n").map((x) => x && x.trim()).filter((x) => x);
|
|
87654
87725
|
const stripLines = lines.map((x) => hasAnsi(x) ? stripAnsi$1(x) : x);
|
|
87655
87726
|
let length = 0;
|
|
87656
87727
|
let ix = stripLines.length - 1;
|
|
@@ -87842,7 +87913,7 @@ var VisualExec = class {
|
|
|
87842
87913
|
this._logger[level](`${chalk.green("No output")} from ${this._outputLabel}`);
|
|
87843
87914
|
return;
|
|
87844
87915
|
}
|
|
87845
|
-
const colorize = (t) => t.replace(/ERR!/g, chalk.red("ERR!"));
|
|
87916
|
+
const colorize = (t) => sanitizeForOutput(t).replace(/ERR!/g, chalk.red("ERR!"));
|
|
87846
87917
|
const logs = [chalk.green(">>>"), `Start of output from ${this._outputLabel} ===`];
|
|
87847
87918
|
if (output.stdout) logs.push(`\n${colorize(output.stdout)}`);
|
|
87848
87919
|
if (output.stderr) logs.push(chalk.red("\n=== stderr ===\n") + colorize(output.stderr));
|
|
@@ -98877,7 +98948,7 @@ const showAudit = (fyn, opts) => {
|
|
|
98877
98948
|
};
|
|
98878
98949
|
|
|
98879
98950
|
//#endregion
|
|
98880
|
-
//#region node_modules/.f/_/ini/4.1.1/ini/lib/ini.js
|
|
98951
|
+
//#region node_modules/.f/_/ini/4.1.1/node_modules/ini/lib/ini.js
|
|
98881
98952
|
var require_ini = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
98882
98953
|
const { hasOwnProperty } = Object.prototype;
|
|
98883
98954
|
const encode = (obj, opt = {}) => {
|