peachsim 0.1.2422 → 0.1.2425

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.
Files changed (112) hide show
  1. package/cli/command-agent.ts +14 -15
  2. package/cli/commands/box.ts +33 -28
  3. package/cli/commands/canvas.ts +54 -0
  4. package/cli/commands/platform.ts +28 -27
  5. package/cli/commands/preview.ts +2 -1
  6. package/cli/outbound-endpoints.ts +141 -23
  7. package/dist-lib/agent-daemon-client.cjs +1 -1
  8. package/dist-lib/agent-events.cjs +1 -1
  9. package/dist-lib/attached-projects.cjs +1 -1
  10. package/dist-lib/auth/shared-session.cjs +1 -1
  11. package/dist-lib/backend-origin.cjs +1 -1
  12. package/dist-lib/beta.cjs +1 -1
  13. package/dist-lib/beta.mjs +1 -1
  14. package/dist-lib/bridge-constants.cjs +1 -1
  15. package/dist-lib/bridge-contract-input.cjs +1 -1
  16. package/dist-lib/bridge-contract-input.mjs +1 -1
  17. package/dist-lib/bridge-contract.cjs +1 -1
  18. package/dist-lib/bridge-contract.mjs +1 -1
  19. package/dist-lib/bundle-channel.cjs +114 -28
  20. package/dist-lib/capture-contract.cjs +1 -1
  21. package/dist-lib/capture-contract.mjs +1 -1
  22. package/dist-lib/cloud-contract.cjs +22 -1
  23. package/dist-lib/cloud-contract.mjs +20 -1
  24. package/dist-lib/cloud-test-args.cjs +1 -1
  25. package/dist-lib/cloud-test-args.mjs +1 -1
  26. package/dist-lib/cloud.cjs +1 -1
  27. package/dist-lib/cloud.mjs +1 -1
  28. package/dist-lib/config.cjs +1 -1
  29. package/dist-lib/config.mjs +1 -1
  30. package/dist-lib/detox/index.cjs +27 -13
  31. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  32. package/dist-lib/expo-swift-bundle.cjs +112 -26
  33. package/dist-lib/expo-swift-metadata.cjs +1 -1
  34. package/dist-lib/expo-swift-metadata.mjs +1 -1
  35. package/dist-lib/home-paths.cjs +1 -1
  36. package/dist-lib/host/bridge-host.cjs +114 -28
  37. package/dist-lib/host/fetch-proxy-handler.cjs +4 -4
  38. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  39. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  40. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  41. package/dist-lib/host/websocket-proxy.cjs +1 -1
  42. package/dist-lib/index.cjs +88 -59
  43. package/dist-lib/jump-to-source-babel.cjs +1 -1
  44. package/dist-lib/jump-to-source-native.cjs +22 -7
  45. package/dist-lib/kotlin-host.cjs +1 -1
  46. package/dist-lib/menu.cjs +1 -1
  47. package/dist-lib/menu.mjs +1 -1
  48. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  49. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  50. package/dist-lib/metro-production-bundle.cjs +1 -1
  51. package/dist-lib/metro-production-bundle.mjs +1 -1
  52. package/dist-lib/metro.cjs +25 -10
  53. package/dist-lib/native-app-identity-project.cjs +2 -2
  54. package/dist-lib/native-app-identity-project.mjs +2 -2
  55. package/dist-lib/native-app-identity.cjs +1 -1
  56. package/dist-lib/native-app-identity.mjs +1 -1
  57. package/dist-lib/native-firebase-metadata.cjs +1 -1
  58. package/dist-lib/native-firebase-metadata.mjs +1 -1
  59. package/dist-lib/pdfium-raster.cjs +1 -1
  60. package/dist-lib/pdfium-raster.mjs +1 -1
  61. package/dist-lib/plist.cjs +1 -1
  62. package/dist-lib/plist.mjs +1 -1
  63. package/dist-lib/profiles.cjs +1 -1
  64. package/dist-lib/public-brand.cjs +1 -1
  65. package/dist-lib/public-origins-lib-esm.json +24 -24
  66. package/dist-lib/public-origins-lib.json +54 -53
  67. package/dist-lib/react-native-host-modules.cjs +1 -1
  68. package/dist-lib/react-native-host-modules.mjs +1 -1
  69. package/dist-lib/reap-browser.cjs +1 -1
  70. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  71. package/dist-lib/sdk.cjs +1 -1
  72. package/dist-lib/sdk.mjs +1 -1
  73. package/dist-lib/skills.cjs +258 -150
  74. package/dist-lib/swift-compile.cjs +87 -16
  75. package/dist-lib/swift-compile.mjs +87 -16
  76. package/dist-lib/swift-package.cjs +1 -1
  77. package/dist-lib/swift-package.mjs +1 -1
  78. package/dist-lib/swift-submit.cjs +1 -1
  79. package/dist-lib/swift-submit.mjs +1 -1
  80. package/dist-lib/swift-toolchain.cjs +1 -1
  81. package/dist-lib/swift.cjs +1 -1
  82. package/dist-lib/vite-swift.cjs +88 -17
  83. package/dist-lib/vite.cjs +25 -10
  84. package/dist-lib/worklet-executable.cjs +1 -1
  85. package/dist-lib/worklet-executable.mjs +1 -1
  86. package/dist-types/packages/peach-engine/src/ios/apps/canvas-map-data.d.ts +83 -2
  87. package/dist-types/packages/peach-engine/src/remote-stream/cloud-display.d.ts +2 -2
  88. package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +9 -0
  89. package/dist-types/packages/peach-globals/src/canvasAgentContract.d.ts +8 -0
  90. package/dist-types/packages/peach-globals/src/index.d.ts +4 -2
  91. package/dist-types/packages/peach-globals/src/lockstepCaptureBridgeContract.d.ts +1 -0
  92. package/dist-types/packages/peach-globals/src/replayBridgeContract.d.ts +12 -0
  93. package/dist-types/packages/peach-globals/src/sceneStreamBridgeContract.d.ts +5 -1
  94. package/kotlin/README.md +4 -3
  95. package/kotlin/sdk.tar.gz +0 -0
  96. package/kotlin/toolchain.json +2 -2
  97. package/package.json +1 -1
  98. package/runtime-companion.json +1 -1
  99. package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/CoreData.apinotes +2 -0
  100. package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSPersistentStore.h +2 -0
  101. package/sdk/ios/wasm/include/errno.h +10 -0
  102. package/src/agent-daemon-client.ts +1 -1
  103. package/src/agent-prompt.ts +1 -8
  104. package/src/canvas-agent-note-delivery.ts +2 -5
  105. package/src/canvas-groups.ts +11 -3
  106. package/src/cloud-contract.ts +31 -1
  107. package/src/swift-compile.ts +1 -1
  108. package/src/swift-guest-compile.ts +2 -0
  109. package/src/swift-guest-image-ledger.ts +37 -2
  110. package/src/swift-guest-source-inputs.ts +45 -6
  111. package/src/visit-parsed-program.ts +21 -6
  112. package/src/vite-plugin.ts +4 -1
