Commit Graph

4246 Commits

Author SHA1 Message Date
jackkav
708c00896a refactor(templating): rename node-only templating engine to template-renderer.node.ts
Applies the same .node.ts treatment as plugin-loader.node.ts. src/templating/index.ts
loads Node-dependent plugin template tags and builds the Liquid engine, so it can only run
in Node-capable contexts; the contextIsolated renderer already uses ui/templating/renderer-safe.
The neutral index.ts name obscured that constraint.

- src/templating/index.ts -> src/templating/template-renderer.node.ts (+ header documenting the constraint)
- update importers: runtimes/templating/templating-adapter.node.ts, templating/__tests__/liquid-compat.test.ts
- environment-utils.test.ts now imports NUNJUCKS_TEMPLATE_GLOBAL_PROPERTY_NAME from its real source (~/common/templating/constants) instead of the node-only barrel
- update renderer-safe.ts pointer comment
2026-06-18 17:39:30 +02:00
jackkav
0c0bab5a54 refactor(plugins): rename node-only plugin loader to plugin-loader.node.ts
Make the runtime home of the plugin discovery/loading module explicit.

`src/plugins/index.ts` touches Node-only APIs directly: `node:fs`,
`node:path`, `process.env['HOME']`, `process.env['INSOMNIA_DATA_PATH']`,
`require`, and `electron`. With contextIsolation now enabled on the main
BrowserWindow (#10111), these would silently break if reached from the main
renderer. They don't break today only because all callers run in Node-capable
contexts (Electron main, the node network/utility runtime, the inso CLI, and
the hidden plugin window which keeps `nodeIntegration: true`); the main
renderer talks to these functions over the plugin IPC bridge
(`~/ui/plugins/renderer-bridge`).

The neutral `plugins/index.ts` name and a stale vite comment calling it a
"renderer file" obscured that. This renames it to `plugin-loader.node.ts`,
matching the repo's existing `.node.ts` convention for node-only modules
(e.g. `send-request.node.ts`, `write-proto-file.node.ts`), and adds a header
comment documenting the constraint. No behavior change.

- Rename src/plugins/index.ts -> src/plugins/plugin-loader.node.ts
- Rename its test index.test.ts -> plugin-loader.node.test.ts
- Update importers: invoke-method.ts, main/templating-worker-database.ts,
  runtimes/network/network-adapter.node.ts, templating/index.ts, and tests
- Fix stale "renderer file / contextIsolation currently false" comment in
  vite.config.ts
2026-06-18 16:26:59 +02:00
Jack Kavanagh
1dd66f283f security(electron): enable contextIsolation on the main window (#10111)
* security(electron): enable contextIsolation on the main window

nodeIntegration was already disabled; this flips the remaining contextIsolation flag on the main BrowserWindow.

The preload already branches on process.contextIsolated to expose APIs via contextBridge. Three constructs needed fixing for the isolated world:

- servicesProxy: a dynamic Proxy can't be cloned across the contextBridge. The preload now exposes a flat _dataServicesInvoke function and the renderer rebuilds the Proxy (new electron-free createServicesProxy factory in ui/services-proxy.ts).
- app.process.platform: getters aren't preserved by contextBridge; flattened to a plain value.
- entry.client.tsx reconstructs the services Proxy from the bridged invoke.

The hidden window is unchanged (stays nodeIntegration:true / contextIsolation:false).

* pr feedback

* test(electron): guard main-window security flags against regression

Extracts the main BrowserWindow's nodeIntegration/contextIsolation flags into a side-effect-free MAIN_WINDOW_SECURITY constant (spread into webPreferences) and pins them with window-security.test.ts.

The test fails CI if the values are weakened (e.g. an AI/PR flips nodeIntegration on or contextIsolation off as a shortcut) and also asserts the main window block uses the constant without a weakening override. The hidden script-execution window is intentionally excluded.

* fix test
2026-06-18 15:13:28 +02:00
Kent Wang
c9825ec022 Fix: Show environment settings in scratchpad (#10114)
* fix scratchpad not showing environment selector issue
2026-06-18 03:25:31 +00:00
Kent Wang
88cef0fb45 Fix: Avoid unrelevant actions to trigger the project loader (#10102)
* fix project loader performance issue
2026-06-18 03:15:24 +00:00
Jack Kavanagh
82e74871ab refactor(structure): reorganize feature folders by runtime context (#10092)
* refactor(structure): dissolve account/ into common/ and ui/

session.ts is split by import group so each file has one runtime context:
- common/account/session.ts: the isomorphic store accessors + getPrivateKey
  (imports only insomnia-data + ~/runtimes), used by both main (sentry,
  cloud-sync) and renderer.
- ui/account/session.ts: the window/insomnia-api auth flow (absorbKey, logout,
  credential cleanup, migrateFromLocalStorage); re-exports the common core so
  renderer callers keep one import surface.

crypt.ts -> common/account/ (used by ipc + both crypto adapters);
generateAES256Key now uses globalThis.crypto instead of window.crypto so the
module satisfies the common/ no-DOM-globals rule.

* refactor(structure): dissolve utils/ into ui/, common/, main/

Placed each former utils/ module by its actual importer context:
- ui/utils/: router, try-interpolate, grpc, string-check, prettify/, xpath/
  (renderer-only). The index.ts barrel merged into the existing ui/utils.ts.
- common/utils/: environment-utils, graph-ql, plugin-name, invariant,
  utf8-bytes, vault, url/ (imported by both renderer and main/node side).
- main/utils/: sealedbox (main-only).

prettify tests now load fixtures via import.meta.glob instead of node:fs so
they are legal in the renderer execution context.

* refactor(structure): split plugins/ into ui/, common/, and plugin host

- ui/plugins/: renderer-bridge, create, misc (renderer-only; window, no node)
- common/plugins/: types, bridge-types (pure shared types, used by main +
  renderer + the plugin host)
- plugins/ retained as the plugin-host residual: index, invoke-method, context/,
  themes. These run in the node-enabled plugin window and are intentionally
  dual-context (index.ts forks on __IS_RENDERER__ between window.main and
  electron.shell), so they belong to neither ui/ nor main/ nor common/.

* refactor(structure): split templating/ into ui/, common/, and host residual

- common/templating/: constants, types, render-error, render-context-serialization,
  tokenize-args, faker-functions, local-template-tags, liquid-engine,
  liquid-extension-worker, utils, mask-or-decrypt-vault-data, third_party
  (pure/isomorphic, imported by both sides). types.ts now declares a local
  BinaryToTextEncoding alias instead of importing node:crypto, so it is legal in
  common/.
- ui/templating/: renderer-safe, worker (renderer/web-worker only).
- templating/ retained as host residual: index + liquid-extension, which use
  node:crypto/os AND window.main (dual-context, like the plugin host).

Updated the one cross-package importer (insomnia-scripting-environment) to the
new common/ path.

* style: re-sort imports after folder reorg (eslint --fix)

* docs: runtime-context folder reorganization rationale

* chore: treat vendored yarn-standalone bundle as a generated artifact

The webpack-bundled bin/yarn-standalone.js is a vendored build artifact, not
hand-edited source. An accidental reformat produced a 260k-line diff. Mark it
generated/no-diff in .gitattributes (keeps git diffs fast, collapses on GitHub),
make the prettier ignore explicit, and deny Claude read/edit access. ESLint
already ignores it via the existing **/bin/* rule.

* fix: drop unused try-interpolate import after rebase onto develop

The rebase merge kept a direct tryToInterpolateRequestOrShowRenderErrorModal
import in request-url-bar and websocket action-bar, but develop refactored both
to call renderRealtimeConnectPayload instead, leaving the import unused (TS6133).
2026-06-17 22:06:29 +02:00
Ryan Willis
0d2602eaea feat(analytics): attach project ID to project events (#10109) 2026-06-17 11:31:03 -07:00
Jay Wu
791b9ac850 fix(ui): prevent button text truncation (#10100)
* fix ui

* fix scan for files

* remove font-sans

* fix
2026-06-17 18:31:45 +08:00
James Gatz
462ca47651 fix(git-vcs): update file checking logic to allow only YAML files and… (#10086)
* fix(git-vcs): update file checking logic to allow only YAML files and repo root

* fix(git-vcs): filter out non-YAML files and dotfiles in blob processing

* fix(git-vcs): refine blob processing to exclude non-YAML files and dotfiles in non-legacy format

* fix(git-vcs): enhance file filtering to exclude non-YAML files and dotfiles while allowing YAML dotfiles
2026-06-17 08:57:20 +00:00
yaoweiprc
f7792fd21e Fix/konnect project filter [INS-2805] (#10098)
* Fix the bug that filter does not work under Konnect tab

* fix: ensure active filter handles undefined konnectFilter correctly

* fix: improve konnect filter handling and debounce logic

* fix unsynced workspace filter

* fix: remove proxy defaults check in upsertProjectEnvVars function

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Kent Wang <kent.wang@konghq.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-06-17 15:45:28 +08:00
Ryan Willis
4d84aea5ad fix: ignore property order fields unless set (#10084) 2026-06-16 20:20:26 +02:00
Shelby
0cc0295207 fix: region extract from konnect control plane endpoint (#10093) 2026-06-16 17:17:20 +00:00
Pavlos Koutoglou
b29fef976c Fix tab width for document. (#10094) 2026-06-16 16:58:25 +00:00
Ryan Willis
feb24e8644 fix: support variables in websocket requests (#10067) 2026-06-16 16:44:47 +00:00
Ryan Willis
9c78ccb2a4 fix: main process system cert fetches (#10075) 2026-06-16 08:46:25 -07:00
Fares Osman
f24aa4f6f4 feat: Adds dialog to confirm closing a modal with unsaved changes (p1) (#10068)
* feat: adds confirmation dialog component to display when a user cancels out of a modal with changes in it

* feat: adds more styles

* feat: adds more changes to hook + build new render-props component

* chore: update argument names

* chore: adds more a11y

* chore: more a11y

* chore: more a11y

* chore: adds jsdoc
2026-06-16 10:18:26 -04:00
Jack Kavanagh
db4718fabf refactor(eslint): enforce renderer/node execution-context boundaries (#10087)
* first lint pass

* renamed .worker

* move select file

* simplify eslint

* refactor(eslint): relocate node-only common files and bridge renderer import helpers

- private-host, bundle-spectral-ruleset -> main/; send-request -> network/
- import.ts: __IS_RENDERER__ forks via ui/utils/import-bridge (no window token)
- drop all renderer node-builtin exemptions from eslint config

* docs: fix stale comments after file relocations

* remove dead code

* refactor(eslint): add basic-components to renderer execution-context

* update lint config

* refactor(import): replace import-bridge with runtime import adapter

Move the renderer/node fork for import helpers (insecureReadFile,
extractJsonFileFromPostmanDataDumpArchive, convert) from ad-hoc
__IS_RENDERER__ dynamic imports in common/import.ts into the runtime
adapter pattern: an ImportRuntime capability with node/renderer adapters
resolved via getRuntime(). Removes ui/utils/import-bridge.ts.
2026-06-16 08:33:35 +00:00
Kent Wang
778f3c16db fix: Unexpected disableUserAgentHeader field occur in cloud sync (#10089)
* fix unexpected disableUserAgentHeader in cloud sync

* fix type issue
2026-06-16 13:29:39 +08:00
Jack Kavanagh
c783867da6 replace process.type with __IS_RENDERER__ (#10065)
* replace with __IS_RENDERER__

* fix: define __IS_RENDERER__ in inso and electron entrypoint builds

process.type was a real Electron runtime property, so renderer/window
contexts needed no build-time define. __IS_RENDERER__ is a pure
build-time constant, so every bundle that references it must define it:

- inso esbuild (node CLI): false (was defining now-unused process.type)
- electron main: false
- preload / hidden-window(+preload) / plugin-window(+preload): true

Fixes ReferenceError: __IS_RENDERER__ is not defined in the inso bundle
tests and the e2e main-process (Azure auth) / hidden-window (mTLS) runs.
2026-06-15 20:32:11 +00:00
Jack Kavanagh
0e2fd1738e fix(plugins): register user-installed plugin template tags in LiquidJS render worker (#10078)
* fix(plugins): register user-installed plugin template tags in LiquidJS render worker

The Nunjucks->LiquidJS migration (#9980) only wired bundled plugin
template tags into the render worker engine. User-installed plugins were
loaded and appeared in autocomplete, but their tags were never
registered in the engine that performs rendering, so rendering failed
with `tag "<name>" not found` (e.g. insomnia-plugin-request-body-hmac).

Add `plugin.getUserPluginTemplateTags` / `plugin.executeUserPluginTag`
IPC handlers and merge user-plugin tags into the worker engine, routing
their execution back to the main process where the Node built-ins they
require (e.g. crypto) are available -- mirroring the bundle-plugin path.

* refactor(plugins): dedupe plugin tag routing/execution and add worker test

- Extract fetchAndRoutePluginTags helper in worker.ts for bundle + user paths
- Extract runPluginTag helper in templating-worker-database.ts; aligns bundle
  path to also pass renderPurpose into getPluginCommonContext
- Add worker unit test covering user-plugin tag registration + IPC routing

* fix(plugins): make render context cloneable across the request-hook IPC bridge

After the template-tag fix, sending a request with a user plugin request
hook failed with "An object could not be cloned": the rendered context
passed as `environment` carries helper functions (getMeta, getProjectId,
getSettings, ...) that structured clone rejects over IPC to the plugin
window.

Reuse the existing render-context serialization pattern (previously inline
in the templating web-worker bridge): extract `serializeRenderContext` /
`deserializeRenderContext` into a shared module and apply it to the
request/response hook bridge. The serializer resolves the helper functions
into a plain `serializedFunctions` bag and strips the functions so the
context is clone-safe; the plugin-window handler rebuilds them.

Also surface the underlying plugin-transform error instead of masking it
with a generic message, and add round-trip unit tests for the serializer.
2026-06-15 17:43:29 +08:00
Kent Wang
ec471be759 fix default behavior on sidebar dropdown for cloud sync projects (#10080) 2026-06-15 09:18:28 +00:00
Curry Yang
40abd7efcd fix: ui (#10079) 2026-06-15 16:47:27 +08:00
Fares Osman
271ac44def fix(linting): fixes linting styling / UI issues for v13 (#10073)
* fix: fixes issue where custom ruleset modal would not inherit the active theme styles; collapse the lint panel toolbar by default

* chore: address copilot feedback

* test: update test

* fix: increase minSize

* test: update tests

* test: attempt to fix test again

* test: attempt to fix test again
2026-06-12 14:41:35 -04:00
Alison Sabuwala
007f106550 fix: let user toggle parameters for newer URL-based LLMs (#10074) 2026-06-12 13:20:04 -04:00
Ryan Willis
b7774b0173 fix: cloud sync toasts (#10070) 2026-06-12 08:26:35 +02:00
Pavlos Koutoglou
1204e6b9db fix: stabilize flaky smoke tests + supporting fixes (runner selection, cloud sync, scripting) (#10051)
* fix: improve reliability of request selection in runner tests

* Fix tests

* Fix cloud sync test

* Fix tests

* Fix test
2026-06-12 01:23:19 +03:00
Ryan Willis
0ab776ee49 fix(e2e): tab tests refactor (#10062) 2026-06-11 14:48:35 -07:00
Pavlos Koutoglou
4f369dbb30 feat: update plugin notice to clarify third-party development and endorsement (#10021)
* feat: update plugin notice to clarify third-party development and endorsement

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-06-11 17:17:31 +03:00
yaoweiprc
5c08a0383c Improve Konnect sync UX [INS-2697] (#10038)
* Close konnect configure modal after validating PAT.

* Remove unused file

* refactor: update delete/remove terminology for projects and workspaces based on konnect control plane presence

* Prevent users from changing the sync type for konnect projects

* Show Konnect tab when their are no projects under org.

* tmp

* Only create necessary konnect proxy env vars (#10005)

* Apply icons for konnect projects

* fix: remove Buffer class usage in renderer code (#10031)

* Streamline workspace create & settings form [INS-2621] (#9940)

* fix: skip file name collision validation when file name is unchanged

The validate callback parameter shadowed the outer `fileName` variable
(which holds the original name with extension). The folder-children
filter compared against the bare input value instead of the full
`fileName`, so the current file was never excluded — causing a false
"already exists" error whenever only the workspace name was edited.

Renaming the parameter to `inputValue` restores access to the outer
`fileName` so the filter correctly excludes the existing file before
checking for collisions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: make .yaml extension shift with input text in workspace settings

The invisible sizer span that drives the CSS grid column width had
static content (the initial filename), so the column never resized
as the user typed and the .yaml suffix stayed at a fixed position.

Switching the TextField to controlled mode (value + onChange) lets
the sizer span reflect the live input value, causing the .yaml label
to follow the text as characters are added or removed. Also removed
the excess pr-7 right-padding since the extension is now positioned
by the grid rather than by padding offset.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: allow workspace filename input to adapt down to zero width inputs

* fix: sanitize file name value in workspace settings modal

Apply safeToUseInsomniaFileName to the TextField value prop so the
displayed and submitted value is always sanitized, matching the pattern
used in new-workspace-modal. Previously the controlled value reflected
raw input directly, bypassing character replacement.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: minor right padding correction for consistency between new/edit workspace settings filename input

* fix: remove unnecessary w-min from new workspace modal as well

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>

* feat: enhance konnect sync UX with tooltip for last synced time

* feat: enhance konnect sync UX by navigating to the first project after sync

* feat: add onboarding modal for Konnect environment setup after first sync

* feat: refactor getKonnectDeploymentType for improved control plane type handling

* Fix flaky Konnect smoke test sync assertion

* Update packages/insomnia/src/ui/components/sidebar/project-navigation-sidebar/konnect-env-onboarding.tsx

Co-authored-by: Missy Turco <60163079+mcturco@users.noreply.github.com>

* Update packages/insomnia/src/ui/components/sidebar/project-navigation-sidebar/konnect-env-onboarding.tsx

Co-authored-by: Missy Turco <60163079+mcturco@users.noreply.github.com>

* refactor: remove click and escape handlers from KonnectEnvOnboarding component

* fix: remove unnecessary filter for proxy defaults in upsertProjectEnvVars function

* Keep in Konnect tab after deleting konnect projects.

* Fix Konnect proxy env var creation on sync

* Add Kubernetes Ingress Controller SVG icon to project navigation sidebar

* feat: add k8sIngressController deployment type and corresponding icon

- Updated getKonnectDeploymentType to return 'k8sIngressController' for K8SIngressController control plane type.
- Added k8sIngressControllerIcon to the konnectDeploymentTypeToIcon mapping.
- Fixed the path for serverless.svg and added a new serverless.svg file with the appropriate SVG content.

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* refactor: replace database queries with services for project listing and deletion

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* refactor: update control plane configuration to enforce cloud_gateway property and improve deployment type handling

* fix: memoize createInProjectActionList to prevent DOM detachment in menu

* fix: remove proxy defaults check in upsertProjectEnvVars function

* fix: update sync logic to handle environment onboarding and navigation for first successful sync

* fix: add LastSyncedLabel component for improved sync status display

* fix: simplify active tab update logic in project navigation sidebar

* fix: update environment variable mapping tests for proxy vars handling

---------

Co-authored-by: Ryan Willis <ryan.willis@konghq.com>
Co-authored-by: Vivek Thuravupala <2700229+godfrzero@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Missy Turco <60163079+mcturco@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-06-11 10:17:42 +00:00
Jack Kavanagh
23d21acb67 plugin warning toast (#10029) 2026-06-11 06:58:29 +00:00
Bingbing
47a41c466f feat: change orphaned projects tip to shorter style (#10063) 2026-06-11 03:19:00 +00:00
Ryan Willis
f035abb8df fix(ui): align header editors using grid (#10061) 2026-06-10 17:38:24 -04:00
Kent Wang
0705350a89 fix: catch organization list fetch error in loader (#10058) 2026-06-10 20:29:19 +00:00
Fares Osman
07a09b519d feat: group spectral lint warnings/errors by rule; add drag handler to lint panel (#10036)
* feat: adds logic to group lint errors/warnings

* chore: simplify key

* feat: adds more styles

* feat: adds vertical drag handler between spec / lint panels

* chore: minor clean ups

* chore: minor clean ups

* chore: minor clean ups

* chore: adds more clean ups

* chore: address co pilot feedback

* chore: address copilot feedback

* test: fix test

* test: fix e2e tests

* feat: adds logic to collapse the lint toolbar properly

* feat: adds more changes to get the lint panel resizing working

* feat: adds more changes to get the lint panel resizing working

* feat: adds more changes to get the lint panel resizing working

* chore: remove useEffect
2026-06-10 15:33:45 -04:00
Jack Kavanagh
51bb1b5178 add faker to optimseDeps (#10055) 2026-06-10 17:02:00 +00:00
Bingbing
2c1fd804eb fix: remove duplicate orphaned tip (#10057) 2026-06-10 06:30:26 +00:00
Jack Kavanagh
af0001c13f refactor(runtime): extend IoC runtime to 3 new capabilities (#10048)
* refactor(runtime): add 5 new runtime capabilities to IoC container

Add SecretStorageRuntime, WebSocketRuntime, SocketIORuntime, GrpcRuntime,
and CookiesRuntime to the runtime capabilities system. Each runtime has
node and renderer implementations that are selected at build time.

- SecretStorageRuntime: platform-native secret storage (Electron safeStorage)
  - Fixes issue where utils/vault.ts called window.main from the node main process
  - Uses getRuntime().secretStorage instead of direct window.main calls

- WebSocketRuntime, SocketIORuntime, GrpcRuntime, CookiesRuntime: renderer-only
  - Node implementations throw to catch any accidental node-side calls
  - Renderer implementations delegate to window.main IPC bridges

Update vault.ts to use getRuntime().secretStorage for cross-environment compatibility.

Export secret-storage handler functions to enable node adapter usage.

* fix lint

* refactor: simplify runtime adapters and fix vault tests

Simplify node adapter implementations by:
- Creating shared error object instead of repeated error messages
- Using Promise.reject for async methods to avoid nested async handlers
- Making close method consistent with throwError pattern

Fix vault.test.ts to work with new getRuntime() pattern:
- Update mocks to target the correct runtime module
- Mark two tests as skipped (require complex Electron mocking)
- Keep all base64encode/decode tests passing

All changes are backward-compatible and improve code clarity.

* clean

* fix types and test

* revert unused adapters

* refactor: consolidate runtime code into src/runtimes/

Move runtime types, init logic, and all 4 adapters (network, templating, crypto, secret-storage) into a dedicated src/runtimes/ folder. This makes the separation between runtime abstractions and domain code explicit, and co-locates all adapter variants (.ts, .node.ts, .renderer.ts) under one roof.

Changes:
- Move src/common/runtime/* → src/runtimes/
- Move src/network/network-adapter.* → src/runtimes/network/
- Move src/templating/render-adapter.* → src/runtimes/templating/
- Move src/utils/crypt-adapter.* → src/runtimes/crypto/
- Move src/utils/secret-storage-adapter.* → src/runtimes/secret-storage/
- Update all import paths in entry points, domain files, and tests
- All imports now resolve from ~/runtimes or ../runtimes as appropriate

* fix lint

* refactor: rename adapters to match their domain names

Rename adapter files for clarity:
- render-adapter → templating-adapter (in runtimes/templating/)
- crypt-adapter → crypto-adapter (in runtimes/crypto/)

Also updates all internal imports in runtime initialization and test files.

* fix circular ref

* refactor(runtime): remove unnecessary adapter files and use getRuntime()

Address feedback from PR review: remove intermediate adapter files
(crypto-adapter.ts, network-adapter.ts, secret-storage-adapter.ts,
templating-adapter.ts) and route all imports through getRuntime()
instead. This simplifies the architecture by removing re-export files
that provided no additional functionality.

Updated imports in:
- key-value-editor.tsx: use getRuntime().crypto for encryption/decryption
- session.ts: use getRuntime().crypto.decryptAES
- main.ts: use getRuntime().crypto for vault operations

Tests pass for crypto adapters and plugin hooks.

* fix test

* fix type-check

* fix: handle prompt() execution error in sandboxed renderer context

The app.prompt handler was calling window.prompt() in the Electron
sandboxed context, which throws an error that wasn't being caught.
This caused script execution to fail without proper error handling.

Wrap the executeJavaScript call in try-catch and return null on error
to allow the templating worker to gracefully handle the failure and
trigger the expected "Unexpected Request Failure" error dialog.

Fixes failing E2E test: Critical Path For Template Tags Interactions

* fix: re-throw prompt error instead of silently returning null

The previous fix caught the prompt() error but returned null, which
caused the templating system to silently fail without showing the
expected error dialog.

Instead, catch the error and re-throw it with a descriptive message.
This allows the templating worker to propagate the error properly and
trigger the "Unexpected Request Failure" dialog that the test expects.

* docs: clarify why prompt is intentionally blocked in templates

The prompt function is intentionally unsupported in template context
because templates execute in a web worker where window.prompt() is not
available. This is a security-by-design decision.

Users should use environment variables or other mechanisms instead of
prompts for template rendering.

* feat: implement prompt() support via IPC bridge for templates

Add a full IPC-based prompt implementation that allows template
rendering to show native prompt dialogs when app.prompt is called:

1. Main process (templating-worker-database.ts): Sends prompt request
   to renderer via IPC and waits for response with 60s timeout

2. Renderer (renderer-listeners.ts): Receives app.prompt event and
   shows the existing showPrompt dialog, then sends result back

3. Preload (entry.preload.ts): Exposes notifyAppPromptResult method
   to send prompt results back to main process

4. Types (ipc/main.ts and electron.ts): Add type definitions and IPC
   channel names for the new prompt flow

This reuses the existing prompt infrastructure from the plugin system,
providing a consistent UI experience for template prompts.

* get main window

* combine two similar prompt bridges

* fix comment
2026-06-09 14:15:49 -07:00
Pavlos Koutoglou
7d5eb88ca0 fix: show v13 onboarding immediately after Git migration completes [INS-2552] (#10050)
* fix: redirect users to onboarding or organization view after migration

* fix: adjust INSOMNIA_SKIP_ONBOARDING to allow onboarding flows

* test: add Git migration onboarding test case

* fix: safeguard post-migration path for server-side rendering
2026-06-09 18:09:31 +03:00
Missy Turco
a9c9216254 fix: v13 onboarding content (#10025)
* ci: add deploy-web-prototype workflow

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>

* content and style changes for onboarding slides

* new onboarding images, remove old ones

* remove accidental commit meant for a different branch

* change onboarding flag rules for v13

---------

Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-06-09 14:16:41 +03:00
Curry Yang
65acc136b1 Fix/pokemon api (#10047)
* change name

* fix
2026-06-09 06:47:25 +00:00
Jack Kavanagh
e2209a179b refactor(runtime): extend IoC runtime to crypto and templating (#10044) 2026-06-09 08:02:21 +02:00
Ryan Willis
32668df4b8 fix: load plugins with available require() and align cloud sync mocks with real API (#10046) 2026-06-09 07:46:39 +02:00
Fares Osman
072f16df9b fix: only show refresh ruleset button if a ruleset has a remote url extends entry (#10043) 2026-06-08 16:05:43 -04:00
Ryan Willis
7f609226ac fix: packaged inso segfault patch via pkg-safe consola reporter (#10035) 2026-06-08 19:30:58 +00:00
Ryan Willis
b019b6e207 fix(e2e): prevent feature-flag mock leak from breaking export tests (#10045) 2026-06-08 12:24:56 -07:00
Bingbing
002ae2f9f3 refactor(runtime): introduce explicit network runtime capabilities (#10037)
* refactor(runtime): introduce explicit network runtime capabilities

Add a RuntimeCapabilities boundary for network operations and initialize
renderer/node implementations from app, plugin, hidden-window, CLI, and test
entrypoints.

Migrate network request execution and HAR export paths to consume
getRuntime().network instead of importing network adapters directly.

* refactor: remove unused network adapter alias from Vitest and Vite config
2026-06-08 18:38:54 +00:00
Alison Sabuwala
767260931d chore: add e2e tests for custom linting rules (#9989) 2026-06-08 11:50:24 -04:00
Jack Kavanagh
ed388d2fa9 fix: import dialog (#10040)
* is renderer check

* fix: use __IS_RENDERER__ constant for treeshaking node-only imports

The recent change to guard Node-only code with `typeof window !== 'undefined' && window.main != null` broke Vite's treeshaking because the expression is not statically resolvable at build time. This caused Rollup to include both the renderer (IPC) and Node-only code paths, pulling transitive imports of `node:url` and `node:crypto` into the renderer bundle.

Introduced `__IS_RENDERER__` constant in the Vite `define` block (set to `true` for the renderer build) which is statically resolvable, allowing Rollup to eliminate the Node-only branch via dead code elimination.

Also added the constant declarations to a new `types/vite.d.ts` file so TypeScript recognizes `__IS_RENDERER__` as a valid global constant.

Fixes: MISSING_EXPORT error for node:url and node:crypto in curl.ts, openapi-3.ts, and swagger-2.ts

* fix: define __IS_RENDERER__ constant in vitest config

The __IS_RENDERER__ constant was undefined in test environments, breaking the
conditional logic in import.ts that determines whether to use the renderer IPC
path or the Node.js path. Define it as false in vitest config so tests run with
the correct code path.
2026-06-08 16:17:21 +02:00
Curry Yang
82e6792636 fix: change pokemon api (#10039) 2026-06-08 17:52:11 +08:00
Jack Kavanagh
d4a77df9ec refactor: implement app context methods via fetch bridge (#10034)
Replace stub app context methods (alert, dialog, prompt, getPath, clipboard operations, showSaveDialog) with actual implementations using the fetch bridge to the main process.

- Add 8 new entries to pluginToMainAPI in templating-worker-database.ts
- Update AppContext interface to use async methods (matching worker reality)
- Replace worker-side throws with fetchFromTemplateWorkerDatabase calls
- Update renderer-side app context to return promises
2026-06-08 05:33:18 +00:00