happy-imou-cloud 2.1.1 → 2.1.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/happy-cloud.mjs +21 -21
- package/compat/acp-sdk-schema/index.js +27 -27
- package/compat/acp-sdk-schema/types.gen.js +2 -2
- package/compat/acp-sdk-schema/zod.gen.js +1553 -1553
- package/compat/ink-build/components/Cursor.d.ts +83 -83
- package/compat/ink-build/components/Cursor.js +52 -52
- package/compat/ink-build/components/CursorContext.d.ts +11 -11
- package/compat/ink-build/components/CursorContext.js +7 -7
- package/compat/ink-build/components/ErrorBoundary.d.ts +18 -18
- package/compat/ink-build/components/ErrorBoundary.js +22 -22
- package/compat/ink-build/hooks/use-cursor.d.ts +12 -12
- package/compat/ink-build/hooks/use-cursor.js +28 -28
- package/dist/{BaseReasoningProcessor-Dn9FxfxU.mjs → BaseReasoningProcessor-BaOWkVcu.mjs} +3 -3
- package/dist/{BaseReasoningProcessor-CBMK-8Gi.cjs → BaseReasoningProcessor-CzvqwxuY.cjs} +3 -3
- package/dist/ProviderSelectionHandler-Q8pl7e-d.mjs +261 -0
- package/dist/ProviderSelectionHandler-wwbfeK_s.cjs +265 -0
- package/dist/{api-DBy5lPZw.mjs → api-Cxifhw5r.mjs} +3 -3
- package/dist/{api-DId_j3C2.cjs → api-DZimmN4C.cjs} +2 -2
- package/dist/{command-CeaBwYCW.mjs → command-B6LM3Nml.mjs} +3 -3
- package/dist/{command-DwfUpmId.cjs → command-RcCJI1jl.cjs} +3 -3
- package/dist/{index-CuuYSKiv.cjs → index-Cuvs0lFS.cjs} +168 -75
- package/dist/{index-66vjECEd.mjs → index-Des7I5WX.mjs} +165 -72
- package/dist/index.cjs +3 -3
- package/dist/index.mjs +3 -3
- package/dist/lib.cjs +1 -1
- package/dist/lib.d.cts +36 -36
- package/dist/lib.d.mts +36 -36
- package/dist/lib.mjs +1 -1
- package/dist/{persistence-BOWh1NER.mjs → persistence-6d4U4Sh8.mjs} +1 -1
- package/dist/{persistence-Dzr6sFwD.cjs → persistence-C8-MtdQK.cjs} +1 -1
- package/dist/{registerKillSessionHandler-D4_wpN18.mjs → registerKillSessionHandler-BFBkz_XT.mjs} +417 -5
- package/dist/{registerKillSessionHandler-Dg_iRBPm.cjs → registerKillSessionHandler-BapPCRmp.cjs} +419 -4
- package/dist/{runClaude-B74dHAnQ.mjs → runClaude-CPV5Uap2.mjs} +34 -5
- package/dist/{runClaude-oIFzkfuU.cjs → runClaude-DVnqKa1q.cjs} +37 -8
- package/dist/{runCodex-D_9CuL6M.cjs → runCodex-Bzsp8gFO.cjs} +29 -21
- package/dist/{runCodex-mLHjsgVj.mjs → runCodex-CwtLSTMJ.mjs} +26 -18
- package/dist/{runGemini-CcWGezMt.cjs → runGemini-6Dwyk_Km.cjs} +267 -82
- package/dist/{runGemini-BMiho2ab.mjs → runGemini-Bmoxehlh.mjs} +267 -82
- package/package.json +9 -9
- package/scripts/build.mjs +68 -68
- package/scripts/ensureAcpSdkCompat.mjs +170 -172
- package/scripts/release-smoke.mjs +38 -35
- package/dist/ProviderSelectionHandler-BuXk-8ji.cjs +0 -680
- package/dist/ProviderSelectionHandler-CMaQThYO.mjs +0 -673
|
@@ -1,83 +1,83 @@
|
|
|
1
|
-
import React, { type RefObject } from 'react';
|
|
2
|
-
import { type DOMElement, type CursorAnchorMode } from '../dom.js';
|
|
3
|
-
export type Props = {
|
|
4
|
-
/**
|
|
5
|
-
Optional reference to anchor cursor coordinates to a different element.
|
|
6
|
-
|
|
7
|
-
By default, `anchorRef` uses `anchor="textEnd"` behavior to follow the rendered end of that element's text, including wrapping and wide characters.
|
|
8
|
-
|
|
9
|
-
Use this for inputs where the cursor should stay at the visible end of text.
|
|
10
|
-
|
|
11
|
-
If `anchorRef` is set but currently unresolved, Ink hides the cursor for that frame unless `anchor="flow"` is used.
|
|
12
|
-
|
|
13
|
-
If multiple `<Cursor>` components are rendered in one frame, the last rendered one controls terminal cursor position.
|
|
14
|
-
*/
|
|
15
|
-
readonly anchorRef?: RefObject<DOMElement | null>;
|
|
16
|
-
/**
|
|
17
|
-
Anchor mode used to resolve cursor coordinates.
|
|
18
|
-
|
|
19
|
-
- `'flow'`: Anchor to `<Cursor />` position in layout flow.
|
|
20
|
-
Use this when you place `<Cursor />` exactly where it should appear.
|
|
21
|
-
|
|
22
|
-
- `'origin'`: Anchor to content origin (top-left) of `anchorRef` or parent when no `anchorRef` is provided.
|
|
23
|
-
Use this for manual `x/y` positioning.
|
|
24
|
-
|
|
25
|
-
- `'textEnd'`: Anchor to rendered end of text for `anchorRef` or parent when no `anchorRef` is provided.
|
|
26
|
-
Use this when cursor should follow wrapped text.
|
|
27
|
-
|
|
28
|
-
Defaults to `'flow'` when `anchorRef` is omitted and `'textEnd'` when `anchorRef` is provided.
|
|
29
|
-
|
|
30
|
-
`'flow'` is the default without `anchorRef` to avoid coupling cursor position to surrounding sibling text changes.
|
|
31
|
-
*/
|
|
32
|
-
readonly anchor?: CursorAnchorMode;
|
|
33
|
-
/**
|
|
34
|
-
Horizontal offset from resolved anchor position.
|
|
35
|
-
*/
|
|
36
|
-
readonly x?: number;
|
|
37
|
-
/**
|
|
38
|
-
Vertical offset from resolved anchor position.
|
|
39
|
-
*/
|
|
40
|
-
readonly y?: number;
|
|
41
|
-
};
|
|
42
|
-
/**
|
|
43
|
-
Declaratively position the terminal cursor relative to a container.
|
|
44
|
-
|
|
45
|
-
Use this component when building reusable inputs where absolute root coordinates are inconvenient.
|
|
46
|
-
|
|
47
|
-
`<Cursor>` must not be rendered inside `<Text>`.
|
|
48
|
-
|
|
49
|
-
@example
|
|
50
|
-
```jsx
|
|
51
|
-
import {Box, Cursor, Text} from 'ink';
|
|
52
|
-
import {useRef} from 'react';
|
|
53
|
-
|
|
54
|
-
const prompt = '> ';
|
|
55
|
-
const value = 'hello';
|
|
56
|
-
|
|
57
|
-
const Example = () => {
|
|
58
|
-
return (
|
|
59
|
-
<Box flexDirection="row">
|
|
60
|
-
<Text>{prompt}</Text>
|
|
61
|
-
<Text>{value}</Text>
|
|
62
|
-
<Cursor />
|
|
63
|
-
</Box>
|
|
64
|
-
);
|
|
65
|
-
};
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
```jsx
|
|
69
|
-
const ExampleWithAnchor = () => {
|
|
70
|
-
const lineReference = useRef();
|
|
71
|
-
|
|
72
|
-
return (
|
|
73
|
-
<Box flexDirection="column">
|
|
74
|
-
<Box ref={lineReference}>
|
|
75
|
-
<Text>{`${prompt}${value}`}</Text>
|
|
76
|
-
</Box>
|
|
77
|
-
<Cursor anchorRef={lineReference} />
|
|
78
|
-
</Box>
|
|
79
|
-
);
|
|
80
|
-
};
|
|
81
|
-
```
|
|
82
|
-
*/
|
|
83
|
-
export default function Cursor({ anchorRef, anchor, x, y }: Props): React.JSX.Element;
|
|
1
|
+
import React, { type RefObject } from 'react';
|
|
2
|
+
import { type DOMElement, type CursorAnchorMode } from '../dom.js';
|
|
3
|
+
export type Props = {
|
|
4
|
+
/**
|
|
5
|
+
Optional reference to anchor cursor coordinates to a different element.
|
|
6
|
+
|
|
7
|
+
By default, `anchorRef` uses `anchor="textEnd"` behavior to follow the rendered end of that element's text, including wrapping and wide characters.
|
|
8
|
+
|
|
9
|
+
Use this for inputs where the cursor should stay at the visible end of text.
|
|
10
|
+
|
|
11
|
+
If `anchorRef` is set but currently unresolved, Ink hides the cursor for that frame unless `anchor="flow"` is used.
|
|
12
|
+
|
|
13
|
+
If multiple `<Cursor>` components are rendered in one frame, the last rendered one controls terminal cursor position.
|
|
14
|
+
*/
|
|
15
|
+
readonly anchorRef?: RefObject<DOMElement | null>;
|
|
16
|
+
/**
|
|
17
|
+
Anchor mode used to resolve cursor coordinates.
|
|
18
|
+
|
|
19
|
+
- `'flow'`: Anchor to `<Cursor />` position in layout flow.
|
|
20
|
+
Use this when you place `<Cursor />` exactly where it should appear.
|
|
21
|
+
|
|
22
|
+
- `'origin'`: Anchor to content origin (top-left) of `anchorRef` or parent when no `anchorRef` is provided.
|
|
23
|
+
Use this for manual `x/y` positioning.
|
|
24
|
+
|
|
25
|
+
- `'textEnd'`: Anchor to rendered end of text for `anchorRef` or parent when no `anchorRef` is provided.
|
|
26
|
+
Use this when cursor should follow wrapped text.
|
|
27
|
+
|
|
28
|
+
Defaults to `'flow'` when `anchorRef` is omitted and `'textEnd'` when `anchorRef` is provided.
|
|
29
|
+
|
|
30
|
+
`'flow'` is the default without `anchorRef` to avoid coupling cursor position to surrounding sibling text changes.
|
|
31
|
+
*/
|
|
32
|
+
readonly anchor?: CursorAnchorMode;
|
|
33
|
+
/**
|
|
34
|
+
Horizontal offset from resolved anchor position.
|
|
35
|
+
*/
|
|
36
|
+
readonly x?: number;
|
|
37
|
+
/**
|
|
38
|
+
Vertical offset from resolved anchor position.
|
|
39
|
+
*/
|
|
40
|
+
readonly y?: number;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
Declaratively position the terminal cursor relative to a container.
|
|
44
|
+
|
|
45
|
+
Use this component when building reusable inputs where absolute root coordinates are inconvenient.
|
|
46
|
+
|
|
47
|
+
`<Cursor>` must not be rendered inside `<Text>`.
|
|
48
|
+
|
|
49
|
+
@example
|
|
50
|
+
```jsx
|
|
51
|
+
import {Box, Cursor, Text} from 'ink';
|
|
52
|
+
import {useRef} from 'react';
|
|
53
|
+
|
|
54
|
+
const prompt = '> ';
|
|
55
|
+
const value = 'hello';
|
|
56
|
+
|
|
57
|
+
const Example = () => {
|
|
58
|
+
return (
|
|
59
|
+
<Box flexDirection="row">
|
|
60
|
+
<Text>{prompt}</Text>
|
|
61
|
+
<Text>{value}</Text>
|
|
62
|
+
<Cursor />
|
|
63
|
+
</Box>
|
|
64
|
+
);
|
|
65
|
+
};
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
```jsx
|
|
69
|
+
const ExampleWithAnchor = () => {
|
|
70
|
+
const lineReference = useRef();
|
|
71
|
+
|
|
72
|
+
return (
|
|
73
|
+
<Box flexDirection="column">
|
|
74
|
+
<Box ref={lineReference}>
|
|
75
|
+
<Text>{`${prompt}${value}`}</Text>
|
|
76
|
+
</Box>
|
|
77
|
+
<Cursor anchorRef={lineReference} />
|
|
78
|
+
</Box>
|
|
79
|
+
);
|
|
80
|
+
};
|
|
81
|
+
```
|
|
82
|
+
*/
|
|
83
|
+
export default function Cursor({ anchorRef, anchor, x, y }: Props): React.JSX.Element;
|
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
/**
|
|
3
|
-
Declaratively position the terminal cursor relative to a container.
|
|
4
|
-
|
|
5
|
-
Use this component when building reusable inputs where absolute root coordinates are inconvenient.
|
|
6
|
-
|
|
7
|
-
`<Cursor>` must not be rendered inside `<Text>`.
|
|
8
|
-
|
|
9
|
-
@example
|
|
10
|
-
```jsx
|
|
11
|
-
import {Box, Cursor, Text} from 'ink';
|
|
12
|
-
import {useRef} from 'react';
|
|
13
|
-
|
|
14
|
-
const prompt = '> ';
|
|
15
|
-
const value = 'hello';
|
|
16
|
-
|
|
17
|
-
const Example = () => {
|
|
18
|
-
return (
|
|
19
|
-
<Box flexDirection="row">
|
|
20
|
-
<Text>{prompt}</Text>
|
|
21
|
-
<Text>{value}</Text>
|
|
22
|
-
<Cursor />
|
|
23
|
-
</Box>
|
|
24
|
-
);
|
|
25
|
-
};
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
```jsx
|
|
29
|
-
const ExampleWithAnchor = () => {
|
|
30
|
-
const lineReference = useRef();
|
|
31
|
-
|
|
32
|
-
return (
|
|
33
|
-
<Box flexDirection="column">
|
|
34
|
-
<Box ref={lineReference}>
|
|
35
|
-
<Text>{`${prompt}${value}`}</Text>
|
|
36
|
-
</Box>
|
|
37
|
-
<Cursor anchorRef={lineReference} />
|
|
38
|
-
</Box>
|
|
39
|
-
);
|
|
40
|
-
};
|
|
41
|
-
```
|
|
42
|
-
*/
|
|
43
|
-
export default function Cursor({ anchorRef, anchor, x = 0, y = 0 }) {
|
|
44
|
-
const normalizedAnchorReference = anchorRef ?? undefined;
|
|
45
|
-
const normalizedAnchor = anchor ?? (normalizedAnchorReference ? 'textEnd' : 'flow');
|
|
46
|
-
return (React.createElement("ink-cursor", { internal_cursor: {
|
|
47
|
-
anchorRef: normalizedAnchorReference,
|
|
48
|
-
anchor: normalizedAnchor,
|
|
49
|
-
x,
|
|
50
|
-
y,
|
|
51
|
-
} }));
|
|
52
|
-
}
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
Declaratively position the terminal cursor relative to a container.
|
|
4
|
+
|
|
5
|
+
Use this component when building reusable inputs where absolute root coordinates are inconvenient.
|
|
6
|
+
|
|
7
|
+
`<Cursor>` must not be rendered inside `<Text>`.
|
|
8
|
+
|
|
9
|
+
@example
|
|
10
|
+
```jsx
|
|
11
|
+
import {Box, Cursor, Text} from 'ink';
|
|
12
|
+
import {useRef} from 'react';
|
|
13
|
+
|
|
14
|
+
const prompt = '> ';
|
|
15
|
+
const value = 'hello';
|
|
16
|
+
|
|
17
|
+
const Example = () => {
|
|
18
|
+
return (
|
|
19
|
+
<Box flexDirection="row">
|
|
20
|
+
<Text>{prompt}</Text>
|
|
21
|
+
<Text>{value}</Text>
|
|
22
|
+
<Cursor />
|
|
23
|
+
</Box>
|
|
24
|
+
);
|
|
25
|
+
};
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
```jsx
|
|
29
|
+
const ExampleWithAnchor = () => {
|
|
30
|
+
const lineReference = useRef();
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<Box flexDirection="column">
|
|
34
|
+
<Box ref={lineReference}>
|
|
35
|
+
<Text>{`${prompt}${value}`}</Text>
|
|
36
|
+
</Box>
|
|
37
|
+
<Cursor anchorRef={lineReference} />
|
|
38
|
+
</Box>
|
|
39
|
+
);
|
|
40
|
+
};
|
|
41
|
+
```
|
|
42
|
+
*/
|
|
43
|
+
export default function Cursor({ anchorRef, anchor, x = 0, y = 0 }) {
|
|
44
|
+
const normalizedAnchorReference = anchorRef ?? undefined;
|
|
45
|
+
const normalizedAnchor = anchor ?? (normalizedAnchorReference ? 'textEnd' : 'flow');
|
|
46
|
+
return (React.createElement("ink-cursor", { internal_cursor: {
|
|
47
|
+
anchorRef: normalizedAnchorReference,
|
|
48
|
+
anchor: normalizedAnchor,
|
|
49
|
+
x,
|
|
50
|
+
y,
|
|
51
|
+
} }));
|
|
52
|
+
}
|
|
53
53
|
//# sourceMappingURL=Cursor.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { type CursorPosition } from '../log-update.js';
|
|
2
|
-
export type Props = {
|
|
3
|
-
/**
|
|
4
|
-
Set the cursor position relative to the Ink output.
|
|
5
|
-
|
|
6
|
-
Pass `undefined` to hide the cursor.
|
|
7
|
-
*/
|
|
8
|
-
readonly setCursorPosition: (position: CursorPosition | undefined) => void;
|
|
9
|
-
};
|
|
10
|
-
declare const CursorContext: import("react").Context<Props>;
|
|
11
|
-
export default CursorContext;
|
|
1
|
+
import { type CursorPosition } from '../log-update.js';
|
|
2
|
+
export type Props = {
|
|
3
|
+
/**
|
|
4
|
+
Set the cursor position relative to the Ink output.
|
|
5
|
+
|
|
6
|
+
Pass `undefined` to hide the cursor.
|
|
7
|
+
*/
|
|
8
|
+
readonly setCursorPosition: (position: CursorPosition | undefined) => void;
|
|
9
|
+
};
|
|
10
|
+
declare const CursorContext: import("react").Context<Props>;
|
|
11
|
+
export default CursorContext;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { createContext } from 'react';
|
|
2
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
3
|
-
const CursorContext = createContext({
|
|
4
|
-
setCursorPosition() { },
|
|
5
|
-
});
|
|
6
|
-
CursorContext.displayName = 'InternalCursorContext';
|
|
7
|
-
export default CursorContext;
|
|
1
|
+
import { createContext } from 'react';
|
|
2
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
3
|
+
const CursorContext = createContext({
|
|
4
|
+
setCursorPosition() { },
|
|
5
|
+
});
|
|
6
|
+
CursorContext.displayName = 'InternalCursorContext';
|
|
7
|
+
export default CursorContext;
|
|
8
8
|
//# sourceMappingURL=CursorContext.js.map
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import React, { PureComponent, type ReactNode } from 'react';
|
|
2
|
-
type Props = {
|
|
3
|
-
readonly children: ReactNode;
|
|
4
|
-
readonly onError: (error: Error) => void;
|
|
5
|
-
};
|
|
6
|
-
type State = {
|
|
7
|
-
readonly error?: Error;
|
|
8
|
-
};
|
|
9
|
-
export default class ErrorBoundary extends PureComponent<Props, State> {
|
|
10
|
-
static displayName: string;
|
|
11
|
-
static getDerivedStateFromError(error: Error): {
|
|
12
|
-
error: Error;
|
|
13
|
-
};
|
|
14
|
-
state: State;
|
|
15
|
-
componentDidCatch(error: Error): void;
|
|
16
|
-
render(): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
|
|
17
|
-
}
|
|
18
|
-
export {};
|
|
1
|
+
import React, { PureComponent, type ReactNode } from 'react';
|
|
2
|
+
type Props = {
|
|
3
|
+
readonly children: ReactNode;
|
|
4
|
+
readonly onError: (error: Error) => void;
|
|
5
|
+
};
|
|
6
|
+
type State = {
|
|
7
|
+
readonly error?: Error;
|
|
8
|
+
};
|
|
9
|
+
export default class ErrorBoundary extends PureComponent<Props, State> {
|
|
10
|
+
static displayName: string;
|
|
11
|
+
static getDerivedStateFromError(error: Error): {
|
|
12
|
+
error: Error;
|
|
13
|
+
};
|
|
14
|
+
state: State;
|
|
15
|
+
componentDidCatch(error: Error): void;
|
|
16
|
+
render(): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import React, { PureComponent } from 'react';
|
|
2
|
-
import ErrorOverview from './ErrorOverview.js';
|
|
3
|
-
// Error boundary must be a class component since getDerivedStateFromError
|
|
4
|
-
// and componentDidCatch are not available as hooks
|
|
5
|
-
export default class ErrorBoundary extends PureComponent {
|
|
6
|
-
static displayName = 'InternalErrorBoundary';
|
|
7
|
-
static getDerivedStateFromError(error) {
|
|
8
|
-
return { error };
|
|
9
|
-
}
|
|
10
|
-
state = {
|
|
11
|
-
error: undefined,
|
|
12
|
-
};
|
|
13
|
-
componentDidCatch(error) {
|
|
14
|
-
this.props.onError(error);
|
|
15
|
-
}
|
|
16
|
-
render() {
|
|
17
|
-
if (this.state.error) {
|
|
18
|
-
return React.createElement(ErrorOverview, { error: this.state.error });
|
|
19
|
-
}
|
|
20
|
-
return this.props.children;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
1
|
+
import React, { PureComponent } from 'react';
|
|
2
|
+
import ErrorOverview from './ErrorOverview.js';
|
|
3
|
+
// Error boundary must be a class component since getDerivedStateFromError
|
|
4
|
+
// and componentDidCatch are not available as hooks
|
|
5
|
+
export default class ErrorBoundary extends PureComponent {
|
|
6
|
+
static displayName = 'InternalErrorBoundary';
|
|
7
|
+
static getDerivedStateFromError(error) {
|
|
8
|
+
return { error };
|
|
9
|
+
}
|
|
10
|
+
state = {
|
|
11
|
+
error: undefined,
|
|
12
|
+
};
|
|
13
|
+
componentDidCatch(error) {
|
|
14
|
+
this.props.onError(error);
|
|
15
|
+
}
|
|
16
|
+
render() {
|
|
17
|
+
if (this.state.error) {
|
|
18
|
+
return React.createElement(ErrorOverview, { error: this.state.error });
|
|
19
|
+
}
|
|
20
|
+
return this.props.children;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
23
|
//# sourceMappingURL=ErrorBoundary.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { type CursorPosition } from '../log-update.js';
|
|
2
|
-
/**
|
|
3
|
-
`useCursor` is a React hook that lets you control the terminal cursor position.
|
|
4
|
-
|
|
5
|
-
Setting a cursor position makes the cursor visible at the specified coordinates (relative to the Ink output origin). This is useful for IME (Input Method Editor) support, where the composing character is displayed at the cursor location.
|
|
6
|
-
|
|
7
|
-
Pass `undefined` to hide the cursor.
|
|
8
|
-
*/
|
|
9
|
-
declare const useCursor: () => {
|
|
10
|
-
setCursorPosition: (position: CursorPosition | undefined) => void;
|
|
11
|
-
};
|
|
12
|
-
export default useCursor;
|
|
1
|
+
import { type CursorPosition } from '../log-update.js';
|
|
2
|
+
/**
|
|
3
|
+
`useCursor` is a React hook that lets you control the terminal cursor position.
|
|
4
|
+
|
|
5
|
+
Setting a cursor position makes the cursor visible at the specified coordinates (relative to the Ink output origin). This is useful for IME (Input Method Editor) support, where the composing character is displayed at the cursor location.
|
|
6
|
+
|
|
7
|
+
Pass `undefined` to hide the cursor.
|
|
8
|
+
*/
|
|
9
|
+
declare const useCursor: () => {
|
|
10
|
+
setCursorPosition: (position: CursorPosition | undefined) => void;
|
|
11
|
+
};
|
|
12
|
+
export default useCursor;
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { useContext, useRef, useCallback, useInsertionEffect } from 'react';
|
|
2
|
-
import CursorContext from '../components/CursorContext.js';
|
|
3
|
-
/**
|
|
4
|
-
`useCursor` is a React hook that lets you control the terminal cursor position.
|
|
5
|
-
|
|
6
|
-
Setting a cursor position makes the cursor visible at the specified coordinates (relative to the Ink output origin). This is useful for IME (Input Method Editor) support, where the composing character is displayed at the cursor location.
|
|
7
|
-
|
|
8
|
-
Pass `undefined` to hide the cursor.
|
|
9
|
-
*/
|
|
10
|
-
const useCursor = () => {
|
|
11
|
-
const context = useContext(CursorContext);
|
|
12
|
-
const positionRef = useRef(undefined);
|
|
13
|
-
const setCursorPosition = useCallback((position) => {
|
|
14
|
-
positionRef.current = position;
|
|
15
|
-
}, []);
|
|
16
|
-
// Propagate cursor position to log-update only during commit phase.
|
|
17
|
-
// useInsertionEffect runs before resetAfterCommit (which triggers onRender),
|
|
18
|
-
// and does NOT run for abandoned concurrent renders (e.g. suspended components).
|
|
19
|
-
// This prevents cursor state from leaking across render boundaries.
|
|
20
|
-
useInsertionEffect(() => {
|
|
21
|
-
context.setCursorPosition(positionRef.current);
|
|
22
|
-
return () => {
|
|
23
|
-
context.setCursorPosition(undefined);
|
|
24
|
-
};
|
|
25
|
-
});
|
|
26
|
-
return { setCursorPosition };
|
|
27
|
-
};
|
|
28
|
-
export default useCursor;
|
|
1
|
+
import { useContext, useRef, useCallback, useInsertionEffect } from 'react';
|
|
2
|
+
import CursorContext from '../components/CursorContext.js';
|
|
3
|
+
/**
|
|
4
|
+
`useCursor` is a React hook that lets you control the terminal cursor position.
|
|
5
|
+
|
|
6
|
+
Setting a cursor position makes the cursor visible at the specified coordinates (relative to the Ink output origin). This is useful for IME (Input Method Editor) support, where the composing character is displayed at the cursor location.
|
|
7
|
+
|
|
8
|
+
Pass `undefined` to hide the cursor.
|
|
9
|
+
*/
|
|
10
|
+
const useCursor = () => {
|
|
11
|
+
const context = useContext(CursorContext);
|
|
12
|
+
const positionRef = useRef(undefined);
|
|
13
|
+
const setCursorPosition = useCallback((position) => {
|
|
14
|
+
positionRef.current = position;
|
|
15
|
+
}, []);
|
|
16
|
+
// Propagate cursor position to log-update only during commit phase.
|
|
17
|
+
// useInsertionEffect runs before resetAfterCommit (which triggers onRender),
|
|
18
|
+
// and does NOT run for abandoned concurrent renders (e.g. suspended components).
|
|
19
|
+
// This prevents cursor state from leaking across render boundaries.
|
|
20
|
+
useInsertionEffect(() => {
|
|
21
|
+
context.setCursorPosition(positionRef.current);
|
|
22
|
+
return () => {
|
|
23
|
+
context.setCursorPosition(undefined);
|
|
24
|
+
};
|
|
25
|
+
});
|
|
26
|
+
return { setCursorPosition };
|
|
27
|
+
};
|
|
28
|
+
export default useCursor;
|
|
29
29
|
//# sourceMappingURL=use-cursor.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { p as publishSessionRegistration } from './index-
|
|
2
|
-
import { s as startOfflineReconnection, c as configuration, i as isAuthenticationRequiredError, l as logger } from './api-
|
|
3
|
-
import { c as createSessionMetadata } from './registerKillSessionHandler-
|
|
1
|
+
import { p as publishSessionRegistration } from './index-Des7I5WX.mjs';
|
|
2
|
+
import { s as startOfflineReconnection, c as configuration, i as isAuthenticationRequiredError, l as logger } from './api-Cxifhw5r.mjs';
|
|
3
|
+
import { c as createSessionMetadata } from './registerKillSessionHandler-BFBkz_XT.mjs';
|
|
4
4
|
import { EventEmitter } from 'node:events';
|
|
5
5
|
import { randomUUID } from 'node:crypto';
|
|
6
6
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
4
|
-
var api = require('./api-
|
|
5
|
-
var registerKillSessionHandler = require('./registerKillSessionHandler-
|
|
3
|
+
var index = require('./index-Cuvs0lFS.cjs');
|
|
4
|
+
var api = require('./api-DZimmN4C.cjs');
|
|
5
|
+
var registerKillSessionHandler = require('./registerKillSessionHandler-BapPCRmp.cjs');
|
|
6
6
|
var node_events = require('node:events');
|
|
7
7
|
var node_crypto = require('node:crypto');
|
|
8
8
|
|