sootsim 0.1.36 → 0.1.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -5
- package/dist-cli/bin.js +15 -20
- package/dist-cli/chunks/{agent-YZB6D3DR.js → agent-CGQWOOOL.js} +2 -2
- package/dist-cli/chunks/{agent-wrapper-VHCVS22I.js → agent-wrapper-M6P53GJ2.js} +10 -10
- package/dist-cli/chunks/{assert-AIVCKKLG.js → assert-O7N2SYJZ.js} +2 -2
- package/dist-cli/chunks/auto-bootstrap-DF4KYGPS.js +2 -0
- package/dist-cli/chunks/beta-AK25X3AU.js +2 -0
- package/dist-cli/chunks/chunk-23YMXBQ2.js +1 -0
- package/dist-cli/chunks/chunk-2ABGQIW7.js +4 -0
- package/dist-cli/chunks/chunk-5HNZO5AI.js +7 -0
- package/dist-cli/chunks/chunk-5XI3AB4I.js +3 -0
- package/dist-cli/chunks/{chunk-IJMYFYDZ.js → chunk-67K3WAEZ.js} +2 -2
- package/dist-cli/chunks/chunk-6UJXRT7F.js +5 -0
- package/dist-cli/chunks/chunk-ARH3T5NK.js +66 -0
- package/dist-cli/chunks/{chunk-VFDRZNPN.js → chunk-B4VH67D3.js} +1 -1
- package/dist-cli/chunks/chunk-BEY2QVU5.js +3 -0
- package/dist-cli/chunks/chunk-CB4PUMI2.js +1 -0
- package/dist-cli/chunks/chunk-CHMHTTI7.js +11 -0
- package/dist-cli/chunks/chunk-E473YTRQ.js +2 -0
- package/dist-cli/chunks/chunk-FCOCFEBU.js +27 -0
- package/dist-cli/chunks/chunk-FRE5TY3C.js +1 -0
- package/dist-cli/chunks/chunk-FX3PPKSJ.js +2 -0
- package/dist-cli/chunks/{chunk-27P763IZ.js → chunk-FXY5FWVY.js} +2 -2
- package/dist-cli/chunks/{chunk-A5BRCXYE.js → chunk-G23GIRBM.js} +1 -1
- package/dist-cli/chunks/chunk-G62Q2MQI.js +1 -0
- package/dist-cli/chunks/chunk-GWQUPWVO.js +2 -0
- package/dist-cli/chunks/{chunk-EWSQSALM.js → chunk-H6CG42HE.js} +4 -4
- package/dist-cli/chunks/chunk-HNAGYNWN.js +16 -0
- package/dist-cli/chunks/{chunk-KAXZHEKM.js → chunk-IE2WYVJF.js} +1 -1
- package/dist-cli/chunks/chunk-IKVIHHWE.js +2 -0
- package/dist-cli/chunks/chunk-JJVZMGRM.js +2 -0
- package/dist-cli/chunks/{chunk-HWCKZXNJ.js → chunk-LNRBXCUI.js} +2 -2
- package/dist-cli/chunks/{chunk-CYCXOAVZ.js → chunk-MTPWS4JK.js} +4 -4
- package/dist-cli/chunks/{chunk-G7XQD4KC.js → chunk-NKYTISAN.js} +2 -2
- package/dist-cli/chunks/chunk-NSZBULGG.js +348 -0
- package/dist-cli/chunks/chunk-P32FCOS3.js +4 -0
- package/dist-cli/chunks/chunk-P722XCFT.js +3 -0
- package/dist-cli/chunks/chunk-PFRPXFSL.js +117 -0
- package/dist-cli/chunks/chunk-QD22CQLH.js +5 -0
- package/dist-cli/chunks/chunk-QI4VLQ3A.js +5 -0
- package/dist-cli/chunks/{chunk-OXN2PEB7.js → chunk-SKNHJDYO.js} +3 -3
- package/dist-cli/chunks/{chunk-YIO6S3R5.js → chunk-T442FYM5.js} +1 -1
- package/dist-cli/chunks/chunk-TR554AIH.js +17 -0
- package/dist-cli/chunks/chunk-UD5ILFN5.js +3 -0
- package/dist-cli/chunks/{chunk-LHDWH7VS.js → chunk-VIEK76DX.js} +1 -1
- package/dist-cli/chunks/chunk-VVUEWU2P.js +64 -0
- package/dist-cli/chunks/{chunk-RMW5BO3S.js → chunk-Z2PBRNJP.js} +2 -2
- package/dist-cli/chunks/chunk-ZEVZN3S4.js +2 -0
- package/dist-cli/chunks/{compat-Y2O2U7FL.js → compat-DNQWSPFQ.js} +2 -2
- package/dist-cli/chunks/{config-SRBOFUCI.js → config-ABR5BGUO.js} +2 -2
- package/dist-cli/chunks/control-DEHRU4XZ.js +2 -0
- package/dist-cli/chunks/cpu-profile-Y5YDH6X2.js +22 -0
- package/dist-cli/chunks/daemon-2Z4DAJT6.js +83 -0
- package/dist-cli/chunks/{debug-BIDMW2PE.js → debug-R36UPOJP.js} +4 -4
- package/dist-cli/chunks/demo-app-registry-DMMWYL7G.js +2 -0
- package/dist-cli/chunks/detox-FQJWEWLT.js +49 -0
- package/dist-cli/chunks/device-SXKLDZEC.js +16 -0
- package/dist-cli/chunks/diagnose-M7RKNI2H.js +41 -0
- package/dist-cli/chunks/drivers-NSCX5CRA.js +2 -0
- package/dist-cli/chunks/electron-YUAKGT4H.js +18 -0
- package/dist-cli/chunks/flow-UQSRNEZD.js +2 -0
- package/dist-cli/chunks/hints-SDD7L3VS.js +2 -0
- package/dist-cli/chunks/home-paths-QMCX2227.js +2 -0
- package/dist-cli/chunks/inspect-6FPPW7GS.js +1101 -0
- package/dist-cli/chunks/install-TTH3PM3B.js +2 -0
- package/dist-cli/chunks/{install-desktop-2MYEI4FM.js → install-desktop-EKMYRDQH.js} +3 -3
- package/dist-cli/chunks/{keys-7PNASIQR.js → keys-ODG3TDUP.js} +2 -2
- package/dist-cli/chunks/{launch-JNS47LAQ.js → launch-7HUL745I.js} +3 -3
- package/dist-cli/chunks/{login-YWZWUHBS.js → login-BJKQMJYT.js} +4 -4
- package/dist-cli/chunks/{logout-O6SXMSBP.js → logout-7NG3KGJD.js} +2 -2
- package/dist-cli/chunks/maestro-VFEUWV3Q.js +80 -0
- package/dist-cli/chunks/{preview-WGKJO5FS.js → preview-WZ6XNOBC.js} +2 -2
- package/dist-cli/chunks/profile-DXFEZOHB.js +22 -0
- package/dist-cli/chunks/react-QP7PL5CZ.js +30 -0
- package/dist-cli/chunks/{record-QPWLYH5R.js → record-AFE25EMH.js} +5 -5
- package/dist-cli/chunks/{runtime-KEMO2MSB.js → runtime-GFWS3QLZ.js} +3 -3
- package/dist-cli/chunks/screenshot-U6VFOVFW.js +28 -0
- package/dist-cli/chunks/screenshot-mode-HNGV3AFC.js +17 -0
- package/dist-cli/chunks/screenshots-GYMRDUJR.js +70 -0
- package/dist-cli/chunks/server-3Q22YYM6.js +35 -0
- package/dist-cli/chunks/setup-repo-NNDWIGZR.js +2 -0
- package/dist-cli/chunks/{skills-MO7BFNVM.js → skills-FT76ZVAV.js} +2 -2
- package/dist-cli/chunks/start-N573LFCF.js +23 -0
- package/dist-cli/chunks/store-6NTDGLPH.js +2 -0
- package/dist-cli/chunks/telemetry-SNZBIRGL.js +2 -0
- package/dist-cli/chunks/{test-XUI3KNNQ.js → test-AJPY2Q6W.js} +3 -3
- package/dist-cli/chunks/three-mode-JZZVOMTG.js +39 -0
- package/dist-cli/chunks/timeline-GTSCF5P6.js +22 -0
- package/dist-cli/chunks/upload-UHTVCGGR.js +2 -0
- package/dist-cli/chunks/what-happened-N3AQ6I7O.js +15 -0
- package/dist-cli/chunks/whoami-FOIMN6UC.js +2 -0
- package/dist-lib/agent-daemon-client.cjs +4 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/agent-sessions.cjs +41 -39
- package/dist-lib/attached-projects.cjs +30 -28
- package/dist-lib/auth/shared-session.cjs +35 -27
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/cli-constants.cjs +1 -1
- package/dist-lib/config.cjs +6 -2
- package/dist-lib/dev-bundle-resolution.cjs +5 -50
- package/dist-lib/home-paths.cjs +94 -38
- package/dist-lib/host/bridge-host.cjs +2144 -1330
- package/dist-lib/host/fetch-proxy-handler.cjs +248 -0
- package/dist-lib/index.cjs +21 -21
- package/dist-lib/metro.cjs +21 -21
- package/dist-lib/profiles.cjs +246 -0
- package/dist-lib/render-mode.cjs +1 -1
- package/dist-lib/vite-base.cjs +3410 -1632
- package/dist-lib/vite.cjs +1 -1
- package/package.json +7 -1
- package/dist-cli/chunks/auto-bootstrap-MLNTX23H.js +0 -2
- package/dist-cli/chunks/chunk-3UIWOHC2.js +0 -62
- package/dist-cli/chunks/chunk-5KGFHWVR.js +0 -1
- package/dist-cli/chunks/chunk-5QIUJNT3.js +0 -5
- package/dist-cli/chunks/chunk-6GGMKFWJ.js +0 -4
- package/dist-cli/chunks/chunk-6Z275LCY.js +0 -2
- package/dist-cli/chunks/chunk-75LBYBKW.js +0 -11
- package/dist-cli/chunks/chunk-DFN3GGH7.js +0 -5
- package/dist-cli/chunks/chunk-EBEHZJRG.js +0 -117
- package/dist-cli/chunks/chunk-EJLNUMMP.js +0 -3
- package/dist-cli/chunks/chunk-FE7UI3MT.js +0 -4
- package/dist-cli/chunks/chunk-G663654J.js +0 -1
- package/dist-cli/chunks/chunk-GW7XY5KC.js +0 -2
- package/dist-cli/chunks/chunk-H2QO4TDV.js +0 -22
- package/dist-cli/chunks/chunk-HWFHBMAQ.js +0 -27
- package/dist-cli/chunks/chunk-J7CTD37P.js +0 -1
- package/dist-cli/chunks/chunk-N32NCVL2.js +0 -3
- package/dist-cli/chunks/chunk-NIZBR7EK.js +0 -2
- package/dist-cli/chunks/chunk-NYY36OKU.js +0 -308
- package/dist-cli/chunks/chunk-PJL25JQV.js +0 -5
- package/dist-cli/chunks/chunk-SHO54NET.js +0 -2
- package/dist-cli/chunks/chunk-SMVJOWSV.js +0 -16
- package/dist-cli/chunks/chunk-TC6V7YFC.js +0 -3
- package/dist-cli/chunks/chunk-YLIIVTTQ.js +0 -3
- package/dist-cli/chunks/chunk-YR7BGGYE.js +0 -2
- package/dist-cli/chunks/chunk-ZEW3RF5Q.js +0 -1
- package/dist-cli/chunks/control-PL2V2O6S.js +0 -2
- package/dist-cli/chunks/daemon-IZC32PZW.js +0 -50
- package/dist-cli/chunks/demo-app-registry-5JFOUU3D.js +0 -2
- package/dist-cli/chunks/detox-B3FDOIS3.js +0 -49
- package/dist-cli/chunks/device-ZZSI363W.js +0 -16
- package/dist-cli/chunks/drivers-S4NGK4DB.js +0 -2
- package/dist-cli/chunks/electron-5YFHXEOI.js +0 -15
- package/dist-cli/chunks/flow-JJBO6TFY.js +0 -2
- package/dist-cli/chunks/hints-G5HBBV2O.js +0 -2
- package/dist-cli/chunks/home-paths-VWC3FWA3.js +0 -2
- package/dist-cli/chunks/inspect-POOPWUQI.js +0 -1034
- package/dist-cli/chunks/install-MP6FHXNZ.js +0 -2
- package/dist-cli/chunks/install-dev-desktop-SKH3KEHY.js +0 -100
- package/dist-cli/chunks/maestro-CW6XVUKV.js +0 -75
- package/dist-cli/chunks/profile-SUOBRPIC.js +0 -22
- package/dist-cli/chunks/screenshot-JTY46V7G.js +0 -26
- package/dist-cli/chunks/screenshot-mode-7OYBBX6D.js +0 -17
- package/dist-cli/chunks/screenshots-QISKC4GD.js +0 -70
- package/dist-cli/chunks/server-YSFJAKAV.js +0 -34
- package/dist-cli/chunks/setup-repo-LFB3HBEO.js +0 -2
- package/dist-cli/chunks/store-6MFL53I4.js +0 -2
- package/dist-cli/chunks/telemetry-CN42GMVC.js +0 -2
- package/dist-cli/chunks/upload-6FUT7AX5.js +0 -2
- package/dist-cli/chunks/whoami-TQFHY42N.js +0 -2
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
/*! sootsim v0.1.38 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
|
+
"use strict";
|
|
4
|
+
var __create = Object.create;
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __export = (target, all) => {
|
|
11
|
+
for (var name in all)
|
|
12
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
13
|
+
};
|
|
14
|
+
var __copyProps = (to, from, except, desc) => {
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(from))
|
|
17
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
18
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
23
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
24
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
25
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
26
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
27
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
28
|
+
mod
|
|
29
|
+
));
|
|
30
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
31
|
+
|
|
32
|
+
// src/profiles.ts
|
|
33
|
+
var profiles_exports = {};
|
|
34
|
+
__export(profiles_exports, {
|
|
35
|
+
DEFAULT_PROFILE_ID: () => DEFAULT_PROFILE_ID,
|
|
36
|
+
clearProfileStorage: () => clearProfileStorage,
|
|
37
|
+
createProfile: () => createProfile,
|
|
38
|
+
deleteProfile: () => deleteProfile,
|
|
39
|
+
electronProfilePartition: () => electronProfilePartition,
|
|
40
|
+
electronProfilePartitionDir: () => electronProfilePartitionDir,
|
|
41
|
+
electronProfilePartitionName: () => electronProfilePartitionName,
|
|
42
|
+
ensureProfile: () => ensureProfile,
|
|
43
|
+
getProfile: () => getProfile,
|
|
44
|
+
listProfiles: () => listProfiles,
|
|
45
|
+
nextGeneratedProfileId: () => nextGeneratedProfileId,
|
|
46
|
+
normalizeProfileId: () => normalizeProfileId,
|
|
47
|
+
playwrightProfileUserDataDir: () => playwrightProfileUserDataDir,
|
|
48
|
+
profileIndexPath: () => profileIndexPath
|
|
49
|
+
});
|
|
50
|
+
module.exports = __toCommonJS(profiles_exports);
|
|
51
|
+
var import_fs = __toESM(require("fs"), 1);
|
|
52
|
+
var import_path = __toESM(require("path"), 1);
|
|
53
|
+
|
|
54
|
+
// src/home-paths.ts
|
|
55
|
+
var import_node_fs = __toESM(require("node:fs"), 1);
|
|
56
|
+
var import_node_os = require("node:os");
|
|
57
|
+
var import_node_path = __toESM(require("node:path"), 1);
|
|
58
|
+
var SOOTSIM_HOME_ENV = "SOOTSIM_HOME";
|
|
59
|
+
function sootsimHomeDir() {
|
|
60
|
+
const override = process.env[SOOTSIM_HOME_ENV];
|
|
61
|
+
if (override && override.length > 0) return import_node_path.default.resolve(override);
|
|
62
|
+
return import_node_path.default.join((0, import_node_os.homedir)(), ".sootsim");
|
|
63
|
+
}
|
|
64
|
+
function runtimesDir() {
|
|
65
|
+
return import_node_path.default.join(sootsimHomeDir(), "runtimes");
|
|
66
|
+
}
|
|
67
|
+
function electronDir() {
|
|
68
|
+
return import_node_path.default.join(sootsimHomeDir(), "electron");
|
|
69
|
+
}
|
|
70
|
+
function electronUserDataDir() {
|
|
71
|
+
return import_node_path.default.join(electronDir(), "userData");
|
|
72
|
+
}
|
|
73
|
+
function profilesDir() {
|
|
74
|
+
return import_node_path.default.join(sootsimHomeDir(), "profiles");
|
|
75
|
+
}
|
|
76
|
+
function cacheDir() {
|
|
77
|
+
return import_node_path.default.join(sootsimHomeDir(), "cache");
|
|
78
|
+
}
|
|
79
|
+
function ensureSootsimHome() {
|
|
80
|
+
import_node_fs.default.mkdirSync(sootsimHomeDir(), { recursive: true });
|
|
81
|
+
import_node_fs.default.mkdirSync(runtimesDir(), { recursive: true });
|
|
82
|
+
import_node_fs.default.mkdirSync(electronDir(), { recursive: true });
|
|
83
|
+
import_node_fs.default.mkdirSync(profilesDir(), { recursive: true });
|
|
84
|
+
import_node_fs.default.mkdirSync(cacheDir(), { recursive: true });
|
|
85
|
+
}
|
|
86
|
+
var DAEMON_LOCKFILE_MAX_BYTES = 16 * 1024;
|
|
87
|
+
|
|
88
|
+
// src/profiles.ts
|
|
89
|
+
var DEFAULT_PROFILE_ID = "default";
|
|
90
|
+
var PROFILE_INDEX_FILE = "profiles.json";
|
|
91
|
+
var PROFILE_INDEX_VERSION = 1;
|
|
92
|
+
function normalizeProfileId(input) {
|
|
93
|
+
const id = input.trim();
|
|
94
|
+
if (!id) throw new Error("profile id is required");
|
|
95
|
+
if (!/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(id)) {
|
|
96
|
+
throw new Error(
|
|
97
|
+
"profile ids must start with a letter or number and contain only letters, numbers, dot, dash, or underscore"
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
if (id === "." || id === "..") throw new Error(`invalid profile id: ${id}`);
|
|
101
|
+
return id;
|
|
102
|
+
}
|
|
103
|
+
function profileIndexPath() {
|
|
104
|
+
return import_path.default.join(profilesDir(), PROFILE_INDEX_FILE);
|
|
105
|
+
}
|
|
106
|
+
function electronProfilePartitionName(profileId) {
|
|
107
|
+
return `sootsim-profile-${normalizeProfileId(profileId)}`;
|
|
108
|
+
}
|
|
109
|
+
function electronProfilePartition(profileId) {
|
|
110
|
+
return `persist:${electronProfilePartitionName(profileId)}`;
|
|
111
|
+
}
|
|
112
|
+
function electronProfilePartitionDir(profileId) {
|
|
113
|
+
return import_path.default.join(
|
|
114
|
+
electronUserDataDir(),
|
|
115
|
+
"Partitions",
|
|
116
|
+
electronProfilePartitionName(profileId)
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
function playwrightProfileUserDataDir(profileId) {
|
|
120
|
+
return import_path.default.join(profilesDir(), "playwright", normalizeProfileId(profileId));
|
|
121
|
+
}
|
|
122
|
+
function readIndexRaw() {
|
|
123
|
+
try {
|
|
124
|
+
const parsed = JSON.parse(
|
|
125
|
+
import_fs.default.readFileSync(profileIndexPath(), "utf8")
|
|
126
|
+
);
|
|
127
|
+
if (!parsed || parsed.version !== PROFILE_INDEX_VERSION) {
|
|
128
|
+
return { version: PROFILE_INDEX_VERSION, profiles: [] };
|
|
129
|
+
}
|
|
130
|
+
const profiles = Array.isArray(parsed.profiles) ? parsed.profiles.filter(
|
|
131
|
+
(profile) => !!profile && typeof profile.id === "string" && typeof profile.createdAt === "string" && typeof profile.updatedAt === "string"
|
|
132
|
+
).map((profile) => ({
|
|
133
|
+
id: normalizeProfileId(profile.id),
|
|
134
|
+
createdAt: profile.createdAt,
|
|
135
|
+
updatedAt: profile.updatedAt
|
|
136
|
+
})) : [];
|
|
137
|
+
return { version: PROFILE_INDEX_VERSION, profiles };
|
|
138
|
+
} catch {
|
|
139
|
+
return { version: PROFILE_INDEX_VERSION, profiles: [] };
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
function sortProfiles(profiles) {
|
|
143
|
+
return [...profiles].sort((a, b) => {
|
|
144
|
+
if (a.id === DEFAULT_PROFILE_ID) return -1;
|
|
145
|
+
if (b.id === DEFAULT_PROFILE_ID) return 1;
|
|
146
|
+
return a.id.localeCompare(b.id);
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
function withDefault(index) {
|
|
150
|
+
if (index.profiles.some((profile) => profile.id === DEFAULT_PROFILE_ID)) {
|
|
151
|
+
return { ...index, profiles: sortProfiles(index.profiles) };
|
|
152
|
+
}
|
|
153
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
154
|
+
return {
|
|
155
|
+
version: PROFILE_INDEX_VERSION,
|
|
156
|
+
profiles: sortProfiles([
|
|
157
|
+
{ id: DEFAULT_PROFILE_ID, createdAt: now, updatedAt: now },
|
|
158
|
+
...index.profiles
|
|
159
|
+
])
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
function writeIndex(index) {
|
|
163
|
+
ensureSootsimHome();
|
|
164
|
+
const next = withDefault(index);
|
|
165
|
+
const tmp = `${profileIndexPath()}.tmp`;
|
|
166
|
+
import_fs.default.writeFileSync(tmp, `${JSON.stringify(next, null, 2)}
|
|
167
|
+
`, "utf8");
|
|
168
|
+
import_fs.default.renameSync(tmp, profileIndexPath());
|
|
169
|
+
return next;
|
|
170
|
+
}
|
|
171
|
+
function listProfiles() {
|
|
172
|
+
return writeIndex(readIndexRaw()).profiles;
|
|
173
|
+
}
|
|
174
|
+
function getProfile(id) {
|
|
175
|
+
const normalized = normalizeProfileId(id);
|
|
176
|
+
return listProfiles().find((profile) => profile.id === normalized) ?? null;
|
|
177
|
+
}
|
|
178
|
+
function ensureProfile(id = DEFAULT_PROFILE_ID) {
|
|
179
|
+
const normalized = normalizeProfileId(id);
|
|
180
|
+
const existing = getProfile(normalized);
|
|
181
|
+
if (existing) return existing;
|
|
182
|
+
return createProfile(normalized);
|
|
183
|
+
}
|
|
184
|
+
function createProfile(id) {
|
|
185
|
+
const normalized = normalizeProfileId(id);
|
|
186
|
+
const index = withDefault(readIndexRaw());
|
|
187
|
+
if (index.profiles.some((profile2) => profile2.id === normalized)) {
|
|
188
|
+
throw new Error(`profile already exists: ${normalized}`);
|
|
189
|
+
}
|
|
190
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
191
|
+
const profile = { id: normalized, createdAt: now, updatedAt: now };
|
|
192
|
+
writeIndex({ version: PROFILE_INDEX_VERSION, profiles: [...index.profiles, profile] });
|
|
193
|
+
return profile;
|
|
194
|
+
}
|
|
195
|
+
function nextGeneratedProfileId() {
|
|
196
|
+
const existing = new Set(listProfiles().map((profile) => profile.id));
|
|
197
|
+
for (let i = 1; i < 1e4; i++) {
|
|
198
|
+
const id = `profile-${i}`;
|
|
199
|
+
if (!existing.has(id)) return id;
|
|
200
|
+
}
|
|
201
|
+
throw new Error("could not allocate a new profile id");
|
|
202
|
+
}
|
|
203
|
+
function deleteProfile(id) {
|
|
204
|
+
const normalized = normalizeProfileId(id);
|
|
205
|
+
if (normalized === DEFAULT_PROFILE_ID) {
|
|
206
|
+
throw new Error("the default profile cannot be deleted; clear it instead");
|
|
207
|
+
}
|
|
208
|
+
const index = withDefault(readIndexRaw());
|
|
209
|
+
const profile = index.profiles.find((entry) => entry.id === normalized);
|
|
210
|
+
if (!profile) throw new Error(`profile not found: ${normalized}`);
|
|
211
|
+
writeIndex({
|
|
212
|
+
version: PROFILE_INDEX_VERSION,
|
|
213
|
+
profiles: index.profiles.filter((entry) => entry.id !== normalized)
|
|
214
|
+
});
|
|
215
|
+
clearProfileStorage(normalized);
|
|
216
|
+
return profile;
|
|
217
|
+
}
|
|
218
|
+
function clearProfileStorage(id) {
|
|
219
|
+
const normalized = normalizeProfileId(id);
|
|
220
|
+
for (const dir of [
|
|
221
|
+
electronProfilePartitionDir(normalized),
|
|
222
|
+
playwrightProfileUserDataDir(normalized)
|
|
223
|
+
]) {
|
|
224
|
+
try {
|
|
225
|
+
import_fs.default.rmSync(dir, { recursive: true, force: true });
|
|
226
|
+
} catch {
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
231
|
+
0 && (module.exports = {
|
|
232
|
+
DEFAULT_PROFILE_ID,
|
|
233
|
+
clearProfileStorage,
|
|
234
|
+
createProfile,
|
|
235
|
+
deleteProfile,
|
|
236
|
+
electronProfilePartition,
|
|
237
|
+
electronProfilePartitionDir,
|
|
238
|
+
electronProfilePartitionName,
|
|
239
|
+
ensureProfile,
|
|
240
|
+
getProfile,
|
|
241
|
+
listProfiles,
|
|
242
|
+
nextGeneratedProfileId,
|
|
243
|
+
normalizeProfileId,
|
|
244
|
+
playwrightProfileUserDataDir,
|
|
245
|
+
profileIndexPath
|
|
246
|
+
});
|
package/dist-lib/render-mode.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.38 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|