@vectle/cli 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/README.md +15 -8
- package/dist/activity.d.ts +10 -0
- package/dist/activity.js +10 -0
- package/dist/activity.js.map +1 -0
- package/dist/adapters/claude.d.ts +4 -0
- package/dist/adapters/claude.js +279 -0
- package/dist/adapters/claude.js.map +1 -0
- package/dist/adapters/codex.d.ts +16 -0
- package/dist/adapters/codex.js +410 -0
- package/dist/adapters/codex.js.map +1 -0
- package/dist/adapters/common.d.ts +80 -0
- package/dist/adapters/common.js +249 -0
- package/dist/adapters/common.js.map +1 -0
- package/dist/adapters/cursor.d.ts +4 -0
- package/dist/adapters/cursor.js +240 -0
- package/dist/adapters/cursor.js.map +1 -0
- package/dist/adapters/vscode.d.ts +4 -0
- package/dist/adapters/vscode.js +240 -0
- package/dist/adapters/vscode.js.map +1 -0
- package/dist/agent-policy.d.ts +50 -0
- package/dist/agent-policy.js +83 -0
- package/dist/agent-policy.js.map +1 -0
- package/dist/client.d.ts +69 -10
- package/dist/client.js +247 -24
- package/dist/client.js.map +1 -1
- package/dist/constants.d.ts +12 -2
- package/dist/constants.js +7 -1
- package/dist/constants.js.map +1 -1
- package/dist/contracts.d.ts +53 -0
- package/dist/contracts.js +68 -0
- package/dist/contracts.js.map +1 -0
- package/dist/delivery.d.ts +80 -0
- package/dist/delivery.js +304 -0
- package/dist/delivery.js.map +1 -0
- package/dist/findings.d.ts +12 -0
- package/dist/findings.js +41 -0
- package/dist/findings.js.map +1 -0
- package/dist/help.d.ts +1 -0
- package/dist/help.js +53 -0
- package/dist/help.js.map +1 -0
- package/dist/index.js +370 -72
- package/dist/index.js.map +1 -1
- package/dist/integrations.d.ts +126 -0
- package/dist/integrations.js +173 -0
- package/dist/integrations.js.map +1 -0
- package/dist/legacy-compat.d.ts +45 -0
- package/dist/legacy-compat.js +149 -0
- package/dist/legacy-compat.js.map +1 -0
- package/dist/lifecycle.d.ts +50 -0
- package/dist/lifecycle.js +146 -0
- package/dist/lifecycle.js.map +1 -0
- package/dist/locator.d.ts +58 -0
- package/dist/locator.js +233 -0
- package/dist/locator.js.map +1 -0
- package/dist/mcp.d.ts +12 -2
- package/dist/mcp.js +194 -48
- package/dist/mcp.js.map +1 -1
- package/dist/modes.d.ts +37 -0
- package/dist/modes.js +32 -0
- package/dist/modes.js.map +1 -0
- package/dist/outbox.d.ts +9 -0
- package/dist/outbox.js +188 -0
- package/dist/outbox.js.map +1 -0
- package/dist/parser.d.ts +10 -0
- package/dist/parser.js +99 -0
- package/dist/parser.js.map +1 -0
- package/dist/pulse.d.ts +122 -0
- package/dist/pulse.js +412 -0
- package/dist/pulse.js.map +1 -0
- package/dist/release-manifest.d.ts +123 -0
- package/dist/release-manifest.js +226 -0
- package/dist/release-manifest.js.map +1 -0
- package/dist/release.d.ts +1 -1
- package/dist/response.d.ts +17 -0
- package/dist/response.js +15 -0
- package/dist/response.js.map +1 -1
- package/dist/rollout.d.ts +8 -0
- package/dist/rollout.js +27 -0
- package/dist/rollout.js.map +1 -0
- package/dist/runtime.d.ts +60 -0
- package/dist/runtime.js +276 -0
- package/dist/runtime.js.map +1 -0
- package/dist/secure-store.d.ts +36 -0
- package/dist/secure-store.js +282 -0
- package/dist/secure-store.js.map +1 -0
- package/dist/setup.d.ts +159 -0
- package/dist/setup.js +629 -0
- package/dist/setup.js.map +1 -0
- package/dist/state.d.ts +98 -0
- package/dist/state.js +226 -0
- package/dist/state.js.map +1 -0
- package/dist/status.d.ts +282 -0
- package/dist/status.js +213 -0
- package/dist/status.js.map +1 -0
- package/dist/store.d.ts +44 -2
- package/dist/store.js +222 -44
- package/dist/store.js.map +1 -1
- package/dist/update.d.ts +33 -1
- package/dist/update.js +88 -16
- package/dist/update.js.map +1 -1
- package/dist/write-journal.d.ts +71 -0
- package/dist/write-journal.js +175 -0
- package/dist/write-journal.js.map +1 -0
- package/package.json +7 -2
package/dist/status.d.ts
ADDED
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
import type { VectleClient } from './client.js';
|
|
2
|
+
import { type IntegrationManifest, type IntegrationManifestEntry } from './integrations.js';
|
|
3
|
+
import type { ClientFamily, VectleConfig } from './store.js';
|
|
4
|
+
import type { CliRelease } from './update.js';
|
|
5
|
+
type Freshness = {
|
|
6
|
+
state: 'live' | 'cached' | 'unchecked' | 'unavailable';
|
|
7
|
+
observed_at: string | null;
|
|
8
|
+
};
|
|
9
|
+
declare function selectionOption(entry: IntegrationManifestEntry): {
|
|
10
|
+
client_family: import("./integrations.js").SupportedClientFamily;
|
|
11
|
+
profile_label: string;
|
|
12
|
+
adapter_entry_id: string;
|
|
13
|
+
};
|
|
14
|
+
export type StatusOptions = {
|
|
15
|
+
clientFamily?: ClientFamily | 'auto' | 'all';
|
|
16
|
+
local?: boolean;
|
|
17
|
+
publicCapability?: Record<string, unknown> | null;
|
|
18
|
+
installationCapability?: Record<string, unknown> | null;
|
|
19
|
+
manifest?: IntegrationManifest;
|
|
20
|
+
releaseEligible?: boolean;
|
|
21
|
+
releaseMetadata?: {
|
|
22
|
+
state: Freshness['state'];
|
|
23
|
+
observed_at: string | null;
|
|
24
|
+
sequence: number | null;
|
|
25
|
+
minimum_supported_version: string | null;
|
|
26
|
+
recommended_version: string | null;
|
|
27
|
+
update_available: boolean | null;
|
|
28
|
+
} | null;
|
|
29
|
+
};
|
|
30
|
+
export declare function readDoctorServices(client: Pick<VectleClient, 'health' | 'latestRelease'>, releaseMetadata: StatusOptions['releaseMetadata'], local: boolean, cliVersion?: string): Promise<[PromiseSettledResult<Record<string, unknown>>, PromiseSettledResult<{
|
|
31
|
+
state: Freshness["state"];
|
|
32
|
+
observed_at: string | null;
|
|
33
|
+
sequence: number | null;
|
|
34
|
+
minimum_supported_version: string | null;
|
|
35
|
+
recommended_version: string | null;
|
|
36
|
+
update_available: boolean | null;
|
|
37
|
+
} | null | undefined>] | [PromiseSettledResult<Record<string, unknown>>, PromiseSettledResult<CliRelease>] | readonly [{
|
|
38
|
+
readonly status: "fulfilled";
|
|
39
|
+
readonly value: {
|
|
40
|
+
readonly status: "unchecked";
|
|
41
|
+
};
|
|
42
|
+
}, {
|
|
43
|
+
readonly status: "fulfilled";
|
|
44
|
+
readonly value: null;
|
|
45
|
+
}]>;
|
|
46
|
+
export declare function buildLocalStatus(config: VectleConfig, options?: StatusOptions): {
|
|
47
|
+
schema_version: "vectle-status-v2";
|
|
48
|
+
selected: "none" | "all" | "family" | "current_integration";
|
|
49
|
+
selection: {
|
|
50
|
+
schema_version: "client-selection-v1";
|
|
51
|
+
status: "not_required" | "none_detected";
|
|
52
|
+
reason: "all_requested" | "no_supported_client";
|
|
53
|
+
options: never[];
|
|
54
|
+
} | {
|
|
55
|
+
schema_version: "client-selection-v1";
|
|
56
|
+
status: "not_required";
|
|
57
|
+
reason: "all_requested";
|
|
58
|
+
options: {
|
|
59
|
+
client_family: import("./integrations.js").SupportedClientFamily;
|
|
60
|
+
profile_label: string;
|
|
61
|
+
adapter_entry_id: string;
|
|
62
|
+
}[];
|
|
63
|
+
} | {
|
|
64
|
+
schema_version: "client-selection-v1";
|
|
65
|
+
status: "selected";
|
|
66
|
+
reason: "explicit_family";
|
|
67
|
+
options: {
|
|
68
|
+
client_family: import("./integrations.js").SupportedClientFamily;
|
|
69
|
+
profile_label: string;
|
|
70
|
+
adapter_entry_id: string;
|
|
71
|
+
}[];
|
|
72
|
+
} | {
|
|
73
|
+
schema_version: "client-selection-v1";
|
|
74
|
+
status: "choice_required";
|
|
75
|
+
reason: "same_family_multiple_profiles";
|
|
76
|
+
options: {
|
|
77
|
+
client_family: import("./integrations.js").SupportedClientFamily;
|
|
78
|
+
profile_label: string;
|
|
79
|
+
adapter_entry_id: string;
|
|
80
|
+
}[];
|
|
81
|
+
} | {
|
|
82
|
+
schema_version: "client-selection-v1";
|
|
83
|
+
status: "selected";
|
|
84
|
+
reason: "managed_invocation";
|
|
85
|
+
options: {
|
|
86
|
+
client_family: import("./integrations.js").SupportedClientFamily;
|
|
87
|
+
profile_label: string;
|
|
88
|
+
adapter_entry_id: string;
|
|
89
|
+
}[];
|
|
90
|
+
};
|
|
91
|
+
installation: {
|
|
92
|
+
configured: boolean;
|
|
93
|
+
local_mode: import("./store.js").LocalMode;
|
|
94
|
+
consent_state: "revocation_pending" | "legacy_v1" | "not_connected" | "revoked" | "active_v2";
|
|
95
|
+
approved_behavior_ceiling: {
|
|
96
|
+
authority: "current";
|
|
97
|
+
consent_version: 2;
|
|
98
|
+
startup_pulse: "automatic" | "on_demand";
|
|
99
|
+
sharing_and_correction: "automatic" | "explicit_only";
|
|
100
|
+
} | null;
|
|
101
|
+
actions_required: {
|
|
102
|
+
code: "new_setup";
|
|
103
|
+
target: null;
|
|
104
|
+
}[] | {
|
|
105
|
+
code: "consent_upgrade";
|
|
106
|
+
target: null;
|
|
107
|
+
}[] | {
|
|
108
|
+
code: "finish_server_revocation";
|
|
109
|
+
target: null;
|
|
110
|
+
}[];
|
|
111
|
+
};
|
|
112
|
+
aggregate: {
|
|
113
|
+
configured_integrations: number;
|
|
114
|
+
verified_full_lifecycle: number;
|
|
115
|
+
automatic_lookup_integrations: number;
|
|
116
|
+
automatic_update_integrations: number;
|
|
117
|
+
automatic_submission_integrations: number;
|
|
118
|
+
automatic_correction_integrations: number;
|
|
119
|
+
integrations_needing_action: number;
|
|
120
|
+
};
|
|
121
|
+
integrations: {
|
|
122
|
+
adapter_entry_id: string;
|
|
123
|
+
client_family: import("./integrations.js").SupportedClientFamily;
|
|
124
|
+
profile_label: string;
|
|
125
|
+
integration_capability: "full_lifecycle" | "policy_and_mcp" | "mcp_only" | "authorized_only" | "disconnected" | "conflict";
|
|
126
|
+
startup_invocation_policy: "off" | "on_demand" | "automatic_guard";
|
|
127
|
+
sharing_invocation_policy: "off" | "explicit_only" | "automatic_guard";
|
|
128
|
+
lookup_capability: "automatic" | "on_demand" | "unavailable";
|
|
129
|
+
updates_capability: "automatic" | "on_demand" | "unavailable";
|
|
130
|
+
write_capabilities: {
|
|
131
|
+
submission: "automatic" | "explicit_only" | "unavailable";
|
|
132
|
+
correction: "automatic" | "explicit_only" | "unavailable";
|
|
133
|
+
withdrawal: "explicit_only" | "unavailable";
|
|
134
|
+
};
|
|
135
|
+
approval_persistence: {
|
|
136
|
+
read: "promptless" | "host_prompts_may_repeat" | "unsupported";
|
|
137
|
+
write: "promptless" | "host_prompts_may_repeat" | "unsupported";
|
|
138
|
+
};
|
|
139
|
+
actions_required: {
|
|
140
|
+
code: "client_choice" | "repair" | "mcp_server_trust" | "lifecycle_hook_trust" | "client_restart";
|
|
141
|
+
target: ReturnType<typeof selectionOption> | null;
|
|
142
|
+
}[];
|
|
143
|
+
limitations: ("runtime_not_durable" | "host_approval_may_repeat" | "lifecycle_unsupported" | "local_sessions_only" | "cold_start_unverified")[];
|
|
144
|
+
runtime_health: "healthy" | "lookup_degraded" | "auth_degraded" | "server_unavailable";
|
|
145
|
+
completion_notice: {
|
|
146
|
+
notice_id: string;
|
|
147
|
+
copy_variant: string;
|
|
148
|
+
status: "pending" | "leased" | "acknowledged";
|
|
149
|
+
} | null;
|
|
150
|
+
}[];
|
|
151
|
+
freshness: {
|
|
152
|
+
public_controls: Freshness;
|
|
153
|
+
installation_controls: Freshness;
|
|
154
|
+
release_manifest: {
|
|
155
|
+
state: Freshness["state"];
|
|
156
|
+
observed_at: string | null;
|
|
157
|
+
sequence: number | null;
|
|
158
|
+
minimum_supported_version: string | null;
|
|
159
|
+
recommended_version: string | null;
|
|
160
|
+
update_available: boolean | null;
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
};
|
|
164
|
+
export declare function readStatus(client: VectleClient, config: VectleConfig, token: string | null, options?: StatusOptions): Promise<{
|
|
165
|
+
schema_version: "vectle-status-v2";
|
|
166
|
+
selected: "none" | "all" | "family" | "current_integration";
|
|
167
|
+
selection: {
|
|
168
|
+
schema_version: "client-selection-v1";
|
|
169
|
+
status: "not_required" | "none_detected";
|
|
170
|
+
reason: "all_requested" | "no_supported_client";
|
|
171
|
+
options: never[];
|
|
172
|
+
} | {
|
|
173
|
+
schema_version: "client-selection-v1";
|
|
174
|
+
status: "not_required";
|
|
175
|
+
reason: "all_requested";
|
|
176
|
+
options: {
|
|
177
|
+
client_family: import("./integrations.js").SupportedClientFamily;
|
|
178
|
+
profile_label: string;
|
|
179
|
+
adapter_entry_id: string;
|
|
180
|
+
}[];
|
|
181
|
+
} | {
|
|
182
|
+
schema_version: "client-selection-v1";
|
|
183
|
+
status: "selected";
|
|
184
|
+
reason: "explicit_family";
|
|
185
|
+
options: {
|
|
186
|
+
client_family: import("./integrations.js").SupportedClientFamily;
|
|
187
|
+
profile_label: string;
|
|
188
|
+
adapter_entry_id: string;
|
|
189
|
+
}[];
|
|
190
|
+
} | {
|
|
191
|
+
schema_version: "client-selection-v1";
|
|
192
|
+
status: "choice_required";
|
|
193
|
+
reason: "same_family_multiple_profiles";
|
|
194
|
+
options: {
|
|
195
|
+
client_family: import("./integrations.js").SupportedClientFamily;
|
|
196
|
+
profile_label: string;
|
|
197
|
+
adapter_entry_id: string;
|
|
198
|
+
}[];
|
|
199
|
+
} | {
|
|
200
|
+
schema_version: "client-selection-v1";
|
|
201
|
+
status: "selected";
|
|
202
|
+
reason: "managed_invocation";
|
|
203
|
+
options: {
|
|
204
|
+
client_family: import("./integrations.js").SupportedClientFamily;
|
|
205
|
+
profile_label: string;
|
|
206
|
+
adapter_entry_id: string;
|
|
207
|
+
}[];
|
|
208
|
+
};
|
|
209
|
+
installation: {
|
|
210
|
+
configured: boolean;
|
|
211
|
+
local_mode: import("./store.js").LocalMode;
|
|
212
|
+
consent_state: "revocation_pending" | "legacy_v1" | "not_connected" | "revoked" | "active_v2";
|
|
213
|
+
approved_behavior_ceiling: {
|
|
214
|
+
authority: "current";
|
|
215
|
+
consent_version: 2;
|
|
216
|
+
startup_pulse: "automatic" | "on_demand";
|
|
217
|
+
sharing_and_correction: "automatic" | "explicit_only";
|
|
218
|
+
} | null;
|
|
219
|
+
actions_required: {
|
|
220
|
+
code: "new_setup";
|
|
221
|
+
target: null;
|
|
222
|
+
}[] | {
|
|
223
|
+
code: "consent_upgrade";
|
|
224
|
+
target: null;
|
|
225
|
+
}[] | {
|
|
226
|
+
code: "finish_server_revocation";
|
|
227
|
+
target: null;
|
|
228
|
+
}[];
|
|
229
|
+
};
|
|
230
|
+
aggregate: {
|
|
231
|
+
configured_integrations: number;
|
|
232
|
+
verified_full_lifecycle: number;
|
|
233
|
+
automatic_lookup_integrations: number;
|
|
234
|
+
automatic_update_integrations: number;
|
|
235
|
+
automatic_submission_integrations: number;
|
|
236
|
+
automatic_correction_integrations: number;
|
|
237
|
+
integrations_needing_action: number;
|
|
238
|
+
};
|
|
239
|
+
integrations: {
|
|
240
|
+
adapter_entry_id: string;
|
|
241
|
+
client_family: import("./integrations.js").SupportedClientFamily;
|
|
242
|
+
profile_label: string;
|
|
243
|
+
integration_capability: "full_lifecycle" | "policy_and_mcp" | "mcp_only" | "authorized_only" | "disconnected" | "conflict";
|
|
244
|
+
startup_invocation_policy: "off" | "on_demand" | "automatic_guard";
|
|
245
|
+
sharing_invocation_policy: "off" | "explicit_only" | "automatic_guard";
|
|
246
|
+
lookup_capability: "automatic" | "on_demand" | "unavailable";
|
|
247
|
+
updates_capability: "automatic" | "on_demand" | "unavailable";
|
|
248
|
+
write_capabilities: {
|
|
249
|
+
submission: "automatic" | "explicit_only" | "unavailable";
|
|
250
|
+
correction: "automatic" | "explicit_only" | "unavailable";
|
|
251
|
+
withdrawal: "explicit_only" | "unavailable";
|
|
252
|
+
};
|
|
253
|
+
approval_persistence: {
|
|
254
|
+
read: "promptless" | "host_prompts_may_repeat" | "unsupported";
|
|
255
|
+
write: "promptless" | "host_prompts_may_repeat" | "unsupported";
|
|
256
|
+
};
|
|
257
|
+
actions_required: {
|
|
258
|
+
code: "client_choice" | "repair" | "mcp_server_trust" | "lifecycle_hook_trust" | "client_restart";
|
|
259
|
+
target: ReturnType<typeof selectionOption> | null;
|
|
260
|
+
}[];
|
|
261
|
+
limitations: ("runtime_not_durable" | "host_approval_may_repeat" | "lifecycle_unsupported" | "local_sessions_only" | "cold_start_unverified")[];
|
|
262
|
+
runtime_health: "healthy" | "lookup_degraded" | "auth_degraded" | "server_unavailable";
|
|
263
|
+
completion_notice: {
|
|
264
|
+
notice_id: string;
|
|
265
|
+
copy_variant: string;
|
|
266
|
+
status: "pending" | "leased" | "acknowledged";
|
|
267
|
+
} | null;
|
|
268
|
+
}[];
|
|
269
|
+
freshness: {
|
|
270
|
+
public_controls: Freshness;
|
|
271
|
+
installation_controls: Freshness;
|
|
272
|
+
release_manifest: {
|
|
273
|
+
state: Freshness["state"];
|
|
274
|
+
observed_at: string | null;
|
|
275
|
+
sequence: number | null;
|
|
276
|
+
minimum_supported_version: string | null;
|
|
277
|
+
recommended_version: string | null;
|
|
278
|
+
update_available: boolean | null;
|
|
279
|
+
};
|
|
280
|
+
};
|
|
281
|
+
}>;
|
|
282
|
+
export {};
|
package/dist/status.js
ADDED
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { CLI_VERSION } from './constants.js';
|
|
2
|
+
import { compareVersions } from './release.js';
|
|
3
|
+
import { fetchReleaseManifest } from './release-manifest.js';
|
|
4
|
+
import { loadAgentState } from './state.js';
|
|
5
|
+
import { localStateRoot } from './delivery.js';
|
|
6
|
+
import { localMode } from './modes.js';
|
|
7
|
+
import { loadIntegrationManifest } from './integrations.js';
|
|
8
|
+
import { readHookState } from './lifecycle.js';
|
|
9
|
+
const clientFamilies = new Set(['codex', 'claude_code', 'cursor', 'vscode', 'terminal', 'unknown']);
|
|
10
|
+
function timestamp(value) { return typeof value === 'string' && Number.isFinite(Date.parse(value)) ? value : null; }
|
|
11
|
+
function fresh(value, now = Date.now()) {
|
|
12
|
+
const observed = timestamp(value?.observed_at);
|
|
13
|
+
const expires = timestamp(value?.expires_at);
|
|
14
|
+
if (!observed || !expires || Date.parse(expires) <= now || Date.parse(expires) > Date.parse(observed) + 5 * 60_000)
|
|
15
|
+
return { state: value ? 'unavailable' : 'unchecked', observed_at: null };
|
|
16
|
+
return { state: 'live', observed_at: observed };
|
|
17
|
+
}
|
|
18
|
+
function publicEnabled(value, freshness) {
|
|
19
|
+
return freshness.state === 'live' && value?.operations?.startup_lookup?.status === 'enabled';
|
|
20
|
+
}
|
|
21
|
+
function operation(value, name, field, freshness) {
|
|
22
|
+
if (freshness.state !== 'live')
|
|
23
|
+
return 'unsupported';
|
|
24
|
+
const raw = value?.operations?.[name]?.[field];
|
|
25
|
+
return raw === 'enabled' || raw === 'disabled' || raw === 'not_authorized' || raw === 'insufficient_scope' || raw === 'unsupported' ? raw : 'unsupported';
|
|
26
|
+
}
|
|
27
|
+
function selectionOption(entry) {
|
|
28
|
+
return { client_family: entry.client_family, profile_label: entry.profile_label, adapter_entry_id: entry.adapter_entry_id };
|
|
29
|
+
}
|
|
30
|
+
function noSelection(reason = 'no_supported_client') {
|
|
31
|
+
return { schema_version: 'client-selection-v1', status: reason === 'all_requested' ? 'not_required' : 'none_detected', reason, options: [] };
|
|
32
|
+
}
|
|
33
|
+
function consentState(config) {
|
|
34
|
+
if (!config.installation)
|
|
35
|
+
return config.contributorId ? 'legacy_v1' : 'not_connected';
|
|
36
|
+
if (localMode(config) === 'revocation_pending')
|
|
37
|
+
return 'revocation_pending';
|
|
38
|
+
if (localMode(config) === 'off')
|
|
39
|
+
return 'revoked';
|
|
40
|
+
return config.installation.consent_version === 2 ? 'active_v2' : 'legacy_v1';
|
|
41
|
+
}
|
|
42
|
+
function ceiling(config) {
|
|
43
|
+
if (!config.installation)
|
|
44
|
+
return null;
|
|
45
|
+
return {
|
|
46
|
+
authority: 'current',
|
|
47
|
+
consent_version: config.installation.consent_version,
|
|
48
|
+
startup_pulse: config.installation.automatic_lookup ? 'automatic' : 'on_demand',
|
|
49
|
+
sharing_and_correction: config.installation.automatic_sharing ? 'automatic' : 'explicit_only',
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function effectiveSelection(config, manifest, requested) {
|
|
53
|
+
const entries = manifest.entries;
|
|
54
|
+
if (requested === 'all')
|
|
55
|
+
return { selected: 'all', selection: { schema_version: 'client-selection-v1', status: 'not_required', reason: 'all_requested', options: entries.map(selectionOption) } };
|
|
56
|
+
if (requested && requested !== 'auto' && clientFamilies.has(requested)) {
|
|
57
|
+
const matches = entries.filter(entry => entry.client_family === requested);
|
|
58
|
+
if (matches.length === 1)
|
|
59
|
+
return { selected: 'family', selection: { schema_version: 'client-selection-v1', status: 'selected', reason: 'explicit_family', options: matches.map(selectionOption) } };
|
|
60
|
+
if (matches.length > 1)
|
|
61
|
+
return { selected: 'none', selection: { schema_version: 'client-selection-v1', status: 'choice_required', reason: 'same_family_multiple_profiles', options: matches.map(selectionOption).slice(0, 8) } };
|
|
62
|
+
return { selected: 'none', selection: noSelection('no_supported_client') };
|
|
63
|
+
}
|
|
64
|
+
if (entries.length === 1)
|
|
65
|
+
return { selected: 'current_integration', selection: { schema_version: 'client-selection-v1', status: 'selected', reason: 'managed_invocation', options: entries.map(selectionOption) } };
|
|
66
|
+
if (entries.length > 1)
|
|
67
|
+
return { selected: 'all', selection: { schema_version: 'client-selection-v1', status: 'not_required', reason: 'all_requested', options: entries.map(selectionOption) } };
|
|
68
|
+
return { selected: 'none', selection: noSelection() };
|
|
69
|
+
}
|
|
70
|
+
function integrationStatus(config, entry, publicValue, publicFreshness, installValue, installFreshness, releaseEligible = false) {
|
|
71
|
+
const mode = localMode(config);
|
|
72
|
+
const installation = config.installation;
|
|
73
|
+
const marker = config.stateRoot ? readHookState(config.stateRoot, entry.adapter_entry_id) : null;
|
|
74
|
+
const markerReady = Boolean(marker && marker.client_family === entry.client_family && marker.integration_manifest_digest === entry.integration_binding_digest && marker.policy_checksum === entry.policy_checksum && Date.parse(marker.executed_at) >= Date.parse(entry.updated_at));
|
|
75
|
+
const effectiveCapability = markerReady ? 'full_lifecycle' : entry.integration_capability;
|
|
76
|
+
const hostReady = effectiveCapability === 'full_lifecycle';
|
|
77
|
+
const readTransport = effectiveCapability !== 'disconnected' && effectiveCapability !== 'conflict';
|
|
78
|
+
const lookupAutomatic = Boolean(installation?.automatic_lookup) && hostReady && (mode === 'active' || mode === 'read-only') && publicEnabled(publicValue, publicFreshness) && releaseEligible;
|
|
79
|
+
const lookup = !readTransport || mode === 'paused' || mode === 'off' ? 'unavailable' : lookupAutomatic ? 'automatic' : 'on_demand';
|
|
80
|
+
const updatesStatus = operation(installValue, 'hive_updates', 'automatic_status', installFreshness);
|
|
81
|
+
const updatesAutomatic = Boolean(installation?.automatic_lookup) && hostReady && (mode === 'active' || mode === 'read-only') && updatesStatus === 'enabled' && releaseEligible;
|
|
82
|
+
const updates = !readTransport || mode === 'paused' || mode === 'off' ? 'unavailable' : updatesAutomatic ? 'automatic' : 'on_demand';
|
|
83
|
+
const explicitSubmit = operation(installValue, 'finding_submit', 'explicit_status', installFreshness) === 'enabled' && mode === 'active' && Boolean(installation);
|
|
84
|
+
const automaticSubmit = explicitSubmit && Boolean(installation?.automatic_sharing) && hostReady && operation(installValue, 'automatic_finding_submit', 'automatic_status', installFreshness) === 'enabled' && releaseEligible;
|
|
85
|
+
const explicitCorrection = operation(installValue, 'finding_correction', 'explicit_status', installFreshness) === 'enabled' && Boolean(installation);
|
|
86
|
+
const automaticCorrection = explicitCorrection && Boolean(installation?.automatic_sharing) && hostReady && operation(installValue, 'automatic_finding_correction', 'automatic_status', installFreshness) === 'enabled' && releaseEligible;
|
|
87
|
+
const withdrawal = operation(installValue, 'content_withdraw', 'explicit_status', installFreshness) === 'enabled' && Boolean(installation) ? 'explicit_only' : 'unavailable';
|
|
88
|
+
const readPolicy = lookupAutomatic ? 'promptless' : hostReady ? 'host_prompts_may_repeat' : 'unsupported';
|
|
89
|
+
const writePolicy = automaticSubmit || automaticCorrection ? 'promptless' : hostReady ? 'host_prompts_may_repeat' : 'unsupported';
|
|
90
|
+
const actions = [];
|
|
91
|
+
const limitations = [];
|
|
92
|
+
if (effectiveCapability === 'mcp_only')
|
|
93
|
+
limitations.push('lifecycle_unsupported');
|
|
94
|
+
if (effectiveCapability === 'policy_and_mcp' && !markerReady) {
|
|
95
|
+
actions.push({ code: 'lifecycle_hook_trust', target: selectionOption(entry) });
|
|
96
|
+
actions.push({ code: 'client_restart', target: selectionOption(entry) });
|
|
97
|
+
}
|
|
98
|
+
if (effectiveCapability === 'authorized_only')
|
|
99
|
+
actions.push({ code: 'repair', target: selectionOption(entry) });
|
|
100
|
+
if (effectiveCapability === 'conflict')
|
|
101
|
+
actions.push({ code: 'repair', target: selectionOption(entry) });
|
|
102
|
+
const runtimeHealth = publicFreshness.state === 'unavailable' && installFreshness.state === 'unavailable' ? 'server_unavailable' : installFreshness.state === 'unavailable' && installation ? 'auth_degraded' : publicFreshness.state === 'unavailable' ? 'lookup_degraded' : 'healthy';
|
|
103
|
+
let completionNotice = null;
|
|
104
|
+
try {
|
|
105
|
+
const state = loadAgentState(localStateRoot(config));
|
|
106
|
+
const notice = state.pending_notices.find(item => item.schema_version === 'completion-notice-v1' && typeof item.notice_id === 'string');
|
|
107
|
+
if (notice)
|
|
108
|
+
completionNotice = { notice_id: notice.notice_id, copy_variant: notice.copy_variant ?? 'integration_verified', status: notice.status ?? (notice.pending === false ? 'acknowledged' : 'pending') };
|
|
109
|
+
}
|
|
110
|
+
catch { /* local status remains truthful without an optional notice */ }
|
|
111
|
+
return {
|
|
112
|
+
adapter_entry_id: entry.adapter_entry_id,
|
|
113
|
+
client_family: entry.client_family,
|
|
114
|
+
profile_label: entry.profile_label,
|
|
115
|
+
integration_capability: effectiveCapability,
|
|
116
|
+
startup_invocation_policy: mode === 'paused' || mode === 'off' || !readTransport ? 'off' : hostReady ? 'automatic_guard' : 'on_demand',
|
|
117
|
+
sharing_invocation_policy: mode === 'active' && hostReady && installation?.automatic_sharing ? 'automatic_guard' : mode === 'active' && explicitSubmit ? 'explicit_only' : 'off',
|
|
118
|
+
lookup_capability: lookup,
|
|
119
|
+
updates_capability: updates,
|
|
120
|
+
write_capabilities: { submission: mode !== 'active' || !explicitSubmit ? 'unavailable' : automaticSubmit ? 'automatic' : 'explicit_only', correction: !explicitCorrection ? 'unavailable' : automaticCorrection ? 'automatic' : 'explicit_only', withdrawal },
|
|
121
|
+
approval_persistence: { read: readPolicy, write: writePolicy },
|
|
122
|
+
actions_required: actions,
|
|
123
|
+
limitations,
|
|
124
|
+
runtime_health: runtimeHealth,
|
|
125
|
+
completion_notice: completionNotice,
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
export async function readDoctorServices(client, releaseMetadata, local, cliVersion = CLI_VERSION) {
|
|
129
|
+
if (local) {
|
|
130
|
+
return [
|
|
131
|
+
{ status: 'fulfilled', value: { status: 'unchecked' } },
|
|
132
|
+
{ status: 'fulfilled', value: null },
|
|
133
|
+
];
|
|
134
|
+
}
|
|
135
|
+
const manifestVersion = compareVersions(cliVersion, '1.1.0');
|
|
136
|
+
if (manifestVersion !== null && manifestVersion >= 0) {
|
|
137
|
+
return Promise.allSettled([
|
|
138
|
+
client.health(true),
|
|
139
|
+
Promise.resolve(releaseMetadata),
|
|
140
|
+
]);
|
|
141
|
+
}
|
|
142
|
+
return Promise.allSettled([
|
|
143
|
+
client.health(true),
|
|
144
|
+
client.latestRelease(true),
|
|
145
|
+
]);
|
|
146
|
+
}
|
|
147
|
+
export function buildLocalStatus(config, options = {}) {
|
|
148
|
+
const manifest = options.manifest ?? loadIntegrationManifest(config.stateRoot);
|
|
149
|
+
const selected = effectiveSelection(config, manifest, options.clientFamily);
|
|
150
|
+
const publicValue = options.publicCapability ?? null;
|
|
151
|
+
const installValue = options.installationCapability ?? null;
|
|
152
|
+
const publicFreshness = options.local ? { state: 'unchecked', observed_at: null } : fresh(publicValue);
|
|
153
|
+
const installFreshness = options.local ? { state: 'unchecked', observed_at: null } : fresh(installValue);
|
|
154
|
+
const integrations = manifest.entries.map(entry => integrationStatus(config, entry, publicValue, publicFreshness, installValue, installFreshness, options.releaseEligible ?? false));
|
|
155
|
+
const mode = localMode(config);
|
|
156
|
+
const consent = consentState(config);
|
|
157
|
+
const authority = config.installation ? ceiling(config) : null;
|
|
158
|
+
const installationActions = consent === 'not_connected' ? [{ code: 'new_setup', target: null }] : consent === 'legacy_v1' ? [{ code: 'consent_upgrade', target: null }] : mode === 'revocation_pending' ? [{ code: 'finish_server_revocation', target: null }] : [];
|
|
159
|
+
return {
|
|
160
|
+
schema_version: 'vectle-status-v2',
|
|
161
|
+
selected: selected.selected,
|
|
162
|
+
selection: selected.selection,
|
|
163
|
+
installation: { configured: Boolean(config.installation), local_mode: mode, consent_state: consent, approved_behavior_ceiling: authority, actions_required: installationActions },
|
|
164
|
+
aggregate: {
|
|
165
|
+
configured_integrations: integrations.length,
|
|
166
|
+
verified_full_lifecycle: integrations.filter(item => item.integration_capability === 'full_lifecycle').length,
|
|
167
|
+
automatic_lookup_integrations: integrations.filter(item => item.lookup_capability === 'automatic').length,
|
|
168
|
+
automatic_update_integrations: integrations.filter(item => item.updates_capability === 'automatic').length,
|
|
169
|
+
automatic_submission_integrations: integrations.filter(item => item.write_capabilities.submission === 'automatic').length,
|
|
170
|
+
automatic_correction_integrations: integrations.filter(item => item.write_capabilities.correction === 'automatic').length,
|
|
171
|
+
integrations_needing_action: integrations.filter(item => item.actions_required.length > 0).length,
|
|
172
|
+
},
|
|
173
|
+
integrations,
|
|
174
|
+
freshness: {
|
|
175
|
+
public_controls: publicFreshness,
|
|
176
|
+
installation_controls: installFreshness,
|
|
177
|
+
release_manifest: options.releaseMetadata ?? { state: options.releaseEligible ? 'live' : 'unchecked', observed_at: options.releaseEligible ? new Date().toISOString() : null, sequence: null, minimum_supported_version: null, recommended_version: null, update_available: null },
|
|
178
|
+
},
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
export async function readStatus(client, config, token, options = {}) {
|
|
182
|
+
if (options.local)
|
|
183
|
+
return buildLocalStatus(config, { ...options, local: true });
|
|
184
|
+
const manifestVersion = compareVersions(CLI_VERSION, '1.1.0');
|
|
185
|
+
const [publicResult, diagnosticResult, releaseResult] = await Promise.allSettled([
|
|
186
|
+
client.anonymousCapabilities(1_000),
|
|
187
|
+
token && config.schema_version === 'vectle-config-v2' ? client.diagnostic(token, 1_000) : Promise.resolve(null),
|
|
188
|
+
manifestVersion !== null && manifestVersion >= 0 ? fetchReleaseManifest(config.endpoint, localStateRoot(config), { persist: false }) : Promise.resolve(null),
|
|
189
|
+
]);
|
|
190
|
+
const publicCapability = publicResult.status === 'fulfilled' ? publicResult.value : null;
|
|
191
|
+
let installationCapability = null;
|
|
192
|
+
if (diagnosticResult.status === 'fulfilled' && diagnosticResult.value && typeof diagnosticResult.value === 'object') {
|
|
193
|
+
const diagnostic = diagnosticResult.value;
|
|
194
|
+
installationCapability = diagnostic.capabilities && typeof diagnostic.capabilities === 'object' ? diagnostic.capabilities : null;
|
|
195
|
+
}
|
|
196
|
+
let releaseMetadata = null;
|
|
197
|
+
let releaseEligible = false;
|
|
198
|
+
if (releaseResult.status === 'fulfilled' && releaseResult.value && typeof releaseResult.value === 'object') {
|
|
199
|
+
const result = releaseResult.value;
|
|
200
|
+
const envelope = result.envelope;
|
|
201
|
+
const manifest = envelope?.manifest;
|
|
202
|
+
const currentSupported = manifest ? compareVersions(CLI_VERSION, manifest.minimum_supported_cli) : null;
|
|
203
|
+
const blocked = Boolean(manifest?.blocked_artifacts.some(item => item.artifact_kind === 'cli_package' && item.version === CLI_VERSION && item.platform === 'any' && item.architecture === 'any'));
|
|
204
|
+
releaseEligible = Boolean(envelope && (result.state === 'live' || result.state === 'cached') && currentSupported !== null && currentSupported >= 0 && !blocked);
|
|
205
|
+
const comparison = manifest ? compareVersions(CLI_VERSION, manifest.recommended_cli) : null;
|
|
206
|
+
releaseMetadata = { state: result.state, observed_at: releaseEligible ? new Date().toISOString() : null, sequence: manifest?.sequence ?? null, minimum_supported_version: manifest?.minimum_supported_cli ?? null, recommended_version: manifest?.recommended_cli ?? null, update_available: comparison === null ? null : comparison < 0 };
|
|
207
|
+
}
|
|
208
|
+
else if (manifestVersion !== null && manifestVersion >= 0) {
|
|
209
|
+
releaseMetadata = { state: 'unavailable', observed_at: null, sequence: null, minimum_supported_version: null, recommended_version: null, update_available: null };
|
|
210
|
+
}
|
|
211
|
+
return buildLocalStatus(config, { ...options, publicCapability, installationCapability, releaseEligible, releaseMetadata });
|
|
212
|
+
}
|
|
213
|
+
//# sourceMappingURL=status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../src/status.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,uBAAuB,EAA2D,MAAM,mBAAmB,CAAC;AACrH,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAS/C,MAAM,cAAc,GAAG,IAAI,GAAG,CAAe,CAAC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC,CAAC;AAElH,SAAS,SAAS,CAAC,KAAc,IAAI,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AAC7H,SAAS,KAAK,CAAC,KAA6D,EAAE,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE;IAC5F,MAAM,QAAQ,GAAG,SA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QAAQ,CAAC,IAAI,gBAAgB,KAAK,IAAI,IAAI,gBAAgB,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAChK,MAAM,UAAU,GAAG,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,WAAW,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAC5F,eAAe,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,WAAW,EAAE,eAAe,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,IAAI,IAAI,EAAE,yBAAyB,EAAE,QAAQ,EAAE,qBAAqB,IAAI,IAAI,EAAE,mBAAmB,EAAE,QAAQ,EAAE,eAAe,IAAI,IAAI,EAAE,gBAAgB,EAAE,UAAU,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,GAAG,CAAC,EAAE,CAAC;IAC7U,CAAC;SAAM,IAAI,eAAe,KAAK,IAAI,IAAI,eAAe,IAAI,CAAC,EAAE,CAAC;QAC5D,eAAe,GAAG,EAAE,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,yBAAyB,EAAE,IAAI,EAAE,mBAAmB,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC;IACpK,CAAC;IACD,OAAO,gBAAgB,CAAC,MAAM,EAAE,EAAE,GAAG,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,eAAe,EAAE,eAAe,EAAE,CAAC,CAAC;AAC9H,CAAC"}
|
package/dist/store.d.ts
CHANGED
|
@@ -1,24 +1,66 @@
|
|
|
1
|
+
import { type InstallationCredentialBackend, type SecureBackend, type SecurePurpose } from './secure-store.js';
|
|
1
2
|
export type ClientFamily = 'codex' | 'claude_code' | 'cursor' | 'vscode' | 'terminal' | 'unknown';
|
|
3
|
+
export type LocalMode = 'unconfigured' | 'active' | 'read-only' | 'paused' | 'revocation_pending' | 'off';
|
|
4
|
+
export type CredentialBackend = 'keychain' | 'file' | 'environment';
|
|
5
|
+
export type V2Installation = {
|
|
6
|
+
support_code: string;
|
|
7
|
+
approved_api_origin: string;
|
|
8
|
+
credential_backend: InstallationCredentialBackend;
|
|
9
|
+
credential_account_handle: string;
|
|
10
|
+
consent_version: 2;
|
|
11
|
+
consented_scopes: string[];
|
|
12
|
+
consent_policy_digest: string;
|
|
13
|
+
approved_at: string;
|
|
14
|
+
automatic_lookup: boolean;
|
|
15
|
+
automatic_sharing: boolean;
|
|
16
|
+
};
|
|
2
17
|
export type VectleConfig = {
|
|
18
|
+
schema_version?: 'vectle-config-v2';
|
|
3
19
|
endpoint: string;
|
|
4
20
|
contributorId?: string;
|
|
5
21
|
displayName?: string;
|
|
6
22
|
identityScope?: 'project' | 'global';
|
|
7
23
|
clientFamily: ClientFamily;
|
|
8
24
|
queryAnalytics: boolean;
|
|
9
|
-
|
|
25
|
+
operationalAnalytics?: boolean;
|
|
26
|
+
query_analytics?: boolean;
|
|
27
|
+
operational_analytics?: boolean;
|
|
28
|
+
mode?: LocalMode;
|
|
29
|
+
rollout_seed?: string;
|
|
30
|
+
installation?: V2Installation | null;
|
|
31
|
+
adapterEntryId?: string;
|
|
32
|
+
integrationBindingDigest?: string;
|
|
33
|
+
policyChecksum?: string;
|
|
34
|
+
stateRoot?: string;
|
|
35
|
+
credentialBackend?: CredentialBackend;
|
|
10
36
|
authorizationMode?: 'standing' | 'per_write';
|
|
11
37
|
authorizationExpiresAt?: string;
|
|
12
38
|
lastUpdateNoticeVersion?: string;
|
|
13
39
|
lastUpdateNoticeAt?: string;
|
|
40
|
+
/** Internal, local-only fields. They are never written by the v2 serializer. */
|
|
41
|
+
config_source?: 'legacy_v1' | 'v2';
|
|
42
|
+
configCorrupt?: boolean;
|
|
14
43
|
};
|
|
15
44
|
export declare function configDirectory(): string;
|
|
16
45
|
export declare function configPath(): string;
|
|
17
46
|
export declare function defaultConfig(): VectleConfig;
|
|
18
47
|
export declare function loadConfig(): VectleConfig;
|
|
48
|
+
/**
|
|
49
|
+
* Read the minimal v2 config projection bound to an explicit state root.
|
|
50
|
+
* Managed MCP and lifecycle processes use this instead of trusting an
|
|
51
|
+
* ambient VECTLE_CONFIG_DIR selected by the host.
|
|
52
|
+
*/
|
|
53
|
+
export declare function loadBoundConfig(root: string): VectleConfig | null;
|
|
19
54
|
export declare function saveConfig(config: VectleConfig): void;
|
|
20
55
|
export declare function keychainAvailable(): "keychain" | "file" | "environment" | null;
|
|
21
56
|
export declare function storeCredential(token: string, allowFileFallback?: boolean): VectleConfig['credentialBackend'];
|
|
22
57
|
export declare function readCredential(): string | null;
|
|
23
58
|
export declare function deleteCredential(): void;
|
|
24
|
-
export declare function credentialBackendDescription():
|
|
59
|
+
export declare function credentialBackendDescription(): CredentialBackend | "environment override" | "not configured";
|
|
60
|
+
export declare function installationCredentialAccount(config: Pick<VectleConfig, 'endpoint' | 'installation'>): string;
|
|
61
|
+
export declare function storeInstallationCredential(token: string, config: Pick<VectleConfig, 'endpoint' | 'installation'>, allowFileFallback?: boolean): InstallationCredentialBackend;
|
|
62
|
+
export declare function readInstallationCredential(config: Pick<VectleConfig, 'endpoint' | 'installation'>): string | null;
|
|
63
|
+
export declare function deleteInstallationCredential(config: Pick<VectleConfig, 'endpoint' | 'installation'>): void;
|
|
64
|
+
export declare function storeTransientCredential(secret: string, config: Pick<VectleConfig, 'endpoint' | 'installation'>, purpose: SecurePurpose, operationId: string, expiresAt: string, allowFileFallback?: boolean): import("./secure-store.js").SecureStoreHandle;
|
|
65
|
+
export declare function readTransientCredential(config: Pick<VectleConfig, 'endpoint' | 'installation'>, purpose: SecurePurpose, operationId: string, backend?: SecureBackend): string | null;
|
|
66
|
+
export declare function deleteTransientCredential(config: Pick<VectleConfig, 'endpoint' | 'installation'>, purpose: SecurePurpose, operationId: string, backend?: SecureBackend): void;
|