@explyt/ai-agent 0.1.4 → 0.2.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/README.md CHANGED
@@ -17,8 +17,8 @@ explyt update # install the newer latest, then restart open sessi
17
17
  For a one-off pinned run:
18
18
 
19
19
  ```bash
20
- npx -y "@explyt/ai-agent@0.1.4" # start the terminal UI
21
- npx -y "@explyt/ai-agent@0.1.4" login # store a provider credential, once
20
+ npx -y "@explyt/ai-agent@0.2.0" # start the terminal UI
21
+ npx -y "@explyt/ai-agent@0.2.0" login # store a provider credential, once
22
22
  ```
23
23
 
24
24
  The agent runs with exactly the extensions this build ships with and ignores any
@@ -28,4 +28,4 @@ you get.
28
28
  IDE (ACP) integration is not part of this package: it is provided by the Explyt
29
29
  managed backend, which the Neo plugin downloads and manages.
30
30
 
31
- Run `npx -y @explyt/ai-agent@0.1.4 --help` for the available options.
31
+ Run `npx -y @explyt/ai-agent@0.2.0 --help` for the available options.
@@ -64,7 +64,7 @@ License or other written license agreements with the Company.
64
64
  ### 3. pi-coding-agent and its ecosystem packages
65
65
 
66
66
  **Original Work:**
67
- - Name: `@earendil-works/pi-coding-agent`, `pi-mcp-adapter`, `pi-subagents`
67
+ - Name: `@earendil-works/pi-coding-agent`, `pi-mcp-adapter`, `pi-web-access`
68
68
  - Available at: https://www.npmjs.com/package/@earendil-works/pi-coding-agent
69
69
  - Licensed under the MIT License
70
70
 
@@ -78,7 +78,7 @@ License or other written license agreements with the Company.
78
78
  at it through its own `PI_PACKAGE_DIR` override, so the engine presents itself under the
79
79
  Explyt name. The original copyright and license notice above apply to the engine
80
80
  unchanged.
81
- - `pi-mcp-adapter` and `pi-subagents` are runtime dependencies. The public npm package
81
+ - `pi-mcp-adapter` and `pi-web-access` are runtime dependencies. The public npm package
82
82
  declares them with exact versions and does not contain them: npm installs the
83
83
  unmodified registry packages beside it. The managed backend archive redistributes them
