vibe-coding-master 0.4.36 → 0.4.37
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/backend/api/gateway-routes.js +3 -0
- package/dist/backend/gateway/gateway-service.js +64 -0
- package/dist-frontend/assets/{index-XvzXPPEy.js → index-BJeQ-5Tw.js} +47 -47
- package/dist-frontend/assets/{index-CuNHDIFw.css → index-Dril-eDD.css} +1 -1
- package/dist-frontend/index.html +2 -2
- package/package.json +1 -1
|
@@ -17,6 +17,9 @@ export function registerGatewayRoutes(app, deps) {
|
|
|
17
17
|
app.post("/api/gateway/lark-registration/check", async () => {
|
|
18
18
|
return deps.gatewayService.checkLarkRegistration();
|
|
19
19
|
});
|
|
20
|
+
app.post("/api/gateway/lark-registration/bind", async (request) => {
|
|
21
|
+
return deps.gatewayService.bindLarkApp(request.body);
|
|
22
|
+
});
|
|
20
23
|
app.post("/api/gateway/binding/reset", async () => {
|
|
21
24
|
return deps.gatewayService.resetBinding();
|
|
22
25
|
});
|
|
@@ -940,6 +940,70 @@ export function createGatewayService(deps) {
|
|
|
940
940
|
gatewayStatus: status
|
|
941
941
|
};
|
|
942
942
|
},
|
|
943
|
+
async bindLarkApp(input) {
|
|
944
|
+
const appId = input.appId.trim();
|
|
945
|
+
const appSecret = input.appSecret.trim();
|
|
946
|
+
const domain = input.larkDomain ?? "lark";
|
|
947
|
+
if (!appId || !appSecret) {
|
|
948
|
+
return {
|
|
949
|
+
status: "failed",
|
|
950
|
+
message: "Lark App ID and App Secret are required."
|
|
951
|
+
};
|
|
952
|
+
}
|
|
953
|
+
await stopPolling();
|
|
954
|
+
const channel = deps.channels.get("lark");
|
|
955
|
+
try {
|
|
956
|
+
await channel.getUpdates({
|
|
957
|
+
account: {
|
|
958
|
+
accountId: null,
|
|
959
|
+
baseUrl: channel.defaultBaseUrl,
|
|
960
|
+
appId,
|
|
961
|
+
appSecret,
|
|
962
|
+
larkDomain: domain
|
|
963
|
+
},
|
|
964
|
+
timeoutMs: 1
|
|
965
|
+
});
|
|
966
|
+
}
|
|
967
|
+
catch (error) {
|
|
968
|
+
return {
|
|
969
|
+
status: "failed",
|
|
970
|
+
message: `Lark App ID/App Secret validation failed. ${errorMessage(error)}`
|
|
971
|
+
};
|
|
972
|
+
}
|
|
973
|
+
const current = await deps.settings.loadSettings();
|
|
974
|
+
const settings = await deps.settings.saveSettings({
|
|
975
|
+
...current,
|
|
976
|
+
channel: "lark",
|
|
977
|
+
binding: {
|
|
978
|
+
...current.binding,
|
|
979
|
+
appId,
|
|
980
|
+
appSecret,
|
|
981
|
+
larkDomain: domain,
|
|
982
|
+
larkOpenId: null,
|
|
983
|
+
larkBotName: null,
|
|
984
|
+
larkBotOpenId: null,
|
|
985
|
+
getUpdatesBuf: ""
|
|
986
|
+
},
|
|
987
|
+
lastPollStatus: {
|
|
988
|
+
state: "idle",
|
|
989
|
+
checkedAt: now()
|
|
990
|
+
},
|
|
991
|
+
updatedAt: now()
|
|
992
|
+
});
|
|
993
|
+
larkRegistrationState = null;
|
|
994
|
+
await ensurePolling();
|
|
995
|
+
const status = deps.settings.expose(settings, isRunning());
|
|
996
|
+
return {
|
|
997
|
+
status: "confirmed",
|
|
998
|
+
appIdConfigured: true,
|
|
999
|
+
appSecretConfigured: true,
|
|
1000
|
+
larkDomain: domain,
|
|
1001
|
+
larkOpenId: null,
|
|
1002
|
+
larkBotName: null,
|
|
1003
|
+
larkBotOpenId: null,
|
|
1004
|
+
gatewayStatus: status
|
|
1005
|
+
};
|
|
1006
|
+
},
|
|
943
1007
|
async handlePmStop(input) {
|
|
944
1008
|
if (input.session.role !== "project-manager") {
|
|
945
1009
|
return;
|