package/dist-lib/vite.cjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2422 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2425 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -3995,7 +3995,7 @@ var require_lib = __commonJS({
3995
3995
  var runtime_companion_default;
3996
3996
  var init_runtime_companion = __esm({
3997
3997
  "runtime-companion.json"() {
3998
- runtime_companion_default = { abi: 1, sha256: "9bc75c6ccfa87cb58eff71992a2fafa21b4e7acbb37f0b4bef6f74279c98317a", file: "node/cli-9bc75c6ccfa87cb58eff71992a2fafa21b4e7acbb37f0b4bef6f74279c98317a.cjs" };
3998
+ runtime_companion_default = { abi: 1, sha256: "50f7ba9b5269b150a6bd2189f202e3cde6ecd829f705d24a70a88f13e6a92474", file: "node/cli-50f7ba9b5269b150a6bd2189f202e3cde6ecd829f705d24a70a88f13e6a92474.cjs" };
3999
3999
  }
4000
4000
  });
4001
4001
 
@@ -4382,7 +4382,7 @@ var STANDIN_SOURCE_DIGEST;
4382
4382
  var init_swift_standin_digest = __esm({
4383
4383
  "src/swift-standin-digest.ts"() {
4384
4384
  "use strict";
4385
- STANDIN_SOURCE_DIGEST = true ? "1122424b1e57ea84e0c3c2fbd17ce18dee149a87374de8912d176aec8451bc86" : standinSourceDigest();
4385
+ STANDIN_SOURCE_DIGEST = true ? "3a0e0016967d34924d12848e05752d3902596cc16a0f603a5fda32cb024d02f8" : standinSourceDigest();
4386
4386
  }
4387
4387
  });
4388
4388
 
@@ -5759,7 +5759,7 @@ var init_swift_compile = __esm({
5759
5759
  FOUNDATION_IMPLICIT_FLAGS = FOUNDATION_IMPLICIT_MODULES.map(
5760
5760
  (module2) => `, "-Xfrontend", "-import-module", "-Xfrontend", "${module2}"`
5761
5761
  ).join("");
5762
- compilerSourceDigest = true ? "63f37c4a87253305166cb52435207eb3f74394734f1a77e562d79ab7d5d7dfc1" : swiftCompilerSourceDigest2(__sootsim_import_meta_dirname);
5762
+ compilerSourceDigest = true ? "714dbca336e958240697a0238ee5b0640b2b212c34df4843e82d0c1abe3e8c43" : swiftCompilerSourceDigest2(__sootsim_import_meta_dirname);
5763
5763
  C_WORDS = new Set(
5764
5764
  "auto bool break case char const continue default do double else enum extern false float for goto if inline int long register restrict return short signed sizeof static struct switch true typedef union unsigned void volatile while YES NO NULL nil Nil id self super instancetype".split(
5765
5765
  " "
@@ -7385,19 +7385,34 @@ init_public_brand();
7385
7385
  var import_oxc_parser = require("oxc-parser");
7386
7386
  init_is_record();
7387
7387
  function visitParsedProgram(program, visitor) {
7388
+ const enterByType = /* @__PURE__ */ new Map();
7389
+ const exitByType = /* @__PURE__ */ new Map();
7390
+ for (const key of Object.keys(visitor)) {
7391
+ const handler = Reflect.get(visitor, key);
7392
+ if (typeof handler !== "function") continue;
7393
+ const invoke = (node) => {
7394
+ handler(node);
7395
+ };
7396
+ if (key.endsWith(":exit")) exitByType.set(key.slice(0, -5), invoke);
7397
+ else enterByType.set(key, invoke);
7398
+ }
7399
+ if (enterByType.size === 0 && exitByType.size === 0) return;
7400
+ const hasExit = exitByType.size > 0;
7388
7401
  function visit3(value) {
7389
7402
  if (Array.isArray(value)) {
7390
- for (const child of value) visit3(child);
7403
+ for (let i = 0; i < value.length; i++) visit3(value[i]);
7391
7404
  return;
7392
7405
  }
7393
7406
  if (!isRecord(value) || typeof value.type !== "string") return;
7394
7407
  const keys = import_oxc_parser.visitorKeys[value.type];
7395
7408
  if (!keys) return;
7396
- const enter = Reflect.get(visitor, value.type);
7397
- if (typeof enter === "function") enter(value);
7398
- for (const key of keys) visit3(value[key]);
7399
- const exit = Reflect.get(visitor, `${value.type}:exit`);
7400
- if (typeof exit === "function") exit(value);
7409
+ const enter = enterByType.get(value.type);
7410
+ if (enter) enter(value);
7411
+ for (let i = 0; i < keys.length; i++) visit3(value[keys[i]]);
7412
+ if (hasExit) {
7413
+ const exit = exitByType.get(value.type);
7414
+ if (exit) exit(value);
7415
+ }
7401
7416
  }
7402
7417
  visit3(program);
7403
7418
  }
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2422 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2425 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2422 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2425 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  var __defProp = Object.defineProperty;
3
3
  var __typeError = (msg) => {
4
4
  throw TypeError(msg);
@@ -1,4 +1,5 @@
1
- import type { SootSimCapturedTextLine } from '../../../../peach-globals/src/index.d.ts';
1
+ import type { CanvasAgentNote } from '../../../../peach-globals/src/index.d.ts';
2
+ import type { CanvasMapAgent, SootSimCapturedTextLine } from '../../../../peach-globals/src/index.d.ts';
2
3
  export type CanvasMapNode = {
3
4
  nodeId: number;
4
5
  parentNodeId: number | null;
@@ -93,7 +94,12 @@ export type CanvasMapCardContent = {
93
94
  kind: 'card';
94
95
  lines: string[];
95
96
  };
96
- export type CanvasMapScreenContent = CanvasMapFrozenTreeContent | CanvasMapScreenshotContent | CanvasMapAppContent | CanvasMapCardContent;
97
+ export type CanvasMapLiveContent = {
98
+ kind: 'live';
99
+ poster?: string;
100
+ };
101
+ export declare function canvasMapLiveChannel(screenId: string): string;
102
+ export type CanvasMapScreenContent = CanvasMapFrozenTreeContent | CanvasMapScreenshotContent | CanvasMapAppContent | CanvasMapCardContent | CanvasMapLiveContent;
97
103
  export type CanvasMapScreen = {
98
104
  id: string;
99
105
  title: string;
@@ -148,6 +154,9 @@ export type CanvasMapGroupMove = {
148
154
  dragging?: true;
149
155
  };
150
156
  type SectionHitArea = Pick<CanvasMapSection, 'id' | 'title' | 'x' | 'y' | 'width' | 'height' | 'dragFromBody'>;
157
+ export declare const CANVAS_NOTE_HOLD_MS = 350;
158
+ export declare function canvasMapTakesNotes(screen: CanvasMapScreen, agents: readonly CanvasMapAgent[]): boolean;
159
+ export declare function canvasMapInkTargetAt(data: Pick<CanvasMapData, 'screens' | 'hostStrokes'>, agents: readonly CanvasMapAgent[], x: number, y: number): CanvasMapScreen | undefined;
151
160
  export declare function canvasMapSectionAt(sections: readonly SectionHitArea[], x: number, y: number, zoom: number, labelSize: number): SectionHitArea | undefined;
152
161
  export type CanvasMapEdge = {
153
162
  from: string;
@@ -168,6 +177,7 @@ export type CanvasMapFontSpec = {
168
177
  url: string;
169
178
  };
170
179
  export type CanvasMapData = {
180
+ agents?: CanvasMapAgent[];
171
181
  rev?: number;
172
182
  screens: CanvasMapScreen[];
173
183
  sections?: CanvasMapSection[];
@@ -180,6 +190,7 @@ export type CanvasMapData = {
180
190
  labelSize?: number;
181
191
  artboardControls: 'play' | 'none';
182
192
  panPointers: 1 | 2;
193
+ hostStrokes?: boolean;
183
194
  moveItems?: boolean;
184
195
  tapToSelect?: boolean;
185
196
  liveScreenId?: string;
@@ -228,6 +239,15 @@ export type CanvasMapTap = {
228
239
  };
229
240
  export type CanvasMapKey = 'ArrowLeft' | 'ArrowRight' | 'ArrowUp' | 'ArrowDown' | 'Enter' | 'Home';
230
241
  export type CanvasMapCommand = 'fit' | 'actual-size' | {
242
+ kind: 'agent';
243
+ agent: CanvasMapAgent;
244
+ } | {
245
+ kind: 'remove-agent';
246
+ agentId: string;
247
+ } | {
248
+ kind: 'follow-agent';
249
+ agentId: string | null;
250
+ } | {
231
251
  kind: 'camera';
232
252
  x: number;
233
253
  y: number;
@@ -249,6 +269,58 @@ export type CanvasMapCommand = 'fit' | 'actual-size' | {
249
269
  } | CanvasMapInspectCommand | {
250
270
  kind: 'enter';
251
271
  screenId: string | null;
272
+ } | {
273
+ kind: 'note-sent';
274
+ localId: string;
275
+ id: string;
276
+ } | {
277
+ kind: 'note-taken';
278
+ id: string;
279
+ } | {
280
+ kind: 'note-failed';
281
+ localId: string;
282
+ message: string;
283
+ } | {
284
+ kind: 'note-element';
285
+ requestId: number;
286
+ element: CanvasNoteElement | null;
287
+ };
288
+ export type CanvasNoteMark = {
289
+ kind: 'element';
290
+ frame: CanvasNoteRect;
291
+ name: string;
292
+ } | {
293
+ kind: 'stroke';
294
+ points: {
295
+ x: number;
296
+ y: number;
297
+ }[];
298
+ closed: boolean;
299
+ };
300
+ export type CanvasNoteRect = {
301
+ x: number;
302
+ y: number;
303
+ width: number;
304
+ height: number;
305
+ };
306
+ export type CanvasNoteElement = {
307
+ frame: CanvasNoteRect;
308
+ name: string;
309
+ summary: string;
310
+ };
311
+ export type CanvasMapNotePick = {
312
+ requestId: number;
313
+ screenId: string;
314
+ instanceId: string;
315
+ point: {
316
+ x: number;
317
+ y: number;
318
+ };
319
+ };
320
+ export type CanvasMapNote = {
321
+ localId: string;
322
+ screenId: string;
323
+ note: CanvasAgentNote;
252
324
  };
253
325
  export declare function canvasMapEdgePath(from: Pick<CanvasMapScreen, 'x' | 'y' | 'width' | 'height'>, to: Pick<CanvasMapScreen, 'x' | 'y' | 'height'>): string;
254
326
  export declare function getCanvasMapData(): CanvasMapData;
@@ -280,4 +352,13 @@ export type CanvasMapMove = {
280
352
  export declare function reportCanvasMapMove(move: CanvasMapMove): void;
281
353
  export declare function reportCanvasMapGroupMove(move: CanvasMapGroupMove): void;
282
354
  export declare function reportCanvasMapEntered(screenId: string | null): void;
355
+ export declare function reportCanvasMapNotePick(pick: CanvasMapNotePick): void;
356
+ export declare function reportCanvasMapNote(note: CanvasMapNote): void;
357
+ export type CanvasMapStroke = {
358
+ points: {
359
+ x: number;
360
+ y: number;
361
+ }[];
362
+ };
363
+ export declare function reportCanvasMapStroke(stroke: CanvasMapStroke): void;
283
364
  export {};
@@ -1,7 +1,7 @@
1
1
  export declare const DISPLAY_SERVER_VERSION = 26;
2
2
  export declare const DISPLAY_SERVER_MAJOR = 2;
3
- export declare const DISPLAY_SERVER_MINOR = 34;
4
- export declare const DISPLAY_SERVER_SUBPROTOCOL = "rnx.display-server.v2.wire26.minor34";
3
+ export declare const DISPLAY_SERVER_MINOR = 35;
4
+ export declare const DISPLAY_SERVER_SUBPROTOCOL = "rnx.display-server.v2.wire26.minor35";
5
5
  export declare const DISPLAY_SERVER_TOKEN_SUBPROTOCOL_PREFIX = "rnx.sim-token.";
6
6
  export declare const RNX_CLOUD_DISPLAY_GRANT_TTL_MS: number;
7
7
  export declare const RNX_CLOUD_DISPLAY_CLOSE: {
@@ -658,6 +658,15 @@ export type WorkerToHost = {
658
658
  } | {
659
659
  type: 'canvasMapTap';
660
660
  tap: import('../ios/apps/canvas-map-data.d.ts').CanvasMapTap;
661
+ } | {
662
+ type: 'canvasMapNotePick';
663
+ pick: import('../ios/apps/canvas-map-data.d.ts').CanvasMapNotePick;
664
+ } | {
665
+ type: 'canvasMapNote';
666
+ note: import('../ios/apps/canvas-map-data.d.ts').CanvasMapNote;
667
+ } | {
668
+ type: 'canvasMapStroke';
669
+ stroke: import('../ios/apps/canvas-map-data.d.ts').CanvasMapStroke;
661
670
  } | {
662
671
  type: 'surfaceRegistered';
663
672
  surfaceId: string;
@@ -0,0 +1,8 @@
1
+ export declare function canvasAgentColor(agentId: string): string;
2
+ export interface CanvasAgentNote {
3
+ agentId: string;
4
+ text: string;
5
+ inspectSummary: string;
6
+ inspectTrace?: string;
7
+ crop: string;
8
+ }
@@ -45,8 +45,10 @@ export type { SootSimCaptureFilter, SootSimCaptureOptions } from './captureBridg
45
45
  export { SOOTSIM_TIMELINE_KINDS, isTimelineKind, isTimelineEvent, } from './timelineBridgeContract.d.ts';
46
46
  export type { SootSimTimelineKind, SootSimTimelineContext, SootSimTimelineEvent, SootSimTimelineQuery, SootSimTimelineQueryResult, SootSimTimelineCountsByKind, SootSimTimelineSummary, SootSimTimelineStatus, SootSimTimelineBridge, } from './timelineBridgeContract.d.ts';
47
47
  export type { SootSimSceneStreamCommand, SootSimSceneStreamContinuation, SootSimSceneReplayState, SootSimSceneStreamResult, SootSimSceneStreamBridge, } from './sceneStreamBridgeContract.d.ts';
48
- export { createSootSimReplayScreenIdentity, inferCursorMoveMs, createSootSimReplayCursorState, createSootSimReplayState, } from './replayBridgeContract.d.ts';
49
- export type { SootSimReplayCursorMode, SootSimReplayCursorPose, SootSimReplayCursorState, SootSimAgentActionDetail, SootSimAgentIdentity, SootSimHardwareKeyboardInputDetail, SootSimReplayTarget, SootSimReplayEvent, SootSimReplayPathPoint, SootSimReplayPreviewState, SootSimReplayState, } from './replayBridgeContract.d.ts';
48
+ export { createSootSimReplayScreenIdentity, isCanvasMapAgent, inferCursorMoveMs, createSootSimReplayCursorState, createSootSimReplayState, } from './replayBridgeContract.d.ts';
49
+ export type { SootSimReplayCursorMode, SootSimReplayCursorPose, SootSimReplayCursorState, CanvasMapAgent, SootSimAgentActionDetail, SootSimAgentIdentity, SootSimHardwareKeyboardInputDetail, SootSimReplayTarget, SootSimReplayEvent, SootSimReplayPathPoint, SootSimReplayPreviewState, SootSimReplayState, } from './replayBridgeContract.d.ts';
50
50
  export type { PointerSourceEvent } from './pointerSourceEventContract.d.ts';
51
51
  export type { SootSimCornerRadii, NativeSurfaceShadow, NativeSurfaceShadowCast, NativeSurfaceLayout, NativeSurfacePresentation, NativeSurfaceIdentity, NativeSurfacePresented, NativeSurfaceRegistration, } from './nativeSurfaceContract.d.ts';
52
52
  export type { GuestEvaluationReceipt, GuestExecutionDigest, GuestExecutionRecord, GuestExecutionSnapshot, } from './guestExecutionContract.d.ts';
53
+ export { canvasAgentColor } from './canvasAgentContract.d.ts';
54
+ export type { CanvasAgentNote } from './canvasAgentContract.d.ts';
@@ -105,6 +105,7 @@ export interface SootSimLockstepCaptureController {
105
105
  end(): void;
106
106
  }
107
107
  export interface SootSimLockstepCaptureBridge {
108
+ getProgress(): ReturnType<SootSimLockstepCaptureController['progress']> | null;
108
109
  begin(fps: number, options?: {
109
110
  baseline?: boolean;
110
111
  holdGpuScenes?: boolean;
@@ -131,3 +131,15 @@ export declare function createSootSimReplayCursorState(mode?: SootSimReplayCurso
131
131
  y: number;
132
132
  }): SootSimReplayCursorState;
133
133
  export declare function createSootSimReplayState(): SootSimReplayState;
134
+ export type CanvasMapAgent = {
135
+ id: string;
136
+ name: string;
137
+ machine: string;
138
+ step: string;
139
+ screenId: string;
140
+ action?: {
141
+ sequence: number;
142
+ detail: SootSimAgentActionDetail;
143
+ };
144
+ };
145
+ export declare function isCanvasMapAgent(value: unknown): value is CanvasMapAgent;
@@ -15,6 +15,9 @@ export type SootSimSceneStreamCommand = {
15
15
  action: 'play';
16
16
  } | {
17
17
  action: 'pause';
18
+ } | {
19
+ action: 'rate';
20
+ rate: number;
18
21
  } | {
19
22
  action: 'seek';
20
23
  timeMs: number;
@@ -29,6 +32,7 @@ export interface SootSimSceneReplayState {
29
32
  durationMs: number;
30
33
  playing: boolean;
31
34
  ended: boolean;
35
+ rate: number;
32
36
  recordedAtEpochMs: number | null;
33
37
  }
34
38
  export type SootSimSceneStreamResult = {
@@ -40,7 +44,7 @@ export type SootSimSceneStreamResult = {
40
44
  frameCount: number;
41
45
  continuation: SootSimSceneStreamContinuation | null;
42
46
  } | ({
43
- action: 'play' | 'pause' | 'seek' | 'step' | 'state';
47
+ action: 'play' | 'pause' | 'rate' | 'seek' | 'step' | 'state';
44
48
  } & SootSimSceneReplayState);
45
49
  export interface SootSimSceneStreamBridge {
46
50
  run(command: SootSimSceneStreamCommand): Promise<SootSimSceneStreamResult>;
package/kotlin/README.md CHANGED
@@ -10,9 +10,10 @@ traffic in `scripts/debug/peach-swift-lazy-network.sh`.
10
10
 
11
11
  - `toolchain.json` pins the patched Kotlin compiler distribution, kotlinx-coroutines,
12
12
  and the AndroidX runtime and Compose Multiplatform UI Kotlin/Wasm klibs.
13
- `fork/compiler.ts` packages the patched jar with the upstream compiler's companion
14
- files in one verified archive. Skiko's browser resources and
15
- kotlinx-datetime's declared JS module are verified and served beside the wasm.
13
+ `fork/compiler.ts` packages the patched jar, Wasm/JS and JVM compiler files,
14
+ Compose and serialization plugins, and license records in one verified archive.
15
+ Skiko's browser resources and kotlinx-datetime's declared JS module are verified
16
+ and served beside the wasm.
16
17
  Compose libraries and the compiler's bundled Compose plugin are selected only
17
18
  for sources referencing `androidx.compose`. `peachsim/kotlin-host` fetches libraries once
18
19
  into `~/.peach/kotlin/<version>`. kotlinc needs a Java runtime (17 or newer)
package/kotlin/sdk.tar.gz CHANGED
Binary file
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "compiler": {
3
3
  "version": "2.4.20",
4
- "url": "https://r2.rnxsim.com/peach-kotlin-fork/442ef3cc1c5d3bec68d5a2bfbd95e0cde4c3ffe8ac8d74e86e6fb4632a0e6133/kotlin-compiler.tar.gz",
5
- "sha256": "442ef3cc1c5d3bec68d5a2bfbd95e0cde4c3ffe8ac8d74e86e6fb4632a0e6133",
4
+ "url": "https://r2.rnxsim.com/peach-kotlin-fork/522d34b0c77983e43180fd369d26a140230502c0077ae5422419f9f59ac998a8/kotlin-compiler.tar.gz",
5
+ "sha256": "522d34b0c77983e43180fd369d26a140230502c0077ae5422419f9f59ac998a8",
6
6
  "upstreamSha256": "59e9ca74c7904ef2c122b12114937673ccce68de820a663f0ed66ccf8799e0b7"
7
7
  },
8
8
  "libraries": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "peachsim",
3
- "version": "0.1.2422",
3
+ "version": "0.1.2425",
4
4
  "description": "Vite and Metro plugins, testing drivers, and SDK exports for peach.",
5
5
  "author": "Tamagui LLC",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -1 +1 @@
1
- {"abi":1,"sha256":"9bc75c6ccfa87cb58eff71992a2fafa21b4e7acbb37f0b4bef6f74279c98317a","file":"node/cli-9bc75c6ccfa87cb58eff71992a2fafa21b4e7acbb37f0b4bef6f74279c98317a.cjs"}
1
+ {"abi":1,"sha256":"50f7ba9b5269b150a6bd2189f202e3cde6ecd829f705d24a70a88f13e6a92474","file":"node/cli-50f7ba9b5269b150a6bd2189f202e3cde6ecd829f705d24a70a88f13e6a92474.cjs"}
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  Name: CoreData
3
3
  Enumerators:
4
+ - Name: NSManagedObjectResultType
5
+ SwiftName: managedObjectResultType
4
6
  - Name: NSBinaryDataAttributeType
5
7
  SwiftName: binaryDataAttributeType
6
8
  - Name: NSBooleanAttributeType
@@ -3,6 +3,8 @@
3
3
  NS_ASSUME_NONNULL_BEGIN
4
4
  __attribute__((availability(ios,introduced=3.0)))
5
5
  PEACH_SWIFT_CLASS(CoreData) @interface NSPersistentStore : NSObject
6
+ @property (nullable, strong) NSURL *URL;
7
+ @property (readonly, copy) NSString *type;
6
8
  @property (null_resettable, nonatomic, strong) NSDictionary<NSString *, id> *metadata;
7
9
  @end
8
10
  NS_ASSUME_NONNULL_END
@@ -4,3 +4,13 @@
4
4
  // sys/errno.h at darwin's value, so this overlay only routes darwin's
5
5
  // errno.h to it.
6
6
  #include_next <errno.h>
7
+
8
+ #ifdef __wasm_atomics__
9
+ // retain libc's tls storage for the final link through its accessor.
10
+ #undef errno
11
+ #ifdef __cplusplus
12
+ extern "C"
13
+ #endif
14
+ __attribute__((const)) int *__errno_location(void);
15
+ #define errno (*__errno_location())
16
+ #endif
@@ -21,10 +21,10 @@ import type {
21
21
  AgentInspectListenerStatus,
22
22
  AgentInspectMessage,
23
23
  AgentPromptEnvelope,
24
- CanvasAgentNote,
25
24
  CanvasAgentNoteStatus,
26
25
  } from './agent-prompt.ts'
27
26
  import type { AgentSession, AttachedProject } from './attached-projects.ts'
27
+ import type { CanvasAgentNote } from '@peach/globals'
28
28
 
29
29
  export interface AgentDaemonClientOptions {
30
30
  port?: number
@@ -1,3 +1,4 @@
1
+ import type { CanvasAgentNote } from '@peach/globals'
1
2
  export interface AgentPromptEnvelope {
2
3
  text: string
3
4
  displayText?: string
@@ -14,14 +15,6 @@ export interface AgentInspectMessage {
14
15
  crop?: string
15
16
  }
16
17
 
17
- export interface CanvasAgentNote {
18
- agentId: string
19
- text: string
20
- inspectSummary: string
21
- inspectTrace?: string
22
- crop: string
23
- }
24
-
25
18
  export interface CanvasAgentNoteDelivery {
26
19
  send(note: CanvasAgentNote): Promise<{ id: string }>
27
20
  waitUntilTaken(id: string, signal: AbortSignal): Promise<void>
@@ -1,8 +1,5 @@
1
- import type {
2
- CanvasAgentNote,
3
- CanvasAgentNoteDelivery,
4
- CanvasAgentNoteStatus,
5
- } from './agent-prompt'
1
+ import type { CanvasAgentNoteDelivery, CanvasAgentNoteStatus } from './agent-prompt'
2
+ import type { CanvasAgentNote } from '@peach/globals'
6
3
 
7
4
  export function createCanvasAgentNoteDelivery(
8
5
  send: CanvasAgentNoteDelivery['send'],
@@ -1,6 +1,9 @@
1
1
  export type CanvasGrouping = 'project' | 'person' | 'agent' | 'machine' | 'label'
2
2
 
3
- export type CanvasGroupFields = Partial<Record<CanvasGrouping, string | null>>
3
+ // a keyed value groups by a stable key and shows its name, as an agent by id
4
+ export type CanvasGroupValue = string | { key: string; name: string }
5
+
6
+ export type CanvasGroupFields = Partial<Record<CanvasGrouping, CanvasGroupValue | null>>
4
7
 
5
8
  export function groupCanvasItems<T extends CanvasGroupFields>(
6
9
  items: readonly T[],
@@ -8,11 +11,16 @@ export function groupCanvasItems<T extends CanvasGroupFields>(
8
11
  ): { key: string; name: string; items: T[] }[] {
9
12
  const groups = new Map<string, { name: string; items: T[] }>()
10
13
  for (const item of items) {
11
- const value = item[by]?.trim()
14
+ const field = item[by]
15
+ const value = typeof field === 'string' ? field.trim() : field?.key.trim()
12
16
  const key = value ? `value:${value}` : 'missing'
13
17
  const group = groups.get(key)
14
18
  if (group) group.items.push(item)
15
- else groups.set(key, { name: value || `No ${by}`, items: [item] })
19
+ else
20
+ groups.set(key, {
21
+ name: (typeof field === 'object' && field?.name.trim()) || value || `No ${by}`,
22
+ items: [item],
23
+ })
16
24
  }
17
25
  return [...groups]
18
26
  .sort(([, a], [, b]) => a.name.localeCompare(b.name, undefined, { numeric: true }))
@@ -1,5 +1,5 @@
1
1
  import type { BridgeCommandType } from './bridge-contract.ts'
2
- import type { SootSimAgentIdentity } from '@peach/globals'
2
+ import type { SootSimAgentIdentity, SootSimReplayTarget } from '@peach/globals'
3
3
 
4
4
  // each field of a command's driving agent, in characters.
5
5
  export const AGENT_IDENTITY_MAX_CHARS = 200
@@ -30,6 +30,36 @@ export function readAgentIdentity(
30
30
  return { id, name, machine, step }
31
31
  }
32
32
 
33
+ const TEXT_FIELD_TYPE = /text ?(input|field)/i
34
+
35
+ /**
36
+ * what someone watching a sim or its recording may learn about the element an
37
+ * agent acted on. a text field's text is whatever was typed into it, so a field
38
+ * leaves only its ids. every writer of an agent action to a wire projects its
39
+ * target through here.
40
+ */
41
+ export function agentActionTarget(
42
+ target: SootSimReplayTarget | null | undefined,
43
+ ): Pick<SootSimReplayTarget, 'id' | 'testID' | 'text'> | undefined {
44
+ if (!target) return undefined
45
+ const clean = (value: string | null | undefined) => {
46
+ const text = value?.trim().replace(/\s+/g, ' ')
47
+ return text ? text.slice(0, AGENT_IDENTITY_MAX_CHARS) : undefined
48
+ }
49
+ const id = clean(target.id)
50
+ const testID = clean(target.testID)
51
+ const text = TEXT_FIELD_TYPE.test(target.type ?? '') ? undefined : clean(target.text)
52
+ if (!id && !testID && !text) return undefined
53
+ return { ...(id && { id }), ...(testID && { testID }), ...(text && { text }) }
54
+ }
55
+
56
+ export function agentActionTargetName(
57
+ target: SootSimReplayTarget | null | undefined,
58
+ ): string | null {
59
+ const safe = agentActionTarget(target)
60
+ return safe?.text ?? safe?.testID ?? safe?.id ?? null
61
+ }
62
+
33
63
  // largest guest artifact a nano isolate measurably boots, settles, screenshots,
34
64
  // and survives repeated invocations within Cloudflare Dynamic Worker platform
35
65
  // limits (67,108,864 bytes total Dynamic Worker size minus 26,347,088 bytes engine
@@ -3053,7 +3053,6 @@ const FOUNDATION_OVERLAY_TYPES = new Set([
3053
3053
  'NSSwappedDouble',
3054
3054
  'NSSwappedFloat',
3055
3055
  'NSUbiquitousKeyValueStore',
3056
- 'NSValueTransformerName',
3057
3056
  'NSXPCCoder',
3058
3057
  'NSXPCConnection',
3059
3058
  'NSXPCInterface',
@@ -8168,6 +8167,7 @@ function compileSwiftProjectOnce(
8168
8167
  output,
8169
8168
  optimized,
8170
8169
  optimize: input.optimize === true,
8170
+ jobs: swiftBuildJobs(),
8171
8171
  })
8172
8172
  else
8173
8173
  await lowerWasm(output, optimized, { optimize: input.optimize === true })
@@ -64,6 +64,7 @@ export async function compileGuestLink(options: {
64
64
  readonly output: string
65
65
  readonly optimized: string
66
66
  readonly optimize: boolean
67
+ readonly jobs: number
67
68
  }): Promise<void> {
68
69
  const directory = path.join(options.buildDirectory, '.peach-guest-link')
69
70
  mkdirSync(directory, { recursive: true })
@@ -266,6 +267,7 @@ export async function compileGuestLink(options: {
266
267
  toolchainBin: options.toolchainBin,
267
268
  swiftCompiler: options.swiftCompiler,
268
269
  objects: selectedSource.map((artifact) => artifact.path),
270
+ jobs: options.jobs,
269
271
  })
270
272
  const links = sourceGuestRuntimeLinks({
271
273
  toolchainBin: options.toolchainBin,
@@ -120,6 +120,7 @@ function llvmType(value: number): string {
120
120
  }
121
121
 
122
122
  const OBJC_INIT_RECORD = '.objc_init'
123
+ const OBJC_LOAD_FUNCTION = '.objcv2_load_function'
123
124
 
124
125
  // change definition names in the linking symbol table, preserving symbol
125
126
  // indices and relocations. no app or dependency source bodies are changed.
@@ -256,7 +257,8 @@ function rewriteObject(
256
257
  if (sectionName === 'linking') {
257
258
  const version = number()
258
259
  if (version !== 2) throw new Error('unsupported wasm linking version')
259
- const parts: Buffer[] = [encodedString(sectionName), encodeNumber(version)]
260
+ const subsections: { kind: number; content: Buffer }[] = []
261
+ let objcLoader: number | undefined
260
262
  while (offset < section.length) {
261
263
  const kind = section[offset++]!
262
264
  const length = number()
@@ -330,6 +332,9 @@ function rewriteObject(
330
332
  }
331
333
  } else if (symbolKind === 3) number()
332
334
  else throw new Error('unsupported wasm symbol kind')
335
+ if (name === OBJC_LOAD_FUNCTION && symbolKind === 0 && !(flags & 16)) {
336
+ objcLoader = i
337
+ }
333
338
  const alias = names.get(name)
334
339
  // an undefined data symbol has no wasm import, only this linking entry.
335
340
  if (flags & 16 && symbolKind === 1 && alias) usedSymbols.add(name)
@@ -392,7 +397,37 @@ function rewriteObject(
392
397
  content = Buffer.concat([...entries, ...extraEntries])
393
398
  }
394
399
  offset = stop
395
- parts.push(Buffer.from([kind]), encodeNumber(content.length), content)
400
+ subsections.push({ kind, content })
401
+ }
402
+ const parts = [encodedString(sectionName), encodeNumber(version)]
403
+ for (const subsection of subsections) {
404
+ let content = subsection.content
405
+ if (subsection.kind === 6 && objcLoader !== undefined) {
406
+ const [count, entriesStart] = readNumber(content, 0)
407
+ const entries = [content.subarray(0, entriesStart)]
408
+ let entryStart = entriesStart
409
+ for (let i = 0; i < count; i++) {
410
+ const [, symbolStart] = readNumber(content, entryStart)
411
+ const [symbol, entryEnd] = readNumber(content, symbolStart)
412
+ // load the merged objc metadata after Swift registration (0) and before user constructors (101+).
413
+ if (symbol === objcLoader) entries.push(encodeNumber(1))
414
+ entries.push(
415
+ content.subarray(
416
+ symbol === objcLoader ? symbolStart : entryStart,
417
+ entryEnd,
418
+ ),
419
+ )
420
+ entryStart = entryEnd
421
+ }
422
+ if (entryStart !== content.length)
423
+ throw new Error('invalid init functions subsection')
424
+ content = Buffer.concat(entries)
425
+ }
426
+ parts.push(
427
+ Buffer.from([subsection.kind]),
428
+ encodeNumber(content.length),
429
+ content,
430
+ )
396
431
  }
397
432
  section = Buffer.concat(parts)
398
433
  }