@poe-platform/safe-js 0.1.463 → 0.1.464

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.
@@ -27,7 +27,7 @@ import {
27
27
  validateMigrationSemantics,
28
28
  validateSnapshotData,
29
29
  validateSnapshotMigration
30
- } from "./chunk-NYT6Z4RI.js";
30
+ } from "./chunk-N45AVH5W.js";
31
31
 
32
32
  // packages/safe-js/src/migrate.ts
33
33
  import { createHash } from "node:crypto";
@@ -8249,4 +8249,4 @@ export {
8249
8249
  parseMcpConfig,
8250
8250
  makeMcpModule
8251
8251
  };
8252
- //# sourceMappingURL=chunk-KCQ7OJWN.js.map
8252
+ //# sourceMappingURL=chunk-RYXS4V74.js.map
@@ -22,7 +22,7 @@ import {
22
22
  resolveFsConfig,
23
23
  splitFrontmatter,
24
24
  withBrokenPipeGuard
25
- } from "./chunks/chunk-KCQ7OJWN.js";
25
+ } from "./chunks/chunk-RYXS4V74.js";
26
26
  import {
27
27
  Budget,
28
28
  SandboxError,
@@ -34,7 +34,7 @@ import {
34
34
  replaceErrorStack,
35
35
  restore,
36
36
  run
37
- } from "./chunks/chunk-NYT6Z4RI.js";
37
+ } from "./chunks/chunk-N45AVH5W.js";
38
38
  import "./chunks/chunk-4YIDX44G.js";
39
39
 
40
40
  // packages/safe-js/src/cli.ts
@@ -5,7 +5,7 @@ import {
5
5
  defineExtension,
6
6
  lint,
7
7
  run
8
- } from "./chunks/chunk-NYT6Z4RI.js";
8
+ } from "./chunks/chunk-N45AVH5W.js";
9
9
  import "./chunks/chunk-4YIDX44G.js";
10
10
  export {
11
11
  Budget,
@@ -26,7 +26,7 @@ import {
26
26
  runWithSpawnUsageAccumulator,
27
27
  splitFrontmatter,
28
28
  supportsSpawnMode
29
- } from "./chunks/chunk-KCQ7OJWN.js";
29
+ } from "./chunks/chunk-RYXS4V74.js";
30
30
  import {
31
31
  Budget,
32
32
  FileSnapshotBackend,
@@ -50,7 +50,7 @@ import {
50
50
  registerPendingHostCallPolicy,
51
51
  restore,
52
52
  run
53
- } from "./chunks/chunk-NYT6Z4RI.js";
53
+ } from "./chunks/chunk-N45AVH5W.js";
54
54
  import "./chunks/chunk-4YIDX44G.js";
55
55
 
56
56
  // packages/safe-js/src/parse.ts
@@ -0,0 +1,28 @@
1
+ import type { Budget } from "./budget.js";
2
+ import type { SandboxObject } from "./values.js";
3
+ export type SegmenterOptions = {
4
+ locale: string;
5
+ granularity: "grapheme" | "word" | "sentence";
6
+ };
7
+ export type SegmentState = {
8
+ segmenter: SandboxObject;
9
+ input: string;
10
+ index?: number;
11
+ };
12
+ export declare function createSandboxSegmenter(locales: string | string[], options: Intl.SegmenterOptions): SandboxObject;
13
+ export declare function isSandboxSegmenter(value: unknown): value is SandboxObject;
14
+ export declare function segmenterState(value: unknown): {
15
+ native: Intl.Segmenter;
16
+ options: SegmenterOptions;
17
+ };
18
+ export declare function createSandboxSegments(state: SegmentState): SandboxObject;
19
+ export declare function isSandboxSegments(value: unknown): value is SandboxObject;
20
+ export declare function segmentState(value: unknown, iterator?: boolean): SegmentState & {
21
+ native: Intl.Segments;
22
+ };
23
+ export declare function containingSegment(value: unknown, index: number, iterator: boolean, budget: Budget): {
24
+ segment: string;
25
+ index: number;
26
+ input: string;
27
+ isWordLike?: boolean;
28
+ } | undefined;
@@ -4,6 +4,7 @@ import { type ResolvedListFormatOptions } from "../interp/intl-listformat.js";
4
4
  import { type ResolvedRelativeTimeFormatOptions } from "../interp/intl-relativetimeformat.js";
5
5
  import { type ResolvedDisplayNamesOptions } from "../interp/intl-displaynames.js";
6
6
  import { type ResolvedPluralRulesOptions } from "../interp/intl-pluralrules.js";
7
+ import { type SegmenterOptions } from "../interp/intl-segmenter.js";
7
8
  import { type NumberFormatOptions } from "../interp/intl-numberformat.js";
8
9
  import { type DateTimeFormatOptions } from "../interp/intl-datetimeformat.js";
9
10
  import { type CollectionIterationMethod } from "../interp/collection-iterator.js";
@@ -255,6 +256,16 @@ export type GuestHeapNode<T> = {
255
256
  kind: "guest-pluralrules";
256
257
  options: ResolvedPluralRulesOptions;
257
258
  state: GuestObjectState<T>;
259
+ } | {
260
+ kind: "guest-segmenter";
261
+ options: SegmenterOptions;
262
+ state: GuestObjectState<T>;
263
+ } | {
264
+ kind: "guest-segments";
265
+ segmenter: T;
266
+ input: string;
267
+ index?: number;
268
+ state: GuestObjectState<T>;
258
269
  } | {
259
270
  kind: "iterator-helper";
260
271
  method: IteratorHelperState["method"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@poe-platform/safe-js",
3
- "version": "0.1.463",
3
+ "version": "0.1.464",
4
4
  "description": "Budgeted JavaScript interpreter with explicit host capabilities and resumable execution",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -58,7 +58,7 @@
58
58
  "access": "public"
59
59
  },
60
60
  "dependencies": {
61
- "@poe-platform/safe-fs": "0.1.463",
61
+ "@poe-platform/safe-fs": "0.1.464",
62
62
  "@petamoriken/float16": "^3.9.3",
63
63
  "@formatjs/intl-localematcher": "0.8.13",
64
64
  "@formatjs/bigdecimal": "0.2.7",