flavor-code 1.3.23 → 1.4.0-beta.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.
- package/README.md +437 -434
- package/README.zh-CN.md +434 -431
- package/dist/agent/loop.d.ts +3 -0
- package/dist/{app-NTEUPJKJ.js → app-H7RYDMD3.js} +45 -157
- package/dist/{chunk-7OICVL2M.js → chunk-2BF7CVWZ.js} +0 -42
- package/dist/{chunk-VEUSROUQ.js → chunk-3BHKW5A7.js} +1 -1
- package/dist/{chunk-SUSLIHXO.js → chunk-IQAZ42TM.js} +1 -1
- package/dist/{chunk-RPFWB45Y.js → chunk-KBHWS7M6.js} +5 -5
- package/dist/{chunk-Z62P4LL7.js → chunk-NIKCPCJG.js} +9345 -8623
- package/dist/{chunk-RQTYHUMK.js → chunk-ZJCAQXA7.js} +17 -1
- package/dist/{claude-ink-6CEG2XZZ.js → claude-ink-ECZ6QF3P.js} +2 -3
- package/dist/cli-main.js +27 -11
- package/dist/config/load.d.ts +2 -0
- package/dist/desktop/main.js +1550 -816
- package/dist/desktop-renderer/assets/index-Bk6FYhyh.css +1 -0
- package/dist/desktop-renderer/assets/{index-D75ozXnZ.js → index-CYd5JkTR.js} +3 -3
- package/dist/desktop-renderer/assets/{interactive-terminal-CTFo4fK9.js → interactive-terminal-j52Ty3QO.js} +1 -1
- package/dist/desktop-renderer/index.html +2 -2
- package/dist/doctor.d.ts +38 -0
- package/dist/execution/docker.d.ts +5 -1
- package/dist/execution/types.d.ts +11 -0
- package/dist/git/service.d.ts +3 -3
- package/dist/git/tools.d.ts +1 -1
- package/dist/harness/local.d.ts +2 -0
- package/dist/init/project.d.ts +0 -6
- package/dist/jobs/registry.d.ts +2 -1
- package/dist/{load-4FWNXE6F.js → load-SLSL3IWR.js} +1 -1
- package/dist/sdk/index.js +4 -4
- package/dist/tools/lsp.d.ts +13 -10
- package/dist/tools/runtime.d.ts +2 -1
- package/dist/tools/search.d.ts +1 -0
- package/dist/tools/shell.d.ts +17 -12
- package/dist/tools/types.d.ts +2 -1
- package/dist/ui/commands.d.ts +1 -1
- package/dist/ui/session.d.ts +1 -0
- package/dist/update/check.d.ts +20 -0
- package/dist/utils/abort.d.ts +4 -0
- package/dist/utils/execFileNoThrow.d.ts +1 -0
- package/dist/utils/process-tree.d.ts +2 -0
- package/dist/utils/semver.d.ts +3 -0
- package/dist/utils/spawn-executable.d.ts +2 -0
- package/package.json +2 -2
- package//346/212/200/346/234/257/346/226/271/346/241/210/346/212/245/345/221/212.md +5848 -5848
- package/dist/astgraph/db.mjs +0 -237
- package/dist/astgraph/extract.mjs +0 -239
- package/dist/astgraph/flavor-plugin.json +0 -25
- package/dist/astgraph/grammars.mjs +0 -68
- package/dist/astgraph/index.js +0 -301
- package/dist/astgraph/indexer.mjs +0 -175
- package/dist/astgraph/query.mjs +0 -165
- package/dist/astgraph/resolve.mjs +0 -93
- package/dist/astgraph/vendor/tree-sitter-javascript.wasm +0 -0
- package/dist/astgraph/vendor/tree-sitter-tsx.wasm +0 -0
- package/dist/astgraph/vendor/tree-sitter-typescript.wasm +0 -0
- package/dist/astgraph/vendor/tree-sitter.js +0 -3980
- package/dist/astgraph/vendor/tree-sitter.wasm +0 -0
- package/dist/astgraph/vendor/zod/LICENSE +0 -21
- package/dist/astgraph/vendor/zod/index.js +0 -4
- package/dist/astgraph/vendor/zod/locales/index.js +0 -1
- package/dist/astgraph/vendor/zod/locales/package.json +0 -7
- package/dist/astgraph/vendor/zod/package.json +0 -135
- package/dist/astgraph/vendor/zod/v4/classic/checks.js +0 -1
- package/dist/astgraph/vendor/zod/v4/classic/coerce.js +0 -17
- package/dist/astgraph/vendor/zod/v4/classic/compat.js +0 -31
- package/dist/astgraph/vendor/zod/v4/classic/errors.js +0 -48
- package/dist/astgraph/vendor/zod/v4/classic/external.js +0 -20
- package/dist/astgraph/vendor/zod/v4/classic/from-json-schema.js +0 -599
- package/dist/astgraph/vendor/zod/v4/classic/index.js +0 -4
- package/dist/astgraph/vendor/zod/v4/classic/iso.js +0 -30
- package/dist/astgraph/vendor/zod/v4/classic/package.json +0 -7
- package/dist/astgraph/vendor/zod/v4/classic/parse.js +0 -15
- package/dist/astgraph/vendor/zod/v4/classic/schemas.js +0 -1395
- package/dist/astgraph/vendor/zod/v4/core/api.js +0 -1087
- package/dist/astgraph/vendor/zod/v4/core/checks.js +0 -575
- package/dist/astgraph/vendor/zod/v4/core/core.js +0 -78
- package/dist/astgraph/vendor/zod/v4/core/doc.js +0 -35
- package/dist/astgraph/vendor/zod/v4/core/errors.js +0 -185
- package/dist/astgraph/vendor/zod/v4/core/index.js +0 -16
- package/dist/astgraph/vendor/zod/v4/core/json-schema-generator.js +0 -95
- package/dist/astgraph/vendor/zod/v4/core/json-schema-processors.js +0 -601
- package/dist/astgraph/vendor/zod/v4/core/json-schema.js +0 -1
- package/dist/astgraph/vendor/zod/v4/core/package.json +0 -7
- package/dist/astgraph/vendor/zod/v4/core/parse.js +0 -93
- package/dist/astgraph/vendor/zod/v4/core/regexes.js +0 -139
- package/dist/astgraph/vendor/zod/v4/core/registries.js +0 -51
- package/dist/astgraph/vendor/zod/v4/core/schemas.js +0 -2239
- package/dist/astgraph/vendor/zod/v4/core/standard-schema.js +0 -1
- package/dist/astgraph/vendor/zod/v4/core/to-json-schema.js +0 -448
- package/dist/astgraph/vendor/zod/v4/core/util.js +0 -674
- package/dist/astgraph/vendor/zod/v4/core/versions.js +0 -5
- package/dist/astgraph/vendor/zod/v4/index.js +0 -3
- package/dist/astgraph/vendor/zod/v4/locales/ar.js +0 -106
- package/dist/astgraph/vendor/zod/v4/locales/az.js +0 -105
- package/dist/astgraph/vendor/zod/v4/locales/be.js +0 -156
- package/dist/astgraph/vendor/zod/v4/locales/bg.js +0 -120
- package/dist/astgraph/vendor/zod/v4/locales/ca.js +0 -107
- package/dist/astgraph/vendor/zod/v4/locales/cs.js +0 -111
- package/dist/astgraph/vendor/zod/v4/locales/da.js +0 -115
- package/dist/astgraph/vendor/zod/v4/locales/de.js +0 -108
- package/dist/astgraph/vendor/zod/v4/locales/el.js +0 -109
- package/dist/astgraph/vendor/zod/v4/locales/en.js +0 -113
- package/dist/astgraph/vendor/zod/v4/locales/eo.js +0 -109
- package/dist/astgraph/vendor/zod/v4/locales/es.js +0 -132
- package/dist/astgraph/vendor/zod/v4/locales/fa.js +0 -114
- package/dist/astgraph/vendor/zod/v4/locales/fi.js +0 -112
- package/dist/astgraph/vendor/zod/v4/locales/fr-CA.js +0 -107
- package/dist/astgraph/vendor/zod/v4/locales/fr.js +0 -125
- package/dist/astgraph/vendor/zod/v4/locales/he.js +0 -214
- package/dist/astgraph/vendor/zod/v4/locales/hr.js +0 -122
- package/dist/astgraph/vendor/zod/v4/locales/hu.js +0 -108
- package/dist/astgraph/vendor/zod/v4/locales/hy.js +0 -147
- package/dist/astgraph/vendor/zod/v4/locales/id.js +0 -106
- package/dist/astgraph/vendor/zod/v4/locales/index.js +0 -52
- package/dist/astgraph/vendor/zod/v4/locales/is.js +0 -109
- package/dist/astgraph/vendor/zod/v4/locales/it.js +0 -108
- package/dist/astgraph/vendor/zod/v4/locales/ja.js +0 -107
- package/dist/astgraph/vendor/zod/v4/locales/ka.js +0 -112
- package/dist/astgraph/vendor/zod/v4/locales/kh.js +0 -5
- package/dist/astgraph/vendor/zod/v4/locales/km.js +0 -110
- package/dist/astgraph/vendor/zod/v4/locales/ko.js +0 -111
- package/dist/astgraph/vendor/zod/v4/locales/lt.js +0 -203
- package/dist/astgraph/vendor/zod/v4/locales/mk.js +0 -109
- package/dist/astgraph/vendor/zod/v4/locales/ms.js +0 -107
- package/dist/astgraph/vendor/zod/v4/locales/nl.js +0 -110
- package/dist/astgraph/vendor/zod/v4/locales/no.js +0 -108
- package/dist/astgraph/vendor/zod/v4/locales/ota.js +0 -109
- package/dist/astgraph/vendor/zod/v4/locales/package.json +0 -7
- package/dist/astgraph/vendor/zod/v4/locales/pl.js +0 -109
- package/dist/astgraph/vendor/zod/v4/locales/ps.js +0 -114
- package/dist/astgraph/vendor/zod/v4/locales/pt.js +0 -108
- package/dist/astgraph/vendor/zod/v4/locales/ro.js +0 -119
- package/dist/astgraph/vendor/zod/v4/locales/ru.js +0 -156
- package/dist/astgraph/vendor/zod/v4/locales/sl.js +0 -109
- package/dist/astgraph/vendor/zod/v4/locales/sv.js +0 -110
- package/dist/astgraph/vendor/zod/v4/locales/ta.js +0 -110
- package/dist/astgraph/vendor/zod/v4/locales/th.js +0 -110
- package/dist/astgraph/vendor/zod/v4/locales/tr.js +0 -105
- package/dist/astgraph/vendor/zod/v4/locales/ua.js +0 -5
- package/dist/astgraph/vendor/zod/v4/locales/uk.js +0 -108
- package/dist/astgraph/vendor/zod/v4/locales/ur.js +0 -110
- package/dist/astgraph/vendor/zod/v4/locales/uz.js +0 -110
- package/dist/astgraph/vendor/zod/v4/locales/vi.js +0 -108
- package/dist/astgraph/vendor/zod/v4/locales/yo.js +0 -107
- package/dist/astgraph/vendor/zod/v4/locales/zh-CN.js +0 -109
- package/dist/astgraph/vendor/zod/v4/locales/zh-TW.js +0 -107
- package/dist/astgraph/vendor/zod/v4/mini/checks.js +0 -1
- package/dist/astgraph/vendor/zod/v4/mini/coerce.js +0 -22
- package/dist/astgraph/vendor/zod/v4/mini/external.js +0 -14
- package/dist/astgraph/vendor/zod/v4/mini/index.js +0 -3
- package/dist/astgraph/vendor/zod/v4/mini/iso.js +0 -34
- package/dist/astgraph/vendor/zod/v4/mini/package.json +0 -7
- package/dist/astgraph/vendor/zod/v4/mini/parse.js +0 -1
- package/dist/astgraph/vendor/zod/v4/mini/schemas.js +0 -961
- package/dist/astgraph/vendor/zod/v4/package.json +0 -7
- package/dist/chunk-OTYFL4AG.js +0 -16
- package/dist/desktop-renderer/assets/index-ZZsUx916.css +0 -1
package/dist/agent/loop.d.ts
CHANGED
|
@@ -46,6 +46,9 @@ export declare class AgentLoop {
|
|
|
46
46
|
constructor(options: AgentLoopOptions);
|
|
47
47
|
get modelId(): string;
|
|
48
48
|
get iterationLimitMode(): "standard" | "d2c";
|
|
49
|
+
get maxIterations(): number;
|
|
50
|
+
get softLimitFactor(): number;
|
|
51
|
+
get extendIterations(): number;
|
|
49
52
|
setModel(modelId: string): void;
|
|
50
53
|
setFallbackModel(modelId: string): void;
|
|
51
54
|
/** D2C keeps a hard cap, but may automatically expand it up to ten times. */
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
|
-
checkForUpdate,
|
|
5
4
|
statusPresentation
|
|
6
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-2BF7CVWZ.js";
|
|
7
6
|
import {
|
|
8
7
|
COMMAND_DESCRIPTIONS,
|
|
9
8
|
MVP_COMMANDS,
|
|
10
9
|
charWidth,
|
|
10
|
+
checkForUpdate,
|
|
11
11
|
createGlobTool,
|
|
12
12
|
createProductionRuntime,
|
|
13
13
|
createTranscriptState,
|
|
@@ -19,9 +19,9 @@ import {
|
|
|
19
19
|
thinkingWindow,
|
|
20
20
|
transcriptReducer,
|
|
21
21
|
withTimeout
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-NIKCPCJG.js";
|
|
23
23
|
import "./chunk-CIVPKHF4.js";
|
|
24
|
-
import "./chunk-
|
|
24
|
+
import "./chunk-KBHWS7M6.js";
|
|
25
25
|
import {
|
|
26
26
|
Box_default,
|
|
27
27
|
ClockContext,
|
|
@@ -38,11 +38,10 @@ import {
|
|
|
38
38
|
useStdout,
|
|
39
39
|
use_app_default,
|
|
40
40
|
use_input_default
|
|
41
|
-
} from "./chunk-
|
|
42
|
-
import "./chunk-OTYFL4AG.js";
|
|
41
|
+
} from "./chunk-IQAZ42TM.js";
|
|
43
42
|
import {
|
|
44
43
|
execFileNoThrow
|
|
45
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-ZJCAQXA7.js";
|
|
46
45
|
import "./chunk-S32JRDZK.js";
|
|
47
46
|
|
|
48
47
|
// src/ui/app.tsx
|
|
@@ -1308,7 +1307,7 @@ function WelcomeCard({
|
|
|
1308
1307
|
columns
|
|
1309
1308
|
}) {
|
|
1310
1309
|
const wide = Math.max(1, Math.floor(columns)) >= WIDE_WELCOME_COLUMNS;
|
|
1311
|
-
const updateHint = updateTo === void 0 ? null : /* @__PURE__ */ jsxs3(Text, { color: "yellowBright", wrap: "
|
|
1310
|
+
const updateHint = updateTo === void 0 ? null : /* @__PURE__ */ jsxs3(Text, { color: "yellowBright", wrap: "wrap", children: [
|
|
1312
1311
|
"\u25B2 ",
|
|
1313
1312
|
"Update available: v",
|
|
1314
1313
|
packageVersion(),
|
|
@@ -1316,7 +1315,7 @@ function WelcomeCard({
|
|
|
1316
1315
|
"\u2192",
|
|
1317
1316
|
" v",
|
|
1318
1317
|
updateTo,
|
|
1319
|
-
"
|
|
1318
|
+
"\nRun: flavor update"
|
|
1320
1319
|
] });
|
|
1321
1320
|
return /* @__PURE__ */ jsx4(Box_default, { width: "100%", borderStyle: "round", borderColor: "yellow", paddingX: 1, children: wide ? /* @__PURE__ */ jsxs3(Box_default, { width: "100%", flexDirection: "row", children: [
|
|
1322
1321
|
/* @__PURE__ */ jsxs3(
|
|
@@ -1523,160 +1522,45 @@ function isBridgeMethod(value, method) {
|
|
|
1523
1522
|
&& typeof value[method] === "function";
|
|
1524
1523
|
}
|
|
1525
1524
|
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
return isBridgeMethod(converted, "base64EncodedStringWithOptions")
|
|
1550
|
-
? converted
|
|
1551
|
-
: null;
|
|
1552
|
-
} catch (error) {
|
|
1553
|
-
return null;
|
|
1554
|
-
}
|
|
1555
|
-
}
|
|
1556
|
-
|
|
1557
|
-
function base64FromData(data) {
|
|
1558
|
-
if (!isBridgeMethod(data, "base64EncodedStringWithOptions")) {
|
|
1559
|
-
return null;
|
|
1560
|
-
}
|
|
1561
|
-
try {
|
|
1562
|
-
const encoded = data.base64EncodedStringWithOptions(0);
|
|
1563
|
-
if (!encoded) {
|
|
1564
|
-
return null;
|
|
1565
|
-
}
|
|
1566
|
-
const unwrapped = ObjC.unwrap(encoded);
|
|
1567
|
-
return typeof unwrapped === "string" && unwrapped.length > 0
|
|
1568
|
-
? unwrapped
|
|
1569
|
-
: null;
|
|
1570
|
-
} catch (error) {
|
|
1571
|
-
return null;
|
|
1572
|
-
}
|
|
1573
|
-
}
|
|
1574
|
-
|
|
1575
|
-
function firstReadableObject(pasteboard, objectClass) {
|
|
1576
|
-
try {
|
|
1577
|
-
if (!isBridgeMethod(pasteboard, "readObjectsForClassesOptions")) {
|
|
1578
|
-
return null;
|
|
1579
|
-
}
|
|
1580
|
-
const classes = $.NSArray.arrayWithObject(objectClass);
|
|
1581
|
-
const objects = pasteboard.readObjectsForClassesOptions(classes, $({}));
|
|
1582
|
-
return objects === null || objects === undefined ? null : objects.firstObject;
|
|
1583
|
-
} catch (error) {
|
|
1584
|
-
return null;
|
|
1585
|
-
}
|
|
1586
|
-
}
|
|
1587
|
-
|
|
1588
|
-
function imageFromWholePasteboard(pasteboard) {
|
|
1589
|
-
try {
|
|
1590
|
-
const image = $.NSImage.alloc.initWithPasteboard(pasteboard);
|
|
1591
|
-
return image === null || image === undefined ? null : image;
|
|
1592
|
-
} catch (error) {
|
|
1593
|
-
return null;
|
|
1594
|
-
}
|
|
1595
|
-
}
|
|
1596
|
-
|
|
1597
|
-
function imageFromFileUrl(pasteboard) {
|
|
1598
|
-
try {
|
|
1599
|
-
const url = firstReadableObject(pasteboard, $.NSURL);
|
|
1600
|
-
if (url === null || url === undefined || !url.isFileURL) {
|
|
1601
|
-
return null;
|
|
1602
|
-
}
|
|
1603
|
-
const image = $.NSImage.alloc.initWithContentsOfURL(url);
|
|
1604
|
-
return image === null || image === undefined ? null : image;
|
|
1605
|
-
} catch (error) {
|
|
1606
|
-
return null;
|
|
1607
|
-
}
|
|
1608
|
-
}
|
|
1609
|
-
|
|
1610
|
-
function base64FromImage(image) {
|
|
1611
|
-
try {
|
|
1612
|
-
return image === null || image === undefined
|
|
1613
|
-
? null
|
|
1614
|
-
: base64FromData(pngDataFromTiff(image.TIFFRepresentation));
|
|
1615
|
-
} catch (error) {
|
|
1616
|
-
return null;
|
|
1617
|
-
}
|
|
1618
|
-
}
|
|
1619
|
-
|
|
1620
|
-
function pasteboardTypeNames(pasteboard) {
|
|
1621
|
-
try {
|
|
1622
|
-
const types = pasteboard.types;
|
|
1623
|
-
if (!isBridgeMethod(types, "objectAtIndex")) {
|
|
1624
|
-
return [];
|
|
1625
|
-
}
|
|
1626
|
-
const count = Number(types.count);
|
|
1627
|
-
const names = [];
|
|
1628
|
-
for (let index = 0; index < count; index += 1) {
|
|
1629
|
-
const name = ObjC.unwrap(types.objectAtIndex(index));
|
|
1630
|
-
if (typeof name === "string") {
|
|
1631
|
-
names.push(name);
|
|
1525
|
+
try {
|
|
1526
|
+
const pasteboard = $.NSPasteboard.generalPasteboard;
|
|
1527
|
+
let data = null;
|
|
1528
|
+
if (isBridgeMethod(pasteboard, "dataForType")) {
|
|
1529
|
+
const png = pasteboard.dataForType($.NSPasteboardTypePNG);
|
|
1530
|
+
if (isBridgeMethod(png, "base64EncodedStringWithOptions")) {
|
|
1531
|
+
data = png;
|
|
1532
|
+
} else {
|
|
1533
|
+
const tiff = pasteboard.dataForType($.NSPasteboardTypeTIFF);
|
|
1534
|
+
// NSData.length is exposed by JXA as a property value, not a
|
|
1535
|
+
// callable bridge method. Probe a real NSData method so a valid
|
|
1536
|
+
// TIFF-only pasteboard item is not mistaken for ObjC nil.
|
|
1537
|
+
if (isBridgeMethod(tiff, "base64EncodedStringWithOptions")) {
|
|
1538
|
+
const representation = $.NSBitmapImageRep.imageRepWithData(tiff);
|
|
1539
|
+
if (isBridgeMethod(representation, "representationUsingTypeProperties")) {
|
|
1540
|
+
const converted = representation.representationUsingTypeProperties(
|
|
1541
|
+
$.NSBitmapImageFileTypePNG,
|
|
1542
|
+
$.NSDictionary.dictionary
|
|
1543
|
+
);
|
|
1544
|
+
if (isBridgeMethod(converted, "base64EncodedStringWithOptions")) {
|
|
1545
|
+
data = converted;
|
|
1546
|
+
}
|
|
1547
|
+
}
|
|
1632
1548
|
}
|
|
1633
1549
|
}
|
|
1634
|
-
return names;
|
|
1635
|
-
} catch (error) {
|
|
1636
|
-
return [];
|
|
1637
1550
|
}
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
const pasteboard = $.NSPasteboard.generalPasteboard;
|
|
1641
|
-
let encoded = base64FromData(safeDataForType(pasteboard, $("public.png")));
|
|
1642
|
-
|
|
1643
|
-
if (!encoded) {
|
|
1644
|
-
encoded = base64FromData(
|
|
1645
|
-
pngDataFromTiff(safeDataForType(pasteboard, $("public.tiff")))
|
|
1646
|
-
);
|
|
1647
|
-
}
|
|
1648
|
-
|
|
1649
|
-
// Ask AppKit for objects conforming to NSPasteboardReading. This covers image
|
|
1650
|
-
// formats and lazy providers that do not expose direct PNG/TIFF NSData.
|
|
1651
|
-
if (!encoded) {
|
|
1652
|
-
encoded = base64FromImage(firstReadableObject(pasteboard, $.NSImage));
|
|
1653
|
-
}
|
|
1654
|
-
|
|
1655
|
-
if (!encoded) {
|
|
1656
|
-
encoded = base64FromImage(imageFromWholePasteboard(pasteboard));
|
|
1657
|
-
}
|
|
1658
|
-
|
|
1659
|
-
// Finder copies files as file URLs instead of image bytes. Load the first
|
|
1660
|
-
// local file through NSImage, which also rejects non-image files.
|
|
1661
|
-
if (!encoded) {
|
|
1662
|
-
encoded = base64FromImage(imageFromFileUrl(pasteboard));
|
|
1663
|
-
}
|
|
1664
|
-
|
|
1665
|
-
if (!encoded) {
|
|
1666
|
-
const types = pasteboardTypeNames(pasteboard);
|
|
1667
|
-
const advertisedImage = types.some(function (type) {
|
|
1668
|
-
return /image|png|tiff|jpeg|jpg|heic|gif|webp|bmp|pdf|file-url|filenames/i.test(type);
|
|
1669
|
-
});
|
|
1670
|
-
if (advertisedImage) {
|
|
1671
|
-
throw new Error(
|
|
1672
|
-
"Clipboard advertises image or file data but AppKit could not decode it. Types: "
|
|
1673
|
-
+ types.join(", ")
|
|
1674
|
-
);
|
|
1551
|
+
if (!data) {
|
|
1552
|
+
$.exit(3);
|
|
1675
1553
|
}
|
|
1554
|
+
const encoded = data.base64EncodedStringWithOptions(0);
|
|
1555
|
+
if (!encoded) {
|
|
1556
|
+
$.exit(3);
|
|
1557
|
+
}
|
|
1558
|
+
const output = encoded.stringByAppendingString("\n")
|
|
1559
|
+
.dataUsingEncoding($.NSUTF8StringEncoding);
|
|
1560
|
+
$.NSFileHandle.fileHandleWithStandardOutput.writeData(output);
|
|
1561
|
+
} catch (error) {
|
|
1676
1562
|
$.exit(3);
|
|
1677
1563
|
}
|
|
1678
|
-
|
|
1679
|
-
console.log(encoded);
|
|
1680
1564
|
`.trim();
|
|
1681
1565
|
function shouldReadClipboardImage(input, key, isPasted) {
|
|
1682
1566
|
return (key.ctrl || key.meta === true) && input.toLowerCase() === "v" || isPasted && input.length === 0;
|
|
@@ -3252,6 +3136,10 @@ function CommandPresentationView({
|
|
|
3252
3136
|
] }),
|
|
3253
3137
|
stdout.total === 0 ? null : /* @__PURE__ */ jsx5(CommandOutputSection, { label: "OUTPUT", value: stdout, tone, error: false }),
|
|
3254
3138
|
stderr.total === 0 ? null : /* @__PURE__ */ jsx5(CommandOutputSection, { label: "ERROR", value: stderr, tone, error: true }),
|
|
3139
|
+
presentation.diagnostic === void 0 ? null : /* @__PURE__ */ jsxs4(Box_default, { children: [
|
|
3140
|
+
/* @__PURE__ */ jsx5(Text, { color: tone, children: "\u2502 " }),
|
|
3141
|
+
/* @__PURE__ */ jsx5(Text, { color: tone, children: presentation.diagnostic })
|
|
3142
|
+
] }),
|
|
3255
3143
|
/* @__PURE__ */ jsxs4(Box_default, { children: [
|
|
3256
3144
|
/* @__PURE__ */ jsx5(Text, { color: tone, children: "\u2514\u2500 " }),
|
|
3257
3145
|
/* @__PURE__ */ jsx5(Text, { dimColor: true, children: commandFooter(presentation, state) })
|
|
@@ -1,44 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
3
|
-
import {
|
|
4
|
-
gt,
|
|
5
|
-
isValidVersion
|
|
6
|
-
} from "./chunk-OTYFL4AG.js";
|
|
7
|
-
|
|
8
|
-
// src/update/check.ts
|
|
9
|
-
var NPM_PACKAGE_NAME = "flavor-code";
|
|
10
|
-
var REGISTRY_LATEST_URL = `https://registry.npmjs.org/${NPM_PACKAGE_NAME}/latest`;
|
|
11
|
-
var DEFAULT_TIMEOUT_MS = 3e3;
|
|
12
|
-
function findNewerVersion(current, latest) {
|
|
13
|
-
if (!isValidVersion(current) || !isValidVersion(latest)) return void 0;
|
|
14
|
-
return gt(latest, current) ? latest : void 0;
|
|
15
|
-
}
|
|
16
|
-
async function fetchLatestVersion(options = {}) {
|
|
17
|
-
const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
18
|
-
const fetchImpl = options.fetchImpl ?? ((url, init) => fetch(url, init));
|
|
19
|
-
let timer;
|
|
20
|
-
const timeout = new Promise((resolve) => {
|
|
21
|
-
timer = setTimeout(() => resolve(void 0), timeoutMs);
|
|
22
|
-
timer.unref?.();
|
|
23
|
-
});
|
|
24
|
-
try {
|
|
25
|
-
const response = await Promise.race([
|
|
26
|
-
fetchImpl(REGISTRY_LATEST_URL, { signal: AbortSignal.timeout(timeoutMs) }),
|
|
27
|
-
timeout
|
|
28
|
-
]);
|
|
29
|
-
if (response === void 0 || !response.ok) return void 0;
|
|
30
|
-
const body = await Promise.race([response.json(), timeout]);
|
|
31
|
-
return typeof body?.version === "string" ? body.version : void 0;
|
|
32
|
-
} catch {
|
|
33
|
-
return void 0;
|
|
34
|
-
} finally {
|
|
35
|
-
if (timer !== void 0) clearTimeout(timer);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
async function checkForUpdate(current, options = {}) {
|
|
39
|
-
const latest = await fetchLatestVersion(options);
|
|
40
|
-
return latest === void 0 ? void 0 : findNewerVersion(current, latest);
|
|
41
|
-
}
|
|
42
3
|
|
|
43
4
|
// src/ui/task-progress-model.ts
|
|
44
5
|
var FRAMES = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
|
|
@@ -155,9 +116,6 @@ function stripSubagentPrefix(text, isSubagent) {
|
|
|
155
116
|
}
|
|
156
117
|
|
|
157
118
|
export {
|
|
158
|
-
NPM_PACKAGE_NAME,
|
|
159
|
-
fetchLatestVersion,
|
|
160
|
-
checkForUpdate,
|
|
161
119
|
staticTaskLines,
|
|
162
120
|
statusPresentation
|
|
163
121
|
};
|
|
@@ -117,13 +117,13 @@ var FlavorConfigSchema = z.object({
|
|
|
117
117
|
evaluationTimeoutMs: z.number().int().min(100).max(3e4).default(2e3)
|
|
118
118
|
}).prefault({}),
|
|
119
119
|
maxIterations: z.object({
|
|
120
|
-
main: z.number().int().min(10).max(500).default(
|
|
121
|
-
subagent: z.number().int().min(10).max(200).default(
|
|
120
|
+
main: z.number().int().min(10).max(500).default(300),
|
|
121
|
+
subagent: z.number().int().min(10).max(200).default(100),
|
|
122
122
|
softLimitFactor: z.number().min(0.5).max(1).default(0.8),
|
|
123
|
-
extendBy: z.number().int().min(5).max(100).default(
|
|
123
|
+
extendBy: z.number().int().min(5).max(100).default(50)
|
|
124
124
|
}).prefault({}),
|
|
125
125
|
loop: z.object({
|
|
126
|
-
maxCycles: z.number().int().positive().max(1e4).default(
|
|
126
|
+
maxCycles: z.number().int().positive().max(1e4).default(100),
|
|
127
127
|
maxTokens: z.number().int().positive().max(Number.MAX_SAFE_INTEGER).default(5e5),
|
|
128
128
|
isolation: z.literal("auto").default("auto")
|
|
129
129
|
}).prefault({}),
|
|
@@ -541,7 +541,7 @@ async function loadConfig(options) {
|
|
|
541
541
|
process.env[key] = value;
|
|
542
542
|
}
|
|
543
543
|
}
|
|
544
|
-
await seedGlobalEnv(globalEnvPath);
|
|
544
|
+
if (options.seedGlobalEnv !== false) await seedGlobalEnv(globalEnvPath);
|
|
545
545
|
const projectRead = await readJsonIfPresent(projectPath);
|
|
546
546
|
const projectConfig = projectRead?.value;
|
|
547
547
|
if (projectRead) sources.push(projectRead.source);
|