pi-subagents 0.24.3 → 0.25.0
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/CHANGELOG.md +26 -5
- package/README.md +19 -11
- package/package.json +4 -8
- package/prompts/review-loop.md +1 -1
- package/skills/pi-subagents/SKILL.md +46 -10
- package/src/agents/agent-management.ts +5 -0
- package/src/agents/agent-serializer.ts +2 -0
- package/src/agents/agents.ts +30 -6
- package/src/agents/skills.ts +25 -23
- package/src/extension/config.ts +16 -0
- package/src/extension/fanout-child.ts +170 -0
- package/src/extension/index.ts +13 -25
- package/src/intercom/intercom-bridge.ts +2 -1
- package/src/intercom/result-intercom.ts +108 -0
- package/src/runs/background/async-execution.ts +107 -7
- package/src/runs/background/async-job-tracker.ts +57 -14
- package/src/runs/background/async-resume.ts +28 -15
- package/src/runs/background/async-status.ts +60 -30
- package/src/runs/background/result-watcher.ts +111 -54
- package/src/runs/background/run-id-resolver.ts +83 -0
- package/src/runs/background/run-status.ts +79 -3
- package/src/runs/background/stale-run-reconciler.ts +46 -1
- package/src/runs/background/subagent-runner.ts +66 -18
- package/src/runs/foreground/chain-execution.ts +6 -0
- package/src/runs/foreground/execution.ts +21 -5
- package/src/runs/foreground/subagent-executor.ts +314 -18
- package/src/runs/shared/completion-guard.ts +23 -1
- package/src/runs/shared/mcp-direct-tool-allowlist.ts +365 -0
- package/src/runs/shared/nested-events.ts +819 -0
- package/src/runs/shared/nested-path.ts +52 -0
- package/src/runs/shared/nested-render.ts +115 -0
- package/src/runs/shared/parallel-utils.ts +1 -0
- package/src/runs/shared/pi-args.ts +67 -5
- package/src/runs/shared/run-history.ts +12 -7
- package/src/runs/shared/single-output.ts +12 -2
- package/src/runs/shared/subagent-prompt-runtime.ts +25 -5
- package/src/shared/artifacts.ts +2 -2
- package/src/shared/types.ts +95 -0
- package/src/shared/utils.ts +11 -1
- package/src/tui/render.ts +254 -153
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import * as fs from "node:fs";
|
|
3
|
+
import * as os from "node:os";
|
|
4
|
+
import * as path from "node:path";
|
|
5
|
+
import { getAgentDir } from "../../shared/utils.ts";
|
|
6
|
+
|
|
7
|
+
const CACHE_VERSION = 1;
|
|
8
|
+
const CACHE_MAX_AGE_MS = 7 * 24 * 60 * 60 * 1000;
|
|
9
|
+
const BUILTIN_TOOL_NAMES = new Set(["read", "bash", "edit", "write", "grep", "find", "ls", "mcp"]);
|
|
10
|
+
const GENERIC_GLOBAL_CONFIG_PATH = path.join(os.homedir(), ".config", "mcp", "mcp.json");
|
|
11
|
+
const IMPORT_PATHS = {
|
|
12
|
+
cursor: [path.join(os.homedir(), ".cursor", "mcp.json")],
|
|
13
|
+
"claude-code": [
|
|
14
|
+
path.join(os.homedir(), ".claude", "mcp.json"),
|
|
15
|
+
path.join(os.homedir(), ".claude.json"),
|
|
16
|
+
path.join(os.homedir(), ".claude", "claude_desktop_config.json"),
|
|
17
|
+
],
|
|
18
|
+
"claude-desktop": [path.join(os.homedir(), "Library", "Application Support", "Claude", "claude_desktop_config.json")],
|
|
19
|
+
codex: [path.join(os.homedir(), ".codex", "config.json")],
|
|
20
|
+
windsurf: [path.join(os.homedir(), ".windsurf", "mcp.json")],
|
|
21
|
+
vscode: [".vscode/mcp.json"],
|
|
22
|
+
} as const;
|
|
23
|
+
|
|
24
|
+
type ToolPrefix = "server" | "none" | "short";
|
|
25
|
+
type ImportKind = keyof typeof IMPORT_PATHS;
|
|
26
|
+
|
|
27
|
+
interface ServerEntry {
|
|
28
|
+
command?: string;
|
|
29
|
+
args?: string[];
|
|
30
|
+
env?: Record<string, string>;
|
|
31
|
+
cwd?: string;
|
|
32
|
+
url?: string;
|
|
33
|
+
headers?: Record<string, string>;
|
|
34
|
+
auth?: "oauth" | "bearer" | false;
|
|
35
|
+
bearerToken?: string;
|
|
36
|
+
bearerTokenEnv?: string;
|
|
37
|
+
exposeResources?: boolean;
|
|
38
|
+
excludeTools?: string[];
|
|
39
|
+
directTools?: boolean | string[];
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
interface McpConfig {
|
|
43
|
+
mcpServers: Record<string, ServerEntry>;
|
|
44
|
+
imports?: ImportKind[];
|
|
45
|
+
settings?: {
|
|
46
|
+
toolPrefix?: ToolPrefix;
|
|
47
|
+
directTools?: boolean;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
interface CachedTool {
|
|
52
|
+
name?: string;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
interface CachedResource {
|
|
56
|
+
uri?: string;
|
|
57
|
+
name?: string;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
interface ServerCacheEntry {
|
|
61
|
+
configHash?: string;
|
|
62
|
+
tools?: CachedTool[];
|
|
63
|
+
resources?: CachedResource[];
|
|
64
|
+
cachedAt?: number;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
interface MetadataCache {
|
|
68
|
+
version: number;
|
|
69
|
+
servers: Record<string, ServerCacheEntry>;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function resolveMcpDirectToolNames(mcpDirectTools: string[] | undefined, cwd = process.cwd()): string[] {
|
|
73
|
+
if (!mcpDirectTools?.length) return [];
|
|
74
|
+
|
|
75
|
+
try {
|
|
76
|
+
const config = loadMcpConfig(cwd);
|
|
77
|
+
const cache = loadMetadataCache();
|
|
78
|
+
if (!cache) return [];
|
|
79
|
+
return resolveDirectToolNames(config, cache, getToolPrefix(config.settings?.toolPrefix), mcpDirectTools);
|
|
80
|
+
} catch {
|
|
81
|
+
return [];
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function loadMetadataCache(): MetadataCache | null {
|
|
86
|
+
const cachePath = path.join(getAgentDir(), "mcp-cache.json");
|
|
87
|
+
let parsed: unknown;
|
|
88
|
+
try {
|
|
89
|
+
parsed = JSON.parse(fs.readFileSync(cachePath, "utf-8"));
|
|
90
|
+
} catch {
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (!parsed || typeof parsed !== "object") return null;
|
|
95
|
+
const raw = parsed as Record<string, unknown>;
|
|
96
|
+
if (raw.version !== CACHE_VERSION || !raw.servers || typeof raw.servers !== "object" || Array.isArray(raw.servers)) {
|
|
97
|
+
return null;
|
|
98
|
+
}
|
|
99
|
+
return raw as unknown as MetadataCache;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function loadMcpConfig(cwd: string): McpConfig {
|
|
103
|
+
let config: McpConfig = { mcpServers: {} };
|
|
104
|
+
for (const sourcePath of getConfigPaths(cwd)) {
|
|
105
|
+
const loaded = readConfig(sourcePath);
|
|
106
|
+
if (!loaded) continue;
|
|
107
|
+
config = mergeConfigs(config, expandImports(loaded, cwd));
|
|
108
|
+
}
|
|
109
|
+
return config;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function getConfigPaths(cwd: string): string[] {
|
|
113
|
+
const piGlobalPath = path.join(getAgentDir(), "mcp.json");
|
|
114
|
+
const projectPath = path.resolve(cwd, ".mcp.json");
|
|
115
|
+
const projectPiPath = path.resolve(cwd, ".pi", "mcp.json");
|
|
116
|
+
const sources: string[] = [];
|
|
117
|
+
if (GENERIC_GLOBAL_CONFIG_PATH !== piGlobalPath) sources.push(GENERIC_GLOBAL_CONFIG_PATH);
|
|
118
|
+
sources.push(piGlobalPath);
|
|
119
|
+
if (projectPath !== piGlobalPath) sources.push(projectPath);
|
|
120
|
+
if (projectPiPath !== piGlobalPath && projectPiPath !== projectPath) sources.push(projectPiPath);
|
|
121
|
+
return sources;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function readConfig(configPath: string): McpConfig | null {
|
|
125
|
+
let parsed: unknown;
|
|
126
|
+
try {
|
|
127
|
+
parsed = JSON.parse(fs.readFileSync(configPath, "utf-8"));
|
|
128
|
+
} catch {
|
|
129
|
+
return null;
|
|
130
|
+
}
|
|
131
|
+
return validateConfig(parsed);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function validateConfig(raw: unknown): McpConfig {
|
|
135
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw)) return { mcpServers: {} };
|
|
136
|
+
const obj = raw as Record<string, unknown>;
|
|
137
|
+
const servers = obj.mcpServers ?? obj["mcp-servers"] ?? {};
|
|
138
|
+
return {
|
|
139
|
+
mcpServers: servers && typeof servers === "object" && !Array.isArray(servers) ? servers as Record<string, ServerEntry> : {},
|
|
140
|
+
imports: Array.isArray(obj.imports) ? obj.imports.filter((value): value is ImportKind => isImportKind(value)) : undefined,
|
|
141
|
+
settings: obj.settings && typeof obj.settings === "object" && !Array.isArray(obj.settings)
|
|
142
|
+
? obj.settings as McpConfig["settings"]
|
|
143
|
+
: undefined,
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
function mergeConfigs(base: McpConfig, next: McpConfig): McpConfig {
|
|
148
|
+
const imports = [...(base.imports ?? []), ...(next.imports ?? [])];
|
|
149
|
+
return {
|
|
150
|
+
mcpServers: { ...base.mcpServers, ...next.mcpServers },
|
|
151
|
+
imports: imports.length ? [...new Set(imports)] : undefined,
|
|
152
|
+
settings: next.settings ? { ...base.settings, ...next.settings } : base.settings,
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function expandImports(config: McpConfig, cwd: string): McpConfig {
|
|
157
|
+
if (!config.imports?.length) return config;
|
|
158
|
+
|
|
159
|
+
const importedServers: Record<string, ServerEntry> = {};
|
|
160
|
+
for (const importKind of config.imports) {
|
|
161
|
+
const importPath = resolveImportPath(importKind, cwd);
|
|
162
|
+
if (!importPath) continue;
|
|
163
|
+
let imported: unknown;
|
|
164
|
+
try {
|
|
165
|
+
imported = JSON.parse(fs.readFileSync(importPath, "utf-8"));
|
|
166
|
+
} catch {
|
|
167
|
+
continue;
|
|
168
|
+
}
|
|
169
|
+
for (const [name, definition] of Object.entries(extractServers(imported, importKind))) {
|
|
170
|
+
if (!importedServers[name]) importedServers[name] = definition;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
return {
|
|
175
|
+
imports: config.imports,
|
|
176
|
+
settings: config.settings,
|
|
177
|
+
mcpServers: { ...importedServers, ...config.mcpServers },
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
function resolveImportPath(importKind: ImportKind, cwd: string): string | null {
|
|
182
|
+
for (const candidate of IMPORT_PATHS[importKind]) {
|
|
183
|
+
const fullPath = candidate.startsWith(".") ? path.resolve(cwd, candidate) : candidate;
|
|
184
|
+
if (fs.existsSync(fullPath)) return fullPath;
|
|
185
|
+
}
|
|
186
|
+
return null;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
function extractServers(config: unknown, kind: ImportKind): Record<string, ServerEntry> {
|
|
190
|
+
if (!config || typeof config !== "object" || Array.isArray(config)) return {};
|
|
191
|
+
const obj = config as Record<string, unknown>;
|
|
192
|
+
const servers = kind === "cursor" || kind === "windsurf" || kind === "vscode"
|
|
193
|
+
? obj.mcpServers ?? obj["mcp-servers"]
|
|
194
|
+
: obj.mcpServers;
|
|
195
|
+
return servers && typeof servers === "object" && !Array.isArray(servers) ? servers as Record<string, ServerEntry> : {};
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
function resolveDirectToolNames(config: McpConfig, cache: MetadataCache, prefix: ToolPrefix, envOverride: string[]): string[] {
|
|
199
|
+
const names: string[] = [];
|
|
200
|
+
const seenNames = new Set<string>();
|
|
201
|
+
const { servers: selectedServers, tools: selectedTools } = parseSelections(envOverride);
|
|
202
|
+
|
|
203
|
+
for (const [serverName, definition] of Object.entries(config.mcpServers)) {
|
|
204
|
+
const serverCache = cache.servers[serverName];
|
|
205
|
+
if (!isServerCacheValid(serverCache, definition)) continue;
|
|
206
|
+
|
|
207
|
+
const toolFilter = selectedServers.has(serverName)
|
|
208
|
+
? true
|
|
209
|
+
: selectedTools.get(serverName);
|
|
210
|
+
if (!toolFilter) continue;
|
|
211
|
+
|
|
212
|
+
for (const tool of Array.isArray(serverCache.tools) ? serverCache.tools : []) {
|
|
213
|
+
if (typeof tool?.name !== "string" || !tool.name) continue;
|
|
214
|
+
if (toolFilter !== true && !toolFilter.has(tool.name)) continue;
|
|
215
|
+
if (isToolExcluded(tool.name, serverName, prefix, definition.excludeTools)) continue;
|
|
216
|
+
const prefixedName = formatToolName(tool.name, serverName, prefix);
|
|
217
|
+
if (BUILTIN_TOOL_NAMES.has(prefixedName) || seenNames.has(prefixedName)) continue;
|
|
218
|
+
seenNames.add(prefixedName);
|
|
219
|
+
names.push(prefixedName);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
if (definition.exposeResources === false) continue;
|
|
223
|
+
for (const resource of Array.isArray(serverCache.resources) ? serverCache.resources : []) {
|
|
224
|
+
if (typeof resource?.name !== "string" || !resource.name || typeof resource.uri !== "string" || !resource.uri) continue;
|
|
225
|
+
const baseName = `get_${resourceNameToToolName(resource.name)}`;
|
|
226
|
+
if (toolFilter !== true && !toolFilter.has(baseName)) continue;
|
|
227
|
+
if (isToolExcluded(baseName, serverName, prefix, definition.excludeTools)) continue;
|
|
228
|
+
const prefixedName = formatToolName(baseName, serverName, prefix);
|
|
229
|
+
if (BUILTIN_TOOL_NAMES.has(prefixedName) || seenNames.has(prefixedName)) continue;
|
|
230
|
+
seenNames.add(prefixedName);
|
|
231
|
+
names.push(prefixedName);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
return names;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
function parseSelections(selections: string[]): { servers: Set<string>; tools: Map<string, Set<string>> } {
|
|
239
|
+
const servers = new Set<string>();
|
|
240
|
+
const tools = new Map<string, Set<string>>();
|
|
241
|
+
for (let item of selections) {
|
|
242
|
+
item = item.replace(/\/+$/, "");
|
|
243
|
+
if (item.includes("/")) {
|
|
244
|
+
const [server, tool] = item.split("/", 2);
|
|
245
|
+
if (server && tool) {
|
|
246
|
+
if (!tools.has(server)) tools.set(server, new Set());
|
|
247
|
+
tools.get(server)!.add(tool);
|
|
248
|
+
} else if (server) {
|
|
249
|
+
servers.add(server);
|
|
250
|
+
}
|
|
251
|
+
} else if (item) {
|
|
252
|
+
servers.add(item);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
return { servers, tools };
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
function isServerCacheValid(entry: ServerCacheEntry | undefined, definition: ServerEntry): entry is ServerCacheEntry {
|
|
259
|
+
if (!entry || entry.configHash !== computeMcpServerHash(definition)) return false;
|
|
260
|
+
if (!entry.cachedAt || typeof entry.cachedAt !== "number") return false;
|
|
261
|
+
return Date.now() - entry.cachedAt <= CACHE_MAX_AGE_MS;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
export function computeMcpServerHash(definition: ServerEntry): string {
|
|
265
|
+
const identity: Record<string, unknown> = {
|
|
266
|
+
command: definition.command,
|
|
267
|
+
args: definition.args,
|
|
268
|
+
env: interpolateEnvRecord(definition.env),
|
|
269
|
+
cwd: resolveConfigPath(definition.cwd),
|
|
270
|
+
url: definition.url,
|
|
271
|
+
headers: interpolateEnvRecord(definition.headers),
|
|
272
|
+
auth: definition.auth,
|
|
273
|
+
bearerToken: resolveBearerToken(definition),
|
|
274
|
+
bearerTokenEnv: definition.bearerTokenEnv,
|
|
275
|
+
exposeResources: definition.exposeResources,
|
|
276
|
+
excludeTools: definition.excludeTools,
|
|
277
|
+
};
|
|
278
|
+
return createHash("sha256").update(stableStringify(identity)).digest("hex");
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
function getToolPrefix(value: unknown): ToolPrefix {
|
|
282
|
+
return value === "none" || value === "short" || value === "server" ? value : "server";
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
function isImportKind(value: unknown): value is ImportKind {
|
|
286
|
+
return typeof value === "string" && Object.hasOwn(IMPORT_PATHS, value);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
function getServerPrefix(serverName: string, mode: ToolPrefix): string {
|
|
290
|
+
if (mode === "none") return "";
|
|
291
|
+
if (mode === "short") {
|
|
292
|
+
const short = serverName.replace(/-?mcp$/i, "").replace(/-/g, "_");
|
|
293
|
+
return short || "mcp";
|
|
294
|
+
}
|
|
295
|
+
return serverName.replace(/-/g, "_");
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
function formatToolName(toolName: string, serverName: string, prefix: ToolPrefix): string {
|
|
299
|
+
const serverPrefix = getServerPrefix(serverName, prefix);
|
|
300
|
+
return serverPrefix ? `${serverPrefix}_${toolName}` : toolName;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
function isToolExcluded(toolName: string, serverName: string, prefix: ToolPrefix, excludeTools: unknown): boolean {
|
|
304
|
+
if (!Array.isArray(excludeTools) || excludeTools.length === 0) return false;
|
|
305
|
+
const candidates = new Set([
|
|
306
|
+
normalizeToolName(toolName),
|
|
307
|
+
normalizeToolName(formatToolName(toolName, serverName, prefix)),
|
|
308
|
+
normalizeToolName(formatToolName(toolName, serverName, "server")),
|
|
309
|
+
normalizeToolName(formatToolName(toolName, serverName, "short")),
|
|
310
|
+
]);
|
|
311
|
+
return excludeTools.some((excluded) => typeof excluded === "string" && candidates.has(normalizeToolName(excluded)));
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
function normalizeToolName(value: string): string {
|
|
315
|
+
return value.replace(/-/g, "_");
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
function resourceNameToToolName(name: string): string {
|
|
319
|
+
let result = name
|
|
320
|
+
.replace(/[^a-zA-Z0-9]/g, "_")
|
|
321
|
+
.replace(/_+/g, "_")
|
|
322
|
+
.replace(/^_+/, "")
|
|
323
|
+
.replace(/_+$/, "")
|
|
324
|
+
.toLowerCase();
|
|
325
|
+
if (!result || /^\d/.test(result)) result = `resource${result ? `_${result}` : ""}`;
|
|
326
|
+
return result;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
function interpolateEnvRecord(values: Record<string, string> | undefined): Record<string, string> | undefined {
|
|
330
|
+
if (!values || typeof values !== "object" || Array.isArray(values)) return undefined;
|
|
331
|
+
const resolved: Record<string, string> = {};
|
|
332
|
+
for (const [key, value] of Object.entries(values)) {
|
|
333
|
+
if (typeof value === "string") resolved[key] = interpolateEnvVars(value);
|
|
334
|
+
}
|
|
335
|
+
return resolved;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
function interpolateEnvVars(value: string): string {
|
|
339
|
+
return value
|
|
340
|
+
.replace(/\$\{(\w+)\}/g, (_, name: string) => process.env[name] ?? "")
|
|
341
|
+
.replace(/\$env:(\w+)/g, (_, name: string) => process.env[name] ?? "");
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
function resolveConfigPath(value: string | undefined): string | undefined {
|
|
345
|
+
if (typeof value !== "string") return undefined;
|
|
346
|
+
const resolved = interpolateEnvVars(value);
|
|
347
|
+
if (resolved === "~") return os.homedir();
|
|
348
|
+
if (resolved.startsWith("~/") || resolved.startsWith("~\\")) return path.join(os.homedir(), resolved.slice(2));
|
|
349
|
+
return resolved;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
function resolveBearerToken(definition: Pick<ServerEntry, "bearerToken" | "bearerTokenEnv">): string | undefined {
|
|
353
|
+
if (typeof definition.bearerToken === "string") return interpolateEnvVars(definition.bearerToken);
|
|
354
|
+
return typeof definition.bearerTokenEnv === "string" ? process.env[definition.bearerTokenEnv] : undefined;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
function stableStringify(value: unknown): string {
|
|
358
|
+
if (value === null || value === undefined || typeof value !== "object") {
|
|
359
|
+
const serialized = JSON.stringify(value);
|
|
360
|
+
return serialized === undefined ? "undefined" : serialized;
|
|
361
|
+
}
|
|
362
|
+
if (Array.isArray(value)) return `[${value.map((entry) => stableStringify(entry)).join(",")}]`;
|
|
363
|
+
const obj = value as Record<string, unknown>;
|
|
364
|
+
return `{${Object.keys(obj).sort().map((key) => `${JSON.stringify(key)}:${stableStringify(obj[key])}`).join(",")}}`;
|
|
365
|
+
}
|