@xopcai/xopc 0.0.175 → 0.0.176
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/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-CM6mQUS2.js → activity-store-DsFM1upC.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-eckyE9AY.js → agent-avatar-dicebear-DvdMLOga.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-D-OIB_r0.js → agents-BVjlpbeZ.js} +1 -1
- package/dist/gateway/static/root/assets/{api-BfMRS6FX.js → api-BdPLCCBm.js} +1 -1
- package/dist/gateway/static/root/assets/{api-2SLLStKp.js → api-Bop4IQRW.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-DYkzZQzZ.js → app-management-settings-panel-DMLDOHul.js} +1 -1
- package/dist/gateway/static/root/assets/appearance-settings-DbI9foFR.js +1 -0
- package/dist/gateway/static/root/assets/{apps-page-CuvFyvuu.js → apps-page-njqxLWYD.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-k909a76t.js → archive-plugin-Dfdxuwvb.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-CqNzyhdJ.js → attachment-load-Dn3RlnYD.js} +2 -2
- package/dist/gateway/static/root/assets/{attachment-preview-renderer-DonnL2dL.js → attachment-preview-renderer-Cmo-5BP5.js} +2 -2
- package/dist/gateway/static/root/assets/{attachment-process-heavy-RnGYy9bC.js → attachment-process-heavy-B2_kr5EA.js} +3 -3
- package/dist/gateway/static/root/assets/{automation-suggestion-card-snNG6u0v.js → automation-suggestion-card-Bc0Y7A9u.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-DetGVTjI.js → automations-page-D-eweHZJ.js} +1 -1
- package/dist/gateway/static/root/assets/{binary-plugins-PfQ9ZHDF.js → binary-plugins-0XtB-xC0.js} +2 -2
- package/dist/gateway/static/root/assets/{block-editor-Xrw-DnE_.js → block-editor-C4fXWbEE.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-G92AdEnX.js → browser-settings-page-lC86-drr.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflow-inputs-DJPF2lUY.js → browser-workflow-inputs-CZmzNymN.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-BoXs4pgc.js → browser-workflows-page-CBYM9HqG.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-nS_AMN1K.js → capabilities-settings-panel-6tYNfHqJ.js} +2 -2
- package/dist/gateway/static/root/assets/{capability-presets-api-BgY-Ysmi.js → capability-presets-api-BiJxmmhW.js} +1 -1
- package/dist/gateway/static/root/assets/{capability-presets-settings-panel-DIO8ZNHW.js → capability-presets-settings-panel-Co-ymbd9.js} +1 -1
- package/dist/gateway/static/root/assets/{channel-recipient-api-D32T1EJM.js → channel-recipient-api-BKTUZDp-.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-settings-4Im3vtnO.js → channels-settings-D46eVjaQ.js} +1 -1
- package/dist/gateway/static/root/assets/channels-status-swr-BMRAO4zZ.js +1 -0
- package/dist/gateway/static/root/assets/{connector-logo-C-l8haIK.js → connector-logo-Pr4RIKjj.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-vL3SjHSc.js → connectors-page-Dw1eYbRi.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-CwOI_Hei.js → desktop-pet-B8cZuQUt.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-Cldo_pA3.js → desktop-pet-settings-CEQacUDF.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-CMASXbgJ.js → directory-picker-path-field-DWnxdZtc.js} +1 -1
- package/dist/gateway/static/root/assets/{dreaming-settings-BnMx02w0.js → dreaming-settings-D2e2w2Ho.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-mUFs3ign.js → extension-debug-page-BLjTGbv3.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-BsFBOZ5N.js → extension-page-D2_UC6hy.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-CTEoovnV.js → extension-settings-page-BsH6o_PX.js} +1 -1
- package/dist/gateway/static/root/assets/{focus-detail-page-CCaZthpU.js → focus-detail-page-BBXUtxRB.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-Bwx-EetD.js → gateway-config-api-C-DkC6UJ.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-CvgyqhR_.js → gateway-settings-DEOGiimF.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-C8f5KwkT.js → gateway-startup-retry-BlSLh1TF.js} +1 -1
- package/dist/gateway/static/root/assets/{goal-create-dialog-Bhynl9LN.js → goal-create-dialog-CSFcRE_N.js} +1 -1
- package/dist/gateway/static/root/assets/{goal-detail-page-ChS2rU0w.js → goal-detail-page-VjRArfAJ.js} +1 -1
- package/dist/gateway/static/root/assets/{goals-config-api-CUnfbgHa.js → goals-config-api-CcdS9qek.js} +1 -1
- package/dist/gateway/static/root/assets/{goals-page-BAS_liXl.js → goals-page-BAcErdch.js} +1 -1
- package/dist/gateway/static/root/assets/{goals-settings-Bkk-tOcf.js → goals-settings-BY7crl0z.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-D9Pldf5E.js → heartbeat-settings-DtTkS0gs.js} +1 -1
- package/dist/gateway/static/root/assets/{image-generation-api-D7aCMgOv.js → image-generation-api-WGgkbwDZ.js} +1 -1
- package/dist/gateway/static/root/assets/index-2UImfRDC.js +212 -0
- package/dist/gateway/static/root/assets/index-CS9sVShT.css +1 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-CBhtXhHb.js → keyboard-shortcuts-settings-C5lpWQ3f.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-HQeu_F1C.js → local-app-workbench-page-Cl0fcPL4.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-BtJGF3M8.js → local-apps-page-b05wWvXG.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-DO-u1yS7.js → locale-store-sToMfHX_.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-0lvwfLAA.js → logs-page-cDE1jLJv.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-split-BGPaeTch.js → markdown-split-0gPVst5y.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-C_Cx8v6u.js → media-plugins-Rxyq_KTm.js} +1 -1
- package/dist/gateway/static/root/assets/messages-CarlxqXV.js +3 -0
- package/dist/gateway/static/root/assets/{notes-page-CIYy5BKF.js → notes-page-DRhNDl_Q.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-workbench-_FgNPlOx.js → notes-workbench-BKNBk0Uf.js} +2 -2
- package/dist/gateway/static/root/assets/{page-tabs-C2vsdfJO.js → page-tabs-cOEOQqHh.js} +1 -1
- package/dist/gateway/static/root/assets/pdf-D4PI9qAw.js +54 -0
- package/dist/gateway/static/root/assets/pdf.worker.min-CHFwMXne.mjs +29 -0
- package/dist/gateway/static/root/assets/{preview-open-alternatives-D_VT83bW.js → preview-open-alternatives-BopOLFvu.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-BNP9kZ3Q.js → product-open-page-DWVPmmOq.js} +1 -1
- package/dist/gateway/static/root/assets/{project-detail-page-MNi-3mZU.js → project-detail-page-BhjEXNQW.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-xx8nUKZO.js → projects-page-B80e69PH.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-H5DSn2bR.js → remote-access-hub-CwdVob6H.js} +1 -1
- package/dist/gateway/static/root/assets/{save-bar-controls-BJL6Xb-F.js → save-bar-controls-BfZmKe1t.js} +1 -1
- package/dist/gateway/static/root/assets/{schedule-field-CxCPSLbu.js → schedule-field-Cpi4jCRV.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-Cao1wGbk.js → schema-form-OXFkcZQe.js} +1 -1
- package/dist/gateway/static/root/assets/{sessions-page-CMQsupwM.js → sessions-page-BGt3Asj6.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-BnTdM9Nn.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-9pgClEud.js → settings-form-section-BwqkZCHJ.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-CQz0gEUK.js → settings-loading-skeleton-BbqH_S3Y.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-DgsMzZLm.js → settings-page-BoxC-JSa.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-BhqupMfG.js → settings-page-layout-Ddu2iGaW.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-B7BsWxJt.js → setup-status-panel-z1Lwv0js.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-CC4dQsQN.js → share-preview-page-CVazOFjy.js} +2 -2
- package/dist/gateway/static/root/assets/{shares-settings-Bhz21P05.js → shares-settings-C4lXuyQj.js} +1 -1
- package/dist/gateway/static/root/assets/skill-reload-api-DSuIDkeI.js +1 -0
- package/dist/gateway/static/root/assets/{skills-page-A0rNObNB.js → skills-page-xgZczqVe.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page.utils-CF4AYPQg.js → skills-page.utils-DgyB1tSo.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-CzZHWI4u.js → system-settings-panel-BoLSQL65.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-BZWNdSZC.js → theme-store-CBNcGOfj.js} +1 -1
- package/dist/gateway/static/root/assets/{time-picker-BC922Mdg.js → time-picker-gochWrny.js} +1 -1
- package/dist/gateway/static/root/assets/{typed-models-lib-C1S-B1pk.js → typed-models-lib-DvRnr7YB.js} +1 -1
- package/dist/gateway/static/root/assets/{use-channel-catalog-DTiLxcLF.js → use-channel-catalog-CA9BFVB7.js} +1 -1
- package/dist/gateway/static/root/assets/{user-context-page-8XdpiAyP.js → user-context-page-CEfIy4WZ.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-CtIYRNfI.js → voice-api-key-field-v8tgylEZ.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-page-DBer86NF.js → work-discovery-page-B-3MClaf.js} +1 -1
- package/dist/gateway/static/root/assets/{work-item-detail-page-BUPyfYaq.js → work-item-detail-page-CEsFEdax.js} +1 -1
- package/dist/gateway/static/root/assets/work-page-CT9AHnq6.js +3 -0
- package/dist/gateway/static/root/assets/workflow-run-setup-panel-CC3cJn5k.js +3 -0
- package/dist/gateway/static/root/assets/{workflows-page-CNls7g6v.js → workflows-page-C-1-_Zp1.js} +1 -1
- package/dist/gateway/static/root/index.html +7 -7
- package/dist/package.js +1 -1
- package/dist/src/agent/agent-manager.js +7 -7
- package/dist/src/agent/context/execution-scope.d.ts +26 -0
- package/dist/src/agent/context/execution-scope.js +84 -0
- package/dist/src/agent/context/project-context.d.ts +3 -1
- package/dist/src/agent/context/project-context.js +26 -8
- package/dist/src/agent/embedded/model-runtime.d.ts +1 -2
- package/dist/src/agent/embedded/model-runtime.js +17 -29
- package/dist/src/agent/embedded/session-runner.js +2 -3
- package/dist/src/agent/prompt/service-prompt-builder.js +1 -0
- package/dist/src/agent/prompt/system-prompt.js +1 -1
- package/dist/src/agent/service/process-direct-streaming.js +7 -4
- package/dist/src/agent/session/session-config-service.d.ts +4 -1
- package/dist/src/agent/session/session-config-service.js +5 -3
- package/dist/src/agent/session/session-inspector.d.ts +6 -0
- package/dist/src/agent/session/session-inspector.js +9 -2
- package/dist/src/agent/workflow/subagent-runner.js +2 -0
- package/dist/src/agent/workflow/types.d.ts +1 -0
- package/dist/src/auth/model-credential-store.d.ts +17 -0
- package/dist/src/auth/model-credential-store.js +110 -0
- package/dist/src/auth/oauth/github-copilot.js +2 -2
- package/dist/src/auth/oauth/openai-codex.js +98 -7
- package/dist/src/auth/oauth/types.d.ts +4 -1
- package/dist/src/auth/oauth/xopc-cloud.js +124 -6
- package/dist/src/cli/commands/gateway/lifecycle.js +2 -2
- package/dist/src/cli/commands/update.js +1 -1
- package/dist/src/config/index.js +2 -2
- package/dist/src/config/schema.d.ts +21 -0
- package/dist/src/config/schema.js +12 -2
- package/dist/src/gateway/heartbeat/service.js +1 -1
- package/dist/src/gateway/hono/lib/config-payload.d.ts +3 -0
- package/dist/src/gateway/hono/lib/config-payload.js +1 -0
- package/dist/src/gateway/hono/oauth-async.d.ts +5 -0
- package/dist/src/gateway/hono/oauth-async.js +20 -8
- package/dist/src/gateway/hono/routes/config-patch/gateway.d.ts +1 -1
- package/dist/src/gateway/hono/routes/config-patch/gateway.js +9 -0
- package/dist/src/gateway/hono/routes/goals.js +13 -0
- package/dist/src/gateway/hono/routes/local-apps.js +1 -1
- package/dist/src/gateway/hono/routes/update.js +2 -2
- package/dist/src/gateway/index.js +1 -1
- package/dist/src/gateway/run-loop.js +1 -1
- package/dist/src/gateway/service/sessions-api.d.ts +2 -1
- package/dist/src/gateway/service.js +5 -5
- package/dist/src/heartbeat/index.js +1 -1
- package/dist/src/infra/gateway-processes.js +1 -1
- package/dist/src/infra/update-restart.js +2 -2
- package/dist/src/infra/update-runner.js +2 -2
- package/dist/src/infra/update-startup.js +1 -1
- package/dist/src/mcp/channel-bridge.js +1 -1
- package/dist/src/providers/index.js +4 -2
- package/dist/src/providers/provider-auth-service.d.ts +22 -0
- package/dist/src/providers/provider-auth-service.js +66 -0
- package/dist/src/providers/register-runtime-providers.d.ts +6 -0
- package/dist/src/providers/register-runtime-providers.js +55 -0
- package/dist/src/providers/xopc-cloud-account-service.d.ts +2 -2
- package/dist/src/providers/xopc-cloud-account-service.js +6 -5
- package/dist/src/providers/xopc-cloud-config.d.ts +3 -0
- package/dist/src/providers/xopc-cloud-config.js +13 -0
- package/dist/src/providers/xopc-cloud-model-source.d.ts +2 -2
- package/dist/src/providers/xopc-cloud-model-source.js +6 -5
- package/dist/src/session/index.d.ts +1 -1
- package/dist/src/session/index.js +2 -2
- package/dist/src/session/thinking-resolve.d.ts +8 -0
- package/dist/src/session/thinking-resolve.js +6 -3
- package/dist/src/tui/tui.js +2 -2
- package/dist/src/tui/xopc-tui-keybindings.d.ts +44 -4
- package/dist/src/workflows/engine/workflow-engine.d.ts +1 -0
- package/dist/src/workflows/engine/workflow-engine.js +2 -0
- package/dist/src/workflows/service/workflow-run-service.js +12 -6
- package/dist/src/workflows/service/workflow-session-bridge.js +2 -1
- package/package.json +5 -5
- package/dist/gateway/static/root/assets/appearance-settings-CDXXN57j.js +0 -1
- package/dist/gateway/static/root/assets/channels-status-swr-CMctpuqb.js +0 -1
- package/dist/gateway/static/root/assets/index-DJ5vdaHk.css +0 -1
- package/dist/gateway/static/root/assets/index-TnouSpay.js +0 -212
- package/dist/gateway/static/root/assets/messages-BP8aQX-5.js +0 -3
- package/dist/gateway/static/root/assets/pdf-epILhEOn.js +0 -54
- package/dist/gateway/static/root/assets/pdf.worker.min-iDqQPrd3.mjs +0 -31
- package/dist/gateway/static/root/assets/settings-advanced-gate-OBUdG6bV.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-CBP-UB88.js +0 -1
- package/dist/gateway/static/root/assets/work-page-G8phwwI1.js +0 -1
- package/dist/gateway/static/root/assets/workflow-run-setup-panel-IKxqDAXw.js +0 -3
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { CredentialResolver, init_credentials } from "./credentials.js";
|
|
3
|
+
//#region src/auth/model-credential-store.ts
|
|
4
|
+
function normalizeProviderId(providerId) {
|
|
5
|
+
return providerId.toLowerCase();
|
|
6
|
+
}
|
|
7
|
+
function toRuntimeCredential(token) {
|
|
8
|
+
const { type: _type, provider: _provider, expiresAt, createdAt: _createdAt, updatedAt: _updatedAt, ...credential } = token;
|
|
9
|
+
return {
|
|
10
|
+
...credential,
|
|
11
|
+
type: "oauth",
|
|
12
|
+
access: token.access,
|
|
13
|
+
refresh: token.refresh ?? "",
|
|
14
|
+
expires: expiresAt ?? Number.MAX_SAFE_INTEGER
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function toPersistedToken(credential, current) {
|
|
18
|
+
const { type: _type, expires, ...token } = credential;
|
|
19
|
+
let previous = {};
|
|
20
|
+
if (current) {
|
|
21
|
+
const { type: _previousType, expires: _previousExpires, ...previousFields } = toRuntimeCredential(current);
|
|
22
|
+
previous = previousFields;
|
|
23
|
+
}
|
|
24
|
+
return {
|
|
25
|
+
...previous,
|
|
26
|
+
...token,
|
|
27
|
+
access: credential.access,
|
|
28
|
+
refresh: credential.refresh || void 0,
|
|
29
|
+
expiresAt: expires,
|
|
30
|
+
createdAt: current?.createdAt ?? (/* @__PURE__ */ new Date()).toISOString()
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
async function serializeProviderModification(providerId, operation) {
|
|
34
|
+
const previous = providerModificationTails.get(providerId) ?? Promise.resolve();
|
|
35
|
+
let release;
|
|
36
|
+
const gate = new Promise((resolve) => {
|
|
37
|
+
release = resolve;
|
|
38
|
+
});
|
|
39
|
+
const tail = previous.catch(() => void 0).then(() => gate);
|
|
40
|
+
providerModificationTails.set(providerId, tail);
|
|
41
|
+
await previous.catch(() => void 0);
|
|
42
|
+
try {
|
|
43
|
+
return await operation();
|
|
44
|
+
} finally {
|
|
45
|
+
release();
|
|
46
|
+
if (providerModificationTails.get(providerId) === tail) providerModificationTails.delete(providerId);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
var providerModificationTails, XopcModelCredentialStore;
|
|
50
|
+
var init_model_credential_store = __esmMin((() => {
|
|
51
|
+
init_credentials();
|
|
52
|
+
providerModificationTails = /* @__PURE__ */ new Map();
|
|
53
|
+
XopcModelCredentialStore = class {
|
|
54
|
+
runtimeApiKeys = /* @__PURE__ */ new Map();
|
|
55
|
+
constructor(repository = new CredentialResolver()) {
|
|
56
|
+
this.repository = repository;
|
|
57
|
+
}
|
|
58
|
+
async read(providerId, options) {
|
|
59
|
+
options?.signal?.throwIfAborted();
|
|
60
|
+
const normalizedProvider = normalizeProviderId(providerId);
|
|
61
|
+
const runtimeApiKey = this.runtimeApiKeys.get(normalizedProvider);
|
|
62
|
+
if (runtimeApiKey) return runtimeApiKey;
|
|
63
|
+
const token = await this.repository.loadOAuthTokenRecord(normalizedProvider);
|
|
64
|
+
options?.signal?.throwIfAborted();
|
|
65
|
+
return token ? toRuntimeCredential(token) : void 0;
|
|
66
|
+
}
|
|
67
|
+
async list(options) {
|
|
68
|
+
options?.signal?.throwIfAborted();
|
|
69
|
+
const oauthTokens = await this.repository.listOAuthTokens();
|
|
70
|
+
options?.signal?.throwIfAborted();
|
|
71
|
+
const credentials = /* @__PURE__ */ new Map();
|
|
72
|
+
for (const token of oauthTokens) credentials.set(normalizeProviderId(token.provider), {
|
|
73
|
+
providerId: normalizeProviderId(token.provider),
|
|
74
|
+
type: "oauth"
|
|
75
|
+
});
|
|
76
|
+
for (const providerId of this.runtimeApiKeys.keys()) credentials.set(providerId, {
|
|
77
|
+
providerId,
|
|
78
|
+
type: "api_key"
|
|
79
|
+
});
|
|
80
|
+
return [...credentials.values()];
|
|
81
|
+
}
|
|
82
|
+
async modify(providerId, update, options) {
|
|
83
|
+
const normalizedProvider = normalizeProviderId(providerId);
|
|
84
|
+
return serializeProviderModification(normalizedProvider, async () => {
|
|
85
|
+
options?.signal?.throwIfAborted();
|
|
86
|
+
const persisted = await this.repository.loadOAuthTokenRecord(normalizedProvider);
|
|
87
|
+
const current = this.runtimeApiKeys.get(normalizedProvider) ?? (persisted ? toRuntimeCredential(persisted) : void 0);
|
|
88
|
+
const updated = await update(current);
|
|
89
|
+
options?.signal?.throwIfAborted();
|
|
90
|
+
if (!updated) return current;
|
|
91
|
+
if (updated.type === "oauth") {
|
|
92
|
+
await this.repository.saveOAuthToken(normalizedProvider, toPersistedToken(updated, persisted));
|
|
93
|
+
this.runtimeApiKeys.delete(normalizedProvider);
|
|
94
|
+
} else this.runtimeApiKeys.set(normalizedProvider, updated);
|
|
95
|
+
return updated;
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
async delete(providerId, options) {
|
|
99
|
+
const normalizedProvider = normalizeProviderId(providerId);
|
|
100
|
+
await serializeProviderModification(normalizedProvider, async () => {
|
|
101
|
+
options?.signal?.throwIfAborted();
|
|
102
|
+
await this.repository.deleteOAuthToken(normalizedProvider);
|
|
103
|
+
this.runtimeApiKeys.delete(normalizedProvider);
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
}));
|
|
108
|
+
//#endregion
|
|
109
|
+
init_model_credential_store();
|
|
110
|
+
export { XopcModelCredentialStore, init_model_credential_store };
|
|
@@ -18,7 +18,7 @@ function fromPiCredential({ type: _type, ...credentials }) {
|
|
|
18
18
|
}
|
|
19
19
|
function toAuthInteraction(callbacks) {
|
|
20
20
|
return {
|
|
21
|
-
signal: callbacks.signal,
|
|
21
|
+
signal: callbacks.signal ?? new AbortController().signal,
|
|
22
22
|
async prompt(prompt) {
|
|
23
23
|
if (prompt.type === "select") return await callbacks.onSelect({
|
|
24
24
|
message: prompt.message,
|
|
@@ -57,7 +57,7 @@ var init_github_copilot = __esmMin((() => {
|
|
|
57
57
|
return fromPiCredential(await getCopilotOAuth().login(toAuthInteraction(callbacks)));
|
|
58
58
|
},
|
|
59
59
|
async refreshToken(credentials) {
|
|
60
|
-
return fromPiCredential(await getCopilotOAuth().refresh(toPiCredential(credentials)));
|
|
60
|
+
return fromPiCredential(await getCopilotOAuth().refresh(toPiCredential(credentials), new AbortController().signal));
|
|
61
61
|
},
|
|
62
62
|
getApiKey(credentials) {
|
|
63
63
|
return credentials.access;
|
|
@@ -2,12 +2,17 @@ import { __esmMin } from "../../../_virtual/_rolldown/runtime.js";
|
|
|
2
2
|
import { generatePKCE, init_pkce } from "./pkce.js";
|
|
3
3
|
import { randomBytes } from "node:crypto";
|
|
4
4
|
import http from "node:http";
|
|
5
|
+
import { setTimeout as setTimeout$1 } from "node:timers/promises";
|
|
5
6
|
//#region src/auth/oauth/openai-codex.ts
|
|
6
7
|
/**
|
|
7
8
|
* OpenAI Codex (ChatGPT) OAuth.
|
|
8
9
|
*
|
|
9
10
|
* Owns callback validation, manual prompt handling, and success/error pages.
|
|
10
11
|
*/
|
|
12
|
+
function requestSignal(signal) {
|
|
13
|
+
const timeout = AbortSignal.timeout(TOKEN_REQUEST_TIMEOUT_MS);
|
|
14
|
+
return signal ? AbortSignal.any([signal, timeout]) : timeout;
|
|
15
|
+
}
|
|
11
16
|
function xopcOAuthHtml(params) {
|
|
12
17
|
const color = params.tone === "success" ? "#2563eb" : "#dc2626";
|
|
13
18
|
const escapedTitle = escapeHtml(params.title);
|
|
@@ -199,7 +204,7 @@ async function postTokenForm(body, signal) {
|
|
|
199
204
|
Accept: "application/json"
|
|
200
205
|
},
|
|
201
206
|
body,
|
|
202
|
-
signal: signal
|
|
207
|
+
signal: requestSignal(signal)
|
|
203
208
|
});
|
|
204
209
|
const contentType = response.headers.get("content-type") ?? "";
|
|
205
210
|
const text = await response.text();
|
|
@@ -207,15 +212,82 @@ async function postTokenForm(body, signal) {
|
|
|
207
212
|
if (!contentType.toLowerCase().includes("application/json")) throw new Error(`OpenAI Codex token response was not JSON: ${contentType || "missing content-type"}`);
|
|
208
213
|
return JSON.parse(text);
|
|
209
214
|
}
|
|
210
|
-
async function exchangeAuthorizationCode(code, verifier, signal) {
|
|
215
|
+
async function exchangeAuthorizationCode(code, verifier, signal, redirectUri = REDIRECT_URI) {
|
|
211
216
|
return normalizeTokenResponse(await postTokenForm(new URLSearchParams({
|
|
212
217
|
grant_type: "authorization_code",
|
|
213
218
|
client_id: CLIENT_ID,
|
|
214
219
|
code,
|
|
215
220
|
code_verifier: verifier,
|
|
216
|
-
redirect_uri:
|
|
221
|
+
redirect_uri: redirectUri
|
|
217
222
|
}), signal));
|
|
218
223
|
}
|
|
224
|
+
async function requestDeviceCode(signal) {
|
|
225
|
+
const response = await fetch(DEVICE_USER_CODE_URL, {
|
|
226
|
+
method: "POST",
|
|
227
|
+
headers: {
|
|
228
|
+
"Content-Type": "application/json",
|
|
229
|
+
Accept: "application/json"
|
|
230
|
+
},
|
|
231
|
+
body: JSON.stringify({ client_id: CLIENT_ID }),
|
|
232
|
+
signal: requestSignal(signal)
|
|
233
|
+
});
|
|
234
|
+
const body = await response.json().catch(() => ({}));
|
|
235
|
+
if (!response.ok) {
|
|
236
|
+
if (response.status === 404) throw new Error("OpenAI Codex device code login is not enabled. Enable it in ChatGPT security or workspace settings, or use browser login.");
|
|
237
|
+
throw new Error(body.error_description ?? body.error ?? `OpenAI Codex device code request failed (${response.status})`);
|
|
238
|
+
}
|
|
239
|
+
if (!body.device_auth_id || !body.user_code) throw new Error("OpenAI Codex device code response is incomplete");
|
|
240
|
+
const intervalSeconds = Number(body.interval);
|
|
241
|
+
return {
|
|
242
|
+
deviceAuthId: body.device_auth_id,
|
|
243
|
+
userCode: body.user_code,
|
|
244
|
+
intervalMs: Math.max(1, Number.isFinite(intervalSeconds) ? intervalSeconds : 5) * 1e3
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
async function pollDeviceAuthorization(params) {
|
|
248
|
+
const expiresAt = Date.now() + DEVICE_AUTH_TIMEOUT_MS;
|
|
249
|
+
while (Date.now() < expiresAt) {
|
|
250
|
+
if (params.signal?.aborted) throw params.signal.reason instanceof Error ? params.signal.reason : /* @__PURE__ */ new Error("OpenAI Codex login cancelled");
|
|
251
|
+
const response = await fetch(DEVICE_TOKEN_URL, {
|
|
252
|
+
method: "POST",
|
|
253
|
+
headers: {
|
|
254
|
+
"Content-Type": "application/json",
|
|
255
|
+
Accept: "application/json"
|
|
256
|
+
},
|
|
257
|
+
body: JSON.stringify({
|
|
258
|
+
device_auth_id: params.deviceAuthId,
|
|
259
|
+
user_code: params.userCode
|
|
260
|
+
}),
|
|
261
|
+
signal: requestSignal(params.signal)
|
|
262
|
+
});
|
|
263
|
+
const body = await response.json().catch(() => ({}));
|
|
264
|
+
if (response.ok) {
|
|
265
|
+
if (!body.authorization_code || !body.code_verifier) throw new Error("OpenAI Codex device authorization response is incomplete");
|
|
266
|
+
return {
|
|
267
|
+
code: body.authorization_code,
|
|
268
|
+
verifier: body.code_verifier
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
if (response.status !== 403 && response.status !== 404) throw new Error(body.error_description ?? body.error ?? `OpenAI Codex device authorization failed (${response.status})`);
|
|
272
|
+
const remainingMs = expiresAt - Date.now();
|
|
273
|
+
await setTimeout$1(Math.min(params.intervalMs, remainingMs), void 0, params.signal ? { signal: params.signal } : void 0);
|
|
274
|
+
}
|
|
275
|
+
throw new Error("OpenAI Codex device authorization timed out");
|
|
276
|
+
}
|
|
277
|
+
async function loginOpenAICodexWithDeviceCode(callbacks) {
|
|
278
|
+
const device = await requestDeviceCode(callbacks.signal);
|
|
279
|
+
callbacks.onDeviceCode({
|
|
280
|
+
userCode: device.userCode,
|
|
281
|
+
verificationUri: DEVICE_VERIFICATION_URL,
|
|
282
|
+
intervalSeconds: device.intervalMs / 1e3,
|
|
283
|
+
expiresInSeconds: DEVICE_AUTH_TIMEOUT_MS / 1e3
|
|
284
|
+
});
|
|
285
|
+
const authorization = await pollDeviceAuthorization({
|
|
286
|
+
...device,
|
|
287
|
+
signal: callbacks.signal
|
|
288
|
+
});
|
|
289
|
+
return exchangeAuthorizationCode(authorization.code, authorization.verifier, callbacks.signal, DEVICE_REDIRECT_URI);
|
|
290
|
+
}
|
|
219
291
|
async function refreshAccessToken(refreshToken) {
|
|
220
292
|
return normalizeTokenResponse(await postTokenForm(new URLSearchParams({
|
|
221
293
|
grant_type: "refresh_token",
|
|
@@ -258,7 +330,7 @@ function getAccountId(accessToken) {
|
|
|
258
330
|
return null;
|
|
259
331
|
}
|
|
260
332
|
}
|
|
261
|
-
async function
|
|
333
|
+
async function loginOpenAICodexWithBrowser(callbacks) {
|
|
262
334
|
const { verifier, state, url } = await createAuthorizationFlow();
|
|
263
335
|
const server = await startLocalOAuthServer(state);
|
|
264
336
|
try {
|
|
@@ -288,25 +360,44 @@ async function loginOpenAICodex(callbacks) {
|
|
|
288
360
|
server.close();
|
|
289
361
|
}
|
|
290
362
|
}
|
|
363
|
+
async function loginOpenAICodex(callbacks) {
|
|
364
|
+
return await callbacks.onSelect({
|
|
365
|
+
message: "Choose how to authorize OpenAI Codex",
|
|
366
|
+
options: [{
|
|
367
|
+
id: "browser",
|
|
368
|
+
label: "Browser (recommended for this device)"
|
|
369
|
+
}, {
|
|
370
|
+
id: "device_code",
|
|
371
|
+
label: "Device code (remote or headless)"
|
|
372
|
+
}]
|
|
373
|
+
}) === "device_code" ? loginOpenAICodexWithDeviceCode(callbacks) : loginOpenAICodexWithBrowser(callbacks);
|
|
374
|
+
}
|
|
291
375
|
async function refreshOpenAICodexToken(refreshToken) {
|
|
292
376
|
return refreshAccessToken(refreshToken);
|
|
293
377
|
}
|
|
294
|
-
var CLIENT_ID, AUTHORIZE_URL, TOKEN_URL, CALLBACK_PORT, CALLBACK_PATH, REDIRECT_URI, SCOPE, MANUAL_PROMPT_DELAY_MS, TOKEN_REQUEST_TIMEOUT_MS, openaiCodexOAuthProvider;
|
|
378
|
+
var CLIENT_ID, AUTH_BASE_URL, AUTHORIZE_URL, TOKEN_URL, DEVICE_USER_CODE_URL, DEVICE_TOKEN_URL, DEVICE_VERIFICATION_URL, DEVICE_REDIRECT_URI, CALLBACK_PORT, CALLBACK_PATH, REDIRECT_URI, SCOPE, MANUAL_PROMPT_DELAY_MS, TOKEN_REQUEST_TIMEOUT_MS, DEVICE_AUTH_TIMEOUT_MS, openaiCodexOAuthProvider;
|
|
295
379
|
var init_openai_codex = __esmMin((() => {
|
|
296
380
|
init_pkce();
|
|
297
381
|
CLIENT_ID = "app_EMoamEEZ73f0CkXaXp7hrann";
|
|
298
|
-
|
|
299
|
-
|
|
382
|
+
AUTH_BASE_URL = "https://auth.openai.com";
|
|
383
|
+
AUTHORIZE_URL = `${AUTH_BASE_URL}/oauth/authorize`;
|
|
384
|
+
TOKEN_URL = `${AUTH_BASE_URL}/oauth/token`;
|
|
385
|
+
DEVICE_USER_CODE_URL = `${AUTH_BASE_URL}/api/accounts/deviceauth/usercode`;
|
|
386
|
+
DEVICE_TOKEN_URL = `${AUTH_BASE_URL}/api/accounts/deviceauth/token`;
|
|
387
|
+
DEVICE_VERIFICATION_URL = `${AUTH_BASE_URL}/codex/device`;
|
|
388
|
+
DEVICE_REDIRECT_URI = `${AUTH_BASE_URL}/deviceauth/callback`;
|
|
300
389
|
CALLBACK_PORT = 1455;
|
|
301
390
|
CALLBACK_PATH = "/auth/callback";
|
|
302
391
|
REDIRECT_URI = `http://localhost:${CALLBACK_PORT}${CALLBACK_PATH}`;
|
|
303
392
|
SCOPE = "openid profile email offline_access";
|
|
304
393
|
MANUAL_PROMPT_DELAY_MS = 15e3;
|
|
305
394
|
TOKEN_REQUEST_TIMEOUT_MS = 3e4;
|
|
395
|
+
DEVICE_AUTH_TIMEOUT_MS = 15 * 6e4;
|
|
306
396
|
openaiCodexOAuthProvider = {
|
|
307
397
|
id: "openai-codex",
|
|
308
398
|
name: "OpenAI Codex",
|
|
309
399
|
usesCallbackServer: true,
|
|
400
|
+
loginMethods: ["browser", "device_code"],
|
|
310
401
|
async login(callbacks) {
|
|
311
402
|
return loginOpenAICodex(callbacks);
|
|
312
403
|
},
|
|
@@ -10,6 +10,7 @@ export type OAuthCredentials = {
|
|
|
10
10
|
[key: string]: unknown;
|
|
11
11
|
};
|
|
12
12
|
export type OAuthProviderId = string;
|
|
13
|
+
export type OAuthLoginMethod = 'browser' | 'device_code';
|
|
13
14
|
export type OAuthPrompt = {
|
|
14
15
|
message: string;
|
|
15
16
|
placeholder?: string;
|
|
@@ -49,8 +50,10 @@ export interface OAuthProviderInterface {
|
|
|
49
50
|
login(callbacks: OAuthLoginCallbacks): Promise<OAuthCredentials>;
|
|
50
51
|
/** Whether login uses a local callback server and supports manual code input. */
|
|
51
52
|
usesCallbackServer?: boolean;
|
|
53
|
+
/** Login methods exposed by providers that support more than one OAuth flow. */
|
|
54
|
+
loginMethods?: readonly OAuthLoginMethod[];
|
|
52
55
|
/** Refresh expired credentials, return updated credentials to persist */
|
|
53
|
-
refreshToken(credentials: OAuthCredentials): Promise<OAuthCredentials>;
|
|
56
|
+
refreshToken(credentials: OAuthCredentials, signal?: AbortSignal): Promise<OAuthCredentials>;
|
|
54
57
|
/** Convert credentials to API key string for the provider */
|
|
55
58
|
getApiKey(credentials: OAuthCredentials): string;
|
|
56
59
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { __esmMin } from "../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { generatePKCE, init_pkce } from "./pkce.js";
|
|
2
3
|
import { hostname } from "node:os";
|
|
3
|
-
import {
|
|
4
|
+
import { randomBytes } from "node:crypto";
|
|
5
|
+
import http from "node:http";
|
|
6
|
+
import { setTimeout as setTimeout$1 } from "node:timers/promises";
|
|
4
7
|
//#region src/auth/oauth/xopc-cloud.ts
|
|
5
8
|
function consoleUrl() {
|
|
6
9
|
return (process.env.XOPC_CONSOLE_URL ?? DEFAULT_CONSOLE_URL).replace(/\/+$/, "");
|
|
@@ -29,7 +32,106 @@ async function tokenRequest(body, signal) {
|
|
|
29
32
|
signal: signal ?? AbortSignal.timeout(3e4)
|
|
30
33
|
});
|
|
31
34
|
}
|
|
32
|
-
|
|
35
|
+
function callbackHtml(title, message) {
|
|
36
|
+
return `<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>${title}</title></head><body><main><h1>${title}</h1><p>${message}</p><p>You can close this window and return to XOPC.</p></main></body></html>`;
|
|
37
|
+
}
|
|
38
|
+
async function loginWithBrowser(callbacks) {
|
|
39
|
+
if (callbacks.signal?.aborted) throw callbacks.signal.reason instanceof Error ? callbacks.signal.reason : /* @__PURE__ */ new Error("XOPC OAuth login cancelled");
|
|
40
|
+
const { verifier, challenge } = await generatePKCE();
|
|
41
|
+
const state = randomBytes(24).toString("base64url");
|
|
42
|
+
let settle;
|
|
43
|
+
const callback = new Promise((resolve) => {
|
|
44
|
+
settle = resolve;
|
|
45
|
+
});
|
|
46
|
+
const server = http.createServer((request, response) => {
|
|
47
|
+
response.setHeader("content-type", "text/html; charset=utf-8");
|
|
48
|
+
try {
|
|
49
|
+
const url = new URL(request.url ?? "", "http://127.0.0.1");
|
|
50
|
+
if (url.pathname !== CALLBACK_PATH) {
|
|
51
|
+
response.statusCode = 404;
|
|
52
|
+
response.end(callbackHtml("Authorization callback not found", "This is not a valid XOPC OAuth callback URL."));
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const returnedState = url.searchParams.get("state");
|
|
56
|
+
const oauthError = url.searchParams.get("error");
|
|
57
|
+
const code = url.searchParams.get("code");
|
|
58
|
+
if (returnedState !== state) {
|
|
59
|
+
const error = /* @__PURE__ */ new Error("XOPC OAuth state mismatch");
|
|
60
|
+
response.statusCode = 400;
|
|
61
|
+
response.end(callbackHtml("Authorization failed", error.message));
|
|
62
|
+
settle?.({ error });
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
if (oauthError || !code) {
|
|
66
|
+
const error = /* @__PURE__ */ new Error(oauthError === "access_denied" ? "XOPC OAuth authorization was denied" : "XOPC OAuth callback did not include an authorization code");
|
|
67
|
+
response.statusCode = 400;
|
|
68
|
+
response.end(callbackHtml("Authorization failed", error.message));
|
|
69
|
+
settle?.({ error });
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
response.statusCode = 200;
|
|
73
|
+
response.end(callbackHtml("Authorization complete", "XOPC received the authorization callback successfully."));
|
|
74
|
+
settle?.({ code });
|
|
75
|
+
} catch {
|
|
76
|
+
const error = /* @__PURE__ */ new Error("XOPC OAuth callback could not be processed");
|
|
77
|
+
response.statusCode = 500;
|
|
78
|
+
response.end(callbackHtml("Authorization failed", error.message));
|
|
79
|
+
settle?.({ error });
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
const redirectUri = await new Promise((resolve, reject) => {
|
|
83
|
+
server.once("error", reject);
|
|
84
|
+
server.listen(0, "127.0.0.1", () => {
|
|
85
|
+
server.removeListener("error", reject);
|
|
86
|
+
const address = server.address();
|
|
87
|
+
if (!address || typeof address === "string") {
|
|
88
|
+
reject(/* @__PURE__ */ new Error("XOPC OAuth callback server did not expose a TCP port"));
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
resolve(`http://127.0.0.1:${address.port}${CALLBACK_PATH}`);
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
const authorizationUrl = new URL(`${consoleUrl()}/oauth/authorize`);
|
|
95
|
+
authorizationUrl.search = new URLSearchParams({
|
|
96
|
+
response_type: "code",
|
|
97
|
+
client_id: CLIENT_ID,
|
|
98
|
+
redirect_uri: redirectUri,
|
|
99
|
+
scope: DEFAULT_SCOPE,
|
|
100
|
+
code_challenge: challenge,
|
|
101
|
+
code_challenge_method: "S256",
|
|
102
|
+
state,
|
|
103
|
+
device_name: hostname() || "XOPC client",
|
|
104
|
+
client_type: "cli"
|
|
105
|
+
}).toString();
|
|
106
|
+
const timeout = setTimeout(() => settle?.({ error: /* @__PURE__ */ new Error("XOPC OAuth authorization timed out") }), AUTHORIZATION_TIMEOUT_MS);
|
|
107
|
+
timeout.unref?.();
|
|
108
|
+
const abort = () => settle?.({ error: callbacks.signal?.reason instanceof Error ? callbacks.signal.reason : /* @__PURE__ */ new Error("XOPC OAuth login cancelled") });
|
|
109
|
+
callbacks.signal?.addEventListener("abort", abort, { once: true });
|
|
110
|
+
try {
|
|
111
|
+
callbacks.onAuth({
|
|
112
|
+
url: authorizationUrl.toString(),
|
|
113
|
+
instructions: "Complete authorization in your browser. XOPC will finish automatically after the local callback."
|
|
114
|
+
});
|
|
115
|
+
const result = await callback;
|
|
116
|
+
if (result.error) throw result.error;
|
|
117
|
+
if (!result.code) throw new Error("XOPC OAuth callback did not include an authorization code");
|
|
118
|
+
const token = await tokenRequest(new URLSearchParams({
|
|
119
|
+
grant_type: "authorization_code",
|
|
120
|
+
client_id: CLIENT_ID,
|
|
121
|
+
code: result.code,
|
|
122
|
+
code_verifier: verifier,
|
|
123
|
+
redirect_uri: redirectUri
|
|
124
|
+
}), callbacks.signal);
|
|
125
|
+
const body = await readJson(token);
|
|
126
|
+
if (!token.ok) throw new Error(body.error_description ?? body.error ?? "XOPC OAuth token exchange failed");
|
|
127
|
+
return credentials(body);
|
|
128
|
+
} finally {
|
|
129
|
+
clearTimeout(timeout);
|
|
130
|
+
callbacks.signal?.removeEventListener("abort", abort);
|
|
131
|
+
server.close();
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
async function loginWithDeviceCode(callbacks) {
|
|
33
135
|
const response = await fetch(`${consoleUrl()}/oauth/device_authorization`, {
|
|
34
136
|
method: "POST",
|
|
35
137
|
headers: {
|
|
@@ -60,7 +162,7 @@ async function login(callbacks) {
|
|
|
60
162
|
});
|
|
61
163
|
while (Date.now() < expiresAt) {
|
|
62
164
|
if (callbacks.signal?.aborted) throw callbacks.signal.reason ?? /* @__PURE__ */ new Error("OAuth login cancelled");
|
|
63
|
-
await setTimeout(intervalMs, void 0, callbacks.signal ? { signal: callbacks.signal } : void 0);
|
|
165
|
+
await setTimeout$1(intervalMs, void 0, callbacks.signal ? { signal: callbacks.signal } : void 0);
|
|
64
166
|
const token = await tokenRequest(new URLSearchParams({
|
|
65
167
|
grant_type: "urn:ietf:params:oauth:grant-type:device_code",
|
|
66
168
|
client_id: CLIENT_ID,
|
|
@@ -73,24 +175,40 @@ async function login(callbacks) {
|
|
|
73
175
|
}
|
|
74
176
|
throw new Error("XOPC OAuth authorization expired");
|
|
75
177
|
}
|
|
76
|
-
async function
|
|
178
|
+
async function login(callbacks) {
|
|
179
|
+
return await callbacks.onSelect({
|
|
180
|
+
message: "Choose how to authorize XOPC Model Service",
|
|
181
|
+
options: [{
|
|
182
|
+
id: "browser",
|
|
183
|
+
label: "Browser (recommended for this device)"
|
|
184
|
+
}, {
|
|
185
|
+
id: "device_code",
|
|
186
|
+
label: "Device code (remote or headless)"
|
|
187
|
+
}]
|
|
188
|
+
}) === "device_code" ? loginWithDeviceCode(callbacks) : loginWithBrowser(callbacks);
|
|
189
|
+
}
|
|
190
|
+
async function refreshToken(current, signal) {
|
|
77
191
|
const response = await tokenRequest(new URLSearchParams({
|
|
78
192
|
grant_type: "refresh_token",
|
|
79
193
|
client_id: CLIENT_ID,
|
|
80
194
|
refresh_token: current.refresh
|
|
81
|
-
}));
|
|
195
|
+
}), signal);
|
|
82
196
|
const body = await readJson(response);
|
|
83
197
|
if (!response.ok) throw new Error(body.error_description ?? body.error ?? "XOPC OAuth refresh failed");
|
|
84
198
|
return credentials(body);
|
|
85
199
|
}
|
|
86
|
-
var CLIENT_ID, DEFAULT_CONSOLE_URL, DEFAULT_SCOPE, xopcCloudOAuthProvider;
|
|
200
|
+
var CLIENT_ID, DEFAULT_CONSOLE_URL, DEFAULT_SCOPE, CALLBACK_PATH, AUTHORIZATION_TIMEOUT_MS, xopcCloudOAuthProvider;
|
|
87
201
|
var init_xopc_cloud = __esmMin((() => {
|
|
202
|
+
init_pkce();
|
|
88
203
|
CLIENT_ID = "xopc-native";
|
|
89
204
|
DEFAULT_CONSOLE_URL = "https://console.xopc.ai";
|
|
90
205
|
DEFAULT_SCOPE = "models:read models:invoke account:usage offline_access";
|
|
206
|
+
CALLBACK_PATH = "/oauth/callback";
|
|
207
|
+
AUTHORIZATION_TIMEOUT_MS = 5 * 6e4;
|
|
91
208
|
xopcCloudOAuthProvider = {
|
|
92
209
|
id: "xopc-cloud",
|
|
93
210
|
name: "XOPC Model Service",
|
|
211
|
+
loginMethods: ["browser", "device_code"],
|
|
94
212
|
login,
|
|
95
213
|
refreshToken,
|
|
96
214
|
getApiKey: (value) => value.access
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { init_paths, resolveConfigPath } from "../../../config/paths.js";
|
|
2
2
|
import { loadConfig } from "../../../config/loader.js";
|
|
3
3
|
import "../../../config/index.js";
|
|
4
|
-
import { resolveGatewayService } from "../../../daemon/service.js";
|
|
5
4
|
import { isRestartEnabled } from "../../../config/commands.flags.js";
|
|
6
|
-
import {
|
|
5
|
+
import { resolveGatewayService } from "../../../daemon/service.js";
|
|
7
6
|
import { findVerifiedGatewayListenerPidsOnPortSync, formatGatewayPidList, signalVerifiedGatewayPidSync } from "../../../infra/gateway-processes.js";
|
|
7
|
+
import { authorizeGatewaySigusr1Restart, writeGatewayRestartIntentSync } from "../../../infra/restart.js";
|
|
8
8
|
import { runServiceRestart, runServiceStop } from "./lifecycle-core.js";
|
|
9
9
|
import { DEFAULT_RESTART_HEALTH_ATTEMPTS, renderGatewayPortHealthDiagnostics, waitForGatewayHealthyListener } from "./restart-health.js";
|
|
10
10
|
import { parsePortFromArgs, renderGatewayServiceStartHints, resolveGatewayPortFromConfig } from "./shared.js";
|
|
@@ -2,9 +2,9 @@ import { PACKAGE_VERSION, init_package_version } from "../../package-version.js"
|
|
|
2
2
|
import { loadConfig } from "../../config/loader.js";
|
|
3
3
|
import { formatExamples, register } from "../registry.js";
|
|
4
4
|
import "../../config/index.js";
|
|
5
|
-
import { acquireUpdateLock } from "../../infra/update-lock.js";
|
|
6
5
|
import { normalizeUpdateChannel } from "../../infra/update-channels.js";
|
|
7
6
|
import { compareSemver, resolveNpmChannelTag } from "../../infra/update-check.js";
|
|
7
|
+
import { acquireUpdateLock } from "../../infra/update-lock.js";
|
|
8
8
|
import { formatUpdateApiResult, resolveUpdateInstallSurface, runGatewayUpdateWithPostSteps } from "../../infra/update-runner.js";
|
|
9
9
|
import { Command } from "commander";
|
|
10
10
|
//#region src/cli/commands/update.ts
|
package/dist/src/config/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ENV_VARS, XOPC_DB_FILENAME, resolveHomeDir, resolveStateDir, resolveXopcDatabasePath } from "./paths-state.js";
|
|
2
2
|
import { TelegramAccountConfigSchema, TelegramConfigSchema, TelegramGroupConfigSchema, TelegramTopicConfigSchema } from "../../extensions/telegram/src/config-schema.js";
|
|
3
3
|
import { WeixinAccountConfigSchema, WeixinConfigSchema } from "../../extensions/weixin/src/config-schema.js";
|
|
4
|
-
import { AgentImageGenerationModelSchema, AgentModelRefSchema, AgentModelsSchema, AgentTypedModelRoleSchema, AgentsConfigSchema, BindingMatchSchema, BindingRuleSchema, BindingsConfigSchema, BrowserConfigSchema, ChannelsConfigSchema, CodeIntelligenceConfigSchema, CommandsConfigSchema, ConfigSchema, ConnectorsConfigSchema, ExperimentalConfigSchema, ExtensionSecurityConfigSchema, ExtensionSlotsConfigSchema, ExtensionsConfigSchema, GatewayAuthRateLimitSchema, GatewayAuthSchema, GatewayBindModeSchema, GatewayChannelConnectDeferModeSchema, GatewayConfigSchema, GatewayModeSchema, GatewayRemoteSchema, GatewaySecuritySchema, GatewayTailscaleConsentSchema, GatewayTailscaleSchema, GatewayTlsSchema, GatewayTrustedProxySchema, GoalNotificationEventSchema, GoalNotificationTargetSchema, GoalNotificationsConfigSchema, GoalsConfigSchema, HeartbeatConfigSchema, McpConfigSchema, McpServerSchema, MediaUnderstandingCapabilitiesSchema, MediaUnderstandingModelSchema, MessagesConfigSchema, ModelCatalogConfigSchema, ModelsDevConfigSchema, ProviderAuthConfigSchema, ProviderAzureConfigSchema, ProviderRequestOverridesSchema, ProvidersConfigSchema, STTConfigSchema, STTFallbackConfigSchema, STTProviderConfigSchema, SearchProviderEntrySchema, SessionConfigSchema, SessionDmScopeSchema, SessionResetByTypeSchema, SessionResetConfigSchema, SessionResetModeSchema, SessionScopeSchema, SessionStorageConfigSchema, TTSConfigSchema, TTSEdgeConfigSchema, TTSFallbackConfigSchema, TTSModelOverridesConfigSchema, TTSProviderConfigSchema, TTSSummarizationConfigSchema, ToolsConfigSchema, ToolsMediaAudioConfigSchema, ToolsMediaConfigSchema, TuiConfigSchema, TunnelConfigSchema, TunnelConsentSchema, UpdateAutoConfigSchema, UpdateConfigSchema, VoiceConfigSchema, VoiceRefinementConfigSchema, WebSearchConfigSchema, WebToolsConfigSchema, WebsiteBlocklistSchema, WorkspaceConfigSchema, WorkspaceImportConfigSchema, getAgentDefaultImageGenerationModelConfig, getAgentDefaultImageModelConfig, getAgentDefaultModelRef, init_schema, parseModelRef } from "./schema.js";
|
|
4
|
+
import { AgentImageGenerationModelSchema, AgentModelRefSchema, AgentModelsSchema, AgentTypedModelRoleSchema, AgentsConfigSchema, BindingMatchSchema, BindingRuleSchema, BindingsConfigSchema, BrowserConfigSchema, ChannelsConfigSchema, CodeIntelligenceConfigSchema, CommandsConfigSchema, ConfigSchema, ConnectorsConfigSchema, ExperimentalConfigSchema, ExtensionSecurityConfigSchema, ExtensionSlotsConfigSchema, ExtensionsConfigSchema, GatewayAuthRateLimitSchema, GatewayAuthSchema, GatewayBindModeSchema, GatewayChannelConnectDeferModeSchema, GatewayConfigSchema, GatewayModeSchema, GatewayRemoteSchema, GatewaySecuritySchema, GatewayTailscaleConsentSchema, GatewayTailscaleSchema, GatewayTlsSchema, GatewayTrustedProxySchema, GatewayWebchatConfigSchema, GoalNotificationEventSchema, GoalNotificationTargetSchema, GoalNotificationsConfigSchema, GoalsConfigSchema, HeartbeatConfigSchema, McpConfigSchema, McpServerSchema, MediaUnderstandingCapabilitiesSchema, MediaUnderstandingModelSchema, MessagesConfigSchema, ModelCatalogConfigSchema, ModelsDevConfigSchema, ProviderAuthConfigSchema, ProviderAzureConfigSchema, ProviderRequestOverridesSchema, ProvidersConfigSchema, STTConfigSchema, STTFallbackConfigSchema, STTProviderConfigSchema, SearchProviderEntrySchema, SessionConfigSchema, SessionDmScopeSchema, SessionResetByTypeSchema, SessionResetConfigSchema, SessionResetModeSchema, SessionScopeSchema, SessionStorageConfigSchema, TTSConfigSchema, TTSEdgeConfigSchema, TTSFallbackConfigSchema, TTSModelOverridesConfigSchema, TTSProviderConfigSchema, TTSSummarizationConfigSchema, ToolsConfigSchema, ToolsMediaAudioConfigSchema, ToolsMediaConfigSchema, TuiConfigSchema, TunnelConfigSchema, TunnelConsentSchema, UpdateAutoConfigSchema, UpdateConfigSchema, VoiceConfigSchema, VoiceRefinementConfigSchema, WebSearchConfigSchema, WebToolsConfigSchema, WebsiteBlocklistSchema, WorkspaceConfigSchema, WorkspaceImportConfigSchema, getAgentDefaultImageGenerationModelConfig, getAgentDefaultImageModelConfig, getAgentDefaultModelRef, init_schema, parseModelRef } from "./schema.js";
|
|
5
5
|
import { applyConfigOverrides, getConfigOverrides, resetConfigOverrides, setConfigOverride, unsetConfigOverride } from "./runtime-overrides.js";
|
|
6
6
|
import { expandWorkspacePathString, init_workspace_path, normalizeWorkspaceDir, resolveWorkspaceRoot } from "./workspace-path.js";
|
|
7
7
|
import { resolveDefaultAgentWorkspaceDir } from "./workspace-defaults.js";
|
|
@@ -27,4 +27,4 @@ init_workspace_path();
|
|
|
27
27
|
init_models_json();
|
|
28
28
|
init_resolve_config_value();
|
|
29
29
|
//#endregion
|
|
30
|
-
export { AgentImageGenerationModelSchema, AgentModelRefSchema, AgentModelsSchema, AgentTypedModelRoleSchema, AgentsConfigSchema, BASE_RELOAD_RULES, BindingMatchSchema, BindingRuleSchema, BindingsConfigSchema, BrowserConfigSchema, ChannelsConfigSchema, CodeIntelligenceConfigSchema, CommandsConfigSchema, ConfigHotReloader, ConfigSchema, ConnectorsConfigSchema, CustomModelSchema, ENV_VARS, ExperimentalConfigSchema, ExtensionSecurityConfigSchema, ExtensionSlotsConfigSchema, ExtensionsConfigSchema, FILENAMES, GatewayAuthRateLimitSchema, GatewayAuthSchema, GatewayBindModeSchema, GatewayChannelConnectDeferModeSchema, GatewayConfigSchema, GatewayModeSchema, GatewayRemoteSchema, GatewaySecuritySchema, GatewayTailscaleConsentSchema, GatewayTailscaleSchema, GatewayTlsSchema, GatewayTrustedProxySchema, GoalNotificationEventSchema, GoalNotificationTargetSchema, GoalNotificationsConfigSchema, GoalsConfigSchema, HeartbeatConfigSchema, ImageGenerationCapabilitiesSchema, ImageGenerationModelSchema, ImageGenerationProviderSchema, McpConfigSchema, McpServerSchema, MediaUnderstandingCapabilitiesSchema, MediaUnderstandingModelSchema, MessagesConfigSchema, ModelCatalogConfigSchema, ModelOverrideSchema, ModelsDevConfigSchema, ModelsJsonSchema, OpenAICompatSchema, OpenAICompletionsCompatSchema, OpenAIResponsesCompatSchema, OpenRouterRoutingSchema, ProfileManager, ProviderAuthConfigSchema, ProviderAzureConfigSchema, ProviderConfigSchema, ProviderRequestOverridesSchema, ProvidersConfigSchema, STTConfigSchema, STTFallbackConfigSchema, STTProviderConfigSchema, SearchProviderEntrySchema, SessionConfigSchema, SessionDmScopeSchema, SessionResetByTypeSchema, SessionResetConfigSchema, SessionResetModeSchema, SessionScopeSchema, SessionStorageConfigSchema, TTSConfigSchema, TTSEdgeConfigSchema, TTSFallbackConfigSchema, TTSModelOverridesConfigSchema, TTSProviderConfigSchema, TTSSummarizationConfigSchema, TelegramAccountConfigSchema, TelegramConfigSchema, TelegramGroupConfigSchema, TelegramTopicConfigSchema, ToolsConfigSchema, ToolsMediaAudioConfigSchema, ToolsMediaConfigSchema, TuiConfigSchema, TunnelConfigSchema, TunnelConsentSchema, USER_MEMORY_FILENAME, USER_PROFILE_FILENAME, UpdateAutoConfigSchema, UpdateConfigSchema, VercelGatewayRoutingSchema, VoiceConfigSchema, VoiceRefinementConfigSchema, WORKSPACE_FILES, WebSearchConfigSchema, WebToolsConfigSchema, WebsiteBlocklistSchema, WeixinAccountConfigSchema, WeixinConfigSchema, WorkspaceConfigSchema, WorkspaceImportConfigSchema, XOPC_DB_FILENAME, applyConfigOverrides, buildReloadPlan, canonicalizeConfiguredMcpServer, clearConfigValueCache, createProfile, deleteProfile, diffConfigPaths, existsSync, expandWorkspacePathString, extractProfileAgentId, formatThinkingLevels, getAgentDefaultImageGenerationModelConfig, getAgentDefaultImageModelConfig, getAgentDefaultModelRef, getAllowedCommands, getCacheStats, getConfigOverrides, getCurrentProfile, getDefaultModelValues, resolveModelsJsonPath as getModelsJsonPath, getProfileManager, getProfileNameFromDir, getSwitchCommand, getWorkspacePath, hasBundledExtensionManifest, isKnownCliMcpTypeAlias, listAgentProfileMarkdownDirs, listAgentWorkspaceDirs, listProfiles, listThinkingLevels, loadConfig, loadModelsJson, matchReloadRule, modelsJsonExists, normalizeConfiguredMcpServers, normalizeElevatedMode, normalizeReasoningLevel, normalizeThinkLevel, normalizeVerboseLevel, normalizeWorkspaceDir, parseModelRef, resetConfigOverrides, resolveAgentAuthProfilesPath, resolveAgentDir, resolveAgentDir$1 as resolveAgentDirFromConfig, resolveAgentHomeDir, resolveAgentHomeDir$1 as resolveAgentHomeDirFromConfig, resolveAgentProfileDir, resolveAgentProfileMarkdownPath, resolveAgentWorkspaceDir, resolveAuthProfilesPath, resolveBinDir, resolveBundledExtensionsDir, resolveBundledSkillsDir, resolveConfigPath, resolveConfigValue, resolveCredentialsDir, resolveDefaultAgentWorkspaceDir, resolveEffectiveAgentManifestForAgent, resolveEffectiveAgentManifestForSession, resolveEffectiveAgentProfile, resolveEffectiveAgentProfileForSession, resolveExtensionSdkPath, resolveExtensionsDir, resolveExtensionsLockPath, resolveHeaders, resolveHomeDir, resolveInboxDir, resolveInboxMessagePath, resolveInboxPendingDir, resolveInboxProcessedDir, resolveLogPath, resolveLogsDir, resolveModelsJsonPath, resolveNodeBinDir, resolveNodeBinPath, resolveNodeToolsDir, resolveNpmBinPath, resolveOAuthPath, resolvePidPath, resolveProfileStateDir, resolveSkillPath, resolveSkillsCachePath, resolveSkillsDir, resolveSkillsLockPath, resolveSocketPath, resolveStateDir, resolveStatusPath, resolveToolsDir, resolveUserDir, resolveUserMemoryPath, resolveUserProfilePath, resolveWorkspaceExtensionsDir, resolveWorkspaceFile, resolveWorkspaceRoot, resolveWorkspaceStateDir, resolveWorkspaceStatePath, resolveXopcBinPath, resolveXopcDatabasePath, resolveXopcMcpTransportAlias, saveConfig, saveModelsJson, setConfigOverride, testApiKeyResolution, thinkLevelToNumber, unsetConfigOverride, validateModelsConfig };
|
|
30
|
+
export { AgentImageGenerationModelSchema, AgentModelRefSchema, AgentModelsSchema, AgentTypedModelRoleSchema, AgentsConfigSchema, BASE_RELOAD_RULES, BindingMatchSchema, BindingRuleSchema, BindingsConfigSchema, BrowserConfigSchema, ChannelsConfigSchema, CodeIntelligenceConfigSchema, CommandsConfigSchema, ConfigHotReloader, ConfigSchema, ConnectorsConfigSchema, CustomModelSchema, ENV_VARS, ExperimentalConfigSchema, ExtensionSecurityConfigSchema, ExtensionSlotsConfigSchema, ExtensionsConfigSchema, FILENAMES, GatewayAuthRateLimitSchema, GatewayAuthSchema, GatewayBindModeSchema, GatewayChannelConnectDeferModeSchema, GatewayConfigSchema, GatewayModeSchema, GatewayRemoteSchema, GatewaySecuritySchema, GatewayTailscaleConsentSchema, GatewayTailscaleSchema, GatewayTlsSchema, GatewayTrustedProxySchema, GatewayWebchatConfigSchema, GoalNotificationEventSchema, GoalNotificationTargetSchema, GoalNotificationsConfigSchema, GoalsConfigSchema, HeartbeatConfigSchema, ImageGenerationCapabilitiesSchema, ImageGenerationModelSchema, ImageGenerationProviderSchema, McpConfigSchema, McpServerSchema, MediaUnderstandingCapabilitiesSchema, MediaUnderstandingModelSchema, MessagesConfigSchema, ModelCatalogConfigSchema, ModelOverrideSchema, ModelsDevConfigSchema, ModelsJsonSchema, OpenAICompatSchema, OpenAICompletionsCompatSchema, OpenAIResponsesCompatSchema, OpenRouterRoutingSchema, ProfileManager, ProviderAuthConfigSchema, ProviderAzureConfigSchema, ProviderConfigSchema, ProviderRequestOverridesSchema, ProvidersConfigSchema, STTConfigSchema, STTFallbackConfigSchema, STTProviderConfigSchema, SearchProviderEntrySchema, SessionConfigSchema, SessionDmScopeSchema, SessionResetByTypeSchema, SessionResetConfigSchema, SessionResetModeSchema, SessionScopeSchema, SessionStorageConfigSchema, TTSConfigSchema, TTSEdgeConfigSchema, TTSFallbackConfigSchema, TTSModelOverridesConfigSchema, TTSProviderConfigSchema, TTSSummarizationConfigSchema, TelegramAccountConfigSchema, TelegramConfigSchema, TelegramGroupConfigSchema, TelegramTopicConfigSchema, ToolsConfigSchema, ToolsMediaAudioConfigSchema, ToolsMediaConfigSchema, TuiConfigSchema, TunnelConfigSchema, TunnelConsentSchema, USER_MEMORY_FILENAME, USER_PROFILE_FILENAME, UpdateAutoConfigSchema, UpdateConfigSchema, VercelGatewayRoutingSchema, VoiceConfigSchema, VoiceRefinementConfigSchema, WORKSPACE_FILES, WebSearchConfigSchema, WebToolsConfigSchema, WebsiteBlocklistSchema, WeixinAccountConfigSchema, WeixinConfigSchema, WorkspaceConfigSchema, WorkspaceImportConfigSchema, XOPC_DB_FILENAME, applyConfigOverrides, buildReloadPlan, canonicalizeConfiguredMcpServer, clearConfigValueCache, createProfile, deleteProfile, diffConfigPaths, existsSync, expandWorkspacePathString, extractProfileAgentId, formatThinkingLevels, getAgentDefaultImageGenerationModelConfig, getAgentDefaultImageModelConfig, getAgentDefaultModelRef, getAllowedCommands, getCacheStats, getConfigOverrides, getCurrentProfile, getDefaultModelValues, resolveModelsJsonPath as getModelsJsonPath, getProfileManager, getProfileNameFromDir, getSwitchCommand, getWorkspacePath, hasBundledExtensionManifest, isKnownCliMcpTypeAlias, listAgentProfileMarkdownDirs, listAgentWorkspaceDirs, listProfiles, listThinkingLevels, loadConfig, loadModelsJson, matchReloadRule, modelsJsonExists, normalizeConfiguredMcpServers, normalizeElevatedMode, normalizeReasoningLevel, normalizeThinkLevel, normalizeVerboseLevel, normalizeWorkspaceDir, parseModelRef, resetConfigOverrides, resolveAgentAuthProfilesPath, resolveAgentDir, resolveAgentDir$1 as resolveAgentDirFromConfig, resolveAgentHomeDir, resolveAgentHomeDir$1 as resolveAgentHomeDirFromConfig, resolveAgentProfileDir, resolveAgentProfileMarkdownPath, resolveAgentWorkspaceDir, resolveAuthProfilesPath, resolveBinDir, resolveBundledExtensionsDir, resolveBundledSkillsDir, resolveConfigPath, resolveConfigValue, resolveCredentialsDir, resolveDefaultAgentWorkspaceDir, resolveEffectiveAgentManifestForAgent, resolveEffectiveAgentManifestForSession, resolveEffectiveAgentProfile, resolveEffectiveAgentProfileForSession, resolveExtensionSdkPath, resolveExtensionsDir, resolveExtensionsLockPath, resolveHeaders, resolveHomeDir, resolveInboxDir, resolveInboxMessagePath, resolveInboxPendingDir, resolveInboxProcessedDir, resolveLogPath, resolveLogsDir, resolveModelsJsonPath, resolveNodeBinDir, resolveNodeBinPath, resolveNodeToolsDir, resolveNpmBinPath, resolveOAuthPath, resolvePidPath, resolveProfileStateDir, resolveSkillPath, resolveSkillsCachePath, resolveSkillsDir, resolveSkillsLockPath, resolveSocketPath, resolveStateDir, resolveStatusPath, resolveToolsDir, resolveUserDir, resolveUserMemoryPath, resolveUserProfilePath, resolveWorkspaceExtensionsDir, resolveWorkspaceFile, resolveWorkspaceRoot, resolveWorkspaceStateDir, resolveWorkspaceStatePath, resolveXopcBinPath, resolveXopcDatabasePath, resolveXopcMcpTransportAlias, saveConfig, saveModelsJson, setConfigOverride, testApiKeyResolution, thinkLevelToNumber, unsetConfigOverride, validateModelsConfig };
|
|
@@ -787,6 +787,13 @@ export declare const GatewayBindModeSchema: z.ZodEnum<{
|
|
|
787
787
|
lan: "lan";
|
|
788
788
|
tailnet: "tailnet";
|
|
789
789
|
}>;
|
|
790
|
+
export declare const GatewayWebchatConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
791
|
+
activityDetailDefault: z.ZodDefault<z.ZodEnum<{
|
|
792
|
+
stream: "stream";
|
|
793
|
+
on: "on";
|
|
794
|
+
off: "off";
|
|
795
|
+
}>>;
|
|
796
|
+
}, z.core.$strip>>;
|
|
790
797
|
export declare const GatewayConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
791
798
|
bind: z.ZodOptional<z.ZodEnum<{
|
|
792
799
|
auto: "auto";
|
|
@@ -872,6 +879,13 @@ export declare const GatewayConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
|
872
879
|
timezone: z.ZodOptional<z.ZodString>;
|
|
873
880
|
}, z.core.$strip>>;
|
|
874
881
|
}, z.core.$strip>>>;
|
|
882
|
+
webchat: z.ZodOptional<z.ZodDefault<z.ZodObject<{
|
|
883
|
+
activityDetailDefault: z.ZodDefault<z.ZodEnum<{
|
|
884
|
+
stream: "stream";
|
|
885
|
+
on: "on";
|
|
886
|
+
off: "off";
|
|
887
|
+
}>>;
|
|
888
|
+
}, z.core.$strip>>>;
|
|
875
889
|
maxSseConnections: z.ZodOptional<z.ZodNumber>;
|
|
876
890
|
corsOrigins: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
877
891
|
publicUrl: z.ZodOptional<z.ZodString>;
|
|
@@ -2053,6 +2067,13 @@ export declare const ConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
|
2053
2067
|
timezone: z.ZodOptional<z.ZodString>;
|
|
2054
2068
|
}, z.core.$strip>>;
|
|
2055
2069
|
}, z.core.$strip>>>;
|
|
2070
|
+
webchat: z.ZodOptional<z.ZodDefault<z.ZodObject<{
|
|
2071
|
+
activityDetailDefault: z.ZodDefault<z.ZodEnum<{
|
|
2072
|
+
stream: "stream";
|
|
2073
|
+
on: "on";
|
|
2074
|
+
off: "off";
|
|
2075
|
+
}>>;
|
|
2076
|
+
}, z.core.$strip>>>;
|
|
2056
2077
|
maxSseConnections: z.ZodOptional<z.ZodNumber>;
|
|
2057
2078
|
corsOrigins: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2058
2079
|
publicUrl: z.ZodOptional<z.ZodString>;
|