@linxiraos/pi-natives 1.1.8 → 1.1.10
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/native/index.d.ts +325 -34
- package/native/index.js +18 -2
- package/native/loader-state.js +8 -1
- package/package.json +8 -10
package/native/index.d.ts
CHANGED
|
@@ -98,6 +98,65 @@ export declare class DiffStream {
|
|
|
98
98
|
finish(context?: number | undefined | null): Promise<DiffStreamResult>
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
+
/** One edit tool call's streaming session. */
|
|
102
|
+
export declare class EditSession {
|
|
103
|
+
/**
|
|
104
|
+
* Open a session. `onPreview` (optional) receives every settled preview
|
|
105
|
+
* batch; batches are delivered one at a time, in generation order.
|
|
106
|
+
*/
|
|
107
|
+
constructor(store: EditStore, policy: EditPolicy, onPreview?: ((error: Error | null, batch: EditPreviewBatch) => void) | undefined | null)
|
|
108
|
+
/** Append a raw streamed argument fragment. */
|
|
109
|
+
push(delta: string): void
|
|
110
|
+
/** Replace the buffer with the complete argument JSON (no-delta path). */
|
|
111
|
+
setArgsJson(argsJson: string): void
|
|
112
|
+
/** Arguments are complete; triggers the final untrimmed preview. */
|
|
113
|
+
finish(): void
|
|
114
|
+
/**
|
|
115
|
+
* Stage and apply the finished edit through `writer`. Never rejects for
|
|
116
|
+
* engine failures: those come back as `isError` outcomes carrying the
|
|
117
|
+
* model-facing message.
|
|
118
|
+
*/
|
|
119
|
+
apply(request: EditApplyRequest, writer: (error: Error | null, request: EditWriteRequest) => Promise<EditWriteResponse>): Promise<EditApplyOutcome>
|
|
120
|
+
/** Stop the preview pump and release buffers. */
|
|
121
|
+
close(): void
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/** Session-scoped snapshots, clipboard registers, and the no-op loop guard. */
|
|
125
|
+
export declare class EditStore {
|
|
126
|
+
constructor()
|
|
127
|
+
/**
|
|
128
|
+
* Record `text` (any line endings) as the current snapshot of
|
|
129
|
+
* `absolutePath` and return its 4-hex tag.
|
|
130
|
+
*/
|
|
131
|
+
recordSnapshot(absolutePath: string, text: string, seenLines?: Array<number> | undefined | null): string
|
|
132
|
+
/**
|
|
133
|
+
* Read `absolutePath` from disk and record it; null when the file is
|
|
134
|
+
* unreadable or larger than 4 MiB.
|
|
135
|
+
*/
|
|
136
|
+
recordSnapshotFile(absolutePath: string, seenLines?: Array<number> | undefined | null): string | null
|
|
137
|
+
/** Merge displayed lines into the snapshot tagged `tag`. */
|
|
138
|
+
recordSeenLines(absolutePath: string, tag: string, lines: Array<number>): void
|
|
139
|
+
/**
|
|
140
|
+
* Merge the lines a hashline-formatted `body` displays into the
|
|
141
|
+
* snapshot tagged `tag`.
|
|
142
|
+
*/
|
|
143
|
+
recordSeenLinesFromBody(absolutePath: string, tag: string, body: string): void
|
|
144
|
+
/** Latest recorded text for `absolutePath`. */
|
|
145
|
+
headText(absolutePath: string): string | null
|
|
146
|
+
/** Latest recorded tag for `absolutePath`. */
|
|
147
|
+
headHash(absolutePath: string): string | null
|
|
148
|
+
/** Recorded text of `absolutePath` tagged `hash`. */
|
|
149
|
+
byHashText(absolutePath: string, hash: string): string | null
|
|
150
|
+
/**
|
|
151
|
+
* Displayed lines recorded for the snapshot tagged `hash`; null when no
|
|
152
|
+
* provenance was recorded.
|
|
153
|
+
*/
|
|
154
|
+
seenLines(absolutePath: string, hash: string): Array<number> | null
|
|
155
|
+
invalidate(absolutePath: string): void
|
|
156
|
+
relocate(from: string, to: string): void
|
|
157
|
+
clear(): void
|
|
158
|
+
}
|
|
159
|
+
|
|
101
160
|
/**
|
|
102
161
|
* Process-owned cross-platform advisory lock.
|
|
103
162
|
*
|
|
@@ -174,20 +233,36 @@ export declare class MacAppearanceObserver {
|
|
|
174
233
|
stop(): void
|
|
175
234
|
}
|
|
176
235
|
|
|
236
|
+
/** A transactional, process-owned native OAuth callback receiver. */
|
|
237
|
+
export declare class NativeOAuthCallback {
|
|
238
|
+
/** Create a receiver without touching the filesystem or OS registration. */
|
|
239
|
+
constructor(options: NativeOAuthCallbackOptions)
|
|
240
|
+
/**
|
|
241
|
+
* Register the scheme transactionally. Returns false on unsupported or
|
|
242
|
+
* remote sessions.
|
|
243
|
+
*/
|
|
244
|
+
start(): Promise<boolean>
|
|
245
|
+
/** Cancel an in-progress start and every pending callback wait. */
|
|
246
|
+
cancel(): void
|
|
247
|
+
/** Wait for and atomically claim the callback URL. */
|
|
248
|
+
waitForCallback(timeoutMs?: number | undefined | null): Promise<string>
|
|
249
|
+
/** Restore prior OS state and release ownership. Safe to call repeatedly. */
|
|
250
|
+
dispose(): Promise<undefined>
|
|
251
|
+
}
|
|
252
|
+
|
|
177
253
|
/**
|
|
178
|
-
* Long-lived
|
|
254
|
+
* Long-lived cross-platform power assertion.
|
|
179
255
|
*
|
|
180
|
-
*
|
|
181
|
-
*
|
|
182
|
-
* platforms
|
|
183
|
-
* code path.
|
|
256
|
+
* macOS uses `IOKit`, Linux holds login1 and desktop `ScreenSaver` inhibitors,
|
|
257
|
+
* and Windows holds thread-affine execution state until the handle is stopped
|
|
258
|
+
* or dropped. Other platforms return a no-op handle.
|
|
184
259
|
*/
|
|
185
|
-
export declare class
|
|
260
|
+
export declare class PowerAssertion {
|
|
186
261
|
/**
|
|
187
|
-
* Acquire a
|
|
188
|
-
*
|
|
262
|
+
* Acquire a power assertion. Unsupported platforms return a no-op handle
|
|
263
|
+
* so callers can stay cross-platform.
|
|
189
264
|
*/
|
|
190
|
-
static start(options?:
|
|
265
|
+
static start(options?: PowerAssertionOptions | undefined | null): PowerAssertion
|
|
191
266
|
/**
|
|
192
267
|
* Release every assertion held by this handle. Safe to call multiple
|
|
193
268
|
* times; subsequent calls are a no-op.
|
|
@@ -573,7 +648,7 @@ export declare function __ompInstallTokioRuntime(): void
|
|
|
573
648
|
* `packages/natives/native/index.js` (which derives the name from
|
|
574
649
|
* `package.json#version`).
|
|
575
650
|
*/
|
|
576
|
-
export declare function
|
|
651
|
+
export declare function __piNativesV1_1_10(): void
|
|
577
652
|
|
|
578
653
|
/**
|
|
579
654
|
* Apply ast-grep rewrite rules to matching files; honors `dryRun` and returns
|
|
@@ -936,6 +1011,16 @@ export declare function cosineSimilarityPairs(vectors: Float64Array, count: numb
|
|
|
936
1011
|
*/
|
|
937
1012
|
export declare function countTokens(input: string | string[], encoding?: Encoding | undefined | null): number
|
|
938
1013
|
|
|
1014
|
+
/**
|
|
1015
|
+
* Decode one complete SIXEL control string into a PNG.
|
|
1016
|
+
*
|
|
1017
|
+
* The decoder is deliberately bounded before handing the stream to
|
|
1018
|
+
* `icy_sixel`: raster declarations, repeats, and row advances are scanned
|
|
1019
|
+
* first so hostile dimensions cannot make the dependency allocate its much
|
|
1020
|
+
* larger internal maximum.
|
|
1021
|
+
*/
|
|
1022
|
+
export declare function decodeSixelToPng(bytes: Uint8Array): Uint8Array
|
|
1023
|
+
|
|
939
1024
|
export interface DesktopCapabilities {
|
|
940
1025
|
backend: string
|
|
941
1026
|
displayServer?: string
|
|
@@ -1136,6 +1221,169 @@ export interface DiffStreamResult {
|
|
|
1136
1221
|
*/
|
|
1137
1222
|
export declare function diffWords(oldText: string, newText: string): Array<DiffChange>
|
|
1138
1223
|
|
|
1224
|
+
/**
|
|
1225
|
+
* Whole-call apply outcome. `is_error` carries the model-facing failure in
|
|
1226
|
+
* `text` with no files.
|
|
1227
|
+
*/
|
|
1228
|
+
export interface EditApplyOutcome {
|
|
1229
|
+
text: string
|
|
1230
|
+
files: Array<EditFileOutcome>
|
|
1231
|
+
isError: boolean
|
|
1232
|
+
}
|
|
1233
|
+
|
|
1234
|
+
/** Apply-time knobs. */
|
|
1235
|
+
export interface EditApplyRequest {
|
|
1236
|
+
lspBatchId?: string
|
|
1237
|
+
lspFlush: boolean
|
|
1238
|
+
}
|
|
1239
|
+
|
|
1240
|
+
/**
|
|
1241
|
+
* Auto-generated-file guard: the rejection message when `absolutePath`
|
|
1242
|
+
* (displayed as `displayPath`) must not be edited, else null. Missing or
|
|
1243
|
+
* unreadable files are editable.
|
|
1244
|
+
*/
|
|
1245
|
+
export declare function editAutoGeneratedMessage(absolutePath: string, displayPath: string): string | null
|
|
1246
|
+
|
|
1247
|
+
/** Tool description markdown for `mode`. */
|
|
1248
|
+
export declare function editDescription(mode: string): string
|
|
1249
|
+
|
|
1250
|
+
/** Numbered unified diff plus the first changed line. */
|
|
1251
|
+
export interface EditDiffResult {
|
|
1252
|
+
diff: string
|
|
1253
|
+
firstChangedLine?: number
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1256
|
+
/** Numbered unified diff between two texts (`generateDiffString`). */
|
|
1257
|
+
export declare function editDiffString(oldText: string, newText: string, path?: string | undefined | null): EditDiffResult
|
|
1258
|
+
|
|
1259
|
+
/** A destructive file operation a payload declares. */
|
|
1260
|
+
export interface EditFileOpIntent {
|
|
1261
|
+
/** `delete` | `move`. */
|
|
1262
|
+
kind: string
|
|
1263
|
+
path: string
|
|
1264
|
+
to?: string
|
|
1265
|
+
}
|
|
1266
|
+
|
|
1267
|
+
/** One file's apply outcome. */
|
|
1268
|
+
export interface EditFileOutcome {
|
|
1269
|
+
/** Absolute path. */
|
|
1270
|
+
path: string
|
|
1271
|
+
displayPath: string
|
|
1272
|
+
/** `create` | `update` | `delete`. */
|
|
1273
|
+
op: string
|
|
1274
|
+
moveTo?: string
|
|
1275
|
+
diff: string
|
|
1276
|
+
firstChangedLine?: number
|
|
1277
|
+
oldText?: string
|
|
1278
|
+
newText?: string
|
|
1279
|
+
snapshotsPruned: boolean
|
|
1280
|
+
diagnosticsJson?: string
|
|
1281
|
+
/** Engine warnings (already rendered into `text`). */
|
|
1282
|
+
warnings: Array<string>
|
|
1283
|
+
/** Model-facing text for this file. */
|
|
1284
|
+
text: string
|
|
1285
|
+
/** The file parsed before the edit and no longer does. */
|
|
1286
|
+
parseRegressed: boolean
|
|
1287
|
+
}
|
|
1288
|
+
|
|
1289
|
+
/** One file's streamed diff preview. */
|
|
1290
|
+
export interface EditFilePreview {
|
|
1291
|
+
/** Display path as authored (after suffix recovery). */
|
|
1292
|
+
path: string
|
|
1293
|
+
/** Numbered unified diff; mutually exclusive with `error`. */
|
|
1294
|
+
diff?: string
|
|
1295
|
+
firstChangedLine?: number
|
|
1296
|
+
/** Model-facing error text. */
|
|
1297
|
+
error?: string
|
|
1298
|
+
/** `create` | `update` | `delete`. */
|
|
1299
|
+
op?: string
|
|
1300
|
+
rename?: string
|
|
1301
|
+
}
|
|
1302
|
+
|
|
1303
|
+
/** Lark grammar for `mode`, when it has a custom wire format. */
|
|
1304
|
+
export declare function editGrammar(mode: string): string | null
|
|
1305
|
+
|
|
1306
|
+
/**
|
|
1307
|
+
* Inspect `argsJson` (the JSON-serialized, possibly partial tool args)
|
|
1308
|
+
* without touching the filesystem.
|
|
1309
|
+
*/
|
|
1310
|
+
export declare function editInspect(mode: string, argsJson: string): EditInspection
|
|
1311
|
+
|
|
1312
|
+
/**
|
|
1313
|
+
* Static projection of a payload: target paths, per-file digests, and
|
|
1314
|
+
* delete/move intents.
|
|
1315
|
+
*/
|
|
1316
|
+
export interface EditInspection {
|
|
1317
|
+
paths: Array<string>
|
|
1318
|
+
entries: Array<EditMatcherEntry>
|
|
1319
|
+
fileOps: Array<EditFileOpIntent>
|
|
1320
|
+
}
|
|
1321
|
+
|
|
1322
|
+
/** `(path, added-lines digest)` for stream matchers. */
|
|
1323
|
+
export interface EditMatcherEntry {
|
|
1324
|
+
path: string
|
|
1325
|
+
digest: string
|
|
1326
|
+
}
|
|
1327
|
+
|
|
1328
|
+
/** Session-wide policy; TypeScript builds it once per tool call. */
|
|
1329
|
+
export interface EditPolicy {
|
|
1330
|
+
cwd: string
|
|
1331
|
+
/** `replace` | `patch` | `apply_patch` | `hashline` | `sloppy`. */
|
|
1332
|
+
mode: string
|
|
1333
|
+
allowFuzzy: boolean
|
|
1334
|
+
fuzzyThreshold: number
|
|
1335
|
+
enforceSeenLines: boolean
|
|
1336
|
+
blockAutoGenerated: boolean
|
|
1337
|
+
planActive: boolean
|
|
1338
|
+
/** Root of the `local://` artifact sandbox; null when the session has none. */
|
|
1339
|
+
localSandboxRoot?: string
|
|
1340
|
+
/** Cached vault roots; null when the vault protocol is disabled. */
|
|
1341
|
+
vaultRoots?: Array<EditVaultRoot>
|
|
1342
|
+
homeDir: string
|
|
1343
|
+
/** The payload is a verbatim custom-format string, not JSON. */
|
|
1344
|
+
rawInput: boolean
|
|
1345
|
+
}
|
|
1346
|
+
|
|
1347
|
+
/** A batch of previews for one session generation. */
|
|
1348
|
+
export interface EditPreviewBatch {
|
|
1349
|
+
/** Monotonically increasing per session. */
|
|
1350
|
+
generation: number
|
|
1351
|
+
/** False for the final untrimmed pass after `finish()`. */
|
|
1352
|
+
streaming: boolean
|
|
1353
|
+
files: Array<EditFilePreview>
|
|
1354
|
+
}
|
|
1355
|
+
|
|
1356
|
+
/** A cached `vault://` root. */
|
|
1357
|
+
export interface EditVaultRoot {
|
|
1358
|
+
/** Vault name; `_` is the active vault. */
|
|
1359
|
+
name: string
|
|
1360
|
+
root: string
|
|
1361
|
+
}
|
|
1362
|
+
|
|
1363
|
+
/** Host write request; the host owns the bytes. */
|
|
1364
|
+
export interface EditWriteRequest {
|
|
1365
|
+
/** Absolute path. */
|
|
1366
|
+
path: string
|
|
1367
|
+
displayPath: string
|
|
1368
|
+
/** `create` | `update` | `delete` | `move`. */
|
|
1369
|
+
op: string
|
|
1370
|
+
/** Absolute destination for `move` (write `content` there, delete `path`). */
|
|
1371
|
+
moveTo?: string
|
|
1372
|
+
/** Final bytes as text; null for `delete`. */
|
|
1373
|
+
content?: string
|
|
1374
|
+
/** Last write of this call and the LSP batch requested a flush. */
|
|
1375
|
+
flushLsp: boolean
|
|
1376
|
+
lspBatchId?: string
|
|
1377
|
+
}
|
|
1378
|
+
|
|
1379
|
+
/** Host write response. */
|
|
1380
|
+
export interface EditWriteResponse {
|
|
1381
|
+
/** Text actually persisted (a bridge may reformat); empty for deletes. */
|
|
1382
|
+
written: string
|
|
1383
|
+
/** `FileDiagnosticsResult` serialized by the host; opaque here. */
|
|
1384
|
+
diagnosticsJson?: string
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1139
1387
|
/** Ellipsis strategy for [`truncate_to_width`]. */
|
|
1140
1388
|
export declare enum Ellipsis {
|
|
1141
1389
|
/** Use a single Unicode ellipsis character ("…"). */
|
|
@@ -1231,6 +1479,9 @@ export declare function execReplace(argv: Array<string>): void
|
|
|
1231
1479
|
*/
|
|
1232
1480
|
export declare function executeShell(options: ShellExecuteOptions, onChunk?: ((error: Error | null, chunk: string) => void) | undefined | null): Promise<ShellRunResult>
|
|
1233
1481
|
|
|
1482
|
+
/** Locate `<SM:EDIT path="…">` payloads the model emitted as plain text. */
|
|
1483
|
+
export declare function extractInlineSloppyRegions(text: string): Array<InlineSloppyRegion>
|
|
1484
|
+
|
|
1234
1485
|
/**
|
|
1235
1486
|
* Extract the before/after slices around an overlay region.
|
|
1236
1487
|
*
|
|
@@ -1487,6 +1738,30 @@ export interface GrepResult {
|
|
|
1487
1738
|
skippedOversized?: number
|
|
1488
1739
|
}
|
|
1489
1740
|
|
|
1741
|
+
/**
|
|
1742
|
+
* Count canonical hashline op header shapes (`PUT N.=M:`, `CUT N*`, …) in
|
|
1743
|
+
* a payload; empty when it carries no hashline ops.
|
|
1744
|
+
*/
|
|
1745
|
+
export declare function hashlineCountOps(input: string): Array<HashlineOpCount>
|
|
1746
|
+
|
|
1747
|
+
/** 4-hex hashline content tag for `text`. */
|
|
1748
|
+
export declare function hashlineFileHash(text: string): string
|
|
1749
|
+
|
|
1750
|
+
/** `[path#TAG]` section header. */
|
|
1751
|
+
export declare function hashlineFormatHeader(path: string, tag: string): string
|
|
1752
|
+
|
|
1753
|
+
/** `N:line` numbered display rows starting at `startLine` (default 1). */
|
|
1754
|
+
export declare function hashlineFormatNumberedLines(text: string, startLine?: number | undefined | null): string
|
|
1755
|
+
|
|
1756
|
+
/** Count of one canonical hashline op header shape in a payload. */
|
|
1757
|
+
export interface HashlineOpCount {
|
|
1758
|
+
label: string
|
|
1759
|
+
count: number
|
|
1760
|
+
}
|
|
1761
|
+
|
|
1762
|
+
/** Strip hashline display prefixes (`N:` / `+N:` …) from pasted rows. */
|
|
1763
|
+
export declare function hashlineStripPrefixes(lines: Array<string>): Array<string>
|
|
1764
|
+
|
|
1490
1765
|
/**
|
|
1491
1766
|
* Quick check if content matches a pattern.
|
|
1492
1767
|
*
|
|
@@ -1560,6 +1835,13 @@ export interface HtmlToMarkdownOptions {
|
|
|
1560
1835
|
skipImages?: boolean
|
|
1561
1836
|
}
|
|
1562
1837
|
|
|
1838
|
+
/** One stray sloppy payload region inside prose (UTF-16 offsets). */
|
|
1839
|
+
export interface InlineSloppyRegion {
|
|
1840
|
+
start: number
|
|
1841
|
+
end: number
|
|
1842
|
+
payload: string
|
|
1843
|
+
}
|
|
1844
|
+
|
|
1563
1845
|
/**
|
|
1564
1846
|
* Invalidate the walker scan cache.
|
|
1565
1847
|
*
|
|
@@ -1772,30 +2054,6 @@ export declare function macOSCheckSpelling(text: string): Promise<Array<Spelling
|
|
|
1772
2054
|
*/
|
|
1773
2055
|
export declare function macOSCompleteWord(text: string, start: number, length: number): Promise<Array<string>>
|
|
1774
2056
|
|
|
1775
|
-
/**
|
|
1776
|
-
* Options for starting a macOS power assertion.
|
|
1777
|
-
*
|
|
1778
|
-
* Each boolean maps to a `caffeinate(8)` flag and a corresponding `IOKit`
|
|
1779
|
-
* `IOPMAssertion` type. Multiple flags can be combined; when set, one
|
|
1780
|
-
* assertion is taken per flag and all are released together when the
|
|
1781
|
-
* handle is stopped or dropped.
|
|
1782
|
-
*
|
|
1783
|
-
* If every flag is unset (or omitted), the handle behaves as if `idle`
|
|
1784
|
-
* were `true` — preserving the historical default of `caffeinate -i`.
|
|
1785
|
-
*/
|
|
1786
|
-
export interface MacOSPowerAssertionOptions {
|
|
1787
|
-
/** Human-readable reason shown in macOS power diagnostics. */
|
|
1788
|
-
reason?: string
|
|
1789
|
-
/** `caffeinate -i`: prevent the system from idle-sleeping. */
|
|
1790
|
-
idle?: boolean
|
|
1791
|
-
/** `caffeinate -s`: prevent the system from sleeping (AC power only). */
|
|
1792
|
-
system?: boolean
|
|
1793
|
-
/** `caffeinate -u`: declare the user is active (wakes the display). */
|
|
1794
|
-
user?: boolean
|
|
1795
|
-
/** `caffeinate -d`: prevent the display from idle-sleeping. */
|
|
1796
|
-
display?: boolean
|
|
1797
|
-
}
|
|
1798
|
-
|
|
1799
2057
|
/** Whether the host can use Apple's native spelling service. */
|
|
1800
2058
|
export declare function macOSSpellCheckerAvailable(): boolean
|
|
1801
2059
|
|
|
@@ -1935,6 +2193,12 @@ export interface MinimizerResult {
|
|
|
1935
2193
|
*/
|
|
1936
2194
|
export declare function mmrRerankIndices(contents: Array<string>, scores: Float64Array, lambdaParam: number, topK: number): Uint32Array
|
|
1937
2195
|
|
|
2196
|
+
/** Construction options for [`NativeOAuthCallback`]. */
|
|
2197
|
+
export interface NativeOAuthCallbackOptions {
|
|
2198
|
+
/** Custom URL scheme to register. */
|
|
2199
|
+
scheme: string
|
|
2200
|
+
}
|
|
2201
|
+
|
|
1938
2202
|
/**
|
|
1939
2203
|
* Named-node chain containing `options.line`, innermost-first, excluding the
|
|
1940
2204
|
* whole-file root.
|
|
@@ -1955,6 +2219,9 @@ export interface NodeSpan {
|
|
|
1955
2219
|
kind: string
|
|
1956
2220
|
}
|
|
1957
2221
|
|
|
2222
|
+
/** Decode notebook JSON into the editable cell-marker text. */
|
|
2223
|
+
export declare function notebookToEditableText(json: string, displayPath: string): string
|
|
2224
|
+
|
|
1958
2225
|
/** Parsed Kitty keyboard protocol sequence result for a Kitty input sequence. */
|
|
1959
2226
|
export interface ParsedKittyResult {
|
|
1960
2227
|
/** Primary codepoint associated with the key. */
|
|
@@ -2033,6 +2300,30 @@ export interface PointerOptions {
|
|
|
2033
2300
|
deliveryMode?: string
|
|
2034
2301
|
}
|
|
2035
2302
|
|
|
2303
|
+
/**
|
|
2304
|
+
* Options for starting a power assertion.
|
|
2305
|
+
*
|
|
2306
|
+
* Each boolean maps to a `caffeinate(8)` flag and the closest corresponding
|
|
2307
|
+
* platform capability. Multiple flags can be combined; when set, one
|
|
2308
|
+
* assertion is taken per flag and all are released together when the
|
|
2309
|
+
* handle is stopped or dropped.
|
|
2310
|
+
*
|
|
2311
|
+
* If every flag is unset (or omitted), the handle behaves as if `idle`
|
|
2312
|
+
* were `true` — preserving the historical default of `caffeinate -i`.
|
|
2313
|
+
*/
|
|
2314
|
+
export interface PowerAssertionOptions {
|
|
2315
|
+
/** Human-readable reason shown in platform power diagnostics. */
|
|
2316
|
+
reason?: string
|
|
2317
|
+
/** `caffeinate -i`: prevent the system from idle-sleeping. */
|
|
2318
|
+
idle?: boolean
|
|
2319
|
+
/** `caffeinate -s`: prevent the system from sleeping (AC power only). */
|
|
2320
|
+
system?: boolean
|
|
2321
|
+
/** `caffeinate -u`: declare the user is active (wakes the display). */
|
|
2322
|
+
user?: boolean
|
|
2323
|
+
/** `caffeinate -d`: prevent the display from idle-sleeping. */
|
|
2324
|
+
display?: boolean
|
|
2325
|
+
}
|
|
2326
|
+
|
|
2036
2327
|
/** Current state of a process reference. */
|
|
2037
2328
|
export declare enum ProcessStatus {
|
|
2038
2329
|
/** The referenced process is still running. */
|
package/native/index.js
CHANGED
|
@@ -21,11 +21,14 @@ export const AudioCapture = nativeBindings.AudioCapture;
|
|
|
21
21
|
export const AudioPlayback = nativeBindings.AudioPlayback;
|
|
22
22
|
export const DesktopSession = adaptDesktopSession(nativeBindings.DesktopSession);
|
|
23
23
|
export const DiffStream = nativeBindings.DiffStream;
|
|
24
|
+
export const EditSession = nativeBindings.EditSession;
|
|
25
|
+
export const EditStore = nativeBindings.EditStore;
|
|
24
26
|
export const FileLock = nativeBindings.FileLock;
|
|
25
27
|
export const HighlightStream = nativeBindings.HighlightStream;
|
|
26
28
|
export const LiveWebRtcPeer = nativeBindings.LiveWebRtcPeer;
|
|
27
29
|
export const MacAppearanceObserver = nativeBindings.MacAppearanceObserver;
|
|
28
|
-
export const
|
|
30
|
+
export const NativeOAuthCallback = nativeBindings.NativeOAuthCallback;
|
|
31
|
+
export const PowerAssertion = nativeBindings.PowerAssertion;
|
|
29
32
|
export const Process = nativeBindings.Process;
|
|
30
33
|
export const PtySession = nativeBindings.PtySession;
|
|
31
34
|
export const Shell = nativeBindings.Shell;
|
|
@@ -36,7 +39,7 @@ export const VcsRepo = nativeBindings.VcsRepo;
|
|
|
36
39
|
|
|
37
40
|
// functions
|
|
38
41
|
export const __ompInstallTokioRuntime = nativeBindings.__ompInstallTokioRuntime;
|
|
39
|
-
export const
|
|
42
|
+
export const __piNativesV1_1_10 = nativeBindings.__piNativesV1_1_10;
|
|
40
43
|
export const astEdit = nativeBindings.astEdit;
|
|
41
44
|
export const astGrep = nativeBindings.astGrep;
|
|
42
45
|
export const astMatch = nativeBindings.astMatch;
|
|
@@ -44,21 +47,33 @@ export const blockRangeAt = nativeBindings.blockRangeAt;
|
|
|
44
47
|
export const copyToClipboard = nativeBindings.copyToClipboard;
|
|
45
48
|
export const cosineSimilarityPairs = nativeBindings.cosineSimilarityPairs;
|
|
46
49
|
export const countTokens = nativeBindings.countTokens;
|
|
50
|
+
export const decodeSixelToPng = nativeBindings.decodeSixelToPng;
|
|
47
51
|
export const detectMacOSAppearance = nativeBindings.detectMacOSAppearance;
|
|
48
52
|
export const deviceCheckGenerateToken = nativeBindings.deviceCheckGenerateToken;
|
|
49
53
|
export const diffLineRuns = nativeBindings.diffLineRuns;
|
|
50
54
|
export const diffLines = nativeBindings.diffLines;
|
|
51
55
|
export const diffWords = nativeBindings.diffWords;
|
|
56
|
+
export const editAutoGeneratedMessage = nativeBindings.editAutoGeneratedMessage;
|
|
57
|
+
export const editDescription = nativeBindings.editDescription;
|
|
58
|
+
export const editDiffString = nativeBindings.editDiffString;
|
|
59
|
+
export const editGrammar = nativeBindings.editGrammar;
|
|
60
|
+
export const editInspect = nativeBindings.editInspect;
|
|
52
61
|
export const enclosingBlockBoundaries = nativeBindings.enclosingBlockBoundaries;
|
|
53
62
|
export const encodeSixel = nativeBindings.encodeSixel;
|
|
54
63
|
export const execReplace = nativeBindings.execReplace;
|
|
55
64
|
export const executeShell = nativeBindings.executeShell;
|
|
65
|
+
export const extractInlineSloppyRegions = nativeBindings.extractInlineSloppyRegions;
|
|
56
66
|
export const extractSegments = nativeBindings.extractSegments;
|
|
57
67
|
export const fuzzyFind = nativeBindings.fuzzyFind;
|
|
58
68
|
export const getSupportedLanguages = nativeBindings.getSupportedLanguages;
|
|
59
69
|
export const getWorkProfile = nativeBindings.getWorkProfile;
|
|
60
70
|
export const glob = nativeBindings.glob;
|
|
61
71
|
export const grep = nativeBindings.grep;
|
|
72
|
+
export const hashlineCountOps = nativeBindings.hashlineCountOps;
|
|
73
|
+
export const hashlineFileHash = nativeBindings.hashlineFileHash;
|
|
74
|
+
export const hashlineFormatHeader = nativeBindings.hashlineFormatHeader;
|
|
75
|
+
export const hashlineFormatNumberedLines = nativeBindings.hashlineFormatNumberedLines;
|
|
76
|
+
export const hashlineStripPrefixes = nativeBindings.hashlineStripPrefixes;
|
|
62
77
|
export const hasMatch = nativeBindings.hasMatch;
|
|
63
78
|
export const highlightCode = nativeBindings.highlightCode;
|
|
64
79
|
export const htmlToMarkdown = nativeBindings.htmlToMarkdown;
|
|
@@ -81,6 +96,7 @@ export const matchesKittySequence = nativeBindings.matchesKittySequence;
|
|
|
81
96
|
export const matchesLegacySequence = nativeBindings.matchesLegacySequence;
|
|
82
97
|
export const mmrRerankIndices = nativeBindings.mmrRerankIndices;
|
|
83
98
|
export const nodeChainAt = nativeBindings.nodeChainAt;
|
|
99
|
+
export const notebookToEditableText = nativeBindings.notebookToEditableText;
|
|
84
100
|
export const parseKey = nativeBindings.parseKey;
|
|
85
101
|
export const parseKittySequence = nativeBindings.parseKittySequence;
|
|
86
102
|
export const pdfToMarkdown = nativeBindings.pdfToMarkdown;
|
package/native/loader-state.js
CHANGED
|
@@ -31,7 +31,14 @@ import { embeddedAddon } from "./embedded-addon.js";
|
|
|
31
31
|
* post-build `--reset` stub) is the authoritative compiled-mode signal.
|
|
32
32
|
*/
|
|
33
33
|
|
|
34
|
-
const SUPPORTED_PLATFORMS = [
|
|
34
|
+
const SUPPORTED_PLATFORMS = [
|
|
35
|
+
"linux-x64",
|
|
36
|
+
"linux-arm64",
|
|
37
|
+
"darwin-x64",
|
|
38
|
+
"darwin-arm64",
|
|
39
|
+
"win32-x64",
|
|
40
|
+
"win32-arm64",
|
|
41
|
+
];
|
|
35
42
|
|
|
36
43
|
/**
|
|
37
44
|
* Streaming startup marker, enabled by `PI_DEBUG_STARTUP`. Local copy of the
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@linxiraos/pi-natives",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.10",
|
|
4
4
|
"description": "Native Rust bindings for PDF conversion, audio, WebRTC, grep, clipboard, image processing, syntax highlighting, PTY, and shell operations via N-API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"homepage": "https://linxira-os.github.io/zeta/",
|
|
@@ -31,12 +31,9 @@
|
|
|
31
31
|
"scripts": {
|
|
32
32
|
"build": "bun ../../scripts/bazel-natives.ts host --dest native",
|
|
33
33
|
"build:bindings": "bun scripts/build-bindings.ts",
|
|
34
|
-
"check": "
|
|
34
|
+
"check": "tsgo -p tsconfig.json --noEmit",
|
|
35
35
|
"check:types": "tsgo -p tsconfig.json --noEmit",
|
|
36
|
-
"lint": "biome lint .",
|
|
37
36
|
"test": "bun test --parallel",
|
|
38
|
-
"fix": "biome check --write --unsafe .",
|
|
39
|
-
"fmt": "biome format --write .",
|
|
40
37
|
"gen:native": "bun scripts/embed-native.ts",
|
|
41
38
|
"gen:native:reset": "bun scripts/embed-native.ts --reset",
|
|
42
39
|
"gen:npm": "bun scripts/gen-npm-packages.ts",
|
|
@@ -98,10 +95,11 @@
|
|
|
98
95
|
}
|
|
99
96
|
},
|
|
100
97
|
"optionalDependencies": {
|
|
101
|
-
"@linxiraos/pi-natives-linux-x64": "1.1.
|
|
102
|
-
"@linxiraos/pi-natives-linux-arm64": "1.1.
|
|
103
|
-
"@linxiraos/pi-natives-darwin-x64": "1.1.
|
|
104
|
-
"@linxiraos/pi-natives-darwin-arm64": "1.1.
|
|
105
|
-
"@linxiraos/pi-natives-win32-x64": "1.1.
|
|
98
|
+
"@linxiraos/pi-natives-linux-x64": "1.1.10",
|
|
99
|
+
"@linxiraos/pi-natives-linux-arm64": "1.1.10",
|
|
100
|
+
"@linxiraos/pi-natives-darwin-x64": "1.1.10",
|
|
101
|
+
"@linxiraos/pi-natives-darwin-arm64": "1.1.10",
|
|
102
|
+
"@linxiraos/pi-natives-win32-x64": "1.1.10",
|
|
103
|
+
"@linxiraos/pi-natives-win32-arm64": "1.1.10"
|
|
106
104
|
}
|
|
107
105
|
}
|