@nextclaw/server 0.10.9 → 0.10.11
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/index.d.ts +23 -1
- package/dist/index.js +33 -0
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -336,6 +336,8 @@ type UiRouterOptions = {
|
|
|
336
336
|
type UiRemoteAccessHost = {
|
|
337
337
|
getStatus: () => Promise<RemoteAccessView> | RemoteAccessView;
|
|
338
338
|
login: (input: RemoteLoginRequest) => Promise<RemoteAccessView>;
|
|
339
|
+
startBrowserAuth: (input: RemoteBrowserAuthStartRequest) => Promise<RemoteBrowserAuthStartResult>;
|
|
340
|
+
pollBrowserAuth: (input: RemoteBrowserAuthPollRequest) => Promise<RemoteBrowserAuthPollResult>;
|
|
339
341
|
logout: () => Promise<RemoteAccessView> | RemoteAccessView;
|
|
340
342
|
updateSettings: (input: RemoteSettingsUpdateRequest) => Promise<RemoteAccessView> | RemoteAccessView;
|
|
341
343
|
runDoctor: () => Promise<RemoteDoctorView>;
|
|
@@ -572,6 +574,26 @@ type RemoteLoginRequest = {
|
|
|
572
574
|
apiBase?: string;
|
|
573
575
|
register?: boolean;
|
|
574
576
|
};
|
|
577
|
+
type RemoteBrowserAuthStartRequest = {
|
|
578
|
+
apiBase?: string;
|
|
579
|
+
};
|
|
580
|
+
type RemoteBrowserAuthStartResult = {
|
|
581
|
+
sessionId: string;
|
|
582
|
+
verificationUri: string;
|
|
583
|
+
expiresAt: string;
|
|
584
|
+
intervalMs: number;
|
|
585
|
+
};
|
|
586
|
+
type RemoteBrowserAuthPollRequest = {
|
|
587
|
+
sessionId: string;
|
|
588
|
+
apiBase?: string;
|
|
589
|
+
};
|
|
590
|
+
type RemoteBrowserAuthPollResult = {
|
|
591
|
+
status: "pending" | "authorized" | "expired";
|
|
592
|
+
message?: string;
|
|
593
|
+
nextPollMs?: number;
|
|
594
|
+
email?: string;
|
|
595
|
+
role?: string;
|
|
596
|
+
};
|
|
575
597
|
type RemoteSettingsUpdateRequest = {
|
|
576
598
|
enabled?: boolean;
|
|
577
599
|
deviceName?: string;
|
|
@@ -1155,4 +1177,4 @@ declare function getUiBridgeSecretPath(): string;
|
|
|
1155
1177
|
declare function readUiBridgeSecret(): string | null;
|
|
1156
1178
|
declare function ensureUiBridgeSecret(): string;
|
|
1157
1179
|
|
|
1158
|
-
export { type AgentBindingView, type AgentProfileView, type ApiError, type ApiResponse, type AppMetaView, type AuthEnabledUpdateRequest, type AuthLoginRequest, type AuthPasswordUpdateRequest, type AuthSetupRequest, type AuthStatusView, type BindingPeerView, type BochaFreshnessValue, type ChannelSpecView, type ChatCapabilitiesView, type ChatCommandOptionView, type ChatCommandView, type ChatCommandsView, type ChatRunListView, type ChatRunState, type ChatRunView, type ChatSessionTypeCtaView, type ChatSessionTypeOptionView, type ChatSessionTypesView, type ChatTurnRequest, type ChatTurnResult, type ChatTurnStopRequest, type ChatTurnStopResult, type ChatTurnStreamEvent, type ChatTurnView, type ConfigActionExecuteRequest, type ConfigActionExecuteResult, type ConfigActionManifest, type ConfigActionType, type ConfigMetaView, type ConfigSchemaResponse, type ConfigUiHint, type ConfigUiHints, type ConfigView, type CronActionResult, type CronEnableRequest, type CronJobStateView, type CronJobView, type CronListView, type CronPayloadView, type CronRunRequest, type CronScheduleView, DEFAULT_SESSION_TYPE, type MarketplaceApiConfig, type MarketplaceInstallKind, type MarketplaceInstallSkillParams, type MarketplaceInstallSpec, type MarketplaceInstalledRecord, type MarketplaceInstalledView, type MarketplaceInstaller, type MarketplaceItemSummary, type MarketplaceItemType, type MarketplaceItemView, type MarketplaceListView, type MarketplaceLocalizedTextMap, type MarketplaceMcpContentView, type MarketplaceMcpDoctorResult, type MarketplaceMcpInstallKind, type MarketplaceMcpInstallRequest, type MarketplaceMcpInstallResult, type MarketplaceMcpInstallSpec, type MarketplaceMcpManageAction, type MarketplaceMcpManageRequest, type MarketplaceMcpManageResult, type MarketplaceMcpTemplateInput, type MarketplacePluginContentView, type MarketplacePluginInstallKind, type MarketplacePluginInstallRequest, type MarketplacePluginInstallResult, type MarketplacePluginManageAction, type MarketplacePluginManageRequest, type MarketplacePluginManageResult, type MarketplaceRecommendationView, type MarketplaceSkillContentView, type MarketplaceSkillInstallKind, type MarketplaceSkillInstallRequest, type MarketplaceSkillInstallResult, type MarketplaceSkillManageAction, type MarketplaceSkillManageRequest, type MarketplaceSkillManageResult, type MarketplaceSort, type ProviderAuthImportResult, type ProviderAuthPollRequest, type ProviderAuthPollResult, type ProviderAuthStartRequest, type ProviderAuthStartResult, type ProviderConfigUpdate, type ProviderConfigView, type ProviderConnectionTestRequest, type ProviderConnectionTestResult, type ProviderCreateRequest, type ProviderCreateResult, type ProviderDeleteResult, type ProviderSpecView, type RemoteAccessView, type RemoteAccountView, type RemoteDoctorCheckView, type RemoteDoctorView, type RemoteLoginRequest, type RemoteRuntimeView, type RemoteServiceAction, type RemoteServiceActionResult, type RemoteServiceView, type RemoteSettingsUpdateRequest, type RemoteSettingsView, type RuntimeConfigUpdate, type SearchConfigUpdate, type SearchConfigView, type SearchProviderConfigView, type SearchProviderName, type SearchProviderSpecView, type SecretProviderEnvView, type SecretProviderExecView, type SecretProviderFileView, type SecretProviderView, type SecretRefView, type SecretSourceView, type SecretsConfigUpdate, type SecretsView, type SessionConfigView, type SessionEntryView, type SessionEventView, type SessionHistoryView, type SessionMessageView, type SessionPatchUpdate, SessionPatchValidationError, type SessionsListView, type UiChatRuntime, type UiNcpAgent, type UiNcpSessionListView, type UiNcpSessionMessagesView, type UiRemoteAccessHost, type UiServerEvent, type UiServerHandle, type UiServerOptions, buildConfigMeta, buildConfigSchemaView, buildConfigView, createCustomProvider, createUiRouter, deleteCustomProvider, deleteSession, ensureUiBridgeSecret, executeConfigAction, getSessionHistory, getUiBridgeSecretPath, listSessions, loadConfigOrDefault, patchSession, readUiBridgeSecret, startUiServer, testProviderConnection, updateChannel, updateModel, updateProvider, updateRuntime, updateSearch, updateSecrets };
|
|
1180
|
+
export { type AgentBindingView, type AgentProfileView, type ApiError, type ApiResponse, type AppMetaView, type AuthEnabledUpdateRequest, type AuthLoginRequest, type AuthPasswordUpdateRequest, type AuthSetupRequest, type AuthStatusView, type BindingPeerView, type BochaFreshnessValue, type ChannelSpecView, type ChatCapabilitiesView, type ChatCommandOptionView, type ChatCommandView, type ChatCommandsView, type ChatRunListView, type ChatRunState, type ChatRunView, type ChatSessionTypeCtaView, type ChatSessionTypeOptionView, type ChatSessionTypesView, type ChatTurnRequest, type ChatTurnResult, type ChatTurnStopRequest, type ChatTurnStopResult, type ChatTurnStreamEvent, type ChatTurnView, type ConfigActionExecuteRequest, type ConfigActionExecuteResult, type ConfigActionManifest, type ConfigActionType, type ConfigMetaView, type ConfigSchemaResponse, type ConfigUiHint, type ConfigUiHints, type ConfigView, type CronActionResult, type CronEnableRequest, type CronJobStateView, type CronJobView, type CronListView, type CronPayloadView, type CronRunRequest, type CronScheduleView, DEFAULT_SESSION_TYPE, type MarketplaceApiConfig, type MarketplaceInstallKind, type MarketplaceInstallSkillParams, type MarketplaceInstallSpec, type MarketplaceInstalledRecord, type MarketplaceInstalledView, type MarketplaceInstaller, type MarketplaceItemSummary, type MarketplaceItemType, type MarketplaceItemView, type MarketplaceListView, type MarketplaceLocalizedTextMap, type MarketplaceMcpContentView, type MarketplaceMcpDoctorResult, type MarketplaceMcpInstallKind, type MarketplaceMcpInstallRequest, type MarketplaceMcpInstallResult, type MarketplaceMcpInstallSpec, type MarketplaceMcpManageAction, type MarketplaceMcpManageRequest, type MarketplaceMcpManageResult, type MarketplaceMcpTemplateInput, type MarketplacePluginContentView, type MarketplacePluginInstallKind, type MarketplacePluginInstallRequest, type MarketplacePluginInstallResult, type MarketplacePluginManageAction, type MarketplacePluginManageRequest, type MarketplacePluginManageResult, type MarketplaceRecommendationView, type MarketplaceSkillContentView, type MarketplaceSkillInstallKind, type MarketplaceSkillInstallRequest, type MarketplaceSkillInstallResult, type MarketplaceSkillManageAction, type MarketplaceSkillManageRequest, type MarketplaceSkillManageResult, type MarketplaceSort, type ProviderAuthImportResult, type ProviderAuthPollRequest, type ProviderAuthPollResult, type ProviderAuthStartRequest, type ProviderAuthStartResult, type ProviderConfigUpdate, type ProviderConfigView, type ProviderConnectionTestRequest, type ProviderConnectionTestResult, type ProviderCreateRequest, type ProviderCreateResult, type ProviderDeleteResult, type ProviderSpecView, type RemoteAccessView, type RemoteAccountView, type RemoteBrowserAuthPollRequest, type RemoteBrowserAuthPollResult, type RemoteBrowserAuthStartRequest, type RemoteBrowserAuthStartResult, type RemoteDoctorCheckView, type RemoteDoctorView, type RemoteLoginRequest, type RemoteRuntimeView, type RemoteServiceAction, type RemoteServiceActionResult, type RemoteServiceView, type RemoteSettingsUpdateRequest, type RemoteSettingsView, type RuntimeConfigUpdate, type SearchConfigUpdate, type SearchConfigView, type SearchProviderConfigView, type SearchProviderName, type SearchProviderSpecView, type SecretProviderEnvView, type SecretProviderExecView, type SecretProviderFileView, type SecretProviderView, type SecretRefView, type SecretSourceView, type SecretsConfigUpdate, type SecretsView, type SessionConfigView, type SessionEntryView, type SessionEventView, type SessionHistoryView, type SessionMessageView, type SessionPatchUpdate, SessionPatchValidationError, type SessionsListView, type UiChatRuntime, type UiNcpAgent, type UiNcpSessionListView, type UiNcpSessionMessagesView, type UiRemoteAccessHost, type UiServerEvent, type UiServerHandle, type UiServerOptions, buildConfigMeta, buildConfigSchemaView, buildConfigView, createCustomProvider, createUiRouter, deleteCustomProvider, deleteSession, ensureUiBridgeSecret, executeConfigAction, getSessionHistory, getUiBridgeSecretPath, listSessions, loadConfigOrDefault, patchSession, readUiBridgeSecret, startUiServer, testProviderConnection, updateChannel, updateModel, updateProvider, updateRuntime, updateSearch, updateSecrets };
|
package/dist/index.js
CHANGED
|
@@ -4894,6 +4894,37 @@ var RemoteRoutesController = class {
|
|
|
4894
4894
|
return c.json(err("REMOTE_LOGIN_FAILED", formatUserFacingError(error)), 400);
|
|
4895
4895
|
}
|
|
4896
4896
|
};
|
|
4897
|
+
startBrowserAuth = async (c) => {
|
|
4898
|
+
const body = await readJson(c.req.raw);
|
|
4899
|
+
if (!body.ok) {
|
|
4900
|
+
return c.json(err("INVALID_BODY", "invalid json body"), 400);
|
|
4901
|
+
}
|
|
4902
|
+
try {
|
|
4903
|
+
return c.json(ok(await this.host.startBrowserAuth({
|
|
4904
|
+
apiBase: readTrimmedString(body.data.apiBase)
|
|
4905
|
+
})));
|
|
4906
|
+
} catch (error) {
|
|
4907
|
+
return c.json(err("REMOTE_BROWSER_AUTH_START_FAILED", formatUserFacingError(error)), 400);
|
|
4908
|
+
}
|
|
4909
|
+
};
|
|
4910
|
+
pollBrowserAuth = async (c) => {
|
|
4911
|
+
const body = await readJson(c.req.raw);
|
|
4912
|
+
if (!body.ok) {
|
|
4913
|
+
return c.json(err("INVALID_BODY", "invalid json body"), 400);
|
|
4914
|
+
}
|
|
4915
|
+
const sessionId = readNonEmptyString(body.data.sessionId);
|
|
4916
|
+
if (!sessionId) {
|
|
4917
|
+
return c.json(err("INVALID_BODY", "sessionId is required"), 400);
|
|
4918
|
+
}
|
|
4919
|
+
try {
|
|
4920
|
+
return c.json(ok(await this.host.pollBrowserAuth({
|
|
4921
|
+
sessionId,
|
|
4922
|
+
apiBase: readTrimmedString(body.data.apiBase)
|
|
4923
|
+
})));
|
|
4924
|
+
} catch (error) {
|
|
4925
|
+
return c.json(err("REMOTE_BROWSER_AUTH_POLL_FAILED", formatUserFacingError(error)), 400);
|
|
4926
|
+
}
|
|
4927
|
+
};
|
|
4897
4928
|
logout = async (c) => {
|
|
4898
4929
|
try {
|
|
4899
4930
|
return c.json(ok(await this.host.logout()));
|
|
@@ -5072,6 +5103,8 @@ function registerRemoteRoutes(app, remoteController) {
|
|
|
5072
5103
|
app.get("/api/remote/status", remoteController.getStatus);
|
|
5073
5104
|
app.get("/api/remote/doctor", remoteController.getDoctor);
|
|
5074
5105
|
app.post("/api/remote/login", remoteController.login);
|
|
5106
|
+
app.post("/api/remote/auth/start", remoteController.startBrowserAuth);
|
|
5107
|
+
app.post("/api/remote/auth/poll", remoteController.pollBrowserAuth);
|
|
5075
5108
|
app.post("/api/remote/logout", remoteController.logout);
|
|
5076
5109
|
app.put("/api/remote/settings", remoteController.updateSettings);
|
|
5077
5110
|
app.post("/api/remote/service/:action", remoteController.controlService);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nextclaw/server",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.11",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Nextclaw UI/API server.",
|
|
6
6
|
"type": "module",
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
"@hono/node-server": "^1.13.3",
|
|
19
19
|
"hono": "^4.6.2",
|
|
20
20
|
"ws": "^8.18.0",
|
|
21
|
-
"@nextclaw/openclaw-compat": "0.3.8",
|
|
22
21
|
"@nextclaw/ncp": "0.3.1",
|
|
23
|
-
"@nextclaw/
|
|
22
|
+
"@nextclaw/mcp": "0.1.11",
|
|
23
|
+
"@nextclaw/openclaw-compat": "0.3.8",
|
|
24
24
|
"@nextclaw/runtime": "0.2.5",
|
|
25
|
-
"@nextclaw/
|
|
25
|
+
"@nextclaw/ncp-http-agent-server": "0.3.1",
|
|
26
26
|
"@nextclaw/core": "0.9.5"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|