84
84
  as bundled dependencies. Text they contribute to the model (tool descriptions and
@@ -97,9 +97,12 @@ License or other written license agreements with the Company.
97
97
  here as required by the MIT License; the original copyright and license notice above
98
98
  apply to the modified package unchanged. The public npm package does not carry the
99
99
  adapter and therefore carries no modification of it.
100
+ - The formerly bundled `pi-subagents` package was removed by spec 008; references to it in
101
+ older release history are historical and do not describe the current artifact.
100
102
  - Seven units of `@earendil-works/pi-coding-agent` 0.84.4 are **copied** (from the TypeScript in
101
103
  the shipped sourcemaps' `sourcesContent`) into `extensions/bash/engine/` under spec 006
102
- (RQ-37); the whitespace-normalized originals sit next to each copy as `*.upstream.txt`, and every
104
+ (RQ-37) — `killProcessTree` into `packages/shared/src/process/`, where spec 008's children
105
+ share it; the whitespace-normalized originals sit next to each copy as `*.upstream.txt`, and every
103
106
  changed line is marked `// 006:` (enforced by `extensions/bash/engine/pin.test.ts`):
104
107
  - `waitForChildProcess` — `src/utils/child-process.ts` → `wait-for-child-process.ts`;
105
108
  modified: idle drain timer suspended while the output writer is busy, promise settles
@@ -192,7 +195,8 @@ The MIT License text below applies to this package with the copyright notice abo
192
195
 
193
196
  ### MIT License
194
197
 
195
- Applies to: pi-acp, `@earendil-works/pi-coding-agent`, `pi-mcp-adapter`, `pi-subagents`,
198
+ Applies to: pi-acp, `@earendil-works/pi-coding-agent`, `pi-mcp-adapter`, `pi-web-access`
199
+ (Copyright (c) 2025 Nico Bailon),
196
200
  `@juicesharp/rpiv-ask-user-question`.
197
201
 
198
202
  ```
@@ -515,7 +519,7 @@ Consult each package for its complete license text.
515
519
  - model-probe@0.6.0: license metadata = MIT (installed by npm beside this package)
516
520
  - open@10.2.0: license metadata = MIT (installed by npm beside this package)
517
521
  - pi-mcp-adapter@2.31.0: license metadata = MIT (installed by npm beside this package)
518
- - pi-subagents@0.62.0: license metadata = MIT (installed by npm beside this package)
522
+ - pi-web-access@0.31.0: license metadata = MIT (installed by npm beside this package)
519
523
  - recheck@4.5.0: license metadata = MIT (installed by npm beside this package)
520
524
  - semver@7.8.5: license metadata = ISC (installed by npm beside this package)
521
525
  - smol-toml@1.9.0: license metadata = BSD-3-Clause (installed by npm beside this package)
@@ -1,4 +1,4 @@
1
- # Explyt Ai Agent documentation
1
+ # Explyt AI Agent documentation
2
2
 
3
3
  This directory describes how **this agent** is configured, for the agent itself to read before
4
4
  answering a configuration question or editing a configuration file.
@@ -12,6 +12,7 @@ it. Read the whole file before editing anything it describes.
12
12
  | `rules.md` | persistent instructions: where rule files live, their frontmatter, how to disable one |
13
13
  | `skills.md` | Skills: where they are found, the `SKILL.md` frontmatter, how to disable one |
14
14
  | `mcp.md` | MCP servers: the two `mcp.json` files, the entry shape, disabling a server or a tool |
15
+ | `web-search.md` | web search and page fetch: `web-search.json`, where requests go, keys, switching search off, failures |
15
16
 
16
17
  ## User configuration lives under `.explyt/`
17
18
 
@@ -33,6 +34,9 @@ all projects, and in the project directory for one project:
33
34
  Create these files and directories when they do not exist; nothing has to be registered anywhere
34
35
  for them to take effect.
35
36
 
37
+ The one exception is web access: it is configured in `web-search.json` in the agent's own directory,
38
+ not under `.explyt/`. `web-search.md` says where that directory is and what goes into the file.
39
+
36
40
  ## Updates of the agent itself
37
41
 
38
42
  The terminal UI shows one line when a newer version is published; nothing updates on its own.
@@ -26,6 +26,10 @@ One object per section, with the setting's keys inside it:
26
26
  },
27
27
  "skills": {
28
28
  "disabledSkills": ["pdf-tools"]
29
+ },
30
+ "subagents": {
31
+ "maxConcurrency": 20,
32
+ "permission": "inherit"
29
33
  }
30
34
  }
31
35
  ```
@@ -40,10 +44,18 @@ rest of the file as it is.
40
44
  | `rules.disabledRules` | array of strings | `[]` | rule IDs that do not apply; see `rules.md` |
41
45
  | `skills.disabledSkills` | array of strings | `[]` | Skill names that are unavailable; see `skills.md` |
42
46
  | `sessionTitle.enabled` | boolean | `true` | whether a new chat gets a short title generated by the model after its first turn succeeds |
47
+ | `subagents.maxConcurrency` | positive integer | `20` | Maximum simultaneously running or waiting children |
48
+ | `subagents.permission` | `inherit` \| `yolo` \| `ask-permissions` | `inherit` | Permission mode resolved for child tools |
43
49
  | `tui.mascot` | string | `"cat"` | the animated mascot in the terminal's working row: `cat`, `snake`, `pacman`, `tetris`, `fishing`, `robot`, `pong` or `crab` |
44
50
 
45
- The two list settings take exact, case-sensitive entries. Neither supports globs or prefixes:
46
- `"pdf-*"` matches nothing. An entry matching nothing is kept, not an error.
51
+ The rule and Skill list settings take exact, case-sensitive entries. Neither supports globs or
52
+ prefixes: `"pdf-*"` matches nothing. An entry matching nothing is kept, not an error.
53
+
54
+ For `subagents`, a valid project value overrides the global value. Invalid values are ignored for
55
+ that layer with a warning, so the other layer or the default still applies. `permission: "inherit"`
56
+ resolves once when the child launches from the parent session's effective permission mode. The
57
+ parent always asks before a dangerous command (or blocks it when nobody can answer), so today
58
+ `inherit` behaves as `ask-permissions`; only an explicit `yolo` lets a child skip the question.
47
59
 
48
60
  Both lists are read per layer rather than merged, so a value written in the project layer does not
49
61
  replace the global one — each layer's list is applied on its own. Which layer to write is a
@@ -0,0 +1,157 @@
1
+ # Web search and page fetch
2
+
3
+ The agent has four web tools:
4
+
5
+ | Tool | What it does |
6
+ |---|---|
7
+ | `web_search` | searches the web and returns results with links |
8
+ | `fetch_content` | fetches a URL and returns it as Markdown; clones a GitHub repository |
9
+ | `get_search_content` | pages through a stored search or fetch result |
10
+ | `source_check` | searches several queries for a claim and returns quotes from sources |
11
+
12
+ ## Where web access is configured
13
+
14
+ Web access is configured in **one file only**:
15
+
16
+ ```text
17
+ <agent dir>/web-search.json
18
+ ```
19
+
20
+ `<agent dir>` is the agent's own directory. It is `$PI_CODING_AGENT_DIR` when that variable is set.
21
+ Otherwise it is `$XDG_DATA_HOME/explyt-ai-agent/agent`, or `~/.local/share/explyt-ai-agent/agent`
22
+ when `XDG_DATA_HOME` is unset or not absolute. The layout is the same on Linux, macOS and Windows
23
+ (on Windows `~` is the user's home directory, for example `C:\Users\<name>\.local\share\explyt-ai-agent\agent`).
24
+
25
+ This file is the one user-editable file outside `.explyt/`. Do not put web settings into
26
+ `.explyt/settings.json`: nothing reads them there.
27
+
28
+ **A change takes effect in the next session** — a new IDE chat or a restarted terminal session.
29
+ The running session keeps the values it started with.
30
+
31
+ ## What the product seeds
32
+
33
+ Every time the product starts, it adds these keys to the file when they are absent:
34
+
35
+ ```json
36
+ {
37
+ "provider": ["exa", "duckduckgo"],
38
+ "workflow": "none",
39
+ "autoOpenBrowser": false,
40
+ "fetch": { "allowedModes": ["readable", "raw"] },
41
+ "githubClone": { "clonePath": "<os temp dir>/explyt-github-repos" },
42
+ "commands": {
43
+ "websearch": { "enabled": false },
44
+ "curator": { "enabled": false },
45
+ "search": { "enabled": false },
46
+ "google-account": { "enabled": false }
47
+ }
48
+ }
49
+ ```
50
+
51
+ - A value already in the file is never overwritten. The one exception: a `githubClone.clonePath`
52
+ whose last path segment is `explyt-github-repos` is kept pointed at the current temp directory.
53
+ - **A seeded key the user deletes comes back on the next start.** To change a seeded value, set a
54
+ different value; do not delete the key.
55
+ - `provider` is not added when the file already has `provider`, `searchProvider` or `searchRouting`.
56
+ - `workflow` is ignored: every search runs without the browser-based curator and without a
57
+ generated summary, whatever the file says.
58
+ - The page-answer mode of `fetch_content` (`answer`) is not available; the tool offers `readable`
59
+ and `raw` only.
60
+
61
+ ## Where the requests go
62
+
63
+ **Search.** By default **every search query is sent to both providers at once**, and the results of
64
+ whichever answered are merged:
65
+
66
+ - **Exa** — Exa's anonymous MCP endpoint (`mcp.exa.ai`). No key needed. Exa limits anonymous
67
+ callers per IP address, by default about 50 tool calls a day; everyone behind the same office
68
+ NAT shares that limit. Some networks are blocked by Exa entirely.
69
+ - **DuckDuckGo** — the agent reads DuckDuckGo's HTML results page (`html.duckduckgo.com`) directly,
70
+ without an API. No key needed; the page can change or answer with a challenge.
71
+
72
+ Search queries leave the user's machine and reach these services. Tell the user this when they ask
73
+ about privacy; the product shows no other notice.
74
+
75
+ **Fetch.** `fetch_content` requests the URL **directly from the user's machine** and converts the
76
+ page to Markdown. No third-party fetch service is used unless the user configures one.
77
+
78
+ **GitHub.** For a repository URL, `fetch_content` makes a shallow clone under
79
+ `<os temp dir>/explyt-github-repos` and gives you the local path. It clones with the user's `gh`
80
+ when `gh` is installed, otherwise with `git` over HTTPS. When the clone fails you get the
81
+ repository's tree and README over the GitHub API instead.
82
+
83
+ ## Enabling or improving search
84
+
85
+ A key alone does **not** change the providers: `provider` is seeded as `["exa", "duckduckgo"]`, so
86
+ **`provider` must be changed too** in every option below. Merge the JSON into the existing file;
87
+ keep the other keys.
88
+
89
+ **Exa key** — unthrottled Exa (key from exa.ai):
90
+
91
+ ```json
92
+ { "exaApiKey": "<key>", "provider": ["exa", "duckduckgo"] }
93
+ ```
94
+
95
+ The pair can stay; with a key Exa is no longer limited per IP. Use `"provider": "exa"` for Exa only.
96
+
97
+ **Brave Search key** (key from api.search.brave.com):
98
+
99
+ ```json
100
+ { "braveApiKey": "<key>", "provider": ["brave", "duckduckgo"] }
101
+ ```
102
+
103
+ **Tavily key** (key from tavily.com):
104
+
105
+ ```json
106
+ { "tavilyApiKey": "<key>", "provider": ["tavily", "duckduckgo"] }
107
+ ```
108
+
109
+ **Self-hosted SearXNG** (the instance must have the JSON output format enabled):
110
+
111
+ ```json
112
+ { "searxngBaseUrl": "https://search.example.com", "provider": "searxng" }
113
+ ```
114
+
115
+ The environment variable `SEARXNG_BASE_URL`, when set, takes precedence over `searxngBaseUrl`.
116
+
117
+ A key may also come from the environment the agent starts with — `EXA_API_KEY`, `BRAVE_API_KEY`,
118
+ `TAVILY_API_KEY` — but `provider` still has to be set in the file.
119
+
120
+ ## Switching search off
121
+
122
+ ```json
123
+ { "webSearch": { "enabled": false } }
124
+ ```
125
+
126
+ This removes `web_search` and `source_check`. `fetch_content` and `get_search_content` stay.
127
+
128
+ ## When search fails
129
+
130
+ When every query of a search call fails, the tool result says so and names each provider's error.
131
+ Tell the user that web search did not work and why, and offer the matching options below.
132
+
133
+ | What the error shows | What it means | What to do |
134
+ |---|---|---|
135
+ | network errors (`fetch failed`, `ENOTFOUND`, `ECONNREFUSED`, timeouts) from every provider | the machine is offline, or the network requires a proxy | check the connection; behind a corporate proxy set `"proxy": "http://host:port"` in the file |
136
+ | `Exa MCP error 403` (often an HTML "you have been blocked" page) | Exa blocks this network | use DuckDuckGo alone (`"provider": "duckduckgo"`), or add a Brave or Tavily key, or a SearXNG instance |
137
+ | `Exa MCP rate limit reached (429)` | the anonymous daily limit for this IP is spent | wait until tomorrow, or add `exaApiKey`, or another provider |
138
+ | DuckDuckGo error or no results | DuckDuckGo changed its page or answered with a challenge | retry later, or add a Brave, Tavily or Exa key, or SearXNG |
139
+ | an error parsing `web-search.json`, or the seeded defaults missing | the file is not valid JSON | open the file and fix it; the product does not repair it |
140
+
141
+ ## Known limitation: `gh` over SSH
142
+
143
+ When `gh` is installed, repositories are cloned with `gh repo clone`, which uses the protocol set in
144
+ the user's `gh` configuration. If that protocol is `ssh` and the user has no working SSH key, every
145
+ clone fails and you get the API view without a local copy. Check with:
146
+
147
+ ```bash
148
+ gh config get git_protocol -h github.com
149
+ ```
150
+
151
+ Workaround — switch `gh` to HTTPS for github.com:
152
+
153
+ ```bash
154
+ gh config set git_protocol https -h github.com
155
+ ```
156
+
157
+ This changes the user's `gh` configuration for all tools; ask the user before running it.
@@ -11,14 +11,16 @@ import {
11
11
  mkdirSync,
12
12
  readFileSync,
13
13
  readlinkSync,
14
+ realpathSync,
14
15
  renameSync,
15
16
  rmSync,
16
17
  statSync,
18
+ chmodSync,
17
19
  symlinkSync,
18
20
  writeFileSync,
19
21
  } from "node:fs";
20
22
  import { basename, delimiter, dirname, isAbsolute, join, resolve, sep } from "node:path";
21
- import { homedir, platform } from "node:os";
23
+ import { homedir, platform, tmpdir } from "node:os";
22
24
  import { fileURLToPath } from "node:url";
23
25
  import { randomBytes } from "node:crypto";
24
26
 
@@ -44,10 +46,11 @@ export const ENGINE_BRAND = "explyt";
44
46
  * configuration tree hangs off that one root: `auth.json`, `models.json`,
45
47
  * `settings.json`, `sessions/`, `bin/`, `prompts/`, `tools/`.
46
48
  *
47
- * This spelling stays even though the engine is rebranded: `pi-subagents` reads the
48
- * literal `PI_CODING_AGENT_DIR` (`src/shared/utils.ts`), `pi-mcp-adapter` falls back to
49
- * it, and so does the ACP adapter fork (`vendor/pi-acp/src/acp/agent-dir.ts`). All of
50
- * them live in the same engine process and must agree on one directory.
49
+ * This spelling stays even though the engine is rebranded: `pi-mcp-adapter` falls back
50
+ * to the literal `PI_CODING_AGENT_DIR`, and so do the ACP adapter fork
51
+ * (`vendor/pi-acp/src/acp/agent-dir.ts`) and the subagent manager, which also passes it
52
+ * on to every child engine (`extensions/subagents/index.ts`). All of them must agree on
53
+ * one directory.
51
54
  */
52
55
  export const AGENT_DIR_ENV = "PI_CODING_AGENT_DIR";
53
56
 
@@ -439,7 +442,7 @@ export function ensureAgentSettings(agentDir, {
439
442
  if (missing.length === 0) return { status: "unchanged" };
440
443
 
441
444
  const seeded = { ...current, ...Object.fromEntries(missing) };
442
- const tempPath = join(agentDir, `.settings.json.${process.pid}.${Date.now()}.tmp`);
445
+ const tempPath = tempPathFor(settingsPath);
443
446
  try {
444
447
  mkdir(agentDir, { recursive: true });
445
448
  } catch (error) {
@@ -450,6 +453,169 @@ export function ensureAgentSettings(agentDir, {
450
453
  return { status: "seeded" };
451
454
  }
452
455
 
456
+ /** File name of the bundled `pi-web-access` package's configuration, in the agent directory. */
457
+ const WEB_SEARCH_CONFIG_FILE = "web-search.json";
458
+
459
+ /** Last path segment of the directory GitHub repositories are cloned into (spec 015, RQ-3). */
460
+ const GITHUB_CLONE_DIR_NAME = "explyt-github-repos";
461
+
462
+ const isPlainObject = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
463
+
464
+ /** The product defaults for `web-search.json` (spec 015, RQ-14). A fresh object per call. */
465
+ export function webSearchSeed(cloneDir) {
466
+ return {
467
+ provider: ["exa", "duckduckgo"],
468
+ workflow: "none",
469
+ autoOpenBrowser: false,
470
+ fetch: { allowedModes: ["readable", "raw"] },
471
+ githubClone: { clonePath: cloneDir },
472
+ commands: {
473
+ websearch: { enabled: false },
474
+ curator: { enabled: false },
475
+ search: { enabled: false },
476
+ "google-account": { enabled: false },
477
+ },
478
+ };
479
+ }
480
+
481
+ /** Adds `value` at `path` when absent; never replaces a present key or descends into a non-object parent. */
482
+ function addAbsent(target, path, value) {
483
+ let node = target;
484
+ for (const key of path.slice(0, -1)) {
485
+ if (!Object.hasOwn(node, key)) node[key] = {};
486
+ else if (!isPlainObject(node[key])) return false;
487
+ node = node[key];
488
+ }
489
+ const last = path[path.length - 1];
490
+ if (Object.hasOwn(node, last)) return false;
491
+ node[last] = value;
492
+ return true;
493
+ }
494
+
495
+ /** True for a string whose last path segment, trailing `/` or `\` removed, is GITHUB_CLONE_DIR_NAME. */
496
+ function isProductCloneDir(value) {
497
+ if (typeof value !== "string") return false;
498
+ const segments = value.replace(/[\\/]+$/, "").split(/[\\/]/);
499
+ return segments[segments.length - 1] === GITHUB_CLONE_DIR_NAME;
500
+ }
501
+
502
+ /**
503
+ * The RQ-14 merge rule applied to a parsed `web-search.json` object; the input is not mutated.
504
+ *
505
+ * @returns {{ config: object, changed: boolean }}
506
+ */
507
+ export function mergeWebSearchConfig(current, cloneDir) {
508
+ const config = structuredClone(current);
509
+ const seed = webSearchSeed(cloneDir);
510
+ let changed = false;
511
+ const add = (path, value) => { if (addAbsent(config, path, value)) changed = true; };
512
+
513
+ if (!["provider", "searchProvider", "searchRouting"].some((key) => Object.hasOwn(config, key))) {
514
+ add(["provider"], seed.provider);
515
+ }
516
+ add(["workflow"], seed.workflow);
517
+ add(["autoOpenBrowser"], seed.autoOpenBrowser);
518
+ const fetch = config.fetch;
519
+ if (!isPlainObject(fetch) || !Object.hasOwn(fetch, "defaultMode") || ["readable", "raw"].includes(fetch.defaultMode)) {
520
+ add(["fetch", "allowedModes"], seed.fetch.allowedModes);
521
+ }
522
+ const clone = config.githubClone;
523
+ if (isPlainObject(clone) && Object.hasOwn(clone, "clonePath")) {
524
+ if (isProductCloneDir(clone.clonePath) && clone.clonePath !== cloneDir) {
525
+ clone.clonePath = cloneDir;
526
+ changed = true;
527
+ }
528
+ } else {
529
+ add(["githubClone", "clonePath"], cloneDir);
530
+ }
531
+ for (const [name, entry] of Object.entries(seed.commands)) add(["commands", name, "enabled"], entry.enabled);
532
+ return { config, changed };
533
+ }
534
+
535
+ /**
536
+ * Seeds `<agentDir>/web-search.json` before an engine starts (spec 015, RQ-13, RQ-14).
537
+ * The package fixes its configuration path when it loads and caches most of the file
538
+ * for the process, so this must run before the engine does.
539
+ *
540
+ * Never throws. A file that is not a JSON object is left byte-identical; an unwritable
541
+ * directory leaves no partial file. Both answer `failed` with a detail the caller
542
+ * reports once as a warning before starting the engine anyway. Nothing to add → no
543
+ * rewrite. A change goes through temp (unique name) + rename, so two starts seeding at
544
+ * once each rename a complete file computed from the same input: one seeding's result.
545
+ *
546
+ * @param {string} agentDir the engine configuration directory
547
+ * @returns {{ status: "unchanged" | "seeded" | "failed", detail?: string }}
548
+ */
549
+ export function ensureWebSearchConfig(agentDir, {
550
+ read = readFileSync,
551
+ write = writeFileSync,
552
+ rename = renameSync,
553
+ remove = rmSync,
554
+ mkdir = mkdirSync,
555
+ stat = statSync,
556
+ chmod = chmodSync,
557
+ realpath = realpathSync,
558
+ tempDir = tmpdir(),
559
+ } = {}) {
560
+ const linkPath = join(agentDir, WEB_SEARCH_CONFIG_FILE);
561
+ // A symlinked file is updated where it points, so the link survives the rename.
562
+ let configPath = linkPath;
563
+ try { configPath = realpath(linkPath); } catch { /* absent: written where it is looked up */ }
564
+ const cloneDir = join(tempDir, GITHUB_CLONE_DIR_NAME);
565
+ let text = null;
566
+ try {
567
+ text = read(configPath, "utf8");
568
+ } catch (error) {
569
+ if (error.code !== "ENOENT") return { status: "failed", detail: `cannot read ${configPath}: ${error.message}` };
570
+ }
571
+ let current = {};
572
+ if (text !== null) {
573
+ try {
574
+ current = JSON.parse(text);
575
+ } catch {
576
+ // Not error.message: JSON.parse quotes the file, which may hold an API key.
577
+ return { status: "failed", detail: `${linkPath} is not valid JSON, left unchanged` };
578
+ }
579
+ if (!isPlainObject(current)) return { status: "failed", detail: `${linkPath} is not a JSON object, left unchanged` };
580
+ }
581
+ const { config, changed } = mergeWebSearchConfig(current, cloneDir);
582
+ if (text !== null && !changed) return { status: "unchanged" };
583
+ try {
584
+ // 0700 as the engine's own auth storage creates it: the file may hold API keys.
585
+ mkdir(dirname(configPath), { recursive: true, mode: 0o700 });
586
+ } catch (error) {
587
+ return { status: "failed", detail: `cannot create ${dirname(configPath)}: ${error.message}` };
588
+ }
589
+ // A rename carries the temp file's mode, so an existing file's mode is kept explicitly.
590
+ let mode = 0o600;
591
+ if (text !== null) {
592
+ try { mode = stat(configPath).mode & 0o777; } catch { /* keep 0600 */ }
593
+ }
594
+ const tempPath = tempPathFor(configPath);
595
+ const written = writeAtomically(configPath, tempPath, `${JSON.stringify(config, null, 2)}\n`, {
596
+ write: (path, data) => { write(path, data, { mode }); chmod(path, mode); },
597
+ rename,
598
+ remove,
599
+ });
600
+ if (written !== null) return { status: "failed", detail: `cannot write ${linkPath}: ${written.message}` };
601
+ return { status: "seeded" };
602
+ }
603
+
604
+ /**
605
+ * Seeds `web-search.json` and reports a failure once through `warn`; the engine starts
606
+ * either way (RQ-13). Every product start path calls this before its engine.
607
+ */
608
+ export function seedWebSearchConfig(agentDir, warn, options) {
609
+ const result = ensureWebSearchConfig(agentDir, options);
610
+ if (result.status === "failed") warn(`warning: web access settings not seeded: ${result.detail}`);
611
+ return result;
612
+ }
613
+
614
+ /** A unique temp name beside `path`: two processes writing at once never share one. */
615
+ function tempPathFor(path) {
616
+ return join(dirname(path), `.${basename(path)}.${process.pid}.${randomBytes(6).toString("hex")}.tmp`);
617
+ }
618
+
453
619
  /**
454
620
  * Builds (or refreshes) the directory the engine is told is its own package.
455
621
  *
@@ -697,9 +863,9 @@ export function interactiveStdin({ isTTY, openTty }) {
697
863
  * Without this the engine merges its user-level registrations into the session, so
698
864
  * the agent's tool set becomes a property of the machine it runs on -- and any
699
865
  * pi package the user already registered collides with the copy we bundle. That is
700
- * not hypothetical: a pre-existing `pi-subagents` registration makes the engine
701
- * exit 1 with `Tool "subagent" conflicts`, killing the session before a single
702
- * protocol frame is written.
866
+ * not hypothetical: a pre-existing package registration can make the engine
867
+ * exit 1 with a tool-name conflict, killing the session before a single protocol
868
+ * frame is written.
703
869
  *
704
870
  * An explicit flag is never overwritten, so the wrapper's own root is a DEFAULT and
705
871
  * not a policy. Every backend this project writes relies on that default and passes
package/dist/cli/index.js CHANGED
@@ -44,6 +44,7 @@ import {
44
44
  engineEntrypointFrom,
45
45
  engineShimDir,
46
46
  ensureAgentSettings,
47
+ seedWebSearchConfig,
47
48
  ensureEngineShim,
48
49
  findEnginePackageDir,
49
50
  findEngineShimDir,
@@ -192,6 +193,10 @@ if (wantsLogout) {
192
193
  // difference is only where keystrokes come from: `login` may be launched by another
193
194
  // program with a piped stdin, so the controlling terminal is consulted before
194
195
  // giving up; the TUI is only ever started by a human.
196
+ function warnOnStderr(message) {
197
+ process.stderr.write(`explyt-ai-agent: ${message}\n`);
198
+ }
199
+
195
200
  if (wantsTui || wantsLogin) {
196
201
  const stdinFd = interactiveStdin({ isTTY: process.stdin.isTTY, openTty: () => openSync("/dev/tty", "r") });
197
202
  if (stdinFd === null) {
@@ -211,6 +216,8 @@ if (wantsTui || wantsLogin) {
211
216
  if (settings.status === "failed") {
212
217
  process.stderr.write(`explyt: engine settings not seeded: ${settings.detail}\n`);
213
218
  }
219
+ // The web tools' configuration (spec 015, RQ-14): before the engine, which fixes its path on load.
220
+ seedWebSearchConfig(env[AGENT_DIR_ENV], warnOnStderr);
214
221
  // `login` is ephemeral (NO_SESSION_FLAG); the TUI keeps its sessions. A login that
215
222
  // asks for a stored session is refused here, before anything is spawned: the engine
216
223
  // would accept the flag and silently do nothing with it.
@@ -277,6 +284,10 @@ if (!engine.shimDir) delete process.env[PACKAGE_DIR_ENV];
277
284
  delete process.env[UPDATE_ENV];
278
285
  Object.assign(process.env, engineEnv(process.env, undefined, { shimDir: engine.shimDir }));
279
286
 
287
+ // Seed the web tools' configuration before the adapter starts (spec 015, RQ-14): every
288
+ // engine it spawns fixes the file's path on load and reads it once.
289
+ seedWebSearchConfig(process.env[AGENT_DIR_ENV], warnOnStderr);
290
+
280
291
  // The adapter self-starts on import: loading the module builds the ACP connection
281
292
  // and resumes stdin. So it is imported for its side effect, never called as an API.
282
293
  // Strip our own subcommand first — the adapter parses argv itself and would reject
@@ -1 +1 @@
1
- const a3=b;(function(Q,R){const a2=b,S=Q();while(!![]){try{const T=-parseInt(a2(0x105))/0x1*(-parseInt(a2(0xdf))/0x2)+-parseInt(a2(0xfa))/0x3+parseInt(a2(0xd7))/0x4*(parseInt(a2(0xf2))/0x5)+-parseInt(a2(0xbc))/0x6*(-parseInt(a2(0xed))/0x7)+-parseInt(a2(0x6c))/0x8*(parseInt(a2(0x99))/0x9)+-parseInt(a2(0xe0))/0xa*(parseInt(a2(0xfd))/0xb)+-parseInt(a2(0x76))/0xc;if(T===R)break;else S['push'](S['shift']());}catch(U){S['push'](S['shift']());}}}(a,0x46cfc));import{existsSync}from'node:fs';import{fileURLToPath,pathToFileURL}from'node:url';var c=a3(0xaf),d=a3(0xd1),e={'where':a3(0x9f),'from':a3(0x104),'to':a3(0xdd)},f={'where':a3(0x102),'from':a3(0x9b),'to':a3(0xc8)},g={'where':a3(0x103),'from':a3(0x8e),'to':a3(0xb9)},h=[{'where':a3(0xf8),'from':a3(0x74),'to':a3(0x66)},{'where':a3(0x94),'from':a3(0xc5),'to':a3(0xb3)}],i=[{'where':a3(0xce),'from':a3(0xae),'to':a3(0xa9)},{'where':a3(0xa4),'from':a3(0x86),'to':a3(0xb8)},{'where':a3(0xf4),'from':a3(0x85),'to':a3(0xc0)}],j=a3(0xe2);function k(Q,{where:R,from:S,to:T}){const a4=a3,U=Q[a4(0xdb)](S);if(U===-0x1||Q[a4(0xdb)](S,U+S[a4(0x9c)])!==-0x1)throw new Error(a4(0xc9)+R+a4(0xf3)+S+'\x22');return Q[a4(0xe5)](0x0,U)+T+Q[a4(0xe5)](U+S[a4(0x9c)]);}function l(Q){const a5=a3;if(Array[a5(0x68)](Q))return Q[a5(0x98)](S=>l(S));if(Q===null||typeof Q!==a5(0xf0))return Q;const R=Object[a5(0xc7)](Object[a5(0x8c)](Q));for(const S of Reflect[a5(0x96)](Q)){const T=Object[a5(0xaa)](Q,S);if(a5(0x7a)in T)T[a5(0x7a)]=l(T[a5(0x7a)]);Object[a5(0x97)](R,S,T);}return R;}function m(Q,R,S){const a6=a3;let T=Q;for(const U of R){T=U===a6(0xc2)?T?.[a6(0xc2)]:T?.[a6(0xb7)]?.[U];}if(!T||typeof T[a6(0x75)]!==a6(0x6a))throw new Error(a6(0x65)+S+'\x20('+R[a6(0xfc)]('.')+')');return T;}function n(Q){const a7=a3,R=l(Q),S=[a7(0x8f),a7(0xc2)],T=[[[...S,a7(0x72)],e],[[...S,a7(0xff)],f],[[...S,a7(0x72),a7(0xc2),a7(0xd9)],g]];for(const [U,V]of T){const W=m(R,U,V[a7(0xa3)]);W[a7(0x75)]=k(W[a7(0x75)],V);}return R;}function o(Q){const a8=a3;return i[a8(0xde)](k,Q);}function p(Q){const a9=a3,R=[...Q];for(const S of h){const T=R[a9(0xad)](U=>U[a9(0x77)](S[a9(0x7e)]));if(T===-0x1)throw new Error(a9(0xc9)+S[a9(0xa3)]+a9(0xa7)+S[a9(0x7e)]+'\x22');R[T]=k(R[T],S);}return[...R,j];}function a(){const aw=['ks4GvgHLihvZzxiGBMv2zxiGC2f3ihrOzw0G4OcuigrVie5pvcb0CMvHDcb0AgLZigfZigeGzgvJBgLUzs4GqxnRihrOzsbXDwvZDgLVBNmGAw4GCgXHAw4Gy2HHDcbPBNn0zwfKlcb3AxrOB3v0ihvZAw5NihrOAxmGDg9VBc4','yM9VBgvHBG','zNvUy3rPB24','ChjVBxb0igD1AwrLBgLUzsaZ','C2HVD24','B3DUs2v5CW','zgv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ignVzguGC25PChbLDhmSigrPywDYyw1ZlcbJB25MAwDZksdIGjqGC2LUz2XLlxnLBgvJDcbVBMX5lIbuAguGzNjLzs10zxH0ig9WDgLVBIbPCYbHzgrLzcb0BYbLDMvYEsbXDwvZDgLVBIWGAw5JBhvKAw5NihDOzw4GB3b0Aw9UCYbJyxjYEsbHihbYzxzPzxCU','vg9VBca','ks4GvgHLEsbTyxKGAgf2zsbHBNn3zxjLzcdIGjqGyxnRigfNywLUigLUihbSywLUignOyxqU','zxHLy3v0zq','ChjVCgvYDgLLCW','vgHLigzYzwuTDgv4DcbVChrPB24GAxmGyxzHAwXHyMXLig9Uigv2zxj5ihf1zxn0Aw9UlcbPBMnSDwrPBMCGD2HLBIbVChrPB25ZignHCNj5igeGyhbYzxzPzxDGlG','t3b0Aw9UywWGChjLDMLLDYbJB250zw50ihnOB3DUihDPDgGGDgHPCYbVChrPB24U','B25uzxjTAw5HBeLUChv0','Aw5WDxq','ndG5nZmYDhjkCLvi','yMLUza','rxjYB3i6ihrOzsbXDwvZDgLVBNmGy291BgqGBM90igjLihnOB3DUihrVihrOzsb1C2vYicG','zxjYB3i','uhjLDMLLDYbJB250zw50igLZihnOB3DUihrVihrOzsb1C2vYihDPDgGGDgHLig9WDgLVBJSGBxvSDgKTBgLUzsb0zxH0ihDPDgGGBMv3BgLUzxmGAxmGC3vWCg9YDgvKlG','Dw5HBNn3zxjLza','AxrLBxm','BxvSDgK','Bw9Kzq','uhjVDMLKzsbHBIbVChrPB25Zw10UChjLDMLLDYbTyxjRzg93BIbZDhjPBMCGD2HLBIbHBIbVChrPB24GyMvUzwzPDhmGzNjVBsbYAwnOzxiGC2LKzs1IEs1ZAwrLignVBNrLEhqGkg1Vy2T1ChmSignVzguGC25PChbLDhmSigrPywDYyw1ZlcbJB25MAwDZksdIGjqGC2LUz2XLlxnLBgvJDcbVBMX5lIbuAguGiLr5CguGC29TzxrOAw5NlIiGCM93igLZigfWCgvUzgvKihrVigv2zxj5ihf1zxn0A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C3n3B3jKCYWGqvbjigTLExmSihrVA2vUCYbVCIbVDgHLCIbZzwnYzxrZoIb0AguGyw5ZD2vYCYbZDgf5ihzPC2LIBguGAw4GDgHLignOyxqU','zw52','CxvLC3rPB24','C2XPy2u','C3rVChbLza','yw5KihjLC3rHCNrPBMCGDgHLigfNzw50lG','ChvZAa','DxjS','y29UDgvUDa','BM9YBwfSAxPLuxvLC3rPB25qyxjHBxm','A2LUza','ndjwuLHVruK','BgfIzwW','CNbJ','B2jQzwn0','Dgv4Da','mJGWEgjurgz2','ig5VigXVBMDLCIbJB250ywLUCYb0AguGCgHYyxnLifjrltiYihjLCgXHy2vZigv4ywn0BhKGB25JztOGiG','Dg9VBcbKzxnJCMLWDgLVBIWGChjLDMLLDYbWyxjHz3jHCgG','D2HPBguGugKGD2fZihj1BM5PBMC','D2HPBguGDgHLigfNzw50ihDHCYbYDw5UAw5N','C2vZC2LVBL9SB2fKx2zHAwXLza','ChjVBxb0igD1AwrLBgLUzsaY','ywjVCNrLza','mJCZotnkuxPqEvK','CMvZDwX0','AM9PBG','mZCXmZi3ugrnqxLx','z2v0qwn0AxzLvg9VBhm','AgvHzgvY','vxnLCIbZA2LWCgvKihrOzsbXDwvZDgLVBNmGD2L0Ag91DcbHBNn3zxjPBMCGDgHLBs4GuhjVy2vLzcb3AxrOihjLyxnVBMfIBguGyxnZDw1WDgLVBNmGB3iGyxnRigLUihbSywLUignOyxq7igrVig5VDcbJywXSigfZA191C2vYx3f1zxn0Aw9UigfNywLUigzVCIb0AguGC2fTzsbXDwvZDgLVBNmU','zxHWBhL0lMfZA191C2vYx3f1zxn0Aw9UlNyX','AgvHzgvYihbHCMfTzxrLCIbKzxnJCMLWDgLVBG','ChjLDMLLDYbWyxjHBwv0zxiGzgvZy3jPChrPB24','vgHLicDuExbLihnVBwv0AgLUzY4NihjVDYbPCYbHChbLBMrLzcbHDxrVBwf0AwnHBgX5iokaLcbKBYbot1qGyxv0Ag9YigL0lG','ntmXnZG1sNDhA3f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MfSDwu','rvHqtfLux0fduf9fteLdsvrbveLptL9gt1jn','rxjYB3i6ihrOzsb1C2vYj3mGyw5ZD2vYignVDwXKig5VDcbIzsbYzwfKicG','ywrK','zNjVBq','AgfZ','zgvMyxvSDa','DgvZDa','CMvHC29U','ChjVBxb0r3vPzgvSAw5LCW','DhvP','uhjLDMLLDYbJB250zw50igLZihjLBMrLCMvKigfZig1HCMTKB3DUigLUigeGBw9UB3nWywnLigjVEc4GtxvSDgKTBgLUzsb0zxH0ihDPDgGGBMv3BgLUzxmGAxmGC3vWCg9YDgvKlIbxAgvUigfUEsbVChrPB24GAgfZigeGChjLDMLLDYWGDgHLifvjihn3AxrJAgvZihrVigeGC2LKzs1IEs1ZAwrLigXHEw91Dcb3AxrOigeGDMvYDgLJywWGB3b0Aw9UigXPC3qGB24GDgHLigXLzNqGyw5KihbYzxzPzxCGB24GDgHLihjPz2H0lG','vgHLicjuExbLihnVBwv0AgLUzY4IihjVDYbPCYbHDMfPBgfIBguGB24GzxzLCNKGCxvLC3rPB24SigLUy2X1zgLUzYb3AgvUig9WDgLVBNmGy2fYCNKGysbGChjLDMLLD2a7igLUihbYzxzPzxCGBw9KzsbPDcbLEhbHBMrZihrVihrOzsbMDwXSihbHBMuGD2LKDgGGD2HPBguGDhLWAw5NihnVihrOzsbJDxn0B20Gyw5ZD2vYigLZig5VDcbJCMfTCgvKigLUDg8GDgHLig5HCNjVDYbVChrPB25ZignVBhvTBI4','Bg9Hzc1MywLSDxjLihrLEhqSihjLC3rHCNq','ig5VDcbMB3vUza','zxzLCNK','BxvSDgLtzwXLy3q','zgv0ywLSCW','z2v0uhjVDg90ExbLt2y','AgfZvuK','t3b0Aw9UywWGChjLDMLLDYbJB250zw50ihjLBMrLCMvKihDOzw4GDgHPCYbVChrPB24GAxmGzM9JDxnLzc4','CxvLC3rPB25Z','Aw5KzxG'];a=function(){return aw;};return a();}function q(Q){const aa=a3;return{'description':o(Q[aa(0x75)]),'promptGuidelines':p(Q[aa(0x83)]??[]),'parameters':n(Q[aa(0x67)])};}var r=a3(0xf7),s=[{'where':a3(0x73),'from':a3(0xf5),'to':a3(0xf6)},{'where':a3(0x87),'from':a3(0xd0),'to':a3(0xe7)}];function t(Q){const ab=a3;return s[ab(0xde)]((R,{from:S,to:T})=>R[ab(0xa6)](S)[ab(0xfc)](T),Q);}var u=a3(0x7b),v=a3(0x101),w=0x1,x=a3(0x100),y=a3(0x6e);function z(Q){const ac=a3;return ac(0xbe)+Q+ac(0x91);}function A(Q){const ad=a3;return ad(0x7c)+Q+ad(0xb5);}function B(Q,R){const ae=a3;return JSON[ae(0xb0)]({'v':w,'toolCallId':Q,'questions':R[ae(0x8f)][ae(0x98)](S=>({'question':S[ae(0xe4)],'header':S[ae(0xff)],'multiSelect':S[ae(0x8a)]===!![],'options':S[ae(0x72)][ae(0x98)](T=>({'label':T[ae(0xee)],'description':T[ae(0x75)],...typeof T[ae(0xd9)]===ae(0x6a)&&T[ae(0xd9)][ae(0x9c)]>0x0?{'preview':T[ae(0xd9)]}:{}}))}))});}var C={'kind':a3(0xbf),'text':A(a3(0xa5))};function D(Q){const af=a3;return typeof Q===af(0xf0)&&Q!==null&&!Array[af(0x68)](Q);}function E(Q,R){const ag=a3,S=[...new Set(Q)],T=R[ag(0x98)](U=>U[ag(0xee)])[ag(0xd3)](U=>S[ag(0x77)](U));return[...T,...S[ag(0xd3)](U=>!T[ag(0x77)](U))];}function b(c,d){const e=a();return b=function(f,g){f=f-0x65;let h=e[f];if(b['KyctWc']===undefined){var i=function(m){const n='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let o='',p='';for(let q=0x0,r,s,t=0x0;s=m['charAt'](t++);~s&&(r=q%0x4?r*0x40+s:s,q++%0x4)?o+=String['fromCharCode'](0xff&r>>(-0x2*q&0x6)):0x0){s=n['indexOf'](s);}for(let u=0x0,v=o['length'];u<v;u++){p+='%'+('00'+o['charCodeAt'](u)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(p);};b['MgWrne']=i,c=arguments,b['KyctWc']=!![];}const j=e[0x0],k=f+j,l=c[k];return!l?(h=b['MgWrne'](h),c[k]=h):h=l,h;},b(c,d);}var F=a3(0xc1);function G(Q,R){const ah=a3;if(!D(Q))return void 0x0;const S=Q[ah(0x90)];if(typeof S!==ah(0xe1)||!Number[ah(0xa0)](S)||S<0x0||S>=R[ah(0x8f)][ah(0x9c)])return void 0x0;const T=R[ah(0x8f)][S],U=ah(0xcc)in Q,V=ah(0xcf)in Q;if(U===V)return void 0x0;if(U){if(typeof Q[ah(0xcc)]!==ah(0x6a)||Q[ah(0xcc)][ah(0xcd)]()[ah(0x9c)]===0x0)return void 0x0;return{'questionIndex':S,'question':T[ah(0xe4)],'kind':ah(0xcc),'answer':Q[ah(0xcc)]};}const W=Q[ah(0xcf)];if(!Array[ah(0x68)](W)||!W[ah(0x89)](Z=>typeof Z===ah(0x6a)))return void 0x0;const X=W[ah(0xd3)](Z=>Z[ah(0x9c)]>0x0);if(X[ah(0x9c)]===0x0)return F;if(T[ah(0x8a)]!==!![]&&X[ah(0x9c)]===0x1){const Z=X[0x0],a0=T[ah(0x72)][ah(0x9d)](a1=>a1[ah(0xee)]===Z)?.[ah(0xd9)];return{'questionIndex':S,'question':T[ah(0xe4)],'kind':ah(0xb2),'answer':Z,...typeof a0===ah(0x6a)&&a0[ah(0x9c)]>0x0?{'preview':a0}:{}};}const Y=T[ah(0x8a)]===!![]?E(X,T[ah(0x72)]):X;return{'questionIndex':S,'question':T[ah(0xe4)],'kind':ah(0xc3),'answer':null,'selected':Y};}function H(Q,R){const ai=a3;let S;try{S=JSON[ai(0xab)](Q);}catch{return C;}if(!D(S))return C;switch(S[ai(0xb1)]){case ai(0xa8):return{'kind':ai(0xfb),'result':{'answers':[],'cancelled':!![]}};case ai(0xe6):return{'kind':ai(0xbf),'text':y};case ai(0xbf):{const T=S[ai(0x82)];if(typeof T!==ai(0x6a)||T[ai(0x9c)]===0x0||/[\r\n]/[ai(0x81)](T)||typeof S[ai(0x95)]!==ai(0x92))return C;return{'kind':ai(0xbf),'text':S[ai(0x95)]?A(T):z(T)};}case ai(0x70):{if(!Array[ai(0x68)](S[ai(0xa2)])||S[ai(0xa2)][ai(0x9c)]===0x0)return C;const U=[],V=new Set();for(const W of S[ai(0xa2)]){const X=G(W,R),Y=D(W)?W[ai(0x90)]:void 0x0;if(!X||V[ai(0x7f)](Y))return C;V[ai(0x7d)](Y);if(X!==F)U[ai(0xe8)](X);}if(U[ai(0x9c)]===0x0)return{'kind':ai(0xfb),'result':{'answers':[],'cancelled':!![]}};return{'kind':ai(0xfb),'result':{'answers':U[ai(0x79)]((Z,a0)=>Z[ai(0xd4)]-a0[ai(0xd4)]),'cancelled':![]}};}default:return C;}}var I=a3(0xd6);function J(Q){const aj=a3;return Q[aj(0xc4)]===aj(0xef)&&process[aj(0xe3)][u]==='1';}function K(Q){const ak=a3;return Q[ak(0xc4)]===ak(0x84)||J(Q);}function L(){const al=a3,Q=process[al(0xe3)][d],R=Q?Q:fileURLToPath(new URL(al(0x106)+c,import.meta[al(0xe9)]));if(!existsSync(R))throw new Error(Q?d+al(0xcb)+R+al(0xd2):al(0xac)+R+al(0xda)+d+al(0x78));return R;}function M(Q){const am=a3,R=Q[am(0x8b)];if(R?.[am(0xd8)]===!![]&&R[am(0xbf)]===r)return{...Q,'content':Q[am(0xea)][am(0x98)](S=>typeof S[am(0xf1)]===am(0x6a)?{...S,'text':t(S[am(0xf1)])}:S)};if(R?.[am(0xd8)]!==!![]||R[am(0xbf)]!==void 0x0)return Q;return{...Q,'content':[{'type':am(0xf1),'text':x}]};}function N(Q,R,S,T){const U=Q['ui'],V=async()=>{const an=b;let X;try{X=await U[an(0xbb)](v,B(R,S),{'signal':T});}catch{throw new Error(z(an(0x9e)));}if(X===void 0x0)throw new Error(T?.[an(0xf9)]?y:z(an(0x69)));const Y=H(X,S);if(Y[an(0xec)]===an(0xfb))return Y[an(0xfb)];throw new Error(Y[an(0xf1)]);},W=new Proxy(Q['ui'],{'get'(X,Y){const ao=b;if(Y===ao(0xcc))return V;if(Y===ao(0xba))return void 0x0;return Reflect[ao(0x71)](X,Y,X);}});return new Proxy(Q,{'get'(X,Y){const ap=b;if(Y===ap(0xc4))return ap(0x84);if(Y===ap(0x8d))return!![];if(Y==='ui')return W;return Reflect[ap(0x71)](X,Y,X);}});}function O(Q,R){const aq=a3,S=Q[aq(0xb6)],T=q(Q);return{...Q,...T,'executionMode':aq(0x9a),async 'execute'(U,V,W,X,Y){const ar=aq;if(Y[ar(0xc4)]===ar(0xef)&&!J(Y))throw new Error(ar(0xb4)+I+ar(0x88));if(!J(Y))return M(await S[ar(0xa1)](Q,U,V,W,X,Y));const Z=R[ar(0xeb)](V),a0=await S[ar(0xa1)](Q,U,V,W,X,N(Y,U,Z,W));return M(a0);}};}async function P(Q){const as=a3,R=await import(pathToFileURL(L())[as(0x6f)]);if(typeof R[as(0x80)]!==as(0x93)||typeof R[as(0xeb)]!==as(0x93))throw new Error(L()+as(0xca));const S=new Proxy(Q,{'get'(T,U){const at=as;if(U===at(0xdc))return W=>Q[at(0xdc)](W?.[at(0x6d)]===I?O(W,R):W);if(U==='on')return(W,X)=>{const au=at,Y=W===au(0xc6)?(Z,a0)=>K(a0)?X(Z,a0):void 0x0:X;return Q['on'](W,Y);};const V=Reflect[at(0x71)](T,U,T);return typeof V===at(0x93)?V[at(0xbd)](T):V;}});R[as(0x80)](S),Q['on'](as(0x6b),(T,U)=>{const av=as;if(K(U))return;const V=Q[av(0xfe)]();if(V[av(0x77)](I))Q[av(0xd5)](V[av(0xd3)](W=>W!==I));});}export{u as ELICITATION_ENV,d as MODULE_ENV,v as QUESTIONNAIRE_TITLE,x as SKIP_TEXT,y as STOPPED_TEXT,I as TOOL_NAME,L as bundlePath,P as default,z as notShownText,K as toolOffered,A as unreadableText};
1
+ const a3=b;(function(Q,R){const a2=b,S=Q();while(!![]){try{const T=parseInt(a2(0x194))/0x1+parseInt(a2(0x164))/0x2+-parseInt(a2(0x189))/0x3*(parseInt(a2(0x1b0))/0x4)+parseInt(a2(0x1af))/0x5+-parseInt(a2(0x178))/0x6+-parseInt(a2(0x127))/0x7+-parseInt(a2(0x173))/0x8;if(T===R)break;else S['push'](S['shift']());}catch(U){S['push'](S['shift']());}}}(a,0xad0cc));import{existsSync}from'node:fs';import{fileURLToPath,pathToFileURL}from'node:url';var c=a3(0x16b),d=a3(0x1ba),e={'where':a3(0x1b2),'from':a3(0x14c),'to':a3(0x145)},f={'where':a3(0x123),'from':a3(0x19a),'to':a3(0x139)},g={'where':a3(0x1aa),'from':a3(0x149),'to':a3(0x15f)},h=[{'where':a3(0x1a3),'from':a3(0x18c),'to':a3(0x197)},{'where':a3(0x1a7),'from':a3(0x176),'to':a3(0x151)}],i=[{'where':a3(0x184),'from':a3(0x16f),'to':a3(0x1a8)},{'where':a3(0x1a1),'from':a3(0x12d),'to':a3(0x12a)},{'where':a3(0x153),'from':a3(0x166),'to':a3(0x167)}],j=a3(0x19e);function k(Q,{where:R,from:S,to:T}){const a4=a3,U=Q[a4(0x146)](S);if(U===-0x1||Q[a4(0x146)](S,U+S[a4(0x183)])!==-0x1)throw new Error(a4(0x14f)+R+a4(0x159)+S+'\x22');return Q[a4(0x170)](0x0,U)+T+Q[a4(0x170)](U+S[a4(0x183)]);}function l(Q){const a5=a3;if(Array[a5(0x13c)](Q))return Q[a5(0x14e)](S=>l(S));if(Q===null||typeof Q!==a5(0x128))return Q;const R=Object[a5(0x12b)](Object[a5(0x132)](Q));for(const S of Reflect[a5(0x179)](Q)){const T=Object[a5(0x162)](Q,S);if(a5(0x129)in T)T[a5(0x129)]=l(T[a5(0x129)]);Object[a5(0x12e)](R,S,T);}return R;}function m(Q,R,S){const a6=a3;let T=Q;for(const U of R){T=U===a6(0x135)?T?.[a6(0x135)]:T?.[a6(0x1b6)]?.[U];}if(!T||typeof T[a6(0x13e)]!==a6(0x195))throw new Error(a6(0x15c)+S+'\x20('+R[a6(0x16e)]('.')+')');return T;}function n(Q){const a7=a3,R=l(Q),S=[a7(0x17e),a7(0x135)],T=[[[...S,a7(0x1b8)],e],[[...S,a7(0x1a5)],f],[[...S,a7(0x1b8),a7(0x135),a7(0x1b1)],g]];for(const [U,V]of T){const W=m(R,U,V[a7(0x12c)]);W[a7(0x13e)]=k(W[a7(0x13e)],V);}return R;}function o(Q){const a8=a3;return i[a8(0x155)](k,Q);}function p(Q){const a9=a3,R=[...Q];for(const S of h){const T=R[a9(0x198)](U=>U[a9(0x150)](S[a9(0x160)]));if(T===-0x1)throw new Error(a9(0x14f)+S[a9(0x12c)]+a9(0x13f)+S[a9(0x160)]+'\x22');R[T]=k(R[T],S);}return[...R,j];}function q(Q){const aa=a3;return{'description':o(Q[aa(0x13e)]),'promptGuidelines':p(Q[aa(0x144)]??[]),'parameters':n(Q[aa(0x14b)])};}var r=a3(0x17b),s=[{'where':a3(0x15d),'from':a3(0x18d),'to':a3(0x16a)},{'where':a3(0x131),'from':a3(0x13a),'to':a3(0x15a)}];function t(Q){const ab=a3;return s[ab(0x155)]((R,{from:S,to:T})=>R[ab(0x174)](S)[ab(0x16e)](T),Q);}var u=a3(0x18e),v=a3(0x165),w=0x1,x=a3(0x125),y=a3(0x156);function z(Q){const ac=a3;return ac(0x12f)+Q+ac(0x187);}function A(Q){const ad=a3;return ad(0x192)+Q+ad(0x140);}function B(Q,R){const ae=a3;return JSON[ae(0x190)]({'v':w,'toolCallId':Q,'questions':R[ae(0x17e)][ae(0x14e)](S=>({'question':S[ae(0x142)],'header':S[ae(0x1a5)],'multiSelect':S[ae(0x17f)]===!![],'options':S[ae(0x1b8)][ae(0x14e)](T=>({'label':T[ae(0x175)],'description':T[ae(0x13e)],...typeof T[ae(0x1b1)]===ae(0x195)&&T[ae(0x1b1)][ae(0x183)]>0x0?{'preview':T[ae(0x1b1)]}:{}}))}))});}var C={'kind':a3(0x1a9),'text':A(a3(0x17a))};function D(Q){const af=a3;return typeof Q===af(0x128)&&Q!==null&&!Array[af(0x13c)](Q);}function b(c,d){const e=a();return b=function(f,g){f=f-0x121;let h=e[f];if(b['xfXnie']===undefined){var i=function(m){const n='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let o='',p='';for(let q=0x0,r,s,t=0x0;s=m['charAt'](t++);~s&&(r=q%0x4?r*0x40+s:s,q++%0x4)?o+=String['fromCharCode'](0xff&r>>(-0x2*q&0x6)):0x0){s=n['indexOf'](s);}for(let u=0x0,v=o['length'];u<v;u++){p+='%'+('00'+o['charCodeAt'](u)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(p);};b['HIbcNf']=i,c=arguments,b['xfXnie']=!![];}const j=e[0x0],k=f+j,l=c[k];return!l?(h=b['HIbcNf'](h),c[k]=h):h=l,h;},b(c,d);}function E(Q,R){const ag=a3,S=[...new Set(Q)],T=R[ag(0x14e)](U=>U[ag(0x175)])[ag(0x13b)](U=>S[ag(0x150)](U));return[...T,...S[ag(0x13b)](U=>!T[ag(0x150)](U))];}var F=a3(0x148);function G(Q,R){const ah=a3;if(!D(Q))return void 0x0;const S=Q[ah(0x181)];if(typeof S!==ah(0x1b7)||!Number[ah(0x136)](S)||S<0x0||S>=R[ah(0x17e)][ah(0x183)])return void 0x0;const T=R[ah(0x17e)][S],U=ah(0x157)in Q,V=ah(0x1bd)in Q;if(U===V)return void 0x0;if(U){if(typeof Q[ah(0x157)]!==ah(0x195)||Q[ah(0x157)][ah(0x16c)]()[ah(0x183)]===0x0)return void 0x0;return{'questionIndex':S,'question':T[ah(0x142)],'kind':ah(0x157),'answer':Q[ah(0x157)]};}const W=Q[ah(0x1bd)];if(!Array[ah(0x13c)](W)||!W[ah(0x13d)](Z=>typeof Z===ah(0x195)))return void 0x0;const X=W[ah(0x13b)](Z=>Z[ah(0x183)]>0x0);if(X[ah(0x183)]===0x0)return F;if(T[ah(0x17f)]!==!![]&&X[ah(0x183)]===0x1){const Z=X[0x0],a0=T[ah(0x1b8)][ah(0x18f)](a1=>a1[ah(0x175)]===Z)?.[ah(0x1b1)];return{'questionIndex':S,'question':T[ah(0x142)],'kind':ah(0x199),'answer':Z,...typeof a0===ah(0x195)&&a0[ah(0x183)]>0x0?{'preview':a0}:{}};}const Y=T[ah(0x17f)]===!![]?E(X,T[ah(0x1b8)]):X;return{'questionIndex':S,'question':T[ah(0x142)],'kind':ah(0x1be),'answer':null,'selected':Y};}function H(Q,R){const ai=a3;let S;try{S=JSON[ai(0x180)](Q);}catch{return C;}if(!D(S))return C;switch(S[ai(0x133)]){case ai(0x143):return{'kind':ai(0x185),'result':{'answers':[],'cancelled':!![]}};case ai(0x152):return{'kind':ai(0x1a9),'text':y};case ai(0x1a9):{const T=S[ai(0x196)];if(typeof T!==ai(0x195)||T[ai(0x183)]===0x0||/[\r\n]/[ai(0x14a)](T)||typeof S[ai(0x130)]!==ai(0x1bb))return C;return{'kind':ai(0x1a9),'text':S[ai(0x130)]?A(T):z(T)};}case ai(0x14d):{if(!Array[ai(0x13c)](S[ai(0x17d)])||S[ai(0x17d)][ai(0x183)]===0x0)return C;const U=[],V=new Set();for(const W of S[ai(0x17d)]){const X=G(W,R),Y=D(W)?W[ai(0x181)]:void 0x0;if(!X||V[ai(0x1bc)](Y))return C;V[ai(0x1a4)](Y);if(X!==F)U[ai(0x1b9)](X);}if(U[ai(0x183)]===0x0)return{'kind':ai(0x185),'result':{'answers':[],'cancelled':!![]}};return{'kind':ai(0x185),'result':{'answers':U[ai(0x1ad)]((Z,a0)=>Z[ai(0x177)]-a0[ai(0x177)]),'cancelled':![]}};}default:return C;}}var I=a3(0x15e);function J(Q){const aj=a3;return Q[aj(0x19c)]===aj(0x122)&&process[aj(0x1ae)][u]==='1';}function a(){const aw=['yw5ZD2vYCW','CxvLC3rPB25Z','BxvSDgLtzwXLy3q','CgfYC2u','Aw5KzxG','ywjVCNrLza','BgvUz3rO','Dg9VBcbKzxnJCMLWDgLVBIWGDxnHz2uGBM90zsaX','CMvZDwX0','igLZig5VDc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DgLVBI4','Dgv4Da','Bw9Kzq','BM9YBwfSAxPLuxvLC3rPB25qyxjHBxm','tMv2zxiGDxnLihrOAxmGDg9VBcb0BYbHC2SGzM9YihbHC3n3B3jKCYWGqvbjigTLExmSihrVA2vUCYbVCIbVDgHLCIbZzwnYzxrZoIb0AguGyw5ZD2vYCYbZDgf5ihzPC2LIBguGAw4GDgHLignOyxqU','CMvNAxn0zxjuB29S','Aw5WDxq','Dg9VBcbKzxnJCMLWDgLVBIWGDxnHz2uGBM90zsaY','y2fSBa','ChjVBxb0igD1AwrLBgLUzsaY','ywrK','AgvHzgvY','B25uzxjTAw5HBeLUChv0','ChjVBxb0igD1AwrLBgLUzsaZ','vxnLCNmGy2fUihr5CguGysbJDxn0B20Gyw5ZD2vYihrOCM91z2GGDgHLigzYzwuTDgv4DcbVChrPB24GywrKzwqGDg8GzxzLCNKGCxvLC3rPB24Sig9YihnRAxaGDgHLihf1zxn0Aw9UCY4','zxjYB3i','ChjLDMLLDYbWyxjHBwv0zxiGzgvZy3jPChrPB24','C2v0qwn0AxzLvg9VBhm','AgfZvuK','C29YDa','zw52','mZa2ntK0meHvsNjWqG','nJHAquTArgG','ChjLDMLLDW','B3b0Aw9UCYbWyxjHBwv0zxiGzgvZy3jPChrPB24','yMLUza','zgvMyxvSDa','z2v0qwn0AxzLvg9VBhm','ChjVCgvYDgLLCW','BNvTyMvY','B3b0Aw9UCW','ChvZAa','rvHqtfLux0fts19vu0vsx1fvrvnusu9ox01prfvmrq','yM9VBgvHBG','AgfZ','C2vSzwn0zwq','BxvSDgK','BMfTzq','CNbJ','AgvHzgvYihbHCMfTzxrLCIbKzxnJCMLWDgLVBG','C2vZC2LVBL9ZDgfYDa','vxnLCIbZA2LWCgvKihrOzsbXDwvZDgLVBNmGD2L0Ag91DcbHBNn3zxjPBMCGDgHLBs4GuhjVy2vLzcb3AxrOihjLyxnVBMfIBguGyxnZDw1WDgLVBNmGB3iGyxnRigLUihbSywLUignOyxq7igrVig5VDcbJywXSigfZA191C2vYx3f1zxn0Aw9UigfNywLUigzVCIb0AguGC2fTzsbXDwvZDgLVBNmU','DxjS','mZaWmdC4mwrLCK1uCa','B2jQzwn0','DMfSDwu','vgHLigzYzwuTDgv4DcbVChrPB24GAxmGyxzHAwXHyMXLig9Uigv2zxj5ihf1zxn0Aw9UlcbPBMnSDwrPBMCGD2HLBIbVChrPB25ZignHCNj5igeGyhbYzxzPzxDGlG','y3jLyxrL','D2HLCMu','vgHLicjuExbLihnVBwv0AgLUzY4IihjVDYbPCYbHDMfPBgfIBguGB24GzxzLCNKGCxvLC3rPB24SigLUy2X1zgLUzYb3AgvUig9WDgLVBNmGy2fYCNKGysbGChjLDMLLD2a7igLUihbYzxzPzxCGBw9KzsbPDcbLEhbHBMrZihrVihrOzsbMDwXSihbHBMuGD2LKDgGGD2HPBguGDhLWAw5NihnVihrOzsbJDxn0B20Gyw5ZD2vYigLZig5VDcbJCMfTCgvKigLUDg8GDgHLig5HCNjVDYbVChrPB25ZignVBhvTBI4','zgvMAw5LuhjVCgvYDhK','rxjYB3i6ihrOzsbXDwvZDgLVBNmGy291BgqGBM90igjLihnOB3DUihrVihrOzsb1C2vYicG','C2HVD24','Bg9Hzc1MywLSDxjLihrLEhqSihjLC3rHCNq','z2v0uhjVDg90ExbLt2y','ywn0Aw9U','lcb3AgLJAcbKB2vZig5VDcbLEgLZDdSGyNvPBgqGAxqGD2L0AcbLEhrLBNnPB25Zl2fZAY11C2vYlxf1zxn0Aw9Ul3nPzgvJyxiUBwPZ','AxrLBxm','AxnjBNrLz2vY','DgHLigfKyxb0zxiGy2fUy2vSBgvKihrOzsbYzxf1zxn0','A2LUza','vMvYEsbZAg9YDcbSywjLBcbZAg93BIbUzxH0ihrVihrOzsbXDwvZDgLVBI4','yw5KihjLC3rHCNrPBMCGugKU','zMLSDgvY','AxnbCNjHEq','zxzLCNK','zgvZy3jPChrPB24','ig5VigXVBMDLCIbJB250ywLUCYb0AguGCgHYyxnLifjrltiYihjLCgXH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YbZDg9WCgvKlIbuAguGDxnLCIbKAwqGBM90igrLy2XPBMuUifDHAxqGzM9YihrOzsb1C2vYj3mGBMv4DcbTzxnZywDLoYbKBYbUB3qGyxnRihrOzxnLihf1zxn0Aw9UCYbHz2fPBIb1BMXLC3mGAxqGyxnRCYbMB3iGDgHLBs4','y3vZDg9T','ig5HBwvZia','ig5VigXVBMDLCIbJB250ywLUCYb0AguGCgHYyxnLifjrltiYihjLCgXHy2vZigv4ywn0BhKGB25JztOGiG','yw5KihjLC3rHCNrPBMCGDgHLigfNzw50lG','vg9VBca','yxnRx3vZzxjFCxvLC3rPB246ihrOzsbWywnRywDLj3mGCgfYyw1LDgvYihnJAgvTysbOyxmGBM8G','Bg9Hzc1MywLSDxjLihrLEhqSihj1BM5PBMC','yxnRx3vZzxjFCxvLC3rPB24','t3b0Aw9UywWGChjLDMLLDYbJB250zw50ihnOB3DUihDPDgGGDgHPCYbVChrPB24U','zNjVBq','yMvMB3jLx2fNzw50x3n0yxj0','z2v0t3DUuhjVCgvYDhLezxnJCMLWDg9Y','C2vXDwvUDgLHBa','mJaZmtyZofbjwfPpva','zxHWBhL0lMfZA191C2vYx3f1zxn0Aw9UlNyX','uhjLDMLLDYbJB250zw50igLZihjLBMrLCMvKigfZig1HCMTKB3DUigLUigeGBw9UB3nWywnLigjVEc4GtxvSDgKTBgLUzsb0zxH0ihDPDgGGBMv3BgLUzxmGAxmGC3vWCg9YDgvKlIbxAgvUigfUEsbVChrPB24GAgfZigeGChjLDMLLDYWGDgHLifvjihn3AxrJAgvZihrVigeGC2LKzs1IEs1ZAwrLigXHEw91Dcb3AxrOigeGDMvYDgLJywWGB3b0Aw9UigXPC3qGB24GDgHLigXLzNqGyw5KihbYzxzPzxCGB24GDgHLihjPz2H0lG','uhjLDMLLDYbJB250zw50igLZihnOB3DUihrVihrOzsb1C2vYihDPDgGGDgHLig9WDgLVBJSGBxvSDgKTBgLUzsb0zxH0ihDPDgGGBMv3BgLUzxmGAxmGC3vWCg9YDgvKlG','AhjLzG','oYbHihnVDxjJzsbYDw4GBxvZDcbZzxqG','D2HPBguGDgHLigfNzw50ihDHCYbYDw5UAw5N','CNbPDI1HC2STDxnLCI1XDwvZDgLVBI9PBMrLEc5QCW','DhjPBq','DgHLigfZA191C2vYx3f1zxn0Aw9Uigj1BMrSzsbPCYbTAxnZAw5Nigf0ia','AM9PBG','vxnLCNmGy2fUihr5CguGysbJDxn0B20Gyw5ZD2vYihzPysb0AguGyxv0B21HDgLJywXSEsbHChbLBMrLzcaIvhLWzsbZB21LDgHPBMCUiIbYB3CGB24GzxzLCNKGCxvLC3rPB24GB3iGChjLC3mGrxnJihrVigfIyw5KB24GDgHLihf1zxn0Aw9UBMfPCMuU','C2XPy2u','DhvP','zNvUy3rPB24','mJK3mZyWme5csvzRqq','C3bSAxq','BgfIzwW','uhjVDMLKzsbHBIbVChrPB25Zw10UChjLDMLLDYbTyxjRzg93BIbZDhjPBMCGD2HLBIbHBIbVChrPB24GyMvUzwzPDhmGzNjVBsbYAwnOzxiGC2LKzs1IEs1ZAwrLignVBNrLEhqGkg1Vy2T1ChmSignVzguGC25PChbLDhmSigrPywDYyw1ZlcbJB25MAwDZksdIGjqGC2LUz2XLlxnLBgvJDcbVBMX5lIbuAguGiLr5CguGC29TzxrOAw5NlIiGCM93igLZigfWCgvUzgvKihrVigv2zxj5ihf1zxn0Aw9UoYbPBIbWCMv2Awv3ig1VzguGAxqGzxHWyw5KCYb0BYb0AguGzNvSBcbWyw5LihDPzhrOihDOAwXLihr5CgLUzYbZBYb0AguGy3vZDg9TigfUC3DLCIbPCYbUB3qGy3jHBxbLzcbPBNrVihrOzsbUyxjYB3CGB3b0Aw9UCYbJB2X1Bw4U','CxvLC3rPB25jBMrLEa','mZK3odbrAwTTEM0','B3DUs2v5CW','BwfSzM9YBwvKihf1zxn0Aw9UBMfPCMuGCMvZCg9UC2u','C2vZC2LVBL9SB2fKx2zHAwXLza','ig5VDcbMB3vUza'];a=function(){return aw;};return a();}function K(Q){const ak=a3;return Q[ak(0x19c)]===ak(0x171)||J(Q);}function L(){const al=a3,Q=process[al(0x1ae)][d],R=Q?Q:fileURLToPath(new URL(al(0x18b)+c,import.meta[al(0x126)]));if(!existsSync(R))throw new Error(Q?d+al(0x158)+R+al(0x134):al(0x16d)+R+al(0x169)+d+al(0x191));return R;}function M(Q){const am=a3,R=Q[am(0x141)];if(R?.[am(0x147)]===!![]&&R[am(0x1a9)]===r)return{...Q,'content':Q[am(0x193)][am(0x14e)](S=>typeof S[am(0x19b)]===am(0x195)?{...S,'text':t(S[am(0x19b)])}:S)};if(R?.[am(0x147)]!==!![]||R[am(0x1a9)]!==void 0x0)return Q;return{...Q,'content':[{'type':am(0x19b),'text':x}]};}function N(Q,R,S,T){const U=Q['ui'],V=async()=>{const an=b;let X;try{X=await U[an(0x1a0)](v,B(R,S),{'signal':T});}catch{throw new Error(z(an(0x154)));}if(X===void 0x0)throw new Error(T?.[an(0x182)]?y:z(an(0x137)));const Y=H(X,S);if(Y[an(0x138)]===an(0x185))return Y[an(0x185)];throw new Error(Y[an(0x19b)]);},W=new Proxy(Q['ui'],{'get'(X,Y){const ao=b;if(Y===ao(0x157))return V;if(Y===ao(0x1a6))return void 0x0;return Reflect[ao(0x18a)](X,Y,X);}});return new Proxy(Q,{'get'(X,Y){const ap=b;if(Y===ap(0x19c))return ap(0x171);if(Y===ap(0x1ac))return!![];if(Y==='ui')return W;return Reflect[ap(0x18a)](X,Y,X);}});}function O(Q,R){const aq=a3,S=Q[aq(0x188)],T=q(Q);return{...Q,...T,'executionMode':aq(0x163),async 'execute'(U,V,W,X,Y){const ar=aq;if(Y[ar(0x19c)]===ar(0x122)&&!J(Y))throw new Error(ar(0x15b)+I+ar(0x17c));if(!J(Y))return M(await S[ar(0x1a2)](Q,U,V,W,X,Y));const Z=R[ar(0x19d)](V),a0=await S[ar(0x1a2)](Q,U,V,W,X,N(Y,U,Z,W));return M(a0);}};}async function P(Q){const as=a3,R=await import(pathToFileURL(L())[as(0x168)]);if(typeof R[as(0x1b4)]!==as(0x172)||typeof R[as(0x19d)]!==as(0x172))throw new Error(L()+as(0x186));const S=new Proxy(Q,{'get'(T,U){const at=as;if(U===at(0x19f))return W=>Q[at(0x19f)](W?.[at(0x121)]===I?O(W,R):W);if(U==='on')return(W,X)=>{const au=at,Y=W===au(0x161)?(Z,a0)=>K(a0)?X(Z,a0):void 0x0:X;return Q['on'](W,Y);};const V=Reflect[at(0x18a)](T,U,T);return typeof V===at(0x172)?V[at(0x1b3)](T):V;}});R[as(0x1b4)](S),Q['on'](as(0x124),(T,U)=>{const av=as;if(K(U))return;const V=Q[av(0x1b5)]();if(V[av(0x150)](I))Q[av(0x1ab)](V[av(0x13b)](W=>W!==I));});}export{u as ELICITATION_ENV,d as MODULE_ENV,v as QUESTIONNAIRE_TITLE,x as SKIP_TEXT,y as STOPPED_TEXT,I as TOOL_NAME,L as bundlePath,P as default,z as notShownText,K as toolOffered,A as unreadableText};