@hasna/coders 0.0.11 → 0.0.12
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/dist/cli.mjs +55 -49
- package/dist/cli.mjs.map +3 -3
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -17648,7 +17648,7 @@ var require_react_reconciler_development = __commonJS({
|
|
|
17648
17648
|
var HostPortal = 4;
|
|
17649
17649
|
var HostComponent = 5;
|
|
17650
17650
|
var HostText = 6;
|
|
17651
|
-
var
|
|
17651
|
+
var Fragment = 7;
|
|
17652
17652
|
var Mode = 8;
|
|
17653
17653
|
var ContextConsumer = 9;
|
|
17654
17654
|
var ContextProvider = 10;
|
|
@@ -17788,7 +17788,7 @@ var require_react_reconciler_development = __commonJS({
|
|
|
17788
17788
|
return "DehydratedFragment";
|
|
17789
17789
|
case ForwardRef:
|
|
17790
17790
|
return getWrappedName$1(type, type.render, "ForwardRef");
|
|
17791
|
-
case
|
|
17791
|
+
case Fragment:
|
|
17792
17792
|
return "Fragment";
|
|
17793
17793
|
case HostComponent:
|
|
17794
17794
|
return type;
|
|
@@ -20922,7 +20922,7 @@ var require_react_reconciler_development = __commonJS({
|
|
|
20922
20922
|
}
|
|
20923
20923
|
}
|
|
20924
20924
|
function updateFragment2(returnFiber, current2, fragment, lanes, key) {
|
|
20925
|
-
if (current2 === null || current2.tag !==
|
|
20925
|
+
if (current2 === null || current2.tag !== Fragment) {
|
|
20926
20926
|
var created = createFiberFromFragment(fragment, returnFiber.mode, lanes, key);
|
|
20927
20927
|
created.return = returnFiber;
|
|
20928
20928
|
return created;
|
|
@@ -21325,7 +21325,7 @@ var require_react_reconciler_development = __commonJS({
|
|
|
21325
21325
|
if (child.key === key) {
|
|
21326
21326
|
var elementType = element.type;
|
|
21327
21327
|
if (elementType === REACT_FRAGMENT_TYPE) {
|
|
21328
|
-
if (child.tag ===
|
|
21328
|
+
if (child.tag === Fragment) {
|
|
21329
21329
|
deleteRemainingChildren(returnFiber, child.sibling);
|
|
21330
21330
|
var existing = useFiber(child, element.props.children);
|
|
21331
21331
|
existing.return = returnFiber;
|
|
@@ -26816,7 +26816,7 @@ var require_react_reconciler_development = __commonJS({
|
|
|
26816
26816
|
var _resolvedProps2 = workInProgress2.elementType === type ? _unresolvedProps2 : resolveDefaultProps(type, _unresolvedProps2);
|
|
26817
26817
|
return updateForwardRef(current2, workInProgress2, type, _resolvedProps2, renderLanes2);
|
|
26818
26818
|
}
|
|
26819
|
-
case
|
|
26819
|
+
case Fragment:
|
|
26820
26820
|
return updateFragment(current2, workInProgress2, renderLanes2);
|
|
26821
26821
|
case Mode:
|
|
26822
26822
|
return updateMode(current2, workInProgress2, renderLanes2);
|
|
@@ -27253,7 +27253,7 @@ var require_react_reconciler_development = __commonJS({
|
|
|
27253
27253
|
case SimpleMemoComponent:
|
|
27254
27254
|
case FunctionComponent:
|
|
27255
27255
|
case ForwardRef:
|
|
27256
|
-
case
|
|
27256
|
+
case Fragment:
|
|
27257
27257
|
case Mode:
|
|
27258
27258
|
case Profiler:
|
|
27259
27259
|
case ContextConsumer:
|
|
@@ -32021,7 +32021,7 @@ var require_react_reconciler_development = __commonJS({
|
|
|
32021
32021
|
return fiber;
|
|
32022
32022
|
}
|
|
32023
32023
|
function createFiberFromFragment(elements, mode, lanes, key) {
|
|
32024
|
-
var fiber = createFiber(
|
|
32024
|
+
var fiber = createFiber(Fragment, elements, key, mode);
|
|
32025
32025
|
fiber.lanes = lanes;
|
|
32026
32026
|
return fiber;
|
|
32027
32027
|
}
|
|
@@ -47312,7 +47312,7 @@ var require_backend = __commonJS({
|
|
|
47312
47312
|
var symbolOrNumber = renderer_typeof(type) === "object" && type !== null ? type.$$typeof : type;
|
|
47313
47313
|
return renderer_typeof(symbolOrNumber) === "symbol" ? symbolOrNumber.toString() : symbolOrNumber;
|
|
47314
47314
|
}
|
|
47315
|
-
var _ReactTypeOfWork = ReactTypeOfWork, CacheComponent = _ReactTypeOfWork.CacheComponent, ClassComponent = _ReactTypeOfWork.ClassComponent, IncompleteClassComponent = _ReactTypeOfWork.IncompleteClassComponent, IncompleteFunctionComponent = _ReactTypeOfWork.IncompleteFunctionComponent, FunctionComponent = _ReactTypeOfWork.FunctionComponent, IndeterminateComponent = _ReactTypeOfWork.IndeterminateComponent, ForwardRef = _ReactTypeOfWork.ForwardRef, HostRoot = _ReactTypeOfWork.HostRoot, HostHoistable = _ReactTypeOfWork.HostHoistable, HostSingleton = _ReactTypeOfWork.HostSingleton, HostComponent = _ReactTypeOfWork.HostComponent, HostPortal = _ReactTypeOfWork.HostPortal, HostText = _ReactTypeOfWork.HostText,
|
|
47315
|
+
var _ReactTypeOfWork = ReactTypeOfWork, CacheComponent = _ReactTypeOfWork.CacheComponent, ClassComponent = _ReactTypeOfWork.ClassComponent, IncompleteClassComponent = _ReactTypeOfWork.IncompleteClassComponent, IncompleteFunctionComponent = _ReactTypeOfWork.IncompleteFunctionComponent, FunctionComponent = _ReactTypeOfWork.FunctionComponent, IndeterminateComponent = _ReactTypeOfWork.IndeterminateComponent, ForwardRef = _ReactTypeOfWork.ForwardRef, HostRoot = _ReactTypeOfWork.HostRoot, HostHoistable = _ReactTypeOfWork.HostHoistable, HostSingleton = _ReactTypeOfWork.HostSingleton, HostComponent = _ReactTypeOfWork.HostComponent, HostPortal = _ReactTypeOfWork.HostPortal, HostText = _ReactTypeOfWork.HostText, Fragment = _ReactTypeOfWork.Fragment, LazyComponent = _ReactTypeOfWork.LazyComponent, LegacyHiddenComponent = _ReactTypeOfWork.LegacyHiddenComponent, MemoComponent = _ReactTypeOfWork.MemoComponent, OffscreenComponent = _ReactTypeOfWork.OffscreenComponent, Profiler = _ReactTypeOfWork.Profiler, ScopeComponent = _ReactTypeOfWork.ScopeComponent, SimpleMemoComponent = _ReactTypeOfWork.SimpleMemoComponent, SuspenseComponent = _ReactTypeOfWork.SuspenseComponent, SuspenseListComponent = _ReactTypeOfWork.SuspenseListComponent, TracingMarkerComponent = _ReactTypeOfWork.TracingMarkerComponent, Throw = _ReactTypeOfWork.Throw, ViewTransitionComponent = _ReactTypeOfWork.ViewTransitionComponent, ActivityComponent = _ReactTypeOfWork.ActivityComponent;
|
|
47316
47316
|
function resolveFiberType(type) {
|
|
47317
47317
|
var typeSymbol = getTypeSymbol(type);
|
|
47318
47318
|
switch (typeSymbol) {
|
|
@@ -47368,7 +47368,7 @@ var require_backend = __commonJS({
|
|
|
47368
47368
|
case HostPortal:
|
|
47369
47369
|
case HostText:
|
|
47370
47370
|
return null;
|
|
47371
|
-
case
|
|
47371
|
+
case Fragment:
|
|
47372
47372
|
return "Fragment";
|
|
47373
47373
|
case LazyComponent:
|
|
47374
47374
|
return "Lazy";
|
|
@@ -47523,7 +47523,7 @@ var require_backend = __commonJS({
|
|
|
47523
47523
|
function renderer_attach(hook, rendererID, renderer2, global2, shouldStartProfilingNow, profilingSettings) {
|
|
47524
47524
|
var version = renderer2.reconcilerVersion || renderer2.version;
|
|
47525
47525
|
var _getInternalReactCons = getInternalReactConstants(version), getDisplayNameForFiber = _getInternalReactCons.getDisplayNameForFiber, getTypeSymbol = _getInternalReactCons.getTypeSymbol, ReactPriorityLevels = _getInternalReactCons.ReactPriorityLevels, ReactTypeOfWork = _getInternalReactCons.ReactTypeOfWork, StrictModeBits = _getInternalReactCons.StrictModeBits, SuspenseyImagesMode = _getInternalReactCons.SuspenseyImagesMode;
|
|
47526
|
-
var ActivityComponent = ReactTypeOfWork.ActivityComponent, ClassComponent = ReactTypeOfWork.ClassComponent, ContextConsumer = ReactTypeOfWork.ContextConsumer, DehydratedSuspenseComponent = ReactTypeOfWork.DehydratedSuspenseComponent, ForwardRef = ReactTypeOfWork.ForwardRef,
|
|
47526
|
+
var ActivityComponent = ReactTypeOfWork.ActivityComponent, ClassComponent = ReactTypeOfWork.ClassComponent, ContextConsumer = ReactTypeOfWork.ContextConsumer, DehydratedSuspenseComponent = ReactTypeOfWork.DehydratedSuspenseComponent, ForwardRef = ReactTypeOfWork.ForwardRef, Fragment = ReactTypeOfWork.Fragment, FunctionComponent = ReactTypeOfWork.FunctionComponent, HostRoot = ReactTypeOfWork.HostRoot, HostHoistable = ReactTypeOfWork.HostHoistable, HostSingleton = ReactTypeOfWork.HostSingleton, HostPortal = ReactTypeOfWork.HostPortal, HostComponent = ReactTypeOfWork.HostComponent, HostText = ReactTypeOfWork.HostText, IncompleteClassComponent = ReactTypeOfWork.IncompleteClassComponent, IncompleteFunctionComponent = ReactTypeOfWork.IncompleteFunctionComponent, IndeterminateComponent = ReactTypeOfWork.IndeterminateComponent, LegacyHiddenComponent = ReactTypeOfWork.LegacyHiddenComponent, MemoComponent = ReactTypeOfWork.MemoComponent, OffscreenComponent = ReactTypeOfWork.OffscreenComponent, SimpleMemoComponent = ReactTypeOfWork.SimpleMemoComponent, SuspenseComponent = ReactTypeOfWork.SuspenseComponent, SuspenseListComponent = ReactTypeOfWork.SuspenseListComponent, TracingMarkerComponent = ReactTypeOfWork.TracingMarkerComponent, Throw = ReactTypeOfWork.Throw, ViewTransitionComponent = ReactTypeOfWork.ViewTransitionComponent;
|
|
47527
47527
|
var ImmediatePriority = ReactPriorityLevels.ImmediatePriority, UserBlockingPriority = ReactPriorityLevels.UserBlockingPriority, NormalPriority = ReactPriorityLevels.NormalPriority, LowPriority = ReactPriorityLevels.LowPriority, IdlePriority = ReactPriorityLevels.IdlePriority, NoPriority = ReactPriorityLevels.NoPriority;
|
|
47528
47528
|
var getLaneLabelMap = renderer2.getLaneLabelMap, injectProfilingHooks = renderer2.injectProfilingHooks, overrideHookState = renderer2.overrideHookState, overrideHookStateDeletePath = renderer2.overrideHookStateDeletePath, overrideHookStateRenamePath = renderer2.overrideHookStateRenamePath, overrideProps = renderer2.overrideProps, overridePropsDeletePath = renderer2.overridePropsDeletePath, overridePropsRenamePath = renderer2.overridePropsRenamePath, scheduleRefresh = renderer2.scheduleRefresh, setErrorHandler = renderer2.setErrorHandler, setSuspenseHandler = renderer2.setSuspenseHandler, scheduleUpdate = renderer2.scheduleUpdate, scheduleRetry = renderer2.scheduleRetry, getCurrentFiber = renderer2.getCurrentFiber;
|
|
47529
47529
|
var supportsTogglingError = typeof setErrorHandler === "function" && typeof scheduleUpdate === "function";
|
|
@@ -47884,7 +47884,7 @@ var require_backend = __commonJS({
|
|
|
47884
47884
|
return true;
|
|
47885
47885
|
case HostRoot:
|
|
47886
47886
|
return false;
|
|
47887
|
-
case
|
|
47887
|
+
case Fragment:
|
|
47888
47888
|
return key === null;
|
|
47889
47889
|
default:
|
|
47890
47890
|
var typeSymbol = getTypeSymbol(type);
|
|
@@ -47958,7 +47958,7 @@ var require_backend = __commonJS({
|
|
|
47958
47958
|
return ElementTypeHostComponent;
|
|
47959
47959
|
case HostPortal:
|
|
47960
47960
|
case HostText:
|
|
47961
|
-
case
|
|
47961
|
+
case Fragment:
|
|
47962
47962
|
return ElementTypeOtherOrUnknown;
|
|
47963
47963
|
case MemoComponent:
|
|
47964
47964
|
case SimpleMemoComponent:
|
|
@@ -57556,25 +57556,6 @@ var init_render = __esm({
|
|
|
57556
57556
|
});
|
|
57557
57557
|
|
|
57558
57558
|
// node_modules/ink/build/components/Static.js
|
|
57559
|
-
function Static(props) {
|
|
57560
|
-
const { items, children: render2, style: customStyle } = props;
|
|
57561
|
-
const [index, setIndex] = (0, import_react11.useState)(0);
|
|
57562
|
-
const itemsToRender = (0, import_react11.useMemo)(() => {
|
|
57563
|
-
return items.slice(index);
|
|
57564
|
-
}, [items, index]);
|
|
57565
|
-
(0, import_react11.useLayoutEffect)(() => {
|
|
57566
|
-
setIndex(items.length);
|
|
57567
|
-
}, [items.length]);
|
|
57568
|
-
const children = itemsToRender.map((item, itemIndex) => {
|
|
57569
|
-
return render2(item, index + itemIndex);
|
|
57570
|
-
});
|
|
57571
|
-
const style = (0, import_react11.useMemo)(() => ({
|
|
57572
|
-
position: "absolute",
|
|
57573
|
-
flexDirection: "column",
|
|
57574
|
-
...customStyle
|
|
57575
|
-
}), [customStyle]);
|
|
57576
|
-
return import_react11.default.createElement("ink-box", { internal_static: true, style }, children);
|
|
57577
|
-
}
|
|
57578
57559
|
var import_react11;
|
|
57579
57560
|
var init_Static = __esm({
|
|
57580
57561
|
"node_modules/ink/build/components/Static.js"() {
|
|
@@ -58438,7 +58419,7 @@ var init_client = __esm({
|
|
|
58438
58419
|
"Content-Type": "application/json",
|
|
58439
58420
|
"anthropic-version": "2023-06-01",
|
|
58440
58421
|
"anthropic-beta": BETA_HEADERS.join(","),
|
|
58441
|
-
"User-Agent": `coders/${"0.0.
|
|
58422
|
+
"User-Agent": `coders/${"0.0.12"}`
|
|
58442
58423
|
};
|
|
58443
58424
|
if (key.isOAuth) {
|
|
58444
58425
|
headers["Authorization"] = `Bearer ${key.apiKey}`;
|
|
@@ -69778,6 +69759,19 @@ function SpinnerDot() {
|
|
|
69778
69759
|
const f = useSpinner(true);
|
|
69779
69760
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { color: "cyan", children: f });
|
|
69780
69761
|
}
|
|
69762
|
+
function Header({ model, mode }) {
|
|
69763
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box_default, { marginBottom: 1, children: [
|
|
69764
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { bold: true, color: "cyan", children: "@hasna/coders" }),
|
|
69765
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, { dimColor: true, children: [
|
|
69766
|
+
" v",
|
|
69767
|
+
VERSION,
|
|
69768
|
+
" \xB7 ",
|
|
69769
|
+
model,
|
|
69770
|
+
" \xB7 ",
|
|
69771
|
+
mode
|
|
69772
|
+
] })
|
|
69773
|
+
] });
|
|
69774
|
+
}
|
|
69781
69775
|
function ToolItem({ tool }) {
|
|
69782
69776
|
const f = useSpinner(tool.status === "running");
|
|
69783
69777
|
const icon = tool.status === "running" ? "\xB7" : tool.status === "error" ? "\u25CF" : "\u25CF";
|
|
@@ -70070,13 +70064,24 @@ function App2({ model, mode, initialPrompt }) {
|
|
|
70070
70064
|
} else if (key.escape) setInput("");
|
|
70071
70065
|
else if (!key.ctrl && !key.meta && ch) setInput((p) => p + ch);
|
|
70072
70066
|
});
|
|
70067
|
+
const maxVisible = Math.max(2, Math.floor((rows - 5) / 3));
|
|
70068
|
+
const visible = msgs.slice(-maxVisible);
|
|
70069
|
+
const hiddenCount = msgs.length - visible.length;
|
|
70073
70070
|
const recentTools = activeTools.slice(-3);
|
|
70074
70071
|
const streamLines = streaming ? streaming.split("\n") : [];
|
|
70075
|
-
const maxStreamLines = Math.max(
|
|
70072
|
+
const maxStreamLines = Math.max(3, rows - 12);
|
|
70076
70073
|
const truncatedStream = streamLines.length > maxStreamLines ? streamLines.slice(-maxStreamLines).join("\n") : streaming;
|
|
70077
|
-
|
|
70078
|
-
|
|
70079
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
70074
|
+
const cols = stdout?.columns ?? 80;
|
|
70075
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box_default, { flexDirection: "column", height: rows, children: [
|
|
70076
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Header, { model, mode }),
|
|
70077
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box_default, { flexDirection: "column", flexGrow: 1, overflow: "hidden", children: [
|
|
70078
|
+
hiddenCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, { dimColor: true, children: [
|
|
70079
|
+
" \u2191 ",
|
|
70080
|
+
hiddenCount,
|
|
70081
|
+
" earlier message",
|
|
70082
|
+
hiddenCount !== 1 ? "s" : ""
|
|
70083
|
+
] }) }),
|
|
70084
|
+
visible.map((m) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MessageView, { msg: m }, m.id)),
|
|
70080
70085
|
busy && recentTools.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box_default, { flexDirection: "column", children: [
|
|
70081
70086
|
activeTools.length > 3 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, { dimColor: true, children: [
|
|
70082
70087
|
" \u2026 +",
|
|
@@ -70096,18 +70101,19 @@ function App2({ model, mode, initialPrompt }) {
|
|
|
70096
70101
|
recentTools.some((t) => t.status === "running") ? "Working" : "Thinking",
|
|
70097
70102
|
"..."
|
|
70098
70103
|
] })
|
|
70104
|
+
] })
|
|
70105
|
+
] }),
|
|
70106
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { dimColor: true, children: "\u2500".repeat(Math.min(cols, 120)) }) }),
|
|
70107
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Box_default, { children: [
|
|
70108
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, { color: "cyan", bold: true, children: [
|
|
70109
|
+
PROMPT,
|
|
70110
|
+
" "
|
|
70099
70111
|
] }),
|
|
70100
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
70101
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
70102
|
-
|
|
70103
|
-
|
|
70104
|
-
|
|
70105
|
-
] }),
|
|
70106
|
-
input.startsWith("/") ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { color: "magenta", children: input }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { children: input }),
|
|
70107
|
-
!busy && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { color: "gray", children: "\u258E" })
|
|
70108
|
-
] }),
|
|
70109
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(StatusBar, { model, mode, cost, tokens })
|
|
70110
|
-
] })
|
|
70112
|
+
input.startsWith("/") ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { color: "magenta", children: input }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { children: input }),
|
|
70113
|
+
!busy && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { color: "gray", children: "\u258E" })
|
|
70114
|
+
] }),
|
|
70115
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { dimColor: true, children: "\u2500".repeat(Math.min(cols, 120)) }) }),
|
|
70116
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(StatusBar, { model, mode, cost, tokens })
|
|
70111
70117
|
] });
|
|
70112
70118
|
}
|
|
70113
70119
|
function launchInkApp(opts = {}) {
|
|
@@ -70396,8 +70402,8 @@ async function bootstrap() {
|
|
|
70396
70402
|
var VERSION, BUILD_TIME, PACKAGE_NAME2, ISSUES_URL2, startupTimestamps, originalCwd, RESET_TERMINAL, cleanupHandlers, earlyInput, earlyInputCapturing;
|
|
70397
70403
|
var init_index = __esm({
|
|
70398
70404
|
"src/cli/index.ts"() {
|
|
70399
|
-
VERSION = "0.0.
|
|
70400
|
-
BUILD_TIME = "2026-03-
|
|
70405
|
+
VERSION = "0.0.12";
|
|
70406
|
+
BUILD_TIME = "2026-03-20T10:40:16.674Z";
|
|
70401
70407
|
PACKAGE_NAME2 = "@hasna/coders";
|
|
70402
70408
|
ISSUES_URL2 = "https://github.com/hasnaxyz/open-coders/issues";
|
|
70403
70409
|
startupTimestamps = {};
|