@harborclient/sdk 1.5.4 → 1.6.1
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 +14 -0
- package/dist/components/Breadcrumb/CrumbSegment.d.ts.map +1 -1
- package/dist/components/Breadcrumb/CrumbSegment.js +4 -2
- package/dist/components/Breadcrumb/types.d.ts +10 -1
- package/dist/components/Breadcrumb/types.d.ts.map +1 -1
- package/dist/components/MethodSelect/MethodSelectMenu.d.ts +34 -0
- package/dist/components/MethodSelect/MethodSelectMenu.d.ts.map +1 -0
- package/dist/components/MethodSelect/MethodSelectMenu.js +150 -0
- package/dist/components/MethodSelect/MethodSelectOption.d.ts +36 -0
- package/dist/components/MethodSelect/MethodSelectOption.d.ts.map +1 -0
- package/dist/components/MethodSelect/MethodSelectOption.js +15 -0
- package/dist/components/MethodSelect/MethodSelectSeparator.d.ts +10 -0
- package/dist/components/MethodSelect/MethodSelectSeparator.d.ts.map +1 -0
- package/dist/components/MethodSelect/MethodSelectSeparator.js +11 -0
- package/dist/components/MethodSelect/index.d.ts +21 -7
- package/dist/components/MethodSelect/index.d.ts.map +1 -1
- package/dist/components/MethodSelect/index.js +47 -6
- package/dist/components/SegmentedTabs/index.d.ts +7 -2
- package/dist/components/SegmentedTabs/index.d.ts.map +1 -1
- package/dist/components/SegmentedTabs/index.js +7 -2
- package/dist/components/SettingIdLabel/index.d.ts +8 -1
- package/dist/components/SettingIdLabel/index.d.ts.map +1 -1
- package/dist/components/SettingIdLabel/index.js +5 -2
- package/dist/components/SidebarItem/sidebarItemClasses.d.ts.map +1 -1
- package/dist/components/SidebarItem/sidebarItemClasses.js +2 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/runtime/createBridgedPluginContext.js +201 -5
- package/dist/runtime/viewHost.js +4 -0
- package/dist/snippets.d.ts +30 -19
- package/dist/types.d.ts +284 -11
- package/dist/types.d.ts.map +1 -1
- package/dist/ui/tokens.d.ts +1 -0
- package/dist/ui/tokens.d.ts.map +1 -1
- package/dist/ui/tokens.js +4 -2
- package/package.json +4 -2
package/dist/types.d.ts
CHANGED
|
@@ -3,6 +3,12 @@ import type * as React from 'react';
|
|
|
3
3
|
* HTTP method supported in the request editor.
|
|
4
4
|
*/
|
|
5
5
|
export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'OPTIONS';
|
|
6
|
+
/**
|
|
7
|
+
* Transport protocol for a saved request or editor draft.
|
|
8
|
+
*
|
|
9
|
+
* HTTP uses the buffered send path. SSE opens a long-lived event stream.
|
|
10
|
+
*/
|
|
11
|
+
export type RequestProtocol = 'http' | 'sse';
|
|
6
12
|
/**
|
|
7
13
|
* A collection-scoped variable for use in request URLs via {{key}} syntax.
|
|
8
14
|
*/
|
|
@@ -306,6 +312,12 @@ export interface RequestDraft {
|
|
|
306
312
|
* HTTP method (for example `GET`, `POST`).
|
|
307
313
|
*/
|
|
308
314
|
method: string;
|
|
315
|
+
/**
|
|
316
|
+
* Transport protocol for the active request (`http` or `sse`).
|
|
317
|
+
*
|
|
318
|
+
* When `sse`, the editor uses the SSE session path instead of a buffered send.
|
|
319
|
+
*/
|
|
320
|
+
protocol?: RequestProtocol;
|
|
309
321
|
/**
|
|
310
322
|
* Request URL including scheme, host, path, and query string.
|
|
311
323
|
*/
|
|
@@ -956,12 +968,12 @@ export interface StatusBarItemContribution {
|
|
|
956
968
|
* - `resize-handle` — resizable panel grip (and high-contrast chrome accents)
|
|
957
969
|
* - `variable-token` — `{{variable}}` syntax highlight in editors
|
|
958
970
|
* - `danger`, `danger-light`, `warning`, `success`, `info` — status colors
|
|
959
|
-
* - `method-get`, `method-post`, `method-put`, `method-patch`, `method-delete`, `method-head`, `method-options` — HTTP method badge colors
|
|
971
|
+
* - `method-get`, `method-post`, `method-put`, `method-patch`, `method-delete`, `method-head`, `method-options`, `method-sse` — HTTP method / SSE badge colors
|
|
960
972
|
* - `scrollbar-track`, `scrollbar-thumb`, `scrollbar-thumb-hover`, `scrollbar-thumb-active` — scrollbar track and thumb colors
|
|
961
973
|
* - `script-stage-before-all`, `script-stage-before-each`, `script-stage-main`, `script-stage-after-each`, `script-stage-after-all` — script row stage accent colors
|
|
962
974
|
* - `terminal` — footer terminal background
|
|
963
975
|
*/
|
|
964
|
-
export type ThemeColorToken = 'surface' | 'header' | 'page-header' | 'page-header-text' | 'page-header-muted' | 'sidebar' | 'sidebar-toolbar' | 'sidebar-rail' | 'sidebar-rail-active' | 'sidebar-rail-text' | 'sidebar-rail-separator' | 'sidebar-section' | 'sidebar-section-text' | 'footer' | 'footer-text' | 'footer-muted' | 'footer-icon-active' | 'toolbar-action-active' | 'breadcrumb-background' | 'breadcrumb-segment' | 'breadcrumb-current' | 'git-staged' | 'git-uncommitted' | 'git-unstaged' | 'git-untracked' | 'control' | 'field' | 'separator' | 'text' | 'text-secondary' | 'muted' | 'accent' | 'selection' | 'doc-markdown' | 'tab-unsaved' | 'tab-underline' | 'resize-separator' | 'resize-handle' | 'variable-token' | 'danger' | 'danger-light' | 'warning' | 'success' | 'info' | 'method-get' | 'method-post' | 'method-put' | 'method-patch' | 'method-delete' | 'method-head' | 'method-options' | 'scrollbar-track' | 'scrollbar-thumb' | 'scrollbar-thumb-hover' | 'scrollbar-thumb-active' | 'script-stage-before-all' | 'script-stage-before-each' | 'script-stage-main' | 'script-stage-after-each' | 'script-stage-after-all' | 'terminal';
|
|
976
|
+
export type ThemeColorToken = 'surface' | 'header' | 'page-header' | 'page-header-text' | 'page-header-muted' | 'sidebar' | 'sidebar-toolbar' | 'sidebar-rail' | 'sidebar-rail-active' | 'sidebar-rail-text' | 'sidebar-rail-separator' | 'sidebar-section' | 'sidebar-section-text' | 'footer' | 'footer-text' | 'footer-muted' | 'footer-icon-active' | 'toolbar-action-active' | 'breadcrumb-background' | 'breadcrumb-segment' | 'breadcrumb-current' | 'git-staged' | 'git-uncommitted' | 'git-unstaged' | 'git-untracked' | 'control' | 'field' | 'separator' | 'text' | 'text-secondary' | 'muted' | 'accent' | 'selection' | 'doc-markdown' | 'tab-unsaved' | 'tab-underline' | 'resize-separator' | 'resize-handle' | 'variable-token' | 'danger' | 'danger-light' | 'warning' | 'success' | 'info' | 'method-get' | 'method-post' | 'method-put' | 'method-patch' | 'method-delete' | 'method-head' | 'method-options' | 'method-sse' | 'scrollbar-track' | 'scrollbar-thumb' | 'scrollbar-thumb-hover' | 'scrollbar-thumb-active' | 'script-stage-before-all' | 'script-stage-before-each' | 'script-stage-main' | 'script-stage-after-each' | 'script-stage-after-all' | 'terminal';
|
|
965
977
|
/**
|
|
966
978
|
* HarborClient UI metric token ids (typography and geometry).
|
|
967
979
|
*
|
|
@@ -2894,7 +2906,166 @@ export interface PluginLivePageHandle {
|
|
|
2894
2906
|
}>;
|
|
2895
2907
|
}
|
|
2896
2908
|
/**
|
|
2897
|
-
*
|
|
2909
|
+
* Append-only static instruction bag on {@link PluginAi.instructions}.
|
|
2910
|
+
*
|
|
2911
|
+
* Fragments are merged into the agent system prompt while registered. Plugins
|
|
2912
|
+
* cannot rewrite Harbor's base system prompt.
|
|
2913
|
+
*/
|
|
2914
|
+
export interface PluginAiInstructions {
|
|
2915
|
+
/**
|
|
2916
|
+
* Appends a fragment merged into the agent system prompt while registered.
|
|
2917
|
+
*
|
|
2918
|
+
* @param text - Instruction text (whitespace-only strings are ignored).
|
|
2919
|
+
* @returns A {@link Disposable} that removes the fragment when disposed.
|
|
2920
|
+
*/
|
|
2921
|
+
add(text: string): Disposable;
|
|
2922
|
+
/**
|
|
2923
|
+
* This plugin's currently registered instruction fragments (read-only).
|
|
2924
|
+
*/
|
|
2925
|
+
readonly list: readonly string[];
|
|
2926
|
+
}
|
|
2927
|
+
/**
|
|
2928
|
+
* One conversation message visible to {@link PluginAiBeforeTurnContext} handlers.
|
|
2929
|
+
*/
|
|
2930
|
+
export interface PluginAiTurnMessage {
|
|
2931
|
+
/**
|
|
2932
|
+
* OpenAI-compatible message role.
|
|
2933
|
+
*/
|
|
2934
|
+
role: 'system' | 'user' | 'assistant' | 'tool';
|
|
2935
|
+
/**
|
|
2936
|
+
* Message text content.
|
|
2937
|
+
*/
|
|
2938
|
+
content?: string | null;
|
|
2939
|
+
}
|
|
2940
|
+
/**
|
|
2941
|
+
* Turn-scoped ephemeral instruction bag on {@link PluginAiBeforeTurnContext}.
|
|
2942
|
+
*/
|
|
2943
|
+
export interface PluginAiTurnInstructions {
|
|
2944
|
+
/**
|
|
2945
|
+
* Appends a fragment for this turn only (ephemeral system message).
|
|
2946
|
+
*
|
|
2947
|
+
* @param text - Instruction text.
|
|
2948
|
+
*/
|
|
2949
|
+
push(text: string): void;
|
|
2950
|
+
/**
|
|
2951
|
+
* Fragments pushed for this turn so far.
|
|
2952
|
+
*/
|
|
2953
|
+
readonly list: readonly string[];
|
|
2954
|
+
}
|
|
2955
|
+
/**
|
|
2956
|
+
* Mutable context passed to {@link PluginAi.onBeforeTurn} once per user chat turn.
|
|
2957
|
+
*
|
|
2958
|
+
* Fires before the first LLM completion step. Mutating {@link userMessage.content}
|
|
2959
|
+
* changes model-facing text for this turn only (not the persisted DB row).
|
|
2960
|
+
*/
|
|
2961
|
+
export interface PluginAiBeforeTurnContext {
|
|
2962
|
+
/**
|
|
2963
|
+
* Chat row id.
|
|
2964
|
+
*/
|
|
2965
|
+
chatId: number;
|
|
2966
|
+
/**
|
|
2967
|
+
* Model id selected in the composer.
|
|
2968
|
+
*/
|
|
2969
|
+
model: string;
|
|
2970
|
+
/**
|
|
2971
|
+
* Team Hub id when the selected model is hub-proxied.
|
|
2972
|
+
*/
|
|
2973
|
+
hubId?: string;
|
|
2974
|
+
/**
|
|
2975
|
+
* The user message driving this turn.
|
|
2976
|
+
*/
|
|
2977
|
+
userMessage: {
|
|
2978
|
+
/**
|
|
2979
|
+
* Model-facing user text (mutable).
|
|
2980
|
+
*/
|
|
2981
|
+
content: string;
|
|
2982
|
+
/**
|
|
2983
|
+
* Read-only `@` reference snapshots already collected for this send.
|
|
2984
|
+
*/
|
|
2985
|
+
readonly referenceSnapshots?: Record<string, unknown>;
|
|
2986
|
+
};
|
|
2987
|
+
/**
|
|
2988
|
+
* Turn-only instruction fragments (appended after static plugin instructions).
|
|
2989
|
+
*/
|
|
2990
|
+
instructions: PluginAiTurnInstructions;
|
|
2991
|
+
/**
|
|
2992
|
+
* Conversation history that will be sent (excluding Harbor's base system prompt).
|
|
2993
|
+
*/
|
|
2994
|
+
messages: PluginAiTurnMessage[];
|
|
2995
|
+
/**
|
|
2996
|
+
* Aborts the turn before any LLM call.
|
|
2997
|
+
*
|
|
2998
|
+
* @param reason - Optional user-facing cancel reason.
|
|
2999
|
+
*/
|
|
3000
|
+
cancel(reason?: string): void;
|
|
3001
|
+
}
|
|
3002
|
+
/**
|
|
3003
|
+
* Read-only result passed to {@link PluginAi.onAfterTurn} when a user turn ends.
|
|
3004
|
+
*/
|
|
3005
|
+
export interface PluginAiAfterTurnContext {
|
|
3006
|
+
/**
|
|
3007
|
+
* Chat row id.
|
|
3008
|
+
*/
|
|
3009
|
+
chatId: number;
|
|
3010
|
+
/**
|
|
3011
|
+
* Model id used for the turn.
|
|
3012
|
+
*/
|
|
3013
|
+
model: string;
|
|
3014
|
+
/**
|
|
3015
|
+
* Team Hub id when hub-proxied.
|
|
3016
|
+
*/
|
|
3017
|
+
hubId?: string;
|
|
3018
|
+
/**
|
|
3019
|
+
* User text that drove this turn (after before-turn rewrites).
|
|
3020
|
+
*/
|
|
3021
|
+
userMessage: {
|
|
3022
|
+
/**
|
|
3023
|
+
* User message content.
|
|
3024
|
+
*/
|
|
3025
|
+
content: string;
|
|
3026
|
+
};
|
|
3027
|
+
/**
|
|
3028
|
+
* Final assistant text persisted for the turn, if any.
|
|
3029
|
+
*/
|
|
3030
|
+
assistantMessage: {
|
|
3031
|
+
/**
|
|
3032
|
+
* Assistant message content.
|
|
3033
|
+
*/
|
|
3034
|
+
content: string;
|
|
3035
|
+
} | null;
|
|
3036
|
+
/**
|
|
3037
|
+
* How the turn ended.
|
|
3038
|
+
*/
|
|
3039
|
+
status: 'completed' | 'cancelled' | 'error';
|
|
3040
|
+
/**
|
|
3041
|
+
* Error details when {@link status} is `error`.
|
|
3042
|
+
*/
|
|
3043
|
+
error?: {
|
|
3044
|
+
/**
|
|
3045
|
+
* User-facing error message.
|
|
3046
|
+
*/
|
|
3047
|
+
message: string;
|
|
3048
|
+
};
|
|
3049
|
+
/**
|
|
3050
|
+
* Cheap telemetry from the tool loop.
|
|
3051
|
+
*/
|
|
3052
|
+
stats: {
|
|
3053
|
+
/**
|
|
3054
|
+
* Number of `completeChatStep` calls in this turn.
|
|
3055
|
+
*/
|
|
3056
|
+
stepCount: number;
|
|
3057
|
+
/**
|
|
3058
|
+
* Number of tool calls executed in this turn.
|
|
3059
|
+
*/
|
|
3060
|
+
toolCallCount: number;
|
|
3061
|
+
/**
|
|
3062
|
+
* Wall-clock duration of the turn in milliseconds.
|
|
3063
|
+
*/
|
|
3064
|
+
durationMs: number;
|
|
3065
|
+
};
|
|
3066
|
+
}
|
|
3067
|
+
/**
|
|
3068
|
+
* AI chat pointer, instruction, and turn-hook APIs available on {@link PluginContext.ai}.
|
|
2898
3069
|
*
|
|
2899
3070
|
* Requires the `ai` permission. Registrations are activation-scoped.
|
|
2900
3071
|
*/
|
|
@@ -2912,6 +3083,24 @@ export interface PluginAi {
|
|
|
2912
3083
|
* @param input - Pointer id, key, label, and context text captured by the plugin.
|
|
2913
3084
|
*/
|
|
2914
3085
|
copyToChat(input: PluginCopyToChatInput): Promise<void>;
|
|
3086
|
+
/**
|
|
3087
|
+
* Append-only static instruction fragments merged into the agent system prompt.
|
|
3088
|
+
*/
|
|
3089
|
+
instructions: PluginAiInstructions;
|
|
3090
|
+
/**
|
|
3091
|
+
* Registers a callback that runs once per user chat turn before the first LLM step.
|
|
3092
|
+
*
|
|
3093
|
+
* @param handler - Called with a mutable turn context.
|
|
3094
|
+
* @returns A {@link Disposable} that unregisters the handler when disposed.
|
|
3095
|
+
*/
|
|
3096
|
+
onBeforeTurn(handler: (ctx: PluginAiBeforeTurnContext) => void | Promise<void>): Disposable;
|
|
3097
|
+
/**
|
|
3098
|
+
* Registers a callback that runs once when a user chat turn finishes.
|
|
3099
|
+
*
|
|
3100
|
+
* @param handler - Called with a read-only turn result.
|
|
3101
|
+
* @returns A {@link Disposable} that unregisters the handler when disposed.
|
|
3102
|
+
*/
|
|
3103
|
+
onAfterTurn(handler: (ctx: PluginAiAfterTurnContext) => void | Promise<void>): Disposable;
|
|
2915
3104
|
}
|
|
2916
3105
|
/**
|
|
2917
3106
|
* **File → Import** handler registration available on {@link PluginContext.imports}.
|
|
@@ -3386,6 +3575,10 @@ export interface CreateCollectionRequest {
|
|
|
3386
3575
|
* HTTP method (for example `GET`, `POST`). Defaults to `GET` when omitted or invalid.
|
|
3387
3576
|
*/
|
|
3388
3577
|
method?: string;
|
|
3578
|
+
/**
|
|
3579
|
+
* Transport protocol (`http` or `sse`). Defaults to `http` when omitted.
|
|
3580
|
+
*/
|
|
3581
|
+
protocol?: 'http' | 'sse';
|
|
3389
3582
|
/**
|
|
3390
3583
|
* Request URL including scheme, host, path, and query string.
|
|
3391
3584
|
*/
|
|
@@ -3575,6 +3768,10 @@ export interface SavedRequestSummary {
|
|
|
3575
3768
|
name: string;
|
|
3576
3769
|
/** HTTP method. */
|
|
3577
3770
|
method: HttpMethod;
|
|
3771
|
+
/**
|
|
3772
|
+
* Transport protocol (`http` or `sse`). Defaults to `http` when omitted by older hosts.
|
|
3773
|
+
*/
|
|
3774
|
+
protocol?: RequestProtocol;
|
|
3578
3775
|
/** Sibling sort order. */
|
|
3579
3776
|
sort_order: number;
|
|
3580
3777
|
/** Optional sidebar marker color. */
|
|
@@ -3836,6 +4033,10 @@ export interface CreateRequestInput {
|
|
|
3836
4033
|
name?: string;
|
|
3837
4034
|
/** HTTP method; defaults to `GET`. */
|
|
3838
4035
|
method?: HttpMethod;
|
|
4036
|
+
/**
|
|
4037
|
+
* Transport protocol; defaults to `http`. Use `sse` for Server-Sent Events.
|
|
4038
|
+
*/
|
|
4039
|
+
protocol?: RequestProtocol;
|
|
3839
4040
|
/** Request URL; defaults to empty. */
|
|
3840
4041
|
url?: string;
|
|
3841
4042
|
}
|
|
@@ -4037,7 +4238,10 @@ export interface HostSavedRequest extends SavedRequestSummary {
|
|
|
4037
4238
|
updated_at: string;
|
|
4038
4239
|
}
|
|
4039
4240
|
/**
|
|
4040
|
-
* Input for
|
|
4241
|
+
* Input for plugin outbound HTTP before conversion to the native fetch API.
|
|
4242
|
+
* Prefer {@link PluginHost.fetch} with `(input, init?)` in new code.
|
|
4243
|
+
*
|
|
4244
|
+
* @deprecated Use fetch(url, init?) instead.
|
|
4041
4245
|
*/
|
|
4042
4246
|
export interface PluginSendRequestInput {
|
|
4043
4247
|
/** HTTP method to use. */
|
|
@@ -4060,7 +4264,72 @@ export interface PluginSendRequestInput {
|
|
|
4060
4264
|
sourceRequestName?: string;
|
|
4061
4265
|
}
|
|
4062
4266
|
/**
|
|
4063
|
-
*
|
|
4267
|
+
* Headers-like facade returned by {@link PluginHost.fetch}.
|
|
4268
|
+
*/
|
|
4269
|
+
export interface PluginFetchHeaders {
|
|
4270
|
+
/**
|
|
4271
|
+
* Returns the first header value for the given name (case-insensitive), or null.
|
|
4272
|
+
*
|
|
4273
|
+
* @param name - Header name.
|
|
4274
|
+
*/
|
|
4275
|
+
get(name: string): string | null;
|
|
4276
|
+
/**
|
|
4277
|
+
* Returns true when a header with the given name is present.
|
|
4278
|
+
*
|
|
4279
|
+
* @param name - Header name.
|
|
4280
|
+
*/
|
|
4281
|
+
has(name: string): boolean;
|
|
4282
|
+
/**
|
|
4283
|
+
* Iterates header entries as [name, value] pairs.
|
|
4284
|
+
*/
|
|
4285
|
+
entries(): IterableIterator<[string, string]>;
|
|
4286
|
+
/**
|
|
4287
|
+
* Iterates header names.
|
|
4288
|
+
*/
|
|
4289
|
+
keys(): IterableIterator<string>;
|
|
4290
|
+
/**
|
|
4291
|
+
* Iterates header values.
|
|
4292
|
+
*/
|
|
4293
|
+
values(): IterableIterator<string>;
|
|
4294
|
+
/**
|
|
4295
|
+
* Invokes callback for each header entry.
|
|
4296
|
+
*
|
|
4297
|
+
* @param callback - Called with (value, key).
|
|
4298
|
+
*/
|
|
4299
|
+
forEach(callback: (value: string, key: string) => void): void;
|
|
4300
|
+
}
|
|
4301
|
+
/**
|
|
4302
|
+
* Response-compatible result of {@link PluginHost.fetch}.
|
|
4303
|
+
*/
|
|
4304
|
+
export interface PluginFetchResponse {
|
|
4305
|
+
/** True when status is in the 200–299 range. */
|
|
4306
|
+
readonly ok: boolean;
|
|
4307
|
+
/** HTTP status code. */
|
|
4308
|
+
readonly status: number;
|
|
4309
|
+
/** HTTP status text. */
|
|
4310
|
+
readonly statusText: string;
|
|
4311
|
+
/** Response headers. */
|
|
4312
|
+
readonly headers: PluginFetchHeaders;
|
|
4313
|
+
/** Returns the response body as text. */
|
|
4314
|
+
text(): Promise<string>;
|
|
4315
|
+
/** Parses the response body as JSON. */
|
|
4316
|
+
json(): Promise<unknown>;
|
|
4317
|
+
/** Returns the response body as an ArrayBuffer (UTF-8 bytes of the text body). */
|
|
4318
|
+
arrayBuffer(): Promise<ArrayBuffer>;
|
|
4319
|
+
}
|
|
4320
|
+
/**
|
|
4321
|
+
* RequestInit-compatible options for {@link PluginHost.fetch}.
|
|
4322
|
+
*/
|
|
4323
|
+
export interface PluginFetchInit {
|
|
4324
|
+
/** HTTP method (default GET). */
|
|
4325
|
+
method?: string;
|
|
4326
|
+
/** Request headers as a record, header list, or Headers-like object. */
|
|
4327
|
+
headers?: Record<string, string> | Array<[string, string]> | PluginFetchHeaders;
|
|
4328
|
+
/** Request body. Only strings and URLSearchParams are supported. */
|
|
4329
|
+
body?: string | URLSearchParams | null;
|
|
4330
|
+
}
|
|
4331
|
+
/**
|
|
4332
|
+
* Result of a plugin-initiated HTTP send used by console logging and history.
|
|
4064
4333
|
*/
|
|
4065
4334
|
export interface PluginSendResult {
|
|
4066
4335
|
/** HTTP status code, or 0 when the request failed before a response. */
|
|
@@ -4086,7 +4355,7 @@ export interface PluginSendResult {
|
|
|
4086
4355
|
/**
|
|
4087
4356
|
* Typed wrappers for built-in HarborClient request editor commands.
|
|
4088
4357
|
*
|
|
4089
|
-
* Requires the `ui` permission (except {@link PluginHost.
|
|
4358
|
+
* Requires the `ui` permission (except {@link PluginHost.fetch}, which
|
|
4090
4359
|
* requires `network`). Prefer these over stringly-typed
|
|
4091
4360
|
* {@link PluginCommands.execute} for opening request tabs.
|
|
4092
4361
|
*/
|
|
@@ -4199,7 +4468,7 @@ export interface PluginHost {
|
|
|
4199
4468
|
*
|
|
4200
4469
|
* No-op when a send is already in flight for the active tab.
|
|
4201
4470
|
*/
|
|
4202
|
-
|
|
4471
|
+
send(): Promise<void>;
|
|
4203
4472
|
/**
|
|
4204
4473
|
* Creates a new environment, populates it with variables, and selects it as active.
|
|
4205
4474
|
*
|
|
@@ -4534,14 +4803,18 @@ export interface PluginHost {
|
|
|
4534
4803
|
result: PluginSendResult;
|
|
4535
4804
|
}): Promise<void>;
|
|
4536
4805
|
/**
|
|
4537
|
-
* Sends one HTTP request through the main-process pipeline
|
|
4538
|
-
*
|
|
4806
|
+
* Sends one HTTP request through the main-process pipeline using the native
|
|
4807
|
+
* fetch(input, init?) signature. Failures resolve to a Response-like object
|
|
4808
|
+
* with status 0 rather than throwing.
|
|
4539
4809
|
*
|
|
4540
4810
|
* Requires the `network` permission.
|
|
4541
4811
|
*
|
|
4542
|
-
* @param input - Request
|
|
4812
|
+
* @param input - URL string, URL, or Request-like `{ url }` object.
|
|
4813
|
+
* @param init - Optional RequestInit-compatible options.
|
|
4543
4814
|
*/
|
|
4544
|
-
|
|
4815
|
+
fetch(input: string | URL | {
|
|
4816
|
+
url: string;
|
|
4817
|
+
}, init?: PluginFetchInit): Promise<PluginFetchResponse>;
|
|
4545
4818
|
/**
|
|
4546
4819
|
* Clears the active request tab's last HTTP response so plugin-only response
|
|
4547
4820
|
* views can take over the panel.
|