@buoy-gg/agent-core 7.0.77 → 7.0.79

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 @@
27
27
  {
28
28
  "action": "getSnapshot",
29
29
  "summary": "Read the app's captured console output \u2014 log/info/warn/error plus uncaught JS errors tagged [FATAL]. Start here when the app crashed, redboxed, or logged something.",
30
- "description": "Returns `{ totalCaptured, shown, entries: [{at, level, message}] }`, newest last. Narrow with `level` (severity threshold), `pattern` (substring) and `limit` \u2014 the raw buffer holds up to 1000 entries at roughly 1KB each, so an unfiltered read is the most expensive thing you can ask for. Only the pre-rendered message is returned; full args and stacks stay on the device. Capture is an in-memory ring buffer that starts when Buoy mounts and resets on every JS reload unless the user turned on \"Preserve log\", so anything logged before that is genuinely absent \u2014 say \"nothing was captured\", never \"nothing happened\".",
30
+ "description": "Returns `{ totalCaptured, shown, entries: [{at, level, message, where?}] }`, newest last. Narrow with `level` (severity threshold), `pattern` (substring) and `limit` \u2014 the raw buffer holds up to 1000 entries at roughly 1KB each, so an unfiltered read is the most expensive thing you can ask for. Only the pre-rendered message is returned, plus `where` on an error: its top app stack frames, the code that threw. Full args and stacks stay on the device. Capture is an in-memory ring buffer that starts when Buoy mounts and resets on every JS reload unless the user turned on \"Preserve log\", so anything logged before that is genuinely absent \u2014 say \"nothing was captured\", never \"nothing happened\".",
31
31
  "params": {
32
32
  "type": "object",
33
33
  "properties": {
@@ -1108,13 +1108,17 @@
1108
1108
  },
1109
1109
  {
1110
1110
  "action": "refetch",
1111
- "summary": "Force one query to re-run its queryFn right now (a real network request), by queryHash.",
1111
+ "summary": "Force one query to re-run its queryFn right now (a real network request), by queryHash. `wait: false` answers at once, before the fetch ends, so the loading state can be read.",
1112
1112
  "params": {
1113
1113
  "type": "object",
1114
1114
  "properties": {
1115
1115
  "queryHash": {
1116
1116
  "type": "string",
1117
1117
  "description": "Target query's hash from listQueries, e.g. '[\"todos\",{\"page\":1}]'. Required \u2014 an unknown hash throws."
1118
+ },
1119
+ "wait": {
1120
+ "type": "boolean",
1121
+ "description": "Default true: answer after the fetch finishes. false: start it and answer at once, so a describeScreen right after shows what the page draws while it loads (for slow-network checks)."
1118
1122
  }
1119
1123
  },
1120
1124
  "required": [
@@ -1132,13 +1136,17 @@
1132
1136
  },
1133
1137
  {
1134
1138
  "action": "invalidate",
1135
- "summary": "Mark a query stale and refetch it if it has active observers \u2014 the normal 'this data is out of date' fix. Takes the query's `queryHash`.",
1139
+ "summary": "Mark a query stale and refetch it if it has active observers \u2014 the normal 'this data is out of date' fix. Takes the query's `queryHash`; `wait: false` answers before the refetch ends.",
1136
1140
  "params": {
1137
1141
  "type": "object",
1138
1142
  "properties": {
1139
1143
  "queryHash": {
1140
1144
  "type": "string",
1141
1145
  "description": "Target query's hash from listQueries. Note the prefix-match blast radius described above."
1146
+ },
1147
+ "wait": {
1148
+ "type": "boolean",
1149
+ "description": "Default true: answer after the fetch finishes. false: start it and answer at once, so a describeScreen right after shows what the page draws while it loads (for slow-network checks)."
1142
1150
  }
1143
1151
  },
1144
1152
  "required": [
@@ -2060,7 +2068,7 @@
2060
2068
  },
2061
2069
  {
2062
2070
  "action": "setNetworkConditions",
2063
- "summary": "Set memory-only network conditions for new intercepted HTTP requests. Pass profile: normal, offline, slow (+500 ms) or verySlow (+2000 ms). Normal clears activation and lets requests through at full speed.",
2071
+ "summary": "Set profile for speed. Set connection for app link state. These work in dev builds. Down caps pace bytes in JS. Up caps wait before send based on body bytes. The socket is not paced. Set profile alone to normal to clear both. Reload clears them too. Set at least one field.",
2064
2072
  "params": {
2065
2073
  "type": "object",
2066
2074
  "properties": {
@@ -2070,14 +2078,26 @@
2070
2078
  "normal",
2071
2079
  "offline",
2072
2080
  "slow",
2073
- "verySlow"
2081
+ "verySlow",
2082
+ "slow3g",
2083
+ "slow4g",
2084
+ "fast4g"
2074
2085
  ],
2075
- "description": "Normal, Offline, 500 ms latency, or 2000 ms latency."
2086
+ "description": "Speed profile. slow adds 500 ms; verySlow adds 2000 ms. The 3G and 4G profiles also cap JS delivery and simulate upload time."
2087
+ },
2088
+ "connection": {
2089
+ "type": "string",
2090
+ "enum": [
2091
+ "auto",
2092
+ "real",
2093
+ "offline",
2094
+ "wifi",
2095
+ "cellular",
2096
+ "noInternet"
2097
+ ],
2098
+ "description": "App link state through an early NetInfo or Expo Network hook. Auto follows Offline; otherwise it uses real state."
2076
2099
  }
2077
2100
  },
2078
- "required": [
2079
- "profile"
2080
- ],
2081
2101
  "additionalProperties": false
2082
2102
  },
2083
2103
  "effect": "write",
@@ -6791,6 +6811,299 @@
6791
6811
  ],
6792
6812
  "unavailableWhen": "The native Swift image-overlay adapter is not registered. React Native does not expose these actions."
6793
6813
  },
6814
+ {
6815
+ "toolId": "memory-leaks",
6816
+ "title": "Memory Leaks",
6817
+ "summary": "Check what stays alive after a screen leaves. Read suspects and growth per loop. An empty list without GC proof does not prove clean.",
6818
+ "unavailableWhen": "Needs @buoy-gg/memory-leaks, Pro and a native dev build. Clock is optional for timers. Route loops need RouteTracker.",
6819
+ "actions": [
6820
+ {
6821
+ "action": "startCheck",
6822
+ "summary": "Move through baselinePath and targetPath. Set cycles and settleMs to tune the check.",
6823
+ "description": "Move through two routes and check what stays alive. Needs Pro and a native dev build.",
6824
+ "effect": "write",
6825
+ "release": "throws",
6826
+ "params": {
6827
+ "type": "object",
6828
+ "properties": {
6829
+ "baselinePath": {
6830
+ "type": "string",
6831
+ "description": "Home route path."
6832
+ },
6833
+ "targetPath": {
6834
+ "type": "string",
6835
+ "description": "Test route path."
6836
+ },
6837
+ "cycles": {
6838
+ "type": "integer",
6839
+ "minimum": 1,
6840
+ "maximum": 20,
6841
+ "description": "Loop count. Default 5."
6842
+ },
6843
+ "settleMs": {
6844
+ "type": "integer",
6845
+ "minimum": 500,
6846
+ "maximum": 5000,
6847
+ "description": "Wait per route in ms. Default 1500."
6848
+ }
6849
+ },
6850
+ "required": [
6851
+ "baselinePath",
6852
+ "targetPath"
6853
+ ],
6854
+ "additionalProperties": false
6855
+ },
6856
+ "releaseNote": "Needs Pro and a native dev build."
6857
+ },
6858
+ {
6859
+ "action": "startWatch",
6860
+ "summary": "Start capture before you enter a screen.",
6861
+ "description": "Start capture before you enter a screen. Needs Pro and a native dev build.",
6862
+ "effect": "write",
6863
+ "release": "throws",
6864
+ "params": {
6865
+ "type": "object",
6866
+ "properties": {},
6867
+ "required": [],
6868
+ "additionalProperties": false
6869
+ },
6870
+ "releaseNote": "Needs Pro and a native dev build."
6871
+ },
6872
+ {
6873
+ "action": "finishWatch",
6874
+ "summary": "Check after you leave the watched screen.",
6875
+ "description": "Check after you leave the watched screen. Needs Pro and a native dev build.",
6876
+ "effect": "write",
6877
+ "release": "throws",
6878
+ "params": {
6879
+ "type": "object",
6880
+ "properties": {},
6881
+ "required": [],
6882
+ "additionalProperties": false
6883
+ },
6884
+ "releaseNote": "Needs Pro and a native dev build."
6885
+ },
6886
+ {
6887
+ "action": "stopCheck",
6888
+ "summary": "Stop the current check by runId.",
6889
+ "description": "Stop the current run. Needs Pro and a native dev build.",
6890
+ "effect": "write",
6891
+ "release": "throws",
6892
+ "params": {
6893
+ "type": "object",
6894
+ "properties": {
6895
+ "runId": {
6896
+ "type": "string",
6897
+ "description": "Current run ID."
6898
+ }
6899
+ },
6900
+ "required": [
6901
+ "runId"
6902
+ ],
6903
+ "additionalProperties": false
6904
+ },
6905
+ "releaseNote": "Needs Pro and a native dev build."
6906
+ },
6907
+ {
6908
+ "action": "getReport",
6909
+ "summary": "Read a report by runId. Omit it for the last report.",
6910
+ "description": "Read the current report. Needs Pro and a native dev build.",
6911
+ "effect": "read",
6912
+ "release": "throws",
6913
+ "params": {
6914
+ "type": "object",
6915
+ "properties": {
6916
+ "runId": {
6917
+ "type": "string",
6918
+ "description": "Run ID to read. Omit for the latest."
6919
+ }
6920
+ },
6921
+ "required": [],
6922
+ "additionalProperties": false
6923
+ },
6924
+ "releaseNote": "Needs Pro and a native dev build."
6925
+ },
6926
+ {
6927
+ "action": "clearReports",
6928
+ "summary": "Drop the last report. Does not free app leaks.",
6929
+ "description": "Drop the last report. Does not free app leaks. Needs Pro and a native dev build.",
6930
+ "effect": "destructive",
6931
+ "release": "throws",
6932
+ "params": {
6933
+ "type": "object",
6934
+ "properties": {},
6935
+ "required": [],
6936
+ "additionalProperties": false
6937
+ },
6938
+ "releaseNote": "Needs Pro and a native dev build."
6939
+ }
6940
+ ]
6941
+ },
6942
+ {
6943
+ "toolId": "ota-update-inspector",
6944
+ "title": "OTA Update Inspector",
6945
+ "summary": "See which Expo update runs. Keep running, found, and fetched state apart. Config hints show their source. Help compares only known facts.",
6946
+ "unavailableWhen": "Needs @buoy-gg/ota-inspector and Buoy Pro. Native actions need expo-updates enabled in this build. Web can only show a device snapshot.",
6947
+ "actions": [
6948
+ {
6949
+ "action": "getState",
6950
+ "summary": "Read the running and pending update.",
6951
+ "description": "Read the running and pending update.",
6952
+ "effect": "read",
6953
+ "release": "works",
6954
+ "releaseNote": "Expo writes need allowActionsInRelease: true. Sync writes also need externalSync.releaseActions to include ota-update-inspector. URL changes need host and native opt-in.",
6955
+ "params": {
6956
+ "type": "object",
6957
+ "properties": {},
6958
+ "additionalProperties": false
6959
+ }
6960
+ },
6961
+ {
6962
+ "action": "check",
6963
+ "summary": "Ask Expo for a new update.",
6964
+ "description": "Ask Expo for a new update.",
6965
+ "effect": "write",
6966
+ "release": "throws",
6967
+ "releaseNote": "Expo writes need allowActionsInRelease: true. Sync writes also need externalSync.releaseActions to include ota-update-inspector. URL changes need host and native opt-in.",
6968
+ "params": {
6969
+ "type": "object",
6970
+ "properties": {},
6971
+ "additionalProperties": false
6972
+ }
6973
+ },
6974
+ {
6975
+ "action": "fetch",
6976
+ "summary": "Fetch an update or server rollback.",
6977
+ "description": "Fetch an update or server rollback.",
6978
+ "effect": "write",
6979
+ "release": "throws",
6980
+ "releaseNote": "Expo writes need allowActionsInRelease: true. Sync writes also need externalSync.releaseActions to include ota-update-inspector. URL changes need host and native opt-in.",
6981
+ "params": {
6982
+ "type": "object",
6983
+ "properties": {},
6984
+ "additionalProperties": false
6985
+ }
6986
+ },
6987
+ {
6988
+ "action": "reload",
6989
+ "summary": "Apply the pending update. Pass expectedType and, for a new update, expectedUpdateId.",
6990
+ "description": "Apply the pending update. This restarts JS. A ticket means the call was queued. Read state after the app reconnects.",
6991
+ "effect": "destructive",
6992
+ "release": "throws",
6993
+ "releaseNote": "Expo writes need allowActionsInRelease: true. Sync writes also need externalSync.releaseActions to include ota-update-inspector. URL changes need host and native opt-in.",
6994
+ "params": {
6995
+ "type": "object",
6996
+ "properties": {
6997
+ "expectedType": {
6998
+ "type": "string",
6999
+ "enum": [
7000
+ "new",
7001
+ "rollback"
7002
+ ],
7003
+ "description": "The pending update type."
7004
+ },
7005
+ "expectedUpdateId": {
7006
+ "type": "string",
7007
+ "description": "The pending id. Required for a new update."
7008
+ }
7009
+ },
7010
+ "additionalProperties": false,
7011
+ "required": [
7012
+ "expectedType"
7013
+ ]
7014
+ }
7015
+ },
7016
+ {
7017
+ "action": "setHeaders",
7018
+ "summary": "Set requestHeaders, or pass null to reset them.",
7019
+ "description": "Set request headers or reset them.",
7020
+ "effect": "write",
7021
+ "release": "throws",
7022
+ "releaseNote": "Expo writes need allowActionsInRelease: true. Sync writes also need externalSync.releaseActions to include ota-update-inspector. URL changes need host and native opt-in.",
7023
+ "params": {
7024
+ "type": "object",
7025
+ "properties": {
7026
+ "requestHeaders": {
7027
+ "type": [
7028
+ "object",
7029
+ "null"
7030
+ ],
7031
+ "additionalProperties": {
7032
+ "type": "string"
7033
+ },
7034
+ "description": "The full header set. Null resets it."
7035
+ }
7036
+ },
7037
+ "additionalProperties": false,
7038
+ "required": [
7039
+ "requestHeaders"
7040
+ ]
7041
+ }
7042
+ },
7043
+ {
7044
+ "action": "setURL",
7045
+ "summary": "Set configOverride with the URL and headers. Pass null to reset both.",
7046
+ "description": "Set the update URL and headers, or reset both.",
7047
+ "effect": "write",
7048
+ "release": "throws",
7049
+ "releaseNote": "Expo writes need allowActionsInRelease: true. Sync writes also need externalSync.releaseActions to include ota-update-inspector. URL changes need host and native opt-in.",
7050
+ "params": {
7051
+ "type": "object",
7052
+ "properties": {
7053
+ "configOverride": {
7054
+ "type": [
7055
+ "object",
7056
+ "null"
7057
+ ],
7058
+ "properties": {
7059
+ "updateUrl": {
7060
+ "type": "string"
7061
+ },
7062
+ "requestHeaders": {
7063
+ "type": "object",
7064
+ "additionalProperties": {
7065
+ "type": "string"
7066
+ }
7067
+ }
7068
+ },
7069
+ "required": [
7070
+ "updateUrl",
7071
+ "requestHeaders"
7072
+ ],
7073
+ "additionalProperties": false,
7074
+ "description": "The new URL and headers. Null resets both."
7075
+ }
7076
+ },
7077
+ "additionalProperties": false,
7078
+ "required": [
7079
+ "configOverride"
7080
+ ]
7081
+ }
7082
+ },
7083
+ {
7084
+ "action": "setExpected",
7085
+ "summary": "Set runtimeVersion and channel for Help checks.",
7086
+ "description": "Set the target facts for Help checks.",
7087
+ "effect": "write",
7088
+ "release": "works",
7089
+ "releaseNote": "Expo writes need allowActionsInRelease: true. Sync writes also need externalSync.releaseActions to include ota-update-inspector. URL changes need host and native opt-in.",
7090
+ "params": {
7091
+ "type": "object",
7092
+ "properties": {
7093
+ "runtimeVersion": {
7094
+ "type": "string",
7095
+ "description": "The runtime to compare with this build."
7096
+ },
7097
+ "channel": {
7098
+ "type": "string",
7099
+ "description": "The channel to compare with this build."
7100
+ }
7101
+ },
7102
+ "additionalProperties": false
7103
+ }
7104
+ }
7105
+ ]
7106
+ },
6794
7107
  {
6795
7108
  "toolId": "three",
6796
7109
  "title": "Scene",
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.CATALOG_ACTIONS=void 0;const CATALOG_ACTIONS=exports.CATALOG_ACTIONS={"env":["getSnapshot"],"console":["getSnapshot","clearEntries"],"sentry":["getSnapshot","clearEnvelopes"],"jotai":["getSnapshot","listAtoms","getAtomValue","getChangeDetail","setAtom","clearEvents"],"route-events":["getSnapshot","getCurrentRoute","navigate","stackGoBack","stackNavigateToIndex","stackPopToIndex","stackPopToTop","clearEvents"],"debug-borders":["cycleMode","setMode"],"zustand":["getSnapshot","listStores","getStoreState","getChangeDetail","setState","rehydrate","clearEvents"],"redux":["getSnapshot","getState","getActionDetail","dispatch","setState","clearEvents"],"impersonate":["getSnapshot","searchUsers","startImpersonation","stopImpersonation","pauseImpersonation","resumeImpersonation","updateSettings","removeFromHistory","clearHistory"],"query":["listQueries","getQueryData","refetch","invalidate","reset","remove","setQueryData","triggerError","restoreError","triggerLoading","restoreLoading","clearQueryCache","clearMutationCache","setOnline"],"events":["exportEvents","setEnabledSources","clearEvents"],"network":["getSnapshot","getCaptureStatus","getEventBody","setPinned","setSaved","removeSavedRecord","clearSavedRequests","clearPinnedRequests","clearEvents","listOverrideRules","getOverrideRuleBody","debugOverrides","upsertOverrideRule","setOverrideRuleEnabled","setOverridesEnabled","deleteOverrideRule","clearOverrideRules","getNetworkConditions","setNetworkConditions"],"js-top":["sample","getOriginDetail","setEnabled","pause","resume","clear"],"app":["ping","reloadApp"],"time-machine":["list","capture","captureBaseline","wipeAll","restore","preview","inspect","delete","rename","duplicate","setExclusions","setScope","setRestoreRoute"],"clock":["getState","setTime","shift","freeze","resume","setRate","reset","updateSettings","jumpToTokenExpiry","failNextRequest","stopTokenCheck"],"lifecycle":["getState","background","interrupt","returnToApp","memoryWarning","openUrl","pressBack","setColorScheme","setPower","resetPower","relaunch","runRecipe","clearReport","reset"],"location":["getState","setLocation","startRoute","pauseRoute","resumeRoute","stopRoute","seekRoute","setSpeed","enterRegion","exitRegion","setConditions","setSignal","setServices","tune","useRealLocation","reset","updateSettings","clearLog"],"permissions":["getState","setOverride","clearOverride","resetAll","requestReal","updateSettings","simulateReturnFromSettings","clearLog"],"storage":["getSnapshot","getRequiredKeys","async.getAllKeys","async.multiGet","async.getItem","async.setItem","async.removeItem","async.multiRemove","async.multiSet","async.clear","clearAppStorage","getEventDetail","clearEvents","timeTravel.undo","timeTravel.jump","mmkv.snapshot","mmkv.get","mmkv.set","mmkv.remove","secure.keys","secure.snapshot","secure.get","secure.set","secure.delete"],"highlight-updates":["describeScreen","tapElement","waitFor","beginMeasurement","endMeasurement","locateComponent","getComponentSource","getRenderDetail","setEnabled","toggle","setSilentTracking","toggleFreeze","setSpotlight","clearRenderCounts","startTouchCapture","stopTouchCapture","clearTouchCapture","readTouchCapture"],"scenarios":["listScenarios","getScenario","save","acceptDraft","discardDraft","preview","run","deactivate","delete","setFolder","listFolders","getActive","export"],"perf-monitor":["setEnabled","startRecording","stopRecording","savePending","discardPending","mark","startAutomation","cancelAutomation","acknowledgeAutomation","refreshIndex","getAutomationConfig","setAutomationConfig","loadReport","deleteReport","deleteBatch","clearAll"],"assets":["list","getDetail","rescan","measureSizes","saveBaseline","clearBaseline","getDiff","clearRecords","getScanStatus"],"tv-remote":["arm","getEventsSince","setMenuCapture","disarm","clear"],"focus-inspector":["rescan","focusElement","setTracking","clearHistory"],"images":["list","getDetail","getCaptureStatus","retry","flash","proveSavings","setOverride","clearOverride","setNetworkMode","setBlankImages","hardReload","evictDisk","massAction","clearRecords","clearExpoCaches"],"ask-buoy":["listChanges","undoChange","undoAll","retrieve","openProcedure"],"push-notifications":["getSnapshot","getCapabilities","getEvent","getPermissions","listPresented","refreshToken","setCaptureSession","clearCapturedEvents","scheduleLocal"],"image-overlay":["getSnapshot","listTargets","selectTarget","loadImage","setSettings","fitToScreen","resetSettings","remove"],"three":["getScene","getStats","action"]};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.CATALOG_ACTIONS=void 0;const CATALOG_ACTIONS=exports.CATALOG_ACTIONS={"env":["getSnapshot"],"console":["getSnapshot","clearEntries"],"sentry":["getSnapshot","clearEnvelopes"],"jotai":["getSnapshot","listAtoms","getAtomValue","getChangeDetail","setAtom","clearEvents"],"route-events":["getSnapshot","getCurrentRoute","navigate","stackGoBack","stackNavigateToIndex","stackPopToIndex","stackPopToTop","clearEvents"],"debug-borders":["cycleMode","setMode"],"zustand":["getSnapshot","listStores","getStoreState","getChangeDetail","setState","rehydrate","clearEvents"],"redux":["getSnapshot","getState","getActionDetail","dispatch","setState","clearEvents"],"impersonate":["getSnapshot","searchUsers","startImpersonation","stopImpersonation","pauseImpersonation","resumeImpersonation","updateSettings","removeFromHistory","clearHistory"],"query":["listQueries","getQueryData","refetch","invalidate","reset","remove","setQueryData","triggerError","restoreError","triggerLoading","restoreLoading","clearQueryCache","clearMutationCache","setOnline"],"events":["exportEvents","setEnabledSources","clearEvents"],"network":["getSnapshot","getCaptureStatus","getEventBody","setPinned","setSaved","removeSavedRecord","clearSavedRequests","clearPinnedRequests","clearEvents","listOverrideRules","getOverrideRuleBody","debugOverrides","upsertOverrideRule","setOverrideRuleEnabled","setOverridesEnabled","deleteOverrideRule","clearOverrideRules","getNetworkConditions","setNetworkConditions"],"js-top":["sample","getOriginDetail","setEnabled","pause","resume","clear"],"app":["ping","reloadApp"],"time-machine":["list","capture","captureBaseline","wipeAll","restore","preview","inspect","delete","rename","duplicate","setExclusions","setScope","setRestoreRoute"],"clock":["getState","setTime","shift","freeze","resume","setRate","reset","updateSettings","jumpToTokenExpiry","failNextRequest","stopTokenCheck"],"lifecycle":["getState","background","interrupt","returnToApp","memoryWarning","openUrl","pressBack","setColorScheme","setPower","resetPower","relaunch","runRecipe","clearReport","reset"],"location":["getState","setLocation","startRoute","pauseRoute","resumeRoute","stopRoute","seekRoute","setSpeed","enterRegion","exitRegion","setConditions","setSignal","setServices","tune","useRealLocation","reset","updateSettings","clearLog"],"permissions":["getState","setOverride","clearOverride","resetAll","requestReal","updateSettings","simulateReturnFromSettings","clearLog"],"storage":["getSnapshot","getRequiredKeys","async.getAllKeys","async.multiGet","async.getItem","async.setItem","async.removeItem","async.multiRemove","async.multiSet","async.clear","clearAppStorage","getEventDetail","clearEvents","timeTravel.undo","timeTravel.jump","mmkv.snapshot","mmkv.get","mmkv.set","mmkv.remove","secure.keys","secure.snapshot","secure.get","secure.set","secure.delete"],"highlight-updates":["describeScreen","tapElement","waitFor","beginMeasurement","endMeasurement","locateComponent","getComponentSource","getRenderDetail","setEnabled","toggle","setSilentTracking","toggleFreeze","setSpotlight","clearRenderCounts","startTouchCapture","stopTouchCapture","clearTouchCapture","readTouchCapture"],"scenarios":["listScenarios","getScenario","save","acceptDraft","discardDraft","preview","run","deactivate","delete","setFolder","listFolders","getActive","export"],"perf-monitor":["setEnabled","startRecording","stopRecording","savePending","discardPending","mark","startAutomation","cancelAutomation","acknowledgeAutomation","refreshIndex","getAutomationConfig","setAutomationConfig","loadReport","deleteReport","deleteBatch","clearAll"],"assets":["list","getDetail","rescan","measureSizes","saveBaseline","clearBaseline","getDiff","clearRecords","getScanStatus"],"tv-remote":["arm","getEventsSince","setMenuCapture","disarm","clear"],"focus-inspector":["rescan","focusElement","setTracking","clearHistory"],"images":["list","getDetail","getCaptureStatus","retry","flash","proveSavings","setOverride","clearOverride","setNetworkMode","setBlankImages","hardReload","evictDisk","massAction","clearRecords","clearExpoCaches"],"ask-buoy":["listChanges","undoChange","undoAll","retrieve","openProcedure"],"push-notifications":["getSnapshot","getCapabilities","getEvent","getPermissions","listPresented","refreshToken","setCaptureSession","clearCapturedEvents","scheduleLocal"],"image-overlay":["getSnapshot","listTargets","selectTarget","loadImage","setSettings","fitToScreen","resetSettings","remove"],"memory-leaks":["startCheck","startWatch","finishWatch","stopCheck","getReport","clearReports"],"ota-update-inspector":["getState","check","fetch","reload","setHeaders","setURL","setExpected"],"three":["getScene","getStats","action"]};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.SNAPSHOT_ACTION=void 0;exports.projectSnapshot=projectSnapshot;var _redact=require("../policy/redact");const SNAPSHOT_ACTION=exports.SNAPSHOT_ACTION="getSnapshot";const SEVERITY={verbose:0,debug:0,trace:0,log:1,info:1,warn:2,warning:2,error:3};function asArray(a){return Array.isArray(a)?a:[]}function rec(a){return a&&typeof a==="object"?a:{}}function num(a,t){return typeof a==="number"&&a>0?a:t}function newest(a,t){const s=o=>{const r=rec(o).timestamp;const u=typeof r==="number"?r:typeof r==="string"?Date.parse(r):NaN;return Number.isFinite(u)?u:0};return[...a].sort((o,r)=>s(r)-s(o)).slice(0,t)}function withinBudget(a,t){const s=[];for(const o of a){const r=JSON.stringify(o).length+1;if(r>t)continue;s.push(o);t-=r}return s}function projectConsole(a,t){const s=asArray(rec(a).entries);const o=typeof t.level==="string"?SEVERITY[t.level]??0:0;const r=typeof t.pattern==="string"?t.pattern.toLowerCase():void 0;const u=s.filter(l=>{const e=rec(l);const i=String(e.level??"log");if((SEVERITY[i]??1)<o)return false;if(!r)return true;return String(e.message??"").toLowerCase().includes(r)});const n=newest(u,num(t.limit,40));return{totalCaptured:s.length,shown:n.length,entries:n.map(l=>{const e=rec(l);return{at:e.timestamp,level:e.level,message:e.message}})}}function projectNetwork(a,t){const s=rec(a);const o=asArray(s.events).filter(e=>!(0,_redact.isSelfTraffic)(rec(e).url));const r=t.failedOnly===true;const u=typeof t.pattern==="string"?t.pattern.toLowerCase():void 0;const n=o.filter(e=>{const i=rec(e);const c=typeof i.status==="number"?i.status:void 0;if(r&&!(i.error||c!==void 0&&c>=400))return false;if(!u)return true;return String(i.url??"").toLowerCase().includes(u)});const l=newest(n,num(t.limit,25));return{totalCaptured:o.length,shown:l.length,requests:l.map(e=>{const i=rec(e);return{id:i.id,at:i.timestamp,method:i.method,url:i.url,status:i.status,durationMs:i.duration,error:i.error,overridden:i.override?true:void 0}}),hint:"Read one response with network.getEventBody({ id })."}}function routeParams(a){const t=Object.entries(rec(a)).slice(0,6).map(([s,o])=>{const r=typeof o==="string"||typeof o==="number"||typeof o==="boolean";const u=r&&String(o).length<=48&&!(0,_redact.isSecretKey)(s,"route");return[s.slice(0,48),u?(0,_redact.redact)(o):"(value omitted)"]});return t.length?Object.fromEntries(t):void 0}function flattenRoutes(a,t,s=80){const o=new Map;for(const i of t.slice(0,160)){if(typeof i.pathname!=="string")continue;const c=routeParams(i.params);if(c)o.set(i.pathname,{...c,...o.get(i.pathname)})}const r=[];const u=new Set;let n=3e3;const l=(i,c=[])=>{if(r.length>=s||u.has(i))return;u.add(i);const f=o.get(i)??{};const p=[...new Set([...Object.keys(f),...asArray(c).filter(m=>typeof m==="string")])].slice(0,6).map(m=>{const g=f[m];return g===void 0||g==="(value omitted)"?m.slice(0,48):`${m}=${String(g)}`});const h=p.every(m=>Object.keys(f).some(g=>m===g||m.startsWith(`${g}=`)))?"params seen":"params";const d=p.length?` (${h}: ${p.join(", ")})`:"";const y=d.length<=n;if(y)n-=d.length;r.push(i+(y?d:""))};const e=(i,c=0)=>{if(c>12)return;for(const f of asArray(i)){if(r.length>=s)break;const p=rec(f);if(p.isInternal!==true&&typeof p.path==="string")l(p.path,p.params);e(p.children,c+1)}};e(a);for(const i of o.keys())l(i);return r}function projectStorage(a,t){const s=n=>typeof n==="string"&&n.length>300?`${n.slice(0,300)}\u2026`:n;const o=typeof t.key==="string"?t.key.toLowerCase():void 0;const r=asArray(a).map(rec).map(n=>{const l=rec(n.data);return{id:n.id,at:n.timestamp,action:n.action,storage:n.storageType,key:l.key??l.keys,value:s(l.value),prevValue:s(l.prevValue)}}).filter(n=>!o||JSON.stringify(n.key??"").toLowerCase().includes(o)).sort((n,l)=>String(l.at).localeCompare(String(n.at)));const u=num(t.limit,20);return{events:r.slice(0,u),total:r.length,returned:Math.min(u,r.length)}}function projectRedux(a,t){const s=n=>{if(n===void 0)return void 0;const l=typeof n==="string"?n:JSON.stringify(n);return l&&l.length>400?`${l.slice(0,400)}\u2026`:n};const o=typeof t.type==="string"?t.type.toLowerCase():void 0;const r=asArray(a).map(rec).filter(n=>n.category!=="internal").map(n=>({id:n.id,at:n.timestamp,type:n.type,payload:s(n.payload),meta:s(n.meta),error:s(n.error),changed:n.diffSummary||void 0})).filter(n=>!o||String(n.type).toLowerCase().includes(o)).sort((n,l)=>Number(l.at)-Number(n.at));const u=num(t.limit,20);return{actions:r.slice(0,u),total:r.length,returned:Math.min(u,r.length)}}function projectStoreChanges(a,t,s,o){const r=e=>{if(e===void 0)return void 0;const i=typeof e==="string"?e:JSON.stringify(e);return i&&i.length>400?`${i.slice(0,400)}\u2026`:e};const u=typeof t[o]==="string"?String(t[o]).toLowerCase():void 0;const n=asArray(rec(a).changes).map(rec).map(e=>({id:e.id,at:e.timestamp,[o]:e[s],changed:e.changedKeys,summary:e.diffSummary||void 0,...s==="storeName"?{partial:r(e.partial)}:{value:r(e.valuePreview)}})).filter(e=>!u||String(e[o]??"").toLowerCase().includes(u)).sort((e,i)=>Number(i.at)-Number(e.at));const l=num(t.limit,20);return{changes:n.slice(0,l),total:n.length,returned:Math.min(l,n.length)}}function projectRoutes(a,t){const s=rec(a);const o=rec(s.sitemap);const r=asArray(s.stack).map(rec);const u=asArray(s.events).map(rec);const n=r.map(c=>({name:c.name,path:c.pathname,...routeParams(c.params)?{params:routeParams(c.params)}:{},focused:c.isFocused===true?true:void 0}));const l=u.slice(0,num(t.limit,15)).map(c=>({at:c.timestamp,from:c.previousPathname,to:c.pathname,...routeParams(c.params)?{params:routeParams(c.params)}:{}}));const e=r.find(c=>c.isFocused===true)??r[r.length-1];const i=u.length?{path:u[0].pathname,source:"event",...routeParams(u[0].params)?{params:routeParams(u[0].params)}:{}}:typeof e?.pathname==="string"?{path:e.pathname,source:"stack",...routeParams(e.params)?{params:routeParams(e.params)}:{}}:void 0;return{currentRoute:i,stack:n,routes:flattenRoutes(o.routes,[...u.slice(0,80),...r.slice(0,80)]),sitemapSource:o.source,recentNavigations:l}}function projectEnv(a){const t=rec(a);return{env:t.env??t.variables,requiredEnvVars:t.requiredEnvVars,...Array.isArray(t.checks)?{checks:t.checks}:{}}}function projectSentry(a,t){const s=rec(a);const o=asArray(s.envelopes).map(rec);const r=typeof t.type==="string"?t.type:void 0;const u=typeof t.pattern==="string"?t.pattern.toLowerCase():void 0;const n=o.filter(e=>{const i=asArray(e.items).map(rec);if(r&&!i.some(c=>c.type===r))return false;if(!u)return true;return i.some(c=>String(c.summary??"").toLowerCase().includes(u))});const l=withinBudget(newest(n,num(t.limit,10)).map(e=>({id:e.id,at:e.timestamp,origin:e.origin,eventId:e.eventId,totalBytes:e.totalBytes,items:asArray(e.items).slice(0,8).map(i=>{const c=rec(i);return{type:c.type,summary:typeof c.summary==="string"?c.summary.slice(0,300):c.summary,spanCount:c.spanCount,bytes:c.bytes}})})),12e3);return{status:s.status,totalCaptured:o.length,shown:l.length,envelopes:l,drops:(()=>{const e=rec(s.drops);const i=asArray(e.recent).map(rec);const c=d=>d.category==="span"||d.category==="transaction";const f=[...newest(i.filter(d=>!c(d)),8),...newest(i.filter(c),3)];const p=withinBudget(f.map(d=>({at:d.timestamp,reason:d.reason,category:d.category,quantity:d.quantity,detail:typeof d.detail==="string"?d.detail.slice(0,200):d.detail})),4e3);const h=withinBudget(asArray(e.summary),2e3);return p.length||e.summary?{summary:h,recent:p}:void 0})(),hint:"For crash stack traces, console's [FATAL] entries carry the component stacks. `drops` lists events the SDK discarded before sending, with the reason."}}function projectImpersonate(a){const t=rec(a);const s=o=>{if(o===null||o===void 0)return null;const r=rec(o);return{id:r.id,displayName:r.displayName,email:r.email}};return{isActive:t.isActive,isPaused:t.isPaused,currentUser:s(t.currentUser),headerKey:t.headerKey,ignorePatterns:t.ignorePatterns,dataNukeSettings:t.dataNukeSettings,showBanner:t.showBanner,history:asArray(t.history).slice(0,10).map(o=>{const r=rec(o);return{user:s(r.user),lastUsedAt:r.lastUsedAt}})}}function projectSnapshot(a,t,s={}){switch(a){case"console":return projectConsole(t,s);case"network":return projectNetwork(t,s);case"route-events":return projectRoutes(t,s);case"storage":return projectStorage(t,s);case"redux":return projectRedux(t,s);case"zustand":return projectStoreChanges(t,s,"storeName","store");case"jotai":return projectStoreChanges(t,s,"atomLabel","atom");case"env":return projectEnv(t);case"impersonate":return projectImpersonate(t);case"sentry":return projectSentry(t,s);default:return t}}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.SNAPSHOT_ACTION=void 0;exports.projectSnapshot=projectSnapshot;var _redact=require("../policy/redact");const SNAPSHOT_ACTION=exports.SNAPSHOT_ACTION="getSnapshot";const SEVERITY={verbose:0,debug:0,trace:0,log:1,info:1,warn:2,warning:2,error:3};function asArray(a){return Array.isArray(a)?a:[]}function rec(a){return a&&typeof a==="object"?a:{}}function num(a,t){return typeof a==="number"&&a>0?a:t}function newest(a,t){const e=i=>{const s=rec(i).timestamp;const u=typeof s==="number"?s:typeof s==="string"?Date.parse(s):NaN;return Number.isFinite(u)?u:0};return[...a].sort((i,s)=>e(s)-e(i)).slice(0,t)}function withinBudget(a,t){const e=[];for(const i of a){const s=JSON.stringify(i).length+1;if(s>t)continue;e.push(i);t-=s}return e}function crashSite(a){if(typeof a!=="string")return void 0;const t=a.split("\n").map(e=>e.trim()).filter(e=>/^at\s/.test(e)&&!/node_modules|\(native\)|<anonymous>/.test(e)).slice(0,3).map(e=>e.replace(/https?:\/\/[^/\s]+\/(@fs)?/g,"").replace(/\?v=[\w]+/g,""));return t.length?t.join(" | ").slice(0,300):void 0}function projectConsole(a,t){const e=asArray(rec(a).entries);const i=typeof t.level==="string"?SEVERITY[t.level]??0:0;const s=typeof t.pattern==="string"?t.pattern.toLowerCase():void 0;const u=e.filter(l=>{const n=rec(l);const o=String(n.level??"log");if((SEVERITY[o]??1)<i)return false;if(!s)return true;return String(n.message??"").toLowerCase().includes(s)});const r=newest(u,num(t.limit,40));return{totalCaptured:e.length,shown:r.length,entries:r.map(l=>{const n=rec(l);const o=n.level==="error"?crashSite(n.stack):void 0;return{at:n.timestamp,level:n.level,message:n.message,...o?{where:o}:{}}})}}function projectNetwork(a,t){const e=rec(a);const i=asArray(e.events).filter(n=>!(0,_redact.isSelfTraffic)(rec(n).url));const s=t.failedOnly===true;const u=typeof t.pattern==="string"?t.pattern.toLowerCase():void 0;const r=i.filter(n=>{const o=rec(n);const c=typeof o.status==="number"?o.status:void 0;if(s&&!(o.error||c!==void 0&&c>=400))return false;if(!u)return true;return String(o.url??"").toLowerCase().includes(u)});const l=newest(r,num(t.limit,25));return{totalCaptured:i.length,shown:l.length,requests:l.map(n=>{const o=rec(n);return{id:o.id,at:o.timestamp,method:o.method,url:o.url,status:o.status,durationMs:o.duration,error:o.error,overridden:o.override?true:void 0}}),hint:"Read one response with network.getEventBody({ id })."}}function routeParams(a){const t=Object.entries(rec(a)).slice(0,6).map(([e,i])=>{const s=typeof i==="string"||typeof i==="number"||typeof i==="boolean";const u=s&&String(i).length<=48&&!(0,_redact.isSecretKey)(e,"route");return[e.slice(0,48),u?(0,_redact.redact)(i):"(value omitted)"]});return t.length?Object.fromEntries(t):void 0}function flattenRoutes(a,t,e=80){const i=new Map;for(const o of t.slice(0,160)){if(typeof o.pathname!=="string")continue;const c=routeParams(o.params);if(c)i.set(o.pathname,{...c,...i.get(o.pathname)})}const s=[];const u=new Set;let r=3e3;const l=(o,c=[])=>{if(s.length>=e||u.has(o))return;u.add(o);const f=i.get(o)??{};const p=[...new Set([...Object.keys(f),...asArray(c).filter(m=>typeof m==="string")])].slice(0,6).map(m=>{const g=f[m];return g===void 0||g==="(value omitted)"?m.slice(0,48):`${m}=${String(g)}`});const h=p.every(m=>Object.keys(f).some(g=>m===g||m.startsWith(`${g}=`)))?"params seen":"params";const d=p.length?` (${h}: ${p.join(", ")})`:"";const y=d.length<=r;if(y)r-=d.length;s.push(o+(y?d:""))};const n=(o,c=0)=>{if(c>12)return;for(const f of asArray(o)){if(s.length>=e)break;const p=rec(f);if(p.isInternal!==true&&typeof p.path==="string")l(p.path,p.params);n(p.children,c+1)}};n(a);for(const o of i.keys())l(o);return s}function projectStorage(a,t){const e=r=>typeof r==="string"&&r.length>300?`${r.slice(0,300)}\u2026`:r;const i=typeof t.key==="string"?t.key.toLowerCase():void 0;const s=asArray(a).map(rec).map(r=>{const l=rec(r.data);return{id:r.id,at:r.timestamp,action:r.action,storage:r.storageType,key:l.key??l.keys,value:e(l.value),prevValue:e(l.prevValue)}}).filter(r=>!i||JSON.stringify(r.key??"").toLowerCase().includes(i)).sort((r,l)=>String(l.at).localeCompare(String(r.at)));const u=num(t.limit,20);return{events:s.slice(0,u),total:s.length,returned:Math.min(u,s.length)}}function projectRedux(a,t){const e=r=>{if(r===void 0)return void 0;const l=typeof r==="string"?r:JSON.stringify(r);return l&&l.length>400?`${l.slice(0,400)}\u2026`:r};const i=typeof t.type==="string"?t.type.toLowerCase():void 0;const s=asArray(a).map(rec).filter(r=>r.category!=="internal").map(r=>({id:r.id,at:r.timestamp,type:r.type,payload:e(r.payload),meta:e(r.meta),error:e(r.error),changed:r.diffSummary||void 0})).filter(r=>!i||String(r.type).toLowerCase().includes(i)).sort((r,l)=>Number(l.at)-Number(r.at));const u=num(t.limit,20);return{actions:s.slice(0,u),total:s.length,returned:Math.min(u,s.length)}}function projectStoreChanges(a,t,e,i){const s=n=>{if(n===void 0)return void 0;const o=typeof n==="string"?n:JSON.stringify(n);return o&&o.length>400?`${o.slice(0,400)}\u2026`:n};const u=typeof t[i]==="string"?String(t[i]).toLowerCase():void 0;const r=asArray(rec(a).changes).map(rec).map(n=>({id:n.id,at:n.timestamp,[i]:n[e],changed:n.changedKeys,summary:n.diffSummary||void 0,...e==="storeName"?{partial:s(n.partial)}:{value:s(n.valuePreview)}})).filter(n=>!u||String(n[i]??"").toLowerCase().includes(u)).sort((n,o)=>Number(o.at)-Number(n.at));const l=num(t.limit,20);return{changes:r.slice(0,l),total:r.length,returned:Math.min(l,r.length)}}function projectRoutes(a,t){const e=rec(a);const i=rec(e.sitemap);const s=asArray(e.stack).map(rec);const u=asArray(e.events).map(rec);const r=s.map(c=>({name:c.name,path:c.pathname,...routeParams(c.params)?{params:routeParams(c.params)}:{},focused:c.isFocused===true?true:void 0}));const l=u.slice(0,num(t.limit,15)).map(c=>({at:c.timestamp,from:c.previousPathname,to:c.pathname,...routeParams(c.params)?{params:routeParams(c.params)}:{}}));const n=s.find(c=>c.isFocused===true)??s[s.length-1];const o=u.length?{path:u[0].pathname,source:"event",...routeParams(u[0].params)?{params:routeParams(u[0].params)}:{}}:typeof n?.pathname==="string"?{path:n.pathname,source:"stack",...routeParams(n.params)?{params:routeParams(n.params)}:{}}:void 0;return{currentRoute:o,stack:r,routes:flattenRoutes(i.routes,[...u.slice(0,80),...s.slice(0,80)]),sitemapSource:i.source,recentNavigations:l}}function projectEnv(a){const t=rec(a);return{env:t.env??t.variables,requiredEnvVars:t.requiredEnvVars,...Array.isArray(t.checks)?{checks:t.checks}:{}}}function projectSentry(a,t){const e=rec(a);const i=asArray(e.envelopes).map(rec);const s=typeof t.type==="string"?t.type:void 0;const u=typeof t.pattern==="string"?t.pattern.toLowerCase():void 0;const r=i.filter(n=>{const o=asArray(n.items).map(rec);if(s&&!o.some(c=>c.type===s))return false;if(!u)return true;return o.some(c=>String(c.summary??"").toLowerCase().includes(u))});const l=withinBudget(newest(r,num(t.limit,10)).map(n=>({id:n.id,at:n.timestamp,origin:n.origin,eventId:n.eventId,totalBytes:n.totalBytes,items:asArray(n.items).slice(0,8).map(o=>{const c=rec(o);return{type:c.type,summary:typeof c.summary==="string"?c.summary.slice(0,300):c.summary,spanCount:c.spanCount,bytes:c.bytes}})})),12e3);return{status:e.status,totalCaptured:i.length,shown:l.length,envelopes:l,drops:(()=>{const n=rec(e.drops);const o=asArray(n.recent).map(rec);const c=d=>d.category==="span"||d.category==="transaction";const f=[...newest(o.filter(d=>!c(d)),8),...newest(o.filter(c),3)];const p=withinBudget(f.map(d=>({at:d.timestamp,reason:d.reason,category:d.category,quantity:d.quantity,detail:typeof d.detail==="string"?d.detail.slice(0,200):d.detail})),4e3);const h=withinBudget(asArray(n.summary),2e3);return p.length||n.summary?{summary:h,recent:p}:void 0})(),hint:"For crash stack traces, console's [FATAL] entries carry the component stacks. `drops` lists events the SDK discarded before sending, with the reason."}}function projectImpersonate(a){const t=rec(a);const e=i=>{if(i===null||i===void 0)return null;const s=rec(i);return{id:s.id,displayName:s.displayName,email:s.email}};return{isActive:t.isActive,isPaused:t.isPaused,currentUser:e(t.currentUser),headerKey:t.headerKey,ignorePatterns:t.ignorePatterns,dataNukeSettings:t.dataNukeSettings,showBanner:t.showBanner,history:asArray(t.history).slice(0,10).map(i=>{const s=rec(i);return{user:e(s.user),lastUsedAt:s.lastUsedAt}})}}function projectSnapshot(a,t,e={}){switch(a){case"console":return projectConsole(t,e);case"network":return projectNetwork(t,e);case"route-events":return projectRoutes(t,e);case"storage":return projectStorage(t,e);case"redux":return projectRedux(t,e);case"zustand":return projectStoreChanges(t,e,"storeName","store");case"jotai":return projectStoreChanges(t,e,"atomLabel","atom");case"env":return projectEnv(t);case"impersonate":return projectImpersonate(t);case"sentry":return projectSentry(t,e);default:return t}}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.EffectLedger=void 0;exports.isReversible=isReversible;var _digest=require("./digest");var _storeDiff=require("./storeDiff");function isReversible(f){return f.kind!=="transient"&&f.kind!=="state-write"}let seq=0;class EffectLedger{entries=[];listeners=new Set;gen=0;get generation(){return this.gen}record(r,n,e,t){if(t!==void 0&&t!==this.gen)return void 0;const i={id:`fx-${++seq}-${Date.now()}`,at:Date.now(),toolId:r,action:n,effect:e};this.entries=[...this.entries,i];this.emit();return i}list(){return this.entries}liveCallIds(){const r=new Set;for(const n of this.entries)if(!n.undoneAt&&n.callId)r.add(n.callId);return r}restore(r){if(this.entries.length>0||r.length===0)return false;this.entries=[...r];this.emit();return true}touch(){this.entries=[...this.entries];this.emit()}reversible(){return this.entries.filter(r=>!r.undoneAt&&isReversible(r.effect))}transients(){return this.entries.filter(r=>!r.undoneAt&&r.effect.kind==="transient")}isEmpty(){return this.entries.every(r=>r.undoneAt!==void 0)}subscribe(r){this.listeners.add(r);return()=>this.listeners.delete(r)}clear(){this.entries=[];this.gen+=1;this.emit()}noteExternalRevert(r,n,e){let t=false;const i=o=>{for(const s of this.entries){if(!s.undoneAt&&o(s)){s.undoneAt=Date.now();s.undoError=void 0;t=true}}};if(r==="network"&&n==="deleteOverrideRule"){i(o=>o.effect.kind==="network-override"&&o.effect.ruleId===e.id)}else if(r==="network"&&n==="clearOverrideRules"){i(o=>o.effect.kind==="network-override")}else if(r==="impersonate"&&n==="stopImpersonation"){i(o=>o.effect.kind==="impersonation")}else{i(o=>{const s=o.effect;if(s.kind!=="inverse-call"||s.toolId!==r||s.action!==n)return false;return Object.entries(s.params).every(([a,u])=>JSON.stringify(e[a]??(a==="enabled"?false:void 0))===JSON.stringify(u))})}if(t)this.touch();return t}emit(){for(const r of this.listeners){try{r()}catch{}}}async revertOne(r,n){if(r.undoneAt)return void 0;const e=r.effect;try{switch(e.kind){case"network-override":await n("network","deleteOverrideRule",{id:e.ruleId});break;case"impersonation":await n("impersonate","stopImpersonation",{});break;case"storage-write":{const t=e.instanceId?{instanceId:e.instanceId}:{};if(e.wrote!==void 0){const i=e.action==="mmkv.set"?"mmkv.get":"async.getItem";try{const o=await n(e.toolId,i,{...t,key:e.key});const s=o&&typeof o==="object"?o:void 0;const a=s?s.value:o;if(s?.found!==false&&a!==void 0&&a!==e.wrote){return"This value was changed again after Ask Buoy wrote it \u2014 left the newer value alone"}}catch{}}if(e.before===void 0){if(!e.removeAction)return"No remove action known for this key";await n(e.toolId,e.removeAction,{...t,key:e.key})}else{await n(e.toolId,e.action,{...t,key:e.key,value:e.before})}break}case"query-write":{if(e.wroteDigest!==void 0){try{const i=await n("query","getQueryData",{queryHash:e.queryHash});if(i?.found===true){const o=i.hasData===false?void 0:(0,_digest.digestOf)(i.data);if(o!==e.wroteDigest){return"The app has refetched or changed this query since Ask Buoy wrote it \u2014 left the newer data alone"}}}catch{}}const t=await(e.before===void 0?n("query","invalidate",{queryHash:e.queryHash}):n("query","setQueryData",{queryHash:e.queryHash,data:e.before,force:true}));if(t&&typeof t==="object"&&t.ok===false){return typeof t.error==="string"?t.error:"The query could not be restored"}break}case"store-write":{let t;try{const o=await n(e.toolId,"getStoreState",{storeName:e.storeName});t=o?.found===true?o.currentState:void 0}catch{t=void 0}if(!t||typeof t!=="object"){return"Couldn't read the store to check for newer changes, so nothing was undone"}{const o=e.leaves.filter(s=>{const a=(0,_storeDiff.readLeaf)(t,s.path);return!a.found||(0,_digest.digestOf)(a.value)!==s.wroteDigest});if(o.length){return`${o.map(s=>s.path.join(".")).join(", ")} changed again after Ask Buoy wrote it \u2014 left the newer value alone`}}const i=await n(e.toolId,"setState",{storeName:e.storeName,state:(0,_storeDiff.restorePatch)(e.leaves),replace:false,force:true});if(i&&typeof i==="object"&&i.ok===false){return typeof i.error==="string"?i.error:"The store could not be restored"}break}case"inverse-call":{const t=await n(e.toolId,e.action,e.params);if(t&&typeof t==="object"&&t.ok===false){return typeof t.error==="string"?t.error:"The change could not be undone"}break}case"state-write":return"This change can't be undone automatically";case"transient":return void 0}r.undoneAt=Date.now();r.undoError=void 0;this.touch();return void 0}catch(t){const i=t instanceof Error?t.message:String(t);r.undoError=i;this.touch();return i}}async revertAll(r){const n={reverted:0,failed:[],skippedTransients:0,permanent:0};const e=[...this.entries].filter(t=>!t.undoneAt).reverse();for(const t of e){if(t.effect.kind==="transient"){n.skippedTransients+=1;continue}if(!isReversible(t.effect)){n.permanent+=1;continue}const i=await this.revertOne(t,r);if(i)n.failed.push({label:t.effect.label,error:i});else n.reverted+=1}this.emit();return n}}exports.EffectLedger=EffectLedger;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.EffectLedger=void 0;exports.isReversible=isReversible;var _digest=require("./digest");var _storeDiff=require("./storeDiff");function isReversible(u){return u.kind!=="transient"&&u.kind!=="state-write"}let seq=0;class EffectLedger{entries=[];listeners=new Set;gen=0;get generation(){return this.gen}record(r,s,a,e){if(e!==void 0&&e!==this.gen)return void 0;const n={id:`fx-${++seq}-${Date.now()}`,at:Date.now(),toolId:r,action:s,effect:a};this.entries=[...this.entries,n];this.emit();return n}list(){return this.entries}liveCallIds(){const r=new Set;for(const s of this.entries)if(!s.undoneAt&&s.callId)r.add(s.callId);return r}restore(r){if(this.entries.length>0||r.length===0)return false;this.entries=[...r];this.emit();return true}touch(){this.entries=[...this.entries];this.emit()}reversible(){return this.entries.filter(r=>!r.undoneAt&&isReversible(r.effect))}transients(){return this.entries.filter(r=>!r.undoneAt&&r.effect.kind==="transient")}isEmpty(){return this.entries.every(r=>r.undoneAt!==void 0)}subscribe(r){this.listeners.add(r);return()=>this.listeners.delete(r)}clear(){this.entries=[];this.gen+=1;this.emit()}noteExternalRevert(r,s,a){let e=false;const n=i=>{for(const t of this.entries){if(!t.undoneAt&&i(t)){t.undoneAt=Date.now();t.undoError=void 0;e=true}}};if(r==="network"&&s==="deleteOverrideRule"){n(i=>i.effect.kind==="network-override"&&i.effect.ruleId===a.id)}else if(r==="network"&&s==="clearOverrideRules"){n(i=>i.effect.kind==="network-override")}else if(r==="impersonate"&&s==="stopImpersonation"){n(i=>i.effect.kind==="impersonation")}else{n(i=>{const t=i.effect;if(t.kind!=="inverse-call"||t.toolId!==r||t.action!==s)return false;return Object.entries(t.params).every(([o,f])=>JSON.stringify(a[o]??(o==="enabled"?false:void 0))===JSON.stringify(f))})}if(e)this.touch();return e}emit(){for(const r of this.listeners){try{r()}catch{}}}async revertOne(r,s,{refetch:a=true}={}){if(r.undoneAt)return void 0;const e=r.effect;try{switch(e.kind){case"network-override":await s("network","deleteOverrideRule",{id:e.ruleId});if(a)await refetchOnScreen(s);break;case"impersonation":await s("impersonate","stopImpersonation",{});break;case"storage-write":{const n=e.instanceId?{instanceId:e.instanceId}:{};if(e.wrote!==void 0){const i=e.action==="mmkv.set"?"mmkv.get":"async.getItem";try{const t=await s(e.toolId,i,{...n,key:e.key});const o=t&&typeof t==="object"?t:void 0;const f=o?o.value:t;if(o?.found!==false&&f!==void 0&&f!==e.wrote){return"This value was changed again after Ask Buoy wrote it \u2014 left the newer value alone"}}catch{}}if(e.before===void 0){if(!e.removeAction)return"No remove action known for this key";await s(e.toolId,e.removeAction,{...n,key:e.key})}else{await s(e.toolId,e.action,{...n,key:e.key,value:e.before})}break}case"query-write":{let n=false;if(e.wroteDigest!==void 0){try{const t=await s("query","getQueryData",{queryHash:e.queryHash});if(t?.found===true){const o=t.hasData===false?void 0:(0,_digest.digestOf)(t.data);n=o!==e.wroteDigest}}catch{}}const i=await(e.before===void 0||n?s("query","invalidate",{queryHash:e.queryHash}):s("query","setQueryData",{queryHash:e.queryHash,data:e.before,force:true}));if(i&&typeof i==="object"&&i.ok===false){return typeof i.error==="string"?i.error:"The query could not be restored"}break}case"store-write":{let n;try{const t=await s(e.toolId,"getStoreState",{storeName:e.storeName});n=t?.found===true?t.currentState:void 0}catch{n=void 0}if(!n||typeof n!=="object"){return"Couldn't read the store to check for newer changes, so nothing was undone"}{const t=e.leaves.filter(o=>{const f=(0,_storeDiff.readLeaf)(n,o.path);return!f.found||(0,_digest.digestOf)(f.value)!==o.wroteDigest});if(t.length){return`${t.map(o=>o.path.join(".")).join(", ")} changed again after Ask Buoy wrote it \u2014 left the newer value alone`}}const i=await s(e.toolId,"setState",{storeName:e.storeName,state:(0,_storeDiff.restorePatch)(e.leaves),replace:false,force:true});if(i&&typeof i==="object"&&i.ok===false){return typeof i.error==="string"?i.error:"The store could not be restored"}break}case"inverse-call":{const n=await s(e.toolId,e.action,e.params);if(n&&typeof n==="object"&&n.ok===false){return typeof n.error==="string"?n.error:"The change could not be undone"}break}case"state-write":return"This change can't be undone automatically";case"transient":return void 0}r.undoneAt=Date.now();r.undoError=void 0;this.touch();return void 0}catch(n){const i=n instanceof Error?n.message:String(n);r.undoError=i;this.touch();return i}}async revertAll(r){const s={reverted:0,failed:[],skippedTransients:0,permanent:0};const a=[...this.entries].filter(t=>!t.undoneAt).reverse();const e=t=>t.effect.kind==="network-override";const n=async t=>{if(t.effect.kind==="transient"){s.skippedTransients+=1;return}if(!isReversible(t.effect)){s.permanent+=1;return}const o=await this.revertOne(t,r,{refetch:false});if(o)s.failed.push({label:t.effect.label,error:o});else s.reverted+=1};const i=a.filter(e);for(const t of i)await n(t);if(i.some(t=>t.undoneAt))await refetchOnScreen(r);for(const t of a.filter(o=>!e(o)))await n(t);this.emit();return s}}exports.EffectLedger=EffectLedger;async function refetchOnScreen(u){try{const r=await u("query","listQueries",{});const s=(r?.queries??[]).filter(a=>typeof a.queryHash==="string"&&typeof a.observers==="number"&&a.observers>0);await Promise.all(s.map(a=>u("query","refetch",{queryHash:a.queryHash})))}catch{}}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.compactScreen=compactScreen;const ICON_ONLY=/^[\s-]*$/;const words=o=>o.label||o.text||"";function compactScreen(o){const s=o;if(!s||!Array.isArray(s.elements))return o;const r=new Map;for(const e of s.elements){const n=JSON.stringify([e.role,e.name.split("(")[0],words(e),e.testID,e.control,e.frame]);const t=r.get(n);if(!t||(e.nativeTag??0)>(t.nativeTag??0))r.set(n,e)}const l=[...r.values()].sort((e,n)=>(n.nativeTag??0)-(e.nativeTag??0));const i=[];let a;for(const e of l){const n=words(e);if(!e.testID&&!e.control&&ICON_ONLY.test(n))continue;if(e.name==="Text"&&!e.testID&&a&&a.nativeTag!==null&&e.nativeTag!==null&&a.nativeTag-e.nativeTag<=12&&words(a).includes(n)){continue}const t=[String(e.nativeTag),e.role??e.name.split("(")[0],JSON.stringify(e.label&&e.text&&e.text!==e.label?`${e.label} / ${e.text}`:n)];if(e.testID)t.push(`testID=${e.testID}`);if(e.control)t.push(`${e.control}=${JSON.stringify(e.value)}`);if(e.longPressable)t.push("longPress");if(!e.interactive)t.push("not tappable");if(e.frame&&(e.frame.y>=1||e.frame.y+e.frame.height<=0))t.push("off-screen");i.push(t.join(" \xB7 "));a=e}return{screen:s.screen,count:i.length,...s.hiddenBuoy?{hiddenBuoy:s.hiddenBuoy}:{},...s.lists?.length?{lists:s.lists.map(e=>`${e.owner??"A list"} shows ${e.items} items: that is the screen's own count of what the user can scroll through. Only ${e.listed} are listed above; the rest are further down.`)}:{},format:"nativeTag \xB7 role or component \xB7 label/text \xB7 extras. Newest first: the screen opened last is at the top, screens still mounted beneath it follow. Tap with tapElement {nativeTag}; off-screen rows scroll into view on tap.",elements:i}}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.compactScreen=compactScreen;const ICON_ONLY=/^[\s-]*$/;const words=i=>i.label||i.text||"";function compactScreen(i){const n=i;if(!n||!Array.isArray(n.elements))return i;const r=new Map;for(const e of n.elements){const t=JSON.stringify([e.role,e.name.split("(")[0],words(e),e.testID,e.control,e.frame]);const l=r.get(t);if(!l||(e.nativeTag??0)>(l.nativeTag??0))r.set(t,e)}const f=typeof document!=="undefined";const h=f?[...r.values()]:[...r.values()].sort((e,t)=>(t.nativeTag??0)-(e.nativeTag??0));const c=[];let a;for(const e of h){const t=words(e);const l=e.interactive&&e.name!=="Text";if(!e.testID&&!e.control&&!l&&ICON_ONLY.test(t))continue;if(e.name==="Text"&&!e.testID&&a&&a.nativeTag!==null&&e.nativeTag!==null&&a.nativeTag-e.nativeTag<=12&&words(a).includes(t)){continue}const o=[String(e.nativeTag),e.role??e.name.split("(")[0],ICON_ONLY.test(t)?"(no name)":JSON.stringify(e.label&&e.text&&e.text!==e.label?`${e.label} / ${e.text}`:t)];if(e.testID)o.push(`testID=${e.testID}`);if(e.control)o.push(`${e.control}=${JSON.stringify(e.value)}`);if(e.longPressable)o.push("longPress");if(!e.interactive)o.push("not tappable");const s=e.frame;if(s&&(s.y>=1||s.y+s.height<=0))o.push("off-screen");else if(s&&(s.x>=1||s.x+s.width<=0))o.push("hidden off the side");c.push(o.join(" \xB7 "));a=e}return{screen:n.screen,count:c.length,...n.hiddenBuoy?{hiddenBuoy:n.hiddenBuoy}:{},...n.lists?.length?{lists:n.lists.map(e=>`${e.owner??"A list"} shows ${e.items} items: that is the screen's own count of what the user can scroll through. Only ${e.listed} are listed above; the rest are further down.`)}:{},format:`nativeTag \xB7 role or component \xB7 label/text \xB7 extras. ${f?"Reading order: top to bottom, then left to right.":"Newest first: the screen opened last is at the top, screens still mounted beneath it follow."} Tap with tapElement {nativeTag}; off-screen rows scroll into view on tap. Rows hidden off the side are not visible, like a closed drawer or menu.`,elements:c}}